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
5: Body mass index(BMI) is calculated as follows: bmi = weight in Kg / (height x height) in m2. Write a function which calculates bmi. BMI is used to broadly define different weight groups in adults 20 years old or older.Check if a person is underweight, normal, overweight or obese based the information given below.
function bmi(kg, m) { let indexBmi = kg / Math.pow(m, 2); if (indexBmi >= 30) { return console.log("Obese"); } else if (indexBmi >= 25) { return console.log("Overweight"); } else if (indexBmi >= 18.5) { return console.log("Normal weight"); } else { return console.log("Underweight"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bmi(weight, height) { // the parameters are height and weight\n var bodyMass = weight / (height * height); // i declared the variable to bodyMass to calculate the bodymass but instead of exponent 2 since it wasnt working i did height times itself\n if (bodyMass <= 18.5) return \"Underweight\"\n if (bodyMass <= 25.0) return \"Normal\"\n if (bodyMass <= 30.0) return \"Overweight\"\n if (bodyMass > 30.0) return \"Obese\"\n}", "function bodyMassIndexCalculator(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else if(bmi < 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are underweight.\");\n\t\t}\n\telse if(bmi < 24.9 && bmi > 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are a normal weight.\");\n\t\t}\t\n\telse if(bmi > 24.9) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are overweight.\");\n\t\t}\n}", "function bodyMassIndex(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \".\");\n\t\t}\t\n}", "function calcBMI ( mass,height ) {\n return mass / (height * height)\n}", "function calculateBMI() {\n var weight = userInfo[\"weight\"];\n var height = userInfo[\"height\"];\n var BMI = weight / Math.pow(height, 2);\n return BMI;\n}", "function calcBMI(height, weight)\n{\n\treturn Math.round((weight)/(height * height) * 10) / 10;\n}", "function calculateBMI(mass,height)\r\n{\r\n let BMI=( mass/(height*height));\r\n return BMI\r\n}", "function calculateBMI(weight, height) {\n\tvar bmi=weight/(height*height)\n\tconsole.log(\"Your BMI: \"+bmi)\n}", "function bmiCalculator(height,weight){\n return(Math.round(weight/(height**2)));\n }", "function bmi(weight, height) {\n\n const bmi = weight / (height**2);\n\n if(bmi <= 18.5) return \"Underweight\";\n if(bmi <= 25.0) return \"Normal\";\n if(bmi <= 30.0) return \"Overweight\";\n\n return \"Obese\";\n\n}", "function BMI(mass, height) {\n return mass /(height*height);\n}", "function bmiCalculator(weight, height){\r\n var bmi = weight/math.pow(height, 2);\r\n return bmi;\r\n}", "function bmiCalculator(weight, height) {\n var bmi = Math.floor(weight / (height * height));\n return bmi;\n}", "function bmiCalc(weight, height) {\n var bmi = weight / Math.pow(height, 2);\n return Math.round(bmi);\n}", "function calcBMI(weight, height, formula) {\n return formula(weight, height);}", "function calculateBMI(){\r\n const heightToMeters = inputHeight.value / 100;\r\n const heightExponent = Math.pow (heightToMeters, 2)\r\n const calculateBMI = inputWeight.value / heightExponent;\r\n const roundBMI = Math.round(calculateBMI * 10) / 10;\r\n return roundBMI;\r\n}", "function bmiCaluculator(weight, height) {\n let bmi = weight/(height*height);\n return Math.round(bmi) ;\n}", "calculeBMI() {\n this.BMI = this.WeightKg / Math.pow(this.convertHeightToMeters(this.HeightCm), 2);\n }", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "bmi(height, weight) {\n if (height > 0 && weight > 0) {\n var bmi = 10000 * (weight / ((height) * (height)));\n bmi = Math.round(bmi * 100) / 100\n this.setState({ bmi: bmi })\n }\n }", "function bmiCalculator(weight, height) {\r\n var bmi = Math.round(weight / (height * height));\r\n var interpretation;\r\n\r\n if (bmi < 18.5) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are underweight.\"\r\n } else if (bmi >= 18.5 && bmi < 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you have a normal weight.\"\r\n } else if (bmi >= 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are overweight.\"\r\n }\r\n\r\n return interpretation;\r\n}", "function interpretBMI(bmi){\n\tif (bmi < 18.5)\n\t{\n\t\treturn \"Underweight\";\n\t}\n\telse if (bmi >= 18.5 && bmi <= 24.9)\n\t{\n\t\treturn \"Normal Weight\";\n\t}\n\telse if (bmi >= 25 && bmi <= 29.9)\n\t{\n\t\treturn \"Overweight\";\n\t}\n\telse if (bmi >= 30 && bmi <= 34.9)\n\t{\n\t\treturn \"Obese\";\n\t}\n\telse if (bmi >= 35 && bmi <= 39.9)\n\t{\n\t\treturn \"Severe Obesity\";\n\t}\n\telse if (bmi >= 40 && bmi <= 44.9)\n\t{\n\t\treturn \"Morbid Obesity\";\n\t}\n\telse if (bmi >= 45)\n\t{\n\t\treturn \"Super Obesity\";\n\t}\n\telse \n\t{\n\t\treturn \"I am error\";\n\t}\n}", "function calculateBMI(inputHeight, inputWeight, type, scale) {\r\n var weight = inputWeight;\r\n var height = inputHeight;\r\n // if lb and pound so multiply 703, if kgs and meters so just calculate normally\r\n if (type === 0) weight = weight * 704;\r\n var result = weight / Math.pow(height, 2);\r\n var roundScale = scale ? scale : DEFAULT_SCALE;\r\n return Math.round(result * roundScale) / roundScale; // beautify result.\r\n}", "function bmiCalculator (weight, height) {\n var message = \"\";\n var bmi = Math.round(weight /(Math.pow(height,2)));\n if (bmi < 18.5) {\n message = \"Your BMI is \"+bmi+\", so you are underweight.\";\n }\n if (bmi >= 18.5 && bmi <24.9) {\n message = \"Your BMI is \"+bmi+\", so you have a normal weight.\";\n }\n if (bmi > 24.9) {\n message = \"Your BMI is \"+bmi+\", so you are overweight.\";\n }\n return message;\n}", "function bmi(name, weight, height) {\n \n// This is calculating the bmi and storing it into a variable. This is the set standard formula; it cannot be changed.\n var bmiResult = (weight / (height * height)) * 703;\n \n//These are the weight classification for bmi. Depending on the user's bmi, the corresponding message will be sent to the console and alerted to the user.\n if (bmiResult > 29.99) {\n console.log(\"The user is considered obese.\");\n alert(name + \", you are considered obese. \\n\\nYou should consult with your physician on a diet and exercise plan.\");\n } else if (bmiResult > 24.99) {\n console.log(\"The user is considered overweight.\");\n alert(name + \", you are considered overweight. \\n\\nYou should work on losing a few pounds.\");\n } else if (bmiResult > 18.49) {\n console.log(\"The user is considered at a normal weight.\");\n alert(name + \", you are considered normal weight. \\n\\nYou should continue to maintain your weight.\");\n } else {\n console.log(\"The user is considered underweight.\");\n alert(name + \", you are considered underweight. \\n\\nYou should probably bulk up a few pounds.\");\n }\n \n//This is returning the bmiResult outside of the function.\n return bmiResult;\n \n}", "function calcBMR(gender,feet,inches,weight,age,callback){\n var bmi = 0;\n if(gender===\"female\"){\n bmi = Math.floor(655+(4.7*callback(feet,inches))+(4.35*weight)-(4.7*age));\n }\n else{\n bmi = Math.floor(66+(12.7*callback(feet,inches))+(6.23*weight)-(6.8*age));\n }\n return bmi;\n }", "function interpretBMI(age, z_bmi){\n\n if (age > 1857) { //above 5 years old\n return z_bmi > 2 ? \"Obese\" : z_bmi > 1 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age > 730 && age < 1858){ //ages 2 - 5\n return z_bmi > 3 ? \"Obese\" : z_bmi > 1.35 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age < 731){\n return \"Not for age < 2\"\n }\n \n }", "function bmiCalculator (weight, height) {\r\n var bmi = weight/(height * height);\r\n var interpretation = \"\";\r\n\r\n if(bmi < 18.5){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are underweight.\");\r\n }\r\n if(bmi >= 18.5 && bmi <= 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you have a normal weight.\");\r\n }\r\n if(bmi > 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are overweight.\");\r\n }\r\n return interpretation;\r\n}", "function determineWeightStatus(BMI){\n if (BMI < 18.5){\n return \"Underweight\";\n } else if (BMI < 25) {\n return \"Healthy Weight\";\n } else if (BMI < 30) {\n return \"Overweight\";\n } else {\n return \"Obese\";\n }\n}", "function bmiCalculator(weight, height){\r\nvar bmi = weight / Math.pow(height, 2);\r\nreturn Math.round(bmi);\r\nconsole.log(`${bmi} is Calculator`);\r\n}", "getBMI(weightInKg, heightInCm) {\n const heightInM = heightInCm/100\n const bmi = weightInKg/Math.pow(heightInM, 2)\n return parseFloat(bmi.toFixed(1))\n }", "function calculateBMIUsingImperial(w, h) {\n return w/h**2*703;\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height);\n console.log(bmi);\n switch (true) {\n case bmi < 15:\n console.log(\"Anorexic\");\n break;\n case bmi < 17.5 && bmi > 15:\n console.log(\"Starvation\");\n break;\n case bmi > 18.5 && bmi < 25:\n console.log(\"Ideal\");\n break;\n case bmi > 25 && bmi < 30:\n console.log(\"Overweight\");\n break;\n case bmi > 30 && bmi < 40:\n console.log(\"Obese\");\n break;\n case bmi > 40:\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "function calculateBmi() {\n\n let weight = document.getElementById(\"weight_input\").value;\n let height = document.getElementById(\"height_input\").value;\n bmi = weight / (height / 100) ** 2\n\n //if any input is empty, give message that you have to fill inn all of the inputs.\n if (weight == \"\" || height == \"\") {\n document.getElementById(\"bmi_output\").innerHTML = \"Please fill all of the inputs\";\n document.getElementById(\"bmi_output_def\").innerHTML = \"\";\n }\n //if all inputs is filled, run this else that runs some if statements, dependent on the bmi.\n else {\n document.getElementById(\"bmi_output\").innerHTML = \"Your BMI is: \" + parseFloat(bmi).toFixed(2);\n\n if (bmi < 18.4) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Underweight\";\n }\n else if (bmi < 24.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Normalweight\";\n }\n else if (bmi < 29.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Overweight\";\n }\n //a bmi over 100 doesn't make any sense.\n else if (bmi > 100) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That can't be right, try again\";\n }\n else {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Obese\";\n }\n }\n}", "function BMIcalculate()\n{\n //Getting the user input for weight //\n var weightofuser = document.getElementById(\"weight\").value;\n //Getting the user input for height //\n var heightofuser = document.getElementById(\"height\").value;\n \n// Calculating the BMI of user //\n \n var BMI = (weightofuser / (heightofuser*heightofuser));\n \n// If statement for BMI Under 18.5 ///\n if ( BMI > 0 && BMI < 18.5)\n {\n // Displaying the result for Underweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Underweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI between 18.5 & including 24.9 //\n else if ( BMI >= 18.5 && BMI <= 24.9)\n {\n // Displaying the result for Normal //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Normal.\"+\"</li>\";\n \n }\n\n// If statement for BMI between 25 & including 29.9 //\n else if ( BMI >= 25 && BMI <= 29.9)\n {\n // Displaying the result for Overweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Overweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI over 30 //\n else \n {\n // Displaying the result for Obese //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Obese.\"+\"</li>\";\n \n } \n \n}", "function BMICalculator(height, weight) {\n // Convert height from cm to m\n height = height/100;\n\n return (weight/(height * height)).toFixed(1);\n}", "function determineBMICategory(bmi) {\n let category = \"\";\n if (bmi < 18.4) category = \"Underweight\";\n else if (bmi >= 18.5 && bmi < 25) category = \"Normal weight\";\n else if (bmi >= 25 && bmi < 30) category = \"Overweight\";\n else if (bmi >= 30 && bmi < 35) category = \"Moderately obese\";\n else if (bmi >= 35 && bmi < 40) category = \"Severely obese\";\n else if (bmi >= 40) category = \"Very severely obese\";\n return category;\n}", "function computeBMI() {\r\n clearAll(true);\r\n\r\n // obtain user inputs\r\n var height = Number(document.getElementById(\"height\").value);\r\n var weight = Number(document.getElementById(\"weight\").value);\r\n var unittype = document.getElementById(\"unittype\").selectedIndex;\r\n\r\n if (height === 0 || isNaN(height) || weight === 0 || isNaN(weight)) {\r\n setAlertVisible(\"error-bmi-output\", ERROR_CLASS, true);\r\n document.getElementById(\"error-bmi-output\").innerHTML = errorString;\r\n } else { // convert\r\n // Perform calculation\r\n var BMI = calculateBMI(height, weight, unittype);\r\n\r\n // Display result of calculation\r\n var result = \" Your BMI index are <strong>\" + BMI + \"</strong>.\";\r\n var warning = true;\r\n if (BMI < BMI_LOWINDEX)\r\n result = \"<strong>Underweight!!</strong>\" + result + \" C'mon, McDonald is near by then.\";\r\n else if (BMI >= BMI_LOWINDEX && BMI <= BMI_HIGHINDEX) {\r\n warning = false;\r\n result = \"<strong>Normal!</strong>\" + result + \" Good exercises!\";\r\n }\r\n else // BMI > 25\r\n result = \"<strong>Overweight!!!</strong>\" + result + \" Recreation center welcome you !!\";\r\n\r\n // if we need to show warning so we show alert with warning, otherwise we show success message.\r\n if (warning) {\r\n setAlertVisible(\"warning-bmi-output\", WARNING_CLASS, true);\r\n document.getElementById(\"warning-bmi-output\").innerHTML = result;\r\n } else {\r\n setAlertVisible(\"normal-bmi-output\", SUCCESS_CLASS, true);\r\n document.getElementById(\"normal-bmi-output\").innerHTML = result;\r\n }\r\n }\r\n}", "getBMIRatio() {\n const htInMeter = this.height / 100; // converts height to meter\n console.log(htInMeter);\n return this.weight / (htInMeter * htInMeter);\n }", "function calculateBMIUsingSI(w, h) {\n return w/h**2;\n}", "calculateBMI(request, response){\n \n const loggedInMember = accounts.getCurrentMember(request);\n \n const latestBmi = 0;\n \n latestBmi = (loggedInMember.startWeight / (loggedInMember.height * loggedInMember.height))\n \n /*\n \n calculateBmi(id){\n \n const loggedInMember = accounts.getCurrentMember(id);\n const assessments = assessmentStore.getAssessment(id);\n const latestBmi = 0;\n \n if(assessments.length == 0){\n latestBmi = (loggedInMember.startWeight / (loggesInMember.height * loggesInMember.height))\n }\n else{\n assessments = assessments.lenght - 1;\n latestBmi = (assessments.weight / (assessments.height * assessments.height))\n }\n \n }\n \n */\n return latestBmi;\n }", "function determineBMIHealthRisk(bmi) {\n try {\n let risk = \"\";\n if (bmi < 18.4) risk = \"Malnutrition risk\";\n else if (bmi >= 18.5 && bmi < 25) risk = \"Low risk\";\n else if (bmi >= 25 && bmi < 30) risk = \"Enhanced risk\";\n else if (bmi >= 30 && bmi < 35) risk = \"Medium risk\";\n else if (bmi >= 35 && bmi < 40) risk = \"High risk\";\n else if (bmi >= 40) risk = \"Very high risk\";\n return risk;\n } catch (error) {\n Exception.error(\"Error determining BMI.\", error, \"BMIException\");\n }\n}", "function calculateBmr(nutritionProfile){\n var age = nutritionProfile.age;\n var weightInLbs = nutritionProfile.weight; //TODO get most recent weight instead of static one\n var heightFeet = nutritionProfile.heightFeet;\n var heightInches = nutritionProfile.heightInches;\n var totalHeight = (heightFeet * 12) + heightInches;\n var gender = nutritionProfile.sex;\n\n //convert weight from lbs to kg:\n // kg = (weight in lbs) * .454\n var weightInKg = weightInLbs * .454;\n\n //convert height from inches to cms\n //height in cms = (height in inches * 2.54)\n var heightInCms = totalHeight * 2.54;\n\n var bmr = 0;\n\n //BMR for Men = 66.47 + (13.75 x weight in kg.) + (5 x height in cm) - (6.75 x age in years)\n if(gender == \"Male\"){\n bmr = 66.47 + (13.75 * weightInKg) + (5 * heightInCms) - (6.75 * age);\n }\n //BMR for Women = 655 + (9.6 x weight in kg.) + (1.8 x height in cm) - (4.7 x age in years).\n else{\n bmr = 655.09 + (9.56 * weightInKg) + (1.84 * heightInCms) - (4.67 * age);\n }\n\n return bmr;\n }", "function bmi(weight, height) {\n var bmi = weight / (height * height)\n console.log(bmi)\n switch (true) {\n case (bmi < 15):\n console.log(\"Anorexic\");\n break;\n case (bmi < 17.5 && bmi > 15):\n console.log(\"Starvation\");\n break;\n case (bmi > 18.5 && bmi < 25):\n console.log(\"Ideal\");\n break;\n case (bmi > 25 && bmi < 30):\n console.log(\"Overweight\");\n break;\n case (bmi > 30 && bmi < 40):\n console.log(\"Obese\");\n break;\n case (bmi > 40):\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "getBMInfo() {\n if (this.getBMIRatio() >= 25) {\n return \"Overweight\";\n } else if(this.getBMIRatio() > 18.5){\n return \"Healthy\";\n }else{\n return \"Underweight\";\n }\n }", "function bmi() {\n var c = document.getElementById(\"mass\").value;\n return (c/exponentHeight()+\"kg/m^2\");\n}", "get getBMI() {\n return this.BMI.toFixed(2);\n }", "function Person(fullName, mass, height) {\r\n this.fullName = fullName;\r\n this.mass = mass;\r\n this.height = height;\r\n this.calcBMI = function() {\r\n this.bmi = Number(this.mass / this.height ** 2).toFixed(2);\r\n return this.bmi;\r\n };\r\n}", "function bmiCalc() {\n //prompt whether user wants to use the imperial or metric system\n var type = parseInt(prompt(\"please chose your operation \\n\" + \"1 - Imperial (lb)\\n\" +\" 2 - Metric (kg)\"));\n // conditional if the type is imperial\n var weight, height, value_array;\n if (type == 1) {\n value_array = prompt_for_values(2,\"please enter your weight(lb)\",\"please enter your height(in)\");\n weight = value_array[0];\n height = value_array[1];\n // we carry out the imperial formula for BMI calculation\n return alert(\"Your BMI is :\" + (weight / Math.pow(height,2) * 703).toFixed(2));\n // conditional if the type is metric\n }else if(type == 2 ){\n value_array = prompt_for_values(2,\"please enter your weight(kg)\",\"please enter your height(m)\");\n weight = value_array[0];\n height = value_array[1];\n //we carry our the metric formula\n return alert(\"Your BMI is : \" + (weight / Math.pow(height,2).toFixed(2)).toFixed(2));\n }\n}", "function getFatMass() {\n var fm;\n if (isMale()) {\n fm = 0.988 * getBMI() + 0.242 * w + 0.094 * a - 30.18;\n } else {\n fm = 0.988 * getBMI() + 0.344 * w + 0.094 * a - 30.18;\n }\n return fm;\n }", "determineBMICategory(latestBmi){\n\n if(latestBmi < 16 ){\n return \"SEVERELY UNDERWEIGHT\";\n }\n else if(latestBmi >= 16 && latestBmi < 18.5){\n return \"UNDERWEIGHT\";\n }\n else if(latestBmi >= 18.5 && latestBmi < 25) {\n return \"NORMAL\";\n }\n else if(latestBmi >= 25 && latestBmi < 30) {\n return \"OVERWEIGHT\";\n }\n else if(latestBmi >= 30 && latestBmi < 35) {\n return \"MODERATELY OBESE\";\n }\n else if(latestBmi >= 35) {\n return \"SEVERELY OBESE\";\n }\n\n return \"No value for BMI\";\n }", "constructor(weightInKg, heightInCm) {\n this.bmi = this.getBMI(weightInKg, heightInCm)\n this.label = this.getLabelFromBMI()\n }", "function calculateBMR() {\n\n // Sedentary (little or no exercise): BMR x 1.2\n // Lightly active (light exercise/sports 1-3 days/week): BMR x 1.375\n // Moderately active (moderate exercise/sports 3-5 days/week): BMR x 1.55\n // Very active (hard exercise/sports 6-7 days a week): BMR x 1.725\n // Extra active (very hard exercise/sports & physical job or 2x training): BMR x 1.9 \n\n // you can simply add 0.175 to each level to get the next. but if we set this up in the database instead\n // of the actual varchar value of the level we can quickly calculate the BMR\n\n return calculateBEE() * activityLevel;\n}", "getLabelFromBMI() {\n let label = ''\n\n if (this.bmi >= 25) {\n label = 'overweight'\n } else if (this.bmi >= 18.5 && this.bmi < 25) {\n label = 'normal'\n } else {\n label = 'underweight'\n }\n\n return label\n }", "function hungryDog(weight, age) {\n \n if(age >= 1 && weight <= 5) {\n return weight * 0.05\n }else if(age >= 1 && weight <= 6 && weight <= 10) {\n return weight * 0.04\n }else if(age >= 1 && weight <= 11 && weight <= 15) {\n return weight * 0.03\n }else if(age >= 1 && weight <15) {\n return weight * 0.02\n }else if(age < .75 && age >= 0.583) {\n return weight * 0.\n }else if(age < .5 && age >= 0.333) {\n return weight * 0.05\n }else if(age < .33 && age >= 0.333) {\n return weight * 0.05\n }\n \n }", "function bmi(hoejde, vaegt) {\n dinBmi = Math.floor((vaegt / (hoejde * hoejde)));\n console.log(\"her er din BMI: \" + dinBmi)\n //document.write(\"her er din BMI: \" + dinBmi);\n document.getElementById('content').innerHTML = '<h2>Her er din BMI: ' +\n dinBmi +\n '</h2>';\n document.getElementById(\"content\").style.backgroundColor = 'blue';\n}", "function calculateBEE() {\n BEE = 0;\n if (gender == 'Female') { //case sensitive\n return BEE = (655 + (4.35 * weight) + (4.7 * height) - (4.7 * age));\n\n }\n else if (gender == 'Male') {//case sensitive\n return BEE = (66 + (6.23 * weight) + (12.7 * height) - (6.8 * age));\n //This is why we can not account for 'other'\n }\n}", "function calculateMolecularWeight(structureData) {\n return casual.integer(0,500);\n}", "function handleUpdateToBmi() {\n let newBMI = weight / (height * height) + ''\n if ((/[.]/).test(newBMI)) {\n try {\n newBMI = newBMI.slice(0, (newBMI.indexOf('.') + 2))\n }catch{\n console.log(\"unable to cut string\")\n }\n }\n updateBmi(newBMI)\n }", "function dogFeeder (age, weight) {\n if (age >= 1) {\n if (weight <= 5) {\n return weight * 0.05;\n } else if (weight >= 6 && weight <= 10) {\n return weight * 0.04;\n } else if (weight >= 11 && weight <= 15) {\n return weight * 0.03;\n } else if (weight > 15) {\n return weight * 0.02;\n }\n } else if (age >= 0.1667 && age < 0.25) {\n return weight * 0.10;\n } else if (age >= 0.25 && age < 0.5833) {\n return weight * 0.05;\n } else if (age >= 0.5833 && age < 1) {\n return weight * 0.04;\n }\n}", "function beeStings(weight){\n //# of bee stings = victim's weight/stingsPerPound\n var numOfStings = weight/stingsPerPound;\n //returns number of stings it takes to kill animal\n return numOfStings;\n}", "function getKnockdownChanceBody(weaponWeight, rawDamage)\n{\n\tvar weightScale = Math.min(weaponWeight * 0.33, 2.0);\n\tvar damageScale = Math.min((rawDamage - 40.0) * 0.2, 5.0);\n\tvar kdChance = Math.max(0, Math.round(((weightScale * damageScale * 0.015) - 0.05) * 10000) / 100);\n\t\n\treturn kdChance;\n}", "function findAgeLevel() {\n let weight = document.getElementById(\"weight\").value;\n weightInt = parseFloat(weight);\n let heightFeet = document.getElementById(\"heightFeet\").value;\n let heightInches = document.getElementById(\"heightInches\").value;\n\n var heightFeetInt = parseInt(heightFeet);\n var heightInchesInt = parseInt(heightInches);\n\n var TotalHeight = heightFeetInt * 12 + heightInchesInt;\n var ageLevel;\n\n if (weightInt < 120 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt < 120 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt < 120 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt >= 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Senior\";\n } else {\n ageLevel = \"Senior\";\n }\n\n return ageLevel;\n}", "getWeight(b) {\nreturn this.weight[b];\n}", "function getBodyweight() {\n\t\t\t\tbodyweight.getBodyweight().then(function(result) {\n\t\t\t\t\tvm.exerciseBodyweight = result;\n\t\t\t\t\tconsole.log(vm.exerciseBodyweight);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "function calculateHealth() {\r\n let heightType = document.querySelector(\"input[name='heightType']:checked\").value;\r\n let calculateItemChecked = document.querySelector(\"input[name='calculate']:checked\").value;\r\n let age = Number(inputAge.value);\r\n let weight = Number(inputWeight.value);\r\n let gender = document.querySelector(\"input[name='gender']:checked\").value;\r\n let physicalState = document.getElementById('physicalState').value;\r\n let height;\r\n //Convert Inches to centimeter for get the height in cm scale \r\n if (heightType === \"centimeter\") {\r\n let centimeter = Number(inputCentimeter.value);\r\n height = centimeter;\r\n } else {\r\n console.log(\"You used inch section\");\r\n let foot = Number(inputFoot.value);\r\n let inches = Number(inputInch.value);\r\n let totalInches = Number((foot * 12) + inches);\r\n let convertToCentimeter = Number(totalInches * 2.54);\r\n console.log(foot, inches, totalInches, convertToCentimeter);\r\n height = convertToCentimeter;\r\n }\r\n\r\n console.log(`Height ${height}, Weight ${weight}, Age ${age}, gender ${gender}, physical state ${physicalState}`);\r\n //TODO: Add a verification for calculation\r\n\r\n if (age == 0 || height == null || height === undefined || weight == 0 || physicalState === \"none\") {\r\n errorAlert.style.display = \"block\";\r\n successAlert.style.display = \"none\";\r\n result.innerHTML = `\r\n <div class=\"d-flex align-items-center\">\r\n <strong>Loading...</strong>\r\n <div class=\"spinner-border ml-auto\" role=\"status\" aria-hidden=\"true\"></div>\r\n </div>`\r\n setTimeout(() => {\r\n result.innerHTML = `\r\n <h5 class=\"alert alert-danger d-block font-weight-bolder text-center\">404 Error <i class=\"fa fa-exclamation-circle\"></i> <br> No values has been given</h5>`\r\n }, 5000);\r\n }\r\n //! When all values is correct\r\n else {\r\n // !Calculate BMR (Heris BeneDict law)\r\n //According to gender\r\n let BMR;\r\n let calories;\r\n let kilojoules;\r\n let icon;\r\n if (gender === \"male\") {\r\n BMR = `${(66 + (13.7 * weight) + (5 * height)) - (6.8 * age)}`\r\n icon = 'male';\r\n } else {\r\n BMR = `${(655 + (9.6 * weight) + (1.8 * height)) - (4.7 * age)}`\r\n icon = 'female';\r\n }\r\n console.log(`Your BMR ${BMR}`);\r\n\r\n //TODO: Calculate calorie according to physical state \r\n let multipicationValue;\r\n if (physicalState === 'low') {\r\n multipicationValue = 1.2;\r\n } else if (physicalState === 'normal') {\r\n multipicationValue = 1.375;\r\n } else if (physicalState === 'medium') {\r\n multipicationValue = 1.55;\r\n } else if (physicalState === 'high') {\r\n multipicationValue = 1.725;\r\n } else if (physicalState === 'veryHigh') {\r\n multipicationValue = 1.9;\r\n } else {\r\n multipicationValue = \"Choose the physical state\"\r\n }\r\n calories = (BMR * multipicationValue);\r\n\r\n // TODO: Calculate KiloJoules from calories\r\n kilojoules = calories * 4.184;\r\n calories = Number(calories).toFixed(2);\r\n kilojoules = Number(kilojoules).toFixed(1);\r\n BMR = Number(BMR).toFixed(2);\r\n console.log(`Your calorie need ${calories}`);\r\n\r\n //TODO: Show the bodyBurnsValue let \r\n let bodyBurning;\r\n let bodyBurningText;\r\n let multipicationValue2;\r\n let resultTypeChecked = document.querySelector(\"input[name='resultIn']:checked\").value;\r\n if (resultTypeChecked === \"kiloJoules\") {\r\n bodyBurning = kilojoules;\r\n bodyBurningText = \"kiloJoules\";\r\n multipicationValue2 = \"X 4.184\";\r\n } else {\r\n bodyBurning = calories;\r\n bodyBurningText = \"calories\";\r\n multipicationValue2 = \"\";\r\n }\r\n\r\n // !Calculate BMI according to height and weight\r\n heightInMeter = `${height / 100}`;\r\n let BMI = `${weight / (heightInMeter**2)}`\r\n BMI = Number(BMI).toFixed(1);\r\n console.log(BMI, heightInMeter);\r\n\r\n //TODO: Justify the BMI index value\r\n let textColor;\r\n let state;\r\n let explainState;\r\n let tips;\r\n let weightText;\r\n if (BMI < 18.5) {\r\n state = \"Underweight\"\r\n explainState = \"শরীরের ওজন কম\";\r\n tips = \"পরিমিত খাদ্য গ্রহণ করে ওজন বাড়াতে হবে\"\r\n textColor = 'black-50';\r\n weightText = \"Low weight\";\r\n } else if (BMI >= 18.5 && BMI <= 24.9) {\r\n state = \"Normal\"\r\n explainState = \"সুসাস্থ্যের আদর্শ মান\";\r\n tips = \"এটি বজায় রাখতে হবে । অতিরিক্ত বা অসাস্থ্যকর খাদ্য গ্রহণ করে সাস্থ্য বাড়ানো যাবে না\"\r\n textColor = 'success';\r\n weightText = \"OverWeight / Underweight\";\r\n } else if (BMI > 24.9 && BMI <= 29.9) {\r\n state = \"Overweight\"\r\n explainState = \"শরীরের ওজন বেশি\";\r\n tips = \"চিন্তিত হবেন না । ব্যায়াম করে ওজন কমাতে হবে\";\r\n textColor = 'warning'\r\n weightText = \"OverWeight\";\r\n } else if (BMI > 29.9 && BMI <= 34.9) {\r\n state = \"obese\"\r\n explainState = \"স্থুল (পর্যায়-১): মেদ বেশি | অতিরিক্ত ওজন\";\r\n tips = \"বেছে খাদ্যগ্রহণ ও ব্যায়াম করা প্রয়োজন ।\"\r\n textColor = 'warning';\r\n weightText = \"High OverWeight\";\r\n } else if (BMI > 34.9 && BMI <= 39.9) {\r\n state = \"obese (High)\"\r\n explainState = \"বেশি স্থুল (পর্যায়-২) ।<br> অতিরিক্ত মেদ\";\r\n tips = \"পরিমিত খাদ্যগ্রহণ ও বেশ ব্যায়াম করা প্রয়োজন । <br> ওজন নিয়োন্ত্রণে আনতে হবে | <br> প্রয়োজনে ডাক্তারের পরামর্শ প্রয়োজন\"\r\n textColor = 'danger';\r\n weightText = \"OverWeight (very high)\";\r\n } else {\r\n state = \"Extremly obese\"\r\n explainState = \"অতিরিক্ত স্থুল (শেষ পর্যায়)। মৃত্যুঝুঁকির আশংকা!\";\r\n tips = \"ডাক্তারের পরামর্শ প্রয়োজন । দ্রুত ওজন নিয়ন্ত্রণে আনতে হবে\"\r\n textColor = 'danger';\r\n weightText = \"OverWeight (extreme)\";\r\n }\r\n // TODO: According to good BMI and given Height calculate the perfect weight for this height\r\n //from \r\n let healthyBMI1 = 18.5;\r\n //to\r\n let healthyBMI2 = 24.9;\r\n //from\r\n let healthyWeight1 = `${healthyBMI1 * (heightInMeter**2)}`\r\n healthyWeight1 = Math.round(healthyWeight1);\r\n //to\r\n let healthyWeight2 = `${healthyBMI2 * (heightInMeter**2)}`\r\n healthyWeight2 = Math.round(healthyWeight2);\r\n //a sequence resulth\r\n let healthyWeight = `${healthyWeight1} to ${healthyWeight2}`\r\n let healthyBMI = `${healthyBMI1} to ${healthyBMI2}`\r\n //Average Result\r\n let averageHealthyWeight = `${(healthyWeight1 + healthyWeight2) / 2}`\r\n let averageHealthyBMI = `${(healthyBMI1 + healthyBMI2) / 2}`\r\n\r\n //TODO: Calculate the difference between healty weight and Given Weight;\r\n let defferenceWeight;\r\n if (state === \"Underweight\") {\r\n defferenceWeight = `${healthyWeight1 - weight}kg To ${healthyWeight2 - weight}kg`\r\n } else if (state === \"Normal\") {\r\n defferenceWeight = \"(N/A) Perfect Weight\"\r\n } else {\r\n defferenceWeight = `${weight - healthyWeight1}kg To ${weight - healthyWeight2}kg`\r\n }\r\n\r\n //TODO; Make the HTML for show the results for each sections\r\n let htmlForBMI;\r\n let htmlForCalories;\r\n let htmlForButtons\r\n\r\n htmlForCalories = `\r\n <div class=\"my-3 d-flex justify-content-center align-content-center flex-column\">\r\n <h5 class=\"card-header text-center my-3\">Your Daily ${bodyBurningText} needs</h5>\r\n <h3 class=\"card-title text-center\" id=\"calculateTitle\">${bodyBurningText} need Per Day : </h3>\r\n <h4 class=\"d-block font-weight-bold mx-auto\" style=\"font-size: 1.5rem;\">\r\n <sup><i class=\"fa fa-fire text-danger\"></i></sup> <span id=\"calorieResult\"> ${bodyBurning}\r\n ${bodyBurningText}/Day</span>\r\n </h4>\r\n</div>\r\n<hr>\r\n<h5 class=\"d-inline-block\">BMR : </h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\n style=\"font-size: 1.5rem;\" id=\"BMRResult\">${BMR}</h5>\r\n<hr>\r\n<h5 class=\"d-inline-block\">${bodyBurningText} : (c)</h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\n style=\"font-size: 1.5rem;\" id=\"SD\">\r\n <i class=\"fa fa-clipboard\"></i> ${BMR} X ${multipicationValue} ${multipicationValue2}\r\n</h5>\r\n<hr>\r\n<h5 class=\"d-inline-block\">Used BMR Law : </h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\nstyle=\"font-size: 1.5rem;\" id=\"SD\">\r\n<i class=\"fa fa-codepen text-codepen\"></i> Heris Bene-Dict \r\n</h5>\r\n<hr>`\r\n\r\n //TODO: BMI HTML\r\n htmlForBMI = `\r\n <div class=\"my-3 d-flex justify-content-center align-content-center flex-column text-center\">\r\n <h5 class=\"card-header my-3\">Your Health Statistics</h5>\r\n <h3 class=\"card-title text-center\" id=\"calculateTitle\">Health State (BMI) : </h3>\r\n <h4 class=\"d-block font-weight-bold mx-auto\" style=\"font-size: 1rem;\">\r\n <sup><i class=\"fa fa-${icon} text-${textColor}\"></i></sup> &nbsp;&nbsp;<span id=\"calorieResult\"> ${explainState}\r\n </span> <small><a id=\"showBMIChart\" onclick=\"showChart()\" class=\"link text-primary\">Chart <i class=\"fa fa-area-chart\"></i></a></small>\r\n </h4>\r\n</div>\r\n<h4>\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\" style=\"display: none;\" id=\"BMIChart\">Chart : <div id=\"img d-flex justify-content-center\">\r\n <img src=\"bmi-chart.gif\" class=\"d-block mx-auto img\" alt=\"BMI Chart\">\r\n </div>\r\n </li>\r\n <li class=\"list-group-item\">BMI Formula : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> weight(kg) /\r\n Height(m) <sup class=\"font-weight-bolder\">2</sup></span>\r\n </li>\r\n\r\n <li class=\"list-group-item\">Your BMI (Body Mass Index) : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\">= ${BMI}</span> <a onclick=\"showBMIStateTable()\" class=\"link text-primary\" id=\"BMITableBtn\">Show BMI Table</a>\r\n <div class=\"card mx-auto\" id=\"BMIStateTable\" style=\"border: none;\r\n width: 100%;\r\n height: auto;\r\n display: none;\">\r\n <br>\r\n <div class=\"card-body bg-light mx-auto\">\r\n <b>Check the health stats according to BMI (Body Mass Index) </b>\r\n </div>\r\n <table class=\"table table-striped mx-auto\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">BMI</th>\r\n <th scope=\"col\">State</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\"> &lt; 18.5</th>\r\n <td>শরীরের ওজন কম (Underweight)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">18.5 to 24.9</th>\r\n <td>সুসাস্থ্যের আদর্শ মান (Normal)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">25 to 29.9</th>\r\n <td>শরীরের ওজন বেশি (Overweight)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">30 to 34.9</th>\r\n <td>\"স্থুল (পর্যায়-১): মেদ বেশি | অতিরিক্ত ওজন (Obese I)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">35 to 39.9</th>\r\n <td>বেশি স্থুল (পর্যায়-২) । অতিরিক্ত মেদ (Obese II)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">&gt 40</th>\r\n <td>অতিরিক্ত স্থুল (শেষ পর্যায়)। মৃত্যুঝুঁকির আশংকা! (Obese III Extreme)</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n </li>\r\n <li class=\"list-group-item\" id=\"state\">State : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${state}</span>\r\n </li>\r\n <hr>\r\n <h5 class=\"card-header text-weight-bolder text-muted\">Calculated Standard Health</h5>\r\n <li class=\"list-group-item\" id=\"goodValues\">1. Your BMI should be : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${healthyBMI}</span>\r\n <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${averageHealthyBMI} <small>(Average)</small></span>\r\n </li>\r\n <li class=\"list-group-item\">2.Your Weight should be : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${healthyWeight}</span>\r\n <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${averageHealthyWeight} <small>(Average)</small></span>\r\n </li>\r\n <li class=\"list-group-item\" id=\"goodWeightDifference\">${weightText}<span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${defferenceWeight}</span>\r\n </li>\r\n <hr>\r\n <h5 class=\"card-header text-weight-bolder text-muted\">Suggetions</h5>\r\n <li class=\"list-group-item\" id=\"tips\">Tips (করনীয়) : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${tips}</span>\r\n </li>\r\n </ul>\r\n</h4>\r\n `\r\n //TODO: Button HTML \r\n htmlForButtons = `\r\n <button class=\"btn btn-outline-warning\" type=\"submit\" onclick=\"location.reload();\">Reload</button>\r\n <button class=\"btn btn-outline-success position-relative float-right\" type=\"submit\"\r\n onclick=\"window.print();\">Print/Save</button>`\r\n result.classList.add('d-none');\r\n\r\n //TODO: Add alert with success message when calculate will be finished\r\n errorAlert.style.display = \"none\";\r\n successAlert.style.display = \"block\";\r\n setTimeout(() => {\r\n successAlert.classList.add('hide')\r\n successAlert.style.display = \"none\";\r\n }, 4000);\r\n\r\n //TODO: Show the results according to user need\r\n if (calculateItemChecked === \"bmr\") {\r\n calorieSection.innerHTML = htmlForCalories;\r\n healthSection.innerHTML = \"\";\r\n } else if (calculateItemChecked === \"bmi\") {\r\n healthSection.innerHTML = htmlForBMI;\r\n calorieSection.innerHTML = \"\";\r\n } else if (calculateItemChecked === \"all\") {\r\n healthSection.innerHTML = htmlForBMI;\r\n calorieSection.innerHTML = htmlForCalories;\r\n }\r\n buttons.innerHTML = htmlForButtons;\r\n\r\n //! Show the navigator\r\n let navigator = document.getElementById('navigator');\r\n if (calculateItemChecked === \"all\") {\r\n navigator.style.display = \"block\";\r\n } else {\r\n navigator.style.display = \"none\";\r\n }\r\n } //End of the else statement\r\n}", "function DoomMD5Weight() {\n\n\tthis.joint = 0; // int\n\tthis.bias = 0.0; // float\n\tthis.pos = vec3.create([0.0, 0.0, 0.0]);\n}", "calculateCal(){\n let BMR;\n BMR = (66 + (6.3*this.props.user.weight) + (12.9*this.props.user.height) - (6.8 * this.props.user.age))\n return BMR * 1.55;\n }", "function brzycki(weight, reps) {\n\treturn weight/((37/36)-(reps/36));\n}", "function bmiCalc(){\n let weight = $('#weight').val()\n let height = $('#height').val()\n let bmi = weight/(height**2)\n $('#bmi').val(bmi)\n}", "function check_current_height_weight_unit(height_unit, weight_unit){\r\n\t\tif(height_unit == \"cm\"){\r\n\t\t\tcm_flag = 1;\r\n\t\t\th_flag = 2;\r\n\t\t}else{\r\n\t\t\tft_inch_flag = 1;\r\n\t\t\th_flag = 1;\r\n\t\t}\r\n\t\t\r\n\t\tif(weight_unit == \"kg\"){\r\n\t\t\tkg_flag = 1;\r\n\t\t}else{\r\n\t\t\tlbs_flag = 1;\r\n\t\t}\r\n\t}", "function lettersSCalc(weight) {\n\n var result;\n\n if(weight <= 1) {\n return result = 0.49;\n }\n else if (weight <= 2) {\n return result = 0.70;\n }\n else if (weight <= 3) {\n return result = 0.91;\n }\n else if (weight <= 3.5) {\n return result = 1.12;\n }\n else {\n return result = -1;\n }\n}", "function displayresult(percentile_bmi, percentile_wt, percentile_ht, z_bmi, z_wt, z_ht, interpret_bmi, weightrange) {\n\n var theAge = calculateAge()[0];\n var bmiNumber = getBMI().toFixed(1);\n var weight = getWeight();\n var height = getHeight();\n\n if (theAge < 6971){ //if 19 or younger\n var ordinal_BMI = Number.getOrdinalFor((percentile_bmi * 100).toFixed(0), true);\n var ordinal_wt = Number.getOrdinalFor((percentile_wt * 100).toFixed(0), true);\n var ordinal_ht = Number.getOrdinalFor((percentile_ht * 100).toFixed(0), true);\n document.getElementById(\"result-age\").innerHTML = calculateAge(0)[1];\n //show the results in the result boxes, and grey out options where not relevant\n weight > 0 && height > 0 ? (document.getElementById(\"result-bminumber\").innerHTML = bmiNumber, document.getElementById(\"result-bminumber\").style.opacity = \"1\") : (document.getElementById(\"result-bminumber\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bminumber\").style.opacity = \"0.4\");\n weight > 0 && height > 0 ? (document.getElementById(\"result-bmi\").innerHTML = ordinal_BMI + \" (Z-score: \" + z_bmi.toFixed(1) + \")\", document.getElementById(\"result-bmi\").style.opacity = \"1\") : (document.getElementById(\"result-bmi\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bmi\").style.opacity = \"0.4\");\n weight > 0 && height > 0 ? (document.getElementById(\"result-it\").innerHTML = interpret_bmi, document.getElementById(\"result-it\").style.opacity = \"1\") : (document.getElementById(\"result-it\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-it\").style.opacity = \"0.4\");\n weight > 0 ? (document.getElementById(\"result-wt\").innerHTML = ordinal_wt + \" (Z-score: \" + z_wt.toFixed(1) + \")\", document.getElementById(\"result-wt\").style.opacity = \"1\") : (document.getElementById(\"result-wt\").innerHTML = \"Enter Weight\", document.getElementById(\"result-wt\").style.opacity = \"0.4\");\n height > 0 ? (document.getElementById(\"result-ht\").innerHTML = ordinal_ht + \" (Z-score: \" + z_ht.toFixed(1) + \")\", document.getElementById(\"result-ht\").style.opacity = \"1\") : (document.getElementById(\"result-ht\").innerHTML = \"Enter Height\", document.getElementById(\"result-ht\").style.opacity = \"0.4\");\n weight > 0 ? (document.getElementById(\"result-wr\").innerHTML = weightrange, document.getElementById(\"result-wr\").style.opacity = \"1\") : (document.getElementById(\"result-wr\").innerHTML = \"Enter Weight\", document.getElementById(\"result-wr\").style.opacity = \"0.4\");\n\n } else { //if an adult then just show BMI\n document.getElementById(\"result-age\").innerHTML = calculateAge(0)[1];\n document.getElementById(\"result-bmi\").innerHTML = \"for age <20\";\n weight > 0 && height > 0 ? (document.getElementById(\"result-bminumber\").innerHTML = bmiNumber, document.getElementById(\"result-bminumber\").style.opacity = \"1\") : (document.getElementById(\"result-bminumber\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bminumber\").style.opacity = \"0.4\");\n document.getElementById(\"result-wt\").innerHTML = ordinal_wt = \"for age <20\";\n document.getElementById(\"result-ht\").innerHTML = ordinal_ht = \"for age <20\";\n document.getElementById(\"result-it\").innerHTML = \"for age <20\";\n document.getElementById(\"result-wr\").innerHTML = \"for age < 20\";\n document.getElementById(\"result-bmi\").style.opacity = \"0.4\"\n document.getElementById(\"result-wt\").style.opacity = \"0.4\"\n document.getElementById(\"result-ht\").style.opacity = \"0.4\"\n document.getElementById(\"result-it\").style.opacity = \"0.4\"\n document.getElementById(\"result-it\").style.opacity = \"0.4\"\n document.getElementById(\"result-wr\").style.opacity = \"0.4\"\n }\n}", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "function rateLetterMetered(weight) {\n if (weight <= 1.0) {\n return 0.47;\n } else if (weight <= 2.0) {\n return 0.68;\n } else if (weight <= 3.0) {\n return 0.89;\n } else if (weight <= 3.5) {\n return 1.10;\n } else {\n return rateLargeFlat(weight);\n }\n}", "function dogFeeder(pounds, years){\n //declaring the variables\n let dog = '';\n //if else: used to find out if dog is puppy or if not\n if (years<1){\n dog = 'puppy';\n } else if (years>=1){\n dog= 'adult';\n }\n\n //calculations for adult dogs\n if (dog==='adult'){\n // up to 5 lbs - 5% of their body weight\n if(pounds<=5){\n let bodyWeight = pounds*.05;\n }\n // 6 - 10 lbs - 4% of their body weight \n else if (pounds<=10){\n bodyWeight = pounds*.04;\n }\n // 11 - 15 lbs - 3% of their body weight \n else if (pounds<=15){\n bodyWeight = pounds*.03;\n } \n // > 15lbs - 2% of their body weight \n else if (pounds>15){\n bodyWeight = pounds*.02;\n }\n }\n\n\n\n if (dog==='puppy'){\n //calculations for puppy\n let month = 1/12;\n //.083 = 1 month in decimal form\n // 2 - 4 months human months 10% of their body weight\n if (years>= month*2 && years<=month*4){\n bodyWeight = pounds*.1;\n // console.log('yo: '+bodyWeight);\n }\n // 4 - 7 months 5% of their body weight \n else if (years> month*4 && years<=month*7){\n bodyWeight = pounds*.05;\n // console.log('yo: '+bodyWeight);\n }\n\n // 7 - 12 months 4% of their body weight\n else if (years> month*7 && years<=month*12){\n bodyWeight = pounds*.04;\n // console.log('yo: '+bodyWeight);\n } else {\n console.log('no: '+bodyWeight);\n }\n }\n return bodyWeight;\n\n}", "function calcBMI(){\r\n //get values from functions page\r\n var weight = document.getElementById('txt_bmiWeight').value;\r\n var height = document.getElementById('txt_bmiHeight').value;\r\n\r\n //Calculate bmi if input fields are valid\r\n var bmi;\r\n if (weight > 0 && weight !== \"\"\r\n && height > 0 && height !== \"\") {\r\n bmi = Math.round((weight * 703) / (height * height));\r\n } else {\r\n alert(\"Please enter a valid number for each text field.\");\r\n clearALL();\r\n }\r\n\r\n //Put BMI value back into form\r\n document.getElementById('txt_bmiCalculated').value = parseInt(bmi);\r\n\r\n //Clear the values in the Weight & Height txt boxes\r\n document.getElementById('txt_bmiWeight').value = null;\r\n document.getElementById('txt_bmiHeight').value = null;\r\n\r\n}", "function calcBMI(){\r\n //get values from functions page\r\n var weight = document.getElementById('txt_bmiWeight').value;\r\n var height = document.getElementById('txt_bmiHeight').value;\r\n\r\n //Calculate bmi if input fields are valid\r\n var bmi;\r\n if (weight > 0 && weight !== \"\"\r\n && height > 0 && height !== \"\") {\r\n bmi = Math.round((weight * 703) / (height * height));\r\n } else {\r\n alert(\"Please enter a valid number for each text field.\");\r\n clearALL();\r\n }\r\n\r\n //Put BMI value back into form\r\n document.getElementById('txt_bmiCalculated').value = parseInt(bmi);\r\n\r\n //Clear the values in the Weight & Height txt boxes\r\n document.getElementById('txt_bmiWeight').value = null;\r\n document.getElementById('txt_bmiHeight').value = null;\r\n\r\n}", "calculate() {\n let age = inputsRequired[0].elem.value;\n let height = inputsRequired[1].elem.value;\n let weight = inputsRequired[2].elem.value;\n let neckCircumference = inputsRequired[3].elem.value;\n let waistCircumference = inputsRequired[4].elem.value;\n let hipCircumference = inputsRequired[5].elem?.value;\n \n let person = new Person();\n \n let feetToCMFactor = 30.48; // *\n let poundsToKGFactor = 2.205; // /\n let inchesToCMFactor = 2.54; // *\n \n person.age = age;\n person.height = height;\n person.weight = weight;\n person.neckCircumference = neckCircumference;\n person.waistCircumference = waistCircumference;\n person.hipCircumference = hipCircumference;\n\n if(this.unit === 1) {\n person.height = height * feetToCMFactor;\n person.weight = weight / poundsToKGFactor;\n person.neckCircumference = neckCircumference * inchesToCMFactor;\n person.waistCircumference = waistCircumference * inchesToCMFactor;\n person.hipCircumference = hipCircumference * inchesToCMFactor;\n }\n \n if(this.gender === 'male') {\n person.gender = 0;\n } else if(this.gender === 'female') {\n person.gender = 1;\n }\n \n let bodyMassIndex = person.findBMI();\n let bodyFatPercentage = person.findBodyFatPercentage();\n let dailyCalorieIntake = person.findDailyCalorieIntake();\n let bmr = person.findBMR(dailyCalorieIntake);\n let activityLevelBmr = bmr * activityLevel.find(lvl => lvl.name === this.activityLevelDetails).value;\n \n function valueFromPercentage(v, p) {\n return ((v * p) / 100);\n }\n \n let calorieBasedOnGoal = activityLevelBmr - workoutGoal.find(goal => goal.name === this.workoutGoalChoosen).execute(activityLevelBmr);\n let macroValuesBasedOnGoal = macroForWorkoutGoal.find(goal => goal.name === this.workoutGoalChoosen);\n let carb = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.carb)/4);\n let protein = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.protein)/4);\n let fat = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.fat)/9);\n \n this.renderOutput(\n bodyMassIndex,\n bodyFatPercentage,\n dailyCalorieIntake,\n activityLevelBmr,\n carb,\n protein,\n fat\n );\n }", "function doseInML(weight, mgPerKg, mgPerML) {\n return (weight * mgPerKg) / parseFloat(mgPerML);\n}", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function getEffectiveWeight(helmet, chest, hand, feet) {\n\thelmet = parseFloat(helmet);\n\tchest = parseFloat(chest);\n\thand = parseFloat(hand);\n\tfeet = parseFloat(feet);\n\n\tvar eweight = Math.pow(Math.max(0, 2*helmet + chest + feet + 4*hand - 10), 1.12);\n\treturn eweight;\n}", "function fnCalcWeight(paramShaft, paramLength)\n{\n let varResults = 0;\n \n // What material is this club made out of\n switch (String(paramShaft).toLowerCase())\n {\n case String(\"Steel\").toLowerCase():\n //If Steel, use Density of 0.28 lb/in**3(cubed) + Estimated weight of Club Head\n varResults = (paramLength * 0.28) + 0.440924884; //gram2lbs from web\n break;\n case String(\"Graphite\").toLowerCase():\n //If Graphite, use Density of 0.08 lb/in**3(cubed)\n varResults = (paramLength * 0.08) + 0.440924884; //gram2lbs from web\n break;\n default:\n //If neither, then just return 0\n varResults = 0;\n break;\n }\n return varResults;\n}", "function get_bm(item) {\n if (item.low <= ns_bm_number) {\n if (item.high >= ns_bm_number) {\n bm_data = item.ratio + \" \" + item.bval;\n }\n }\n }", "function calsPerDay() {\n function find(id) { return document.getElementById(id) }\n\n var age = Number(find(\"age\").value)\n var height = (find(\"heightFt\").value * 30.48) +(find(\"heightIn\").value *2.54);\n var weight = find(\"weight\").value * .45359237\n var bmr=0\n var result = 0\n\n console.log(height);\n console.log(weight);\n console.log(age);\n\n if (find(\"male\").checked) {\n console.log(\"inside check male\")\n bmr = (10*weight) + (6.25*height) - (5*age) + 5\n }\n \n else if (find(\"female\").checked) {\n bmr = (10*weight) + (6.25*height) - (5*age) - 161\n }\n find(\"bmr\").innerHTML = Math.round( bmr ) \n console.log(bmr);\n\n if (find(\"sedentary\").checked) {\n result=(bmr*1.2);\n }\n \n if (find(\"light\").checked) {\n result=(bmr*1.37);\n }\n \n if (find(\"moderate\").checked) {\n result=(bmr*1.55);\n }\n \n if (find(\"heavy\").checked) {\n result=(bmr*1.72);\n }\n\n console.log(result);\n find(\"totalCals\").innerHTML=+Math.round(result)\n\n}", "function calculateCaloriesFromWeight() {\n var weight = userInfo[\"weight\"];\n var totalCalories = weight * 22;\n return totalCalories;\n}", "function bIndex(body){ return Globals.world.getBodies().indexOf(body); }", "function CalcWeight()\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(\"gear\").rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[\"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(\"bagWeight\").innerHTML = total.toFixed(1);\n\n // Add the armor weight.\n for ( var i = 1; i <= 4; i++ )\n {\n // If the armor is flagged as not carried, then don't add it to the weight.\n if ( !sheet()[\"Armor\" + i + \"Carried\"].checked )\n continue;\n\n var num = parseFloat(sheet()[\"Armor\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n // Add the weapon weight\n for ( var i = 1; i <= 4; i++ )\n {\n if ( sheet()[ \"Weapon\" + i + \"Carried\" ].checked )\n {\n var num = parseFloat(sheet()[\"Weapon\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n }\n\n sheet().TotalWeight.value = total.toFixed(1);\n\n // Check to see if the character is encumbered. If so, then set the background\n // color of \"Total Weight\", Speed, and DexMod input fields to red.\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )\n {\n debug.trace(\"Character is encumbered.\");\n var maxDexMod = 99;\n\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )\n {\n maxDexMod = 1;\n sheet().TotalWeight.title = \"Check penalty of -6 while encumbered\";\n }\n else\n {\n maxDexMod = 3;\n sheet().TotalWeight.title = \"Check penalty of -3 while encumbered\";\n }\n\n debug.trace(\"MaxDexMod = \" + maxDexMod + \" DexMod = \" + Clean( sheet().DexMod.value ) );\n if ( Clean( sheet().DexMod.value ) > maxDexMod )\n {\n sheet().DexMod.title = \"Max dex bonus to AC is +\" + maxDexMod + \" while encumbered.\";\n sheet().DexMod.style.color = \"white\";\n sheet().DexMod.style.backgroundColor = \"red\";\n }\n else\n {\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n }\n\n sheet().TotalWeight.style.color = \"white\";\n sheet().TotalWeight.style.backgroundColor = \"red\";\n\n sheet().Speed.title = \"Max speed is reduced by roughly 1/3 due to encumbrance\";\n sheet().Speed.style.color = \"white\";\n sheet().Speed.style.backgroundColor = \"red\";\n\n ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.\n }\n else\n {\n sheet().TotalWeight.title = sheet().TotalWeight.value;\n sheet().TotalWeight.style.color = \"black\";\n sheet().TotalWeight.style.backgroundColor = \"white\";\n\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n\n sheet().Speed.title = sheet().Speed.value;\n sheet().Speed.style.color = \"black\";\n sheet().Speed.style.backgroundColor = \"white\";\n }\n\n\n SkillsUpdateCheckPen();\n\n debug.trace(\"Calculated total weight.\");\n}", "function getEffectiveWeight(helmet, chest, hand, feet) {\n\thelmet = parseFloat(helmet);\n\tchest = parseFloat(chest);\n\thand = parseFloat(hand);\n\tfeet = parseFloat(feet);\n\n\tvar eweight = Math.max(0, 3*helmet + chest + feet + 2*hand - 7);\n\treturn eweight;\n}", "function getDescription(thisBMI) {\n if (thisBMI < 18.5)\n return thisBMI + \" - BAJO PESO - Es conveniente que hagas una consulta con un Nutricionista para alcanzar un peso saludable comiendo en calidad o que se evalúe si sos delgado/a por cuestiones genéticas.\";\n else if (thisBMI >= 18.5 && thisBMI <= 24.99)\n return thisBMI + \" - Tu peso es adecuado para tu altura. De todas formas, es necesario realizar comidas sanas para prevenir enfermedades y tener una buena calidad de vida.\";\n else if (thisBMI >= 25 && thisBMI <= 29.99)\n return thisBMI + \" - SOBREPESO - Es necesario realizar una consulta médica y nutricional para lograr descender unos kilogramos y mantener una buena calidad de vida. Existe también la posibilidad (si sos deportista) que esté aumentada tu masa muscular y por lo tanto sea algo saludable.\";\n else if (thisBMI >= 30 && thisBMI <= 39.99)\n return thisBMI + \" - OBESIDAD - Es necesario realizar una consulta médica - nutricional y comenzar un tratamiento de descenso de peso.\";\n else return \"Por favor, ingrese los valores correctamente :)\";\n}", "weight(e) {\n this.setState({ weight: e.nativeEvent.text }, function () {\n this.bmi();\n });\n }", "compareWeight(animalObject, humanObject) {\n return `${this.species} is a ${animalObject.weight} lbs while you're a ${humanObject.weight} lbs.`;\n }", "calculateByMetric() {\n\t\tthis.height = this.height/100; // convert cm to meter\n const result = (this.weight) / Math.pow(this.height, 2);\n return Math.round(result* 100) / 100;\n }", "function getLewis() {\n let jump_reach_score = jump_height / 100;\n average_power = Math.sqrt(4.9) * body_mass * Math.sqrt(jump_reach_score) * 9.81;\n }", "function Human(weight,height, diet, name) {\n Creature.call(this, 'Homo Sapiens', weight, height, diet);\n\n this.name = name; \n }", "function beeStingsNeeded(victimWeight)\n{\n var totalStings = 8.666666667 * victimWeight; // This is the code that will run in the function.\n\n return totalStings; // This is the code to return the total number of bee stings to the function.\n}", "handleWeighttChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ weight: processedData })\n this.bmi(this.state.height, processedData);\n }", "renderBMICatText(){\n if(this.state.cat=='Underweight')\n {\n if(this.state.gender=='m')\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child may weigh less than he ideally should. You may need to consider ways for your child to gain weight to bring his BMI in the range {this.u_cat} to {this.h_cat}.\n It is still important to eat a healthy diet - you should still avoid junk food. You might need to consult a pediatrician for a diet plan. \n </p>\n );\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child may weigh less than he ideally should. You may need to consider ways for your child to gain weight to bring her BMI to between {this.u_cat} to {this.h_cat}.\n It is still important to maintain a healthy diet for your child. You should still avoid junk food. You might need to consult a pediatrician for a diet plan. \n </p>\n \n );\n \n }\n else if(this.state.cat=='Healthy'){\n if(this.state.gender=='m'){\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child's BMI is currently within what is considered a healthy weight range.\n Being a healthy weight has important benefits, not only on how he feels,\n but also to help reduce the risk of heart disease, diabetes and a range of\n other conditions in the future.\n </p>\n );\n }\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child's BMI is currently within what is considered a healthy weight range.\n Being a healthy weight has important benefits, not only on how she feels,\n but also to help reduce the risk of heart disease, diabetes and a range of\n other conditions in the future.\n </p>\n );\n \n }\n else if(this.state.cat=='Overweight'){\n if(this.state.gender=='m'){\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child's weight appears to be a bit above the ideal range. You should consider helping him loose weight. \n To lose weight, you will generally need to decrease the amount of energy (food) in the diet.\n You could encorage him to drink more water and increase the amount of vegetables in his diet.\n And do not be disheartened or de-motivated if progress is slow as you try to get his weight within a healthy range. \n \n </p>\n );\n }\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child's weight appears to be a bit above the ideal range. You should consider helping her loose weight. \n To lose weight, you will generally need to decrease the amount of energy (food) in the diet.\n You could encorage her to drink more water and increase the amount of vegetables in her diet.\n And do not be disheartened or de-motivated if progress is slow as you try to get her weight within a healthy range. \n </p>\n );\n \n }\n else if(this.state.cat=='Obese'){\n if(this.state.gender=='m'){\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child currently weighs more than what is ideal. This puts his health at\n risk and is of increasing concern as he grows up. Click on Recommended Diet\n to learn more about recommendations on eating and tips to loose weight.\n </p>\n );\n }\n return(\n <p style={{color:'black',textAlign:'justify',paddingLeft:'20px',paddingRight:'20px'}}>\n Your child currently weighs more than what is ideal . This puts her health at\n risk and is of increasing concern as she grows up. Click on Recommended Diet\n to learn more about recommendations on eating and tips to loose weight.\n </p>\n );\n }\n \n }", "function calculate(){\n\n \tvar\twtkg = document.getElementById('wtDrop').selectedIndex +1;\n \tvar wtlb = document.getElementById('wtDropLbs').selectedIndex;\n \tvar chk = document.getElementById('wtChk');\n \tvar weight;\n\n\n \t//checks which unit has been inputed by user then converts lbs to kg\n \tif(chk.checked == true){\n \t\tweight = wtkg.toFixed();\n \t}else if(chk.checked == false){\n \t\tweight = (wtlb*0.453592).toFixed();\n \t}\n\n \t//height function to check which height is used\n\n \tvar htf = document.getElementById('htDropF').selectedIndex -1;\n \tconsole.log(htf);\n \tvar hti = document.getElementById('htDropF2').selectedIndex-1;\n \tvar htC = (htf * 30.48) + (hti *2.54);\n \t\n\n \tvar htm = document.getElementById('htDropM').selectedIndex -1;\n \tvar htChk = document.getElementById('htChk');\n \t\n\n \tvar height;\n\n \tif(htChk.checked == true && hti >= 0){\n \t\theight = htC;\n \t}else if(htChk.checked == false){\n \t\theight = htm;\n \t}\n\n \t//gender\n \tvar r1 = document.getElementById('mRad');\n \tvar r2 = document.getElementById('fRad');\n \tvar gender;\n \tif(r1.checked == true){\n \t\tgender = 1.23;\n \t}else if(r2.checked == true){\n \t\tgender = 1.04;\n \t}\n \t\n \t//calculate height over 5 foot, IBW and ABW\n \tvar inchover5 = (height - 152.4)/2.54;\n \tvar mIBW = (inchover5 * 2.3) + 50;\n\tvar fIBW = (inchover5 * 2.3) + 45.5;\n\tvar mABW = mIBW + 0.4 * (weight - mIBW);\n\tvar fABW = fIBW + 0.4 * (weight - fIBW);\n\n\tvar modalWt = document.getElementById('modalWt');\n\tvar modalIBW = document.getElementById('modalIBW'); \n\tvar modalABW = document.getElementById('modalABW');\n\n\n\tif(gender == 1.23){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = mIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = mABW.toFixed(1) + \"kg\";\n\t}else if(gender == 1.04){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = fIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = fABW.toFixed(1) + \"kg\";\n\n\t}\n\n\n\n\t//age and creatinine\n \tvar age = document.getElementById('ageDrop').selectedIndex -1;\n \tvar srcr = document.getElementById('creatDrop').selectedIndex -1;\n \tvar wtType = document.getElementById('wtType');\n\n \tvar CRCLAnswer = document.getElementById('ansDisplay');\n \tvar crcl = 0;\n \tif(gender == 1.23 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * mABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\n\t} else if(gender == 1.23 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender)/srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t\t\n\t} else if(gender == 1.04 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * fABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\t\t\t\n\t} else if(gender == 1.04 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t}\n\n\n\t//displays answer jumbo if criteria matches\n\tif(weight >= 30 && inchover5 >= 0 && age >= 18 && srcr > 1 && gender > 1){\n\t\tconsole.log(\"criteria matches\");\n\t\tdocument.getElementById('ansJumbo').style.display = \"block\";\n\t\tdocument.getElementById('inputForm').style.display = \"none\";\n\t\tvar title = document.getElementById('title');\n\t\ttitle.innerHTML = \"Creatinine Clearance\"\n\t\ttitle.style.marginLeft = \"50px\";\n\t\tdocument.getElementById('backBtn').style.display = \"block\";\n\t\t\n\n\t}\n \tconsole.log(\"\\nweight: \" + weight + \"\\nHeight: \" + height +\"\\ninches over 5 foot: \" + inchover5 + \" \\nage: \" + age + \"\\nsrcr: \" + srcr + \" \\ngender: \" + gender);\n \treturn crcl;\n}", "function getMilk(bottles){\r\n var cost = bottles * 1.5;\r\n\r\nconsole.log(`${bottles} is costing ${cost}`);\r\n}" ]
[ "0.8438067", "0.82595015", "0.80829865", "0.7922899", "0.77958953", "0.77698994", "0.77475137", "0.77296144", "0.7628763", "0.7606456", "0.7558116", "0.7523544", "0.7514475", "0.7504679", "0.75025207", "0.74736875", "0.73504794", "0.73190415", "0.72958195", "0.72245187", "0.7224279", "0.72073233", "0.72021747", "0.7145136", "0.71284735", "0.7019751", "0.6953815", "0.69463587", "0.692755", "0.68277055", "0.68116534", "0.67346174", "0.67313653", "0.6681488", "0.6669689", "0.6644886", "0.66233927", "0.6598368", "0.6578729", "0.6555024", "0.6522613", "0.6482285", "0.6476952", "0.6449418", "0.63909006", "0.62373954", "0.6191614", "0.6165488", "0.6112981", "0.60047895", "0.5963359", "0.5959166", "0.59438777", "0.59033924", "0.5852814", "0.5819146", "0.58148515", "0.57168394", "0.5700367", "0.5696778", "0.5684611", "0.5679919", "0.56348526", "0.5594426", "0.5592687", "0.5586991", "0.5515428", "0.5504926", "0.55043757", "0.54667896", "0.54559207", "0.5433522", "0.5430051", "0.54228675", "0.5403518", "0.5387442", "0.53647155", "0.53647155", "0.53567755", "0.53533155", "0.5351523", "0.5350724", "0.5347175", "0.534087", "0.53159535", "0.529401", "0.5267435", "0.52524424", "0.525047", "0.5246054", "0.522874", "0.52012175", "0.51999795", "0.5149103", "0.5144429", "0.51390916", "0.5131627", "0.51183224", "0.5116723", "0.51149064" ]
0.7389948
16
6: Write a function called checkSeason, it takes a month parameter and returns the season:Autumn, Winter, Spring or Summer.
function checkSeason(month) { if (month === 9) { console.log("The season is Autumn."); } else if (month === 8) { console.log("The season is Autumn."); } else if (month === 7) { console.log("The season is Autumn."); } else if (month === 10) { console.log("The season is Winter."); } else if (month === 11) { console.log("The season is Winter."); } else if (month === 12) { console.log("The season is Winter."); } else if (month === 1) { console.log("The season is Spring."); } else if (month === 2) { console.log("The season is Spring."); } else if (month === 3) { console.log("The season is Spring."); } else { console.log("The season is Summer."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSeason() {\n month = d.getMonth() + 1;\n if (3 <= month && month <= 5) {\n return 'spring';\n }\n else if (6 <= month && month <= 8) {\n return 'summer';\n }\n else if (9 <= month && month <= 11) {\n return 'fall';\n }\n else{\n return 'winter';\n }\n }", "function seasonActualizer() {\n let date = new Date\n let month = (date.getMonth() + 1) % 12;\n const summer = [6, 7, 8];\n const fall = [9, 10, 11];\n const winter = [12, 1, 2];\n const spring = [3, 4, 5];\n\n if (summer.includes(month)) {\n return 3;\n } else if (fall.includes(month)) {\n return 4;\n } else if (winter.includes(month)) {\n return 1;\n } else if (spring.includes(month)){\n return 2;\n } else {\n return 1\n }\n }", "function whichMonths(season) {\n let monthsInSeason;\n let enun;\n //DEPOIS DA ATIVIDADE USANDO ENUN EM VEZ DE SWITCH\n let Season;\n (function (Season) {\n Season[\"Fall\"] = \"September to November\";\n Season[\"Winter\"] = \"December to February\";\n Season[\"Spring\"] = \"March to May\";\n Season[\"Summer\"] = \"June to August\";\n })(Season || (Season = {}));\n /*\n ANTES DA ATIVADE\n \n switch (season) {\n case \"Fall\":\n monthsInSeason = \"September to November\";\n break;\n case \"Winter\":\n monthsInSeason = \"December to February\";\n break;\n case \"Spring\":\n monthsInSeason = \"March to May\";\n break;\n case \"Summer\":\n monthsInSeason = \"June to August\";\n }*/\n // return monthsInSeason;\n return Season.Fall;\n}", "function getSeasonIndex() {\n var date = new Date();\n var month = date.getMonth();\n if (month == 9 || month == 10 || month == 11) {\n return 1;\n } else {\n return 0;\n }\n}", "function checkMonth (month) {\n if(month.toLowerCase() === \"january\"){\n return 1;\n }else if (month.toLowerCase() == \"febuary\") {\n return 2;\n }else if (month.toLowerCase() == \"march\") {\n return 3;\n }else if (month.toLowerCase() == \"april\") {\n return 4;\n }else if (month.toLowerCase() == \"may\") {\n return 5;\n }else if (month.toLowerCase() == \"june\") {\n return 6;\n }else if (month.toLowerCase() == \"july\") {\n return 7;\n }else if (month.toLowerCase() == \"august\") {\n return 8;\n }else if (month.toLowerCase() == \"september\") {\n return 9;\n }else if (month.toLowerCase() == \"october\") {\n return 10;\n }else if (month.toLowerCase() == \"november\") {\n return 11;\n }else if (month.toLowerCase() == \"december\") {\n return 12;\n }else{\n return \"invalid month\";\n }\n}", "function getCurrentSeason(date){\n var mm, yyyy, dd;\n\n if(!date){\n // No date was set, use the current date\n var today = timezone().tz(\"America/Vancouver\").format(\"L\");\n mm = today.slice(0,2);\n dd = today.slice(3,5);\n yyyy = today.slice(6);\n }else{\n // Date was passed as a parameter use it to determine the current season\n yyyy = date.slice(0,4);\n mm = date.slice(4,6);\n dd = date.slice(6);\n }\n\n var currentSeason;\n\n if(parseInt(mm) >= 9){\n // September is a safe bet for start of new season - usually starts around mid to late October\n var nextYear = parseInt(yyyy) + 1;\n currentSeason = yyyy + \"-\" + nextYear + \"-regular\";\n }else{\n // then we are looking back at the previous year - either in progress or offseason\n var prevYear = parseInt(yyyy) -1;\n currentSeason = prevYear + \"-\" + yyyy + \"-regular\";\n }\n return currentSeason;\n}", "function monthCheck(month, leapYear = false){\n if(month === 'February' && leapYear === true){\n result = `${month} has 29 days in it`;\n }\n else if(month === 'February' && leapYear === false){\n result = `${month} has 28 days in it`;\n }\n else {\n switch(month) {\n case 'April':\n case 'June':\n case 'September':\n case 'November':\n result = `${month} has 30 days in it!`; \n break;\n\n case 'January':\n case 'March':\n case 'May':\n case 'July':\n case 'August':\n case 'October':\n case 'December':\n result = `${month} has 31 days in it`;\n } \n }\n console.log(result);\n}", "function isMonth (s)\r\n{ if (isEmpty(s))\r\n if (isMonth.arguments.length == 1) return defaultEmptyOK;\r\n else return (isMonth.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 12);\r\n}", "function isMonth (s)\r\n{ if (isEmpty(s))\r\n if (isMonth.arguments.length == 1) return defaultEmptyOK;\r\n else return (isMonth.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 12);\r\n}", "function fourSeasons(d){\n if (d > 365) {\n return 'The year flew by!';\n }\n const springStart = 79;\n const summerStart = 171;\n const autumnStart = 263;\n const winterStart = 354;\n\n switch(true) {\n case (d > springStart && d <= summerStart):\n return 'Spring Season';\n case (d > summerStart && d <= autumnStart):\n return 'Summer Season';\n case (d > autumnStart && d <= winterStart):\n return 'Autumn Season';\n case (d > winterStart || d <= springStart):\n return 'Winter Season';\n }\n}", "function monthOf31(month) {\n var thirtyOne = {\n \"3\": true,\n \"5\": true,\n \"7\": true,\n \"8\": true,\n \"10\": true,\n \"12\": true\n };\n var thirty = {\n \"4\": false,\n \"6\": false,\n \"9\": false,\n \"11\": false\n };\n if (thiryOne[month.toString()]) {\n return true;\n } else {\n return false;\n }\n}", "function setSeasons(daynumber)\n{ \n //December Solstice to March Equinox\n if(daynumber >= 355 || daynumber < 79)\n {\n PIEchangeDisplayText(northSeason, winterSeason);\n PIEchangeDisplayText(southSeason, summerSeason);\n }\n //March Equinox to June Solstice\n else if(daynumber >= 79 && daynumber < 172)\n {\n PIEchangeDisplayText(northSeason, springSeason);\n PIEchangeDisplayText(southSeason, autumnSeason);\n }\n //June Solstice to September Equinox\n else if(daynumber >= 172 && daynumber < 265)\n {\n PIEchangeDisplayText(northSeason, summerSeason);\n PIEchangeDisplayText(southSeason, winterSeason);\n }\n //September Equinox to December Solstice\n else\n {\n PIEchangeDisplayText(northSeason, autumnSeason);\n PIEchangeDisplayText(southSeason, springSeason);\n }\n}", "function daysInMonth(month, leapYear = false) {\n let thirtyOne = ['January', 'March', 'May', 'July', 'August', 'October', 'December'];\n let thirty = ['April', 'June', 'September', 'November'];\n\n if (!(thirtyOne.includes(month) || thirty.includes(month) || month === 'February')) {\n throw 'Must provide a valid month';\n }\n\n switch (true) {\n case thirtyOne.includes(month):\n return `${month} has 31 days`;\n\n case thirty.includes(month):\n return `${month} has 30 days`;\n\n case month === 'February':\n if (leapYear === true) {\n return 'February has 29 days';\n } else {\n return 'February has 28 days';\n }\n }\n}", "function addMonthSeason(image) { \n image = ee.Image(image);\n \n // set month\n var month = ee.Number.parse(image.date().format('M'));\n image = image.set({month: month});\n \n // set season (1=winter, 2=spring, 3=summer, 4=autumn)\n var s = ee.Algorithms.If(month.eq(ee.Number(1)),ee.Number(1),\n ee.Algorithms.If(month.eq(ee.Number(2)),ee.Number(1),\n ee.Algorithms.If(month.eq(ee.Number(3)),ee.Number(2),\n ee.Algorithms.If(month.eq(ee.Number(4)),ee.Number(2),\n ee.Algorithms.If(month.eq(ee.Number(5)),ee.Number(2),\n ee.Algorithms.If(month.eq(ee.Number(6)),ee.Number(3),\n ee.Algorithms.If(month.eq(ee.Number(7)),ee.Number(3),\n ee.Algorithms.If(month.eq(ee.Number(8)),ee.Number(3),\n ee.Algorithms.If(month.eq(ee.Number(9)),ee.Number(4),\n ee.Algorithms.If(month.eq(ee.Number(10)),ee.Number(4),\n ee.Algorithms.If(month.eq(ee.Number(11)),ee.Number(4),\n ee.Algorithms.If(month.eq(ee.Number(12)),ee.Number(1)))))))))))));\n \n image = image.set({season: s});\n \n return image;\n }", "function daysInGivenMonth(year, month){\n //thisMonth = dateObj.getMonth(); //calculating number of days in the month\n month == 1 && (year % 4 == 0) ? daysInMonth = 29 \n : month == 1 && (year % 4 !== 0) ? daysInMonth = 28\n : monthHas30Days.includes(month) ? daysInMonth = 30 \n : daysInMonth = 31;\n return daysInMonth;\n}", "function parseMonth(month) {\r\n var matches = monthNames.filter(function(item) { \r\n return new RegExp(\"^\" + month, \"i\").test(item);\r\n });\r\n if (matches.length == 0) {\r\n throw new Error(\"Invalid month string\");\r\n }\r\n if (matches.length < 1) {\r\n throw new Error(\"Ambiguous month\");\r\n }\r\n return monthNames.indexOf(matches[0]);\r\n}", "function seasonToColour(season) {\n switch (season) {\n case 0:\n return \"winter\";\n case 1:\n return \"spring\";\n case 2:\n return \"summer\";\n case 3:\n return \"autumn\";\n default:\n return \"black\";\n }\n}", "function daysInMonth(month)\r\n{\r\n var monthIndex = month.getMonth();\r\n var year = month.getFullYear();\r\n if (monthIndex == 0 || monthIndex == 2 || monthIndex == 4 || monthIndex == 6 || monthIndex == 7 || monthIndex == 9 || monthIndex == 11)\r\n {\r\n return 31;\r\n }\r\n else if (monthIndex == 1)\r\n {\r\n if (((year % 4) == 0) && (((year % 100) != 0) || (year % 400 == 0)))\r\n {\r\n return 29;\r\n }\r\n else\r\n {\r\n return 28;\r\n }\r\n }\r\n else\r\n {\r\n return 30;\r\n }\r\n}", "function getValidMonth(){\r\n\treturn 4;\r\n}", "function getValidMonth(){\r\n\treturn 5;\r\n}", "function getValidMonth(){\r\n\treturn 5;\r\n}", "function animeSeasonSelect(season){\n\tconsole.log(\"Season is \" + season)\n\tvar section\n\tif (season == 1){\n\t\tsection = \"SymphogearSeasonOneAnimeData\"\n\t}\n\telse if(season == 2){\n\t\tsection = \"SymphogearSeasonTwoAnimeData\"\n\t}\n\telse if(season == 3){\n\t\tsection = \"SymphogearSeasonThreeAnimeData\"\n\t}\n\telse if(season == 4){\n\t\tsection = \"SymphogearSeasonFourAnimeData\"\n\t}\n\telse if(season == 5){\n\t\tsection = \"SymphogearSeasonFiveAnimeData\"\n\t}\n\treturn section\n}", "async function checkDateMatchCurrentSeason(datetimeObj){\n const current_season_date = await getCurrentSeasonDate()\n return current_season_date[0] == datetimeObj.getFullYear() || datetimeObj.getFullYear() == current_season_date[1] \n}", "function getValidMonth(){\n\treturn 5;\n}", "function getValidMonth(){\n\treturn 5;\n}", "function daysInAMonth(month, leapYear) {\n if (month === 'February' && leapYear) {\n return 28;\n } if (month === 'February' && !leapYear) {\n return 29;\n }\n\n switch (month) {\n case 'January':\n case 'March':\n case 'May':\n case 'July':\n case 'August':\n case 'October':\n case 'December':\n return `There are 31 days in ${month}`\n break;\n }\n\n switch (month) {\n case 'April':\n case 'June':\n case 'September':\n case 'November':\n return `There are 30 days in ${month}`\n break;\n }\n throw ('You must enter a month with capitalization!');\n}", "function formatMonth(month) {\n var formattedMonth;\n if (month == \"Jan\") {\n formattedMonth = \"January\";\n } else if (month == \"Feb\") {\n formattedMonth = \"February\";\n } else if (month == \"Mar\") {\n formattedMonth = \"March\";\n } else if (month == \"Apr\") {\n formattedMonth = \"April\";\n } else if (month == \"May\") {\n formattedMonth = month;\n } else if (month == \"Jun\") {\n formattedMonth = \"Jun\";\n } else if (month == \"Jul\") {\n formattedMonth = \"July\";\n } else if (month == \"Aug\") {\n formattedMonth = \"August\";\n } else if (month == \"Sep\") {\n formattedMonth = \"September\";\n } else if (month == \"Oct\") {\n formattedMonth = \"October\";\n } else if (month == \"Nov\") {\n formattedMonth = \"November\";\n } else if (month == \"Dec\") {\n formattedMonth = \"December\";\n } else {\n console.log(\"Error: month\" + month);\n return false;\n }\n return formattedMonth;\n}", "function validateMonth(month)\n {\n var valid = true;\n if(isNaN(month))\n {\n valid = false;\n }\n else\n {\n var num = parseInt(month);\n if (num <1 || num >12)\n {\n valid = false;\n }\n }\n return valid;\n }", "function getSeasonName () {\n if (SEASONS.indexOf(SEASON) === SEASONS.length - 1) {\n return 'latest'\n } else {\n return SEASON\n }\n}", "function getSeasonName() {\n if (SEASONS.indexOf(SEASON) === SEASONS.length - 1) {\n return 'latest'\n } else {\n return SEASON\n }\n}", "function getSemesterName( season, year ) {\n return season + \" \" + year;\n}", "function DrawSeasonCalendar() {\n let ourDate = BackendHelper.Filter.CalendarDate;\n let firstDayOfMonthDate = new C_YMD(ourDate.Year, ourDate.Month, 1);\n let firstDayOfMonthDayOfWeek = firstDayOfMonthDate.DayOfWeek();\n\n CalendarModalDate = ourDate;\n $('#vitasa_modal_calendar_date')[0].innerText = MonthNames[ourDate.Month - 1] + \" - \" + ourDate.Year.toString();\n //$('#vitasa_cal_date')[0].innerText = MonthNames[OurDate.Month - 1] + \" - \" + OurDate.Year.toString();\n\n for(let x = 0; x !== 7; x++) {\n for(let y = 0; y !== 7; y++) {\n let calSelector = \"#vitasa_cal_\" + x.toString() + y.toString();\n let calCel = $(calSelector)[0];\n let dn = x * 7 + (y - firstDayOfMonthDayOfWeek + 1);\n\n if (x === 0) {\n if (y < firstDayOfMonthDayOfWeek) {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n else {\n //let thisdate = new C_YMD(ourDate.Year, ourDate.Month, dn);\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n }\n else {\n let date = new C_YMD(ourDate.Year, ourDate.Month, dn);\n let daysInMonth = date.DaysInMonth();\n\n if (date.Day <= daysInMonth) {\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n else {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n }\n }\n }\n}", "function validateMonth(oMon) {\n var isValidMon = false,\n existMonths = shareData.curFyMonths;\n angular.forEach(existMonths, function (month, i) {\n if (month.value == oMon) {\n isValidMon = true;\n }\n })\n return isValidMon;\n\n }", "function getMonth(month) {\n\n // DAY WEEK IN PORTUGUESE\n switch (month) {\n case 0:\n $month = \"Janeiro\"\n break\n case 1:\n $month = \"Fevereiro\"\n break\n case 2:\n $month = \"Março\"\n break\n case 3:\n $month = \"Abril\"\n break\n case 4:\n $month = \"Maio\"\n break\n case 5:\n $month = \"Junho\"\n break\n case 6:\n $month = \"Julho\"\n break\n case 7:\n $month = \"Agosto\"\n break\n case 8:\n $month = \"Setembro\"\n break\n case 9:\n $month = \"Outubro\"\n break\n case 10:\n $month = \"Novembro\"\n break\n case 11:\n $month = \"Dezembro\"\n break\n default:\n $month = \"\";\n }\n return $month;\n}", "function GeefSterrenBeeld(date, month) {\n if (month == 1 && date >= 20 || month == 2 && date <= 18) { return \"Waterman\"; }\n if (month == 2 && date >= 19 || month == 3 && date <= 20) { return \"Vissen\"; }\n if (month == 3 && date >= 21 || month == 4 && date <= 19) { return \"Ram\"; }\n if (month == 4 && date >= 20 || month == 5 && date <= 20) { return \"Stier\"; }\n if (month == 5 && date >= 21 || month == 6 && date <= 21) { return \"Tweeling\"; }\n if (month == 6 && date >= 22 || month == 7 && date <= 22) { return \"Kreeft\"; }\n if (month == 7 && date >= 23 || month == 8 && date <= 22) { return \"Leeuw\"; }\n if (month == 8 && date >= 23 || month == 9 && date <= 22) { return \"Maagd\"; }\n if (month == 9 && date >= 23 || month == 10 && date <= 22) { return \"Weegschaal\"; }\n if (month == 10 && date >= 23 || month == 11 && date <= 21) { return \"Schorpioen\"; }\n if (month == 11 && date >= 22 || month == 12 && date <= 21) { return \"Boogschutter\"; }\n if (month == 12 && date >= 22 || month == 1 && date <= 19) { return \"Steenbok\"; }\n\n return \"What.\"\n}", "function daysInMonth(month, leapYear) {\n if (month === 'January') {\n return 31;\n }\n if (month === 'March') {\n return 31;\n }\n if (month === 'April') {\n return 30;\n }\n if (month === 'May') {\n return 31;\n }\n if (month === 'June') {\n return 30;\n }\n if (month === 'July') {\n return 31;\n }\n if (month === 'August') {\n return 31;\n }\n if (month === 'September') {\n return 30;\n }\n if (month === 'October') {\n return 31;\n }\n if (month === 'November') {\n return 30;\n }\n if (month === 'December') {\n return 31;\n }\n if (leapYear === true && month === 'February') {\n return 29;\n }\n if (leapYear === false && month === 'February') {\n return 28;\n }\n else {\n throw new Error('Must provide a valid month');\n }\n}", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n\t if ( month === 1 && date > 28) {\n\t return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n\t }\n\n\t if ( month === 3 || month === 5 || month === 8 || month === 10) {\n\t return date < 31;\n\t }\n\n\t return true;\n\t }", "function isDay (s)\r\n{ if (isEmpty(s))\r\n if (isDay.arguments.length == 1) return defaultEmptyOK;\r\n else return (isDay.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 31);\r\n}", "function isDay (s)\r\n{ if (isEmpty(s))\r\n if (isDay.arguments.length == 1) return defaultEmptyOK;\r\n else return (isDay.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 31);\r\n}", "function HighOrLowSeason(date) {\n\n var newDate = new Date(date);\n \n newDate.setFullYear(2000);\n //Checks if the new date is inside the highSeason.\n if (newDate > højsæsonStart && newDate < højsæsonSlut) {\n return true;\n }\n else {\n return false;\n }\n}", "function validateBirthmonth(month_of_birth) {\r\n if (month_of_birth < 1 || month_of_birth > 12) {\r\n alert(\"month invalid\");\r\n }\r\n else {\r\n month_of_birth = month_of_birth;\r\n return month_of_birth;\r\n }\r\n\r\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function daysInMonth(month, year) {\n switch (month) {\n case (1):\n return (leapYear(year)) ? 29 : 28;\n case (3):\n case (5):\n case (8):\n case (10):\n return 30;\n default:\n return 31;\n }\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function monthDays(month) {\n\tlet daysInMonth = 31;\n\n\tswitch (month) {\n\t\tcase \"January\":\n\t\t// return `${month} has ___ days`\n\t\t\tdaysInMonth = 31;\n\t\t\tbreak;\n\t\tcase \"February\":\n\t\t\treturn 'February has 28 or 29 days';\n\t\t\tbreak;\n\t\tcase \"March\": \n\t\t\treturn 'March has 31 days';\n\t\t\tbreak;\n\t\tcase \"April\":\n\t\t\treturn 'April has 30 days';\n\t\t\tbreak;\n\t\tcase \"May\":\n\t\t\treturn 'May has 31 days';\n\t\t\tbreak;\n\t\tcase \"June\":\n\t\t\treturn 'June has 30 days';\n\t\t\tbreak;\n\t\tcase \"July\":\n\t\t\treturn 'July has 31 days';\n\t\t\tbreak;\n\t\tcase \"August\":\n\t\t\treturn 'August has 31 days';\n\t\t\tbreak;\n\t\tcase \"September\":\n\t\t\treturn 'September has 30 days';\n\t\t\tbreak;\n\t\tcase \"October\":\n\t\t\treturn 'October has 31 days';\n\t\t\tbreak;\n\t\tcase \"November\":\n\t\t\treturn 'November has 30 days';\n\t\t\tbreak;\n\t\tcase \"December\":\n\t\t\treturn 'December has 31 days';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn `${month} has ${daysInMonth} days`;\n\n}", "dayOfWeek(day, month, year) {\n var y0 = year - Math.floor((14 - month) / 12);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n m0 = month + 12 * Math.floor((14 - month) / 12) - 2;\n var d0 = (day + x + Math.floor((31 * m0) / 12)) % 7;\n console.log(d0);\n var res = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wendsday\", \"Thursday\", \"Friday\", \"saturday\"];\n if (d0 <= res.length) {\n console.log(\"The day falls on :\" + res[d0])\n } else {\n console.log(\"Invalid day \")\n }\n }", "function endOfMonth(month, year) {\r\n var thirtyOneDayMonths = new Array(1, 3, 5, 7, 8, 10, 12);\r\n var thirtyDayMonths = new Array(4, 6, 9, 11);\r\n\r\n for (var thirtyOneDayMonth in thirtyOneDayMonths) {\r\n if (thirtyOneDayMonths[thirtyOneDayMonth] == month) {\r\n return 31;\r\n }\r\n }\r\n for (var thirtyDayMonth in thirtyDayMonths) {\r\n if (thirtyDayMonths[thirtyDayMonth] == month) {\r\n return 30;\r\n }\r\n }\r\n if (year % 400 == 0) {\r\n return 29;\r\n }\r\n if (year % 100 == 0) {\r\n return 28;\r\n }\r\n if (year % 4 == 0) {\r\n return 29;\r\n } else {\r\n return 28;\r\n }\r\n}", "function dayOfTheWeekInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm, 1).getDay();\n }", "function birthday(month,day){\n if (month===7 && day===7){\n console.log(\"How did you know?\");\n } else console.log(\"Just another day....\")\n}", "function getLeagueSeason(league, season){\n\tvar resource_url = 'http://api.football-data.org/alpha/soccerseasons';\n\tresource_url += season == null ? \"\" : \"?season=\"+season;\n\tvar answer;\n\tjQuery.ajax({\n\t\theaders: { 'X-Auth-Token': api_key },\n\t\turl: resource_url,\n\t\tdataType: 'json',\n\t\ttype: 'GET',\n\t\tasync: false,\n\t\tsuccess: function(response) {\n\t\t\tfor(var i=0; i<response.length; i++){\n\t\t\t\tvar season = response[i];\n\t\t\t\tif(season.league === league){\n\t\t\t\t\tanswer = season;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t});\n\treturn answer;\n}", "function daysInFebruary (year)\r\n{\r\n // February has 29 days in any year evenly divisible by four,\r\n // EXCEPT for centennial years which are not also divisible by 400\r\n return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );\r\n}", "function has31Days(month) {\n\t\t// If the month is January, March, May, July, August, October, or\n\t\t// December, then return true.\n\t\tif (month == 0 || month == 2 || month == 4 || month == 6 \n\t\t\t|| month == 7 || month == 9 || month == 11) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Otherwise, return false.\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isValid(year, month, date) {\n if (!(0 < date && date < 31)) {\n return false;\n }\n if (!(0 <= month && month < 11)) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function daysInFebruary (year)\r\n{ // February has 29 days in any year evenly divisible by four,\r\n // EXCEPT for centurial years which are not also divisible by 400.\r\n return ( ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );\r\n}", "function daysInFebruary (year)\r\n{ // February has 29 days in any year evenly divisible by four,\r\n // EXCEPT for centurial years which are not also divisible by 400.\r\n return ( ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );\r\n}", "function goodMonth() { //for step 135 **write own if statement\n var m = new Date();\n if (m.getMonth() > 10) { \n document.getElementById(\"Greeting\").innerHTML = \"Happy Holidays.\";\n } else {\n document.getElementById(\"Greeting\").innerHTML = \"Hello.\";\n }\n}", "function isValid(year, month, date) {\n\t\t\tif (date < 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( month === 1 && date > 28) {\n\t\t\t\treturn date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n\t\t\t}\n\n\t\t\tif ( month === 3 || month === 5 || month === 8 || month === 10) {\n\t\t\t\treturn date < 31;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function daysInMonth(month, year) {\n let result = '';\n if (year % 4 === 0) {\n result += 'February has 29 days';\n }\n else {\n switch (month) {\n case 'January':\n case 'March':\n case 'May':\n case 'July':\n case 'August':\n case 'October':\n case 'December':\n result = `${month} has 31 days`;\n break;\n case 'April':\n case 'June':\n case 'September':\n case 'November':\n result = `${month} has 30 days`;\n break;\n case 'February':\n result = `${month} has 28 days`;\n break;\n }\n }\n return result\n}", "function get_month(month){\n\tvar m;\n\tswitch (month){\n\t\tcase 'January':\n\t\t\tm='01';\n\t\t\tbreak;\n\t\tcase 'February':\n\t\t\tm='02';\n\t\t\tbreak;\n\t\tcase 'March':\n\t\t\tm='03';\n\t\t\tbreak;\n\t\tcase 'April':\n\t\t\tm='04';\n\t\t\tbreak;\n\t\tcase 'May':\n\t\t\tm='05';\n\t\t\tbreak;\n\t\tcase 'June':\n\t\t\tm='06';\n\t\t\tbreak;\n\t\tcase 'July':\n\t\t\tm='07';\n\t\t\tbreak;\n\t\tcase 'August':\n\t\t\tm='08';\n\t\t\tbreak;\n\t\tcase 'September':\n\t\t\tm='09';\n\t\t\tbreak;\n\t\tcase 'October':\n\t\t\tm='10';\n\t\t\tbreak;\n\t\tcase 'November':\n\t\t\tm='11';\n\t\t\tbreak;\n\t\tcase 'December':\n\t\t\tm='12';\n\t\t\tbreak;\n\t}\n\treturn m;\n}", "function birthday(day,month){\n var myDay = 20;\n var myMonth = 11;\n if(day == myDay && month == myMonth){\n console.log(\"How did you know!\");\n }\n else{\n console.log(\"Just another day.\");\n }\n}", "function howManyDays(month, leapYear) {\n switch(month.toLowerCase()) {\n case 'january': //31\n case 'march': // 31\n case 'may': //31\n case 'july': //31\n case 'august': //31\n case 'october': //31\n case 'december': //31\n return `${month} has 31 days in it`;\n case 'april': // 30\n case 'june': // 30\n case 'september': //30\n case 'november': //30\n return `${month} has 30 days in it`;\n case 'february': //28 or 29\n if (leapYear === true) {\n return `${month} has 29 days in it`;\n } else {\n return `${month} has 28 days in it`;\n }\n }\n return new Error(\"Must provide a valid month.\")\n}", "function isDateOk(Y, M, D) {\n var ML = [,31,28,31,30,31,30,31,31,30,31,30,31];\n var L = ML[M]; // Improved after LRN\n \n // var msg = 'Day = '+D+', Month = '+M+', Year = '+Y;\n var valid = D>0 && !!L && (D<=L || D==29 && Y%4==0 && (Y%100!=0 || Y%400==0) );\n // alert(msg+', Is valid = '+valid);\n return valid;\n}", "function hebrew_month_days(year, month) {\n // First of all, dispose of fixed-length 29 day months\n if (month == 2 || month == 4 || month == 6 || month == 10 || month == 13) {return 29;}\n if (month == 12 && !hebrew_leap(year)) {return 29;} // If it's not a leap year, Adar has 29 days\n if (month == 8 && !(mod(hebrew_year_days(year), 10) == 5)) {return 29;} // If it's Heshvan, days depend on length of year\n // Similarly, Kislev varies with the length of year\n if (month == 9 && (mod(hebrew_year_days(year), 10) == 3)) {return 29;}\n // Nope, it's a 30 day month\n return 30;\n}", "function getDaysInMonth(year, month) {\r\n if (month === 2) {\r\n if (isLeapYear(year)) {\r\n return 29;\r\n } else {\r\n return 28;\r\n }\r\n } else if ((month === 1) || (month === 3) || (month === 5) || (month === 7)\r\n || (month === 8) || (month === 10) || (month === 12)) {\r\n return 31;\r\n } else {\r\n return 30;\r\n }\r\n}", "function calculardiasdel_mes(month){\n if(month==-1)month=11;\n if(month ==0|| month==2 ||month==4|| month==6|| month==7||month==9||month==11 ){\n return 31;\n }else if(month==3||month==5||month==8||month==10){\n return 30;\n }else{\n return bisciesto() ? 29:28;\n }\n}", "function monthReturn(month) {\n var months = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';\n var dateMonth = new Date();\n var dateCheck = new Date();\n var actualMonth;\n var pos = months.indexOf(month.substring(0, 3));\n dateMonth.setMonth(pos / 3);\n if ((dateCheck.getMonth() + 1) > (dateMonth.getMonth() + 1)) {\n actualMonth = new Date(dateMonth.getFullYear() + 1, dateMonth.getMonth() + 1, 0);\n } else {\n actualMonth = new Date(dateMonth.getFullYear(), dateMonth.getMonth() + 1, 0);\n }\n return actualMonth;\n}", "function getDaysInMonth(month) {\n if (month == 9 || month == 11) {\n return 30;\n } else {\n return 31;\n }\n}", "function getDaysInMonth(year, month) {\r\n switch (month) {\r\n case 1:\r\n case 3:\r\n case 5:\r\n case 7:\r\n case 8:\r\n case 10:\r\n case 12:\r\n return 31;\r\n case 4:\r\n case 6:\r\n case 9:\r\n case 11:\r\n return 30;\r\n case 2:\r\n if (year % 400 === 0) { \r\n return 29;\r\n } else if ( year % 100 === 0) {\r\n return 28;\r\n } else if ( year % 4 === 0) {\r\n return 29;\r\n } else {\r\n return 28;\r\n }\r\n break;\r\n default: throw new Error('Unknown month: ' + month);\r\n }\r\n }", "monthof(m) { \n switch (m) {\n case 1: return 31;\n break;\n case 2: return 28;\n break;\n case 3: return 31;\n break;\n case 4: return 30;\n break;\n case 5: return 31;\n break;\n case 6: return 30;\n break;\n case 7: return 31;\n break;\n case 8: return 31;\n break;\n case 9: return 30;\n break;\n case 10: return 31;\n break;\n case 11: return 30;\n break;\n case 12: return 31;\n break;\n\n }\n }", "function daysInFebruary (year){\n\t\t\treturn (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );\n\t\t}", "function getDaysInMonth(month, year)\r\n{\r\n // Assume that if the month isn't a number, it represents the \"blank\" value\r\n if(isNaN(month))\r\n {\r\n return 0;\r\n }\r\n else if(month == 2)\r\n {\r\n return daysInFebruary(year);\r\n }\r\n else if(month >= 1 && month < daysInMonth.length)\r\n {\r\n return daysInMonth[month - 1];\r\n }\r\n\r\n // If it's invalid, just return 0\r\n return 0;\r\n}", "function zodiac(month, day) {\n if((month == 1 && day <= 19) ||(month == 12 && day >= 22 )){\n return \"capricorn\";\n }else if((month == 2 && day <= 18) ||(month == 1 && day >= 20 )){\n return \"aquaries\";\n }else if((month == 3 && day <= 20) ||(month == 2 && day >= 19 )){\n return \"pisces\";\n }else if((month == 4 && day <= 19) ||(month == 3 && day >= 21 )){\n return \"aries\";\n }else if((month == 5 && day <= 20) ||(month == 4 && day >= 20 )){\n return \"taurus\";\n }else if((month == 6 && day <= 20) ||(month == 5 && day >= 21 )){\n return \"gemini\";\n }else if((month == 7 && day <= 22 ) ||(month == 6 && day >= 21 )){\n return \"cancer\";\n }else if((month == 8 && day <= 22) ||(month == 7 && day >= 23 )){\n return \"leo\";\n }else if((month == 9 && day <= 22) ||(month == 8 && day >= 23 )){\n return \"virgo\";\n }else if((month == 10 && day <= 22) ||(month == 9 && day >= 23 )){\n return \"libra\";\n }else if((month == 11 && day <= 21) ||(month == 10 && day >= 23 )){\n return \"scorpio\";\n }else if((month == 12 && day <= 21) ||(month == 11 && day >= 22 )){\n return \"sagittarius\";\n }\n}", "function charSeasonSelect(season){\n\tconsole.log(\"Season is \" + season)\n\tvar section\n\tif (season == 1){\n\t\tsection = \"SymphogearSeasonOneCharacterData\"\n\t}\n\telse if(season == 2){\n\t\tsection = \"SymphogearSeasonTwoCharacterData\"\n\t}\n\telse if(season == 3){\n\t\tsection = \"SymphogearSeasonThreeCharacterData\"\n\t}\n\telse if(season == 4){\n\t\tsection = \"SymphogearSeasonFourCharacterData\"\n\t}\n\telse if(season == 5){\n\t\tsection = \"SymphogearSeasonFiveCharacterData\"\n\t}\n\treturn section\n}", "function findEvent(date, month) {\n \tfor (var i = 0; i < parseInt(month[i]); i++) {\n \t\tif (date === parseInt(month[i])) {\n \t\t\tz = i;\n \t\t\tbreak;\n \t\t// } else if (date > parseInt(month[i])){\n \t\t// \tz = month.length;\n \t\t} else if (date < parseInt(month[i])){\n\t\t\tz = i;\n \t\t\tbreak;\n \t\t}\n \t}\n\treturn z;\n }", "function birthday(bday, bMonth)\r\n{\r\n if (bday == 5 || bMonth == 9)\r\n {\r\n console.log(\"How did you know?\")\r\n }\r\n else \r\n {\r\n console.log(\"Just another day....\")\r\n }\r\n\r\n}" ]
[ "0.7930279", "0.79269266", "0.7269071", "0.7255933", "0.6924466", "0.68562376", "0.6493932", "0.6463682", "0.6463682", "0.6260932", "0.6144034", "0.61049837", "0.60054785", "0.59470886", "0.5892112", "0.58111554", "0.58016074", "0.5799047", "0.5778231", "0.5759706", "0.5759706", "0.5753914", "0.57388407", "0.5725237", "0.5725237", "0.57094085", "0.57044035", "0.5662975", "0.56196135", "0.5609599", "0.5599227", "0.55897224", "0.55870414", "0.5580207", "0.5578418", "0.55597645", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.55453867", "0.5545163", "0.5541911", "0.5541911", "0.55170834", "0.5515515", "0.55152553", "0.55152553", "0.55152553", "0.54993063", "0.54993063", "0.54993063", "0.54993063", "0.54993063", "0.54993063", "0.54993063", "0.54956084", "0.5494969", "0.5473544", "0.5473492", "0.54696435", "0.54681444", "0.54643524", "0.5459451", "0.54480284", "0.54440516", "0.5441837", "0.5433945", "0.5433945", "0.5420082", "0.54134417", "0.54111606", "0.53978163", "0.53550315", "0.53404015", "0.5328429", "0.5289995", "0.528683", "0.5284699", "0.52829444", "0.5273179", "0.5268196", "0.5257837", "0.52555895", "0.52532613", "0.52512383", "0.52347296", "0.5221566", "0.52109826" ]
0.878837
0
All roman numerals answers should be provided in uppercase.
function convertToRoman(num) { let romanNums = { 1000: "M", 900: "CM", 500: "D", 400: "CD", 100: "C", 90: "XC", 50: "L", 40: "XL", 10: "X", 9: "IX", 5: "V", 4: "IV", 1: "I", } let keys = Object.keys(romanNums).reverse(); let romanNum = ""; keys.forEach(function(key) { while (key <= num) { romanNum += romanNums[key]; num -= key; } }); return romanNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RomanNumeralsHelper() {\n}", "function uppercase(input) {}", "function upperLetters(){\n // start at the position of the first uppercase letter in the character set\n for (var i = 65; i <= 90; i++) {\n // push every lowercase letter from positions 65 to 90 into storedCharacters key\n answer.storedCharacters.push(String.fromCharCode(i));\n }\n}", "function uppercasePrompt() {\n uppercase = confirm(\"Should your password include uppercase letters?\");\n if (uppercase) {\n possibleChars = possibleChars.concat(uppercaseChars);\n }\n numeralsPrompt();\n}", "function romanize (num) {\n if (!+num)\n return false;\n var\tdigits = String(+num).split(\"\"),\n\t\tkey = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n\t\t \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n\t\t \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n\t\troman = \"\",\n\t\ti = 3;\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}", "function solution(roman){\n var sum = 0;\n var chars = roman.split('');\n var nums = [];\n\n\n var translate = function(letter) {\n switch(letter) {\n case \"M\":\n nums.push(1000);\n break;\n case 'D':\n nums.push(500);\n break;\n case 'C':\n nums.push(100);\n break;\n case 'L':\n nums.push(50);\n break;\n case 'X':\n nums.push(10);\n break;\n case 'V':\n nums.push(5);\n break;\n case 'I':\n nums.push(1);\n }\n };\n\n //convert each character to a number, push to numbers array\n for (var i=0; i<chars.length; i++) {\n translate(chars[i]);\n }\n\n //within numbers array, sum them up roman-numerals style\n for (var i=0; i<nums.length; i++) {\n if (nums[i] >= nums[i+1] || nums[i+1] == undefined) {\n sum += nums[i];\n }\n else {\n sum += nums[i+1] - nums[i];\n i++;\n }\n }\n\n return sum;\n}", "function romanToArabic(roman) {\n const numeralValues = {\n I: 1,\n V: 5,\n X: 10,\n L: 50,\n C: 100,\n D: 500,\n M: 1000,\n };\n\n let romanArray = roman.split('').map((i) => numeralValues[i]);\n console.log({ romanArray });\n\n let result = 0;\n // let i = 0;\n const range = romanArray.length;\n console.log({ range });\n\n for (let i = 0; i < range; ) {\n if (i === 0) {\n result += romanArray[i];\n i++;\n } else if (\n romanArray[i] <= romanArray[i - 1] &&\n romanArray[i] >= romanArray[i + 1]\n ) {\n result += romanArray[i];\n i++;\n } else if (romanArray[i] < romanArray[i + 1]) {\n result += romanArray[i + 1] - romanArray[i];\n i += 2;\n }\n console.log({ i });\n }\n console.log({ result });\n\n // console.log(romanArray[i-1]);\n\n return result;\n}", "function convertToRoman(num) {\n \n}", "function convertToRoman(num) {\n // get input\n num = document.getElementById(\"num\").value;\n // Create an empty string for the result \n let result = [];\n\n // list all relevant numbers and numerals\n let arabicNum = [1000000,500000,100000,50000,10000,5000,1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n \n let romanNum = [\"_M\",\"_D\",\"_C\",\"_L\",\"_X\",\"_V\",\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"];\n\n // Loop through the numbers while the number is greater than the number, keep looping\n arabicNum.map((number, i) => { \n while (num >= number) {\n // add numerals as you go --> loop numbers, find 1st, loop again, find 2nd\n result += romanNum[i];\n num -= number;\n }\n\n // add pop-up with result\n document.getElementById(\"answer\").innerHTML = result;\n });\n }", "function convertToRoman(num) {\n let numSplit = separateUnits(num); \n // console.log(numSplit); // Testing \n\n let romanNum = \"\";\n\nfor (let i=0; i<numSplit.length; i++){\n switch(numSplit[i]){\n case 3000:\n romanNum +=\"MMM\";\n break;\n case 2000:\n romanNum +=\"MM\";\n break;\n case 1000:\n romanNum +=\"M\";\n break; \n case 900:\n romanNum +=\"CM\";\n break;\n case 800:\n romanNum +=\"DCCC\";\n break;\n case 700:\n romanNum +=\"DCC\";\n break;\n case 600:\n romanNum +=\"DC\";\n break;\n case 500:\n romanNum +=\"D\";\n break;\n case 400:\n romanNum +=\"CD\";\n break;\n case 300:\n romanNum +=\"CCC\";\n break;\n case 200:\n romanNum +=\"CC\";\n break;\n case 100:\n romanNum +=\"C\";\n break;\n case 90:\n romanNum +=\"XC\";\n break;\n case 80:\n romanNum +=\"LXXX\";\n break;\n case 70:\n romanNum +=\"LXX\";\n break;\n case 60:\n romanNum +=\"LX\";\n break;\n case 50:\n romanNum +=\"L\";\n break;\n case 40:\n romanNum +=\"XL\";\n break;\n case 30:\n romanNum +=\"XXX\";\n break;\n case 20:\n romanNum +=\"XX\";\n break;\n case 10:\n romanNum +=\"X\";\n break;\n case 9:\n romanNum +=\"IX\";\n break;\n case 8:\n romanNum +=\"VIII\";\n break;\n case 7:\n romanNum +=\"VII\";\n break;\n case 6:\n romanNum +=\"VI\";\n break;\n case 5:\n romanNum +=\"V\";\n break;\n case 4:\n romanNum +=\"IV\";\n break;\n case 3:\n romanNum +=\"III\";\n break;\n case 2:\n romanNum +=\"II\";\n break;\n case 1:\n romanNum +=\"I\";\n break;\n}\n\n\n}\nreturn romanNum;\n} // function", "function allUppercase (input) {\n return input ? input.toUpperCase() : input;\n }", "function roman(int){\n arr = []\n i = 0\n while(int>=500){\n int = int - 500\n arr[i] = 'D'\n i++\n }\n while( int>= 100){\n int = int - 100\n arr[i] = 'C'\n i++\n }\n while( int>= 50){\n int = int-50\n arr[i] = 'L'\n i++\n }\n while(int>= 10){\n int = int-10\n arr[i] = 'X'\n i++\n }\n while(int>=5){\n int = int -5\n arr[i] = 'V'\n i++\n }\n while(int>0){\n int = int - 1\n arr[i] = 'I'\n i++\n }\n console.log(arr.join(''))\n}", "function numToRoman(num) {\n}", "function testInUpperCaseAlphabet(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\tvar lencodings = stringUtils.languageEncodings;\n\t\tvar isUpperCaseInAlphabet1 = stringUtils.isUpperCaseInAlphabet(\"abcdef\", encodings.ASCII, lencodings.ENGLISH);\n\t\tvar isUpperCaseInAlphabet2 = stringUtils.isUpperCaseInAlphabet(\"ABCDEF\", encodings.ASCII, lencodings.ENGLISH);\n\t\tvar isUpperCaseInAlphabet3 = stringUtils.isUpperCaseInAlphabet(\"0123456789\", encodings.ASCII, lencodings.ENGLISH);\n\t\tvar isUpperCaseInAlphabet4 = stringUtils.isUpperCaseInAlphabet(\"g\", encodings.ASCII, lencodings.ENGLISH);\n\t\tvar isUpperCaseInAlphabet5 = stringUtils.isUpperCaseInAlphabet(\"->?\", encodings.ASCII, lencodings.ENGLISH);\n\t\texpect(isUpperCaseInAlphabet1).to.eql(false);\n\t\texpect(isUpperCaseInAlphabet2).to.eql(true);\n\t\texpect(isUpperCaseInAlphabet3).to.eql(false);\n\t\texpect(isUpperCaseInAlphabet4).to.eql(false);\n\t\texpect(isUpperCaseInAlphabet5).to.eql(false);\n\t}", "function convertToRoman() {\n let numero = prompt('Ingrese el número a convertir:');\n let original = numero;\n\n function obtenerNumero(digito, cadenaUno, cadenaDos, cadenaTres) {\n switch (true) {\n \n case digito <= 3:\n return cadenaUno.repeat(digito);\n \n case digito === 4:\n return cadenaUno + cadenaDos;\n \n case digito <= 8:\n return cadenaDos + cadenaUno.repeat(digito - 5);\n \n default:\n return cadenaUno + cadenaTres;\n }\n }\n \n let cadena = '';\n \n cadena += 'M'.repeat(Math.floor(numero/1000));\n numero %= 1000;\n \n cadena += obtenerNumero(Math.floor(numero/100), 'C', 'D', 'M')\n numero %= 100;\n \n cadena += obtenerNumero(Math.floor(numero/10), 'X', 'L', 'C')\n numero %= 10;\n \n cadena += obtenerNumero(numero, 'I', 'V', 'X')\n \n alert(`${original} en números romanos equivale a: ${cadena}.`);\n\n return cadena;\n }", "static get romanNumeral() {\n return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/;\n }", "function toRoman(number) {\r\n const vals = [10, 9, 5, 4, 1];\r\n const syms = ['X', 'IX', 'V', 'IV', 'I'];\r\n roman = '';\r\n for (let i = 0; i < syms.length; i++) {\r\n while (number >= vals[i]) {\r\n number -= vals[i];\r\n roman += syms[i];\r\n }\r\n }\r\n return roman;\r\n}", "function i(e){return e[0].toUpperCase()+e.substr(1)}", "function capitalize2String(event3) {\n let userInput3 = event3.target.value;\n let answer3 = userInput3;\n\n // Codes\n let i = 0;\n answer3 = answer3.toLowerCase();\n mainAnswer = ' ';\n\n while (i < answer3.length) {\n if (i === 0) {\n mainAnswer += answer3[i].toUpperCase();\n }\n else if (answer3[i-1] === ' ') \n {\n mainAnswer += answer3[i].toUpperCase();\n }\n else {\n mainAnswer += answer3[i];\n }\n i++;\n }\n document.querySelector('#capResult2').innerText = mainAnswer;\n}", "function promptUpperChar () {\n var upperChar = prompt(\"Would you like a upper case character in your password?\" + \"\\nInput 'YES' or 'NO'\");\n var lowerUpperChar = upperChar.toLowerCase();\n\n if(lowerUpperChar === \"yes\" || lowerUpperChar === \"y\") {\n for(var i = 0; i < passLength; i++) {\n var selectUpperChar =\n upperCaseCharacters[Math.floor(Math.random() * upperCaseCharacters.length)];\n passArray.push(selectUpperChar);\n } \n promptLowerChar(); \n } else {\n promptLowerChar ();\n }\n }", "function romanNumerals() {\n for (let i = 0;)\n}", "function upperCaser(input) {\n return input.toUpperCase();\n}", "function mM(str) {\nvar array = str.split(\"\");\n\nvar ar = array.map( function(item,index) {\n if (index % 2== 0) {\n return item.toUpperCase();\n }\n\n else {\n return item;\n }\n}\n);\n\nreturn ar.join(\"\");\n}", "function capitalizeTyping(event) {\n let userInput = event.target.value;\n let answer = userInput.split(' ');\n\n // Codes\n let i = 0;\n while (i < answer.length) {\n answer[i] = answer[i].charAt(0).toUpperCase() + answer[i].slice(1).toLowerCase();\n i++;\n}\n document.querySelector('#capResult').innerText = answer.join (' ');\n}", "function convertToRoman(num) {\n\n //create an empty string\n var roman = \"\";\n //create an array of possible roman numerals up to 1000\n var romanNumeral = [\"M\", \"CM\", \"D\", \"CD\", \"C\", \"XC\", \"L\", \"XL\", \"X\", \"IX\", \"V\", \"IV\", \"I\"];\n //create array of possible number values\n var numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n //iterate for a length of our numbers array\n for (var i=0; i<numbers.length; i++) {\n //while original number is larger than inputted numbers array\n while(num >= numbers[i]) {\n //add its equivalent roman numeral to our original empty string\n roman = roman + romanNumeral[i];\n //subtract the value from original number to end the while loop\n num = num - numbers[i];\n }\n }\n return roman;\n}", "function convertToRoman(num) {\n var lookup = {M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},\n roman = '',\n i;\n for ( i in lookup ) {\n while ( num >= lookup[i] ) {\n roman += i;\n num -= lookup[i];\n }\n }\n return roman;\n}", "function upperValidation(){\n var upperCases = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n if(upperCasesChoice === 'yes'){\n return upperCases\n }else{\n return;\n }\n }", "function nombreEnMayuscula(n){\n n = n.toUpperCase()\n console.log(n)\n}", "function testConvertRomanNumerals(){\n var testCases = {\n 'VII': 7,\n 'vii': 7,\n 'I': 1,\n 'i': 1,\n 'IV': 4,\n 'Iv': 4,\n 'iV': 4,\n 'IX': 9,\n 'XCIV': 94,\n 'xciv': 94\n }\n\n var NanCases = {\n 'ggg': true\n }\n\n for(numeral in testCases) {\n var actual = convertRomanNumeral(numeral);\n if(actual !== testCases[numeral]) {\n console.log(`Failed on ${numeral}, expected ${testCases[numeral]} but got ${actual}`);\n return false;\n }\n }\n\n for(numeral in NanCases) {\n var actual = convertRomanNumeral(numeral);\n if (!isNaN(actual)) return false;\n }\n\n console.log(\"all tests pass\");\n return true;\n }", "function playerComputerUpperCase() {\n playerChoice = playerChoice.toUpperCase()\n computerChoice = computerChoice.toUpperCase()\n }", "function solution(number){\n var roman = {M:1000,CM:900, D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1 }\n var ans = '';\n while (number > 0) {\n for(a in roman) { \n if(roman[a] <= number) {\n ans += a; \n number -= roman[a]; \n break;\n } \n }\n }\n return ans;\n}", "function convMaiusc(z){\r\n\tv = z.value.toUpperCase();\r\n\tz.value = v;\r\n}", "function isRoman(s) {\n // http://stackoverflow.com/a/267405/1447675\n return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(s);\n}", "function kungfoo(input) {\n var array = input.split(' ').map(function(item, i){\n if(i%2 !== 0 && i !== 0){\n return item.toUpperCase()\n } else {\n return item\n }\n })\n return array.join(' ');\n}", "function yell(string) { return string.toUpperCase(); }", "function convertToRoman(num) {\n //works on numbers under 4000 only\n //array with roman numerals\n var romanNum = [\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"];\n //matching array with arabic numbers\n var arabicNum = [1000,900,500,400,100,90,50,40,10,9,5,4,1];\n //result will be string\n var result = \"\";\n\n //loop through length of array, same for both\n //maybe use indexOf?\n for(i = 0; i < romanNum.length; i++){\n //while input value is greater or equal to the current arabic num in array\n //example: 36; will start checking from 10 b/c smaller than 40\n while (num >= arabicNum[i]) {\n //input value - current arabic num in array\n num -= arabicNum[i];\n //result is the string of matching roman numeral in same spot of array\n //X+X+X, then is smaller than 10\n result += romanNum[i];\n }\n }\n return result;\n //return num;\n}", "function catSpeak(vocals) { // parameter is what funciton expects\n var specialMeow = vocals.toUpperCase();\n alert(specialMeow);\n}", "function upCase() {\n var upperCase = confirm(\"do you want to include upper case option\\n ok = yes cancel = no\");\n return upperCase; \n }", "function letrasMa(v){\n\treturn v.toUpperCase();\n}", "function imprimirNombreEnMayusculas(nombre){\n nombre = nombre.toUpperCase();\n console.log(nombre);\n}", "function romanDecrypt(str) {\n let p1 = [];\n let p2 = [];\n let result = [];\n str = str.split('');\n str.forEach((l, i) => {\n (i % 2 === 0) ? (i !== str.length - 1) ? p1.push(l) : p2.push(l) : p2.push(l);\n });\n return result.concat(p1, p2).join('');\n}", "function imprimirNombreEnMayusculas(nombre){\n nombre = nombre.toUpperCase()\n console.log(nombre)\n}", "function uppercase() {\n uppercaseCheck = confirm(\"Do you want to include uppercase letters?\");\n return uppercaseCheck;\n}", "function imprimirNombreenmatusculas(){\n nombre= nombre.toUpperCase()\n console.log(nombre)\n}", "function romanToInt(s) {\r\n var result = 0;\r\n if (s === '') {\r\n return result;\r\n }\r\n var romans = new Map();\r\n romans.set('I', 1);\r\n romans.set('V', 5);\r\n romans.set('X', 10);\r\n romans.set('L', 50);\r\n romans.set('C', 100);\r\n romans.set('D', 500);\r\n romans.set('M', 1000);\r\n console.log(romans.values());\r\n for (var i_1 = 0; i_1 < s.length; i_1++) {\r\n if (romans.get(s.charAt(i_1)) < romans.get(s.charAt(i_1 + 1))) {\r\n result -= romans.get(s.charAt(i_1));\r\n }\r\n else {\r\n result += romans.get(s.charAt(i_1));\r\n }\r\n }\r\n return result;\r\n}", "function roman(){\n let number = prompt(\"Write a number up to 4000\");\n //number= parseInt(number);\n let ronum = \"\";\n console.log(number);\n let numarray = [number[0],number[1],number[2],number[3]];\n \n if(number[0]==1){\n ronum=ronum+'M';\n }\n else if(number[0]==2){\n ronum=ronum+'MM';\n }\n else if(number[0]==3){\n ronum=ronum+'MMM';\n }\n console.log(ronum);\n\n if(number[1]==1){\n ronum=ronum+'C';\n }\n else if(number[1]==0){\n ronum=ronum;\n }\n else if(number[1]==2){\n ronum=ronum+'CC';\n }\n else if(number[1]==3){\n ronum=ronum+'CC';\n }\n else if(number[1]==4){\n ronum=ronum+'CD';\n }\n else if(number[1]==5){\n ronum=ronum+'D';\n }\n else if(number[1]==6){\n ronum=ronum+'DC';\n }\n else if(number[1]==7){\n ronum=ronum+'DCC';\n }\n else if(number[1]==8){\n ronum=ronum+'DCCC';\n }\n else if(number[1]==9){\n ronum=ronum+'CM';\n }\n\n if(number[2]==1){\n ronum=ronum+'X'\n }\n else if(number[2]==0){\n ronum=ronum;\n }\n else if(number[2]==2){\n ronum=ronum+'XX'\n }\n else if(number[2]==3){\n ronum=ronum+'XXX'\n }\n else if(number[2]==4){\n ronum=ronum+'XL'\n }\n else if(number[2]==5){\n ronum=ronum+'L'\n }\n else if(number[2]==6){\n ronum=ronum+'LX'\n }\n else if(number[2]==7){\n ronum=ronum+'LXX'\n }\n else if(number[2]==8){\n ronum=ronum+'LXXX'\n }\n else if(number[2]==9){\n ronum=ronum+'XC'\n }\n \n\n if(number[3]==1) {\n ronum= ronum+'I';\n }\n else if(number[3]==2) {\n ronum= ronum+'II';\n }\n else if(number[3]==0){\n ronum=ronum;\n }\n else if(number[3]==3) {\n ronum= ronum+'III';\n }\n else if(number[3]==4) {\n ronum= ronum+'IV';\n }\n else if(number[3]==5) {\n ronum= ronum+'V';\n }\n else if(number[3]==6) {\n ronum= 'VI';\n }\n else if(number[3]==7) {\n ronum= 'VII';\n }\n else if(number[3]==8) {\n ronum= 'VIII';\n }\n else if(number[3]==9) {\n ronum= 'IX';\n }\n\n console.log(ronum);\n}", "function getRoman(value) {\r\n var romanNumeral = \"\";\r\n for (var i = 0; i < romanLetters.length; i++) {\r\n while (value >= numericalLetters[i]) {\r\n value -= numericalLetters[i];\r\n romanNumeral += romanLetters[i];\r\n }\r\n }\r\n return romanNumeral;\r\n }", "function convertToRoman(num) {\n var roman = \"\";\n var decimalNums = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var romanNums = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n for (var i = 0; i < decimalNums.length; i++) {\n while (num >= decimalNums[i]) {\n roman += romanNums[i];\n num -= decimalNums[i];\n }\n }\n return roman;\n}", "static toRoman(num) {\n \n // Copy the input to a variable called \"int.\"\n var int = num;\n \n // Initialize empty array to hold the roman numerals that will be used in the solution.\n var convert = [];\n \n // Initialize a dictionary for all combinations of roman numerals.\n var dictionary = { \n \"M\": 1000,\n \"CM\": 900,\n \"D\": 500,\n \"CD\": 400,\n \"C\": 100,\n \"XC\": 90,\n \"L\": 50,\n \"XL\": 40,\n \"X\": 10,\n \"IX\": 9,\n \"V\": 5,\n \"IV\": 4,\n \"I\": 1\n }\n \n while (int) {\n // This for loop tries to find the largest base value from the dictionary in \"int.\"\n for (var key in dictionary) {\n if (int / dictionary[key] >= 1) {\n // Add the corresponding roman numeral of the largest base value found in \"int\" to the \"convert\" array.\n convert.push(key);\n // Now, subtract the base value from \"int.\" \n int = int - dictionary[key];\n // Exit the for loop because we want to start over again from the top of the dictionary.\n break;\n }\n }\n }\n \n // Combine the \"convert\" array into a string and return as the solution.\n return convert.join(\"\")\n }", "function convertToRoman(number) {\n var roman = [];\n var i, v, x, l, c, d, m;\n \n m = Math.floor(number / 1000); // 3\n for (var count = 0; count < m; count++) {\n roman.push(\"M\");\n }\n var mRemainder = number % 1000; // 192\n if (mRemainder >= 900) {\n roman.push(\"CM\");\n mRemainder = mRemainder - 900;\n }\n \n d = Math.floor(mRemainder / 500); // 0\n for (count = 0; count < d; count++) {\n roman.push(\"D\");\n }\n var dRemainder = mRemainder % 500; // 192\n \n c = Math.floor(dRemainder / 100); // 1\n if (c === 9) {\n roman.push(\"CM\");\n }\n else if (c === 4) {\n roman.push(\"CD\");\n }\n else {\n for (count = 0; count < c; count++) {\n roman.push(\"C\");\n }\n }\n var cRemainder = dRemainder % 100; // 92\n if (cRemainder >= 90) {\n roman.push(\"XC\");\n cRemainder = cRemainder - 90;\n }\n \n l = Math.floor(cRemainder / 50); // 1\n for (count = 0; count < l; count++) {\n roman.push(\"L\");\n }\n var lRemainder = cRemainder % 50; // 42\n \n x = Math.floor(lRemainder / 10); // 4\n if (x === 9) {\n roman.push(\"XC\");\n }\n else if (x === 4) {\n roman.push(\"XL\");\n }\n else {\n for (count = 0; count < x; count++) {\n roman.push(\"X\");\n }\n }\n var xRemainder = lRemainder % 10; // 2\n if (xRemainder === 9) {\n roman.push(\"IX\");\n xRemainder = xRemainder - 9;\n }\n \n v = Math.floor(xRemainder / 5); // 0\n for (count = 0; count < v; count++) {\n roman.push(\"V\");\n }\n var vRemainder = xRemainder % 5; // 2\n \n i = vRemainder; // 2\n if (i === 4) {\n roman.push(\"IV\");\n }\n else {\n for (count = 0; count < i; count++) {\n roman.push(\"I\");\n }\n }\n \n return roman.join(\"\");\n}", "function romanEncrypt(str) {\n let result = [];\n str = str.split('');\n let p1 = str.slice(0, str.length / 2);\n let p2 = str.slice(str.length / 2, str.length);\n p1.forEach((l1, i) => {\n // f => agrega la últma letra si el array no es divisible entre dos...\n let f = (i === p2.length - 2 && p1.length < p2.length) ? p2[p2.length - 1] : '';\n result.push(`${l1}${p2[i]}${f}`);\n });\n return result.join('');\n}", "function capMe(arr) {\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i].substring(0,1).toUpperCase() + arr[i].substring(1).toLowerCase()\n ;\n }\n return arr;\n}", "static fromRoman(str) {\n \n // Initialize an empty array.\n var temp = []\n \n // Loop over each roman numeral of the input \"str.\"\n for (var char of str) {\n // Add the corresponding decimal value of each roman numeral to the \"temp\" array.\n switch(char) {\n case \"I\":\n temp.push(1);\n break;\n case \"V\":\n temp.push(5);\n break;\n case \"X\":\n temp.push(10);\n break;\n case \"L\":\n temp.push(50);\n break;\n case \"C\":\n temp.push(100);\n break;\n case \"D\":\n temp.push(500);\n break;\n case \"M\":\n temp.push(1000);\n break;\n default:\n break; \n }\n }\n \n // Check for subtractive cases, i.e. when a smaller roman numeral precedes a larger roman numeral.\n for (var i = 0; i < temp.length-1; i++) {\n if (temp[i] < temp[i+1]) {\n // Multiply the subtractive roman numeral by -2 and add it to the end of the \"temp\" array. This has the same effect as subtracting it.\n temp.push(temp[i] * -2) \n } \n }\n \n // Add up all the converted roman numerals in the \"temp\" array and return as the solution.\n return temp.reduce(function (total, num) {return total + num;})\n }", "function minusculamayuscula(texto){\n return texto.toUpperCase()\n}", "function mayus(e) {\n e.value = e.value.toUpperCase();\n}", "function uppercaseAll(arrayOfStrings) {\r newArray=[];\r each(array,function(element,i){\r \tnewArray.push(element.toUpperCase(){\r \t})\r })\r \t\treturn newArray;\r\r }", "function mayus(e) {\n e.value = e.value.toUpperCase();\n}", "function mayusculas(e) {\n e.value = e.value.toUpperCase();\n }", "function convertToRoman(num) {\n if (num < 1 || num > 3999)\n return undefined;\n \n let numerals = [['I','V'],['X','L'],['C','D'],['M']];\n\n let arr = num\n .toString()\n .split('')\n .map(element => parseInt(element));\n \n while (arr.length < 4)\n arr.unshift(0);\n\n arr = arr.map((element, index) => {\n let ones = numerals[3-index][0];\n let fives = numerals[3-index][1];\n if (element <= 3 && element > 0) \n return ones.repeat(element);\n if (element === 4)\n return ones + fives;\n if (element === 5)\n return fives;\n if (element > 5 && element < 9)\n return fives + ones.repeat(element - 5);\n if (element === 9)\n return ones + numerals[4-index][0];\n })\n\n return arr.join('');\n}", "function upperlower(name){\r\n var capital=0;\r\n var small=0;\r\n for(var i=0;i<name.length;i++){\r\n if(/[A-Z]/.test(name.charAt(i))){\r\n capital++;\r\n }\r\n else if(/[a-z]/.test(name.charAt(i))){\r\n small++;\r\n }\r\n }\r\n console.log(\"capitalletter:\"+ capital+\",\"+\"smallletter\"+small);\r\n}", "function AltCapsFunnction(msgstring = \"cHarI\")\n{\n msgstring = msgstring.toLowerCase();\n const characters = msgstring.split(\"\");\n\n return characters.map((value, index) => {\n return index % 2 ? value.toUpperCase() : value.toLowerCase();\n }).join(\"\");\n\n}", "function uppercase_method(){\n var name = \"Jose Carlos Cruz Santiago\";\n var uppercase_name = name.toUpperCase();\n document.getElementById(\"uppercase_method\").innerHTML=uppercase_name;\n}", "function solution(string) {\n let newString = \"\";\n for (let i of string) {\n if (i === i.toUpperCase()) {\n newString += ` ${i}`;\n } else {\n newString += i;\n }\n }\n return newString;\n}", "function convertToRoman(num) {\n let RomanNum= [1000,500,100,90,50,40,10,9,5,4,3,2,1];\n let RomanAlpha =['M','D','C','XC','L','XL','X','IX','V','IV','III','II','I'];\n let conver = '';\n for (let i=0; i<RomanNum.length;i++){\n while(RomanNum[i]<= num){\n conver += RomanAlpha[i];\n num -= RomanNum[i];\n }\n }\n return conver;\n}", "function convert(num) {\n var numToConvert = num; // prevent modifying parameter\n var romanNum = ''; // create a new string to represent roman numerals\n\n // break down roman numerals into categories\n var romanNumerals = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n // create numbers to coincide with romanNumerals\n var numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n\n for (var i = 0; i < romanNumerals.length; i++){\n //\n while (numToConvert >= numbers[i]){\n numToConvert -= numbers[i];\n romanNum += romanNumerals[i];\n }\n }\n\n return romanNum.toUpperCase();\n}", "function titleCases(arg){\n return arg.charAt(0).toUpperCase() + arg.substring(1);\n }", "function caps(a) {return a.substring(0,1).toUpperCase() + a.substring(1,a.length);}", "function toRoman(num) { \n var result = '';\n var decimal = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var roman = [\"M\", \"CM\",\"D\",\"CD\",\"C\", \"XC\", \"L\", \"XL\", \"X\",\"IX\",\"V\",\"IV\",\"I\"];\n for (var i = 0;i<=decimal.length;i++) {\n while (num%decimal[i] < num) { \n result += roman[i];\n num -= decimal[i];\n }\n }\n return result;\n}", "function yell(x){\n return x.toUpperCase();\n}", "function determineUppercase(){\n uppercaseCheck = prompt(\"Would you like uppercase letters? \\n(Yes or No)\");\n uppercaseCheck = uppercaseCheck.toLowerCase();\n\n if (uppercaseCheck === null || uppercaseCheck === \"\"){\n alert(\"Aanswer Yes or No\");\n determineUppercase();\n\n }else if (uppercaseCheck === \"yes\" || uppercaseCheck ===\"y\"){\n uppercaseCheck = true;\n return uppercaseCheck;\n\n }else if (uppercaseCheck === \"no\" || uppercaseCheck ===\"n\"){\n uppercaseCheck = false;\n return uppercaseCheck;\n \n }else {\n alert(\"Answer Yes or No\");\n determineUppercase();\n }\n return uppercaseCheck;\n}", "function convertToRoman(num) {\n // Converting number into single digit: eg: 345 to 3, 4, and 5!\n var digits = []\n while (num) {\n digits.push(num % 10);\n num = Math.floor(num / 10);\n }\n\n // Multiply proper tens or hundreds or thousands to single digits. So the number breaks\n // Eg: 345 into 300, 40, and 5\n var expandedNum = [];\n var x = 1;\n for (var digit in digits) {\n expandedNum.push(digits[digit] * x)\n x *= 10;\n }\n expandedNum.reverse();\n\n // Some important base-roman dictionary values:\n var romandict = { 1000: 'M', 900: 'CM', 500: 'D', 400: 'CD', 100: 'C', 90: 'XC', 50: 'L', 40: 'XL', 10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I' }\n // Storing the integers from romandict and sorting in descending order as dictionary saves values in ascending order by default.\n var decimals = Object.keys(romandict).sort((a, b) => b - a);\n\n var romanNumber = ''\n\n for (var i in expandedNum) {\n for (var j in decimals) {\n while (decimals[j] <= expandedNum[i]) {\n romanNumber += romandict[decimals[j]];\n expandedNum[i] -= decimals[j];\n }\n }\n }\n return romanNumber\n}", "function parseRoman(s) {\n var val = {M: 1000, D: 500, C: 100, L: 50, X: 10, V: 5, I: 1};\n return s.toUpperCase().split('').reduce(function(r, a, i, aa) {\n return val[a] < val[aa[i + 1]] ? r - val[a] : r + val[a];\n }, 0);\n}", "function convertToRoman(num) {\n let romanLookup = [\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'],\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]\n ];\n\n let roman = '';\n for(let i = 0; i < romanLookup[0].length; i++) {\n while(num >= romanLookup[1][i]) {\n roman += romanLookup[0][i];\n num -= romanLookup[1][i];\n }\n }\n return roman;\n}", "function solution(roman){\n let numerals = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000,};\n let count = numerals[roman[roman.length-1]];\n \n for (let i = roman.length - 2; i >= 0; i--) {\n (numerals[roman[i]] >= numerals[roman[i+1]]) ?\n count += numerals[roman[i]] :\n count -= numerals[roman[i]]\n }\n return count;\n}", "function option8(input, output) {\n console.log(\"option8\");\n var words = input.value.toLowerCase().split(/[ -]+/);\n for (var i = 0; i < words.length; i++) {\n words[i] = words[i].charAt(0).toUpperCase() + words[i].substring(1); \n }\n output.value = words.join(' ');\n}", "function convertToRoman(num) {\nvar arr=[];\nvar m = Math.floor(num/1000);\nfor(let i=0;i<m;i++){ //how many thousands\narr.push(\"M\");\n}\nvar remainderM = num%1000;\nif(remainderM>=900){ //remainderM more than 900\narr.push(\"CM\");\nvar remainder900 = remainderM % 900;\nif (remainder900 >=90){\narr.push(\"XC\");\nvar remainder90= remainder900%90;\nif(remainder90>5){\nvar remainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>=50){\narr.push(\"L\");\nvar remainder50= remainder900%50;\nvar tens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nvar remainder10=remainder50%10;\n\nif(remainder10>5){\nvar remainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>=40){\narr.push(\"XL\");\n\nvar remainder40= remainder900%40;\nif(remainder40>5){\nvar remainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>0){\n\n\n\ntens=Math.floor(remainder900/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder900%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse{\nif(remainderM>=500){ //remainderM more than 500\narr.push(\"D\");\nvar remainder500=remainderM%500;\nfor (let i=0;i<Math.floor(remainder500/100);i++){\narr.push(\"C\");\n}\n\n\n\nvar remainder100 = remainder500 % 100;\nif (remainder100 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=50){\narr.push(\"L\");\nremainder50= remainder100%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=40){\narr.push(\"XL\");\n\nremainder40= remainder100%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>0){\n\n\n\ntens=Math.floor(remainder100/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder100%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainderM>=400){ //remainderM more than 400\narr.push(\"CD\");\n\nvar remainder400 = remainderM % 100;\nif (remainder400 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>=50){\narr.push(\"L\");\nremainder50= remainder400%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>=40){\narr.push(\"XL\");\n\nremainder40= remainder400%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>0){\n\ntens=Math.floor(remainder400/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder400%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if (remainderM>0){ //remainderM less than 400\n\n\n\n\n\nfor (let i=0;i<Math.floor(remainderM/100);i++){\narr.push(\"C\");\n}\n\n\n\nremainder100 = remainderM % 100;\nif (remainder100 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=50){\narr.push(\"L\");\nremainder50= remainder100%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=40){\narr.push(\"XL\");\n\nremainder40= remainder100%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>0){\n\ntens=Math.floor(remainder100/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder100%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\"); //remainderM is 0\n}\n}\n}", "function convertToRoman(num) {\n if (isNaN(num))\n return NaN;\n var digits = String(+num).split(\"\"),\n key = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n roman = \"\",\n i = 3;\n console.log(`Digits array is [${digits}]`)\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n console.log(`roman is ${roman}`)\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}", "function toUpperCaseStringsOnly(a){\n\t mapImproved(a,function(item,i){\n\t\tif(typeof a[i]==='string')a[i]=item.toUpperCase();\n\t})\n\t return a\n}", "function printAnswer(){\n var print = \" \";\n for (var i = 0; i < answer.length; i++) {\n print = print.concat(answer[i].toUpperCase());\n }\n document.getElementById(\"updateScreen\").innerText = \" Name: \" + print;\n}", "function convertToRoman(num) {\n const map = {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1,\n };\n let result = '';\n \n // main algorithm\n \n console.log(\"result:\", result);\n return result;\n }", "function upper(name){\r\n var up=\"\";\r\n var splitchar=name.split(\"\");\r\n console.log(splitchar);\r\nfor(i=0;i<name.length;i++){\r\n up=up+splitchar[i]+\" \";\r\n}\r\nup=up.toLocaleUpperCase();\r\nconsole.log(up);\r\n}", "function reverseAndCapitalize(arr) {\n let newArr = [];\n for (const item in arr) {\n newArr.push(arr[item].toUpperCase());\n }\n return console.log(newArr.reverse());\n}", "function allCaps(input) {\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function SwapII(str) { \n str = str.replace(/(\\d)([A-Za-z]+)(\\d)/, \"$3$2$1\");\n var parts = str.split('');\n var results = '';\n for (var i = 0; i < parts.length; i++){\n if (parts[i] == parts[i].toLowerCase()){\n results += parts[i].toUpperCase();\n } else if (parts[i] == parts[i].toUpperCase()){\n results += parts[i].toLowerCase();\n } else {\n results += parts[i];\n }\n }\n return results;\n}", "function convertToRoman(num) {\n //function to find first occurence of number being less than item in array\n function findDec(element) {\n return num < element;\n }\n\n const romans = [\n \"I\",\n \"IV\",\n \"V\",\n \"IX\",\n \"X\",\n \"XL\",\n \"L\",\n \"XC\",\n \"C\",\n \"CD\",\n \"D\",\n \"CM\",\n \"M\",\n \"MMMM\",\n \"V!\"\n ];\n const decimals = [\n 1,\n 4,\n 5,\n 9,\n 10,\n 40,\n 50,\n 90,\n 100,\n 400,\n 500,\n 900,\n 1000,\n 4000,\n 5000\n ];\n let romArr = [];\n\n let index1 = decimals.findIndex(findDec);\n console.log(\"index 1 :\" + index1);\n\n //run loop until provided number is 0\n for (let i = 0; num > 0; i++) {\n let index = decimals.findIndex(findDec); //index where number is less than element in array\n\n romArr.push(romans[index - 1]); //push the roman element with above index - 1 to get highest numeral before being too low\n num -= decimals[index - 1]; //set num equal to itself minus it's relative roman numeral above\n console.log(num);\n }\n\n return romArr.join(\"\");\n}", "function solve(s) {\n let lowercase = 0;\n let uppercase = 0;\n for (let c of s) {\n c.toLowerCase() === c ? lowercase++ : uppercase++;\n }\n return lowercase > uppercase || lowercase === uppercase\n ? s.toLowerCase()\n : s.toUpperCase();\n}", "function swap(){\n var str = document.getElementById(\"demo3\").value;\n \nvar UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nvar LOWER = 'abcdefghijklmnopqrstuvwxyz';\nvar result = [];\n \n for(var x=0; x<str.length; x++)\n {\n if(UPPER.indexOf(str[x]) !== -1)\n {\n result.push(str[x].toLowerCase());\n }\n else if(LOWER.indexOf(str[x]) !== -1)\n {\n result.push(str[x].toUpperCase());\n }\n else \n {\n result.push(str[x]);\n }\n }\n\ndocument.getElementById(\"ans3\").innerHTML = result.join('');\n}", "function romanNumerals(num) {\n let romanRef = {M:1000, CM:900, D:500, CD:400, C:100, XC:90, L:50, XL:40, X:10, IX:9, V:5, IV:4, I:1};\n let numeral = '';\n for ( let i in romanRef ) {\n while ( num >= romanRef[i] ) {\n numeral += i;\n num -= romanRef[i];\n }\n }\n return numeral;\n}", "function capitalize(sequence){\n return sequence.toUpperCase();\n}", "function testIsInRomanceAlphabet(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\tvar romanceTest1 = stringUtils.isInRomanceAlphabet(\"abcdef\", encodings.ASCII);\n\t\tvar romanceTest2 = stringUtils.isInRomanceAlphabet(\"ABCDEF\", encodings.ASCII);\n\t\tvar romanceTest3 = stringUtils.isInRomanceAlphabet(\"0123456789\", encodings.ASCII);\n\t\tvar romanceTest4 = stringUtils.isInRomanceAlphabet(\"g\", encodings.ASCII);\n\t\tvar romanceTest5 = stringUtils.isInRomanceAlphabet(\"->?\", encodings.ASCII);\n\t\texpect(romanceTest1).to.eql(true);\n\t\texpect(romanceTest2).to.eql(true);\n\t\texpect(romanceTest3).to.eql(false);\n\t\texpect(romanceTest4).to.eql(true);\n\t\texpect(romanceTest5).to.eql(false);\n\t}", "function yell(arg){\n return arg.toUpperCase();\n}", "function capitalize(studentName){\n\tvar newName =\"\";\n\tfor ( var l in studentName) {\n\n\t\tif (1 == 0){\n\t\t\t//What happens if we use 3 equals?\n\t\t\n\t\tnewName = studentName[1].toUpperCase();\n\t}else {\n\t\tnewName+= studentName[1];\n\t}\n}\nreturn newName\n}", "function upper(s) {\n\treturn s.toUpperCase();\n}", "function yell(value) {\n return value.toUpperCase();\n}", "function capital(name){\n n = name.toUpperCase()\n console.log(n)\n}", "function convertToRoman(num){\n\n let roman_numeral = \"\";\n \n \n while(true){\n let max = findMax(num);\n if(max == 1){\n roman_numeral += \"I\";\n num = num - max;\n }\n else if(max == 4){\n roman_numeral += \"IV\";\n num = num - max;\n }\n else if(max == 5){\n roman_numeral += \"V\";\n num = num - max;\n }\n else if(max == 9){\n roman_numeral += \"IX\";\n num = num - max;\n }\n else if(max == 10){\n roman_numeral += \"X\";\n num = num - max;\n }\n else if(max == 40){\n roman_numeral += \"XL\";\n num = num - max;\n }\n else if(max == 50){\n roman_numeral += \"L\";\n num = num - max;\n }\n else if(max == 90){\n roman_numeral += \"XC\";\n num = num - max;\n }\n else if(max == 100){\n roman_numeral += \"C\";\n num = num - max;\n }\n else if(max == 400){\n roman_numeral += \"CD\";\n num = num - max;\n }\n else if(max == 500){\n roman_numeral += \"D\";\n num = num - max;\n }\n else if(max == 900){\n roman_numeral += \"CM\";\n num = num - max;\n }\n else if(max == 1000){\n roman_numeral += \"M\";\n num = num - max;\n }\n if(num == 0){\n break;\n }\n \n }\n\n return roman_numeral;\n}", "function MaysPrimera(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function answer() {\n\tdocument.querySelector(\"#currentWord\").innerHTML = answerArray.join(\" \").toUpperCase();\n}", "function upperandlower() {\n var rl = require('readline');\n var prompts = rl.createInterface(process.stdin, process.stdout);\n prompts.question('string: ', function (str) {\n console.log(str + ' ');\n var count = 0;\n var count1 = 0;\n for (var i = 0; i < str.length; i++) {\n var ch = str.charAt(i);\n if (ch >= 'A' && ch <= 'Z')\n count++;\n }\n console.log('Upper case :' + count + ' ');\n for (var i = 0; i < str.length; i++) {\n var ch = str.charAt(i);\n if (ch >= 'a' && ch <= 'z')\n count1++;\n }\n console.log('Lower case :' + count1 + ' ');\n process.exit();\n });\n}", "function uppercaseAll(arrayOfStrings) {\n return map (arrayOfStrings, function(element, i){\n\t\t return element.toUpperCase();\n\t });\n }", "function yell (str) {\n \treturn str.toUpperCase();\n }" ]
[ "0.67612714", "0.6459759", "0.63812846", "0.636349", "0.6262297", "0.6224946", "0.61437637", "0.6119703", "0.60750407", "0.606791", "0.6036034", "0.60154474", "0.5995357", "0.59585154", "0.59578204", "0.5949594", "0.58397007", "0.58324236", "0.5827182", "0.5826234", "0.582203", "0.5821765", "0.58160776", "0.5815926", "0.57966655", "0.57780695", "0.57471734", "0.57358456", "0.57342666", "0.5720426", "0.571585", "0.57126606", "0.57079965", "0.57006365", "0.56947696", "0.5690538", "0.5682583", "0.5679814", "0.56514144", "0.565019", "0.56495106", "0.56484216", "0.56365556", "0.5630849", "0.562028", "0.56199646", "0.5618771", "0.5609189", "0.55986565", "0.5589982", "0.5588385", "0.5585764", "0.55801296", "0.55773365", "0.55758315", "0.5573817", "0.5563195", "0.55563426", "0.55512154", "0.5550135", "0.5548566", "0.5542533", "0.5511206", "0.5510178", "0.5501857", "0.5500296", "0.5496321", "0.5487658", "0.5474403", "0.5470347", "0.5452324", "0.5443637", "0.54401994", "0.5438023", "0.5435404", "0.54325354", "0.5428998", "0.54282165", "0.5426345", "0.5424091", "0.5416201", "0.5415212", "0.5410724", "0.54092205", "0.5404751", "0.5403176", "0.53965473", "0.53960335", "0.5375284", "0.53636473", "0.5360721", "0.5359141", "0.53556144", "0.5351385", "0.5350403", "0.53483075", "0.53443253", "0.5342573", "0.5333802", "0.53289473", "0.5327637" ]
0.0
-1
Criado em: 20/02/2010 Autor: Fabricio P. Reis Funcao usada para validar os dados obrigatorios e colocar letras maiusculas e minusculas nos campos adequados
function validarDados() { var mensagem = "Preencha corretamente os seguintes campos:"; if (trim(document.formPaciente.nome.value) == "") { mensagem = mensagem + "\n- Nome"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nome.value)).toLowerCase()); document.formPaciente.nome.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nome.value).toLowerCase()); } if (!document.formPaciente.sexo[0].checked && !document.formPaciente.sexo[1].checked) { mensagem = mensagem + "\n- Sexo"; } if (trim(document.formPaciente.dataNascimento.value) == "") { mensagem = mensagem + "\n- Data de Nascimento"; } // Nome do pai sem acentos e/ou cedilhas if (trim(document.formPaciente.nomePai.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomePai.value)).toLowerCase()); document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomePai.value).toLowerCase()); } // Nome da mae sem acentos e/ou cedilhas if (trim(document.formPaciente.nomeMae.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomeMae.value)).toLowerCase()); document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomeMae.value).toLowerCase()); } if (trim(document.formPaciente.logradouro.value) == "") { mensagem = mensagem + "\n- Logradouro"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.logradouro.value)).toLowerCase()); document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.logradouro.value).toLowerCase()); } // Numero sem acentos e/ou cedilhas if (trim(document.formPaciente.numero.value) != "") { document.formPaciente.numero.value = retirarAcentos(trim(document.formPaciente.numero.value)).toUpperCase(); } /* Numero deixa de ser obrigatorio if (trim(document.formPaciente.numero.value) == "") { mensagem = mensagem + "\n- Numero"; } */ if (trim(document.formPaciente.bairro.value) == "") { mensagem = mensagem + "\n- Bairro"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.bairro.value)).toLowerCase()); document.formPaciente.bairro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.bairro.value).toLowerCase()); } // Complemento sem acentos e/ou cedilhas if (trim(document.formPaciente.complemento.value) != "") { // Linha abaixo comentada para manter acentos //document.formPaciente.complemento.value = retirarAcentos(trim(document.formPaciente.complemento.value)).toUpperCase(); document.formPaciente.complemento.value = trim(document.formPaciente.complemento.value).toUpperCase(); } if (trim(document.formPaciente.cidade.value) == "") { mensagem = mensagem + "\n- Cidade"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.cidade.value)).toLowerCase()); document.formPaciente.cidade.value = primeirasLetrasMaiusculas(trim(document.formPaciente.cidade.value).toLowerCase()); } if (trim(document.formPaciente.estado.value) == "") { mensagem = mensagem + "\n- Estado"; } if (trim(document.formPaciente.indicacao.value) == "") { mensagem = mensagem + "\n- Indicacao"; } if (document.formPaciente.indicacao.value == "selected") { if (trim(document.formPaciente.indicacaoOutra.value) == "") { mensagem = mensagem + "\n- Indicacao - Outra"; } else { // Linha abaixo comentada para manter acentos //document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.indicacaoOutra.value)).toLowerCase()); document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(trim(document.formPaciente.indicacaoOutra.value).toLowerCase()); } } if (mensagem == "Preencha corretamente os seguintes campos:") { return true; } else { alert(mensagem); goFocus('nome'); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formProcedimento.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formProcedimento.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formProcedimento.nome.value)).toLowerCase());\n document.formProcedimento.nome.value = primeirasLetrasMaiusculas(trim(document.formProcedimento.nome.value).toLowerCase());\n }\n \n if (trim(document.formProcedimento.valor.value) == \"\") {\n mensagem = mensagem + \"\\n- Valor(R$)\";\n }\n else {\n document.formProcedimento.valor.value = document.formProcedimento.valor.value.replace(\",\", \".\");\n }\n\n if (trim(document.formProcedimento.valorMinimo.value) == \"\") {\n mensagem = mensagem + \"\\n- Valor Minimo(R$)\";\n }\n else {\n document.formProcedimento.valorMinimo.value = document.formProcedimento.valorMinimo.value.replace(\",\", \".\");\n }\n\n if (parseFloat(trim(document.formProcedimento.valor.value.toString())) < parseFloat(trim(document.formProcedimento.valorMinimo.value.toString()))) {\n alert(\"Valor minimo Invalido!\");\n return false;\n }\n\n if (trim(document.formProcedimento.descricao.value) == \"\") {\n mensagem = mensagem + \"\\n- Descricao\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formProcedimento.descricao.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formProcedimento.descricao.value)).toLowerCase());\n document.formProcedimento.descricao.value = primeirasLetrasMaiusculas(trim(document.formProcedimento.descricao.value).toLowerCase());\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function valid(campo1, campo2, campo3, campo4, campo5, campo6, campo7, campo8, campo9, campo10, campo11, campo12, campo13, campo14){\nerro = false;\n\tif (campo1 != null){\n\t\tif (campo1.value == \"\"){\n\t\t\terro = true;\n\t\t\tcampo1.focus();\n\t\t}\n\t\telse if (campo2 != null){\n\t\t\tif (campo2.value == \"\"){\n\t\t\t\terro = true;\n\t\t\t\tcampo2.focus();\n\t\t\t}\n\t\t\telse if (campo3 != null){\n\t\t\t\tif (campo3.value == \"\"){\t\t\n\t\t\t\t\terro = true;\n\t\t\t\tcampo3.focus();\n\t\t\t\t}\n\t\t\t\telse if (campo4 != null){\n\t\t\t\t\tif (campo4.value == \"\"){\t\t\n\t\t\t\t\t\terro = true;\n\t\t\t\t\t\tcampo4.focus();\n\t\t\t\t\t}\n\t\t\t\t\telse if (campo5 != null){\n\t\t\t\t\t\tif (campo5.value == \"\"){\t\t\n\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\tcampo5.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (campo6 != null){\n\t\t\t\t\t\t\tif (campo6.value == \"\"){\t\t\n\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\tcampo6.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (campo7 != null){\n\t\t\t\t\t\t\t\tif (campo7.value == \"\"){\t\t\n\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\tcampo7.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (campo8 != null){\n\t\t\t\t\t\t\t\t\tif (campo8.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\tcampo8.focus();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (campo9 != null){\n\t\t\t\t\t\t\t\t\t\tif (campo9.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\tcampo9.focus();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (campo10 != null){\n\t\t\t\t\t\t\t\t\t\t\tif (campo10.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\tcampo10.focus();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if (campo11 != null){\n\t\t\t\t\t\t\t\t\t\t\t\tif (campo11.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\tcampo11.focus();\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 if (campo12 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo12.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcampo12.focus();\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\telse if (campo13 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo13.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcampo13.focus();\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 if (campo14 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo14.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcampo14.focus();\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}\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}\n\tif (erro==false){\n\t\treturn salvar();\n\t}\n\telse{\n\t\talert(\"Favor preencher todos os campos requeridos. \\n Vou indica-lo!\");\n\t\treturn false;\n\t}\n}", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formFuncionario.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.nome.value)).toLowerCase());\n document.formFuncionario.nome.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.nome.value).toLowerCase());\n }\n\n if (!document.formFuncionario.sexo[0].checked && !document.formFuncionario.sexo[1].checked) {\n mensagem = mensagem + \"\\n- Sexo\";\n }\n\n if (trim(document.formFuncionario.dataNascimento.value) == \"\") {\n mensagem = mensagem + \"\\n- Data de Nascimento\";\n }\n\n if (trim(document.formFuncionario.cargo.value) == \"\") {\n mensagem = mensagem + \"\\n- Cargo\";\n }\n\n if (trim(document.formFuncionario.cpf.value) == \"\") {\n mensagem = mensagem + \"\\n- CPF\";\n }\n\n if (trim(document.formFuncionario.logradouro.value) == \"\") {\n mensagem = mensagem + \"\\n- Logradouro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.logradouro.value)).toLowerCase());\n document.formFuncionario.logradouro.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.logradouro.value).toLowerCase());\n }\n\n // Numero sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.numero.value) != \"\") {\n document.formFuncionario.numero.value = retirarAcentos(trim(document.formFuncionario.numero.value)).toUpperCase();\n }\n\n /* Numero deixa de ser obrigatorio\n if (trim(document.formFuncionario.numero.value) == \"\") {\n mensagem = mensagem + \"\\n- Numero\";\n }\n */\n\n if (trim(document.formFuncionario.bairro.value) == \"\") {\n mensagem = mensagem + \"\\n- Bairro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.bairro.value)).toLowerCase());\n document.formFuncionario.bairro.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.bairro.value).toLowerCase());\n }\n \n // Complemento sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.complemento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.complemento.value = retirarAcentos(trim(document.formFuncionario.complemento.value)).toUpperCase();\n document.formFuncionario.complemento.value = trim(document.formFuncionario.complemento.value).toUpperCase();\n }\n\n if (trim(document.formFuncionario.cidade.value) == \"\") {\n mensagem = mensagem + \"\\n- Cidade\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.cidade.value)).toLowerCase());\n document.formFuncionario.cidade.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.cidade.value).toLowerCase());\n }\n\n if (trim(document.formFuncionario.estado.value) == \"\") {\n mensagem = mensagem + \"\\n- Estado\";\n }\n\n if (trim(document.formFuncionario.nomeDeUsuario.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome de usuario\";\n }\n else {\n // remove 1 espaco em branco que existir\n document.formFuncionario.nomeDeUsuario.value = document.formFuncionario.nomeDeUsuario.value.replace(\" \", \"\");\n }\n\n if ((trim(document.formFuncionario.senha.value) == \"\") && (trim(document.formFuncionario.senha2.value) == \"\")) {\n mensagem = mensagem + \"\\n- Senha\";\n }\n else {\n // remove 1 espaco em branco que existir\n document.formFuncionario.senha.value = document.formFuncionario.senha.value.replace(\" \", \"\");\n }\n\n if (document.formFuncionario.senha.value != document.formFuncionario.senha2.value) {\n mensagem = mensagem + \"\\n- As senhas digitadas nao sao iguais!\";\n }\n\n // Frase \"Esqueci Minha Senha\" sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.fraseEsqueciMinhaSenha.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.fraseEsqueciMinhaSenha.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.fraseEsqueciMinhaSenha.value)).toLowerCase());\n document.formFuncionario.fraseEsqueciMinhaSenha.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.fraseEsqueciMinhaSenha.value).toLowerCase());\n }\n\n if (!validarCheckBoxes(document.formFuncionario.grupoAcessoAdministrador.name)) {\n mensagem = mensagem + \"\\n- Grupo de acesso\";\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Tratamento\") {\n if (trim(document.formFuncionario.comissaoTratamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(%)\";\n }\n else {\n document.formFuncionario.comissaoTratamento.value = document.formFuncionario.comissaoTratamento.value.replace(\",\", \".\");\n }\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento\") {\n if (trim(document.formFuncionario.comissaoOrcamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(R$)\";\n }\n else {\n document.formFuncionario.comissaoOrcamento.value = document.formFuncionario.comissaoOrcamento.value.replace(\",\", \".\");\n }\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento-Tratamento\") {\n if (trim(document.formFuncionario.comissaoOrcamentoTratamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(R$)\";\n }\n else {\n document.formFuncionario.comissaoOrcamentoTratamento.value = document.formFuncionario.comissaoOrcamentoTratamento.value.replace(\",\", \".\");\n }\n if (trim(document.formFuncionario.comissaoTratamentoOrcamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(%)\";\n }\n else {\n document.formFuncionario.comissaoTratamentoOrcamento.value = document.formFuncionario.comissaoTratamentoOrcamento.value.replace(\",\", \".\");\n }\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeTratamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeTratamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeTratamento.value)).toLowerCase());\n document.formFuncionario.especialidadeTratamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeTratamento.value).toLowerCase());\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeOrcamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeOrcamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeOrcamento.value)).toLowerCase());\n document.formFuncionario.especialidadeOrcamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeOrcamento.value).toLowerCase());\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeOrcamentoTratamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeOrcamentoTratamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeOrcamentoTratamento.value)).toLowerCase());\n document.formFuncionario.especialidadeOrcamentoTratamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeOrcamentoTratamento.value).toLowerCase());\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function validarCampos () {\n\tvar arrayCamposEvaluar = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\", \"cajonesEstacionamiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayCamposObligatorios = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\");\n\t\n\tif ($(\"#celdaCodigo\").css(\"display\") != \"none\") {\n\t\tarrayCamposObligatorios.push(\"codigo\");\n\t}\n\t\n\tvar arrayFlotantes = new Array(\"precio\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayEnteros = new Array(\"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\");\n\t\n\t\n\tfor (var x = 0; x < arrayCamposEvaluar.length; x++) {\n\t\t//evalua los que son obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) > -1) {\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (vacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\"), $(\"#\"+arrayCamposEvaluar[x]+\" option[value='-1']\").text()))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (vacio($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los flotantes\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los enteros\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//evalua todos aquellos que no son necesariamente obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) == -1) {\n\t\t\tvar continua = false;\n\t\t\t\n\t\t\t//evalua primeramente que no esten vacios\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (!isVacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\")))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (!isVacio($(\"#\"+arrayCamposEvaluar[x]).val()))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\t\n\t\t\t//si no lo estan\n\t\t\tif (continua) {\n\t\t\t\t//evalua los flotantes\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//evalua los enteros\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tvar id = pos_comp;\n\t\n\tif (pos_comp != -1)\n\t\tid = positions[pos_comp].id;\n\t\t\n\t\n\tif (isVacio($(\"#codigo\").val())) {\n\t\tsave();\n\t}\n\telse {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tid: id,\n\t\t\t\tvalidarCodigo: 1,\n\t\t\t\tusuario: $(\"#usuario\").val(),\n\t\t\t\tcodigo: $(\"#codigo\").val()\n\t\t\t}\n\t\t}).always(function(respuesta_json) {\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tsave();\n\t\t\t}\n\t\t\telse\n\t\t\t\talert(respuesta_json.mensaje);\n\t\t});\n\t}\n}", "function validarCampos () {\n\tvar arrayCamposEvaluar = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\", \"cajonesEstacionamiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayCamposObligatorios = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\");\n\t\n\tif ($(\"#celdaCodigo\").css(\"display\") != \"none\") {\n\t\tarrayCamposObligatorios.push(\"codigo\");\n\t}\n\t\n\tvar arrayFlotantes = new Array(\"precio\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayEnteros = new Array(\"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\");\n\t\n\t\n\tfor (var x = 0; x < arrayCamposEvaluar.length; x++) {\n\t\t//evalua los que son obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) > -1) {\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (vacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\"), $(\"#\"+arrayCamposEvaluar[x]+\" option[value='-1']\").text()))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (vacio($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los flotantes\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los enteros\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//evalua todos aquellos que no son necesariamente obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) == -1) {\n\t\t\tvar continua = false;\n\t\t\t\n\t\t\t//evalua primeramente que no esten vacios\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (!isVacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\")))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (!isVacio($(\"#\"+arrayCamposEvaluar[x]).val()))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\t\n\t\t\t//si no lo estan\n\t\t\tif (continua) {\n\t\t\t\t//evalua los flotantes\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//evalua los enteros\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tvar id = pos_comp;\n\t\n\tif (pos_comp != -1)\n\t\tid = positions[pos_comp].id;\n\t\t\n\t\n\tif (isVacio($(\"#codigo\").val())) {\n\t\tsave();\n\t}\n\telse {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tid: id,\n\t\t\t\tvalidarCodigo: 1,\n\t\t\t\tusuario: $(\"#usuario\").val(),\n\t\t\t\tcodigo: $(\"#codigo\").val()\n\t\t\t}\n\t\t}).always(function(respuesta_json) {\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tsave();\n\t\t\t}\n\t\t\telse\n\t\t\t\talert(respuesta_json.mensaje);\n\t\t});\n\t}\n}", "function validacionCampos(nombreCampo, valorCampo, tipoCampo) {\n\n var expSoloCaracteres = /^[A-Za-zÁÉÍÓÚñáéíóúÑ]{3,10}?$/;\n var expMatricula = /^([A-Za-z]{1}?)+([1-9]{2}?)$/;\n\n if (tipoCampo == 'select') {\n valorComparar = 0;\n } else {\n valorComparar = '';\n }\n\n //validamos si el campo es rellenado.\n if (valorCampo != valorComparar) {\n $('[id*=' + nombreCampo + ']').removeClass('is-invalid');\n\n //Aplicamos validaciones personalizadas a cada campo.\n if (nombreCampo == 'contenidoPagina_nombreMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n\n }\n else if (nombreCampo == 'contenidoPagina_apellidoMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n \n }\n else if (nombreCampo == 'contenidoPagina_especialidadMedico') {\n return true;\n\n }\n else if (nombreCampo == 'contenidoPagina_matriculaMedico') {\n\n if (expMatricula.test(valorCampo)) {\n\n $(\"[id*=contenidoPagina_matriculaMedico]\").off('keyup');\n $(\"[id*=contenidoPagina_matriculaMedico]\").on('keyup', function () {\n return validarMatriculaUnica($(this).val(), matAcomparar);\n });\n\n return validarMatriculaUnica($(\"[id*=contenidoPagina_matriculaMedico]\").val(), matAcomparar);\n } else {\n mostrarMensaje(nombreCampo, 'estructuraInc');\n return false;\n } \n }\n } else {\n mostrarMensaje(nombreCampo, 'incompleto');\n return false;\n }\n }", "function validarFormulario(){\n var flagValidar = true;\n var flagValidarRequisito = true;\n\n if(txtCrben_num_doc_identific.getValue() == null || txtCrben_num_doc_identific.getValue().trim().length ==0){\n txtCrben_num_doc_identific.markInvalid('Establezca el numero de documento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_nombres.getValue() == null || txtCrben_nombres.getValue().trim().length ==0){\n txtCrben_nombres.markInvalid('Establezca el nombre, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCrecv_codigo.getValue() == null || cbxCrecv_codigo.getValue().trim().length ==0){\n cbxCrecv_codigo.markInvalid('Establezca el estado civil, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_apellido_paterno.getValue() == null || txtCrben_apellido_paterno.getValue().trim().length ==0){\n txtCrben_apellido_paterno.markInvalid('Establezca el apellido, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCpais_nombre_nacimiento.getValue() == null || cbxCpais_nombre_nacimiento.getValue().trim().length ==0){\n cbxCpais_nombre_nacimiento.markInvalid('Establezca el pais de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(dtCrper_fecha_nacimiento.isValid()==false){\n dtCrper_fecha_nacimiento.markInvalid('Establezca la fecha de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n for (var i = 0; i < gsCgg_res_solicitud_requisito.getCount(); i++) {\n var rRequisito = gsCgg_res_solicitud_requisito.getAt(i);\n if (rRequisito.get('CRSRQ_REQUERIDO') == true) {\n if (rRequisito.get('CRRQT_CUMPLE') == false) {\n flagValidarRequisito = false;\n }\n }\n }\n\n if (flagValidarRequisito == false) {\n Ext.Msg.show({\n title: tituloCgg_res_beneficiario,\n msg: 'Uno de los requisitos necesita cumplirse, por favor verifiquelos.',\n buttons: Ext.Msg.OK,\n icon: Ext.MessageBox.WARNING\n }); \n grdCgg_res_solicitud_requisito.focus();\n flagValidar = false;\n }\n return flagValidar;\n }", "function validar() {\n var i = 0;\n\n if ($(\"#txtNombre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSerie\").val().length < 1) {\n i++;\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n i++;\n }\n\n\n if (i == 5) {\n alert(\"Por favor llene todos los campos.\");\n return false;\n }\n\n\n if ($(\"#txtNombre\").val().length < 1) {\n alert(\"El nombre es obligatorio.\");\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n alert(\"El semestre designado es obligatorio.\");\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n alert(\"La carrera es obligatorio.\");\n }\n if ($(\"#txtSerie\").val().length < 1) {\n alert(\"La serie es obligatorio.\");\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n alert(\"El campo de horas practicas es obligatorio.\");\n }\n\n if (i == 0) {\n saveMtr(); \n $('#txtSerie').val('');\n $('#txtNombre').val('');\n $('#txtSemestre').val('');\n $('#txtCarrera').val('');\n $('#txtHPracticas').val('');\n return false;\n }\n\n}", "function validaFormProvimento() {\n var ueid = document.getElementById(\"ueid\");\n var matricula = document.getElementById(\"Matricula\");\n var motivo = document.getElementById(\"inputMotivo\");\n var motivo_data_inicio = date(document.getElementById(\"DataInicio\"));\n var motivo_data_fim = date(document.getElementById(\"DataFim\"));\n var data_assuncao = date(document.getElementById(\"DataAssuncao\"));\n\n if (ueid == \"\" || (ueid = null)) {\n erro = \"Código empresa está vazio\";\n }\n\n if (ueid.length > 8) {\n erro = \"Código da escola não pode ter mais que 8 dígitos\";\n }\n\n if (motivo <= 0) {\n document.getElementById(\"erroMotivo\").value =\n \"Por favor, escolha um motivo de provimento.\";\n }\n\n if (motivo_data_fim <= motivo_data_inicio) {\n erro = \"Data final não pode ser menor ou igual a data início.\";\n }\n}", "function validateFieldsUF(){\n \n\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}//end validateFieldsUF", "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 validateFieldsIF(){\n \n console.log(\"ENTRA\");\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\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 validateFields() {\n\t// hide all previous warnings\n\thideAllWarnings();\n\tconsole.log(\"validando campos\");\n\t\t\n\tvar err = false;\n\t\t\n\t//--var textTypeFields = new Array( 'name', 'empresa', 'telefono', 'email', 'lugar' );\n\tvar textTypeFields = new Array( 'name', 'telefono', 'email', 'lugar' );\n\t\n\t// Check if text fields have content\n\tfor( var i = 0; i < textTypeFields.length; i++ ) {\n\t\tif( $( \"#\" + textTypeFields[i] ).val().length == 0 ) {\n\t\t\t$( \"#\" + textTypeFields[i] + \"_msg\" ).toggle();\n\t\t\t$( \"#\" + textTypeFields[i] ).select();\n\t\t\t$( \"#\" + textTypeFields[i] ).focus();\n\t\t\terr = true;\n\t\t\treturn err;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\n\t// Check if there is a valid email address\n\tif( !checkEmail( $(\"#email\").val() ) && !err ) {\n\t\t$(\"#email_msg_format\").toggle();\n\t\terr = true;\n\t}\n\tconsole.log(\"el valor de err \" + err);\n\tif(!err) {\n\t\t$(\"#contact_message\").html(\"Enviando pedido..., <br />por favor espere.\");\n\t\tinitializeDB();\n\t\tvar elementos = new Array();\n\t\tdb.transaction( function(tx) {\n\t\t\ttx.executeSql('SELECT * FROM orders', [], function(tx, results) {\n\t\t\t\tvar len = results.rows.length;\n\t\t\t\tfor (var i=0; i < len; i++){\n\t\t elementos[i] = results.rows.item(i).id_mod +\";\"+ results.rows.item(i).cost + \";\" + results.rows.item(i).cant;\n\t\t }\n\t\t\t\t\n\t\t\t\tvar name = $(\"#name\").val();\n\t\t\t\tvar company = $(\"#client\").val(); //---$(\"#empresa\").val();\n\t\t\t\tvar telephone = $(\"#telefono\").val();\n\t\t\t\tvar email = $(\"#email\").val();\n\t\t\t\tvar city = $(\"#lugar\").val();\n\t\t\t\tvar modules = '';\n\t\t\t\tvar pack = '';\n\t\t\t\tvar tiempo = '';\n\t\t\t\tvar costo = '';\n\t\t\t\tvar datos = elementos.join(\"-\");\n\t\t\t\t\n\t\t\t\tconsole.log(\"los datos a enviar \" + datos);\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\turl: \"http://www.enbolivia.com/class/sendcot3.php\",\n\t\t\t\t\tdata: ({\"frmnombre\": name,\"frmempresa\": company, \"frmtelefono\": telephone, \"frmmail\": email, \"frmlugar\": city, \"frmpaquetes\": datos, \"frmidpaquete\": pack, \"frmtiempo\": tiempo, \"frmcosto\": costo}),\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdataType: \"text\",\n\t\t\t\t\tsuccess: envioSatisfactorio,\n\t\t\t\t\terror: function() {navigator.notification.alert(\"Su cotizaci\\u00f3n no se pudo enviar.\", function() {}, \"Formulario de Contactos\", \"Aceptar\");}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}, errorCB);\n\t\t}, errorCB, successCB);\n\t}\n\t\n\treturn err;\n}", "function validar1()\r\n\t{\r\n\t\t// incio de validación de espacios nulos\r\n\t\tif(document.registro.telfdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio es necesario\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Celular es necesario\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio es necesario\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Mail es necesario\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t//Fin de validacion de espacios nulos \r\n\t\t//-------------------------------------------\r\n\t\t// Incio de validacion de tamanio \t\r\n\t\tif(document.registro.telfdom.value.length<7 || document.registro.telfdom.value.length>7)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio incorrecto\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length!=8)\r\n\t\t{\r\n\t\t\talert(\"Celular es incorrecto\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length<=5 || document.registro.dirdom.value.length>=200)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio incorrecto\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length<=10 || document.registro.mail.value.length>=100 )\r\n\t\t{\r\n\t\t\talert(\"El mail es incorrecto\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// fin de validacion de tamanio \r\n\t\t// --------------------------------\r\n\t\t// incio validaciones especiales\r\n\t\tif(isNaN(document.registro.telfdom.value))\r\n\t\t{\r\n\t\t\talert(\"El telefono de domicilio tiene que ser un número\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirOf.value.length!=0){\r\n\t\t\tif(document.registro.dirOf.value.length>=200 || document.registro.dirOf.value.length<10)\r\n\t\t\t{\r\n\t\t\t\talert(\"Esta Direccion parece incorrecta\");\r\n\t\t\t\tdocument.registro.dirOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.telfOf.value.length!=0){\r\n\t\t\tif(document.registro.telfOf.value.length!=7)\r\n\t\t\t{\r\n\t\t\t\talert(\"Este Telefono no parece correcto\");\r\n\t\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfOf.value)&& document.registro.telfOf.value.length!=0)\r\n\t\t{\r\n\t\t\talert(\"El telefono de oficina tiene que ser un número\");\r\n\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.celular.value))\r\n\t\t{\r\n\t\t\talert(\"El celular tiene que ser un número\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\"@\"))<3)\r\n\t\t{\r\n\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\".com\")<5)&&(document.registro.mail.value.indexOf(\".org\")<5)&&(document.registro.mail.value.indexOf(\".gov\")<5)&&(document.registro.mail.value.indexOf(\".net\")<5)&&(document.registro.mail.value.indexOf(\".mil\")<5)&&(document.registro.mail.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\tdocument.registro.email.focus() ;\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mailOf.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.mailOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\".com\")<5)&&(document.registro.mailOf.value.indexOf(\".org\")<5)&&(document.registro.mailOf.value.indexOf(\".gov\")<5)&&(document.registro.mailOf.value.indexOf(\".net\")<5)&&(document.registro.mailOf.value.indexOf(\".mil\")<5)&&(document.registro.mailOf.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.mailOf.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.msn.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.msn.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.msn.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.msn.value.indexOf(\".com\")<5)&&(document.registro.msn.value.indexOf(\".org\")<5)&&(document.registro.msn.value.indexOf(\".gov\")<5)&&(document.registro.msn.value.indexOf(\".net\")<5)&&(document.registro.msn.value.indexOf(\".mil\")<5)&&(document.registro.msn.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.msn.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// fin validaciones especiales\r\n\t\tdocument.registro.submit();\r\n\t}", "validarDatos() {\n let errores = '';\n\n if (!moment($('#devolucion_venta-fecha').value).isValid()) {\n errores += '<br>Fecha inválida';\n }\n\n\n\n if (!$('#devolucion_venta-cliente').value) {\n errores += '<br>Falta seleccionar cliente';\n }\n\n if (!$('#devolucion_venta-venta').value) {\n errores += '<br>Falta seleccionar una venta';\n }\n\n if(this.tablaDevoluciones){\n let lineasDeVenta = this.tablaDevoluciones.getData();\n if (lineasDeVenta.length == 0) {\n errores += '<br>No se hallaron detalles de venta.';\n } else {\n let lineaIncompleta = false;\n lineasDeVenta.forEach((lineaVenta) => {\n if (!util.esNumero(lineaVenta.subtotal)) {\n lineaIncompleta = true;\n }\n });\n\n if (lineaIncompleta) {\n errores += '<br>Se encontró al menos un detalle de compra incompleto.';\n }\n }\n\n }\n \n\n return errores;\n }", "function validaPreenchimentoCamposFaixa(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.localidadeOrigemID.value != \"\" && form.localidadeDestinoID.value == \"\"){\r\n\t\talert(\"Informe Localidade Final.\");\r\n\t\tform.localidadeDestinoID.focus();\r\n\t\tretorno = false;\r\n\t}else if(form.localidadeDestinoID.value != \"\" && form.localidadeOrigemID.value == \"\"){\r\n\t\talert(\"Informe Localidade Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != \"\" && form.setorComercialDestinoCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.setorComercialDestinoCD.value != \"\" && form.setorComercialOrigemCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.quadraOrigemID.value != \"\" && form.quadraDestinoID.value == \"\"){\r\n\t\talert(\"Informe Quadra Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.quadraDestinoID.value != \"\" && form.quadraOrigemID.value == \"\"){\r\n\t\talert(\"Informa Quadra Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.loteOrigem.value != \"\" && form.loteDestino.value == \"\"){\r\n\t\talert(\"Informe Lote Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.loteDestino.value != \"\" && form.loteOrigem.value == \"\"){\r\n\t\talert(\"Informe Lote Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\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 validateFieldsUP(){\n \n var namePark = document.getElementById('txtName');\n var location = document.getElementById('txtLocation');\n var contact = document.getElementById('txtContact');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyLocation = false, emptyContact = false, \n emptyDescription = false;\n \n if(namePark.value.length < 2){//el parque est� vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(location.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorLocation').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorLocation').style.visibility = \"hidden\";\n }//end else\n \n if(contact.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorContact').style.visibility = \"visible\";\n emptyContact = true;\n }else{\n document.getElementById('msgErrorContact').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyContact === true || emptyDescription === true || \n emptyLocation === true || emptyName === true){\n return false;\n }else{\n return true;\n }\n}", "function validarFormulario() {\n\n /*creo una variable de tipo booleana que en principio tendrá un valor true,\n y que retornaremos en false(falso) cuando nuestra condición no se cumpla*/\n var todo_correcto = true;\n\n /*El primer campo que comprobamos es el del nombre. Lo traemos por id y verificamos\n la condición, en este caso, por ejemplo, le decimos que tiene que tener más de 2 dígitos\n para que sea un nombre válido. Si no tiene más de dos dígitos, la variable todo_correcto\n devolverá false.*/\n\n //ELEMENTOS\n var nombre = document.getElementById('element_1_1');\n var apellido = document.getElementById('element_1_2');\n var direccion = document.getElementById('element_2_1');\n var ciudad = document.getElementById('element_2_3');\n var provincia = document.getElementById('element_2_4');\n var cp = document.getElementById('element_2_5');\n var pais = document.getElementById('element_2_6');\n var tel = document.getElementById('telefono');\n var web = document.getElementById('element_5');\n var email = document.getElementById('element_6');\n var month = document.getElementById('element_3_1');\n var day = document.getElementById('element_3_2');\n var year = document.getElementById('element_3_3');\n var dateFormulario = month.value + \"/\" + day.value + \"/\" + year.value;\n var hoy = new Date();\n var dd = hoy.getDate();\n var mm = hoy.getMonth()+1;\n var yyyy = hoy.getFullYear();\n if(dd<10) {\n dd='0'+dd\n }\n\n if(mm<10) {\n mm='0'+mm\n }\n var fechaActual = mm+'/'+dd+'/'+yyyy;\n\n var x=fecha2MayorFecha1(dateFormulario,fechaActual);\n\n\n\n\n\n\n\n //EXPRESIONES REGULARES\n var regexpGlobal = /^([a-z ??????]{2,60})$/i;\n var regexpDireccion = /^([a-zA-Z\\d\\s\\-\\,\\#\\.\\+])+/;\n var regexpCodigoPostal = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n var regexpTelefono = /(?:[+]?(?:[0-9]{1,5}|\\\\x28[0-9]{1,5}\\\\x29)[ ]?)?[0-9]{2}(?:[0-9][ ]?){6}[0-9]/;\n var regexpWeb = /^(http?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\?=.-]*)*\\/?$/;\n var regexpEmail = /^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/;\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR NOMBRE\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(nombre.value)) {\n nombre.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n nombre.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR APELLIDO\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(apellido.value)) {\n apellido.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n apellido.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR Direccion\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpDireccion.test(direccion.value)) {\n direccion.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n direccion.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR CIUDAD\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(ciudad.value)) {\n ciudad.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n ciudad.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR PROVINCIA\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(provincia.value)) {\n provincia.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n provincia.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR CODIGO POSTAL\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpCodigoPostal.test(cp.value)) {\n cp.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n cp.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR PAIS\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (pais.value == \"\") {\n pais.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n pais.style.borderColor = \"black\";\n }\n /////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR TELEFONO\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpTelefono.test(tel.value)) {\n tel.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n tel.style.borderColor = \"black\";\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR WEB\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpWeb.test(web.value)) {\n web.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n web.style.borderColor = \"black\";\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR email\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpEmail.test(email.value)) {\n email.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n email.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR fecha\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!validaFechaDDMMAAAA(dateFormulario)) {\n day.style.borderColor = \"red\";\n month.style.borderColor = \"red\";\n year.style.borderColor = \"red\";\n todo_correcto = false;\n\n\n }\n if(fecha2MayorFecha1(dateFormulario,fechaActual)){\n day.style.borderColor = \"red\";\n month.style.borderColor = \"red\";\n year.style.borderColor = \"red\";\n todo_correcto = false;\n\n }\n\n\n if (todo_correcto==false) {\n alert('Los campos en rojo no estan correctos, vuelva a revisarlos');\n }\n\n return todo_correcto;\n\n\n\n}", "function ValidadoresDatosGenerales() {\r\n\tjQuery.validator.addMethod(\"alphanumeric\", function(value, element) {\r\n\t\treturn this.optional(element) || /^\\w+$/i.test(value);\r\n\t}, \"Letters, numbers, and underscores only please\");\r\n\r\n\t$.validator.addMethod(\"ValidaVacios\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaSoloLetras\", function(value, element) {\r\n\t\tvar objRegExp = /^[a-z\\u00C0-\\u00ff]+$/;\r\n\t\tif (!objRegExp.test(value)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumento\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboDocumento').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoProp\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cbdoTipoDocRA').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoRRLL\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboTipoDocRRLL').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoRA\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboDocIdenRAS').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRUCPJ\", function(value, element) {\r\n\t\tif($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() === ''){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() !== '') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif ($('#txtRucRA').val() !== '' && $('#txtRucPJRA').val() === '') {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRUCPN\", function(value, element) {\r\n\t\tif($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() === ''){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() !== '') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif ($('#txtRucRA').val() !== '' && $('#txtRucPJRA').val() === '') {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRZPJ\", function(value, element) {\r\n\t\tif ($('#txtRucPJRA').val() !== '') {\r\n\t\t\tif ($('#txtRSocialPJRA').val() === '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t} \r\n\t}, '');\r\n\r\n\t// validacion de formulario inscripcion IPRESS\r\n\t$('#frmDatosPropietario').validate({\r\n\t\tignore : [],\r\n\t\trules : {\r\n\t\t\t// PN\r\n\t\t\ttxtRucRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t\t//minlength : 11,\r\n\t\t\t\t//number : true\r\n\r\n\t\t\t},\r\n\t\t\tcbdoTipoDocRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtNroDocRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t\t//ValidaDocumentoProp : true\r\n\t\t\t},\r\n\t\t\tcboPaisRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtFecNacRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\tcboSexoRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtAPaternoRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtAMaternoRA : {\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtACasadaRA : {\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtNombresRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\r\n\t\t\t// PJ\r\n\t\t\ttxtRucPJRA : {\r\n\t\t\t\t//minlength : 11,\r\n\t\t\t\tValidaRUCPJ : true,\r\n\t\t\t\t//number : true\r\n\t\t\t},\r\n\t\t\ttxtRSocialPJRA : {\r\n\t\t\t\tValidaRZPJ : true\r\n\t\t\t// required : true\r\n\t\t\t},\r\n\r\n\t\t\t// DIRECCION\r\n\t\t\tcboDepRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tcboProRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tcboDisRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\r\n\t\t\t// DATOS COMPLEMENTARIOS\r\n\t\t\ttxtTelRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtEmailRA : {\r\n\t\t\t\temail : true,\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtReEmailRA : {\r\n\t\t\t\temail : true,\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtNroRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtNroPisoRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtNroDptoRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtInteriorRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\tcboViaRA : {\r\n\t\t\t\tValidaVia1 : true\r\n\t\t\t},\r\n\t\t},\r\n\t\thighlight : function(element) {\r\n\t\t\t$(element).closest('.form-group').addClass('has-error');\r\n\t\t},\r\n\t\tunhighlight : function(element) {\r\n\t\t\t$(element).closest('.form-group').removeClass('has-error');\r\n\t\t},\r\n\t\terrorElement : 'span',\r\n\t\terrorClass : 'help-block',\r\n\t\terrorPlacement : function(error, element) {\r\n\t\t\tif (element.parent('.input-group').length) {\r\n\t\t\t\terror.insertAfter(element.parent());\r\n\t\t\t} else {\r\n\t\t\t\terror.insertAfter(element);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n}", "validateFields() {\n const { description, amount, date } = Form.getValues() //Desustrurando o objeto\n // console.log(description)\n\n if(description.trim() === \"\" || amount.trim() === \"\" || date.trim() === \"\") { // trim: limpeza da sua string\n throw new Error(\"Por favor, preencha todos os campos\")// Throw é jogar para fora (cuspir), criando um novo objeto de erro com uma mensagem adicionada\n } \n }", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "function validarValores(objForm) {\n var i, numEl;\n var bErro = false;\n var numEl = objForm.elements.length;\n\n for (i = 0; i < numEl; i++) {\n var prefixo = objForm.elements[i].name.substring(0, 3);\n\n if (prefixo == \"vlr\") {\n //Limpa espaços a direita e a esquerda\n objForm.elements[i].value = trim(objForm.elements[i].value);\n\n //verifica se tem algum caracter não numerico\n if (!verificarNumeros(objForm.elements[i].value))\n bErro = true;\n\n //compara o valor formatado com o valor do campo\n var sFormatado = formatarValor(objForm.elements[i].value);\n if (sFormatado != objForm.elements[i].value)\n bErro = true;\n }\n }\n\n if (bErro) {\n alert(\"Um ou mais valores informados estão incorretos.\");\n return false;\n }\n\n return true;\n}", "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\t|| !getValue('estadoID')\n\t\t|| !getValue('ciudadID') \n\t\t|| !getValue('shortDesc') \n\t\t|| !getValue('longDesc')\n\t\t|| !isChecked('lblCheck'))\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "function validarDatos(tipoautomata,entrada,alfabeto,inicial,final){\n var strAlert = `!! Error ¡¡\\nNo puedes ingresar una ',' (coma) al final del input.\\nDebes finalizar la entrada con el ultimo dato.`,\n strAlertAll = `!! Error ¡¡\\nPuede que hayas ingresado una palabra no valida en alguno de los input.\\nPrueba reingresando los datos.`;\n if(tipoautomata === 'AFND'){\n for(let i=0; i<inicial.length; i++){\n let existeInicial = entrada.indexOf(inicial[i]);\n if(existeInicial == -1){\n alert(`!! Error ¡¡\\nEl estado incial ' ${inicial[i]} ' no se encuentra presente en los estados ingresados.\\nPor favor ingrese un estado inicial valido.`);\n return false;\n }\n if(inicial[i]===\"\"){ \n alert(strAlert); \n return false;\n }\n if(inicial[i] == 'null' || inicial[i] == 'undefined'){ \n alert(strAlertAll); \n return false;\n }\n }\n }else{\n for(let i=0; i<inicial.length; i++){\n let existeInicial = entrada.indexOf(inicial[i]);\n if(inicial.length>1){\n alert(`!! Error ¡¡\\nSolo puedes poner un estado inicial.`); \n return false;\n }\n if(existeInicial == -1){\n alert(`!! Error ¡¡\\nEl estado incial ' ${inicial[i]} ' no se encuentra presente en los estados ingresados.\\nPor favor ingrese un estado inicial valido.`);\n return false;\n }\n if(inicial[i]===\"\"){ \n alert(strAlert); \n return false;\n }\n if(inicial[i] == 'null' || inicial[i] == 'undefined'){ \n alert(strAlertAll); \n return false;\n }\n }\n }\n for(let m=0; m<entrada.length; m++){\n if(entrada[m]===\"\"){ \n alert(strAlert); \n return false;\n }\n if(entrada[m] == 'null' || entrada[m] == 'undefined'){ \n alert(strAlertAll); \n return false;\n }\n }\n for(let m=0; m<alfabeto.length; m++){\n if(alfabeto[m]===\"\"){ \n alert(strAlert); \n return false;\n }\n if(alfabeto[m] == 'null' || alfabeto[m] == 'undefined'){ \n alert(strAlertAll); \n return false;\n }\n }\n for(let j=0; j<final.length; j++){\n var existeFinal = entrada.indexOf(final[j]);\n if(existeFinal == -1){\n alert(`!! Error ¡¡\\nEl estado incial ' ${final[j]} ' no se encuentra presente en los estados ingresados.\\nPor favor ingrese un estado final valido.`);\n return false;\n }\n if(final[j]===\"\"){ \n alert(strAlert); \n return false;}\n if(final[j] == 'null' || final[j] == 'undefined'){ \n alert(strAlertAll); \n return false;\n }\n } \n}", "function ValidarCamposVacios(texto) {\n var retorno = false;\n if (texto.length > 0) {\n if (texto != \"\") {\n retorno = true;\n }\n }\n return retorno;\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 validamos(){\r\n\r\n documento = $(\"#numdoc\").val();\r\n pnombre = $(\"#pnombre\").val();\r\n papellido = $(\"#papellido\").val();\r\n direccion = $(\"#direccion\").val();\r\n correo = $(\"#correo\").val();\r\n celular = $(\"#celular\").val();\r\n esp = $(\"#esp\").val();\r\n\r\n\r\n if (documento.length <2) {\r\n alert(\"Ingrese un numero documento por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (pnombre.length <2) {\r\n alert(\"Ingrese un numero Nombre por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (papellido.length <2) {\r\n alert(\"Ingrese un numero Apellido por favor.\")\r\n return false;\r\n\r\n }\r\n if (direccion.length <2) {\r\n alert(\"Ingrese un numero direccion por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (correo.length <2) {\r\n alert(\"Ingrese un numero correo por favor.\")\r\n return false;\r\n\r\n }\r\n if (celular.length <2) {\r\n alert(\"Ingrese un numero celular por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (esp.length <2) {\r\n alert(\"Ingrese especializacion.\")\r\n return false;\r\n\r\n }\r\n \r\n\r\n\r\n\r\n\r\n }", "function validar2(formulario){\n\n\t\t//comprobamos la longitud de los nombres\n\t\tif (formulario.nombreform.value.length==0){\n\t\t\talert (\"El campos nombre es obligatorio\");\n\t\t\treturn false;\n\t\t}\n\t\t//esta lista de caracteres lo que hace es comprobar que se le introduce caracteres validos seguidos de un \"@\" con más texto para terminar con un \".com\" por\n\t\t//ejemplo \"[a-z]\" significa de la \"a\" a la \"Z\" y {2,3} la longitud de esta palabra final. \n\t\tlistacar=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/\n\t\tif (!listacar.test(document.getElementById('mailform').value)){\n\t\t\talert (\"Debe indicar un email valido\");\n\t\t\treturn false;\n\t\t}\n\t\t//comprobamos si se envía información del proyecto\n\t\tif (formulario.telefonoform.value.toString().length<6){\n\t\t\talert (\"Indique un numero de teléfono valido\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar input = document.getElementById(\"fechareunion\").value;\n\t\tvar fechaintroducida = new Date(input);\n\t\tvar fechaminima = new Date().getTime() + (24 * 60 * 60 * 1000);\n\t\tvar fechamaxima = new Date().getTime() + (365 * 24 * 60 * 60 * 1000);\n\t\t\n\t\t//Comprobamos que se ha introducido una fecha\n\t\tif (isNaN(fechaintroducida)) {\n\t\t\talert(\"Introduzca una fecha para la reunión por favor.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t//Comprobamos que la fecha esta entre mañana y dentro de un año\n\t\tif (fechaintroducida > fechamaxima) {\n\t\t\talert (\"Plazo máximo para la reunión de un año\");\n\t\t\treturn false;\n\t\t}else if (fechaintroducida < fechaminima) {\n\t\t\talert (\"Plazo mínimo para la reunión a partir de mañana\");\n\t\t\treturn false;\n\t\t}else {\n\t\t\talert(\"Fecha valida\");\n\t\t}\n\t\t\n\t\t//comprobamos si se envía información del proyecto\n\t\tif (formulario.motivoreunion.value.length<5){\n\t\t\talert (\"Indique el motivo de la reunión\");\n\t\t\treturn false;\n\t\t}\n\t\t//comprueba se aceptan las políticas de privacidad\n\t\tif (!formulario.politicasform.checked){\n\t\t\talert (\"Debe aceptar la política de privacidad.\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\talert (\"Privacidad marcada\");\n\t\t}\n}", "function validaPesquisaFaixaSetor(){\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != form.setorComercialDestinoCD.value){\r\n\t\tif(form.localidadeOrigemID.value != form.localidadeDestinoID.value){\r\n\t\t\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Setor Comercial as Localidade inicial e final devem ser iguais.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\t\t\r\n\t}\r\n\t\r\n\tif((form.setorComercialOrigemCD.value != \"\" )\r\n\t\t&& (form.setorComercialOrigemCD.value > form.setorComercialDestinoCD.value)){\r\n\t\talert(\"O c?digo do Setor Comercial Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n\r\n}", "function validateTextBox(e, id) {\n\n\n /* let bValidate = true;\n let bValidateMail = false;\n let listTextBox = new Array();\n let listSelect = new Array();\n \n \n listTextBox[0] = $('#emp_name');\n listTextBox[1] = $('#emp_surname');\n listTextBox[2] = $('#emp_address');\n listTextBox[3] = $('#emp_document');\n \n let sMail = $('#emp_mail');\n let sMail_2 = $('#emp_mail2');\n \n let sPassword = $('#emp_password');\n let sPassword2 = $('#emp_password_confirm');\n \n \n \n listSelect[0] = $('#listPermission');\n listSelect[1] = $('#listBraBusiness');\n listSelect[2] = $('#listRole');\n $('input').removeClass('invalid');\n \n if (!validateBoxText(listTextBox) ) {\n \n textInfoForm.text(\"Verifique los datos de los contenidos\");\n return false;\n }\n if (!validateBoxEmail(sMail)) {\n textInfoForm.text(\"Verifique los datos de su cuenta de correo mail 1\");\n return false;\n } else {\n \n \n if (sMail_2.val().toLowerCase() === sMail.val().toLowerCase()) {\n textInfoForm.text(\"Los email deben ser diferentes\");\n sMail_2.addClass('invalid');\n sMail.addClass('invalid');\n return false;\n }\n else if (sMail_2.val() != \"\" || sMail_2.val().length > 0) {\n \n let bValidateMail = (expressionEmail.test(sMail_2.val().toLowerCase())) ? false : true;\n \n if (bValidateMail) {\n sMail_2.addClass('invalid');\n textInfoForm.text(\"Verifique los datos de su cuenta de correo mail 2\");\n return false;\n } \n }\n }\n \n if (!validateBoxPassword(sPassword)) {\n textInfoForm.text('Tenga en cuenta :Mínimo 8 caracteres, máximo 15, al menos una letra mayúscula, al menos una letra minúscula, al menos un carácter, no espacios en blanco.');\n return false;\n } else if(!validateBoxPasswordConfirm(sPassword, sPassword2)){\n textInfoForm.text(\"Las constraseñas no coinciden \");\n return false;\n \n }\n if (!validateSelectList(listSelect)) {\n textInfoForm.text(\"Seleccione una opción de las listas\");\n return false;\n \n }else if (listSelect[0].val().length < 1) {\n textInfoForm.text(\"Seleccione una opción de las listas\");\n return false;\n } \n \n \n if (bValidate) {\n \n textInfoForm.text(\"\");\n $('input').removeClass('invalid');\n dataJson.iRol_id = parseInt(listSelect[2].val());\n dataJson.sEmp_name = listTextBox[0].val().toLowerCase();\n dataJson.sEmp_document = listTextBox[3].val().toLowerCase();\n dataJson.sEmp_surname = listTextBox[1].val().toLowerCase();\n dataJson.sEmp_phone = $('#emp_phone').val();\n dataJson.sEmp_phone2 = $('#emp_phone2').val();\n dataJson.sEmp_cell_phone = $('#emp_cel_phone').val();\n dataJson.sEmp_cell_phone2 = $('#emp_cel_phone2').val();\n dataJson.sEmp_addres = listTextBox[2].val().toLowerCase();\n dataJson.sEmp_mail = sMail.val().toLowerCase();\n dataJson.sEmp_mail2 = sMail_2.val().toLowerCase();\n dataJson.sEmp_password = sPassword.val();\n dataJson.sEmp_photo = $('#emp_photo').val().toLowerCase();\n dataJson.sEmp_permission = listSelect[0].val().toString();\n dataJson.iBra_buis_id = parseInt(listSelect[1].val());\n \n selectionStorages();\n return false;\n }\n else {\n alert(\"Valida la información\");\n return false;\n \n \n }\n \n let formInputTel = $(form + \" :input[type=tel]\");\n let formInputText = $(form + \" :input[type=text]\");\n let formInputPassword = $(form + \" :input[type=password]\");\n let formInputMail = $(form + \" :input[type=email]\");\n let formInputSelect = $(form + \" select\");*/\n\n let form = '#' + id;\n //alert(formInputSelect.length);\n let validate = true;\n //Validate password input\n\n\n //Validate text input\n if (!formInputText(form)) {\n validate = false;\n }\n if (validate && (!formInputTel(form))) {\n validate = false;\n }\n if (validate && (!formInputMail(form))) {\n validate = false;\n }\n if (validate && ($('#sEmp_mail2').val() != \"\" || $('#sEmp_mail2').val() != null)) {\n if ($('#sEmp_mail2').val() == $('#sEmp_mail').val()) {\n validate = false;\n $('#sEmp_mail2').addClass('invalid');\n $('#sEmp_mail').addClass('invalid');\n }\n }\n if (validate && (!formInputPassword(form))) {\n validate = false;\n }\n if (validate && ($('#sEmp_password').val() != $('#emp_password_confirm').val())) {\n validate = false;\n\n $('#sEmp_password').addClass('invalid');\n $('#emp_password_confirm').addClass('invalid');\n }\n if (validate && (!formInputSelect(form))) {\n validate = false;\n }\n if (validate) {\n $('input').removeClass('invalid');\n createObjectJson(id);\n }\n //alert(formInputPassword.length);\n e.preventDefault();\n\n}", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n var divPagamentoAVista = document.getElementById('pagamentoAVista');\n var divPagamentoAPrazo = document.getElementById('pagamentoAPrazo');\n\n if (trim(document.formPagamento.formaPagamentoId.value) == \"\") {\n mensagem = mensagem + \"\\n- Forma de Pagamento\";\n }\n\n if (divPagamentoAVista.style.display == 'block'){\n if (trim(document.formPagamento.subtotalAVista.value) == \"\" || parseFloat(trim(document.formPagamento.subtotalAVista.value)) <= parseFloat(\"0\")) {\n mensagem = mensagem + \"\\n- Subtotal (R$)\";\n }\n else {\n document.formPagamento.subtotalAVista.value = document.formPagamento.subtotalAVista.value.replace(\",\", \".\");\n }\n if (trim(document.formPagamento.totalAVista.value) == \"\" || parseFloat(trim(document.formPagamento.totalAVista.value)) <= parseFloat(\"0\")) {\n mensagem = mensagem + \"\\n- Total (R$)\";\n }\n else {\n document.formPagamento.totalAVista.value = document.formPagamento.totalAVista.value.replace(\",\", \".\");\n }\n }\n else\n if (divPagamentoAPrazo.style.display == 'block'){\n if (trim(document.formPagamento.subtotalAPrazo.value) == \"\" || parseFloat(trim(document.formPagamento.subtotalAPrazo.value)) <= parseFloat(\"0\")) {\n mensagem = mensagem + \"\\n- Subtotal (R$)\";\n }\n else {\n document.formPagamento.subtotalAPrazo.value = document.formPagamento.subtotalAPrazo.value.replace(\",\", \".\");\n }\n if (trim(document.formPagamento.totalAPrazo.value) == \"\" || parseFloat(trim(document.formPagamento.totalAPrazo.value)) <= parseFloat(\"0\")) {\n mensagem = mensagem + \"\\n- Total (R$)\";\n }\n else {\n document.formPagamento.totalAPrazo.value = document.formPagamento.totalAPrazo.value.replace(\",\", \".\");\n }\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n return false;\n }\n}", "function validarLetras(elemento){\n if(elemento.value.length > 0){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 97 && codigA <= 122)||(codigA >=65 && codigA <= 90)||(codigA == 32)){ \n if ((elemento.id=='nombres')||(elemento.id=='apellidos')) {\n //console.log(\"Entra para irse\");\n return validarDosOMasCampos(elemento);\n }\n }else {\n console.log(\"Es una letra invalida\")\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n return false\n }\n }\n}", "function validate() {\n var nombreEmpresa = document.getElementById(\"nombreEmp\").value;\n var nit = document.getElementById(\"nit\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var tOperacion = document.getElementById(\"tipoOperacion\").value;\n\n var camposValidos = true;\n if (nombreEmpresa.length < 3) {\n camposValidos = false;\n alert(nombreEmpresa + \"El nombre debe ser mayor de 3 digitos\");\n }\n if (nit.length < 8) {\n camposValidos = false;\n alert(\"El nit debe ser de 8 u 10 digitos\");\n\n }\n if (nit.length > 10) {\n camposValidos = false;\n alert(\"El nit debe ser de 8 u 10 digitos\");\n\n }\n if (telefono.length < 10) {\n camposValidos = false;\n alert(\"El telefono debe ser de 10 digitos\");\n\n }\n if (tOperacion.value == \"Selecionar: \") {\n \n alert(\"Por favor seleccionar un tipo de operacion\");\n }\n return camposValidos;\n\n}", "function validarCampoE(fila) {\n if ($(\"#cbo-det-2-\" + fila).val() == 0) {\n return false;\n } else if ($(\"#cbo-det-3-\" + fila).val() == 0) {\n return false;\n } else if ($(\"#txt-det-1-\" + fila).val() == \"\") {\n return false;\n } else if ($(\"#txt-det-2-\" + fila).val() == \"\") {\n return false;\n } else {\n return true;\n }\n}", "validarDadosC() {\n for (let i in this) {\n if (this[i] == undefined || this[i] == '' || this[i] == null) {\n return false;\n }\n }\n\n if (this.vencimento == 'e' || this.limite == 'e') {\n return false\n }\n else if (this.vecimento < 1 || this.limite < 1) {\n return false\n }\n else if (this.vencimento > 31) {\n return false\n }\n\n return true;\n }", "function Validar(Cadena){\n var Fecha= new String(Cadena) // Crea un string\n var RealFecha= new Date() // Para sacar la fecha de hoy\n //Cadena A�o\n var Ano= new String(Fecha.substring(Fecha.lastIndexOf(\"-\")+1,Fecha.length))\n // Cadena Mes\n var Mes= new String(Fecha.substring(Fecha.indexOf(\"-\")+1,Fecha.lastIndexOf(\"-\")))\n // Cadena D�a\n var Dia= new String(Fecha.substring(0,Fecha.indexOf(\"-\")))\n\n // Valido el a�o\n if (isNaN(Ano) || Ano.length<4 || parseFloat(Ano)<1900 || Ano.length>4 || parseFloat(Ano)>2015){\n alert('Gestion invalida')\n return false\n }\n // Valido el Mes\n if (isNaN(Mes) || parseFloat(Mes)<1 || parseFloat(Mes)>12){\n alert('Mes invalido')\n return false\n }\n // Valido el Dia\n if (isNaN(Dia) || parseInt(Dia, 10)<1 || parseInt(Dia, 10)>31){\n alert('Dia invalido')\n return false\n }\n if (Mes==4 || Mes==6 || Mes==9 || Mes==11 || Mes==2) {\n if (Mes==2 && Dia > 28 || Dia>30) {\n alert('Dia invalido')\n return false\n }\n }\n}", "function validar_campos(){\n var nome = formulario.nome.value;\n var email = formulario.email.value;\n var msg = formulario.msg.value;\n var bool = true; //variável booleana que confere se o formulario foi preenchido corretamente\n \n if(!valida_campo(nome,'nome','erro_nome')) bool = false;\n if(!valida_email(email)) bool = false;\n if(!valida_campo(msg,'msg','erro_msg')) bool = false;\n return bool;\n}", "function validacion(){\n\n\t/*Recibe en una variable los textos ingresados en los input del formulario*/\n\tnombre = document.getElementById(\"nombre\").value;\n\tpais = document.getElementById(\"pais\").value;\n\tcorreo = document.getElementById(\"correo\").value;\n\t\n\t/*Verifica si el nombre esta vacio y si esta correctamente escrito segun la expresion regular*/\n\tif( nombre == null || nombre == 0 || !(validar_letrasyespacios(nombre)) ) {\n\n\t\tdocument.getElementById(\"nombrevalido\").innerHTML = \"Error, por favor ingrese un nombre valido\";\n\t\tlimpiar();\n\t\treturn false;\n\n\t\tif (validar_letrasyespacios(nombre)==true) {\n\n document.getElementById(\"nombrevalido\").innerHTML = \"\";\n }\n \n\t}\n\t/*Verifica si el pais esta vacio y si esta correctamente escrito segun la expresion regular*/\n\telse if (pais == null || pais.length == 0 || !(validar_letrasyespacios(pais))) {\n\n\t\tdocument.getElementById(\"paisvalido\").innerHTML = \"Error, por favor ingrese un nombre de pais valido\";\n\t\tlimpiar();\n\t\tif (validar_letrasyespacios(nombre)==true) {\n\n document.getElementById(\"paisvalido\").innerHTML = \"\";\n }\n\t\treturn false;\n\t}\n\t/*Verifica si el e-mail esta vacio y si esta correctamente escrito segun la expresion regular*/\n\telse if (!(validar_email(correo))) {\n\n\t\tdocument.getElementById(\"correovalido\").innerHTML = \"Error, por favor ingrese un correo valido\";\n\t\tlimpiar();\n\t\tif (validar_email(nombre)==true) {\n\n document.getElementById(\"correovalido\").innerHTML = \"\";\n }\n\t\treturn false;\n\n\t}\n\n\n\t/*Si el usuario ha escrito todos los campos correctamente le muestra un alert diciendo que los campos han sido enviados correctamente*/\n\talert('Su mensaje ha sido enviado correctamente');\n\treturn true;\n\n\n\n\t\n\n}", "function validarFormulario(nombre, apellidos, telefono, fecha) {\n\n var expresion_regular_nombre = /^[A-z]+$/; //Caulquier letra desde la A mayuscula a la z minuscula\n var expresion_regular_apellidos = /^[A-z]+$/; //Caulquier letra desde la A mayuscula a la z minuscula\n var expresion_regular_telefono = /^[0-9]{2,3}-? ?[0-9]{6,7}$/; // 3 primeros numeros - opcional o espacio 6 numeros mas\n var expresion_regular_fecha = /^(?:(?:(?:0?[1-9]|1\\d|2[0-8])[/](?:0?[1-9]|1[0-2])|(?:29|30)[/](?:0?[13-9]|1[0-2])|31[/](?:0?[13578]|1[02]))[/](?:0{2,3}[1-9]|0{1,2}[1-9]\\d|0?[1-9]\\d{2}|[1-9]\\d{3})|29[/]0?2[/](?:\\d{1,2}(?:0[48]|[2468][048]|[13579][26])|(?:0?[48]|[13579][26]|[2468][048])00))$/;\n\n /*\n Entero: ^(?:\\+|-)?\\d+$\n Correo: /[\\w-\\.]{3,}@([\\w-]{2,}\\.)*([\\w-]{2,}\\.)[\\w-]{2,4}/\n URL: ^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)( [a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\\\+&%\\$#_]*)?$\n Contraseña segura: (?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$\n (Entre 8 y 10 caracteres, por lo menos un digito y un alfanumérico, y no puede contener caracteres espaciales)\n Fecha: ^\\d{1,2}\\/\\d{1,2}\\/\\d{2,4}$\n (Por ejemplo 01/01/2007)\n Hora: ^(0[1-9]|1\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$\n (Por ejemplo 10:45:23)\n Numero de Telefono: ^[0-9]{2,3}-? ?[0-9]{6,7}$\n Codigo Postal: ^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$\n */\n\n //var expresion_regular_email = /^(.+\\@.+\\..+)$/;\n\n\n // Usaremos el método \"test\" de las expresiones regulares:\n if (expresion_regular_nombre.test(nombre) == false) {\n return false;\n }\n if (expresion_regular_apellidos.test(apellidos) == false) {\n return false;\n }\n if (expresion_regular_telefono.test(telefono) == false) {\n return false;\n }\n if (expresion_regular_fecha.test(fecha) == false) {\n return false;\n }\n return true;\n}", "function validar_formu() {\n\tvar valido = true;\n\tvar campo1 = document.getElementById(\"cod_cliente\");\n\tvar campo2 = document.getElementById(\"nombre_cliente\");\n\tif (campo_vacio(campo1) && campo_vacio(campo2)) {\n\t\tvalido = false;\n\t\talert(\"Uno de los dos campos son obligatorios para realizar la consulta de los datos del cliente.\");\n\t}\n\treturn valido;\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 validaCampoTexto(Nombre, longitud, ActualLement) {\n //errorIs = Array();\n LimitaTamCampo(Nombre, Number(longitud), '#' + ActualLement);\n $('#' + ActualLement + '_txt_' + Nombre).change(function () {\n resetCampo(Nombre, '#' + ActualLement);\n validaCampoTextoInSave(Nombre, '#' + ActualLement);\n });\n}", "function validaCampoNumeroInSave(Nombre, ActualLement, rango, decimal) {\n var cValue = $('#' + ActualLement + '_txt_' + Nombre).val();\n var TextErr = false;\n\n if (cValue !== null && cValue !== '') {\n\n if (!decimal) {\n _regEx = new RegExp(\"^[0-9]+$\");\n if (!_regEx.test(cValue)) {\n redLabel_Space(Nombre, 'Solo se permiten caracteres numéricos', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n } else {\n if (!cValue.includes('.')) {\n redLabel_Space(Nombre, 'Solo se permiten decimales', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n\n if (rango !== undefined && Array.isArray(rango)) {\n if (cValue < rango[0]) {\n redLabel_Space(Nombre, 'El rango mínimo deber se de ' + rango[0], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n } else {\n if (cValue > rango[1]) {\n redLabel_Space(Nombre, 'El rango máximo deber se de ' + rango[1], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n }\n\n\n if (TextErr) {\n errorIs[Nombre] = true;\n } else {\n errorIs[Nombre] = false;\n }\n }\n}", "function validarFormModifyDates() {\n const cuTorre = document.forms[\"modifyDatePosition\"][\"torreCU\"];\n const serialTorre = document.forms[\"modifyDatePosition\"][\"torreSerial\"];\n const cuMoni = document.forms[\"modifyDatePosition\"][\"moniCU\"];\n const serialMoni = document.forms[\"modifyDatePosition\"][\"moniSerial\"];\n\n // Los campos no pueden ser vaciós.\n if (cuTorre.value == \"\" || cuTorre.value.length <= 3 || serialTorre.value == \"\" || serialTorre.value.length <= 3 || cuMoni.value == \"\" || cuMoni.value.length <= 3 || serialMoni.value == \"\" || serialMoni.value.length <= 3) {\n snackbar(\"Los campos no deben ser vacios y no deden ser inferiores a 4 caracteres.\");\n return false;\n }else {\n console.log(\"Datos correctos (por ahora)\");\n saveChanges(cuTorre.value, serialTorre.value, cuMoni.value, serialMoni.value, buttonSave.value);\n }\n}", "function validarvacios() {\n var bandera = true;\n /*Creamos un for que nos recorrera todos los elmentos de nuestra html */\n for (var i = 0; i < document.forms[0].elements.length; i++) {\n var elemento = document.forms[0].elements[i]\n /*seleccionamos todoslos elementos de tipo text y comparamos si estos estan vacios */\n if (elemento.value == '' && elemento.type == 'text') {\n /*Si los elementos se encuentran vacios mostrara un mensaje de error en nuestras etiquetas spam */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:block; color:white;'\n document.getElementById('errorNombre').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n\n }\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:block; color:white;'\n document.getElementById('errorApellido').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'cedula') {\n document.getElementById('errorCedula').style = 'display:block; color:white;'\n document.getElementById('errorCedula').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:block; color:white;'\n document.getElementById('errorTelefono').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'direccion') {\n document.getElementById('errorDireccion').style = 'display:block; color:white;'\n document.getElementById('errorDireccion').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:block; color:white;'\n document.getElementById('errorFecha').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:block; color:white;'\n document.getElementById('errorCorreo').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:block; color:white;'\n document.getElementById('errorContrasenia').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n \n } else {\n\n /*se leeel dato de nuestra etiqueta cedula y posteriormente se la envia a nuestra funcion de validar cedula */\n\n\n if(elemento.id == 'cedula'){\n cedula = document.getElementById(\"cedula\").value;\n /*si nuestra cedula esigual a 10 procede a ingresar a nuestro metodo de validacion */\n if (validarnumero(cedula)==false) {\n document.getElementById('errorCedula').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCedula').innerHTML = '<b>No se permite letras'\n }else{\n validaCedula();\n }\n\n }\n\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:none;'\n nombre = document.getElementById(\"nombre\").value;\n if (validarNombre(nombre) == false) {\n document.getElementById('errorNombre').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorNombre').innerHTML = '<b>No se permite numeros</b>'\n }\n }\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:none;'\n apellido = document.getElementById(\"apellido\").value;\n \n if (validarNombre(apellido) == false) {\n document.getElementById('errorApellido').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorApellido').innerHTML = '<b>No se permite numeros</b>'\n }\n\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:none;'\n numero= document.getElementById(\"telefono\").value;\n /*compararemos si todos los datos son de tipo numericos */\n if (validarnumero(numero) == false) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n /*Nos aseguramos de que nuestro telefono tenga un maximo de 10 */\n if (numero.length < 10) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:none;'\n fech = document.getElementById(\"fecha\").value;\n \n if (validarformato(fech) == false) {\n document.getElementById('errorFecha').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorFecha').innerHTML = '<b>Formato de fecha incorrecta</b>'\n }\n\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:none;'\n cor = document.getElementById(\"correo\").value;\n \n if (validarEmail(cor) == false) {\n document.getElementById('errorCorreo').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCorreo').innerHTML = '<b>Extencion de correo incorrecta </b>'\n }\n\n }\n\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:none;'\n contra = document.getElementById(\"contrasenia\").value;\n \n if (contra.length < 8) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n if (validarPasswd (contra) == false) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n\n\n }\n\n \n }\n\n\n bandera = false\n }\n \n}", "function validateForm ()\n {\n\n //Variabele om errors bij te houden\n\n let numberOfErrors = 0;\n\n //Check voornaam\n\n let voornaam = document.getElementById(\"voornaam\");\n let voornaamSpan = document.querySelector(\"#voornaam + span\");\n\n if(voornaam.value.length > 30)\n {\n voornaam.style.borderColor = \"red\";\n voornaamSpan.innerText = \"max 30 karakters !\";\n voornaamSpan.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(voornaam, voornaamSpan, numberOfErrors);\n\n }\n\n //Check familienaam\n\n let familienaam = document.getElementById(\"familienaam\");\n let familienaamSpan = document.querySelector(\"#familienaam + span\");\n\n if(familienaam.value === '' || familienaam.value === ' ')\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Het veld is verplicht !\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else\n {\n if(familienaam.value.length > 50)\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Max 50 karakters\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(familienaam, familienaamSpan, numberOfErrors);\n }\n }\n\n\n\n //Check geboortedatum\n\n let geboortedatum = document.getElementById(\"geboortedatum\");\n let geboortedatumSpan = document.querySelector(\"#geboortedatum + span\");\n\n\n //Gebruik regex expressie. Bemerk dat de expressie tussen twee slashes moet staan.\n\n let regex = /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/;\n\n //We gebruiken de test() method die we aanroepen over een regex expressie\n //Zie https://www.w3schools.com/js/js_regexp.asp\n //Check dat geboortedatum niet leeg is en dan niet aan het patroon voldoet\n\n if(geboortedatum.value !== '' && regex.test(geboortedatum.value) === false)\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Formaat is niet YYYY-MM-DD !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n //Check of geboortedatum leeg is\n\n if(geboortedatum.value === '')\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Geboortedatum is een verplicht veld !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(geboortedatum, geboortedatumSpan, numberOfErrors);\n }\n }\n\n //Check e-mail\n\n let email = document.getElementById(\"email\");\n let emailSpan = document.querySelector(\"#email + span\");\n\n //Regex voor mail geplukt van https://emailregex.com/\n\n regexMail =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\n //Check email tegen regexMail\n\n if(regexMail.test(email.value) === false)\n {\n numberOfErrors += 1;\n email.style.borderColor = \"red\";\n emailSpan.innerText = \"Geen geldig email adres !\";\n emailSpan.style.color = \"red\";\n }\n\n else\n {\n //Check of email ingevuld is\n\n if(email.value === '' || email.value === ' ')\n {\n numberOfErrors += 1;\n emailSpan.innerText = \"Verplicht veld !\";\n emailSpan.style.color = \"red\";\n email.style.borderColor = \"red\";\n }\n else\n {\n resetStyle(email, emailSpan, numberOfErrors);\n }\n }\n\n //Check aantal kinderen\n\n let aantalKinderen = document.querySelector(\"#aantalKinderen\");\n let aantalKinderenSpan = document.querySelector(\"#aantalKinderen + span\");\n\n if(aantalKinderen.value < 0)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"is geen positief getal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n if(aantalKinderen.value > 99)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"te hoog aantal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(aantalKinderen, aantalKinderenSpan, numberOfErrors);\n }\n }\n\n //Geef alert als het formulier volledig correct is\n\n if(numberOfErrors === 0)\n {\n alert(\"formulier correct ingevuld !\")\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 validar(campo1,campo2)\n\t{\t\t\n\t\tvalidarCampo(campo1,campo2);\t\n\t\treturn false;\n\t}", "function validaForm(){\t\n\tif($('#tipo_evento').val() == -1){\n\t\tmensagem(\"Por favor, preencha o campo tipo do evento!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#tipo_evento').focus();\n\t\treturn false\n\t}\n\tif($('#dataInicio').val() == \"\"){\n\t\tmensagem(\"Por favor, preencha o campo data início!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#dataInicio').focus();\n\t\treturn false\n\t}\n\tvar dataAtual = new Date;\n\tvar novaDataInicio = $('#dataInicio').val();\n\tif (novaDataInicio.toString().substring(0,4) < dataAtual.getFullYear() ||\n\t\tnovaDataInicio.toString().substring(0,4) == dataAtual.getFullYear() &&\n\t\t\tnovaDataInicio.toString().substring(5,7) < dataAtual.getMonth() + 1 ||\n\t\tnovaDataInicio.toString().substring(0,4) == dataAtual.getFullYear() &&\n\t\t\tnovaDataInicio.toString().substring(5,7) == dataAtual.getMonth() + 1 &&\n\t\t\tnovaDataInicio.toString().substring(8,10) < dataAtual.getDate())\n\t{\n\t\tmensagem(\"Data de início não pode ser anterior a data atual!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false;\n\t}\n\tif($('#titulo').val() == \"\"){\n\t\tmensagem(\"Por favor, preencha o título!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#titulo').focus();\n\t\treturn false\n\t}\n\tif(typeof $(\"#L10L .clicado\").next().attr(\"value\") == \"undefined\"){\n\t\tmensagem(\"Por favor, preencha o campo feriado!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false\n\t}\n\tif(typeof $(\"#L10A .clicado\").next().attr(\"value\") == \"undefined\"){\n\t\tmensagem(\"Por favor, preencha o campo aula!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false\n\t}\n}", "function ValidateArticolo() {\n\tvar value = document.getElementsByName('parole')[1].value;\n\tif (!/^\\s*$/.test(value)) {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('id_autore')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvar sel = document.getElementsByName('keywords')[0];\n\tfor (var i=0, len=sel.options.length; i<len; i++) {\n opt = sel.options[i];\n if ( opt.selected ) {\n\t\t\treturn true;\n\t\t}\t\t\n\t}\n\tvalue = document.getElementsByName('categoria')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('data_inizio_year')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('data_fine_year')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('citato')[0].value;\n\tif (!/^\\s*$/.test(value)) {\n\t\treturn true;\n\t}\n\n\talert(\"Devi inserire almeno un campo\");\n\treturn false; \n}", "function fValidModificacion()\n{\n\tif($('#txtPrimerNombre').val() == Datos.primernombre && $('#txtSegundoNombre').val() == Datos.segundonombre.replace(/\\+/g,\" \") && $('#txtPrimerApellido').val() == Datos.primerapellido && $('#txtSegundoApellido').val() == Datos.segundoapellido.replace(/\\+/g,\" \") && $('#txtEmail').val() == Datos.email && $('#cmbIdTelefono').val() == Datos.idtelefono && $('#txtTelefonoMovil').val() == Datos.telefonomovil && $('#cmbIdCodArea').val() == Datos.idcodarea && $('#txtTelefonoFijo').val() == Datos.telefonofijo && $('#cmbIdDepartamento').val() == Datos.iddepartamento && $('#cmbIdCargo').val() == Datos.idcargo && $('#txtFechaIngreso').val() == Datos.fechaingreso && $('#txtDireccion').val() == Datos.direccion.replace(/\\+/g,\" \") )\t{\n\t\treturn 0;\n\t}\n\telse {\n\t\treturn 1;\n\t}\n}", "function validarCamposOrden(){\r\n /*if(document.getElementById(\"codigoOrden\").value == \"\"){\r\n alert(\"Falta el codigo de la orden de compra\");\r\n return false;\r\n }*/\r\n if(document.getElementById(\"Proveedor\").value == null){\r\n alert(\"Falta el proveedor\")\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaPedido\").value == \"\"){\r\n alert(\"Falta le fecha de pedido\");\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaEntrega\").value == \"\"){\r\n alert(\"Falta la fecha de entrega\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validar(){\n\tvar valNom = valNombre(); \n\tvar valApe = valApellido();\n\tvar valTel = valNumero();\n\tvar valMayor = valEdad();\n\tvar email = valEmail();\n\tvar ident = identificador();\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 validarFormDelPosition() {\n let namePos = document.forms[\"formDelPosition\"][\"delOnePosition\"].value;\n\n // El campo de nombre de la posicion no puede ser vacio.\n if (namePos === \"\") {\n alert(\"El campo no puede ser vacío.\");\n return false;\n }else {\n // Validar si la posición existe en el plano.\n let namePosMinus = namePos.toLowerCase();\n let cont = 0;\n for (let valor of positions) {\n\n let converNamePos = positions[cont].toLowerCase();\n\n if(namePosMinus !== converNamePos) {\n alert(\"No existe una posición con el nombre \"+namePos+\"\\nPosicion convertida: \"+namePosMinus+\"\\n\"+converNamePos);\n return false;\n }\n cont++;\n }\n }\n}", "function validarGuardadoPrimeraSucursal(){\n\n\tvar sw = 0; // variable para determinar si existen campos sin diligenciar\n\n\t\n\tif( $(\"#sucursal_nombre\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_nombre\").addClass( \"active\" );\n\t\t$(\"#sucursal_nombre\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#sucursal_telefono1\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_telefono1\").addClass( \"active\" );\n\t\t$(\"#sucursal_telefono1\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_celular\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_celular\").addClass( \"active\" );\n\t\t$(\"#sucursal_celular\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_direccion\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_direccion\").addClass( \"active\" );\n\t\t$(\"#sucursal_direccion\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idPais\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_pais\").addClass( \"active\" );\n\t\t$(\"#pais\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idCiudad\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_ciudad\").addClass( \"active\" );\n\t\t$(\"#ciudad\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idBarrio\").val() == '0'){\n\t\t\n\t\t$(\"#label_sucursal_barrio\").addClass( \"active\" );\n\t\t$(\"#barrio\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif(sw == 1){\n\t\treturn false;\n\t}else{\n\t\t$(\"#form_primeraSucursal\").submit();\n\t}\n \n}", "function validForm() {\n // si el nombre es igual a vacio\n // entonces muestrame que es invalido\n if ($('#titulo').val() == \"\") {\n $('#titulo').removeClass(\"is-valid\")\n $('#titulo').addClass(\"is-invalid\")\n } else {\n $('#titulo').removeClass(\"is-invalid\")\n $('#titulo').addClass(\"is-valid\")\n }\n if ($('#descripcion').val() == \"\") {\n $('#descripcion').removeClass(\"is-valid\")\n $('#descripcion').addClass(\"is-invalid\")\n } else {\n $('#descripcion').removeClass(\"is-invalid\")\n $('#descripcion').addClass(\"is-valid\")\n } \n if ($('#categorias').val() == \"\") {\n $('#categorias').removeClass(\"is-valid\")\n $('#categorias').addClass(\"is-invalid\")\n } else {\n $('#categorias').removeClass(\"is-invalid\")\n $('#categorias').addClass(\"is-valid\")\n }\n if ($('#contenido').val() == \"\") {\n $('#contenido').removeClass(\"is-valid\")\n $('#contenido').addClass(\"is-invalid\")\n } else {\n $('#contenido').removeClass(\"is-invalid\")\n $('#contenido').addClass(\"is-valid\")\n }\n if ($('#fecha_publ').val() == \"\") {\n $('#fecha_publ').removeClass(\"is-valid\")\n $('#fecha_publ').addClass(\"is-invalid\")\n } else {\n $('#fecha_publ').removeClass(\"is-invalid\")\n $('#fecha_publ').addClass(\"is-valid\")\n }\n if ($('#fecha_fin').val() == \"\") {\n $('#fecha_fin').removeClass(\"is-valid\")\n $('#fecha_fin').addClass(\"is-invalid\")\n } else {\n $('#fecha_fin').removeClass(\"is-invalid\")\n $('#fecha_fin').addClass(\"is-valid\")\n }\n if ($('#titulo').val() != \"\" && $('#categoria').val() != 0 && $('#descripcion').val() != \"\" && $('#contenido').val() != \"\" && $('#fecha_publ').val() != \"\" && $('#fecha_fin').val() >= \"\") {\n CrearOActualizar()\n }\n}", "function validar()\r\n\t{\r\n\r\n\t\t // incio de validaci�n de espacios nulos\r\n\t\tif(document.registro.nombre.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El nombre necesario\");\r\n\t\t\tdocument.registro.nombre.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.apellido.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El apellido es necesario\");\r\n\t\t\tdocument.registro.apellido.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.ci.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El CI es necesario\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.telfdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio es necesario\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.celular.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Celular es necesario\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio es necesario\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mail.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Mail es necesario\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.usuario.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El nombre de usuario esta vacio\");\r\n\t\t\tdocument.registro.usuario.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.pass.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"No coloco una contrase�a\");\r\n\t\t\tdocument.registro.pass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.conpass.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Debe validar su contrase�a\");\r\n\t\t\tdocument.registro.conpass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t var RegExPattern = /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$/;\t\t\t\r\n\t\t var errorMessage = 'Password No seguro.';\r\n\t\t if ((document.registro.pass.value.match(RegExPattern)) && (document.registro.pass.value!=\"\")) {\r\n\t\t alert('Password Seguro');\r\n\t\t } else {\r\n\t\t alert(errorMessage);\r\n\t\t document.registro.pass.focus();\r\n\t\t\treturn 0;\r\n \t\t\t} \r\n\t\t//Fin de validacion de espacios nulos \r\n\t\t//-------------------------------------------\r\n\t\t// Incio de validacion de tamanio \t\r\n\t\tif(document.registro.nombre.value.length<=3 || document.registro.nombre.value.length>=100)\r\n\t\t{\r\n\t\t\talert(\"El nombre es muy largo o muy corto\");\r\n\t\t\tdocument.registro.nombre.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.apellido.value.length<=3 || document.registro.apellido.value.length>=100)\r\n\t\t{\r\n\t\t\talert(\"El apellidoes muy largo o muy corto\");\r\n\t\t\tdocument.registro.apellido.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.ci.value.length<=5 || document.registro.ci.value.length>=10)\r\n\t\t{\r\n\t\t\talert(\"El CI invalido\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.telfdom.value.length<7 || document.registro.telfdom.value.length>7)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio incorrecto\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.celular.value.length!=8)\r\n\t\t{\r\n\t\t\talert(\"Celular es incorrecto\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirdom.value.length<=5 || document.registro.dirdom.value.length>=200)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio incorrecto\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mail.value.length<=10 || document.registro.mail.value.length>=100 )\r\n\t\t{\r\n\t\t\talert(\"El mail es incorrecto\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.usuario.value.length<=5 || document.registro.usuario.value.length>=10 )\r\n\t\t{\r\n\t\t\talert(\"El nombre de usuario debe estar entre 6 y 10 caracteres\");\r\n\t\t\tdocument.registro.usuario.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.pass.value.length<=7 || document.registro.pass.value.length>=15 )\r\n\t\t{\r\n\t\t\talert(\"La contrase�a debe estar entre 8 y 15 caracteres\");\r\n\t\t\tdocument.registro.pass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// fin de validacion de tamanio \r\n\t\t// --------------------------------\r\n\t\t// incio validaciones especiales\r\n\t\tif(isNaN(document.registro.ci.value))\r\n\t\t{\r\n\t\t\talert(\"El carnet de indentidad tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfdom.value))\r\n\t\t{\r\n\t\t\talert(\"El telefono de domicilio tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfofi.value)&& document.registro.telfofi.value.length!=0)\r\n\t\t{\r\n\t\t\talert(\"El telefono de oficina tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.telfofi.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.celular.value))\r\n\t\t{\r\n\t\t\talert(\"El celular tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\"@\"))<3)\r\n\t\t{\r\n\t\t\talert(\"Lo siento,la cuenta de correo parece err�nea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\".com\")<5)&&(document.registro.mail.value.indexOf(\".org\")<5)&&(document.registro.mail.value.indexOf(\".gov\")<5)&&(document.registro.mail.value.indexOf(\".net\")<5)&&(document.registro.mail.value.indexOf(\".mil\")<5)&&(document.registro.mail.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece err�nea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminaci�n como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\tdocument.registro.email.focus() ;\r\n\t\t\treturn 0;\r\n\t\t} \r\n\t\tif(document.registro.pass.value !=document.registro.conpass.value )\r\n\t\t{\r\n\t\t\talert(\"Las contrase�as no coinciden\");\r\n\t\t\tdocument.registro.conpass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.tipo.value ==0)\r\n\t\t{\r\n\t\t\talert(\"Debes escoger que tipo de usuario eres\");\r\n\t\t\tdocument.registro.tipo.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.tipo.value >=3 && document.registro.ingreso.value ==0)\r\n\t\t{\r\n\t\t\talert(\"Debes escoger el a�o que entraste a la camara\");\r\n\t\t\tdocument.registro.ingreso.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// fin validaciones especiales\r\n\t\tdocument.registro.submit();\r\n\t}", "function validation()\r\n{\r\n\tvar reference = new String(document.getElementById(\"reference\").value);\r\n\tif (reference.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(referenceNonRenseignee);\r\n\t}\r\n\r\n\tif (!verifier(reference))\r\n\t{\r\n\t\treturn afficheErreur(referenceLettreRequise);\t\t\r\n\t}\r\n\t\r\n\tvar titre = new String(document.getElementById(\"titre\").value);\r\n\tif (titre.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(titreNonRenseigne);\r\n\t}\r\n\t\r\n\tvar auteurs = new String(document.getElementById(\"auteurs\").value);\r\n\tif (auteurs.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(auteursNonRenseignes);\r\n\t}\r\n\r\n\tvar editeur = new String(document.getElementById(\"editeur\").value);\r\n\tif (editeur.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editeurNonRenseigne);\r\n\t}\r\n\t\r\n\tvar edition = new String(document.getElementById(\"edition\").value);\r\n\tif (edition.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editionNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(edition))\r\n\t{\r\n\t\treturn afficheErreur(editionDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar annee = new String(document.getElementById(\"annee\").value);\r\n\tif (annee.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(anneeNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(annee) || annee.length != 4)\r\n\t{\r\n\t\treturn afficheErreur(anneeDoitEtreNombre4Chiffres);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar isbn = new String(document.getElementById(\"isbn\").value);\r\n\tif (isbn.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(isbnNonRenseigne);\r\n\t}\r\n\tif (isNaN(isbn))\r\n\t{\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar nombreExemplaires = new String(document.getElementById(\"nombreExemplaires\").value);\r\n\tif (nombreExemplaires.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(nombreExemplairesNonRenseigne);\r\n\t\t\r\n\t}\r\n\tif (isNaN(nombreExemplaires))\r\n\t{\r\n\t\t// Afficher Erreur Correspondante\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\r\n\tvar disponibilite = document.getElementById(\"Disponibilite\").checked;\r\n\tvar excluPret = document.getElementById(\"excluPret\").checked;\r\n\tvar commentaires = new String(document.getElementById(\"Commentaires\").value);\r\n\t// crŽation d'un ouvrage \r\n\t\r\n\tvar ouvrage = new Array();\r\n\touvrage[indiceReference] = reference;\r\n\t// Completer l'ouvrage\r\n\touvrage[indiceTitre] = titre;\r\n\touvrage[indiceAuteurs] = auteurs;\r\n\touvrage[indiceEditeur] = editeur;\r\n\touvrage[indiceEdition] = edition;\r\n\touvrage[indiceAnnee] = annee;\r\n\touvrage[indiceIsbn] = isbn;\r\n\touvrage[indiceNombreExemplaires] = nombreExemplaires;\r\n\touvrage[indiceDisponibilite] = disponibilite;\r\n\touvrage[indiceExcluPret] = excluPret;\r\n\touvrage[indiceCommentaires] = commentaires;\r\n\touvrages[nombreOuvrages] = ouvrage;\r\n\tnombreOuvrages++;\r\n\t\r\n\tafficherResume(ouvrage);\r\n\treset_validation()\r\n\t\r\n}", "function validarCampo(){\r\n\tlet lleno=true;\r\n inputNombre = document.querySelector('#txtNombre');\r\n\t inputSegundoNombre= document.querySelector('#txtSegundoNombre');\r\n\t inputApellido = document.querySelector('#txtApellido');\r\n inputSegundoApellido= document.querySelector('#txtSegundoApellido');\r\n\t inputIdentificacion= document.querySelector('#txtIdentificacion');\r\n\t inputFechaNacimiento = document.querySelector('#txtFechaNacimiento');\r\n\t\t inputGenero = document.querySelector('input[name= genero]:checked'); \r\n\t\t inputTelefono = document.querySelector('#txtTelefono');\r\n\t inputCorreo = document.querySelector('#txtCorreo');\r\n\t inputGradoAcademico=document.querySelector('#txtGradoAcademico');\r\n\t inputInstitucion = document.querySelector('#txtInstitucion');\r\n\t inputNivel = document.querySelector('#txtNivel');\r\n\t inputSeccion = document.querySelector('#txtSeccion');\r\n\t\r\n\r\nlet formulario=[];\r\n\t formulario=[inputNombre,inputApellido,inputSegundoApellido,inputIdentificacion,inputFechaNacimiento,\r\n\t\tinputGenero,inputTelefono,inputCorreo,inputGradoAcademico,inputInstitucion,inputNivel,inputSeccion];\r\n\r\nfor ( vacio= 0; vacio <formulario.length; vacio++) {\r\n if (formulario[vacio].value==\"\"){\r\n\t\t\r\n\tformulario[vacio].classList.add('bordeError'); \r\n\t\t lleno=false;\r\n\t\t document.querySelector('#modal').classList.remove('ocultar');\r\n\t\t \r\n}else{\r\nformulario[vacio].classList.remove('bordeError');\r\nformulario.length==lleno;\r\n \r\n }\r\n\r\n }\r\n \r\n\r\n return lleno;\r\n}", "function validaCampoVacio(Nombre, _G_ID_) {\n /* Es de tipo select */\n if ($(_G_ID_ + '_txt_' + Nombre).is('select')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == -1) {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n } else /* de tipo input*/\n if ($(_G_ID_ + '_txt_' + Nombre).is('input')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == '') {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n }\n}", "function validaPesquisaFaixaLote(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.quadraOrigemID.value != form.quadraDestinoID.value){\r\n\t\tif(form.loteOrigem.value != form.loteDestino.value){\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Lotes as Localidade, os Setores Comerciais e as Quadras iniciais e finais devem ser iguais.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((form.loteOrigem.value != \"\" )\r\n\t\t&& (form.loteOrigem.value > form.loteDestino.value)){\r\n\t\talert(\"O n?mero do Lote Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function validarFormulario() {\n //limpiar los avisos anteriores!!\n emptySpans();\n let camposAValidar = document.getElementsByTagName(\"input\");\n let valido = true;\n //comprobar que cumpla todo lo que dice cada campo input text y date\n for (let i = 0; i < camposAValidar.length; i++) {\n if (camposAValidar[i].type ==\"text\" || camposAValidar[i].type ==\"date\") {\n //si no se validan se cambia el color a rojo y se añade el mensaje de ayuda\n if (!validarInputText(camposAValidar[i].id, camposAValidar[i].getAttribute(\"regexp\"), camposAValidar[i].getAttribute(\"obligatorio\"))) {\n let span = document.createElement(\"span\");\n camposAValidar[i].style.borderColor = \"red\";\n span.innerHTML = camposAValidar[i].title;\n span.style.color = \"red\";\n camposAValidar[i].parentNode.insertBefore(span, camposAValidar[i]);\n valido = false;\n }else{\n //si esta bien quitamos el atributo style\n camposAValidar[i].removeAttribute(\"style\");\n }\n }\n }\n //devuelve si es valido o no\n return valido;\n\n}", "function verificarCampos(){\n let añoS=parseInt(fechafinal.value.substr(0,4));\n let mesS=parseInt(fechafinal.value.substr(5,7));\n let diaS=parseInt(fechafinal.value.substr(8,10));\n \n\n if(idC.value==''|| producto.value=='' || estanteria.value==''|| precio.value==''||\n descripcion.value==''|| ubicacion.value=='' ||fechafinal.value=='' ){\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n LLene todo los Campos\n </div>\n `;\n mensaje.style.display='block';\n }else if((añoS<anoActual || mesS<mesActual) || diaS<=dia ){\n mensaje.style.display='block';\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n La fecha escojida debe ser superior a la actual \n </div>\n `;\n \n }else{\n insertarDatosEmpeno();\n }\n }", "function validarCamposDetalle(){\r\n if(document.getElementById(\"Cantidad\").value == \"\"){\r\n alert(\"falta la cantidad\");\r\n return false;\r\n }\r\n if(document.getElementById(\"Precio\").value == \"\"){\r\n alert(\"falta el precio\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validarDosOMasCampos(elemento)\n{ \n if(elemento.value.length > 0){\n for (var i = 0; i < elemento.value.length; i++) {\n if (((elemento.value.charCodeAt(i)==32))) {\n if ((elemento.value.charCodeAt(i-1)!=32)&&(elemento.value.charCodeAt(i+1)>=65)&&(elemento.value.charCodeAt(i+1)<=122)){\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML =''; \n }else{\n \n document.getElementById('mensaje3').innerHTML=\"\" ;\n }\n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto'; \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n return false;\n }\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto';\n console.log(\"Es nombre\"); \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n }\n \n }\n }\n}", "function validarAgregarAbogado(){\r\n var validacion=true;\r\n var nombre=document.getElementById('nombreAbogado').value.trim();\r\n var campoNombre=document.getElementById('nombreAbogado');\r\n var dni=document.getElementById('dniAbogado').value.trim();\r\n var campoDni=document.getElementById('dniAbogado');\r\n var sueldo=document.getElementById('sueldo').value.trim();\r\n var campoSueldo=document.getElementById('sueldo');\r\n var error=\"\";\r\n\r\n var oExpReg=/^[A-Z][a-z]{3,40}$/;\r\n\r\n if(oExpReg.test(nombre)==false){\r\n\r\n error+=\"Error en el campo nombre<br>\";\r\n campoNombre.style.backgroundColor=\"orange\";\r\n }else{\r\n campoNombre.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{8}[a-zA-Z]$/;\r\n\r\n if(oExpReg.test(dni)==false){\r\n\r\n error+=\"Error en el campo dni<br>\";\r\n campoDni.style.backgroundColor=\"orange\";\r\n }else{\r\n campoDni.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{3,4},\\d{2}$/;\r\n\r\n if(oExpReg.test(sueldo)==false){\r\n\r\n error+=\"Error en el campo sueldo<br>\";\r\n campoSueldo.style.backgroundColor=\"orange\";\r\n }else{\r\n campoSueldo.style.backgroundColor=\"white\";\r\n\r\n }\r\n\r\n if(error!=\"\"){\r\n toastr.error(error,\"Fallo en la Validacion\");\r\n validacion=false;\r\n }\r\n\r\n\r\n\r\n return validacion;\r\n\r\n}", "function validarAgregarCliente(){\r\n var validacion=true;\r\n\r\n var dniCiente=document.getElementById('dniCliente').value.trim();\r\n var campoDniCiente=document.getElementById('dniCliente');\r\n\r\n var nombreCiente=document.getElementById('nombreCliente').value.trim();\r\n var campoNombreCiente=document.getElementById('nombreCliente');\r\n var telefonoCliente=document.getElementById('telefonoCliente').value.trim();\r\n var campoTelefonoCliente=document.getElementById('telefonoCliente');\r\n var emailCliente=document.getElementById('emailCliente').value.trim();\r\n var campoEmailCliente=document.getElementById('emailCliente');\r\n\r\n var error=\"\";\r\n var oExpReg=/^\\d{8}[a-zA-Z]$/;\r\n\r\n if(oExpReg.test(dniCiente)==false){\r\n\r\n error+=\"Error en el campo dni<br>\";\r\n campoDniCiente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoDniCiente.style.backgroundColor=\"white\";\r\n\r\n }\r\n\r\n var oExpReg=/^[A-Z][a-z]{3,40}$/;\r\n\r\n if(oExpReg.test(nombreCiente)==false){\r\n\r\n error+=\"Error en el campo nombre<br>\";\r\n campoNombreCiente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoNombreCiente.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg= /^[679]\\d{8}$/;\r\n\r\n if(oExpReg.test(telefonoCliente)==false){\r\n\r\n error+=\"Error en el campo telefono<br>\";\r\n campoTelefonoCliente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoTelefonoCliente.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg= /^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/;\r\n\r\n if(oExpReg.test(emailCliente)==false){\r\n\r\n error+=\"Error en el campo email<br>\";\r\n campoEmailCliente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoEmailCliente.style.backgroundColor=\"white\";\r\n\r\n }\r\nif(document.getElementById('ClienteMiembro').checked){\r\n var fecha=document.getElementById('fechaAltaCliente').value.trim();\r\n var campoFecha=document.getElementById('fechaAltaCliente');\r\n if (fecha == \"\"){\r\n fecha = document.clienteM.fechaAltaCliente.getAttribute(\"placeholder\");\r\n }\r\n\r\n var oExpReg=/^([0-9]{1,2})[/]{1}([0-9]{1,2})[/]{1}([0-9]{4})$/;\r\n if (oExpReg.test(fecha)==false){\r\n\r\n error+=\"Error en el campo fecha <br>\";\r\n campoFecha.style.backgroundColor=\"orange\";\r\n\r\n }else{\r\n campoFecha.style.backgroundColor=\"white\";\r\n oFechaActual = new Date(fecha.split(\"/\")[2],(fecha.split(\"/\")[1]-1),fecha.split(\"/\")[0]);\r\n if (oFechaActual.getDate() !=fecha.split(\"/\")[0]){\r\n toastr.error(\"El dia es incorrecto\",\"Error en la fecha\");\r\n campoFecha.style.backgroundColor=\"orange\";\r\n }else if ((oFechaActual.getMonth()+1) !=fecha.split(\"/\")[1]){\r\n toastr.error(\"El mes es incorrecto\",\"Error en la fecha\");\r\n campoFecha.style.backgroundColor=\"orange\";\r\n }\r\n }\r\n}\r\n\r\nif(error!=\"\"){\r\n toastr.error(error,\"Fallo en la Validacion\");\r\n validacion=false;\r\n}\r\n\r\n return validacion;\r\n\r\n}", "function validaDadosCampo(campo) {\r\n var validacao = true;\r\n for (let item of campo) {\r\n if ($(item).val() == '' || $(item).val() == null) {\r\n validacao = false;\r\n }\r\n }\r\n return validacao;\r\n}", "function ValidaDatosGrid(gridID, arreglo) {\n var objGridView = c$(gridID);\n var totalRows = objGridView.rows.length - 1;\n var totalCols = objGridView.rows[0].cells.length;\n var j = 0;\n var x = 0;\n\n var colNoValidadas = arreglo;\n\n if (totalRows == 0) {\n alert('Debe Agregar Superficie de Terreno');\n return false;\n }\n\n // alert('Rows=>' + totalRows);\n // alert('Cols=>' + totalCols);\n\n //Recorre las Filas del Grid\n for (x = 1; x <= totalRows; x++)\n //Recorre las Columnas del Grid\n for (j = 1; j <= totalCols - 1; j++) {\n\n //Recupera el Texto de el Cabecero\n var txtHead = objGridView.rows[0].cells[j].outerText;\n //alert('j :' + j + ' =>' + ($.inArray(j, colNoValidadas)));\n if ($.inArray(j, colNoValidadas) < 0)\n //Verifica si es Nuemrico el dato\n if (!isNaN(parseFloat(objGridView.rows[x].cells[j].children[0].value))) {\n //Verifica que el dato sea mayor a Cero\n if (objGridView.rows[x].cells[j].children[0].value <= 0) {\n alert('La Columna: ' + txtHead + '\\n En la Fila ' + x + '\\n Debe Ser Mayor que 0');\n return false;\n }\n } else {\n\n //Verifica si esta vacia la celda\n if (objGridView.rows[x].cells[j].children[0].value == \"\") {\n alert('La Columna: ' + txtHead + '\\n En la Fila ' + x + '\\n Falta llenar el Dato');\n return false;\n }\n }\n\n }\n\n return true;\n }", "function validarForm(form){\r\n\t// Campos relacionados a inscri??o de origem\r\n\tvar localidadeOrigem = form.localidadeOrigemID;\r\n\tvar setorComercialOrigem = form.setorComercialOrigemCD;\r\n\tvar quadraOrigem = form.quadraOrigemNM;\r\n\tvar loteOrigem = form.loteOrigem;\r\n\r\n\t// Campos relacionados a inscri??o de destino\r\n\tvar localidadeDestino = form.localidadeDestinoID;\r\n\tvar setorComercialDestino = form.setorComercialDestinoCD;\r\n\tvar quadraDestino = form.quadraDestinoNM;\r\n\tvar loteDestino = form.loteDestino;\r\n\r\n\tvar obrigatorio = true;\r\n\r\n\t//Origem\r\n\t//if (localidadeOrigem.value.length < 1){\r\n\t//\talert(\"Informe a Localidade da inscri??o de origem\");\r\n\t//\tlocalidadeOrigem.focus();\r\n\t//}else\r\n\tif (!testarCampoValorZero(localidadeOrigem, \"Localidade Inicial.\")){\r\n\t\tlocalidadeOrigem.focus();\r\n\t}else if (setorComercialOrigem.value.length > 0 && \r\n\t\t\t !testarCampoValorZero(setorComercialOrigem, \"Setor Comercial Inicial.\")){\r\n\r\n\t\tsetorComercialOrigem.focus();\r\n\t}else if (quadraOrigem.value.length > 0 && !testarCampoValorZero(quadraOrigem, \"Quadra Inicial.\")){\r\n\t\tquadraOrigem.focus();\r\n\t}else if (loteOrigem.value.length > 0){\r\n\t\tloteOrigem.focus();\r\n\t}else{\r\n\t\tobrigatorio = campoObrigatorio(setorComercialOrigem, quadraOrigem, \"Setor Comercial Inicial.\");\r\n\t\tif (!obrigatorio){\r\n\t\t\tobrigatorio = campoObrigatorio(quadraOrigem, loteOrigem, \"Quadra Inicial.\");\r\n\t\t}\r\n\t}\r\n\r\n\t//Destino\r\n\tif (!obrigatorio){\r\n\t\tif (localidadeDestino.value.length < 1 && localidadeOrigem.value.length > 0){\r\n\t\t\talert(\"Localidade Final.\");\r\n\t\t\tlocalidadeDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (!testarCampoValorZero(localidadeDestino, \"Localidade Final.\")){\r\n\t\t\tlocalidadeDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (setorComercialDestino.value.length > 0 && \r\n\t\t\t !testarCampoValorZero(setorComercialDestino, \"Setor Comercial Final.\")){\r\n\r\n\t\t\tsetorComercialDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (quadraDestino.value.length > 0 && !testarCampoValorZero(quadraDestino, \"Quadra Final.\")){\r\n\t\t\tquadraDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (loteDestino.value.length > 0){\r\n\t\t\tloteDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else{\r\n\t\t\tobrigatorio = campoObrigatorio(setorComercialDestino, quadraDestino, \"Informe Setor Comercial Final.\");\r\n\t\t\tif (!obrigatorio){\r\n\t\t\t\tobrigatorio = campoObrigatorio(quadraDestino, loteDestino, \"Informe Quadra Final.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//Origem - Destino\r\n\tif (!obrigatorio){\r\n\t\tobrigatorio = campoObrigatorio(setorComercialDestino, setorComercialOrigem, \"Informe Setor Comercial Final.\");\r\n\t\tif (!obrigatorio){\r\n\t\t\tobrigatorio = campoObrigatorio(quadraDestino, quadraOrigem, \"Informe Quadra Inicial.\");\r\n\t\t\tif (!obrigatorio){\r\n\t\t\t\tobrigatorio = campoObrigatorio(loteDestino, loteOrigem, \"Informe Lote Inicial\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//\r\n\t//valida se os campos preenchido tao com seus correspondentes preenchidos tbm(obrigatorio)\r\n\t//\r\n\tif(!validaPreenchimentoCamposFaixa()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaSetor()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaQuadra()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaLote()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaLocalidade()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\r\n\t// Confirma a valida??o do formul?rio\r\n\tif (!obrigatorio && validateImovelOutrosCriteriosActionForm(form)){\r\n\t\tform.target = 'Relatorio';\r\n\t\tform.submit();\t\r\n\t}\r\n\r\n}", "function validaCompetidor(competidor) {\n\n var erros = [];\n\n if (competidor.largada.length == 0) {\n erros.push(\"A largada não pode ser em branco\");\n }\n\n\n if (competidor.competidor.length == 0) {\n erros.push(\"O competidor não pode ser em branco\");\n }\n\n if (competidor.tempo.length == 0) {\n erros.push(\"O tempo não pode ser em branco\");\n }\n\n if (!validaLargada(competidor.largada)) {\n erros.push(\"A largada é inválida\");\n }\n\n if (!validaTempo(competidor.tempo)) {\n erros.push(\"O tempo é inválido\");\n }\n\n return erros;\n\n}", "function validateForm(){\n\t\n\tvar boo1 = validateLabPerson();\n\tvar boo2 = validateBioPerson();\n\tvar boo3 = validatePI();\n\tvar boo4 = validateBillTo();\n\tvar boo5 = validateRunType();\n\n\tvar boo6 = validateAllTables();\n//\tvar boo6 = true;\n\n\tvar boo7 = validateDate();\n\tvar boo8 = validateIAccept();\n\n\tvar boo9 = validateConcentrationUnit();\n\tvar boo10 = validateTubesAndLanes();\n\t\n//\talert(\"boo1 = \" + boo1 + \" boo2 = \" + boo2 + \" boo3 = \" + boo3 + \" boo4 = \" + boo4 +\" boo5 = \" + boo5 +\" boo6 = \" + boo6 + \" boo7 = \" + boo7 + \" boo8 = \" + boo8 + \" boo9 = \" + boo9 + \" boo10 = \" + boo10);\n\tif (boo1 && boo2 && boo3 && boo4 && boo5 && boo6 && boo7 && boo8 && boo9 && boo10){\t\n//\tif(validateLabPerson() && validateBioPerson() && validatePI() && validateBillTo() && validateRunType() && validateTable()){\n\t\t//insert fields used to generate csv\n\t\tinsertTableSize();\t\t\t\t\t// insert size of all table - used when generating csv file\n\t\tgenerateOrderNoteID();\t\t\t\t// insert orderNoteID\n\t\taddPI2TubeTag();\t\t\t\t\t// indsæt \"de tre tegn\" (fra PI) i tubetaggen.\n\t\tsetVersion();\t\t\t\t\t\t// insert the version number in the hidden field.\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}", "function camposVaciosFormularios(inf){\n\n let datos = inf || {}\n let formulario = datos[\"formulario\"].getElementsByClassName(\"campo\");\n let vacio = false;\n \n Array.from(formulario).forEach(function(campo,index){\n\n if(!datos[\"excepto\"].includes(campo.id)){\n \n if(campo.nodeName === \"SELECT\" && campo.classList.contains(\"selectpicker\")){\n\n let select = $(`#${campo.id}`).val();\n\n if(select == \"0\" || select == null || select == 0 ){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n\n vacio = true; \n }\n }else{\n if(campo.nodeName !== \"DIV\")\n if(campo.value.trim() === \"\" || campo.value === \"0\" || campo.value === null){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n \n vacio = true; \n }\n } \n }\n \n \n })\n \n return vacio;\n}", "function validarAnoBusca()\r\n{\r\n\tif ((document.check.ano.value.length==4) && (document.check.ano.value != blank))\r\n\t\tif(!isNumberString(document.check.ano.value))\r\n\t\t{\r\n\t\t\talert(\"Valor inválido para ano, digite somente números.\");\r\n\t\t\tanoValido = false;\r\n\t\t\tdocument.check.ano.focus();\r\n\t\t\tdocument.check.ano.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tanoValido = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n}", "function validacionForm() {\r\n\tvar reason = \"\";\r\n\tvar nom = document.getElementById(\"name\");\r\n\tvar mot = document.getElementById(\"cita\");\r\n\tvar tel = document.getElementById(\"numer\");\r\n\treason += validateName(nom);\r\n\treason += validateCita(mot);\r\n\treason += validatePhone(tel);\r\n\tif (reason != \"\") {\r\n\t\twindow.alert(\"Algunos de los campos necesita correción\\n\" + reason);\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function validaciones() {\r\n \tvalidacionColumna();\r\n \tvalidafila();\r\n \t// Si hay dulces que borrar\r\n \tif ($('img.delete').length !== 0) {\r\n \t\teliminadulces();\r\n \t}\r\n }", "function lawsuitInsertValidation()\n{\n var errors = [];\n\n if ($(\"#datepicker\").val() == '')\n {\n errors.push(\"Morate uneti datum parnice\");\n return errors;\n }\n if ($(\"#lawsuitProcessId\").val() == '')\n {\n errors.push(\"Morate uneti identifikator parnice\");\n return errors;\n }\n if ($(\"#lawsuitCourtroom\").val() == '' || $(\"#lawsuitCourtroom\").val().length > 5)\n {\n errors.push(\"Morate uneti broj sudnice ili broj sudnice ima vise od 5 karaktera\");\n return errors;\n }\n if ($(\".lawsuitLocation\").children(\"option:selected\").html() == \"Izaberite lokaciju\" ||\n $(\".lawsuitJudge\").children(\"option:selected\").html() == \"Izaberite sudiju\")\n {\n errors.push(\"Niste izabrali sve stavke parnice\");\n return errors;\n }\n if ($(\".lawsuitProsecutor\").children(\"option:selected\").html() == \"Izaberite tuzioca\" || $(\".lawsuitDefendant\").children(\"option:selected\").html() == \"Izaberite tuzenika\" ||\n $(\".lawsuitProcessType\").children(\"option:selected\").html() == \"Izaberite postupak\")\n {\n errors.push(\"Niste izabrali sve stavke parnice\");\n return errors;\n }\n if ($(\".lawsuitLawyers\").val().length === 0)\n {\n errors.push(\"Niste izabrali nijednog advokata\");\n return errors;\n }\n}", "function validarEdad(){\r\n\t\r\n\tvar valEdad = recopilarinfotextbox(\"txtEdad\");\r\n\t\r\n\tif (valEdad>=12){\r\n\t\t//alert(valEdad+\" edad mayor de 12\");\r\n\t\tdesactivarelementoFormulario(\"ceo\");\r\n\t\tdocument.getElementById(\"ceo\").value = \"no aplica\";\r\n\t}else{\r\n\t\t//alert(valEdad+\" edad menor de 12\");\r\n\t\tdesactivarelementoFormulario(\"cop\");\r\n\t\tdocument.getElementById(\"cop\").value = \"no aplica\";\r\n\t}\r\n\t\r\n}", "function ValidarForm(){\r\n\t/*Validando el campo nombre*/\r\n\tif(document.frmCliente.nombre.value.length==0){\r\n\t\talert(\"Debe escribir el Nombre\")\r\n\t\tdocument.frmCliente.nombre.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo apellidos*/\r\n\tif(document.frmCliente.apellidos.value.length==0){\r\n\t\talert(\"Debe escribir los Apellidos\")\r\n\t\tdocument.frmCliente.apellidos.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo cedula*/\r\n\tif(document.frmCliente.cedula.value.length==0){\r\n\t\talert(\"Debe escribir el numero de Cedula\")\r\n\t\tdocument.frmCliente.cedula.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo telefono*/\r\n\tif(document.frmCliente.telefono.value.length==0){\r\n\t\talert(\"Debe escribir el numero de Telefono\")\r\n\t\tdocument.frmCliente.telefono.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo correo*/\r\n\tif(document.frmCliente.correo.value.length==0){\r\n\t\talert(\"Debe escribir su Correo\")\r\n\t\tdocument.frmCliente.correo.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo direccion*/\r\n\tif(document.frmCliente.direccion.value.length==0){\r\n\t\talert(\"Debe escribir su Direccion\")\r\n\t\tdocument.frmCliente.direccion.focus()\r\n\t\treturn false\r\n\t}\r\n}", "validate(form) {\n\n let currentValidations = document.querySelectorAll('form .error-validation');\n\n if (currentValidations.length) {\n this.cleanValidations(currentValidations);\n }\n // metodo para limpar as validações \n\n // pegar todos os inputs\n let inputs = form.getElementsByTagName('input')\n\n // para dar o loop, deve transformar o HTML Collections em Array\n let inputsArray = [...inputs]\n\n // loop para os inputs e validações de acordo com o que for encontrado\n inputsArray.forEach(function (input) {\n\n // loop em todas as validações existentes\n // this.validations faz com que verifiquemos a qtd de validações existentes no Array this.validations=['data-min-length']\n\n for (let i = 0; this.validations.length > i; i++) {\n // pego os atributos do input e ve se é igual as minhas validações atual\n if (input.getAttribute(this.validations[i]) != null) {\n\n\n // TRASFORMACAO DO data-min-length em minlength\n //limpando as strings para virar um metodo\n let method = this.validations[i].replace('data-', '').replace('-', '');\n\n // valor do input\n let value = input.getAttribute(this.validations[i]) //saber o valor da validação, no caso dessa 3 caracter\n\n\n // chamar o metodo e passo o atributo \n this[method](input, value);\n\n }\n }\n\n }, this)//quando eu acessar o this, esta se tratando do this.validator \n\n }", "function validateTrainerperCourseForm() {\n const start = trainerCoursestartDate.value;\n const end = trainerCourseendDate.value;\n const partsStart = start.split(\"-\");\n const partsEnd = end.split(\"-\");\n const dayStart = parseInt(partsStart[2], 10);\n const monthStart = parseInt(partsStart[1], 10);\n const yearStart = parseInt(partsStart[0], 10);\n const dayEnd = parseInt(partsEnd[2], 10);\n const monthEnd = parseInt(partsEnd[1], 10);\n const yearEnd = parseInt(partsEnd[0], 10);\n const regex = /^[a-zA-Z ]{2,15}$/;\n if (trainerCourseFirstName.value === null || trainerCourseFirstName.value === '' || regex.test(trainerCourseFirstName.value) === false) {\n errTrainerCourse.innerText = 'First Name up to 15 letters / no numbers';\n trainerCourseFirstName.classList.add('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n return false;\n }\n else if (trainerCourseLastName.value === null || trainerCourseLastName.value === '' || regex.test(trainerCourseLastName.value) === false) {\n errTrainerCourse.innerText = 'Last Name up to 15 letters / no numbers';\n trainerCourseLastName.classList.add('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n return false;\n }\n else if (trainerCourseSubject.value === null || trainerCourseSubject.value === '#') {\n trainerCourseSubject.classList.add('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n errTrainerCourse.innerText = 'Choose a subject';\n return false;\n }\n else if (trainerCoursestartDate.value === '' || yearStart < 2020 || monthEnd == 0 || monthStart < 12 || dayStart < 0 || dayStart > 31) {\n trainerCoursestartDate.classList.add('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n errTrainerCourse.innerText = 'Start Date has to be set and cant be before next month';\n\n return false;\n }\n else if (trainerCourseendDate.value === '' || yearEnd < 2021 || monthEnd == 0 || monthEnd < 3 || dayEnd < 0 || dayEnd > 31) {\n trainerCourseendDate.classList.add('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n errTrainerCourse.innerText = 'End Date has to be at least three months after the start';\n return false;\n }\n else if (!trainerCoursePartType.checked && !trainerCourseFullType.checked) {\n trainerCourseendDate.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n errTrainerCourse.innerText = 'Choose Course Type';\n return false;\n }\n else {\n errTrainerCourse.innerText = '';\n return true;\n }\n}", "function validateForm() {\n\t\n\tvar coApplWorkPhone = document.forms[\"myForm\"][\"coApplWorkPhone\"].value;\n\tif (!coApplWorkPhone) {\n\t\tdocument.getElementById('input_4101').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\t\tdocument.getElementById('phonedatata5').focus();\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4101\").innerHTML = \"\";\n\t}\n\t\t\t\t\n\tvar coApplBirthday = document.forms[\"myForm\"][\"coApplBirthday\"].value;\n\tif (!coApplBirthday) {\n\t\tdocument.getElementById('input_4103').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\t\tdocument.getElementById('datepicker').focus();\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4103\").innerHTML = \"\";\n\t}\n\t\n\tvar coApplInsurNum = document.forms[\"myForm\"][\"coApplInsurNum\"].value;\n\tif (!coApplInsurNum) {\n\t\tdocument.getElementById('input_4104').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\t\t//document.getElementById('phonedatata8').focus();\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4104\").innerHTML = \"\";\n\t}\n\t//alert(isNum(coApplInsurNum,\"input_4104\"));\n\tif(!(isNum(coApplInsurNum,\"input_4104\"))){\n\t\tconsole.log(\"coming \");\n\t\t//alert(\"coming\")\n\t\treturn false;\n\t}\n\tvar coAppDependants = document.forms[\"myForm\"][\"coAppDependants\"].value;\n\tif (!coAppDependants) {\n\t\tdocument.getElementById('input_4106').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\t\t//document.getElementById('phonedatata8').focus();\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4106\").innerHTML = \"\";\n\t}\n\t\n\t\n\tvar movedCanadas = document.forms[\"myForm\"][\"movedCanadas\"].value;\n\tif (!movedCanadas) {\n\t\tdocument.getElementById('input_4009').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\t\t//document.getElementById('phonedatata8').focus();\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4009\").innerHTML = \"\";\n\t}\n\t\t\n\t/* var coApplicantss = document.forms[\"myForm\"][\"coApplicantss\"].value;\n\tif (!coApplicantss) {\n\t\tdocument.getElementById('input_4107').innerHTML = \"<span style='color:red'>*This field is Required.</span>\";\n\n\t\treturn false;\n\t} else {\n\t\tdocument.getElementById(\"input_4107\").innerHTML = \"\";\n\t} */\n\t\n\treturn true;\n}", "function validateDescripcionActualizada()\n{\n //verificar si el campo esta vacio\n if(checkIfEmpty(descripcionA)) return;\n if(!validateAlphanumeric(descripcionA)) return;\n return true;\n}", "function validarFormulario(){\t\n\tvar valido = true ;\n\tvar valRecargaTemp = valorRecarga.value.replace(\",\",\"\");\n\tif( valRecargaTemp == 0 || valRecargaTemp == \"\" || multiploDeMil(valRecargaTemp)){\n\t\tvalido = false;\n\t\tvalorRecarga.blur();\n\t\tvalorRecarga.classList.add(\"is-invalid-input\");\n\t\tdocument.getElementById(\"icondollar\").classList.add(\"is-invalid-label\");\n\t\tdocument.getElementById(\"error-valor\").style.display = 'block';\n\t\t\n\t}\n\tconsole.log(numeroCelular.value < 10);\n\tif(numeroCelular.value.length < 10){\n\t\tvalido = false;\n\t\tnumeroCelular.blur();\n\t\tnumeroCelular.classList.add(\"is-invalid-input\");\n\t\tdocument.getElementById(\"iconmobile\").classList.add(\"is-invalid-label\");\n\t\tdocument.getElementById(\"error-numero\").style.display = 'block';\n\n\t}\n\t\n\treturn valido;\n}", "function validateActivity(){\n var text_es = document.getElementById('text_es').value;\n var text_eu = document.getElementById('text_eu').value;\n var text_en = document.getElementById('text_en').value;\n var title_es = document.getElementById('title_es').value;\n var title_eu = document.getElementById('title_eu').value;\n var title_en = document.getElementById('title_en').value;\n result = true;\n \n //Spanish fields empty\n if (title_es.length < 1){\n result = false;\n alert(\"Introduce un titulo en castellano\");\n return false;\n }\n if (text_es.length < 1){\n result = false;\n alert(\"Introduce un texto en castellano\");\n return false;\n }\n //Titles without texts\n if (title_eu.length > 0 && text_eu.length < 1){\n result = false;\n alert(\"Introduce un texto o borra el titulo en euskera\")\n return false;\n }\n if (title_en.length > 0 && text_en.length < 1){\n result = false;\n alert(\"Introduce un texto o borra el titulo en ingles\")\n return false;\n }\n //Text without titles\n if (text_eu.length > 0 && title_eu.length < 1){\n result = false;\n alert(\"Introduce un titulo o borra el texto en euskera\")\n return false;\n }\n if (text_en.length > 0 && title_en.length < 1){\n result = false;\n alert(\"Introduce un titulo o borra el texto en ingles\")\n return false;\n }\n // TODO: check date\n // TODO: check numeric fields price, people\n return true;\n}", "function validarFormAddPositions() {\n let nomen = document.forms[\"formAddPositions\"][\"nomen\"].value;\n let multiPositionInitial = document.forms[\"formAddPositions\"][\"multiPositionInitial\"].value;\n let multiPositionFinal = document.forms[\"formAddPositions\"][\"multiPositionFinal\"].value;\n\n // Los campos no pueden estar vacios.\n if (nomen == \"\" || multiPositionInitial == \"\" || multiPositionFinal == \"\") {\n alert(\"Los campos no pueden estar vacios.\");\n return false;\n } else {\n // Los campos deben ser menores a 6 caracteres. \n if(multiPositionInitial.length >= 6 || multiPositionFinal.length >= 6) {\n alert(\"Los campos deben ser menos de 6 caracteres.\");\n return false;\n } else if(multiPositionInitial === multiPositionFinal) {\n alert(\"La posición inicial no puede ser igual a la posición final\");\n return false;\n } else if(multiPositionInitial > multiPositionFinal) {\n alert(\"La posición inicial no puede ser mayor que la posición final\");\n return false;\n } else {\n // Validar si el nombre ingresado ya existe en la base.\n let cont = 0;\n for(let i = multiPositionInitial; i < multiPositionFinal; i++) {\n\n let namePlano = nomen+i;\n let namePlanoMinus = namePlano.toLowerCase();\n \n if(positions.length !== 0) {\n for (let pos = 0; pos < positions.length; pos++) {\n console.log(\"Convert name: \"+namePlanoMinus);\n console.log(positions[pos]);\n \n let converNamePosition = positions[pos].toLowerCase();\n \n if(namePlanoMinus === converNamePosition) {\n alert(\"Ya existe una posición con el nombre \"+namePlano);\n return false;\n }\n cont++;\n }\n }\n }\n }\n }\n}", "function validateFieldsIE(){\n console.log(\"Elements!!!!!!!\");\n\n var nameElement = document.getElementById('txtNameElement');\n var description = document.getElementById('txtDescription');\n var park = document.getElementById('txtPark');\n \n var emptyName = false, emptyDescription = false, emptyPark = false;\n \n if(nameElement.value.length < 2){//el parque está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n \n \n if(emptyName === true || emptyDescription === true || emptyPark === true){\n return false;\n console.log(\"false\");\n }else{\n return true;\n }\n}", "function validarLocalidade(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\tif( form.localidadeOrigemID.value == form.localidadeDestinoID.value ){\r\n\t\tform.setorComercialOrigemID.disabled = false;\r\n\t\tform.setorComercialDestinoID.disabled = false;\r\n\t}\r\n\telse if( form.localidadeOrigemID.value != form.localidadeDestinoID.value ){\r\n\t\tform.setorComercialOrigemID.disabled = true;\r\n\t\tform.setorComercialDestinoID.disabled = true;\r\n\t\tform.setorComercialOrigemID.value = '';\r\n\t\tform.setorComercialDestinoID.value = '';\r\n\t\tform.quadraOrigemID.value = '';\r\n\t\tform.quadraDestinoID.value = '';\r\n\t}\r\n\telse if( form.setorComercialOrigemID.value != form.setorComercialDestinoID.value ){\r\n\t\t\tform.quadraOrigemID.disabled = false;\r\n\t\t\tform.quadraDestinoID.disabled = false;\r\n\t\t}\r\n\r\n}", "function cleanFormulaire() {\n input_matricule.value = '';\n input_prenom.value = '';\n input_nom.value = '';\n select_sexe.value = '';\n input_datenaissance.value = '';\n input_lieunaissance.value = '';\n input_email.value = '';\n input_telephone.value = '';\n input_adresse.value = '';\n\n select_filiere.value = '';\n select_classe.value = '';\n input_montantinscription.value = '';\n input_mensualite.value = '';\n input_total.value = '';\n input_dateinscription.value = '';\n input_anneeacademique.value = '';\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 validar_add_despliegue_nombre(){\r\n\r\n\tif(document.getElementById('txt_despliegue').value==''){\r\n\t\tmostrarDiv('error_despliegue');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_programada').value=='' || document.getElementById('txt_fecha_programada').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_programada');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_produccion').value=='' || document.getElementById('txt_fecha_produccion').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_produccion');\r\n\t\treturn false;\r\n\t}\r\n\tdocument.getElementById('frm_add_despliegue').action='?mod=despliegues&niv=1&task=saveAdd';\r\n\tdocument.getElementById('frm_add_despliegue').submit();\r\n}", "function validarCampos() {\n var campo1 = false;\n var campo2 = false;\n\n if (!document.getElementById('usuario').validity.valid) {\n document.getElementById('divUsuario').className = 'form-group has-error has-feedback';\n $('[data-toggle=\"divUsuario\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divUsuario').className = 'form-group has-error has-feedback'; \n } else {\n document.getElementById('divUsuario').className = 'form-group';\n campo1 = true;\n }\n\n if (!document.getElementById('password').validity.valid) {\n document.getElementById('divPassword').className = 'form-group has-error';\n $('[data-toggle=\"divPassword\"]').tooltip('show'); \n temporizadorTooltip();\n document.getElementById('divPassword').className = 'form-group has-error has-feedback';\n } else {\n document.getElementById('divPassword').className = 'form-group';\n campo2 = true;\n }\n\n if (campo1 && campo2) {\n return true;\n }\n}", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "function validateNuevoArticulo() {\n /*elements for focus*/\n var inTitulo = document.getElementById(\"article-title\");\n var txtContenido = document.getElementById(\"article-content\");\n var txtFuente = document.getElementById(\"article-source\");\n\n /*elements for test*/\n var tituloValue = inTitulo.value.trim();\n var contenidoValue = txtContenido.value.trim();\n var fuenteValue = txtFuente.value.trim();\n\n /*elements for errors*/\n var errorTitulo = document.getElementById(\"title-error\");\n var errorContenido = document.getElementById(\"content-error\");\n var errorFuente = document.getElementById(\"source-error\");\n var generalError = document.getElementsByClassName(\"general-errors\")[0];\n\n errorTitulo.innerHTML = '';\n errorContenido.innerHTML = '';\n errorFuente.innerHTML = '';\n generalError.innerHTML = '';\n\n var cont = 0, errors = [];\n errors[0] = '<span>El campo no debe quedar vacío.</span>';\n errors[1] = '<span>Ingresar un valor más específico.</span>';\n errors[2] = '<span>El contenido debe tener más texto.</span>';\n\n /*validate titulo*/\n if (tituloValue === '') {\n cont++;\n errorTitulo.innerHTML = errors[0];\n if (cont == 1) inTitulo.focus();\n } else if (tituloValue.length < 15) {\n cont++;\n errorTitulo.innerHTML = errors[1];\n if (cont == 1) inTitulo.focus();\n }\n\n /*validate contenido*/\n if (contenidoValue === '') {\n cont++;\n errorContenido.innerHTML = errors[0];\n if (cont == 1) txtContenido.focus();\n } else if (contenidoValue.length < 700) {\n cont++;\n errorContenido.innerHTML = errors[2];\n if (cont == 1) txtContenido.focus();\n }\n\n /*validate titulo*/\n if (fuenteValue === '') {\n cont++;\n errorFuente.innerHTML = errors[0];\n if (cont == 1) txtFuente.focus();\n } else if (fuenteValue.length < 15) {\n cont++;\n errorFuente.innerHTML = errors[1];\n if (cont == 1) txtFuente.focus();\n }\n\n /*results*/\n if (cont > 0) {\n generalError.innerHTML = '<span>Hay '+cont+' campo(s) por completar.</span>';\n return false;\n }\n}", "function check_text_tipo_sangre(field,longitud,sizefijo,conv, dig,let,esp,req){\r\n\r\nvar mensaje=\"\";\r\nvar DateField = field;\r\n\r\nif(field.value==\"\"&&req=='s')\r\n{\r\n\t mensaje=\"Error: Campo requerido\";\r\n\t return mensaje;\r\n}\t\r\n\r\nvar err = 0;\r\nvar i;\r\nerr = 0;\r\n\r\nvar digitos ='0123456789';\t\t\t\t\t\t\t\t// Digitos\r\nvar letrasMin ='abcdefghijklmnopqrstuvwxyz';\t\t\t// αινσϊ Letras minusculas\r\nvar letrasMay ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';\t\t\t// ΑΙΝΣΪ Letras mayusculas\r\nvar espacios = '.,:\\\\ \\t\\n\\r+-';\t\t\t\t\t\t\t\t// whitespace characters\r\n\r\nvar caractpermitidos='';\r\nvar permite=' ';\r\n\r\nDateValue = DateField.value;\r\n\r\n\r\nif (dig=='s') {\r\n\tcaractpermitidos=caractpermitidos+digitos;\r\n\tpermite = \"numeros \";\r\n}\r\nif (let=='s') {\r\n\tcaractpermitidos=caractpermitidos+letrasMin+letrasMay;\r\n\tpermite = permite + \" letras\";\r\n}\r\nif (esp=='s') {\r\n\tcaractpermitidos=caractpermitidos+espacios;\r\n\tpermite = permite + \" espacios\";\r\n}\r\n\r\nif(!valContenido(DateValue,caractpermitidos)){\r\n\t\tmensaje=('Error: Debe Ingresar solo: '+ permite);\r\n\t\terr = 10\r\n}\r\n\r\n\t\t\r\nif ((DateValue.length > longitud) && (err ==0)) {\r\n\t\terr=20\r\n\t\tmensaje=(\"Error: Solo se puede ingresar \"+ longitud+ \" caracteres\" );\r\n\t}\r\n\r\nif ((DateValue.length < longitud) && (err ==0) && (sizefijo == 's')) {\r\n\t\terr=15\r\n\t\tmensaje=(\"Error: El campo ingresado debe contener \"+ longitud+ \" caracteres\" );\r\n}\r\n\r\nif (conv=='s'){\r\n\tDateField.value = DateField.value.toUpperCase();\r\n}\r\n\t\t\r\nif (err > 0) {\r\n\t;\t\r\n\t\t//DateField.select();\r\n\t\t//DateField.focus();\t\t\r\n}\r\nreturn mensaje;\r\n}", "function validarCedula(elemento)\n{ \n if(elemento.value.length > 0 && elemento.value.length < 11){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 48 && codigA <= 57)){\n }else {\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n }else{\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n if (elemento.value.length == 10) {\n if((elemento.value.substring(0,2)>=1)||(elemento.value.substring(0,2)<=24)){\n //Suma impares\n var pares = 0;\n var numero =0;\n for (var i = 0; i< 4; i++) {\n numero = elemento.value.substring(((i*2)+1),(i*2)+2);\n numero = (numero * 1);\n if( numero > 9 ){ var numero = (numero - 9); }\n pares = pares + numero; \n }\n var imp=0;\n numero = 0\n for (var i = 0; i< 5; i++) {\n var numero = elemento.value.substring((i*2),((i*2)+1));\n var numero = (numero * 2);\n if( numero > 9 ){ var numero = (numero - 9); }\n imp = imp + numero; \n }\n var sum = pares + imp;\n aux = (''+sum)[0];\n var di = aux.substring(0,1);\n di++;\n di = di *10;\n numero = (di - sum);\n if (numero == (elemento.value.substring(9,10))) {\n document.getElementById('mensaje1').innerHTML='' ; \n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n }\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n}" ]
[ "0.7299923", "0.71525186", "0.70642394", "0.7037944", "0.7037944", "0.6984522", "0.6983445", "0.6907712", "0.68994087", "0.6879504", "0.6818327", "0.6788984", "0.67866", "0.6776433", "0.6769318", "0.6767671", "0.6756519", "0.6733219", "0.67088115", "0.665767", "0.661388", "0.66094106", "0.6604593", "0.6604593", "0.65993667", "0.6583527", "0.65688616", "0.6553406", "0.6550177", "0.6527383", "0.6521053", "0.65163815", "0.65098345", "0.64947546", "0.6494389", "0.64904916", "0.6485495", "0.64807004", "0.6474181", "0.64724123", "0.64713156", "0.6468823", "0.6468131", "0.6464219", "0.64615333", "0.6454643", "0.6452143", "0.64517087", "0.64399827", "0.641898", "0.64161825", "0.64123315", "0.64072084", "0.6405705", "0.6402441", "0.6402279", "0.63963866", "0.63904333", "0.63903016", "0.6379927", "0.6377279", "0.6371673", "0.63250124", "0.6324855", "0.63114464", "0.63107216", "0.630875", "0.6304476", "0.6295501", "0.62930644", "0.62915105", "0.62802744", "0.62800586", "0.62782735", "0.6264241", "0.6260976", "0.62584174", "0.6256696", "0.62510824", "0.6245495", "0.6242789", "0.62371737", "0.6234999", "0.62284654", "0.6226075", "0.6225607", "0.62170154", "0.62155384", "0.6215352", "0.6210918", "0.6207096", "0.62066597", "0.6205506", "0.62033665", "0.6192152", "0.6190517", "0.6179843", "0.6174825", "0.6173158", "0.6170467" ]
0.6931287
7
Funcao usada para mostrar / sumir o div contendo Informacoes Adicionais
function mostrarXsumir(valor){ document.formPaciente.indicacaoOutra.value = ""; var abreDiv = document.getElementById('infoIndicacaoOutra'); if (valor == 'selected') { abreDiv.style.display = 'block'; } else { abreDiv.style.display = 'none'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MostrarContadores() {\n\tvar div = document.getElementById(\"mostrarcontador\");\n\tdiv.innerHTML = \"\";\n\n\tvar TitleTotalArticles = document.createElement(\"h4\");\n\tvar TitlePriceWithoutIVA = document.createElement(\"h4\");\n\tvar TitleTotalPrice = document.createElement(\"h4\");\n\n\tvar cont1 = 0;\n\tvar cont2 = 0;\n\tvar TotalArticulos = 0;\n\tvar Totalprecio = 0;\n\tvar PrecioSinIva = 0;\n\n\t//Con esto mostramos el total de articulos en nuestro carrito.\n\tfor (x of carritocompra.cantidades) {\n\t\tx = parseInt(x);\n\t\tTotalArticulos += x;\n\t}\n\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\tTotalprecio += (element.precio * carritocompra.cantidades[cont2]);\n\t\tcont2++;\n\t});\n\n\t// Esta parte del codigo es para sacar los precios sin iva\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\telement.iva = parseInt(element.iva);\n\t\tPrecioSinIva += (element.precio * carritocompra.cantidades[cont1]) - (((element.precio * element.iva) / 100) * carritocompra.cantidades[cont1]);\n\t\tcont1++;\n\t});\n\n\tTitleTotalArticles.appendChild(document.createTextNode(\"Artículos en tu carrito: \" + TotalArticulos));\n\tTitlePriceWithoutIVA.appendChild(document.createTextNode(\"Precio sin IVA: \" + PrecioSinIva + \"€\"));\n\tTitleTotalPrice.appendChild(document.createTextNode(\"Precio total a pagar: \" + Totalprecio + \"€\"));\n\n\tdiv.appendChild(TitleTotalArticles);\n\tdiv.appendChild(TitlePriceWithoutIVA);\n\tdiv.appendChild(TitleTotalPrice);\n}", "function getInfoOperador(operador){\n\n\t\t$(\"#ShowTableDateCobros\").css('display', 'none');\n\t\t$(\"#ShowTableDateCobros\").empty();\n\t\t$(\"#showButtonQuery\").css('display', 'none');\n\t\t$(\"#showButtonQuery\").empty();\n\t\t$(\"#showQueryFor\").empty();\n\n\t\tlet cargando = document.getElementById(\"ShowTableDateCobros\");\n\t\tcargando.style.display = \"block\";\n\t\tcargando.style.textAlign = \"center\";\n\t\tcargando.style.color = \"green\";\n\t\tcargando.textContent = \"Cargando...\";\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl:baseURL + \"web/Operador_ctrl/getInfor_operador\",\n\t\t\tdata: {operador: operador},\n\t\t\tsuccess: function(respuesta) {\n\t\t\t var obj = JSON.parse(respuesta);\n\n\t\t\t\tif (obj.resultado === true) {\n\t\t\t\t\tcargando.style.display = \"none\";\n\t\t\t\t\tcargando.style.color = \"black\";\n\t\t\t\t\tlet HTML = \"\";\n\t\t\t\t\tHTML += \"<br>\";\n\t\t\t\t\tHTML += \"<p style='text-align: center; display: inline-block; '><strong>\" + \"Reporte de cobros realizados hoy \" + obj.operador.fecha +\"</strong></p> \";\n\n\t\t\t\t\tif (obj.operador.hayPasajeros === true) {\n\t\t\t\t\t\t// HTML += \"<button style='background: blue' >CORTE DEL DIA</button> \";\n\t\t\t\t\t\tHTML += \"<table style='width:92%;>\";\n\t\t\t\t\t\t\tHTML += \"<thead>\";\n\t\t\t\t\t\t\t\tHTML += \"<tr style='background: grey; color: white' >\";\n\t\t\t\t\t\t\t\t\tHTML += \"<th width='33%' style='background: grey; color: white; text-align: center'>Tarifa</th>\";\n\t\t\t\t\t\t\t\t\tHTML += \"<th width='34%' style='background: grey; color: white; text-align: center'>Total de Pasajeros</th>\";\n\t\t\t\t\t\t\t\t\tHTML += \"<th width='33%' style='background: grey; color: white; text-align:right'>Total de Ganancias</th>\";\n\t\t\t\t\t\t\t\tHTML += \"</tr>\";\n\t\t\t\t\t\t\tHTML += \"</thead>\";\n\t\t\t\t\t\t\tHTML += \"<tbody>\";\n\t\t\t\t\t\t\t\tHTML += \"<tr>\";\n\t\t\t\t\t\t\t\t\tHTML += \"<td style='text-align:center' >\" + \"$ \" + obj.operador.tarifa + \" </td>\";\n\t\t\t\t\t\t\t\t\tHTML += \"<td style='text-align:center' >\" + obj.operador.pasajeros+ \" Estudiantes \" + \" </td>\";\n\t\t\t\t\t\t\t\t\tHTML += \"<td style='text-align:right' >\" + \"$ \" + obj.operador.ganancias + \" Pesos \" +\"</td>\";\n\t\t\t\t\t\t\t\tHTML += \"</tr>\";\n\t\t\t\t\t\t\tHTML += \"</tbody>\";\n\t\t\t\t\t\tHTML += \"</table>\";\n\t\t\t\t\t\tHTML += \"</br>\";\n\t\t\t\t\t\tHTML += \"<button style='margin: 1px 1px' class='btn btn-primary' data-backdrop='static' data-keyboard='false' data-toggle='modal' data-target='.modal_corte_dia_pdf' onclick='print_corte_operador_day(\"+operador+\")'> <span class='icon-print'> </span></button>\";\n\t\t\t\t\t\tif (obj.operador.correo) {\n\t\t\t\t\t\t\tHTML += \"<button style='margin: 1px 1px' type='button' class='ladda-button btn btn-success' data-style='expand-left' id='btn_dia' onclick='sendEmail_corte_operadorDay(\"+operador+\")'> <span class='icon-envelope-alt'> </span></button>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(\"#ShowTableDateCobros\").html(HTML).css('display', 'block');\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tHTML += \"<h1 style='color: red; text-align:center;'><strong> \" + obj.operador.pasajeros + \"</strong> </h1>\";\n\t\t\t\t\t\t$(\"#ShowTableDateCobros\").html(HTML).css('display', 'block');\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet htmlSelect = \"\";\n\t\t\t\t\thtmlSelect += \"<p>Consulta Personalizada</p>\";\n\t\t\t\t\thtmlSelect += \"<select name='opcionPersonalizada' class='form-control' id='opcionPersonalizadaSelect' onchange='personalizada(this.value)' > \";\n\t\t\t\t\t\thtmlSelect += \"<option class='' style='width: 10%'' value='' selected disabled hidden>Selecciona Tipo</option>\";\n\t\t\t\t\t\thtmlSelect += \"<option value='dia'> Día </option>\";\n\t\t\t\t\t\thtmlSelect += \"<option value='rango'> Rango </option>\";\n\t\t\t\t\t\thtmlSelect += \"<option value='mes'> Mes </option>\";\n\t\t\t\t\t\thtmlSelect += \"<option value='year'> Año </option>\";\n\t\t\t\t\thtmlSelect += \"</select> \";\n\t\t\t\t\t$(\"#showConstumQuery\").html(htmlSelect).css('display', 'block');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t}", "function verDetalles() {\r\n\r\n indiceNoticia = document.getElementById(\"indice\").value;\r\n alert(indiceNoticia);\r\n\r\n document.getElementById('detalle').innerHTML =\r\n `\r\n <div class=\" col-md-12 col-xs-12 col-sm-12 bg-white \">\r\n\r\n <div class=\"container bg-dark\">\r\n <div class=\"row\">\r\n <div class=\"contenedor \">\r\n <img src=\"${Noticias[indiceNoticia].Caratula}\" class=\"w-100 principal \">\r\n <div class=\"texto-encima \"><span class=\"badge badge-danger p-1\">&nbsp;Ultima Hora</span></div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <h6 class=\"col-12\">${Noticias[indiceNoticia].Titulo}</h6>\r\n <p style=\"color: darkgray;\" class=\"col-12 \">${Noticias[indiceNoticia].detalleNoticia}</p>\r\n <p style=\"color: darkgray;\" class=\"col-12 \">${Noticias[indiceNoticia].likes} / ${Noticias[indiceNoticia].fechaPublicacion}<br>\r\n <p style=\"color: darkgray;\" class=\"col-12 \">${Noticias[indiceNoticia].redactor}<br>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n </div> `;\r\n\r\n $(\"#detalle\").show();\r\n\r\n\r\n\r\n\r\n}", "function dadosRecebidos(result) {\n $(\".container1\").html(`<h3>Casos Confirmados</h3> <div><h1>\n ${result.confirmed.value}</h1></div>`)\n\n\n $(\".container2\").html(`<h3>Casos Recuperados</h3> <div><h1>\n ${result.recovered.value}</h1></div>`)\n\n\n $(\".container3\").html(`<h3>Óbitos Confirmados</h3> <div><h1>\n ${result.deaths.value}</h1></div>`)\n}", "function mostrarResultado() {\r\n resultado=\"\";\r\n \r\n if (totalEncuestas == 1) {\r\n resultado+=\"<h3>Has realizado \"+totalEncuestas+\" vez esta encuesta.</h3>\";\r\n }else{\r\n if (totalEncuestas >= 2) {\r\n resultado+=\"<h3>Has realizado \"+totalEncuestas+\" veces esta encuesta.</h3>\";\r\n }\r\n if(totalEncuestas > 3){\r\n resultado+=\"<h3>Ha superado la cantidad máxima de 3 intentos.</h3>\";\r\n\r\n }\r\n }\r\n\r\n for(var i=1;i<=totalPreguntas;i++) { \r\n resultado+=\"<div>Puntaje en pregunta \"+i+\" : \"+resultadoEncuesta[\"p\"+i+\"-alt\"][0]+\"</div>\";\r\n \r\n }\r\n resultado+=\"<div>Puntaje total obtenido: \"+resultadoEncuesta+[i][0]+ \"</div>\";\r\n document.getElementById(\"resultado\").innerHTML=resultado;\r\n}", "function escrever_resultado()\r\n{\r\n var texto= '<hr>';\r\n\r\n /*\r\n texto += '<b>Suave:</b> máximo[ mínimo { μ CocaForte (x) ; μ RunFraco (x) ; μ Gelo (x) } ; mínimo { μ CocaSuave (x) ; μ RunSuave (x) ; μ Gelo (x) } ;mínimo { μ CocaFraco (x) ; μ RunForte (x) ; μ Gelo (x) }]' ;\r\n texto+='<br><b>Forte:</b> máximo[ mínimo { μ CocaForte (x) ; μ RunSuave (x) ; μ Gelo (x) } ; mínimo { μ CocaForte (x) ; μ RunForte (x) ; μ Gelo (x) } ;mínimo { μ CocaSuave (x) ; μ RunForte (x) ; μ Gelo (x)]' ;\r\n texto+='<br><b>Fraco:</b> máximo[ mínimo { μ CocaFraco (x) ; μ RunFraco (x) ; μ Gelo (x) } ; mínimo { μ CocaFraco (x) ; μ RunSuave (x) ; μ Gelo (x) } ;mínimo { μ CocaSuave (x) ; μ RunForte (x) ; μ Gelo (x) }]';\r\n */\r\n \r\n \r\n texto += '<hr>';\r\n texto+= '<h3><u>Resultado</u></h3>'+ calc_resultado();\r\n document.getElementById('resultado').innerHTML= texto; \r\n}", "show(data){\n this.isCalculated = true;\n var stringData = data.toString();\n\n if(stringData.length > 8){\n stringData = stringData.slice(0, 8)\n }\n\n if(this.isCalculated && this.onlyOne){\n this.onlyOne = false;\n this.paraSecuencia = this.agregados;\n }\n\n this.agregados = \"\";\n this.toAdd = stringData;\n this.resultado = stringData;\n this.display.innerHTML = stringData;\n\n }", "function restaurarReloj() {\n $horasDom.text('00');\n $minutosDom.text('00');\n $segundosDom.text('00');\n }", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function mostrarCalculo(params) {\n var elementos = [];\n elementos[\"Nº de enlaces: \"] = contar(\"a\");\n elementos[\"Nº de imagenes: \"] = contar(\"img\");\n elementos[\"Nº de inputs: \"] = contar(\"input\");\n elementos[\"Nº de botones: \"] = contar(\"button\");\n elementos[\"Nº de checkbox: \"] = contar(\"input[type = checkbox]\");\n elementos[\"Nº de select: \"] = contar(\"select\");\n elementos[\"Nº de label:\"] = contar(\"label\");\n elementos[\"Nº de span: \"] = contar(\"span\");\n for (var e in elementos)\n document.getElementById('elementos').innerHTML += e + elementos[e] + \"</br>\";\n\n}", "function ocultaDivCausasAsistencia()\n\t{\n\t\t$(\"#desnoestudioa\").hide();\n\t\t$(\"#masnoestudioa\").val('+');\n\t\t$(\"#desnoestudiob\").hide();\n\t\t$(\"#masnoestudiob\").val('+');\n\t\t$(\"#desnoestudioc\").hide();\n\t\t$(\"#masnoestudioc\").val('+');\n\t\t$(\"#desnoestudiod\").hide();\n\t\t$(\"#masnoestudiod\").val('+');\n\t\t$(\"#desnoestudioe\").hide();\n\t\t$(\"#masnoestudioe\").val('+');\n\t\t$(\"#desnoestudiof\").hide();\n\t\t$(\"#masnoestudiof\").val('+');\n\t\t$(\"#desnoestudiog\").hide();\n\t\t$(\"#masnoestudiog\").val('+');\n\t}", "function muda_data_atual_aux(ddaattaa){\n document.getElementById(\"data_Atual\").textContent = ddaattaa;\n $(\"#progresso_cal\").addClass('indeterminate');\n $.getJSON(\"/\" + ddaattaa.split('/').reverse().join('-') + '/', function(dadoss){\n var n = dadoss.length;\n dados_act = document.getElementById(\"dados_atividades\");\n dados_act.innerHTML = \"\";\n if(n){\n for(var i=0, k=i; i<n; i++){\n var dados = dadoss[i];\n if(dados.success == undefined){\n dados_act.innerHTML += \"<a href='#!' onclick='display_info(\" + k + \",\" + n +\")' class='link_act'><p class='white-text'>\" + dados.tipo + \"<i class='material-icons right'>add</i>\" +\"</p></a>\";\n dados_act.innerHTML += \"<div class='separador-fino'></div>\";\n dados_act.innerHTML += \"<div id='dados_atividades_conteudo_\" + k + \"' class='dados_atividades_conteudo' style='display: none !important;'></div>\" ;\n if(i < n-1){\n dados_act.innerHTML += \"<br>\";\n }\n var tipo = dados.tipo;\n var dados_act_info = document.getElementById(\"dados_atividades_conteudo_\" + k);\n dados_act_info.innerHTML = \"<h6 class='white-text center'><b>\" + dados.titulo + \"</b></h6>\";\n if(tipo == 'Workshop'){\n if(dados.orador != 'vazio'){\n dados_act_info.innerHTML += \"<p class='white-text'><b>Orador:</b> \" + dados.orador + \"</p>\";\n }else{\n dados_act_info.innerHTML += \"<p class='white-text'>Orador por confirmar</p>\";\n }\n }\n if(dados.local != 'vazio') dados_act_info.innerHTML += \"<p class='white-text'><b>Local:</b> \" + dados.local + \"</p>\";\n if(dados.hora != '00:00') dados_act_info.innerHTML += \"<p class='white-text'><b>Hora:</b> \" + dados.hora + \"</p>\";\n dados_act_info.innerHTML += \"<p class='white-text'>Sabe mais <b><a href='\" + dados.link_atividade + \"' target='_blank'> aqui</a></b></p>\";\n\n //console.log(dados[i]);\n k++;\n \n }else{\n dados_act.innerHTML = \"\";\n if( Math.max(document.documentElement.clientWidth, window.innerWidth || 0) > 600){\n document.getElementById(\"actividade_inner\").className = 'col s12';\n document.getElementById(\"actividade_bg\").style.background = \"\";\n document.getElementById(\"actividade_bg\").style.backgroundSize = \"cover\";\n }\n }\n }\n }else{\n if(dadoss.success == undefined){\n dados_act.innerHTML += \"<a href='#!' onclick='display_info(0,0)' class='link_act'><p class='white-text'>\" + dadoss.tipo + \"<i class='material-icons right'>add</i>\" +\"</p></a>\";\n dados_act.innerHTML += \"<div class='separador-fino'></div>\";\n dados_act.innerHTML += \"<div id='dados_atividades_conteudo_0' class='dados_atividades_conteudo' style='display: none !important;'></div>\" ;\n var tipo = dadoss.tipo;\n var dados_act_info = document.getElementById(\"dados_atividades_conteudo_0\");\n dados_act_info.innerHTML = \"<h6 class='white-text center'><b>\" + dadoss.titulo + \"</b></h6>\";\n if(tipo == 'Workshop'){\n if(dadoss.orador != 'vazio'){\n dados_act_info.innerHTML += \"<p class='white-text'><b>Orador:</b> \" + dadoss.orador + \"</p>\";\n }else{\n dados_act_info.innerHTML += \"<p class='white-text'>Orador por confirmar</p>\";\n }\n }\n if(dadoss.local != 'vazio') dados_act_info.innerHTML += \"<p class='white-text'><b>Local:</b> \" + dadoss.local + \"</p>\";\n if(dadoss.hora != '00:00') dados_act_info.innerHTML += \"<p class='white-text'><b>Hora:</b> \" + dadoss.hora + \"</p>\";\n dados_act_info.innerHTML += \"<p class='white-text'>Sabe mais <b><a href='\" + dadoss.link_atividade + \"' target='_blank'> aqui</a></b></p>\";\n\n //console.log(dados[i]);\n i++;\n }else{\n dados_act.innerHTML = \"\";\n if( Math.max(document.documentElement.clientWidth, window.innerWidth || 0) > 600){\n document.getElementById(\"actividade_inner\").className = 'col s12';\n document.getElementById(\"actividade_bg\").style.background = \"\";\n document.getElementById(\"actividade_bg\").style.backgroundSize = \"cover\";\n }\n }\n }\n }).done(function(){\n $(\"#progresso_cal\").removeClass('indeterminate');\n });\n}", "imprimirTotal(){\n const divTotal = document.createElement('div')\n divTotal.classList.add('totalPlatoPedido')\n\n let totalPedido = 0\n pedido.forEach(precioDet => {\n totalPedido = totalPedido + parseInt(precioDet.precio)\n })\n\n // ---- Scripting del total del pedido --\n const totDetPedido = document.createElement('li')\n totDetPedido.classList.add('totDetLi')\n\n totDetPedido.textContent = totalPedido\n\n // ---- Agregar los párrafos al divDetalle ---\n divTotal.appendChild(totDetPedido)\n\n // ---- Agregar el total al HTML --------\n totalPedidoMostrar.appendChild(divTotal) \n }", "function mostrarResumen(){\n const resumen = document.querySelector('.contenido-resumen');\n //Destructuring al objeto\n const {nombre,fecha,hora,servicios} = cita;\n //Limpiar el contenido de resumen \n while(resumen.firstChild){\n resumen.removeChild(resumen.firstChild);\n } \n if( Object.values(cita).includes('') || cita.servicios.length === 0){ \n mostrarAlerta('Faltan datos de servicios, fecha u hora','error','.contenido-resumen',false);\n return;\n }\n //Creamos el heading\n \n const headingCita = document.createElement('H2');\n headingCita.textContent = 'Resumen cita';\n resumen.appendChild(headingCita); \n //Añadimos en el orden que deseamos que aparezcan los datos.\n const nombreCliente = document.createElement('P');\n nombreCliente.innerHTML = `<span>Nombre : </span>${nombre}`;\n resumen.appendChild(nombreCliente);\n fechaFormateada = formatearFecha(fecha);\n const fechaCita = document.createElement('P');\n fechaCita.innerHTML = `<span>Fecha : </span>${fechaFormateada}`;\n resumen.appendChild(fechaCita);\n const horaCita = document.createElement('P');\n horaCita.innerHTML = `<span>Hora : </span>${hora}`;\n resumen.appendChild(horaCita); \n //Variable para calcular el precio total \n let precioTotal = 0;\n servicios.forEach(servicio =>{ \n //Destructuring al objeto \n const {id, precio, nombre} = servicio;\n //Sumatorio del precio total \n precioTotal += parseInt( precio); \n\n const contenedorServicio = document.createElement('DIV');\n contenedorServicio.classList.add('contenedor-servicio');\n const textoServicio = document.createElement('P');\n textoServicio.textContent = nombre; \n const precioServicio = document.createElement('DIV');\n precioServicio.innerHTML = `<span> Precio: </span> ${precio} €`;\n contenedorServicio.appendChild(textoServicio);\n contenedorServicio.appendChild(precioServicio);\n resumen.appendChild(contenedorServicio);\n });\n \n const totalTexto = document.createElement('H2');\n totalTexto.innerHTML = `<span> Total: </span> ${precioTotal} €`;\n resumen.appendChild(totalTexto); \n\n //Crear boton\n \n const botonReservar = document.createElement('BUTTON');\n botonReservar.classList.add('boton');\n botonReservar.textContent = \"Reservar cita\";\n botonReservar.onclick = reservarCita;\n \n resumen.appendChild(botonReservar); \n}", "function visualizarRespuestas(chData, item) {\n const aData = chData;\n const obs = aData[0];\n let texto = \"\";\n for (let data in obs) {\n texto = texto + (obs[data]).toString() + \"<hr>\";\n }\n const item_id = \"rep_\" + item;\n const respuesta = document.getElementById(item_id);\n respuesta.innerHTML = texto;\n}", "function mostrarDatosCompra() {\n //Tomo los datos que pasé en la funcion navegar\n const unaCompra = this.data;\n if (unaCompra) {\n const idProd = unaCompra.idProducto;\n const productoComprado = obtenerProductoPorID(idProd);\n const subTotal = unaCompra.cantidad * productoComprado.precio;\n //Escribo el mensaje a mostrar\n const mensaje = `Producto <strong>${productoComprado.nombre}</strong>.\n <br> Cantidad comprada: <strong>${unaCompra.cantidad}</strong>.<br>\n Sub Total: <strong> $${subTotal}</strong>`;\n //Muestro el mensaje\n $(\"#pDetalleCompraMensaje\").html(mensaje);\n } else {\n ons.notification.alert(\"Ocurrió un error, por favor contacte al administrador\", { title: 'Oops!' });\n }\n}", "function showResultsDiv(CoinsResult) {\n for (var i = 0; i < CoinsResult.length; i++) {\n var id = (\"#\" + CoinsArr[i] + \"pCoin\");\n if (CoinsResult[i] > 0) {\n // html <h3> includes the number of the counted result.\n var CoinCountContent = \"<h3>\" + CoinsResult[i] + \"</h3>\";\n // replace the content of .CoinCount class\n $((id + \" .CoinCount\")).html(CoinCountContent);\n // show the coin in the result div\n $(id).css(\"display\", \"inline-block\");\n\n } else {\n // hide the coin in the result div\n $(id).css(\"display\", \"none\");\n }\n }\n // show th result div\n $('#Result_Div').show();\n\n}", "function mostrarCantEjResueltos(){\r\n let cantidadEntregas = cantEntregasDocente();\r\n document.querySelector(\"#divMostrarResueltos\").innerHTML = `Usted tiene en total ${cantidadEntregas} entregas de sus alumnos`;\r\n}", "function displayFacture(){\n\n // Si elle existe déjà, on la détruit\n $(\"#factureDetail\").empty();\n $(\"#factureSomme\").empty();\n\n // Titre\n var titre = document.createElement(\"h2\");\n titre.setAttribute(\"class\", \"w3-center\");\n titre.innerHTML= \"La Livrairie vous remercie !\";\n\n // Si la personne a fournie ses coordonnées, on les affiches (Pas de vérification demandée dans le TP)\n if(coordonnees.nom){\n $(\"#factureCoord\").show();\n $(\"#factureNom\").text(\"Nom : \" + coordonnees.nom);\n $(\"#facturePrenom\").text(\"Prénom : \" + coordonnees.prenom);\n $(\"#factureAdresse\").text(\"Adresse : \" + coordonnees.address);\n }\n\n // On crée les éléments correspondants aux achats\n for(var p in panier){\n $(\"#factureDetail\").append(createFactureElement(panier[p]));\n }\n\n // On crée la zone somme\n var somme = createSumZone(); \n \n // Ajout de la somme\n var list = $(\"#factureSomme\").append(somme);\n\n\n // On affiche\n document.getElementById(\"factureModal\").style.display='block';\n\n // On remplie les montants de la somme\n refreshSomme();\n}", "function SomarHorasProjeto(){\r\n\t var total = 0;\r\n\t if($('#hora_a').val() != ''){\r\n\t total = parseInt($('#hora_a').val());\r\n\t }\r\n\t if($('#hora_b').val() != ''){\r\n\t total = total + parseInt($('#hora_b').val());\r\n\t }\r\n\t if($('#hora_c').val() != ''){\r\n\t total = total + parseInt($('#hora_c').val());\r\n\t }\r\n\t $('#total-de-horas p').html(total);\r\n}", "function mostrarInfoSesion($usuario){\n\n $('aside').css('display','flex');\n\n $user=new Usuario($usuario.idUsuario, $usuario.nombreUsuario, $usuario.email, $usuario.password, $usuario.codResp);\n\n $('aside div:nth-child(2)').text('user: '+$user.getIdUsuario()+'-'+$user.getNombreUsuario());\n $('aside div:nth-child(3)').text($user.getEmail());\n\n\n}", "showResults(resultado, moneda, crypto, textCurrency){\n\n // select first div\n const resultadoAnterior = document.querySelector('#resultado > div');\n\n if(resultadoAnterior){\n resultadoAnterior.remove();\n }\n\n // asi puedes ir accediendo a un objeto en javascript\n const dateCurrency = resultado[crypto][moneda];\n console.log(resultado);\n // Only show 2 decimals\n let price = dateCurrency.PRICE.toFixed(2),\n changeDay = dateCurrency.CHANGEPCTDAY.toFixed(2),\n // Change date \n update = new Date(dateCurrency.LASTUPDATE * 1000).toLocaleDateString('es-MX');\n // build template\n\n let templateHTML = `\n\n <div class=\"card bg-danger\">\n <div class=\"card-body text-light\">\n <img style=\"width:10%\" class=\"align-center\" src=\"https://www.cryptocompare.com${dateCurrency.IMAGEURL}\"> \n <h2 class=\"card-title\">Results:</h2>\n <p>The price of ${dateCurrency.FROMSYMBOL} from currency ${textCurrency} is of: $${price}\n </p>\n <p>Change of last day: % ${changeDay}\n </p>\n <p>The last update: ${update}\n </p>\n </div>\n </div>\n \n `;\n\n // print spinner\n\n this.showHideSpinner('block');\n\n \n setTimeout(() => {\n // print result\n document.querySelector('#resultado').innerHTML = templateHTML;\n \n //hide spinner\n this.showHideSpinner('none');\n }, 2000)\n }", "function outputAstronauts(astrDiv, astrList){\n let total = astrDiv.querySelector(\"#astronauts-amount\");\n if(total){\n total.innerHTML = astrList.length;\n }\n let ul = astrDiv.querySelector(\".astronauts__list\");\n if(ul){\n ul.innerHTML = \"\";\n for(let i = 0; i < astrList.length; i++){\n ul.append(createAstronaut(astrList[i]));\n }\n }\n}", "function tulostatuotteet(result){\n \n for(i=0; i < result.ruokalista.length; i++){\n ateriat += \"<div class='ateriat'><span class='glyphicon glyphicon-plus-sign vasen mob'></span><p class='eiNay'>\" + result.ruokalista[i].id + \"</p><h1 class='ateria mob'>\" + result.ruokalista[i].nimi + \"</h1><div class='tiedot piilo'><p>\" + result.ruokalista[i].ainekset + \" <b>\" + result.ruokalista[i].hinta.toFixed(2) + \"€</b></p></div><h1 class='desk'>\" + result.ruokalista[i].nimi + \"</h1><div class='desk'><p>\"\n + result.ruokalista[i].ainekset + \" <b>\" + result.ruokalista[i].hinta.toFixed(2) +\"€</b></p><p class='lyhenne'>\" + result.ruokalista[i].lyhenne + \"</p><span class='glyphicon glyphicon-plus-sign oikea'></span>\" + \"<p class='eiNay'>\" + result.ruokalista[i].id + \"</p></div></div>\";\n ateria.push(result.ruokalista[i]);\n }\n \n $(\"#ruokalista\").html(ateriat);\n }", "mostrarResultado(seguro, total){\n const resultado = document.getElementById('resultado');\n let marca;\n switch(seguro.marca){\n case '1': marca = \"Americano\";\n break;\n case '2': marca = \"Asiatico\";\n break;\n case '3': marca = \"Europeo\";\n break;\n }\n\n let div = document.createElement('div');\n div.classList = 'cotizacion';\n \n div.innerHTML=`\n <p class= 'header'>Resumen</p>\n <p>Marca: ${marca}</p>\n <p>Anio: ${seguro.anio}</p>\n <p>Tipo de seguro: ${seguro.tipo}</p>\n <p>Total de la cotizacion: $ ${total}</p>`\n\n const spinner = document.querySelector('#cargando img');\n spinner.style.display = 'block';\n setTimeout(function(){\n spinner.style.display='none';\n resultado.appendChild(div);\n },2000);\n\n}", "function mostrarFechasResultantes (infoFechaInmunidad, infoFechaRevacunacion){\n //levanto el modal donde están las cajas de mensaje donde\n //cargo la información de las fechas\n $('#modalInfo').modal();\n //asigno la información de las fechas a las cajas de texto\n const infoFechaInmune = document.getElementById(\"fInmune\");\n infoFechaInmune.innerHTML = `${infoFechaInmunidad}`;\n const infoFechaRevacunar = document.getElementById(\"fRevacunacion\");\n infoFechaRevacunar.innerHTML = `${infoFechaRevacunacion}`;\n\n\n}", "function mostrarTarjetas(titulo,informacion,id,seccion)\n\t{\n\t\tdatosTarjeta = '';\n\t\tdatosTarjeta += '<div class=\"mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--3dp\">';\n datosTarjeta += '<div class=\"mdl-card__title\">';\n datosTarjeta += '<h4 class=\"mdl-card__title-text\">'+titulo+'</h4>';\n datosTarjeta += '</div>';\n datosTarjeta += '<div class=\"mdl-card__supporting-text\">';\n datosTarjeta += informacion;\n\t datosTarjeta += '</div>';\n\t datosTarjeta += '<div class=\"mdl-card__actions\">';\n\t datosTarjeta += '<a class=\"android-link mdl-button mdl-js-button mdl-typography--text-uppercase mdl-button--colored '+seccion+'\" onclick=\"mostrarContainerGalpones('+id+')\">Ver más';\n\t datosTarjeta += '<i class=\"material-icons\">chevron_right</i>';\n\t datosTarjeta += '</a>';\n\t datosTarjeta += '</div>';\n\t datosTarjeta += '</div>';\n\t \n\t $('#'+seccion).append(datosTarjeta);\n\t /*\n\t $('.containerGranjas').click(function()\n\t {\n\t \t$('#containerGalpones').html('');\n\t \t$('#containerInsumos').html('');\n\t \talert($(this).data('value'));\n\t \tmostrarContainerGalpones($(this).data('value'));\n\t });\n\t\t*/\n\n\n\t}", "function MostrarCosas(DID) {\n $(DID).css(\"display\", \"block\");\n }", "function mostrar_contratos_en_vigor(){\n url1 = '..\\\\negocio\\\\contratos-en-vigor.php';\n url2 = '..\\\\negocio\\\\anuncios-vinculados.php';\n url3 = '..\\\\negocio\\\\tipo-inmueble.php';\n adjunto1 = {'id_usuario': id_usuario,\n 'tipo_usuario': tipo_usuario};\n $.post(url1, adjunto1)\n .done(function(respuesta1){\n var contratos_en_vigor = $.parseJSON(respuesta1);\n if(contratos_en_vigor.length == 0){\n return;\n }\n if(num_contratos_vigentes == 0){\n num_contratos_vigentes = contratos_en_vigor.length;\n var cont = 0;\n } else {\n var cont = num_contratos_vigentes;\n num_contratos_vigentes += 1;\n }\n var html1 = '';\n var html2 = '';\n for (var i = cont; i < contratos_en_vigor.length; i++) {\n //-------------------------------------------------------------\n html1 += '<div id=\"contratos_vigor'+(i+1)+'\"'\n +'class=\"w3-col w3-small w3-text-inmobshop w3-border w3-border-red\"'\n +'style=\"width: 100%;margin: 0;padding-left: 30px;\">'\n +'<div id=\"salida_nombre_contrato'+(i+1)+'\" class=\"w3-col w3-panel w3-border w3-border-red\"'\n +'style=\"width: 50%;margin: 0;\">'\n +'</div>'\n +'<div class=\"w3-col w3-panel w3-border w3-border-red\"'\n +'style=\"width: 25%;margin: 0;text-align: right;\">'\n +'<b>Fecha</b>'\n +'</div>'\n +'<div id=\"salida_fecha_contrato'+(i+1)+'\"'\n +'class=\"w3-col w3-panel w3-border w3-border-red\"'\n +'style=\"width: 25%;margin: 0;\">'\n +'</div>'\n +'</div>'\n +'<div id=\"salida_anuncios_vinculados'+(i+1)+'\" '\n +'class=\"w3-col w3-small w3-text-inmobshop w3-border w3-border-green\"'\n +'style=\"width: 100%;margin: 0;\">'\n +'</div>';\n var p_contratos = $('#p_contratos');//redefinida\n var salida_anuncios_vinculados = $('#salida_anuncios_vinculados'+i);\n if(i == 0){\n p_contratos.after(html1);\n html1 = '';\n }else {\n salida_anuncios_vinculados.after(html1);\n html1 = '';\n }\n //-------------------------------------------------------------\n var s_nombre_contrato = contratos_en_vigor[i].nombre_servicio;\n var salida_nombre_contrato = $('#salida_nombre_contrato'+(i+1));//redefinida\n salida_nombre_contrato.html('<b>C'+(i+1)+'. ' + s_nombre_contrato +'</b>');\n var s_fecha = contratos_en_vigor[i].fecha_contrato;\n var salida_fecha_contrato = $('#salida_fecha_contrato'+(i+1));//redefinida\n salida_fecha_contrato.html(s_fecha);\n adjunto2 = {'id_contrato': contratos_en_vigor[i].id_contrato,\n 'id_usuario': id_usuario,\n 'tipo_usuario': tipo_usuario};\n $.post(url2, adjunto2)//for recorre anuncios\n .done(function(respuesta2){\n var anuncios_vinculados = $.parseJSON(respuesta2);\n if(anuncios_vinculados != 'No tiene anuncios vinculados al contrato.'){\n html2 += '<table class=\"w3-table w3-bordered\">'\n +'<tr>'\n +'<th>Id</th>'\n +'<th>Contrato vinculado</th>'\n +'<th>Localización</th>'\n +'<th>Tipo operación</th>'\n +'<th>Tipo inmueble</th>'\n +'<th>Precio €</th>'\n +'</tr>';\n for (var j = 0; j < anuncios_vinculados.length; j++) {\n var s_id = anuncios_vinculados[j].id_anuncio;\n var s_contrato_vinculado = 'C'+(i+1)+'. ' + s_nombre_contrato;\n var via = anuncios_vinculados[j].via;\n var num_via = anuncios_vinculados[j].numero_via;\n var cod_postal = anuncios_vinculados[j].cod_postal;\n var localidad = anuncios_vinculados[j].localidad;\n var provincia = anuncios_vinculados[j].provincia;\n var s_localizacion = via + ', ' + num_via + ', '\n + cod_postal + ' ' + localidad + ', '\n + provincia;\n var s_tipo_operacion = anuncios_vinculados[j].tipo_operacion;\n var s_precio = anuncios_vinculados[j].precio;\n var s_tiempo = anuncios_vinculados[j].tiempo;\n adjunto3 = {'id_anuncio': s_id};\n $.post(url3, adjunto3)\n .done(function(respuesta3){\n var tipo_inmueble = $.parseJSON(respuesta3);\n var s_tipo_inmueble = tipo_inmueble[0];\n html2+= '<tr><td>'\n + s_id\n +'</td><td>'\n + s_contrato_vinculado\n +'</td><td>'\n + s_localizacion\n +'</td><td>'\n +s_tipo_operacion\n +'</td><td>'\n +s_tipo_inmueble\n +'</td><td>'\n if(s_tiempo){\n html2+=\n + s_precio +'/' + s_tiempo\n +'</tr>';\n }else {\n html2+=\n + s_precio\n +'</tr>';\n }\n if(i == anuncios_vinculados.length - 1){\n html2 += '</table>';\n var salida_anuncios_vinculados = $('#salida_anuncios_vinculados'+(i+1));\n salida_anuncios_vinculados.html(html2);\n }\n\n });\n\n }\n }\n });\n }\n });\n}", "function renderPrestamo(data, id_prestamo){\n \n var divInfoPrestamoId = `info_pre_${id_prestamo}`;\n const divInfoPrestamo = document.querySelector(`#${divInfoPrestamoId}`);\n divInfoPrestamo.classList.replace(\"hide\",\"show\");\n\n\n divInfoPrestamo.innerHTML =\n\n `<div class=\"prestamo-item view-prestamo-info\">\n <div class=\"\">\n <label for=\"planillaIdPr\">Planilla No.: ${data[0].peticion_pago_id}</label>\n <a id=\"verPlanillaInfo\" href=\"#\" onclick=\"getDataPlanilla(${data[0].id_planilla})\">Ver Planilla</a>\n </div>\n <div class=\"\">\n <label for=\"cedulaPr\">Contratista: ${data[0].cedula}</label>\n </div>\n <div class=\"\">\n <label for=\"descripcionPr\">Razon: ${data[0].detalles}</label>\n </div>\n <div class=\"\">\n <label for=\"estadoPr\">Estado: ${data[0].estado}</label>\n </div>\n <div class=\"\">\n <label for=\"nombrePr\">Nombre: ${data[0].nombre}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Primer Apellido: ${data[0].apellido1}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido2Pr\">Segundo Apellido: ${data[0].apellido2}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Monto: ${data[0].monto}</label>\n </div>\n <div class=\"\">\n <label for=\"fecha_creacionPr\">Creada: ${data[0].fecha_creacion}</label>\n </div>\n </div>\n <div class=\"prestamo-item\" id=\"view-info-planilla_${data[0].id_planilla}\"></div>\n `;\n\n\n switch (data[0].estado) {\n\n case \"pendiente\":\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n <a id=\"verUsuario href=\"#\" onclick=\"rechazarPrestamo(${id_prestamo})\">Rechazar</a>\n <a id=\"pagarItem\" href=\"#\" onclick=\"autorizarPrestamo(${id_prestamo})\">Aprobar</a>\n \n \n </div>`;\n \n break;\n \n default:\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n \n </div>`;\n\n break;\n }\n \n \n }", "function divs(objeto) {\r\n\r\n var newDiv = $(\"<div class='noticia'></div>\")\r\n $(newDiv).html(\"<h3>\" + \" <a href=\" + objeto.url + \" target=_blank>\" + objeto.title + \"</a>\" + \"</h3>\" + \"<br>\" + \"<br>\" + \"<img src=\" + objeto.urlToImage + \">\" + \"<p>\" + objeto.description + \"</p>\" + \"<br>\");\r\n\r\n $(newDiv).append($('<button>').attr(\"class\", \"boton\").text(\"+info\").click(function () {\r\n info(objeto)\r\n }));\r\n\r\n $(\"#container\").append(newDiv)\r\n}", "afficherTotalPayer() {\r\n\r\n let elmH4 = document.createElement('h4');\r\n let elmH3 = document.createElement('h3');\r\n\r\n let texteContenu = this.total ;\r\n let titreTextContenu = \" Total : \" \r\n\r\n let texte = document.createTextNode(texteContenu);\r\n let titreTexte = document.createTextNode(titreTextContenu);\r\n\r\n elmH4.appendChild(texte);\r\n elmH3.appendChild(titreTexte);\r\n\r\n document.getElementById('iTotal').appendChild(elmH3);\r\n document.getElementById('iTotal').appendChild(elmH4);\r\n }", "function addDataToDiv(data) {\n var str = \"\";\n str += \"<div class='data1'><div class='div_header'>Letztes Datum</div>\"+data.time+\"</div>\"\n str += \"<div class='data2'><div class='div_header'>Gesamtinfiziert</div>\"+data.GesamtInfizierte+\"</div>\"\n str += \"<div class='data3'><div class='div_header'>Genesen</div>\"+data.Genesen+\"</div>\"\n str += \"<div class='data4'><div class='div_header'>Todesfälle</div>\"+data.Todesfälle+\"</div>\"\n str += \"<div class='data5'><div class='div_header'>Aktuell Infiziert</div>\"+data.AktuellInfizierte+\"</div>\"\n $('#last_data_wrap').prepend(str);\n}", "function mostrarInmuebles() {\n actualizarCalificacionesInmuebles();\n\n let tipoUsuario = globalTipoUser;\n let mostrar = document.querySelector(\"#divMostrarInmuebles\");\n let coti = 0;\n\n mostrar.setAttribute(\"style\", \"display:block\");\n mostrar.innerHTML = \"\";\n mostrar.innerHTML += `<h3> INMUEBLES PARA ALQUILAR </h3>`;\n\n listaInmuebles.sort((function (a, b) {\n if (Number(a.calificacionActual) < Number(b.calificacionActual)) { return 1; }\n if (Number(a.calificacionActual) > Number(b.calificacionActual)) { return -1; }\n if (Number(a.calificacionActual) === Number(b.calificacionActual)) { return 0; }\n }));\n\n if (globalTipoUser === \"Visitante\") {\n if (document.querySelector(\"#selOrdenar\").value === \"Ascendente\") {\n listaInmuebles.sort((function (a, b) {\n if (Number(a.precioPorNoche) > Number(b.precioPorNoche)) { return 1; }\n if (Number(a.precioPorNoche) < Number(b.precioPorNoche)) { return -1; }\n if (Number(a.precioPorNoche) === Number(b.precioPorNoche)) { return 0; }\n }));\n }\n if (document.querySelector(\"#selOrdenar\").value === \"Descendente\") {\n listaInmuebles.sort((function (a, b) {\n if (Number(a.precioPorNoche) < Number(b.precioPorNoche)) { return 1; }\n if (Number(a.precioPorNoche) > Number(b.precioPorNoche)) { return -1; }\n if (Number(a.precioPorNoche) === Number(b.precioPorNoche)) { return 0; }\n }));\n }\n }\n if (moneda === \"$\") {\n coti = 1;\n }\n if (moneda === \"U$S\") {\n coti = cotizacion;\n }\n for (let i = 0; i < listaInmuebles.length; i++) {\n let element = listaInmuebles[i];\n let fotoAct = element.fotoActual;\n if (tipoUsuario === \"Visitante\" && element.estado == \"on\") {\n\n mostrar.innerHTML += `<br><table border=2><tr><td><img id=\"img${element.id}\" src=\"${element.fotos[fotoAct]}\"></td><tr><table>\n <table border=2>\n <tr><td>id: ${element.id}</td><tr>\n <tr><td>Titulo: ${element.titulo}</td><tr>\n <tr><td>Descripción: ${element.descripcion}</td><tr>\n <tr><td>Calificación: ${Number(element.calificacionActual).toFixed(1)}</td><tr>\n <tr><td>Precio por noche: ${moneda}<span id=\"precio${element.id}\">${Number(element.precioPorNoche) / coti}<span></td><tr> \n <tr><td>Ciudad: ${element.ciudad}</td><tr><table><br>`\n }\n if (tipoUsuario === \"Huesped\" && element.estado == \"on\") {\n mostrar.innerHTML += `<br><table border=2><tr><td><img id=\"img${element.id}\" src=\"${element.fotos[fotoAct]}\"></td><table>\n <table border=2>\n <tr><td>id: ${element.id}</td><tr>\n <tr><td>Titulo: ${element.titulo}</td><tr>\n <tr><td>Descripción: ${element.descripcion}</td><tr>\n <tr><td>Calificación: ${Number(element.calificacionActual).toFixed(1)}</td><tr>\n <tr><td>Precio por noche: ${moneda}<span id=\"precio${element.id}\">${Number(element.precioPorNoche) / coti}<span></td><tr>\n <tr><td>Ciudad: ${element.ciudad}</td><tr> \n <tr><td><input type=\"button\" class=\"verMas\" Value=\"Ver Más\" name=\"${element.id}\">\n <div id=\"divVerMas${element.id}\" style=\"display:none\">\n <input type=\"button\" name=\"${element.id}\" class=\"fotoAnterior\" value=\" << \">\n <input type=\"button\" name=\"${element.id}\" class=\"fotoSiguiente\" value=\" >> \"><br> \n <h3> Para reservar </h3><br> \n <input type=\"text\" id=\"txtReserva${element.id}\" style=\"width: 200px;\" placeholder=\"Ingrese cantidad de noches\"><br> \n <input type=\"button\" name=\"${element.id}\" class=\"realizarReserva\" value=\"Realizar reserva\"><br> \n <div id=\"divConfirmar${element.id}\" style=\"display:none\"></div></div></td><table><br>`;\n }\n if (tipoUsuario === \"Anfitrion\" && globalUser == element.usuarioAnfitrion) {\n mostrar.innerHTML += `<br><table border=2><tr><td><img id=\"img${element.id}\" src=\"${element.fotos[fotoAct]}\"></td><tr><table>\n <table border=2><tr><td>Titulo: ${element.titulo}</td><tr>\n <tr><td>Descripción: ${element.descripcion}</td><tr>\n <tr><td>Calificación: ${Number(element.calificacionActual).toFixed(1)}</td><tr>\n <tr><td>Precio por noche: ${moneda}<span id=\"precio${element.id}\">${Number(element.precioPorNoche) / coti}<span></td><tr>\n <tr><td>Ciudad: ${element.ciudad}</td><tr><input type=\"button\" class=\"btnHab\" name=\"${element.id}\" value=\"Habilitar\"><input type=\"button\" class=\"btnDesab\" name=\"${element.id}\" value=\"Deshabilitar\"><span id=\"span${element.id}\"></span><table><br>`\n }\n habilitarbotones();\n\n }\n}", "function mostraResultado(){\n\n\tvar resultado = document.getElementById(\"divResultado\"); // procura o elemto com o id informado. No caso, a div onde sera colocada o resultado da partida\n\n\t// atibui ao resultado da pesquisa os valores das marcacoes corretas e erradas\n\tresultado.innerHTML = \"<font color= green>Erro(s) Encontrado(s): \" + numErrosEncontrados + \"</font></br>\" +\n\t\"<font color= #DAA520>Erro(s) Não Marcado(s): \" + numNaoMarcados + \"</font></br>\" +\n\t\"<font color= red>Marcação(ões) Errada(s): \" + numMarcacoesIncorretas+ \"</font>\"\n\n}", "function floatcarDisplay(){\r\r\r\r\r\r\n\r $.post('/officium/web/ecar/floatDisplay',\r\r\r\r\r\n {\r\r\r\r\r\n },function(result){\r\r\r\r\r\n\r\r\r\r\n result = JSON.parse(result);\r\r\r\r\n var citems =result.length;\r\r\r\r\n var i=0;\r\r\r\r\n var adds=\"\";\r\r\r\r\n for(i=0;i<citems;i++){\r\r\r\r\n var img = result[i][1].substring(2)\r\r\r\r\n img = 'https://officiumix.com.mx/'+img;\r\r\r\r\n adds= adds+'<div style=\"margin-bottom:15px;\" class=\"col-3\"><img class=\"rounded\" src=\"'+img+'\" style=\"width:75px\"> </div>'+\r\r\r\r\n '<div style=\"margin-bottom:15px; padding-top:12px;\" class=\"col-6\"><small>'+result[i][0]+'</small></div>'+\r\r\r\r\n '<div style=\"margin-bottom:15px;\" class=\"col-2 text-right\">'+result[i][2]+'</div>';\r\r\r\r\n }\r\r\r\r\n $(\"#ecarList\").html(adds);\r\r\r\r\n $('#exampleModal').modal('toggle');\r\r\r\r\r\n }); ///end of comuniccation\r\r\r\r\r\n\r\r\r\r\r\n}///end of function", "function showInfoBox(new_cases, total_cases, new_deaths, total_deaths) {\n /*return '<div class=\"container-fluid flex-wrap\" style=\"width: 25vh; font-size: 15px\">' + '' +\n '<div class=\"row\"> ' +\n '<div class=\"col-6 d-flex justify-content-end\" style=\"color: #000000\">New Cases</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + new_cases + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end\" style=\"color: #000000\">Total Cases</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + total_cases + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end \" style=\"color: #000000\">New Deaths</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + new_deaths + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end\">Total Deaths</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + total_deaths + '</div>' +\n '</div>' +\n '</div>';*/\n return '<div style=\"width: 25vh\">' +\n 'New Cases: <b>' + new_cases + '</b><br>' +\n 'Total Cases: <b>' + total_cases + '</b><br>' +\n 'New Deaths: <b>' + new_deaths + '</b><br>' +\n 'Cumulative Deaths: <b>' + total_deaths + '</b></div>';\n }", "function displayComic(data) {\n\t\t \t$('.title').text(data.title);\n\t\t\t\t$('.month').text(data.month);\n\t\t\t\t$('.day').text(data.day);\n\t\t\t\t$('.year').text(data.year);\n\t\t\t\t$('.image').html('<img src=\"' + data.img + '\"/>');\n\t\t\t\t$('.alt').text(data.alt);\n\t\t\t} // end displayComic function", "function mostrarDevoluciones() {\n elementos.mensajePanel.addClass('hide');\n elementos.devolucionesTabla.removeClass('hide');\n\n NumberHelper.mascaraMoneda('.mascaraMoneda');\n }", "function mostrarMensaje(div) {\n var capa = document.getElementById(div);\n capa.style.display = 'inline';\n}", "async function visualizacaoRecursiva(div_comentario,respostas){\n if(respostas.length>0){\n respostas.forEach(newComentario => {\n let div_reposta = criaComentario(newComentario);\n visualizacaoRecursiva(div_reposta,newComentario.resposta);\n div_comentario.caixa.appendChild(div_reposta.caixa);\n });\n }\n return div_comentario;\n}", "function forDetalleProducto(){\n\tvar txt= '<div class=\"div-center\"><div class=\"content\"><div id=\"head\"><img src=\"img/logo1.png\" alt=\"logo\" id=\"imgLogin\"><h2>PLATOS</h2>';\n\ttxt += '<hr /></div><div id=\"asignar\"><div><img class=\"col-xs-6\" src=\"img/menu/Arroz_con_Pollo.jpg\" alt=\"Plato\" id=\"imgProducto\">';\n\ttxt += '<div class=\"col-xs-6\"><h5>Arroz con Pollo</h5><h5>precio: $ 8000</h5></div></div><div id=\"contenedorContador\"><img src=\"img/flecha_abajo.png\" class=\"imgFlechas\">';\n\ttxt += '<h3 id=\"contador\">1</h3><img src=\"img/flecha_arriba.png\" class=\"imgFlechas\"></div></div><hr/><div id=\"campoBtn\"><button class=\"btn btn-info pull-left\" onClick=\"regresar()\" id=\"btnRegreso\"><span class=\"glyphicon glyphicon-chevron-left\"></span></button>';\n\ttxt += '<button type=\"button\" id=\"btnNuevaSolicitud\" onClick=\"mostrarDescripcionPedido()\" class=\"btn btn-default pull-right\">Aceptar</button></div></div></div>';\n\t\treturn txt;\n}", "function showResult(){\n let message;\n let div = document.getElementById(\"resultAll\");\n if(somme < 0){\n message = \"Vous etes dans le negatif ! Vous devez : \"\n }\n else {\n message = \"Vous avez actuelement : \"\n }\n div.innerHTML = message + \"<br>\" + parseFloat(somme) + \"€\";\n div.style.cssText = \"font-size:20px;font-weight:bold\";\n}", "function display(data) {\n div = document.createElement(\"div\");\n div.className = \"container-fluid row justify-content-center\";\n div.id = \"row\";\n // using foreach loop to iterate through data----------------------\n data.forEach((element) => {\n const newdiv = document.createElement(\"div\");\n newdiv.className = \"col-10 col-sm-5 col-lg-3\";\n // adding name to the div----------------------------------------\n const name = document.createElement(\"h3\");\n name.innerHTML = `${element.name}`;\n newdiv.appendChild(name);\n // adding type to div--------------------------------------------\n const type = document.createElement(\"p\");\n type.innerHTML = `brewery type : ${element.brewery_type}`;\n type.id = \"type\";\n newdiv.appendChild(type);\n // adding address to div-----------------------------------------\n const address = document.createElement(\"p\");\n // checking for street name if null it will execute if part else it will ecxecute else part.\n if (element.street == null) \n address.innerHTML = `Address: , ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n else\n address.innerHTML = `Address: ${element.street}, ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n newdiv.appendChild(address);\n // adding website to div-----------------------------------------\n const web = document.createElement(\"p\");\n // checking for website if null it will display Not Available else it will display website name.\n web.id=\"web\";\n if (element.website_url == null)\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> - Not Available`;\n else\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> ${element.website_url}`;\n newdiv.appendChild(web);\n // adding number to div------------------------------------------\n const phone = document.createElement(\"p\");\n // checking for number if null it will display Not Available else it will display number.\n if (element.phone == null)\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i> - Not Available `;\n else\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i>${element.phone}`;\n newdiv.appendChild(phone);\n div.appendChild(newdiv);\n root.appendChild(div);//appending all element to root element\n });\n}", "function buscarhorarios()\n{\n var data = new Array(12);\n var divhoras;\n divhoras = document.getElementById(\"divhoras\");\n fechaage = document.getElementsByName(\"calendario\")[0].value;\n str_nom_agenda = document.getElementsByName(\"str_nom_agenda\")[0].value;\n \n str_medico1 = document.getElementsByName(\"str_medico1\")[0].value;\n str_medico2 = document.getElementsByName(\"str_medico\")[0].value;\n\n //*******************ASIGNAREL VALOR DEL MÉDICOQUE SE USARAN PARA EL QUERY********************\n int_medico = str_medico1\n //*******************BUSCO EL DIA DE LA SEMANA A LA PERTENECE LA FECHA SELECCIONADA***********\n \n var cadena = fechaage.split(\"-\");\n semana = cadena[0];\n dia = cadena[1];\n mes = cadena[2];\n ano = cadena[3];\n fecha_actual = ano+\"-\"+mes+\"-\"+dia;\n\n //*******************ASIGNAR AL ARRAY DE DATOS************************************************\n\n data[0] = semana;\n data[1] = dia;\n data[2] = mes;\n data[3] = ano;\n data[4] = str_nom_agenda;\n data[5] = int_medico;\n data[6] = fecha_actual;\n \n //*******************ENVÍO CON JQUERY LA INFORMACION******************************************\n $.ajax({\n url: 'horarios',\n type: 'POST',\n data: {data: data},\n dataType: 'html',\n beforeSend: function () {\n //alert('Procesando...');\n },\n error:function( jqXHR, textStatus, errorThrown ) {\n alert( errorThrown ); \n //alert(\"Ha ocurrido un error\");\n },\n success: function (respuesta) {\n $('#divhoras').html(respuesta);\n }\n });\n}", "function display() {\n for (var i = 0; i < arrs.length; i++) {\n //tao the div va dat ten class\n var div = document.createElement(\"div\");\n div.className = \"product\";\n //tao the img\n var img = document.createElement(\"img\");\n img.src = arrs[i].image;\n //tao the p (mo to san pham)\n var px = document.createElement(\"div\");\n px.className = \"dix\"\n px.innerHTML = arrs[i].price + \" đ\";\n var p = document.createElement(\"p\");\n p.innerHTML = \"<div class='showra'>\" + \"<div class='name'>\" + arrs[i].name + \"</div>\" + \"<br>\" + arrs[i].detail + \"<a class='nutmua' href='#'onclick='add(\" + i + \")'><i class='fa fa-shopping-cart' aria-hidden='true' style='font-size:25px'></i></a>\" + \"</div>\";\n //dua vao lam con\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(px);\n //gan the div vao lam con body\n document.body.appendChild(div);\n }\n}", "function display() {\n for (var i = 0; i < arrs.length; i++) {\n //tao the div va dat ten class\n var div = document.createElement(\"div\");\n div.className = \"product\";\n //tao the img\n var img = document.createElement(\"img\");\n img.src = arrs[i].image;\n //tao the p (mo to san pham)\n var px = document.createElement(\"div\");\n px.className = \"dix\"\n px.innerHTML = arrs[i].price + \" đ\";\n var p = document.createElement(\"p\");\n p.innerHTML = \"<div class='showra'>\" + \"<div class='name'>\" + arrs[i].name + \"</div>\" + \"<br>\" + arrs[i].detail + \"<a class='nutmua' href='#'onclick='add(\" + i + \")'><i class='fa fa-shopping-cart' aria-hidden='true' style='font-size:25px'></i></a>\" + \"</div>\";\n //dua vao lam con\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(px);\n //gan the div vao lam con body\n document.body.appendChild(div);\n }\n}", "function sumarCarrito(carrito) {\n let contador = document.getElementById('contador');\n contador.innerText = carrito.length\n}", "function renderHtmlTotalArticles(panier) {\n \n let htmlTotalArticles = getHtmlTotalArticles(panier);\n\n document.querySelector(\".nbTotalCart\").innerHTML = htmlTotalArticles\n\n}", "function mostrarFormBuscarCitas(){\n\t\n\t$(\"#div_hiddenBuscarcitas\").show(\"slower\");\n}", "function procesarInfo(){\n //obtiene el valor en la caja input\n let primerNumero = document.getElementById('txtNumberOne').value;\n let segundoNumero = document.getElementById('txtNumberTwo').value;\n console.log('primer numero ===> ', primerNumero);\n console.log('segundo numero ====> ', segundoNumero);\n\n // asigna a una variable el resultado del metodo\n let resultado = sumarDosVariables(primerNumero, segundoNumero);\n\n // asigna en el div el resultado de la variable\n document.getElementById('divResultado').innerHTML = 'Resultado => '+resultado;\n}", "function etapa6() {\n \n msgTratamentoEtapa5.innerHTML = \"\";\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"6º Etapa - Despesas do Evento\";\n \n document.getElementById('inserirDespesas').style.display = ''; //habilita a etapa 6\n document.getElementById('inserirValorAdicional').style.display = 'none'; //desabilita a etapa 5\n \n //recebe o elemento html que está as inf dos valores adicionais\n var confirmacaoInfValoresAdicionais = document.querySelector(\"#valoresAddInf\");\n \n //pega o valor adicional e faz o monta o texto da etapa final caso não tenha\n var qtdValorAdicional = document.getElementById('qtdValorAdicional').value;\n \n if(qtdValorAdicional == 0){\n //apaga o texto da confirmação da etapa final pois vai ser montado novamente\n confirmacaoInfValoresAdicionais.innerHTML = \"\";\n \n //cria um elento inpunt <h6>\n var paragrafoValorAdicional = document.createElement(\"h5\");\n\n //define os atributos desse elemento\n paragrafoValorAdicional.class = \"card-title\";\n\n //define o texto dentro do paragrafo\n paragrafoValorAdicional.textContent = \"Valores Adicionais: Evento não possui valores adicionais\";\n\n //adicona o <p> criado na informação dos valores adicionais na ultima etapa\n confirmacaoInfValoresAdicionais.appendChild(paragrafoValorAdicional);\n \n }\n \n //pega o desconto e monta o texto da etapa final\n descontoTotalFesta = document.getElementById('jsDesconto').value;\n if(descontoTotalFesta == \"\"){\n descontoTotalFesta = 0;\n }\n \n //cria um elento inpunt <h6>\n var paragrafoDesconto = document.createElement(\"h5\");\n\n //define os atributos desse elemento\n paragrafoDesconto.class = \"card-title\";\n\n //define o texto dentro do paragrafo\n paragrafoDesconto.textContent = \"Desconto: R$\"+descontoTotalFesta;\n\n //adicona o <p> criado na informação dos valores adicionais na ultima etapa\n confirmacaoInfValoresAdicionais.appendChild(paragrafoDesconto);\n \n }", "function etapa7() {\n \n msgTratamentoEtapa6.innerHTML = \"\";\n \n //recebe a qtd de despesa em uma variavel\n var qtdDespesa = document.getElementById('qtdDespesa').value; //habilita a etapa 7\n \n //verifica se adicionou pelo menos 1 despesa\n if(qtdDespesa == 0){\n \n //COMEÇO DEFINIÇÃO DO TEXTO DE CONFIRMAÇÃO DA ULTIMA ETAPA\n //recebe o elemento html que está as inf das despesas e apaga tudo, pois vai ser montado novamente\n var confirmacaoInfDespesas = document.querySelector(\"#despesasInf\");\n confirmacaoInfDespesas.innerHTML = \"\"; \n\n //variaveis utilizadas para montagem do texto\n var textoParagrafoDespesa = \"\";\n\n //cria um elento inpunt <h6>\n var paragrafoDespesa = document.createElement(\"h5\");\n\n //define os atributos desse elemento\n paragrafoDespesa.id = \"h6Despesa\";\n paragrafoDespesa.class = \"card-title\";\n\n //define o texto dentro do paragrafo\n paragrafoDespesa.textContent = \"Evento não possui despesas.\";\n\n //adicona o <p> criado na informação das despesas na ultima etapa\n confirmacaoInfDespesas.appendChild(paragrafoDespesa); \n \n //COMEÇO DO CALCULO DOS VALORES\n //VALOR TOTAL FESTA \n //calcula o valor total dos pacotes adicionais\n var valorPacotesAdd = 0;\n listaPacoteAddValores.forEach((valorAtual) => {\n valorPacotesAdd = parseFloat(valorPacotesAdd) + parseFloat(valorAtual);\n });\n \n //calcula o valor total dos valores adicionais\n var valorValoresAdicionais = 0;\n listaValoresAddValores.forEach((valorAtual) => {\n valorValoresAdicionais = parseFloat(valorValoresAdicionais) + parseFloat(valorAtual);\n }); \n \n //resultado = pacotes adicionais + valores adicionais + pacote\n valorTotalFesta = (parseFloat(valorPacotesAdd) + parseFloat(valorValoresAdicionais) + parseFloat(valorPacote)) - parseFloat(descontoTotalFesta);\n\n //VALOR TOTAL DESPESA \n //calcula o valor de despesa de funcionario\n var valorTotalPagamentoFunc = 0;\n listaFuncionarioValores.forEach((valorAtual) => {\n valorTotalPagamentoFunc = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorAtual);\n });\n \n //resultado = funcionario\n var valorTotalDespesa = 0;\n valorTotalDespesa = parseFloat(valorTotalPagamentoFunc);\n \n //LUCRO\n //resultado = valor total - valor total despesa\n valorLucro = parseFloat(valorTotalFesta) - parseFloat(valorTotalDespesa);\n \n //arredonda os valores para 2 casas depois da virgula\n valorTotalFesta = parseFloat(valorTotalFesta.toFixed(2));\n valorTotalDespesa = parseFloat(valorTotalDespesa.toFixed(2));\n valorLucro = parseFloat(valorLucro.toFixed(2));\n \n //salva o valorTotalFesta em uma variavel auxiliar utilizada na próxima etapa\n if(countPrimeiraVezAdd == 0){\n valorTotalFestaLocal = valorTotalFesta; \n valorTotalFestaLocalAnterior = valorTotalFesta; \n }else{\n //subtrai do valor total anterior oque sobrou do valor total festa\n valorTotalFestaLocalAnterior = valorTotalFestaLocalAnterior - valorTotalFestaLocal;\n \n //define o novo valor total local, subtraindo o valor total festa - valor anterior\n valorTotalFestaLocal = valorTotalFesta - valorTotalFestaLocalAnterior;\n \n valorTotalFestaLocalAnterior = valorTotalFesta;\n }\n //FIM DO CALCULO DOS VALORES \n \n //DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n //valor total\n var valorTotalProximaEtapa = document.querySelector(\"#valorTotal\");\n valorTotalProximaEtapa.textContent = \"Valor Total: R$\"+valorTotalFesta; \n \n //desconto\n var valorDescontoProximaEtapa = document.querySelector(\"#totalDesconto\");\n valorDescontoProximaEtapa.textContent = \"Desconto: R$\" + descontoTotalFesta;\n \n //valor total despesa\n var valorTotalDespesaProximaEtapa = document.querySelector(\"#totalDespesas\");\n valorTotalDespesaProximaEtapa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n \n //valor lucro\n var valorLucroProximaEtapa = document.querySelector(\"#lucro\");\n valorLucroProximaEtapa.textContent = \"Lucro do Evento: R$\"+valorLucro; \n //FIM DA DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n \n //DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n confirmacaoInfValoresFinais.innerHTML = \"\"; //limpa seu conteudo\n \n //zera a varivel porque vai apagar o h6\n criouPegarContratante = 0;\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorTotal = document.createElement(\"h5\");\n var paragrafoDesconto = document.createElement(\"h5\");\n var paragrafoValorTotalDespesa = document.createElement(\"h5\");\n var paragrafoValorLucro = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorTotal.class = \"card-title\";\n paragrafoDesconto.class = \"card-title\";\n paragrafoValorTotalDespesa.class = \"card-title\"; \n paragrafoValorLucro.class = \"card-title\"; \n \n //define o texto\n paragrafoValorTotal.textContent = \"Valor Total: R$\"+valorTotalFesta; \n paragrafoDesconto.textContent = \"Desconto: R$\"+descontoTotalFesta; \n paragrafoValorTotalDespesa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n paragrafoValorLucro.textContent = \"Lucro do Evento: R$\"+valorLucro; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotal);\n confirmacaoInfValoresFinais.appendChild(paragrafoDesconto);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotalDespesa);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorLucro);\n //FIM DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n \n //DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n document.getElementById('valorTotalFesta').value = valorTotalFesta;\n document.getElementById('descontoEvento').value = descontoTotalFesta;\n document.getElementById('valorTotalDespesa').value = valorTotalDespesa;\n document.getElementById('valorTotalLucro').value = valorLucro;\n //FIM DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"7º Etapa - Valores & Formas de Pagamento\";\n \n document.getElementById('valoresEformaPagamento').style.display = ''; //habilita a etapa 7\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n \n }else{ \n\n //COMEÇO DO CALCULO DOS VALORES\n //VALOR TOTAL FESTA \n //calcula o valor total dos pacotes adicionais\n var valorPacotesAdd = 0;\n listaPacoteAddValores.forEach((valorAtual) => {\n valorPacotesAdd = parseFloat(valorPacotesAdd) + parseFloat(valorAtual);\n });\n \n //calcula o valor total dos valores adicionais\n var valorValoresAdicionais = 0;\n listaValoresAddValores.forEach((valorAtual) => {\n valorValoresAdicionais = parseFloat(valorValoresAdicionais) + parseFloat(valorAtual);\n }); \n \n //resultado = pacotes adicionais + valores adicionais + pacote\n valorTotalFesta = (parseFloat(valorPacotesAdd) + parseFloat(valorValoresAdicionais) + parseFloat(valorPacote)) - parseFloat(descontoTotalFesta);\n\n //VALOR TOTAL DESPESA \n //calcula o valor de despesa de funcionario\n var valorTotalPagamentoFunc = 0;\n listaFuncionarioValores.forEach((valorAtual) => {\n valorTotalPagamentoFunc = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorAtual);\n }); \n \n //calcula o valor de despesa das despesas\n var valorTotalDespesa = 0;\n listaValoresDespesa.forEach((valorAtual) => {\n valorTotalDespesa = parseFloat(valorTotalDespesa) + parseFloat(valorAtual);\n }); \n \n //resultado = funcionario + despesas\n valorTotalDespesa = parseFloat(valorTotalPagamentoFunc) + parseFloat(valorTotalDespesa);\n \n //LUCRO\n //resultado = valor total - valor total despesa\n valorLucro = parseFloat(valorTotalFesta) - parseFloat(valorTotalDespesa);\n \n //arredonda os valores para 2 casas depois da virgula\n valorTotalFesta = parseFloat(valorTotalFesta.toFixed(2));\n valorTotalDespesa = parseFloat(valorTotalDespesa.toFixed(2));\n valorLucro = parseFloat(valorLucro.toFixed(2));\n \n //salva o valorTotalFesta em uma variavel auxiliar utilizada na próxima etapa\n if(countPrimeiraVezAdd == 0){\n valorTotalFestaLocal = valorTotalFesta; \n valorTotalFestaLocalAnterior = valorTotalFesta; \n }else{\n //subtrai do valor total anterior oque sobrou do valor total festa\n valorTotalFestaLocalAnterior = valorTotalFestaLocalAnterior - valorTotalFestaLocal;\n \n //define o novo valor total local, subtraindo o valor total festa - valor anterior\n valorTotalFestaLocal = valorTotalFesta - valorTotalFestaLocalAnterior;\n \n valorTotalFestaLocalAnterior = valorTotalFesta;\n }\n //FIM DO CALCULO DOS VALORES \n \n //DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n //valor total\n var valorTotalProximaEtapa = document.querySelector(\"#valorTotal\");\n valorTotalProximaEtapa.textContent = \"Valor Total: R$\"+valorTotalFesta; \n \n //desconto\n var valorDescontoProximaEtapa = document.querySelector(\"#totalDesconto\");\n valorDescontoProximaEtapa.textContent = \"Desconto: R$\" + descontoTotalFesta;\n \n //valor total despesa\n var valorTotalDespesaProximaEtapa = document.querySelector(\"#totalDespesas\");\n valorTotalDespesaProximaEtapa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n \n //valor lucro\n var valorLucroProximaEtapa = document.querySelector(\"#lucro\");\n valorLucroProximaEtapa.textContent = \"Lucro do Evento: R$\"+valorLucro; \n //FIM DA DEFINIÇÃO DO TEXTO DA PRÓXIMA ETAPA\n \n //DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n confirmacaoInfValoresFinais.innerHTML = \"\"; //limpa seu conteudo\n \n //zera a varivel porque vai apagar o h6\n criouPegarContratante = 0;\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorTotal = document.createElement(\"h5\");\n var paragrafoDesconto = document.createElement(\"h5\");\n var paragrafoValorTotalDespesa = document.createElement(\"h5\");\n var paragrafoValorLucro = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorTotal.class = \"card-title\"; \n paragrafoDesconto.class = \"card-title\";\n paragrafoValorTotalDespesa.class = \"card-title\"; \n paragrafoValorLucro.class = \"card-title\"; \n \n //define o texto\n paragrafoValorTotal.textContent = \"Valor Total: R$\"+valorTotalFesta; \n paragrafoDesconto.textContent = \"Desconto: R$\"+descontoTotalFesta;\n paragrafoValorTotalDespesa.textContent = \"Total de despesas: R$\"+valorTotalDespesa; \n paragrafoValorLucro.textContent = \"Lucro do Evento: R$\"+valorLucro; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotal);\n confirmacaoInfValoresFinais.appendChild(paragrafoDesconto);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorTotalDespesa);\n confirmacaoInfValoresFinais.appendChild(paragrafoValorLucro);\n //FIM DEFINIÇÃO DO TEXTO PARA A ULTIMA ETAPA (CONFIRMAÇÃO)\n \n //DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n document.getElementById('valorTotalFesta').value = valorTotalFesta;\n document.getElementById('descontoEvento').value = descontoTotalFesta;\n document.getElementById('valorTotalDespesa').value = valorTotalDespesa;\n document.getElementById('valorTotalLucro').value = valorLucro;\n //FIM DEFINIÇÃO DOS VALORES DO INPUTS DO CADASTRO DE FESTA\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"7º Etapa - Valores & Formas de Pagamento\";\n \n document.getElementById('valoresEformaPagamento').style.display = ''; //habilita a etapa 7\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n }\n \n }", "function formattazione(payload1,showCommenti){\n scroll(0,0);//torno in cima alla pagina per visualizzare il problema\n //selezione il div che conterrà il problema\n var divProblema = document.getElementById(\"problema\");\n divProblema.className=\"stripe\";\n divProblema.style.visibility=\"visibile\";\n //titolo del problema\n\t\t\t\tvar idP=document.createElement(\"small\");\n\t\t\t\tidP.setAttribute(\"id\",\"idp\");\n\t\t\t\tdivProblema.appendChild(idP);\n\t\t\t\tidP.innerHTML= payload1.problema.idProblema;\n var titolo = document.createElement(\"h1\");\n titolo.setAttribute(\"id\", \"titolo\");\n divProblema.appendChild(titolo);\n titolo.innerHTML=payload1.problema.titolo;\n //descrizione del problema \n var descrizione = document.createElement(\"p\");\n descrizione.setAttribute(\"id\", \"descrizione\");\n divProblema.appendChild(descrizione);\n if(payload1.problema.anonimo){\n\t\t\t\t\tk=\"<br><i>l'utete ha deciso di effettuare la segnalazione in maniera anonima</i>\"\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tk=\"<br><br><small><i>segnalazione effettuata dall'utente numero: \"+payload1.problema.secretID+\". Che corrisconde all'utente: \"+payload1.utenti.Nome +\" \"+ payload1.utenti.Cognome+\"</i></small>\";\n\t\t\t\t}\n\t\t\t\tif(payload1.problema.dataRisol!== null){\n\t\t\t\t\tk+=\"<br><p> risolto il :\"+payload1.problema.dataRisol+\"</p>\"\n\t\t\t\t}\n descrizione.innerHTML=payload1.problema.descrizione+k; //il valore di k cambio al cambiare della volontà dell'utente di rimanere anonimo o no\n\n //TAG\n var l = payload1.tag.length;\n\t\t\t\tvar tag=\"\";\n\t\t\t\tvar i=0;\n\t\t\t\twhile(l>i){\n\t\t\t\t\ttag+= \" \"+payload1.tag[i];\n\t\t\t\t\ti++;\n }\n descrizione.innerHTML+=\"<br><br><b> TAG : </b> \"+ tag;\n }", "function mostrarDiv(idmuestra,idoculta){\n\tvar ident=\"#\"+idmuestra;\n\tvar identOculta=\"#\"+idoculta;\n\t$(identOculta).hide();\n\t$(ident).show();\r\n}", "function showResultUi(data) {\n result.innerHTML = '';\n data === null ? result.innerHTML = `\n <div class=\"col-md-12 text-center\">\n <p>There is no search result, try agin!</p>\n </div>\n ` :\n data.forEach(meal => {\n result.innerHTML += `\n <div class=\"col-md-2 m-0 p-1\">\n <div class=\"meal\">\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\">\n <div id=\"${meal.idMeal}\" class=\"meal-info\">\n <p id=\"${meal.idMeal}\">${meal.strMeal}</p>\n </div>\n </div>\n </div>\n `;\n });\n}", "function presentarNota(){darRespuestaHtml(\"<b>Nota: \"+nota+\"</b> punto/s sobre 10\");}", "function carritoHTML() {\n // // limpiar el html\n limpiarHTML();\n //recorre el carrito y genera el html\n coleccionProductos.forEach((producto) => {\n const { imagen, nombre, precio, cantidad, id } = producto;\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td><img src='${imagen}' width='40'></td>\n <td>${nombre}</td>\n <td>${cantidad}</td>\n <td>$${precio}</td>\n <td><a href=\"#\" class=\"borrar\" data-id=${id}><ion-icon name=\"trash-outline\" size=\"large\"></ion-icon></a></td>\n `;\n contenedorCarrito.appendChild(row);\n });\n\n // Agrego el carrito de comprasal local stogare\n sincronizarLocalSotorage();\n mostrarCantidadCarrito();\n calcularSubTotal();\n}", "function imprimeTodasDespesas() {\n const areaDasDespesas = document.getElementById(\"area-despesas\");\n// limpa area para evitar info duplicadas\n areaDasDespesas.innerHTML = \"\";\n// adiciona despesa na area de despesa\n for (let despesa of listaDeDespesas){\n areaDasDespesas.innerHTML += despesa.compilaDadosDespesa();\n }\n}", "function mostrarMediciones() {\n var medicionesContent = document.getElementById(\"mediciones-content\");\n console.log(medicionesContent);\n\n //console.log(\"mostrarMediciones()\");\n let promesa = laLogica.recuperarMediciones().then((mediciones) => {\n if (mediciones) {\n medicionesContent.innerHTML = \"\";\n mediciones.forEach((medicion) => {\n //console.log(medicion);\n let row = document.createElement(\"div\");\n row.classList.add(\"row\");\n\n let divHora = document.createElement(\"div\");\n divHora.innerText = medicion.momento\n .toString()\n .replace(\"T\", \" \")\n .replace(\"Z\", \" \");\n divHora.classList.add(\"cell\");\n let divValor = document.createElement(\"div\");\n divValor.innerText = medicion.valor;\n divValor.classList.add(\"cell\");\n\n let divUbicacion = document.createElement(\"div\");\n divUbicacion.innerText =\n \"lat: \" + medicion.ubicacion.x + \", lng: \" + medicion.ubicacion.y;\n divUbicacion.classList.add(\"cell\");\n\n row.append(divHora);\n row.append(divValor);\n row.append(divUbicacion);\n medicionesContent.appendChild(row);\n });\n } else {\n }\n });\n}", "function agregarCompra1(){\r\n let compra = document.getElementById('producto1')\r\n let precio = document.getElementById('txt1')\r\n let vendedor = document.getElementById('vend1')\r\n let modelo = document.getElementById('modelo1')\r\n let orden = `\r\n <div id=\"tit1\" class=\"fs-4 fw-bold\">${compra.textContent}</div>\r\n <p class=\"mt-1 fw-bold\" >Precio: <div id=\"pre1\" class=\"fs-5\">${precio.textContent}</div></p>\r\n <p class=\"mt-1 fw-bold\" >Año: <div id=\"mod1\" class=\"fs-5\">${modelo.textContent}</div></p>\r\n <p class=\"mt-1 fw-bold\" >Vendedor: <div id=\"ven1\" class=\"fs-5\">${vendedor.textContent}</div></p>\r\n `\r\n document.getElementById('compras').innerHTML = orden;\r\n}", "function showEmptyDisease() {\n var ref_enfermedad = document.getElementById(\"enfermedad\");\n\n var html = '<img id=\"plantillafondo2\" src=\"assets/img/logo.jpg\" alt=\"Enfermedad no especificada\">' +\n '<div class=\"panel-footer text-muted\" id=\"footerFoto\">Aquí se mostrarán los datos de la enfermedad solicitada</div>';\n\n ref_enfermedad.innerHTML = html;\n\n if ( $(\"#contagiosSexo\").length && $(\"#contagiosEdad\").length ) {\n $(\"#contagiosSexo\").hide();\n $(\"#contagiosEdad\").hide();\n $(\"#tituloDisp\").hide();\n $(\"#disper1\").hide();\n $(\"#disper2\").hide();\n }\n}", "function showDescrepancyCount(sectionDescrepancies) {\n// loop through and get the key\n for (var key in sectionDescrepancies) {\n// with the key select the correct div to modify\n var selector = document.getElementById(key).parentNode.parentNode.previousSibling.previousSibling;\n//remove invisible class so warnings are visible\n selector.classList.remove(\"invisible\");\n if (sectionDescrepancies[key] > 0) {\n\n// insert the count value into the innerhtml of the correct div ^\n selector.innerHTML = '<img src=\\'images/icons/warning.png\\'> <em class=\\'red-text\\'>' + sectionDescrepancies[key] + '<em>';\n }\n }\n}", "function createResultList(dta){\nx = 0;\ncontent = \"\";\ndta.forEach(function(element) {\n\t\t\n\t\tcontent += '<div id=\"p'+element['id']+'\" > ';\n\t\tif (null != leaveOfAbsence) {\n\t\tcontent += '<a href=\"#\" onClick=\"leaveOfAbsenceNotice('+element['id']+')\" class=\"navigation waves-effect waves-light teal-text\">';\n\t\t} else {\n\t\tcontent += '<a href=\"#\" onClick=\"absentNotice('+element['id']+')\" class=\"navigation waves-effect waves-light teal-text\">';\n\t\t}\n\t\tcontent += element['name']+', ' \n\t\t+ element['vorname'] + '( '\n\t\t+ element['klasse'] \n\t\t+')</a></div>'\n\t\t//+'<div id=\"'+element['name']+'\"></div></div>';\n\t\t\n\t\tx++;\n\t\t});\t\n\treturn content;\n}", "function forVistaProductos(){\n\tvar txt= '<div class=\"div-center\"><div class=\"content\"><div id=\"head>\"<img src=\"img/logo1.png\" alt=\"logo\" id=\"imgLogin\"><h2>PLATOS</h2><hr /></div>';\n\ttxt +='<div id=\"asignar\"><table class=\"table table-bordered table-light\" ><thead><tr class=\"table-active\"><th scope=\"col\">Producto</th>';\n\ttxt +='<th scope=\"col\">Precio</th><th scope=\"col\"></th></tr></thead><tbody><tr><th scope=\"row\">Arroz con pollo</th><td>$8000</td><td>';\n\ttxt +='<button onClick=\"mostrarConfirmacionPedido()\" class=\"btn btn-info\"><span class=\"glyphicon glyphicon-eye-open\"></span></button></td></tr><tr><th scope=\"row\">Bandeja Paisa</th>';\n\ttxt +='<td>$10000</td><td><button class=\"btn btn-info\"><span class=\"glyphicon glyphicon-eye-open\"></span></button></td></tr><tr><th scope=\"row\">Churrasco</th>';\n\ttxt +='<td>$14000</td><td><button class=\"btn btn-info\"><span class=\"glyphicon glyphicon-eye-open\"></span></button></td></tr></tbody>';\n\ttxt +='</table></div><hr /><div id=\"campoBtn\"><button class=\"btn btn-info pull-left\" onClick=\"regresar()\" id=\"btnRegreso\"><span class=\"glyphicon glyphicon-chevron-left\"></span></button>';\n\ttxt +='</div></div></div>';\n\t\treturn txt;\n}", "function showCijferusa(){\r\n document.getElementById(\"cijfer4\").innerHTML = cijfers[3];\r\n document.getElementById(\"punt4\").style.display = \"block\";\r\n}", "function mostrarXsumir(valor){\n // Dentista-Tratamento\n document.formFuncionario.croTratamento.value = \"\";\n document.formFuncionario.especialidadeTratamento.value = \"\";\n document.formFuncionario.comissaoTratamento.value = \"\";\n // Dentista-Orcamento\n document.formFuncionario.croOrcamento.value = \"\";\n document.formFuncionario.especialidadeOrcamento.value = \"\";\n document.formFuncionario.comissaoOrcamento.value = \"\";\n // Dentista-Orcamento-Tratamento\n document.formFuncionario.croOrcamentoTratamento.value = \"\";\n document.formFuncionario.especialidadeOrcamentoTratamento.value = \"\";\n document.formFuncionario.comissaoOrcamentoTratamento.value = \"\";\n document.formFuncionario.comissaoTratamentoOrcamento.value = \"\";\n if (valor == 'Dentista-Tratamento') {\n var abreDiv = document.getElementById('infoAddDentistaOrcamento');\n abreDiv.style.display = 'none';\n var abreDiv2 = document.getElementById('infoAddDentistaTratamento');\n abreDiv2.style.display = 'block';\n var abreDiv3 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv3.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = true;\n }\n else {\n if (valor == 'Dentista-Orcamento') {\n var abreDiv4 = document.getElementById('infoAddDentistaTratamento');\n abreDiv4.style.display = 'none';\n var abreDiv5 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv5.style.display = 'block';\n var abreDiv6 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv6.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = true;\n }\n else {\n if (valor == 'Dentista-Orcamento-Tratamento') {\n var abreDiv7 = document.getElementById('infoAddDentistaTratamento');\n abreDiv7.style.display = 'none';\n var abreDiv8 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv8.style.display = 'none';\n var abreDiv9 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv9.style.display = 'block';\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = false;\n }\n else {\n var abreDiv10 = document.getElementById('infoAddDentistaTratamento');\n abreDiv10.style.display = 'none';\n var abreDiv11 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv11.style.display = 'none';\n var abreDiv12 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv12.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = true;\n }\n }\n }\n}", "function showCargaAcademicainfoAcademicaDefectoAno(id){ \n alerta_principal=$(\"#alerta_principal\");\n alerta_principal.html(\"Cargando Detalles de Carga Academica...........\");\n alerta_principal.show();\n $.get(entorno+\"cargaAcademica/\"+id+\"/show\",function(data){\n $(\"#tab5-0\").html(data); \n alerta_principal.html(\"Listo\");alerta_principal.hide(5000);\n \n }); \n}", "function valida_test1(preguntas, test, divresultado ){\n let respuestas = validarRespuestas (preguntas,test,false);\n let mostrar = \"\";\n let mensaje =\"\";\n if (respuestas){\n let suma = 0;\n //sumar \n for(i in respuestas ) suma += (parseInt(i)) * (parseInt(respuestas[i]));\n \n let sumaX2 = suma *2;\n mostrar = \"<p> Porcentaje total %: \"+suma+\"</p>\" +\n \"<p> Puntaje total multiplicado por 2: \"+sumaX2+\"</p>\";\n mensaje = \"Suma: \";\n }\n\n mostrarResultado(mostrar, divresultado, mensaje);\n}", "function Ejercicio5() {\n var ancho = parseInt($('#txtancho').val());\n var alto = parseInt($('#txtalto').val());\n var resultado = 0;\n \n resultado=CalcularAreaRetangulo(ancho,alto);\n \n $('#divEje5Area').html(resultado);\n}", "function afficherTotal(prixTotal){\n document.getElementById(\"divTotalPanier\").innerHTML = prixTotal;\n}", "function displayCaddie() {\n let list = \"\";\n\n for (let i = 0; i < productsList.length; i++) {\n // Récupère le produit à l'indice i\n const product = productsList[i];\n\n // si élément actuel ajouté au panier\n // alors on ajoute \"X code\" à la variable list\n\n if(product.total > 0 ){\n list = list + product.total + \" \";\n list = list + product.name + \", \";\n\n }\n\n }\n\n // Parcours tous les éléments du panier\n document.getElementById(\"resultat\").innerHTML = list;\n\n}", "function buscadisponibilidad()\n{\n var data = new Array(7);\n divhoradisponible = document.getElementById(\"divhoradisponible\");\n str_medico = document.getElementsByName(\"str_medico\")[0].value;\n str_especialista = document.getElementsByName(\"str_especialista\")[0].value;\n str_nom_agenda = document.getElementsByName(\"str_nom_agenda\")[0].value;\n\n //*******************BUSCO EL DIA DE LA SEMANA A LA PERTENECE LA FECHA SELECCIONADA***********\n var f = new Date();\n var hoy = f.getDay();\n //***PARA ASIGNAR EL DIA DOMINGO***\n if (hoy==0){hoy = 7;}\n //*********************************\n var dia = f.getDate();\n var mes = f.getMonth()+1;\n var ano = f.getFullYear();\n var fecactual = ano+\"-\"+mes+\"-\"+dia;\n //*******************ASIGNAR AL ARRAY DE DATOS************************************************\n data[0] = str_nom_agenda;\n data[1] = str_medico;\n data[2] = str_especialista;\n data[3] = hoy;\n data[4] = fecactual;\n\n //*******************ACTIVAR LOS BOTONES*****************************************************\n $('#reserva').attr(\"disabled\", false);\n $('#masreservas').attr(\"disabled\", false);\n //*******************ENVÍO CON JQUERY LA INFORMACION******************************************\n $.ajax({\n url: '../disponibilidad',\n type: 'POST',\n data: {data: data},\n dataType: 'html',\n beforeSend: function () {\n //alert('Procesando...');\n },\n error:function( jqXHR, textStatus, errorThrown ) {\n alert( errorThrown ); \n //alert(\"Ha ocurrido un error\");\n },\n success: function (respuesta) {\n $('#divhoradisponible').html(respuesta);\n }\n });\n}", "function mostraErrosExistentes() {\n\t$(\".campoErro\").each(function(i) { \n\t\terrosExistentes++;\n\t});\n\n\tvar contador = document.getElementById(\"numeroDeErrosExistentes\"); //Procura o local onde colocar a quantidade de erros\n\tcontador.innerHTML = \"<font>\"+errosExistentes+\"</font>\" // adiciona a quantidade de erros existentes ao carregar a pagina\n}", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function itemsQuantity(lugar_id){\r\n let id = lugar_id\r\n let all_mobi_html = ''\r\n\r\n $.ajax({\r\n url: '/cant_items',\r\n method: 'get',\r\n data: {id: id},\r\n dataType: 'json',\r\n success: function(data){\r\n if(data.pc_cant != 0){\r\n all_mobi_html += `<div class=\"col\">\r\n <p class=\"text-success text-justify\">Computadoras Totales</p>\r\n <p class=\"text-justify\">`+data.pc_cant+`</p>\r\n </div>`\r\n }\r\n if(data.mesa_cant != 0){\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Mesas Totales</p>\r\n <p class=\"text-justify\">`+data.mesa_cant+`</p>\r\n </div>`\r\n }\r\n if (data.silla_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Sillas Totales</p>\r\n <p class=\"text-justify\">`+data.silla_cant+`</p>\r\n </div>`\r\n }\r\n if (data.piz_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Pizarrones Totales</p>\r\n <p class=\"text-justify\">`+data.piz_cant+`</p>\r\n </div>`\r\n\r\n }\r\n if (data.television_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Televisiones Totales</p>\r\n <p class=\"text-justify\">`+data.television_cant+`</p>\r\n </div>`\r\n }\r\n if (data.termostato_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Termostatos Totales</p>\r\n <p class=\"text-justify\">`+data.termostato_cant+`</p>\r\n </div>`\r\n }\r\n if (data.ruteador_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Ruteadores Totales</p>\r\n <p class=\"text-justify\">`+data.ruteador_cant+`</p>\r\n </div>`\r\n }\r\n if (data.swith_cant != 0) {\r\n all_mobi_html += `<div class=\"col text-justify\">\r\n <p class=\"text-success text-justify\">Switches Totales</p>\r\n <p class=\"text-justify\">`+data.swith_cant+`</p>\r\n </div>`\r\n }\r\n $(\"#cant_mobi_all\").html(all_mobi_html)\r\n $(\"#titleDetailsMobi\").text('Cantidades en ')\r\n $(\"#itemsCantModal\").modal('show')\r\n }\r\n })\r\n}", "function afficherDetailsPays(donnee, selection, identifiantPays){\n var detailsPaysHtml = ' ';\n detailsPaysHtml += ' <input type=\"hidden\" class=\"val\" value=\"'+identifiantPays+'\" /> <h2 class=\"titre\" > '+ donnee[donnee.length-1].location +' </h2> ' ;\n detailsPaysHtml += '<tr > <td> Date Dernière Donnée </td> <span class=\"date\"> <td> '+ donnee[donnee.length-1].date +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> Population </td> <span class=\"population\"> <td> '+ donnee[donnee.length-1].population +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> Densité Population </td> <span class=\"population_density\"> <td> '+ donnee[donnee.length-1].population_density +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> PIB / Habitant </td> <span class=\"gdp_per_capita\"> <td> '+ donnee[donnee.length-1].gdp_per_capita +' </td> </span> </tr> <br> <br>' ;\n\n detailsPaysHtml += '<tr> <td> Nombre de Cas totale </td> <span class=\"total_cases\"> <td> '+ donnee[donnee.length-1].total_cases +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> % Population + 65ans </td> <span class=\"aged_65_older\"> <td> '+ donnee[donnee.length-1].aged_65_older +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> Totale de mort </td> <td > <span class=\"mort\"><td> '+ donnee[donnee.length-1].total_deaths +' </td> </span> </tr> <br>' ;\n detailsPaysHtml += '<tr> <td> Nombre mort par million </td> <span class=\"new_deaths_per_million\"> <td> '+ donnee[donnee.length-1].new_deaths_per_million +' </td> </span> </tr> <br> ' ;\n detailsPaysHtml += '<tr> <td> Nombre de lit Hopital / 1000 Per </td> <span class=\"hospital_beds_per_thousand\"> <td> '+ donnee[donnee.length-1].hospital_beds_per_thousand +' </td> </span> </tr> <br> ' ;\n\n $('#presentation'+selection).html(detailsPaysHtml);\n comparator()\n }", "function displayAdditionalInfo(){\r\n var container = _.findWhere(matchingContainers, {'Container': selectedContaier});\r\n var html = '';\r\n\r\n if(container) {\r\n $('#results-dwell-time tbody').empty();\r\n $('#results-movements tbody').empty();\r\n\r\n $additionalInfoContainer.fadeOut('fast', function(){\r\n var dwell = container.DwellTime;\r\n if(dwell) {\r\n html =\r\n '<tr>' +\r\n '<td>' + dwell.Container + '</td>' +\r\n '<td>' + dwell.DischargeDate + '</td>' +\r\n '<td>' + dwell.RampDate + '</td>' +\r\n '<td>' + dwell.DepartureDate + '</td>' +\r\n '<td>' + dwell.TermDwell + '</td>' +\r\n '<td>' + dwell.RailDwell + '</td>' +\r\n '<td>' + (dwell.TermDwell + dwell.RailDwell) + '</td>' +\r\n '</tr>';\r\n\r\n $('#results-dwell-time tbody').append(html);\r\n }\r\n\r\n var movements = container.Movements;\r\n if(movements) {\r\n html = '';\r\n\r\n _.each(movements, function(movement){\r\n html +=\r\n '<tr>' +\r\n '<td>' + movement.Container + '</td>' +\r\n '<td>' + movement.From + '</td>' +\r\n '<td>' + movement.DepartureDate + '</td>' +\r\n '<td>' + movement.To + '</td>' +\r\n '<td>' + movement.ArrivalDate + '</td>' +\r\n '<td>' + movement.Car + '</td>' +\r\n '<td>' + movement.Train + '</td>' +\r\n '</tr>';\r\n });\r\n\r\n $('#results-movements tbody').append(html);\r\n }\r\n\r\n $additionalInfoContainer.fadeIn('fast');\r\n });\r\n }\r\n }", "function voltarEtapa5() {\n \n msgTratamentoEtapa6.innerHTML = \"\";\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"5º Etapa - Valores Adicionais & Desconto\";\n\n document.getElementById('inserirValorAdicional').style.display = ''; //habilita a etapa 5\n document.getElementById('inserirDespesas').style.display = 'none'; //desabilita a etapa 6\n }", "function mostrar(estudiante) {\n // TO DO: Completar el template para que muestre las propiedades correctas del estudiante\n var resultado = \"\";\n resultado += \"<div class='row'>\";\n resultado += \"<div class='col m12'>\";\n resultado += \"<div class='card blue-grey darken-1'>\";\n resultado += \"<div class='card-content white-text'>\";\n resultado += \"<p><strong>Nombre:</strong> \" + estudiante.nombre + \"</p>\";\n resultado += \"<p><strong>Puntos Técnicos:</strong> \" + estudiante.portec + \"</p>\";\n resultado += \"<p><strong>Puntos HSE:</strong> \" + estudiante.porHSE + \"</p>\";\n resultado += \"</div>\";\n resultado += \"</div>\";\n resultado += \"</div>\";\n resultado += \"</div>\";\n return resultado;\n}", "function gestionBouton(){\n let boutonAjouter = document.getElementsByClassName(\"bouton-achat\");\n for(let i = 0; boutonAjouter.length > i; i++){\n boutonAjouter[i].addEventListener(\"click\", ajoutAuPanierInfo);\n };\n function ajoutAuPanierInfo (event) {\n let élement = event.target.parentElement.parentElement.parentElement.parentElement.parentElement;\n let élémentImg = élement.getElementsByClassName(\"élémentImg\")[0].src;\n let élémentNom = élement.getElementsByClassName(\"élémentNom\")[0].innerText;\n let élémentPrix = élement.getElementsByClassName(\"élémentPrix\")[0].innerText;\n ajoutAuPanier(élémentImg, élémentNom, élémentPrix); \n nombre ++;\n nombreAchat.innerHTML = nombre;\n total += Number(élémentPrix);\n totalAchat.innerHTML = Math.floor(total*100)/100;\n tatol += Number(élémentPrix);\n tatolAchat.innerHTML = Math.floor(tatol*100)/100;\n\n\n\n function ajoutAuPanier(élémentImg, élémentNom, élémentPrix){\n let liste = document.getElementById(\"liste-achat\");\n let élémentDuPanier = document.createElement('div');\n élémentDuPanier.innerHTML = `\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-3\"><img src=\"${élémentImg}\" alt=\"\" class=\"img-fluid rounded-circle élémentImg\" style=\"width: 100%;\"></div>\n <div class=\"col-3\"><p class=\"élémentNom\">${élémentNom}</p></div>\n <div class=\"col-3\"><p class=\"élémentPrix\">${élémentPrix}</p></div>\n <div class=\"col-3\"><button class=\"btn btn-outline-danger boutonRetirer\"><i class=\"fas fa-trash fa-2\"></i></button></div>\n </div>\n </div>`\n liste.appendChild(élémentDuPanier); \n alert(\"Eléments ajouter au panier\");\n élémentDuPanier.getElementsByClassName(\"boutonRetirer\")[0].addEventListener(\"click\", boutonRetirerF);\n }\n\n\n function boutonRetirerF (){\n let boutonRetirer = document.getElementsByClassName(\"boutonRetirer\");\n for (let i = 0; boutonRetirer.length > i; i++){\n boutonRetirer[i].addEventListener(\"click\", retirerUnElément); \n };\n function retirerUnElément (event) {\n event.target.parentElement.parentElement.parentElement.remove();\n nombre --;\n nombreAchat.innerHTML = nombre;\n total -= Number(élémentPrix);\n totalAchat.innerHTML = Math.floor(total*100)/100;\n tatol -= Number(élémentPrix);\n tatolAchat.innerHTML = Math.floor(tatol*100)/100;\n };\n \n };\n };\n}", "function info(id){\n\tif(id == \"\"){\n\t\twindow.alert(\"Insira ID\");\n\t\treturn;\n\t}\n\n\tlet xhttp = new XMLHttpRequest();\n\tlet url = ENDERECO + ROTA_CONSULTA + \"?id=\" + id;\n\n\txhttp.open(\"GET\", url, true);\n\txhttp.withCredentials = true;\n\txhttp.onreadystatechange = function() {\n\t\tif(xhttp.readyState === xhttp.DONE) {\n\t\t\tvar xml = (new DOMParser()).parseFromString(this.responseText, \"application/xml\");\n\t\t\tvar raiz = xml.firstElementChild;\n\t\t\tif(xhttp.status === 200) {\n\t\t\t\tvar elementos = raiz.children;\n\t\t\t\tlet informacoes = document.getElementById(\"informacoes\");\n\t\t\t\tinformacoes.innerHTML = \"\";\n\t\t\t\tfor(let i = 0; i < elementos.length; i++) {\n\t\t\t\t\tvar dados = elementos[i].children;\n\t\t\t\t\tinformacoes.innerHTML +=\"<label class=\\\"primary-text text-lighten-1 short col s12 m6\\\"> SIAPE: <input type=\\\"number\\\" name=\\\"id\\\" disabled value=\\\"\" + dados[0].textContent + \"\\\"></label>\";\n\t\t\t\t\tinformacoes.innerHTML += \"<label class=\\\"primary-text text-lighten-1 short col s12 m6\\\">Nome: <input type=\\\"text\\\" name=\\\"nome\\\" disabled value=\\\"\" + dados[2].textContent + \"\\\"></label>\";\n\t\t\t\t\tinformacoes.innerHTML += \"<label class=\\\"primary-text text-lighten-1 short col s12 m3\\\">Id-Depto: <input type=\\\"number\\\" name=\\\"id-depto\\\" disabled value=\\\"\" + dados[1].textContent + \"\\\"></label>\";\n\t\t\t\t\tinformacoes.innerHTML += \"<label class=\\\"primary-text text-lighten-1 short col s12 m6\\\">E-mail: <input type=\\\"text\\\" name=\\\"email\\\" disabled value=\\\"\" + dados[3].textContent + \"\\\"></label>\";\n\t\t\t\t\tinformacoes.innerHTML += \"<label class=\\\"primary-text text-lighten-1 short col s12 m3\\\">Titulação:<input type=\\\"text\\\" name=\\\"titulacao\\\" disabled value=\\\"\" + dados[4].textContent + \"\\\"></label>\";\n\t\t\t\t}\n\t\t\t} else if(xhttp.status == 404) {\n\t\t\t\tdocument.getElementsByTagName(\"p\")[0].innerHTML = (\"Servidor offline\");\n\t\t\t} else {\n\t\t\t\tdocument.getElementsByTagName(\"p\")[0].innerHTML = (raiz.firstElementChild.textContent);\n\t\t\t}\n\t\t}\n\t};\n\txhttp.send();\n}", "function pelis(){\n var url = 'http://hbflix.tk//api/verPelis';\n $.ajax({\n type: \"GET\",\n url:url,\n dataType: 'json',\n timeout: 5000,\n }).done(function( data, textStatus, jqXHR ) {//data van los datos\n if ( console && console.log ) {\n\n //Estrenos\n \tdocument.getElementById(\"estrenos1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n //Favoritos\n document.getElementById(\"fav1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n //Favoritos2\n document.getElementById(\"fav5\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][4][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][4][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][4][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav6\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][5][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][5][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][5][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav7\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][6][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][6][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][6][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav8\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][7][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][7][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][7][\"aLanzamiento\"]+\"</span></div></div>\";\n //Ultimas agregadas\n document.getElementById(\"ult1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n \n }\n }).fail(function( jqXHR, textStatus, errorThrown) {\n if ( console && console.log ) {\n console.log( \"La solicitud a fallado: partidas \" + textStatus);favoritos}\n });\n}", "function listarCargos_processResponse(res) {\n\n try {\n var info = eval('(' + res + ')');\n var divTerceros = document.getElementById('divListadoCargos');\n if (res != '0') {\n var datosRows = info.data;\n var l = info.cols;\n var ctl = true, claseAplicar = \"\", claseAplicar1 = \"\", claseAplicar2 = \"\";\n\n var id = \"\";\n var nombre = \"\";\n var descripcion = \"\";\n var area = \"\";\n\n var tabla = \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan='5'>CARGOS EXISTENTES</td></tr>\";\n tabla += \"<tr><td class='encabezado' colspan='2'>NOMBRE</td><td class='encabezado'>DETALLE</td><td class='encabezado'>EDITAR</td><td class='encabezado'>ELIMINAR</td></tr>\";\n\n for (var i = 0; i < datosRows.length; i += l) {\n id = datosRows[i]\n nombre = datosRows[i + 1];\n descripcion = datosRows[i + 2];\n area = datosRows[i + 3];\n nombreArea = datosRows[i + 4];\n\n if (ctl) {\n claseAplicar = \"cuerpoListado9\";\n claseAplicar2 = \"cuerpoListado3\";\n } else {\n claseAplicar = \"cuerpoListado10\";\n claseAplicar2 = \"cuerpoListado5\";\n }\n\n ctl = !ctl;\n tabla += '<tr><td colspan=\"2\" class=\"' + claseAplicar + '\" align=\"center\">' + unescape(nombre).toUpperCase() + '</td>';\n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgDetalle\" class=\"linkIconoLateral botonDetalle\" onclick=\"detalle( \\'' + nombre.toUpperCase() + '\\',\\'' + descripcion.toUpperCase() + '\\',\\'' + nombreArea.toUpperCase() + '\\' )\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/listar.png\"><p>Detalle</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEditar\" class=\"linkIconoLateral botonEditar\" onclick=\"editarCargo( \\'' + id + '\\',\\'' + nombre.toUpperCase() + '\\',\\'' + descripcion.toUpperCase() + '\\',\\'' + area + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/editar_24x24.png\"><p>Editar</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEliminar\" class=\"linkIconoLateral botonEliminar\" onclick=\"eliminarCargo(\\'' + id + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/eliminar_24x24.png\"><p>Eliminar</p></div></td></tr>';\n }\n tabla += '</table>'\n divTerceros.innerHTML = tabla;\n divTerceros.innerHTML += pieDePaginaListar(info, 'listarCargos');\n var idMenuForm = document.getElementById('idMenuForm').innerHTML; // se adiciona esta linea para que se de el permiso de visualizar el editar despues de cargar\n permisosParaMenu(idMenuForm); // se adiciona esta linea para que se el permiso de visualizar el editar despues de cargar\n } else {\n divTerceros.innerHTML = mensajecero;\n }\n } catch (elError) {\n }\n $.fancybox.close();\n}", "function informationen() {\r\n\tvar eingabe = document.getElementsByTagName('input')[0].value;\r\n\tvar eingabe2 = document.getElementsByTagName('input')[1].value;\r\n\tvar monat = document.getElementsByName('Monat')[0].value;\r\n\tvar tag = document.getElementsByName('Tag')[0].value;\r\n\tvar jahr = document.getElementsByName('Jahr')[0].value;\r\n\tvar anschrift = document.getElementsByTagName('input')[2].value;\r\n\tvar hausnummer = document.getElementsByTagName('input')[3].value;\r\n\tvar postempfaenger = document.getElementsByTagName('input')[4].value;\r\n\tvar postleitzahl = document.getElementsByTagName('input')[5].value;\r\n\tvar ort = document.getElementsByTagName('input')[6].value;\r\n\tvar bezirk = document.getElementsByTagName('input')[7].value;\r\n\talert(\"Erfolg. Sie können alle informationen unten sehen.\");\r\n\t\r\n\t/*document.getElementById('ausgabe').innerHTML = \"Hallo, \" + eingabe +\" \" + eingabe2 + \". <br />Der Geburtstag ist: \" + tag + \"-\" + monat + \"-\" + jahr + \"<br />\" + \r\n\t\t\t\t\t\t\t\t\t\t\t\t \"Ihre Adresse <br /> Anschrift: \" + anschrift + \" Hausnummer: \" + hausnummer + \" Postempfaenger: \" + postempfaenger + \" Postleitzahl: \" + postleitzahl + \" Ort: \" + ort + \" Bezirk: \" + bezirk;*/\r\n\t/* Jetzt kommt alle information in eine liste*/\t\t\t\t\t\t\t\t\t\t\t\t\r\n\tdocument.getElementById('collapse1').innerHTML = '<div class=\"panel-body\">' + eingabe + ' ' + eingabe2 + '</div>';\r\n\tdocument.getElementById('collapse2').innerHTML = '<div class=\"panel-body\">' + tag + '/' + monat + '/' + jahr + '</div>';\r\n\tdocument.getElementById('collapse3').innerHTML = '<div class=\"panel-body\">' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<ul class=\"list-group\">' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Anschrift: ' + anschrift + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Hausnummer: ' + hausnummer + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Postempfaenger: ' + postempfaenger + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Postleitzahl: ' + postleitzahl + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Ort: ' + ort + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '<li class=\"list-group-item\">Bezirk: ' + bezirk + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</ul>' +\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t '</div>';\r\n\t\r\n}", "function displayData(data) {\n \n container.innerHTML = '';\n\n data.forEach(function (fact) {\n container.innerHTML += `<div class=\"product\"><div class=\"row\"><div class=\"col-sm-8\"><h3>Title: ${fact.title}</h3>\n <img src=\"${fact.image_url}\" ><p>Price: ${fact.price}</p>\n </div></div>\n </div>`;\n });\n}", "function atualizaPlacar(){\n var divPlacar = document.getElementById('placar')\n var html = \"Jogador \" + pontosJogador + \"/\" + pontosMaquina + \" Máquina\" \n divPlacar.innerHTML = html\n }", "function showResults(responseJson)\r\n{\t\r\n\t$(\"#result\").empty();\r\n\t\r\n\tvar contElement = 0;\r\n\t\r\n\t$.each(responseJson, function(i, element){\r\n\t\tvar locandina = element.locandina;\r\n\t\tvar titolo = element.titolo;\r\n\t\tvar durata = element.durata;\r\n\t\tvar anno = element.anno;\r\n\t\tvar genere = element.genere;\r\n\t\tvar id = element.id_serieTV;\r\n\t\t\r\n\t\t\r\n\t\tvar html = '<div class=\"content col-lg-4 col-md-6 mb-4\">';\r\n\t\thtml += '<div class=\"card h-100\">';\r\n\t\thtml += '<a href=\"ottieniStagioni?id_serie='+id+'\" class=\"imageContent\">';\r\n\t\thtml += '<img id=\"imgCardSerieTV\" class=\"card-img-top\" src=\"images/'+locandina+'\" alt=\"\">';\r\n\t\thtml += '</a>';\r\n\t\thtml += '<div class=\"card-body\">';\r\n\t\thtml += '<h4 id=\"cardTitleSerieTV\" class=\"card-title jumbotron\">';\r\n\t\thtml += '<a class=\"searchTitleHere\" href=\"ottieniStagioni?id_serie='+id+'\">'+titolo+'</a>';\r\n\t\thtml += '</h4>';\r\n\t\thtml += '</div>';\r\n\t\thtml += '<div class=\"card-footer\">';\r\n\t\thtml += '<div class=\"row\">';\r\n\t\thtml += '<div id=\"yearSerieTV\" class=\"col-sm-6\">'+anno+'</div>';\r\n\t\thtml += '<div id=\"genderSerieTV\" class=\"col-sm-6\">'+genere+'</div>';\t\t\r\n\t\thtml += '</div>';\r\n\t\thtml += '</div>';\r\n\t\thtml += '</div>';\r\n\t\thtml += '</div>';\r\n\t\t\r\n\t\t$(\"#result\").append(html);\r\n\t\t\r\n\t\tcontElement++;\t\t\t\r\n\t\t\r\n\t});\r\n\t\r\n\tif(contElement==0)\r\n\t{\r\n\t\t$(\"#result\").append('<h1 id=\"risultatoRicercaText\">Nessun risultato trovato!</h1>');\r\n\t\t$(\"#idPages\").hide();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// Distruggo vecchia pagination\r\n\t\t$(\"#idPages\").empty();\r\n\t\t$(\"#idPages\").append('<ul id=\"ul\" class=\"pagination\">');\r\n\t\t\r\n\t\t// Nuova pagination\r\n\t\tshowPages();\r\n\t\t$(\"#idPages\").show();\r\n\t}\r\n}", "function mostrarListadoSaldoConductor(){\n ocultarFormularios();\n \n let sListado = oDGT.listadoSaldoConductor();\n \n document.getElementById(\"areaListado\").innerHTML= sListado;\n document.getElementById(\"titulo\").innerHTML= \"Listado de conductores con saldo pendiente\";\n}", "function botaoMostrarEventosAnteriores() {\n\t$('.botaoEventosAnteriores').css(\"display\", \"block\");\n}", "function displayOrdersAdmin(numTable){\r\n\r\n $(\"#all-orders\").css(\"display\", \"block\");\r\n \r\n $.post(\"admin_query.php?order-tables-admin\",{numTable:numTable}, function(response)\r\n {\r\n let obj=JSON.parse(response);\r\n let total=0;\r\n if(obj.data)\r\n { \r\n let n=0;\r\n let list=\"\";\r\n for(el of obj.data)\r\n {\r\n let op1=el.order_price;\r\n let op2=el.order_quantity;\r\n let results= op1 * op2 ;\r\n\r\n total+=results;\r\n\r\n n++\r\n\r\n list+=\"<input type='text' class='list' value='\"+n+\": \"+el.order_item+\"' disabled><input type='text' class='list' value='\"+el.order_price+\" дин.' disabled><input type='text' class='list' value='\"+el.order_quantity+\" ком.' disabled><input type='text' class='list' data-results='calculate' value='\"+results+\" дин.' disabled ><input type='text' class='list' value='\"+el.employee_name+\" (Име запосленог)'disabled><input type='text' class='list' value='\"+el.section_name+\"' disabled><input type='text' class='list' value='\"+el.order_time+\" (време)' disabled><br>\";\r\n\r\n $(\"#all-orders\").html(list);\r\n } \r\n } \r\n $(\"#total-amount-admin\").html(\"Укупна зарада за овај сто износи: \"+total+ \" дин\").css(\"padding\",\"40px\").css(\"display\",\"block\"); \r\n }); \r\n}", "function showCijfercom(){\r\n document.getElementById(\"cijfer5\").innerHTML = cijfers[4];\r\n document.getElementById(\"punt5\").style.display = \"block\";\r\n document.getElementById(\"punt5\").style.display = \"block\";\r\n}", "function Calci() {\n\n\n var outerDiv = document.createElement(\"DIV\");\n outerDiv.className = \"box\";\n\n outerDiv.appendChild(model.result);\n\n var numberDiv = new numberTable(); //new number pad is created \n outerDiv.appendChild(numberDiv); // number pad is appended to the outer Div\n\n var operatorDiv = new operatorsTable();\n outerDiv.appendChild(operatorDiv);\n\n\n document.body.appendChild(outerDiv);\n\n\n }", "function mostrarDIVS(){\n\tvar opcioDiv = document.forms[\"addProduction\"][\"tipo\"];\n\tvar divM = document.getElementById(\"divMovie\");\n\tvar divS = document.getElementById(\"divSerie\");\n\tif (opcioDiv.value == \"0\") {\n\t\tdivM.style.display = \"none\";\n\t\tdivS.style.display = \"none\";\n\t}else if(opcioDiv.value == \"Movie\"){\n\t\tdivM.style.display = \"block\";\n\t\tdivS.style.display = \"none\";\n\t}else{\n\t\tdivM.style.display = \"none\";\n\t\tdivS.style.display = \"block\";\n\t}//Fin del if\n}//Fin de mostrarDIVS", "function getJugadoresVendidos(text) {\r\n\t\t\tvar pujaspos = text.indexOf(\"Ofertas para ti:\");\r\n\t\t\t//var table1pos = text.indexOf(\"<table\");\r\n\t\t\tvar table2pos = text.indexOf(\"<table\", pujaspos);\r\n\t\t\tvar tablaPujasHTML = text.substring(table2pos, text.indexOf(\"</table\", table2pos));\r\n\t\t\t//alert(tablaPujasHTML);\r\n\t\t\tvar divPujas = document.createElement(\"div\");\r\n\t\t\tdivPujas.id=\"divVentas\";\r\n\t\t\tdivPujas.style.display=\"none\";\r\n\t\t\tdivPujas.innerHTML = tablaPujasHTML;\r\n\t\t\tvar trsPujas = divPujas.getElementsByTagName(\"tr\");\r\n\t\t\tfor (var i = 0; i < trsPujas.length; i++) {\r\n\t\t\t\tvar tdsPujas = trsPujas[i].getElementsByTagName(\"td\");\r\n\t\t\t\tif (tdsPujas[tdsPujas.length - 1].innerHTML == \"Aceptada\") {\r\n\t\t\t\t\t\r\n\t\t\t\t\tplayerNameColNoScript = 0;\r\n\t\t\t\t\t//erpichi 20111125 - Intentando arreglar nombres raros en vender jugadores\r\n\t\t\t\t\tvar nombreJugadorComprado = trim(tdsPujas[playerNameColNoScript].textContent).replace(/\"/g, \"quot\").replace( /\\ /g, \"_\" );\r\n\t\t\t\t\t//var nombreJugadorComprado = tdsPujas[playerNameColNoScript].textContent.replace(/\"/g, \"&quot;\").replace( /\\ /g, \"_\" );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (document.getElementById(\"vendido\") != null\r\n\t\t\t\t\t\t\t&& document.getElementById(\"vendidoNames\") != null\r\n\t\t\t\t\t\t\t&& document.getElementById(\"vendidoNames\").value.indexOf(\"//\" + nombreJugadorComprado+ \"//\") == -1) {\r\n\t\t\t\t\t\tvar vendidoTotal = parseInt(replaceAll(document.getElementById('vendido').value, \".\", \"\").replace(' €', ''),10);\r\n\t\t\t\t\t\tvar vendidoTD = parseInt(replaceAll(tdsPujas[precioVentaCol].innerHTML, \".\", \"\"),10);\r\n\t\t\t\t\t\tdocument.getElementById('vendido').value = vendidoTotal + vendidoTD;\r\n\t\t\t\t\t\tdocument.getElementById(\"vendidoNames\").value += \"//\" + nombreJugadorComprado+ \"//\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (text.indexOf('title=\"Siguiente\"', pujaspos) != -1) {\r\n\t\t\t\tvar botonSiguientePujasPos = text.indexOf('title=\"Siguiente\"', pujaspos);\r\n\t\t\t\t//erpichi 20111125 - En chrome buscar el href del siguiente bien\r\n\t\t\t\twhile (text.charAt(--botonSiguientePujasPos) != \"<\");\r\n\t\t\t\t\r\n\t\t\t\tvar hrefSiguientePujaPos = text.indexOf('href=', botonSiguientePujasPos) + 'href=\"'.length;\r\n\t\t\t\tvar hrefSiguientePujaPosFin = text.indexOf('\"', hrefSiguientePujaPos);\r\n\t\t\t\tvar hrefSiguientePuja = text.substring(hrefSiguientePujaPos, hrefSiguientePujaPosFin);\r\n\t\t\t\threfSiguientePuja = replaceAll(hrefSiguientePuja, \"&amp;\", \"&\");\r\n\t\t\t\tvar comunio = \"\";\r\n\t\t\t\tif (window.location.href.indexOf(\"https://\") != -1) {\r\n\t\t\t\t\tcomunio = window.location.href.substring(0, window.location.href.indexOf(\"/\",\"https://\".length));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcomunio = window.location.href.substring(0, window.location.href.indexOf(\"/\",\"http://\".length));\r\n\t\t\t\t}\r\n\t\t\t\tjQuery.get( comunio + \"/\" + hrefSiguientePuja, getJugadoresVendidos );\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\trecalcularSaldo();\r\n\t\t\t\tcambiarOnblurInputs();\r\n\r\n\t\t\t\tif(window.location.href.indexOf( \"placeOffers.phtml\") != -1) {\r\n\t\t\t\t\tjQuery.get( window.location.href.replace( \"placeOffers.phtml\", \"\" ) + 'exchangemarket.phtml?viewoffers_x=22', getJugadoresAbiertos );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function mostrarMarcadores(){\n\t\t// Intenta insertarlos en la lista derecha, si no existe la crea\n\t\tvar ba = find(\"//div[preceding-sibling::div[@class='div4'] and @id='ba']\", XPFirst);\n\t\tif (!ba){\n\t\t\tba = document.createElement(\"DIV\");\n\t\t\tba.setAttribute(\"style\", \"position:absolute; z-index:5; border: 0px solid #000000; left: 700px; top: 100px;\");\n\t\t\tba.setAttribute(\"id\", \"ba\");\n\t\t\tinsertAfter(find(\"//div[@class='div4']\", XPFirst), ba);\n\t\t}\n\t\tvar div = document.createElement(\"DIV\");\n\t\tvar titulo = elem(\"B\", T('MARCADORES') + \":\");\n\t\tvar enlace = elem(\"A\", T('ANYADIR'));\n\t\tvar tabla = document.createElement(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"f10\");\n\t\tdiv.setAttribute(\"id\", \"marcadores\");\n\t\tenlace.href = \"javascript:void(0);\";\n\t\t// Al anyadir se pide el texto y el enlace, si se cancela o se deja vacio alguno se aborta\n\t\t// Despues de insertar se refresca la lista volviendola a insertar\n\t\tenlace.addEventListener(\"click\", function(){ \n\t\t\t\t\t\t\t\tvar a = prompt(T('ENLACE')); \n\t\t\t\t\t\t\t\tif (a == null || a == '') return;\n\t\t\t\t\t\t\t\tvar b = prompt(T('TEXTO'));\n\t\t\t\t\t\t\t\tif (b == null || b == '') return;\n\t\t\t\t\t\t\t\tagregarElementoCookie(\"marcadores\", [b, a]); \n\t\t\t\t\t\t\t\tremoveElement(find(\"//div[@id='marcadores']\", XPFirst));\n\t\t\t\t\t\t\t\tmostrarMarcadores();\n\t\t\t\t\t\t}, 0);\n\t\ttitulo.setAttribute(\"class\",\"f10\");\n\t\tdiv.appendChild(titulo);\n\t\tdiv.appendChild(document.createTextNode(\" (\")); div.appendChild(enlace); div.appendChild(document.createTextNode(\")\"));\n\t\tdiv.appendChild(tabla);\n\t\tba.appendChild(div);\n\n\t\t// Se obtienen los marcadores y se insertan junto con un enlace para eliminarlos\n\t\tvar marcadores = obtenerValorCookie(\"marcadores\");\n\t\tfor (var i = 0; i < marcadores.length; i++){\n\t\t\tvar tr = document.createElement(\"TR\");\n\t\t\tvar td = elem(\"TD\", \"<span>&#8226;</span>&nbsp; <a href='\" + marcadores[i][1] + \"'>\" + marcadores[i][0] + \"</a>\");\n\t\t\tvar enlace = elem(\"A\", \" <img src='\" + img('a/del.gif') + \"' width='12' height='12' border='0' title='\" + T('ELIMINAR') + \"'>\");\n\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\tenlace.addEventListener(\"click\", crearEventoEliminarCookie(\"marcadores\", i, mostrarMarcadores), 0);\n\t\t\ttd.appendChild(enlace);\n\t\t\ttr.appendChild(td);\n\t\t\ttabla.appendChild(tr);\n\t\t}\n\t}", "function mostrarCarritoRecuperado()\n{\n for (const precio of carritoRecuperado)\n {\n precioRecuperado = precio.precio + precioRecuperado;\n }\n $(\"#precioDelCarrito\").text(`Total: $${precioRecuperado}`);\n\n// SI HAY ITEMS EN EL CARRITO, MUESTRA PRODUCTOS\n for (const nombre of carritoRecuperado)\n {\n listaRecuperada.push(nombre.nombre+\"<br>\");\n }\n $(\"#productosEnCarrito\").append(listaRecuperada);\n\n// VUELVO A PUSHEAR LOS ITEMS EN EL CARRITO\n for (const item of carritoRecuperado)\n {\n carrito.push(item);\n }\n\n// ACTUALIZO EL CONTADOR DEL CARRITO\n contadorCarrito();\n\n}", "function quantidadePsicologo() {\n\t\n\t$(\"#psicologos\").load(\"ajax\",{qt_psicologo:$(\"#qt_psicologo\").val()});\n\t\n\t/*se a quantidade de psicologos tiver algum valor, entao aparece o botao para comecar dinamica*/\n\t\n\tif ($(\"#qt_psicologo\").val() != \"\") {\n\t\t\n\t\t$(\"#botao_dinamica\").css(\"display\",\"block\");\n\t}\n\t\n\t/*se a quantidade de psicologos ainda nao foi definida, entao o botao para comecar a dinamica ainda nao aparecera*/\n\t\n\telse {\n\t\t$(\"#botao_dinamica\").css(\"display\",\"none\");\t\n\t}\n}", "function obtenerResultado() {\n return document.getElementById(\"display\").innerHTML;\n}", "mostrarPublicaciones(publiaciones){\n let salida = \"\";\n publiaciones.forEach((publicacion) => {\n salida += `\n <div class=\"card mb-3\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">${publicacion.titulo}</h4>\n <p class=\"card-text\">${publicacion.cuerpo}</p>\n <a href=\"#\" class=\"editar card-link\" data-id=\"${publicacion.id}\">\n <i class=\"fa fa-pencil\"></i>\n </a>\n <a href=\"#\" class=\"borrar card-link\" data-id=\"${publicacion.id}\">\n <i class=\"fa fa-remove\"></i> \n </a>\n </div>\n </div>`\n })\n this.publicacionesUI.innerHTML = salida;\n }", "function esconderDivCadastro(obj){\r\n document.getElementById('conteudo').style.display=\"hidden\";\r\n switch(obj.id){\r\n case 'div':\r\n document.getElementById('conteudo').style.display=\"block\";\r\n document.getElementById('div1').style.display=\"hidden\";\r\n break;\r\n case 'sair':\r\n document.getElementById('conteudo').style.display=\"hidden\";\r\n document.getElementById('div1').style.display=\"block\";\r\n break;\r\n }\r\n }" ]
[ "0.6914211", "0.6438706", "0.63988787", "0.6324239", "0.6297997", "0.62307537", "0.6178018", "0.61089385", "0.61064047", "0.6092528", "0.60772383", "0.6062174", "0.6044518", "0.60284287", "0.6023026", "0.6019397", "0.59932554", "0.5988071", "0.5985599", "0.5985018", "0.59798694", "0.5978423", "0.59721005", "0.59710705", "0.59618", "0.5957242", "0.5956682", "0.5930602", "0.5927221", "0.59254986", "0.59033346", "0.5896714", "0.5893006", "0.589137", "0.58846134", "0.5872759", "0.5872448", "0.5862167", "0.5861304", "0.5834142", "0.5831428", "0.5820948", "0.581562", "0.5813491", "0.58091354", "0.5804956", "0.5804956", "0.58042276", "0.57965916", "0.5791508", "0.5790881", "0.5784429", "0.5782099", "0.5781915", "0.5781685", "0.57650185", "0.57613856", "0.57518053", "0.5750756", "0.57490194", "0.5744596", "0.57408714", "0.57408273", "0.57373524", "0.5736749", "0.5719087", "0.5716533", "0.5714841", "0.5713372", "0.57123625", "0.5711991", "0.5707409", "0.57014495", "0.5700104", "0.56956273", "0.5695394", "0.56894535", "0.56791544", "0.56786674", "0.5678139", "0.5674704", "0.56726557", "0.5672593", "0.56640613", "0.56635875", "0.56625193", "0.5659775", "0.5658949", "0.565758", "0.56519043", "0.5650316", "0.564767", "0.56468934", "0.56466556", "0.5644303", "0.5642259", "0.5640236", "0.5637169", "0.562818", "0.56195295", "0.56189376" ]
0.0
-1
TO DO Valida RG Verificar se tem letras e numeros ou soh numeros e retirar acentos e/ou cedilhas
function validarRg(rg) { if (trim(rg.value) != '') { document.formPaciente.rg.value = retirarAcentos(trim(document.formPaciente.rg.value)).toUpperCase(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validar_rut()\n{\n var rut = document.getElementById('rut_b');\n var digito = document.getElementById('dv_b');\n var numerico = rut.value.search( /[^0-9]/i );\n \n if(rut.value == \"\" && digito.value == \"\")\n return true\n if( numerico != -1 ) {\n alert(\"El rut contiene un caracter no numerico\")\n return false\n }\n if( digito.value == \"\" && rut.value != \"\") {\n alert(\"No ha ingresado el digito verificador\")\n return false\n }\n if( digito.value != \"K\" && digito.value != \"k\" )\n {\n var numerico1 = digito.value.search( /[^0-9]/i );\n if( numerico1 != -1 )\n {\n alert(\"El digito verificador no es valido\")\n return false\n }\n }\n var rut_aux = rut.value;\n var i = 0;\n var suma = 0;\n var mult = 2;\n var c = 0;\n var modulo11 = 0;\n var largo = rut_aux.length;\n for( i = largo - 1; i >= 0; i-- )\n {\n suma = suma + rut_aux.charAt( i ) * mult;\n mult++;\n if( mult > 7 )\n mult = 2;\n }\n modulo11 = 11 - suma % 11;\n if( modulo11 == 10 )\n modulo11 = \"K\";\n if( modulo11 == 11 )\n modulo11 = \"0\";\n if( modulo11 != digito.value.toUpperCase() )\n {\n alert( \"Rut invalido.\" );\n return false;\n }\n return true;\n}", "function Valida_Rut(Objeto)\n\n{\n\n var tmpstr = \"\";\n\n var intlargo = Objeto.value;\n\n if (intlargo.length > 0)\n\n {\n\n crut = Objeto.value;\n\n largo = crut.length;\n\n if (largo < 2)\n\n {\n\n sweetAlert(\"ERROR\", \"RUN INVALIDO!\", \"error\");\n\n //Objeto.focus();\n\n return false;\n\n }\n\n for (i = 0; i < crut.length; i++)\n if (crut.charAt(i) !== ' ' && crut.charAt(i) !== '.' && crut.charAt(i) !== '-')\n\n {\n\n tmpstr = tmpstr + crut.charAt(i);\n\n }\n\n rut = tmpstr;\n\n crut = tmpstr;\n\n largo = crut.length;\n\n\n\n if (largo > 2)\n rut = crut.substring(0, largo - 1);\n\n else\n rut = crut.charAt(0);\n\n\n\n dv = crut.charAt(largo - 1);\n\n\n\n if (rut === null || dv === null)\n return 0;\n\n\n\n var dvr = '0';\n\n suma = 0;\n\n mul = 2;\n\n\n\n for (i = rut.length - 1; i >= 0; i--)\n\n {\n\n suma = suma + rut.charAt(i) * mul;\n\n if (mul === 7) {\n\n mul = 2;\n\n } else {\n\n mul++;\n }\n\n }\n\n\n\n res = suma % 11;\n\n if (res === 1) {\n dvr = 'k';\n\n } else if (res === 0) {\n dvr = '0';\n\n } else {\n\n {\n\n dvi = 11 - res;\n\n dvr = dvi + \"\";\n\n }\n }\n\n\n\n if (dvr !== dv.toLowerCase())\n\n {\n\n\n sweetAlert(\"ERROR!!!\", \"RUN INCORRECTO!\", \"error\");\n }\n //Objeto.focus();\n\n return false;\n\n }\n\n\n\n // Objeto.focus();\n\n return true;\n\n}", "function validaCampoNumeroInSave(Nombre, ActualLement, rango, decimal) {\n var cValue = $('#' + ActualLement + '_txt_' + Nombre).val();\n var TextErr = false;\n\n if (cValue !== null && cValue !== '') {\n\n if (!decimal) {\n _regEx = new RegExp(\"^[0-9]+$\");\n if (!_regEx.test(cValue)) {\n redLabel_Space(Nombre, 'Solo se permiten caracteres numéricos', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n } else {\n if (!cValue.includes('.')) {\n redLabel_Space(Nombre, 'Solo se permiten decimales', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n\n if (rango !== undefined && Array.isArray(rango)) {\n if (cValue < rango[0]) {\n redLabel_Space(Nombre, 'El rango mínimo deber se de ' + rango[0], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n } else {\n if (cValue > rango[1]) {\n redLabel_Space(Nombre, 'El rango máximo deber se de ' + rango[1], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n }\n\n\n if (TextErr) {\n errorIs[Nombre] = true;\n } else {\n errorIs[Nombre] = false;\n }\n }\n}", "function valida_numeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla == 8 ){ return true; }\n if (tecla == 9 ){ return true; }\n if (tecla == 0 ){ return true; }\n if (tecla == 13 ){ return true; }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9-.]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "function validaruc(){\r\n\t\tvar ruc = document.getElementById('ruc');\r\n\t\tlimpiarError(ruc);\r\n\t\tif(ruc.value ==''){\r\n\t\t\talert ('Completa el campo de ruc o rise');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(isNaN(ruc.value)){\r\n\t\t\talert('Formato del RUC o RISE debe ser numeros');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\telse if(ruc.value.length<13){\r\n\t\t\talert('Error: Solo se debe ingresar minimo 13 digitos');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(ruc.value.length>13){\r\n\t\t\talert('Error: solo se debe ingresar maximo 13 digitos');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}return true;\r\n\t}", "function validarIntegrantesFamiliares(integrantes) {\n const regEx = /^[0-9]{1,2}$/;\n\n if (!regEx.test(integrantes)) {\n return 'Ingresaste un caracter invalido';\n }\n\n return '';\n}", "function validarCedula(inCedula)\n{\n var array = inCedula.split(\"\") ;\n var num = array.length;\n var total;\n var digito;\n var mult;\n var decena;\n var end;\n\n if(num == 10)\n {\n total = 0;\n digito = (array[9]*1);\n for( var i = 0; i<(num-1);i++)\n {\n mult = 0;\n if((i%2) != 0)\n {\n total = total + (array[i]*1);\n }\n else\n {\n mult = array[i]*2;\n if( mult > 9)\n {\n total = total + (mult - 9);\n }\n else\n {\n total = total + mult;\n }\n }\n\n }\n decena = total/10;\n decena = Math.floor(decena);\n decena = ( decena + 1 ) * 10;\n end = ( decena - total ) ;\n if((end == 10 && digito == 0)|| end == digito)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n}", "function chequearSoloNumeros(field) {\n if (/^([0-9])*$/.test(field.value)) {\n setValido(field);\n return true;\n } else {\n setInvalido(field, `${field.name} solo debe contener números`);\n return false;\n }\n }", "function PhoneNumberValidator(inputPhoneNumber){\n if(inputPhoneNumber[0] !== '0'){\n return 'Nomor Harus Diawali Dengan 0'\n } \n\n if(inputPhoneNumber.length >= 9 && inputPhoneNumber.length <= 12){\n for(let i = 0; i < inputPhoneNumber.length; i++){\n if(!(inputPhoneNumber[i] >= 0)){\n return 'Nomor Harus Berupa Angka'\n }else if(inputPhoneNumber[i] === ' '){\n return 'Nomor Tanpa Spasi'\n }\n }\n }else{\n return 'Nomor Harus 9-12 Digit'\n }\n\n return true\n}", "function validarDocumento(numero) { \n \n /* alert(numero); */\n var suma = 0; \n var residuo = 0; \n var pri = false; \n var pub = false; \n var nat = false; \n var numeroProvincias = 22; \n var modulo = 11;\n \n /* Verifico que el campo no contenga letras */ \n var ok=1;\n for (i=0; i<numero.length && ok==1 ; i++){\n var n = parseInt(numero.charAt(i));\n if (isNaN(n)) ok=0;\n }\n if (ok==0){\n swal(\"No puede ingresar caracteres en el número\", \"\", \"info\"); \n return false;\n }\n \n if (numero.length < 10 ){ \n swal(\"El número ingresado no es válido \", \"\", \"info\");\n // alert('El número ingresado no es válido'); \n return false;\n }\n \n /* Los primeros dos digitos corresponden al codigo de la provincia */\n provincia = numero.substr(0,2); \n if (provincia < 1 || provincia > numeroProvincias){ \n swal('El código de la provincia (dos primeros dígitos) es inválido', \"\", \"info\");\n return false; \n }\n /* Aqui almacenamos los digitos de la cedula en variables. */\n d1 = numero.substr(0,1); \n d2 = numero.substr(1,1); \n d3 = numero.substr(2,1); \n d4 = numero.substr(3,1); \n d5 = numero.substr(4,1); \n d6 = numero.substr(5,1); \n d7 = numero.substr(6,1); \n d8 = numero.substr(7,1); \n d9 = numero.substr(8,1); \n d10 = numero.substr(9,1); \n \n /* El tercer digito es: */ \n /* 9 para sociedades privadas y extranjeros */ \n /* 6 para sociedades publicas */ \n /* menor que 6 (0,1,2,3,4,5) para personas naturales */ \n if (d3==7 || d3==8){ \n swal('El tercer dígito ingresado es inválido', \"\", \"info\"); \n return false;\n } \n \n /* Solo para personas naturales (modulo 10) */ \n if (d3 < 6){ \n nat = true; \n p1 = d1 * 2; if (p1 >= 10) p1 -= 9;\n p2 = d2 * 1; if (p2 >= 10) p2 -= 9;\n p3 = d3 * 2; if (p3 >= 10) p3 -= 9;\n p4 = d4 * 1; if (p4 >= 10) p4 -= 9;\n p5 = d5 * 2; if (p5 >= 10) p5 -= 9;\n p6 = d6 * 1; if (p6 >= 10) p6 -= 9; \n p7 = d7 * 2; if (p7 >= 10) p7 -= 9;\n p8 = d8 * 1; if (p8 >= 10) p8 -= 9;\n p9 = d9 * 2; if (p9 >= 10) p9 -= 9; \n modulo = 10;\n } \n /* Solo para sociedades publicas (modulo 11) */ \n /* Aqui el digito verficador esta en la posicion 9, en las otras 2 en la pos. 10 */\n else if(d3 == 6){ \n pub = true; \n p1 = d1 * 3;\n p2 = d2 * 2;\n p3 = d3 * 7;\n p4 = d4 * 6;\n p5 = d5 * 5;\n p6 = d6 * 4;\n p7 = d7 * 3;\n p8 = d8 * 2; \n p9 = 0; \n } \n \n /* Solo para entidades privadas (modulo 11) */ \n else if(d3 == 9) { \n pri = true; \n p1 = d1 * 4;\n p2 = d2 * 3;\n p3 = d3 * 2;\n p4 = d4 * 7;\n p5 = d5 * 6;\n p6 = d6 * 5;\n p7 = d7 * 4;\n p8 = d8 * 3;\n p9 = d9 * 2; \n }\n \n suma = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9; \n residuo = suma % modulo; \n /* Si residuo=0, dig.ver.=0, caso contrario 10 - residuo*/\n digitoVerificador = residuo==0 ? 0: modulo - residuo; \n /* ahora comparamos el elemento de la posicion 10 con el dig. ver.*/ \n if (pub==true){ \n if (digitoVerificador != d9){ \n swal('El ruc de la empresa del sector público es incorrecto.', \"\", \"info\"); \n return false;\n } \n /* El ruc de las empresas del sector publico terminan con 0001*/ \n if ( numero.substr(9,4) != '0001' ){ \n swal('El ruc de la empresa del sector público debe terminar con 0001', \"\", \"info\");\n return false;\n }\n } \n else if(pri == true){ \n if (digitoVerificador != d10){ \n swal('El ruc de la empresa del sector privado es incorrecto.', \"\", \"info\");\n return false;\n } \n if ( numero.substr(10,3) != '001' ){ \n swal('El ruc de la empresa del sector privado debe terminar con 001', \"\", \"info\");\n return false;\n }\n } \n else if(nat == true){ \n if (digitoVerificador != d10){ \n swal('El número de cédula de la persona natural es incorrecto.', \"\", \"info\");\n return false;\n } \n if (numero.length >10 && numero.substr(10,3) != '001' ){ \n swal('El ruc de la persona natural debe terminar con 001', \"\", \"info\");\n return false;\n }\n } \n return true; \n \n }", "function validarCedula(cedula){\t\n\tcadena=/^[0-9]{10}$/;\n\tsumaprod=0;\n\tcoef='212121212';\n if(cadena.test(cedula)){\t\t\n\t\ti=0;\n\t\twhile(i<9){\t\t\t\t\n\t\t\tif(i==0){\n\t\t\t numruc=cedula.substr(0,1);\t\t\n\t\t\t numcoef=coef.substr(0,1);\t \t\t \n\t\t\t}\n\t\t\telse{\n\t\t\t numruc=cedula.substr(i,1);\t\t\n\t\t\t numcoef=coef.substr(i,1);\t \n\t\t\t}\t\t\n\t\t\tproduct=numruc*numcoef;\t\t\n\t\t\tif (product>=10){\t\t\t\n\t\t\t product1=String(product);\t \t\t\t\n\t\t\t num1=product1.substr(0,1);\t\t \n\t\t\t num2=product1.substr(1,1);\t\t\t\n\t\t\t product=Number(num1)+Number(num2);\t \n\t\t\t}\n\t\t\t sumaprod=sumaprod+product;\t\t\t\t \t\t \n\t\t\t i=i+1;\t\t\n\t\t}\t\t\n\t\tresid=sumaprod%10;\t\n\t\tif(resid==0)\n\t\t digverf=0;\n\t\telse\n\t\tdigverf=10-resid;\n\t\tdigverfced=cedula.substr(9,1);\n\t\tif(Number(digverfced)==Number(digverf)) {\n\t\t return 1;\t \n\t\t }\n\t\telse {\n\t\t return 0;\t \n\t\t} \n\t}\n\telse {\n\t return 0;\t \n\t }\n}", "function validarNumero10(mensaje1,mensaje2,mensaje3,mensaje4,mensajesSixbell,mensajeFormat,operacion) {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked)\r\n\t{\r\n\t\tif(frm.numeros.selectedIndex == -1)\r\n\t\t\tshowAlertMessage(mensaje2);\r\n\t\telse{\r\n\t\t var cont=0;\r\n\t\t for (var i=frm.numeros.options.length-1;i>-1;i--) \r\n\t\t { \r\n if (frm.numeros.options[i].selected) \r\n cont++; \r\n }\r\n if(cont>10){\r\n\t\t\t\tshowAlertMessage(mensajesSixbell);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfrm.operacion.value = operacion;\r\n\t\t\t\tfrm.submit();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(frm.numero.value == '')\r\n\t\t\tshowAlertMessage(mensaje1);\r\n\t\telse{\r\n\t\t\tvar patron=/[^0-9]/;\r\n\t\t\tif(patron.exec(frm.numero.value)){\r\n\t\t\t\tshowAlertMessage(mensajeFormat);\r\n\t\t\t\tfrm.numero.focus();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(frm.localidad.value == 1){\r\n\t\t\t\t\tif(frm.numero.value.length != 9){\r\n\t\t\t\t\tshowAlertMessage(mensaje3);\r\n\t\t\t\t\tfrm.numero.focus();\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\t\tif(frm.numero.value.length != 9){\r\n\t\t\t\t\tshowAlertMessage(mensaje4);\r\n\t\t\t\t\tfrm.numero.focus();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfrm.operacion.value = operacion;\r\n\t\t\tfrm.submit();\t\t\r\n\t\t}\r\n\t}\r\n}", "function soloLetrasYNum(campo) {\r\n\tvar validos = \" abcdefghijklmnopqrstuvwxyz0123456789\";\r\n var letra;\r\n var bien = true;\r\n for (var i=0; i<campo.value.length; i++) {\r\n letra=campo.value.charAt(i).toLowerCase()\r\n if (validos.indexOf(letra) == -1){bien=false;};\r\n }\r\n return bien;\r\n \r\n }", "function Numero( caractere ) { \nvar strValidos = \"0123456789\" \nif ( strValidos.indexOf( caractere ) == -1 ) \nreturn false; \nreturn true; \n}", "function processa_letra()\n{\n let letra = document.getElementById(\"entrada\").value; //le o valor da entrada\n alert(\"voce digitou mais de um caracter\")\n //verifica se a entrada e valida\n if (letra.length > 1)\n {\n alert(\"voce digitou mais de um caracter\")\n }\n //processa a letra\n else \n {\n //coloca em minusculo\n letra = letra.toLowercase();\n //vefica se esta na palavra\n let j = 0;\n for(let i = 0; i < jogo.palavra.length; i++)\n {\n if (jogo.palavra[i] == letra)\n {\n jogo.acertos++;\n jogo.try_cor[i] = letra;\n }\n else\n {\n j++;\n }\n }\n\n if(i == j)\n {\n try_err = try_err + letra;\n jogo.erros++;\n }\n\n verifica_jogo(jogo);\n }\n\n\n}", "function validaCampoNumero(Nombre, longitud, ActualLement, rango, decimal) {\n //errorIs = Array();\n LimitaTamCampo(Nombre, Number(longitud), '#' + ActualLement);\n $('#' + ActualLement + '_txt_' + Nombre).change(function () {\n resetCampo(Nombre, '#' + ActualLement);\n validaCampoNumeroInSave(Nombre, ActualLement, rango, decimal);\n });\n}", "function validarCumple(cumple){\n\n cumple = cumple.split(\"/\");\n\n if(cumple.length==2){\n var c= 0;\n for(i=0; i<2; i++){\n if(cumple[i].length == 2 && cumple[i].match(/^[0-9]+$/)){\n if(i == 0){\n if(parseInt(cumple[i])<=31 && parseInt(cumple[i])>0){\n c++;\n }else{\n alert(\"Ingresar cumpleaños segun formato\");\n break;\n }\n }else{\n if(parseInt(cumple[i])<=12 && parseInt(cumple[i])>0){\n c++;\n }else{\n alert(\"Ingresar cumpleaños segun formato\");\n }\n }\n }else{\n alert(\"Ingresar cumpleaños segun formato\");\n break;\n }\n }\n }else{\n alert(\"Ingresar cumpleaños segun formato\");\n }\n if(c==2){return true;}\n}", "function validarNumeros(elemento){\n if(elemento.value.length>0){\n var miAscii = elemento.value.charCodeAt(elemento.value.length-1)\n console.log(miAscii)\n if(miAscii >=48 && miAscii <= 57){ //valida solo numeros entre 0 y 9\n return true\n }else{\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n return false\n }\n }else{\n return false\n }\n}", "function validarSoloNumeros(evento) {\n tecla = (document.all) ? evento.keyCode : evento.which; // con document.all verifica si es IE\n\t // o FireFox. Según lo que sea, obtiene\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // el codigo de la tecla con la \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // instruccion correspondiente\n\tif (tecla==8) return true; // para que pueda hacer backspace\n if (tecla==0) return true; // para que pueda pasar a otro campo con TAB\n patron =/\\d/; // solo acepta numeros\n te = String.fromCharCode(tecla); // convierte el char a codigo ASCII\n\treturn patron.test(te); // compara con el patron y devuelve true o false\n}", "function comprobarNum( campo ,size ) {\n var exp = /^[0-9]*$/;\n if(!comprobarExpresionRegular(campo,exp,size)){//comprueba que la expresión enviada en telef sea cumplida por el campo enviado si no lo hace devuelve false\n return false;\n }else {\n campo.style.border = \"2px solid green\";\n return true;\n }\n}", "function validarLetras(elemento){\n if(elemento.value.length > 0){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 97 && codigA <= 122)||(codigA >=65 && codigA <= 90)||(codigA == 32)){ \n if ((elemento.id=='nombres')||(elemento.id=='apellidos')) {\n //console.log(\"Entra para irse\");\n return validarDosOMasCampos(elemento);\n }\n }else {\n console.log(\"Es una letra invalida\")\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n return false\n }\n }\n}", "function validarAnoBusca()\r\n{\r\n\tif ((document.check.ano.value.length==4) && (document.check.ano.value != blank))\r\n\t\tif(!isNumberString(document.check.ano.value))\r\n\t\t{\r\n\t\t\talert(\"Valor inválido para ano, digite somente números.\");\r\n\t\t\tanoValido = false;\r\n\t\t\tdocument.check.ano.focus();\r\n\t\t\tdocument.check.ano.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tanoValido = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n}", "function validarCedula(elemento)\n{ \n if(elemento.value.length > 0 && elemento.value.length < 11){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 48 && codigA <= 57)){\n }else {\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n }else{\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n if (elemento.value.length == 10) {\n if((elemento.value.substring(0,2)>=1)||(elemento.value.substring(0,2)<=24)){\n //Suma impares\n var pares = 0;\n var numero =0;\n for (var i = 0; i< 4; i++) {\n numero = elemento.value.substring(((i*2)+1),(i*2)+2);\n numero = (numero * 1);\n if( numero > 9 ){ var numero = (numero - 9); }\n pares = pares + numero; \n }\n var imp=0;\n numero = 0\n for (var i = 0; i< 5; i++) {\n var numero = elemento.value.substring((i*2),((i*2)+1));\n var numero = (numero * 2);\n if( numero > 9 ){ var numero = (numero - 9); }\n imp = imp + numero; \n }\n var sum = pares + imp;\n aux = (''+sum)[0];\n var di = aux.substring(0,1);\n di++;\n di = di *10;\n numero = (di - sum);\n if (numero == (elemento.value.substring(9,10))) {\n document.getElementById('mensaje1').innerHTML='' ; \n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n }\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n}", "function validarNumeros(parametro) {\r\n\tif (!/^([0-9])*$/.test(parametro)) {\r\n\t\treturn false;\r\n\t}else {\r\n\t\treturn true;\r\n\t}\r\n}", "function validarFormulario(){\t\n\tvar valido = true ;\n\tvar valRecargaTemp = valorRecarga.value.replace(\",\",\"\");\n\tif( valRecargaTemp == 0 || valRecargaTemp == \"\" || multiploDeMil(valRecargaTemp)){\n\t\tvalido = false;\n\t\tvalorRecarga.blur();\n\t\tvalorRecarga.classList.add(\"is-invalid-input\");\n\t\tdocument.getElementById(\"icondollar\").classList.add(\"is-invalid-label\");\n\t\tdocument.getElementById(\"error-valor\").style.display = 'block';\n\t\t\n\t}\n\tconsole.log(numeroCelular.value < 10);\n\tif(numeroCelular.value.length < 10){\n\t\tvalido = false;\n\t\tnumeroCelular.blur();\n\t\tnumeroCelular.classList.add(\"is-invalid-input\");\n\t\tdocument.getElementById(\"iconmobile\").classList.add(\"is-invalid-label\");\n\t\tdocument.getElementById(\"error-numero\").style.display = 'block';\n\n\t}\n\t\n\treturn valido;\n}", "function validacionLetras(letraDigitada) {\n if (letraDigitada == letrasOrden[0]) { // me valida si la letra digita es igual al primer indici del arreglo de las letras ordenadas\n inputletras.textContent += letraDigitada;\n letrasOrden.shift(); // me elimina el primer elementto de la lista para decir que esta letra esta digitada y no volverla a validar\n if (letrasOrden.length == 0 && letraDigitada == 'J') {\n swal(\"Ya se terminaron las letras, continue con los numeros\", {\n className: \"swal-text\",\n icon: \"success\",\n });\n terminarNumeros = true; // me indica si ya se termino de digitar las letras para darle el turno para digigitar las letras\n }\n } else {\n switch (letraDigitada) { // en cada uno de los caso se valida si dijita dos veces, y si digita una letra que no este en orden muestra cuales faltan \n case 'A':\n contadorLetraA += 1;\n if (contadorLetraA >= 2) {\n swal(\"La letra A ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break\n case 'B':\n if (contadorLetraB == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraB += 1;\n } else if (contadorLetraB >= 2) {\n swal(\"La letra B ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'C':\n if (contadorLetraC == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A y B\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraC += 1;\n } else if (contadorLetraC >= 2) {\n swal(\"La letra C ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'D':\n if (contadorLetraD == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraD += 1;\n } else if (contadorLetraD >= 2) {\n swal(\"La letra D ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'E':\n if (contadorLetraE == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraE += 1;\n } else if (contadorLetraE >= 2) {\n swal(\"La letra B ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'F':\n if (contadorLetraF == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D ,E \", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraF += 1;\n } else if (contadorLetraF >= 2) {\n swal(\"La letra F ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'G':\n if (contadorLetraG == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D ,E ,F\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraG += 1;\n } else if (contadorLetraG >= 2) {\n swal(\"La letra G ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'H':\n if (contadorLetraH == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D ,E ,F, G\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraH += 1;\n } else if (contadorLetraH >= 2) {\n swal(\"La letra H ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'I':\n if (contadorLetraB == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D ,E ,F ,G ,H\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraI += 1;\n } else if (contadorLetraI >= 2) {\n swal(\"La letra I ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n case 'J':\n if (contadorLetraJ == 1) {\n swal(\"No puedes oprimir esta letra te falta la letra A ,B ,C ,D ,E ,F ,G ,H ,I\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n contadorLetraJ += 1;\n } else if (contadorLetraJ >= 2) {\n swal(\"La letra J ya fue digitada\", {\n className: \"swal-text\",\n icon: \"warning\",\n });\n }\n break;\n }\n }\n}", "function validarNumero20(mensaje1,mensaje2,mensaje3,mensaje4,mensajesSixbell,mensajeFormat,operacion) {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked)\r\n\t{\r\n\t\tif(frm.numeros.selectedIndex == -1)\r\n\t\t\tshowAlertMessage(mensaje2);\r\n\t\telse{\r\n\t\t var cont=0;\r\n\t\t for (var i=frm.numeros.options.length-1;i>-1;i--) \r\n\t\t { \r\n if (frm.numeros.options[i].selected) \r\n cont++; \r\n }\r\n if(cont>20){\r\n\t\t\t\tshowAlertMessage(mensajesSixbell);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfrm.operacion.value = operacion;\r\n\t\t\t\tfrm.submit();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(frm.numero.value == '')\r\n\t\t\tshowAlertMessage(mensaje1);\r\n\t\telse{\r\n\t\t\tvar patron=/[^0-9]/;\r\n\t\t\tif(patron.exec(frm.numero.value)){\r\n\t\t\t\tshowAlertMessage(mensajeFormat);\r\n\t\t\t\tfrm.numero.focus();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(frm.localidad.value == 1){\r\n\t\t\t\t\tif(frm.numero.value.length != 9){\r\n\t\t\t\t\tshowAlertMessage(mensaje3);\r\n\t\t\t\t\tfrm.numero.focus();\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\t\tif(frm.numero.value.length != 9){\r\n\t\t\t\t\tshowAlertMessage(mensaje4);\r\n\t\t\t\t\tfrm.numero.focus();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfrm.operacion.value = operacion;\r\n\t\t\tfrm.submit();\t\t\r\n\t\t}\r\n\t}\r\n}", "function validarNA(atri, men, id){\n var bandera = true;\n if(atri.value!==''){\n var partes = atri.value.split(\" \");\n if(partes.length !== 2 || partes[0]=='' || partes[1]==''){\n error(atri, men, '<br>Los datos ingresados no son aceptados')\n bandera = false;\n vgeneral[id]=bandera;\n }else{\n arreglo(atri, men);\n bandera = true;\n vgeneral[id]=bandera;\n }\n }else{\n error(atri, men, '<br>Debe ingresar mas informacion')\n bandera = false;\n vgeneral[id]=bandera;\n }\n return bandera;\n}", "function revisarDigito( dvr )\n{\ndv = dvr \"\"\nif ( dv != '0' && dv != '1' && dv != '2' && dv != '3' && dv != '4' && dv != '5' && dv != '6' && dv != '7' && dv != '8' && dv != '9' && dv != 'k' && dv != 'K')\n{\nalert(\"Debe ingresar un digito verificador valido\");\nwindow.document.form1.rut.focus();\nwindow.document.form1.rut.select();\nreturn false;\n}\nreturn true;\n}", "function comprobacion(e) {\n\t var numeros=\"0123456789\";\n\nfunction tiene_numeros(texto){\n for(i=0; i<texto.length; i++){\n if (numeros.indexOf(texto.charAt(i),0)!=-1){\n \t//si retorna 1 es que encontro numeros en el texto\n return 1;\n }\n }\n //si retorna 0 solo contiene letras\n return 0;\n}\n}", "function validarNum(Num)\r\n{\r\n var regNum = /([^0-9]{4})/g;\r\n num.value = num.value.replace(/([^0-9]{4})/g,'');\r\n\r\n}", "function verificarNumero(value, min, id){\n let res = \"\";\n let val = value.split(\"\");\n for(let i = 0; i < val.length; i++){\n res += (NUMBERS.includes(val[i])) ? val[i] : \"\";\n }\n if(Number.parseInt(res) > 20) {\n res = (Number.parseInt(res) > 20) ? res.slice(0,-1) : res;\n }\n document.getElementById(id).value = res;\n return (Number.isInteger(Number.parseInt(value[value.length - 1])) && !(Number.parseInt(value) < min));\n}", "function validateIrsNumber(el)\n{\n\t/* in order for an irs number to be valid, it must have exactly 9 digits. Only spaces are allowed */\n\t\n\t//get the length of the irs number\n\tvar irsNumberLength = el.value.length;\n\t//get the number of digits\n\tvar digitsNumber = getNoOfDigits(el);\n\t//get the number of spaces\n\tvar spacesNumber = getNoOfSpaces(el);\n\t\n\t// if the irs number is valid, reset the custom validity message\n\tif ( (irsNumberLength == 0) || ( (digitsNumber == 9) && (digitsNumber+spacesNumber == irsNumberLength) ) )\n\t{\n\t\tel.setCustomValidity('');\n\t}\n\telse\n\t{\n\t\tel.setCustomValidity('Το ΑΦΜ δεν είναι έγκυρο. Απαιτούνται ακριβώς 9 ψηφία. Μόνο οι κενοί χαρακτήρες επιτρέπονται.');\n\t}\n}", "function validarNumeros1(e){ \n \n tecla = e.keyCode || e.which; \n \n var apellido = window.document.getElementById(\"apellidos\");\n \n //valida que el campo no contenga numeros \n if(expre.test(apellido.value)==true){\n \n apellido.style.borderColor =\"red\";\n valApel = false;\n var aux = apellido.value.substring(apellido.value.length-1);\n var rempla = apellido.value.replace(aux,\"\");\n apellido.value=rempla;\n}\n //valida que el campo tenga el formato solicitado\n else if (expreL.test(apellido.value)==true){\n apellido.style.borderColor =\"blue\";\n valApel = true;\n}\n else{\n apellidos.style.borderColor =\"red\";\n valApel = false;\n}\n}", "function validarNumeros(e){ \n \n tecla = e.keyCode || e.which; \n var nombre = window.document.getElementById(\"nombres\");\n //verifica que el campo no contenga numeros\n if(expre.test(nombre.value)==true){\n \n nombres.style.borderColor =\"red\";\n valNom = false;\n var aux = nombre.value.substring(nombre.value.length-1);\n var rempla = nombre.value.replace(aux,\"\");\n nombre.value=rempla;\n \n}\n \n //verifica que el campo Nombre contenga solo letras \n else if (expreL.test(nombre.value)==true){\n nombres.style.borderColor =\"blue\";\n valNom=true;\n }else{\n nombres.style.borderColor =\"red\";\n valNom=false;\n }\n \n }", "function primer() {\r\n if (numeross(0)){\r\n validar(soloN());\r\n }else if (letrass(0)) {\r\n validar(soloL());\r\n }else {\r\n validar(soloS());\r\n }\r\n}", "function validateNum() {\n var pass = true,\n num = '';\n\n ['#areacode', '#phnum1', '#phnum2'].forEach(function(id) {\n var $e = $(id),\n val = $e.val();\n\n if(!val || val.length !== parseInt($e.attr('maxlength'), 10)) {\n pass = false;\n $e.addClass('error');\n }\n else\n num += val;\n });\n\n if(!pass) return false;\n\n return num;\n }", "function ValidNum(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla==8 || tecla==0){\n //console.log('entro al if, deberia devolver un true');\n return true;\n }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "function validarRg(rg) {\n if (trim(rg.value) != '') {\n document.formFuncionario.rg.value = retirarAcentos(trim(document.formFuncionario.rg.value)).toUpperCase();\n }\n}", "function validarNota() {\r\n var n = $(\"#txtNota\").val();\r\n if (n < 0.0 || n > 10.0) {\r\n bandera= 1 ;\r\n }\r\n else {\r\n bandera = 0;\r\n }\r\n }", "function f_phone(){\n var phone = document.getElementById(\"phone\").value;\n var expresionRegular1=/^\\d{3}-\\d{3}-\\d{3}$/;//<--- con esto vamos a validar el numero\n var expresionRegular2=/\\s/;//<--- con esto vamos a validar que no tenga espacios en blanco\n if(phone === \"\"){\n alert(\"El campo del telefono es obligatorio\");}\n else if(expresionRegular2.test(phone)){\n alert(\"error existen espacios en blanco\");}\n else if(!expresionRegular1.test(phone)){\n alert(\"Telefono incorrecto, separar 3 digitos con guiones\");\n return false;}\n else { return true; }\n}", "function checkCPR(number) {\n //check at nummeret har den rigtige længde\n if (cpr_number.length === 10) {\n console.log(\"cpr number has the correct length\")\n for (i = 0; i < cpr_number.length - 1; i++) {\n //check for hver character i cpr nummeret om det er et tal\n if (!isNaN(parseInt(cpr_number[i]))) {\n console.log(cpr_number[i]);\n }\n else {\n console.log(\"cpr number contains a letter and is hence invalid\")\n break;\n }\n }\n var day = cpr_number.charAt(0) + cpr_number.charAt(1);\n console.log(\"day = \" + day);\n var month = cpr_number.charAt(2) + cpr_number.charAt(3);\n console.log(\"month = \" + month);\n var year = cpr_number.charAt(4) + cpr_number.charAt(5);\n console.log(\"year = \" + year);\n var cp7 = parseInt(cpr_number[6]);\n console.log(\"cp7 = \" + cp7);\n var gender = cpr_number.charAt(9)%2 == 0 ? 'woman' : 'man';\n //check at dagen har en korrekt værdi\n if (day >= 1 && day <= 31) {\n console.log(\"the day is valid\")\n //check at måneden har en korrekt værdi\n if (month >= 1 && month <= 12) {\n console.log(\"the month is valid\")\n //check at året har en korrekt værdi\n if (year >= 0 && year <= 99) {\n console.log(\"the year is valid\")\n //check at det 7'ende ciffer har en korrekt værdi\n switch (cp7) {\n //cp7 between 0-3 (both inclusive)\n case 0: case 1: case 2: case 3:\n if (year >= 00 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is 4\n case 4:\n if (year >= 00 && year <= 36) {\n var fullYear = parseInt(\"20\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 37 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 between 5 and 8 (both inclusive)\n case 5: case 6: case 7: case 8:\n if (year >= 00 && year <= 57) {\n var fullYear = parseInt(\"20\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 58 && year <= 99) {\n var fullYear = parseInt(\"18\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is 9\n case 9:\n if (year >= 00 && year <= 36) {\n var fullYear = parseInt(\"20\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 37 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is invalid\n default:\n console.log(\"ERROR ERROR ERROR ERROR\")\n break;\n }\n }\n else {\n console.log(\"the year is invalid\")\n }\n }\n else {\n console.log(\"the month is invalid\")\n }\n }\n else {\n console.log(\"the day is invalid\");\n }\n }\n else {\n console.log(\"the number has the wrong length and is invalid \")\n }\n}", "function allnumeric(unummer) {\n var numbers = /^[0-9]+$/;\n if (unummer.value.match(numbers)) {\n return true;\n } else {\n alert(\"Vul alle velden in. Sommige velden (gewicht, grootte) moeten ALLEEN numerieke tekens bevatten\");\n unummer.focus();\n return false;\n }\n}", "function validarContenido(cont){\n if(cont.length == 3){ \n a = parseInt(cont.split('')[0]);\n b = cont.split('')[1];\n c = parseInt(cont.split('')[2]);\n return (Number.isInteger(a) && b == \"/\" && Number.isInteger(c));\n }else{\n return false;\n }\n}", "function validarDNI() {\r\n var result = true;\r\n var dni = document.getElementById('nif');\r\n\r\n if (dni.value == '') {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'el DNI no puede estar en blanco';\r\n } else {\r\n var condicion = /\\d{8}-[A-Z]/;\r\n\r\n if (!condicion.test(dni.value)) {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'el DNI indicado tiene una estructura incorrecta';\r\n } else {\r\n var numeros = dni.value.substring(0, 8);\r\n var letra = dni.value.substring(9, 10)\r\n\r\n if (!comprobarLetraDNI(parseInt(numeros), letra)) {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'la letra del DNI no corresponde con ese numero';\r\n } else {\r\n dni.className = '';\r\n document.getElementById('errores').innerHTML = '';\r\n }\r\n }\r\n }\r\n return result;\r\n}", "function validateStandard(data) {\n\tvar error = \"\";\n\tvar re = /^(XC|XL|L?X{0,1})(IX|IV|V?I{0,3})$/;\n\tif (!re.test(data.value)) {\n\t\tdata.style.background = \"Red\";\n\t\tdocument.getElementById(\"standardValidationError\").innerHTML =\n\t\t\t\"The required field must be a valid Roman Numeral\";\n\t\tvar error = \"1\";\n\t} else {\n\t\tdata.style.background = 'url(\"assets/back-blur3.jpg\")';\n\t\tdocument.getElementById(\"standardValidationError\").innerHTML = \"\";\n\t}\n\treturn error;\n}", "function lingkaranValidation(){\n\t//init value\n\tvar valResult = [];\n\tvar angka1 = document.getElementById(\"T4_angka1\").value;\n\t\n\t//validation\n\tif(!angka1){\n\t\tvalResult.push(\"Angka 1 tidak boleh kosong\");\n\t}\n\telse{\n\t\tif(isNaN(angka1)){\n\t\t\tvalResult.push(\"Angka 1 harus diisi dengan angka\");\n\t\t}\n\t}\n\n\treturn valResult;\n}", "function comprobarTipo(texto){//nos devuelve un string indicando el tipo de token\r\n \r\n //comparamos que la primera posicion de la palabra sea una letra mayuscula o minuscula\r\n if((textoEntrada.value.charCodeAt(0)>=97 && textoEntrada.value.charCodeAt(0)<=122) \r\n || (textoEntrada.value.charCodeAt(0)>=65 && textoEntrada.value.charCodeAt(0)<=90)){\r\n //si cumple con ser una letra el primer caracter\r\n //comparamos que los siguientes caracteres sigan siendo letras o numeros\r\n if((texto>=97 && texto<=122) || (texto>=65 && texto<=90) || texto>=48 && texto<=57){\r\n\t\t return(\"letra\");\r\n \r\n }else {//si algun caracter no cumple nos vamos a un estado de error\r\n \r\n return(\"error\"); \r\n }\r\n //comparamos que el primer caracter sea un numero \r\n }else if((textoEntrada.value.charCodeAt(0)>=48 && textoEntrada.value.charCodeAt(0)<=57) ){\r\n \r\n if(texto>=48 && texto<=57){//si cumple, continua comparando que la palabra contenga solo numeros\r\n return(\"digito\");\r\n \r\n\t }else {\r\n return(\"error\");\r\n }\r\n //comparamos que el primer caracter sea un simbolo \r\n }else if(textoEntrada.value.charCodeAt(0)>=35 && textoEntrada.value.charCodeAt(0)<=37 ) {\r\n \r\n if(texto>=35 && texto<=37){\r\n return(\"simbolo\");\r\n \r\n\t }else{\r\n return(\"error\");\r\n }\r\n \r\n }else{\r\n return(\"error\");\r\n }\r\n \r\n}", "function fvalidarCaracter(text, tipo) {\n var cValido = true;\n var cad = \"\";\n var numpunto = 0;\n for (var i = 0; i < text.value.length; i++) { // El for recorre el contenido de la cadena caracter por caracter\n var band = false;\n var var1 = \"(text.value.charAt(i)<'0' || text.value.charAt(i)>'9')\";\n var var2 = \"(text.value.charAt(i)<'a' || text.value.charAt(i)>'z') && (text.value.charAt(i)<'A' || text.value.charAt(i)>'Z') && (text.value.charAt(i)!='ñ' && (text.value.charAt(i)!='Ñ') && (text.value.charAt(i)!=' '))\";\n var varpunto = \"(text.value.charAt(i)!='.')\";\n var varacento = \"(text.value.charAt(i)!='á' && text.value.charAt(i)!='é' && text.value.charAt(i)!='í' && text.value.charAt(i)!='ó' && text.value.charAt(i)!='ú')\";\n var var3 = \"(text.value.charAt(i)!='.' && text.value.charAt(i)!='_' && text.value.charAt(i)!='-' && text.value.charAt(i)!='@')\";\n var var4 = \"(text.value.charAt(i)!='.' && text.value.charAt(i)!=',' && text.value.charAt(i)!='#' && text.value.charAt(i)!='-')\";\n //Estos son los filtros\n if (tipo == 'numerico' && eval(var1))\n band = true;\n if (tipo == 'alfabetico' && eval(var2) && eval(varacento) && eval(varpunto))\n band = true;\n if (tipo == 'alfanumerico' && eval(var1) && eval(var2))\n band = true;\n if (tipo == 'email' && eval(var1) && eval(var2) && eval(var3))\n band = true;\n if (tipo == 'direccion' && eval(var1) && eval(var2) && eval(varacento) && eval(var4))\n band = true;\n if (tipo == 'especial' && eval(var1) && eval(var2) && eval(varacento) && eval(var3))\n band = true;\n if (tipo == 'flotante') {\n if (!eval(varpunto)) {\n numpunto++;\n if (numpunto > 1)\n band = true;\n }\n if (eval(var1) && eval(varpunto))\n band = true\n if (i + 1 == text.value.length) {\n if (text.value.charAt(i) == '.')\n band = true;\n }\n }\n //Aqui entra si el dato es invalido\n if (band) {\n cValido = false;\n }\n\n }\n //Aqui despliega los caracteres invalidos en el dato que se intento capturar\n if (!cValido) {\n //alert(\"Este campo no permite caracteres especiales\\n\\nPor Ejemplo: \"+cad+\"\\n\\nEn su dato : \"+text.value);\n return false;\n }\n return true;\n}", "function valSearchGirviByCustomAmountRangeInputs(obj) {\r\n if (validateEmptyField(document.srch_girvi_customAmtRange.grvCustomAmtStartRange.value, \"Please enter start range!\") == false ||\r\n validateNum(document.srch_girvi_customAmtRange.grvCustomAmtStartRange.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_girvi_customAmtRange.grvCustomAmtStartRange.focus();\r\n return false;\r\n } else if (validateEmptyField(document.srch_girvi_customAmtRange.grvCustomAmtEndRange.value, \"Please enter end range!\") == false ||\r\n validateNum(document.srch_girvi_customAmtRange.grvCustomAmtEndRange.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_girvi_customAmtRange.grvCustomAmtEndRange.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function valida_difito(rut)\n\t{\n\t\tvar tmpstr=\"\";\n\t\tvar tmprut, i;\n\t\tvar digito = \"\";\n\t\t\n\t\ttmprut = rut.value;\n\t\t\n\t\tif ( tmprut.length >= 9 && tmprut.length <= 10)\n\t\t{\n\t\t\tfor ( i=0; i < tmprut.length; i++ ) \n\t\t\t{\n\t\t\t\tif ( tmprut.charAt(i) != ' ' && tmprut.charAt(i) != '.' && tmprut.charAt(i) != '-' ) \n\t\t\t\t{\n\t\t\t\t\ttmpstr = tmpstr + tmprut.charAt(i); //obtengo el rut sin caracteres... osea: 111111111\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmprut = \"\";\n\t\t\tlargo_rut = tmpstr.length; \t\n\t\t\n\t\t\tfor ( i=0; i < largo_rut-1; i++ )\n\t\t\t{\n\t\t\t\ttmprut = tmprut + tmpstr.charAt(i); //obtengo el rut sin digito verificador\n\t\t\t}\n\t\t\tdigito= tmpstr.charAt(largo_rut-1);\t\t\t//obtengo el digito verificador\n\t\t\n\t\t\tvar dvr = '0';\n\t\t\tsuma = 0;\n\t\t\tmul = 2;\n\n\t\t\tfor (i= tmprut.length - 1 ; i >= 0; i--) \n\t\t\t{\n\t\t\t\tsuma = suma + tmprut.charAt(i) * mul;\n\t\t\t\tif (mul == 7)\n\t\t\t\t\tmul = 2;\n\t\t\t\telse\n\t\t\t\t\tmul++;\n\t\t\t}\n\n\t\t\tres = suma % 11;\n\t\t\tif (res==1)\n\t\t\t{\n\t\t\t\tdvr = 'k';\n\t\t\t}\n\t\t\telse if (res==0) \n\t\t\t{\n\t\t\t\tdvr = '0';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdvi = 11-res;\n\t\t\t\tdvr = dvi + \"\";\n\t\t\t}\n\t\t\tif (dvr != digito.charAt(0).toLowerCase()) \n\t\t\t{\n\t\t\t\talert(\"El RUT ingresado es inválido, ingreselo nuevamente\");\n\t\t\t\trut.value=\"\";\n\t\t\t\trut.focus();\n\t\t\t\treturn false; //El DV no concordo con el RUT.\n\t\t\t}\n\n\t\t\treturn true; //EL DV concordo con el RUT.\n\t\t}\n\t\telse if( tmprut.length = 0 )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"El RUT ingresado es inválido, ingreselo nuevamente\");\n\t\t\trut.value=\"\";\n\t\t\trut.focus();\n\t\t\treturn false;\n\t\t}\n\n\t}", "function passNumFunc() {\n var p, z; //t= \"paragraph\", z= змінна.\n p = document.getElementById('pasword-num');\n p.innerHTML = \"\";\n z = document.getElementById('pasNum-put').value;\n try {\n if (z == \"\") throw \"is empty!\";\n if (isNaN(z)) throw \"is not a number!\";\n z = Number(z);\n if (z <= 7) throw \"is too low!\";\n if (z >= 11 ) throw \"is too height!\";\n if (z === 8) throw getPassNum8();\n if (z === 9) throw getPassNum9();\n if (z === 10) throw getPassNum10();\n } catch (err) {\n p.innerHTML = err;\n } finally {\n document.getElementById('pasNum-put').value=\"\";\n }\n}", "function isValidCurso(formname){\n \n var varCurso = document.forms[formname][\"curso\"].value; //Obtenemos los datos introducidos en el input curso\n \n if(varCurso.length == 0){\n var x= document.getElementById(\"curso\");\n x.innerHTML=\"Campo vacio\";\n return false;\n }\n varCurso=varCurso.trim();//quitamos los posibles espacios en blancos de los <--extremos-->\n varCurso= varCurso.replace(/ /g,' ');//sustituimos los posibles múltiples espacios entre palabras por solamente uno\n \n var x= document.getElementById(\"curso\");\n if(!/^[1-4][a-hA-H]$/.test(varCurso)){//Si los datos introducidos no cumplmen \"nl\", siendo \"n\" un número entre 1 y 4 y \"l\" una letra en a-h o A-H\n x.innerHTML=\"Error: nº curso debe estar entre 1 y 4, letra entre A y H\";\n return false; \n }\n \n x.innerHTML=\"\"; //Si no hay fallo en el parrafo anexo al input no se pone nada\n document.forms[formname][\"curso\"].value=varCurso; //refrescamos los datos introducimos en el campo curso pero ahora sin espacios en blanco inválidos.\n return true;\n}", "function Validar_Number(obj){\n\t jq(obj).validCampoAPP('0123456789');\n}", "function validar1()\r\n\t{\r\n\t\t// incio de validación de espacios nulos\r\n\t\tif(document.registro.telfdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio es necesario\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Celular es necesario\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio es necesario\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Mail es necesario\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t//Fin de validacion de espacios nulos \r\n\t\t//-------------------------------------------\r\n\t\t// Incio de validacion de tamanio \t\r\n\t\tif(document.registro.telfdom.value.length<7 || document.registro.telfdom.value.length>7)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio incorrecto\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length!=8)\r\n\t\t{\r\n\t\t\talert(\"Celular es incorrecto\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length<=5 || document.registro.dirdom.value.length>=200)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio incorrecto\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length<=10 || document.registro.mail.value.length>=100 )\r\n\t\t{\r\n\t\t\talert(\"El mail es incorrecto\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// fin de validacion de tamanio \r\n\t\t// --------------------------------\r\n\t\t// incio validaciones especiales\r\n\t\tif(isNaN(document.registro.telfdom.value))\r\n\t\t{\r\n\t\t\talert(\"El telefono de domicilio tiene que ser un número\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirOf.value.length!=0){\r\n\t\t\tif(document.registro.dirOf.value.length>=200 || document.registro.dirOf.value.length<10)\r\n\t\t\t{\r\n\t\t\t\talert(\"Esta Direccion parece incorrecta\");\r\n\t\t\t\tdocument.registro.dirOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.telfOf.value.length!=0){\r\n\t\t\tif(document.registro.telfOf.value.length!=7)\r\n\t\t\t{\r\n\t\t\t\talert(\"Este Telefono no parece correcto\");\r\n\t\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfOf.value)&& document.registro.telfOf.value.length!=0)\r\n\t\t{\r\n\t\t\talert(\"El telefono de oficina tiene que ser un número\");\r\n\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.celular.value))\r\n\t\t{\r\n\t\t\talert(\"El celular tiene que ser un número\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\"@\"))<3)\r\n\t\t{\r\n\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\".com\")<5)&&(document.registro.mail.value.indexOf(\".org\")<5)&&(document.registro.mail.value.indexOf(\".gov\")<5)&&(document.registro.mail.value.indexOf(\".net\")<5)&&(document.registro.mail.value.indexOf(\".mil\")<5)&&(document.registro.mail.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\tdocument.registro.email.focus() ;\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mailOf.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.mailOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\".com\")<5)&&(document.registro.mailOf.value.indexOf(\".org\")<5)&&(document.registro.mailOf.value.indexOf(\".gov\")<5)&&(document.registro.mailOf.value.indexOf(\".net\")<5)&&(document.registro.mailOf.value.indexOf(\".mil\")<5)&&(document.registro.mailOf.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.mailOf.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.msn.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.msn.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.msn.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.msn.value.indexOf(\".com\")<5)&&(document.registro.msn.value.indexOf(\".org\")<5)&&(document.registro.msn.value.indexOf(\".gov\")<5)&&(document.registro.msn.value.indexOf(\".net\")<5)&&(document.registro.msn.value.indexOf(\".mil\")<5)&&(document.registro.msn.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.msn.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// fin validaciones especiales\r\n\t\tdocument.registro.submit();\r\n\t}", "function validateDigitos(myfield, e)\r\n{\r\n\treturn restrictCharacters(myfield, e, digitsOnly); \r\n}", "function passBgLettFunc() {\n var n, g; //n= \"note\", g= змінна.\n n = document.getElementById('pasword-bglett');\n n.innerHTML = \"\";\n g = document.getElementById('pasBgLetter-put').value;\n try {\n if (g == \"\") throw \"is empty!\";\n if (isNaN(g)) throw \"is not a number!\";\n g = Number(g);\n if (g <= 7) throw \"is too low!\";\n if (g >= 11 ) throw \"is too height!\";\n if (g === 8) throw getPassBgLett8();\n if (g === 9) throw getPassBgLett9();\n if (g === 10) throw getPassBgLett10();\n } catch (err) {\n n.innerHTML = err;\n } finally {\n document.getElementById('pasBgLetter-put').value=\"\";\n }\n}", "function cargarNumeros(){\n\n //Tomo elementos del HTML y los guardo en variables\n let primerNumero = document.getElementById('numero1').value;\n let segundoNumero = document.getElementById('numero2').value;\n console.log(primerNumero,segundoNumero)\n \n\n // ((primerNumero>=0 || segundoNumero>=0))\n if ((primerNumero<0 && segundoNumero>=0) || (primerNumero>=0 && segundoNumero<0)){\n alert('Mensaje de alerta');\n } else{\n console.log('los numeros no cumplieron la condicion')\n }\n}", "function esNumeroEnteroValido(strNumeroEntero) {\n\treturn(/^[\\-]*[0-9]+$/.test(strNumeroEntero));\n}", "function validar(num1){\n if(isNaN(num1)){\n return false;\n } else {\n return true;\n }\n}", "function crore(number){\n\t\t\t\tif(number.length==8){\n\t\t\t\t\tsubnum=number[1]+number[2]+number[3]+number[4]+number[5]+number[6]+number[7];\n\t\t\t\t\tword= first[number[0]]+\" \"+unit[3]+\" \"+lakh(subnum);\n\t\t\t\t\treturn word;\n\t\t\t\t}\n\t\t\t\telse if(number.length==9){\n\t\t\t\t\tsubnum=number[2]+number[3]+number[4]+number[5]+number[6]+number[7]+number[8];\n\t\t\t\t\tword= first2degred(number[0]+number[1])+\" \"+unit[3]+\" \"+lakh(subnum);\n\t\t\t\t\treturn word;\n\t\t\t\t}\n\t\t\t}", "function validarNum(te){\n var num=/^([0-9]+){9}$/;\n if(!num.test(te)){\n window.alert(\"El teléfono sólo debe contener números.\");\n return false;\n }\n}", "function validate(n) {\n n = String(n)\n let pisah = n.split('')\n let jumlah = 0\n console.log(pisah)\n if (pisah.length % 2 === 0) {\n for (let i = 0; i < pisah.length; i++) {\n if (i % 2 === 0) {\n pisah[i] = pisah[i] * 2\n }\n }\n } \n \n else if (pisah.length % 2 !== 0) {\n for (let i = 0; i < pisah.length; i++) {\n if (i % 2 !== 0) {\n pisah[i] = pisah[i] * 2\n }\n }\n }\n\n console.log(pisah)\n\n for (let i = 0; i < pisah.length; i++) {\n if (String(pisah[i]).length > 1) {\n pisah[i] = pisah[i]-9\n }\n }\n \n console.log(pisah)\n for (let i = 0; i < pisah.length; i++) {\n jumlah += Number(pisah[i])\n }\n\n console.log(jumlah)\n\n if (jumlah % 10 === 0) {\n return true\n } else {\n return false\n }\n}", "function validate() {\n var nombreEmpresa = document.getElementById(\"nombreEmp\").value;\n var nit = document.getElementById(\"nit\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var tOperacion = document.getElementById(\"tipoOperacion\").value;\n\n var camposValidos = true;\n if (nombreEmpresa.length < 3) {\n camposValidos = false;\n alert(nombreEmpresa + \"El nombre debe ser mayor de 3 digitos\");\n }\n if (nit.length < 8) {\n camposValidos = false;\n alert(\"El nit debe ser de 8 u 10 digitos\");\n\n }\n if (nit.length > 10) {\n camposValidos = false;\n alert(\"El nit debe ser de 8 u 10 digitos\");\n\n }\n if (telefono.length < 10) {\n camposValidos = false;\n alert(\"El telefono debe ser de 10 digitos\");\n\n }\n if (tOperacion.value == \"Selecionar: \") {\n \n alert(\"Por favor seleccionar un tipo de operacion\");\n }\n return camposValidos;\n\n}", "function checa_numerico(String) {\r\n\tvar mensagem = \"Este campo aceita somente números\"\r\n\tvar msg = \"\";\r\n\tif (isNaN(String)) msg = mensagem;\r\n\treturn msg;\r\n}", "function validarEdad() {\n // Usaremos una expresion regular que solo permita digitos y la longitud sea de 1 a 3.\n var exp = /[0-9]{1,3}$/g;\n if (!exp.test(document.getElementById(\"edad\").value) || document.getElementById(\"edad\").value <0 || document.getElementById(\"edad\").value >105 ){\n // Cuando no se cumpla alguna de las condiciones, patron o limites de edad\n // facalizaremos el campo y mostraremos un error.\n document.getElementById(\"edad\").value = \"error!\";\n document.getElementById(\"edad\").focus();\n document.getElementById(\"edad\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en la edad. <br/> Tiene que ser un numero entre 0 y 105\";\n return false;\n }\n else {\n // si el patron es correcto y la edad esta entre 0 y 105 la daremos por valida.\n document.getElementById(\"edad\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function validarTelefono() {\n\t// Expresion regular que nos servirá de patron para comprobar que el telefono se teclea correctamente\n\t// de inicio ^ a fin $ tendremos 9 digitos: \\d{9}\n var exp = /^\\d{9}$/g;\n if (!exp.test(document.getElementById(\"telefono\").value)){\n document.getElementById(\"telefono\").value = \"error!\";\n document.getElementById(\"telefono\").focus();\n document.getElementById(\"telefono\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en el telefono. <br/> Debe tener 9 digitos.\";\n return false;\n }\n else {\n document.getElementById(\"telefono\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function validarAgregarAbogado(){\r\n var validacion=true;\r\n var nombre=document.getElementById('nombreAbogado').value.trim();\r\n var campoNombre=document.getElementById('nombreAbogado');\r\n var dni=document.getElementById('dniAbogado').value.trim();\r\n var campoDni=document.getElementById('dniAbogado');\r\n var sueldo=document.getElementById('sueldo').value.trim();\r\n var campoSueldo=document.getElementById('sueldo');\r\n var error=\"\";\r\n\r\n var oExpReg=/^[A-Z][a-z]{3,40}$/;\r\n\r\n if(oExpReg.test(nombre)==false){\r\n\r\n error+=\"Error en el campo nombre<br>\";\r\n campoNombre.style.backgroundColor=\"orange\";\r\n }else{\r\n campoNombre.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{8}[a-zA-Z]$/;\r\n\r\n if(oExpReg.test(dni)==false){\r\n\r\n error+=\"Error en el campo dni<br>\";\r\n campoDni.style.backgroundColor=\"orange\";\r\n }else{\r\n campoDni.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{3,4},\\d{2}$/;\r\n\r\n if(oExpReg.test(sueldo)==false){\r\n\r\n error+=\"Error en el campo sueldo<br>\";\r\n campoSueldo.style.backgroundColor=\"orange\";\r\n }else{\r\n campoSueldo.style.backgroundColor=\"white\";\r\n\r\n }\r\n\r\n if(error!=\"\"){\r\n toastr.error(error,\"Fallo en la Validacion\");\r\n validacion=false;\r\n }\r\n\r\n\r\n\r\n return validacion;\r\n\r\n}", "function validateParts(parts) {\r\n\t\t\tfor (var i = 0; i < parts.length; ++i) {\r\n\t\t\t\tif (!gl.isPositiveInteger(parts[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "function valSearchUdhaarByCustomAmountRangeInputs(obj) {\r\n if (validateEmptyField(document.srch_udhaar_customAmtRange.udhaarCustomAmtStartRange.value, \"Please enter start range!\") == false ||\r\n validateNum(document.srch_udhaar_customAmtRange.udhaarCustomAmtStartRange.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_udhaar_customAmtRange.udhaarCustomAmtStartRange.focus();\r\n return false;\r\n } else if (validateEmptyField(document.srch_udhaar_customAmtRange.udhaarCustomAmtEndRange.value, \"Please enter end range!\") == false ||\r\n validateNum(document.srch_udhaar_customAmtRange.udhaarCustomAmtEndRange.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_udhaar_customAmtRange.udhaarCustomAmtEndRange.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function recValidate() {\n var recvalue = document.getElementById(\"rectscale\");\n sum = Number(recvalue.value)\n if(Number(sum)) {\n \n } else {\n alert(\"Numbers only, please!\");\n };\n}", "function akarAngkaValidation(){\n\t//init value\n\tvar valResult = [];\n\tvar angka1 = document.getElementById(\"T2_angka1\").value;\n\t\n\t//validation\n\tif(!angka1){\n\t\tvalResult.push(\"Angka 1 tidak boleh kosong\");\n\t}\n\telse{\n\t\tif(isNaN(angka1)){\n\t\t\tvalResult.push(\"Angka 1 harus diisi dengan angka\");\n\t\t}\n\t}\n\n\treturn valResult;\n}", "function Validar_Text_Number(obj)\n{\n\tjq(obj).validCampoAPP('abcdefghijklmnñopqrstuvwxyzáéíóú0123456789 ');\n}", "function numerosLlenos()\n{\n\tvalido = true;\n\n\t$(\".todos_numeros\").each(function()\n\t{\n\t\tif ($(this).val() == \"\")\n\t\t{\n\t\t\t$(this).val(\"\");\n\t\t\t$(this).attr(\"placeholder\", \"* Requerido\");\n\t\t\t$(this).addClass(\"border_rojo\");\n\n\t\t\tvalido = false;\n\t\t}\n\t})\n\n\treturn valido;\n}", "function ValidaCorreo(nombre, _G_ID_) {\n var p = $(_G_ID_ + '_txt_' + nombre).val();\n var errors = [];\n if (!p.includes('.')) {\n errors.push('Menor');\n redLabel_Space(nombre, 'El correo es incorrecto', _G_ID_);\n }\n if (!p.includes('@')) {\n errors.push('Menor');\n redLabel_Space(nombre, 'El correo es incorrecto', _G_ID_);\n }\n if (errors.length > 0) {\n return false;\n }\n return true;\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 validarErrSig(ecu){ // 2 + 2\nlet erss = [];\nlet ers = 0;\nlet signos = ['{','[', '(', ')', ']', '}','+', '-', '*', '/', ' ','=', '^','|','||','&','&&', '<', '>', '<>', '<=', '>=','1','2','3','4','5','6','7','8','9','0'];\n\nfor (let i = 0; i < ecu.length; i++) {\nif(signos.includes(ecu[i])){\n \n}else{\n erss.push(ecu[i]);\n ers++;\n}\n}\n\nif(ers > 0){\nreturn {consigers: true , erers: erss} \n}else{\nreturn {consigers: false , erers: 'Todo Correcto'} \n}\n\n}", "function validaCompetidor(competidor) {\n\n var erros = [];\n\n if (competidor.largada.length == 0) {\n erros.push(\"A largada não pode ser em branco\");\n }\n\n\n if (competidor.competidor.length == 0) {\n erros.push(\"O competidor não pode ser em branco\");\n }\n\n if (competidor.tempo.length == 0) {\n erros.push(\"O tempo não pode ser em branco\");\n }\n\n if (!validaLargada(competidor.largada)) {\n erros.push(\"A largada é inválida\");\n }\n\n if (!validaTempo(competidor.tempo)) {\n erros.push(\"O tempo é inválido\");\n }\n\n return erros;\n\n}", "function validamos(){\n \n if(isNaN(document.getElementById(\"dni\").value)){\n alert (\"El campo Dni acepta solo numeros\");\n return false;\n }\n\n if(isNaN(document.getElementById(\"numTarj\").value)){\n alert (\"El campo Numero de Tarjeta acepta solo numeros\");\n return false;\n }\n \n return true;\n}", "function pOdValidator(num) {\n if (num % 2 === 0) {\n return \" è un numero pari, quindi hanno vinto i pari!\";\n } else {\n return \" è un numero dispari, quindi hanno vinto i dispari!\";\n }\n }", "function ValidaSoloNumeros() \n\t{\n \t\tif ((event.keyCode < 48) || (event.keyCode > 57)) \n \t\tevent.returnValue = false;\n\t}", "function clean(number) {\n const AllowChar = \"1234567890+()-. \";\n const Letter = \"abcdefghijklmnopqrstuvwxyz\";\n if (number.split('').filter(i => AllowChar.includes(i)).length != number.length ) {\n if (number.split('').filter(i => !Letter.includes(i)).length != number.length) {\n throw \"Letters not permitted\";\n }\n throw \"Punctuations not permitted\";\n }\n const choosefrom = \"1234567890\";\n let puretext = number.split('').filter(i => choosefrom.includes(i)).join('');\n if (puretext.length > 11) {\n throw \"More than 11 digits\";\n }\n if (puretext.length <= 11 && puretext.length > 9) {\n if (puretext[0] != '1' && puretext.length === 11) {\n throw \"11 digits must start with 1\";\n }\n \n let edit = puretext.slice(-10);\n if (edit[0] == '0') {\n throw 'Area code cannot start with zero';\n }\n if (edit[0] == '1') {\n throw 'Area code cannot start with one';\n }\n if (edit[3] == '0') {\n throw 'Exchange code cannot start with zero';\n }\n if (edit[3] == '1') {\n throw 'Exchange code cannot start with one';\n }\n \n return edit;\n } else throw \"Incorrect number of digits\";\n}", "function custom(theValue) {\n //+ - 1 sau mai multe\n // 0 sau mai multe\n //? sursa : https://stackoverflow.com/questions/19715303/regex-that-accepts-only-numbers-0-9-and-no-characters\n //?sursa pt nr cu , : https://stackoverflow.com/questions/12643009/regular-expression-for-floating-point-numbers\n if(/^([0-9]+[.])?[0-9]+$/.test(theValue)) {\n ctrl.$setValidity(\"doarCifre\",true);\n }else {\n ctrl.$setValidity(\"doarCifre\",false);\n } \n return theValue;\n }", "function validacionCampos(nombreCampo, valorCampo, tipoCampo) {\n\n var expSoloCaracteres = /^[A-Za-zÁÉÍÓÚñáéíóúÑ]{3,10}?$/;\n var expMatricula = /^([A-Za-z]{1}?)+([1-9]{2}?)$/;\n\n if (tipoCampo == 'select') {\n valorComparar = 0;\n } else {\n valorComparar = '';\n }\n\n //validamos si el campo es rellenado.\n if (valorCampo != valorComparar) {\n $('[id*=' + nombreCampo + ']').removeClass('is-invalid');\n\n //Aplicamos validaciones personalizadas a cada campo.\n if (nombreCampo == 'contenidoPagina_nombreMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n\n }\n else if (nombreCampo == 'contenidoPagina_apellidoMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n \n }\n else if (nombreCampo == 'contenidoPagina_especialidadMedico') {\n return true;\n\n }\n else if (nombreCampo == 'contenidoPagina_matriculaMedico') {\n\n if (expMatricula.test(valorCampo)) {\n\n $(\"[id*=contenidoPagina_matriculaMedico]\").off('keyup');\n $(\"[id*=contenidoPagina_matriculaMedico]\").on('keyup', function () {\n return validarMatriculaUnica($(this).val(), matAcomparar);\n });\n\n return validarMatriculaUnica($(\"[id*=contenidoPagina_matriculaMedico]\").val(), matAcomparar);\n } else {\n mostrarMensaje(nombreCampo, 'estructuraInc');\n return false;\n } \n }\n } else {\n mostrarMensaje(nombreCampo, 'incompleto');\n return false;\n }\n }", "function isValidNumDigits(field, min, max, sName) {\n\n\tvar str = field.value;\n\tvar len;\n\t\n // this will get rid of leading spaces \n while (str.substring(0,1) == ' ') \n str = str.substring(1, str.length);\n\n\t// this will get rid of trailing spaces \n while (str.substring(str.length-1,str.length) == ' ')\n str = str.substring(0, str.length-1);\n \n len = str.length;\n \n if ( (len >= min) && (len <= max) ) {\n\t\t\n\t\tfor (var i=0;i < len;i++) {\n\t\t\tif ((str.substring(i,i+1) < '0') || (str.substring(i,i+1) > '9')) {\n\t\t\t\talert(sName + ' should only contain numbers.');\n\t\t\t\tfield.focus();\n\t\t\t return false; \n\t\t\t}\n\t\t}\n\t\t\n } else {\n\t\tif (min == max) {\n\t\t\talert(sName + ' should be a ' + min + ' digit number.');\n\t\t} else {\n\t\t\talert(sName + ' should be a ' + min + ' - ' + max + ' digit number.');\n\t\t}\n\t\tfield.focus;\n\t\treturn false\n } \n \n return true;\n}", "function telponValidation (telephone) {\r\n if (telephone.length < 4) {\r\n return false;\r\n } else {\r\n for (var i = 0; i < telephone.length; i++) {\r\n if (!(telephone[i] >= '0' && telephone[i] <= '9')) {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "function pangkatAngkaValidation(){\n\t//init value\n\tvar valResult = [];\n\tvar angka1 = document.getElementById(\"T1_angka1\").value;\n\tvar angka2 = document.getElementById(\"T1_angka2\").value;\n\t\n\t//validation\n\tif(!angka1){\n\t\tvalResult.push(\"Angka 1 tidak boleh kosong\");\n\t}\n\telse{\n\t\tif(isNaN(angka1)){\n\t\t\tvalResult.push(\"Angka 1 harus diisi dengan angka\");\n\t\t}\n\t}\n\t\n\tif(!angka2){\n\t\tvalResult.push(\"Angka 2 tidak boleh kosong\");\n\t}\n\telse{\n\t\tif(isNaN(angka2)){\n\t\t\tvalResult.push(\"Angka 2 harus diisi dengan angka\");\n\t\t}\n\t}\t\n\n\treturn valResult;\n\t\n}", "function validarTelefono(telefono){\n var numero = telefono.value; //se asigna el valor de telefono a la variable numero\n \n if(numero==\"\"){//valida que hay algo escrito\n telefono.setCustomValidity(\"Ingrese algun valor numerico\");\n return false;\n }else if(numero.includes(\" \")){//valida que no hay espacios\n telefono.setCustomValidity(\"Quite los espacios por favor \");\n return false;\n }else if(isNaN(numero)){ //verifica que solo sean valores numericos\n telefono.setCustomValidity(\"Introduce solo valores numericos\");\n return false;\n }else if(numero.length < 9){\n telefono.setCustomValidity(\"El largo del telefono es insuficiente, escriba uno de 9 o mas\");//se define un largo minimo a respetar\n return false;\n }\ntelefono.setCustomValidity('');//se resetea el setCustomValidity en caso de haber ocurrido alguna ocurrencia en el if\n}", "function ValidateIdStudent(form) {\r\n if (valideIdUser(form))\r\n if (form.id_group_log.value == 3) { // si el grupo es estudiantes\r\n strCarne = new String;\r\n strCarne = form.id_user_log.value;\r\n strYear = new String;\r\n var intNumeric = 0;\r\n switch (strCarne.length) {\r\n // esto es necesario si son carnes con inicio de 98 y 99\r\n case 7:\r\n intNumeric = strCarne;\r\n if (intNumeric > 9799999) {\r\n strCarne = \"19\" + strCarne;\r\n form.id_user_log.value = strCarne;\r\n }\r\n else {\r\n strCarne = \"00\" + strCarne;\r\n form.id_user_log.value = strCarne;\r\n }\r\n break;\r\n // esto es necesario si son carnes con todo el anio completo pero menores a 1998\r\n case 9:\r\n strYear = strCarne.charAt(0) + strCarne.charAt(1) + strCarne.charAt(2) + strCarne.charAt(3);\r\n if (strYear < 1998) {\r\n form.id_user_log.value = \"00\" + strCarne.substr(2, strCarne.length - 2);\r\n }\r\n break;\r\n //esto es necesario para autocompletar para carnes de longitud distinta\r\n default:\r\n for (; (strCarne.length < 9);) {\r\n strCarne = \"0\" + strCarne;\r\n }\r\n form.id_user_log.value = strCarne;\r\n }\r\n }\r\n else {\r\n strRegPer = new String;\r\n strRegPer = form.id_user_log.value;\r\n //esto es necesario para autocompletar porque son registros de personal\r\n for (; (strRegPer.length < 9);) {\r\n strRegPer = \"0\" + strRegPer;\r\n }\r\n form.id_user_log.value = strRegPer;\r\n }\r\n} // end de la function Completar", "function validation()\r\n{\r\n\tvar reference = new String(document.getElementById(\"reference\").value);\r\n\tif (reference.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(referenceNonRenseignee);\r\n\t}\r\n\r\n\tif (!verifier(reference))\r\n\t{\r\n\t\treturn afficheErreur(referenceLettreRequise);\t\t\r\n\t}\r\n\t\r\n\tvar titre = new String(document.getElementById(\"titre\").value);\r\n\tif (titre.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(titreNonRenseigne);\r\n\t}\r\n\t\r\n\tvar auteurs = new String(document.getElementById(\"auteurs\").value);\r\n\tif (auteurs.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(auteursNonRenseignes);\r\n\t}\r\n\r\n\tvar editeur = new String(document.getElementById(\"editeur\").value);\r\n\tif (editeur.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editeurNonRenseigne);\r\n\t}\r\n\t\r\n\tvar edition = new String(document.getElementById(\"edition\").value);\r\n\tif (edition.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editionNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(edition))\r\n\t{\r\n\t\treturn afficheErreur(editionDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar annee = new String(document.getElementById(\"annee\").value);\r\n\tif (annee.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(anneeNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(annee) || annee.length != 4)\r\n\t{\r\n\t\treturn afficheErreur(anneeDoitEtreNombre4Chiffres);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar isbn = new String(document.getElementById(\"isbn\").value);\r\n\tif (isbn.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(isbnNonRenseigne);\r\n\t}\r\n\tif (isNaN(isbn))\r\n\t{\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar nombreExemplaires = new String(document.getElementById(\"nombreExemplaires\").value);\r\n\tif (nombreExemplaires.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(nombreExemplairesNonRenseigne);\r\n\t\t\r\n\t}\r\n\tif (isNaN(nombreExemplaires))\r\n\t{\r\n\t\t// Afficher Erreur Correspondante\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\r\n\tvar disponibilite = document.getElementById(\"Disponibilite\").checked;\r\n\tvar excluPret = document.getElementById(\"excluPret\").checked;\r\n\tvar commentaires = new String(document.getElementById(\"Commentaires\").value);\r\n\t// crŽation d'un ouvrage \r\n\t\r\n\tvar ouvrage = new Array();\r\n\touvrage[indiceReference] = reference;\r\n\t// Completer l'ouvrage\r\n\touvrage[indiceTitre] = titre;\r\n\touvrage[indiceAuteurs] = auteurs;\r\n\touvrage[indiceEditeur] = editeur;\r\n\touvrage[indiceEdition] = edition;\r\n\touvrage[indiceAnnee] = annee;\r\n\touvrage[indiceIsbn] = isbn;\r\n\touvrage[indiceNombreExemplaires] = nombreExemplaires;\r\n\touvrage[indiceDisponibilite] = disponibilite;\r\n\touvrage[indiceExcluPret] = excluPret;\r\n\touvrage[indiceCommentaires] = commentaires;\r\n\touvrages[nombreOuvrages] = ouvrage;\r\n\tnombreOuvrages++;\r\n\t\r\n\tafficherResume(ouvrage);\r\n\treset_validation()\r\n\t\r\n}", "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 }", "function ValidarCNPJ(ObjCnpj){\n var cnpj = ObjCnpj.value;\n var valida = new Array(6,5,4,3,2,9,8,7,6,5,4,3,2);\n var dig1= new Number;\n var dig2= new Number;\n\n exp = /\\.|\\-|\\//g\n cnpj = cnpj.toString().replace( exp, \"\" ); \n var digito = new Number(eval(cnpj.charAt(12)+cnpj.charAt(13)));\n\n for(i = 0; i<valida.length; i++){\n dig1 += (i>0? (cnpj.charAt(i-1)*valida[i]):0); \n dig2 += cnpj.charAt(i)*valida[i]; \n }\n dig1 = (((dig1%11)<2)? 0:(11-(dig1%11)));\n dig2 = (((dig2%11)<2)? 0:(11-(dig2%11)));\n\n if(((dig1*10)+dig2) != digito){\n\t\t\tdocument.getElementById('cnpj').value='';\n alert('CNPJ Invalido!');\n\t\t}\n\n}", "function validar_telefono(id, spanId) {\n var span = document.getElementById(spanId);\n var input = document.forms[\"formulario\"][id];\n var str = input.value;\n // Expresión regular para validar un número de teléfono\n var regex = new RegExp(/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$/);\n var correcto;\n if (!regex.test(str)) {\n input.className = \"input is-danger\";\n span.className = \"help is-danger\";\n correcto = false;\n } else {\n input.className = \"input is-success\";\n span.className = \"help is-danger is-hidden\";\n correcto = true;\n }\n return correcto;\n}", "function justNumeros(n) {\n key = n.keyCode || e.which;\n teclado = String.fromCharCode(key);\n numeros=\"0123456789\";\n especiales = \"8-37-39-46\";\n teclas_especiales = false;\n for (var i in especiales) {\n if (key==especiales[i]) {\n teclas_especiales = true;\n }\n }\n\n if (numeros.indexOf(teclado) == -1 && !teclas_especiales){\n return false;\n }\n}", "checkPerimeter() {\n if(this.minLength < TriCountEnum.MIN_RANGE || this.minLength > TriCountEnum.MAX_RANGE) {\n throw new RangeError('minLength is between ' + TriCountEnum.MIN_RANGE + ' and ' + TriCountEnum.MAX_RANGE + ', inclusive.');\n } else if(this.minLength > this.maxLength){\n throw new RangeError('maxLength value is smaller than minLength value');\n } else if(this.maxLength > TriCountEnum.MAX_RANGE) {\n throw new RangeError('maxLength is between ' + this.minLength + ' and '+ TriCountEnum.MAX_RANGE + ', inclusive');\n }\n }", "function validaNombre(nombre){\n var nombre1 = nombre.value; //asigno el valor de la variable nombre a una nueva variable\n var primeraLetra = nombre1.charAt(0); //asigno el valor de la primera letra a una variable nueva\n var patron=/[A-Z]/g; //se crea un patron\n \n if( nombre1==''||primeraLetra.match(patron)==null)//si el nombre esta vacio o no se encuentra una coincidencia de la primera letra con el patron devuelve el mensaje con setCustomValidity\n {\n nombre.setCustomValidity(\"Tiene que iniciar con mayuscula\");\n return false;\n }\n nombre.setCustomValidity(''); //se resetea el setCustomValidity en caso de haber ocurrido alguna ocurrencia en el if\n}", "function validasiNama (nama) {\r\n if (nama == \"\") {\r\n return false;\r\n } else {\r\n for (var i = 0; i < nama.length; i++) {\r\n if((nama[i] >='0' && nama[i] <= '9')) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}", "function validarFormulario(){\n var flagValidar = true;\n var flagValidarRequisito = true;\n\n if(txtCrben_num_doc_identific.getValue() == null || txtCrben_num_doc_identific.getValue().trim().length ==0){\n txtCrben_num_doc_identific.markInvalid('Establezca el numero de documento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_nombres.getValue() == null || txtCrben_nombres.getValue().trim().length ==0){\n txtCrben_nombres.markInvalid('Establezca el nombre, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCrecv_codigo.getValue() == null || cbxCrecv_codigo.getValue().trim().length ==0){\n cbxCrecv_codigo.markInvalid('Establezca el estado civil, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_apellido_paterno.getValue() == null || txtCrben_apellido_paterno.getValue().trim().length ==0){\n txtCrben_apellido_paterno.markInvalid('Establezca el apellido, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCpais_nombre_nacimiento.getValue() == null || cbxCpais_nombre_nacimiento.getValue().trim().length ==0){\n cbxCpais_nombre_nacimiento.markInvalid('Establezca el pais de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(dtCrper_fecha_nacimiento.isValid()==false){\n dtCrper_fecha_nacimiento.markInvalid('Establezca la fecha de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n for (var i = 0; i < gsCgg_res_solicitud_requisito.getCount(); i++) {\n var rRequisito = gsCgg_res_solicitud_requisito.getAt(i);\n if (rRequisito.get('CRSRQ_REQUERIDO') == true) {\n if (rRequisito.get('CRRQT_CUMPLE') == false) {\n flagValidarRequisito = false;\n }\n }\n }\n\n if (flagValidarRequisito == false) {\n Ext.Msg.show({\n title: tituloCgg_res_beneficiario,\n msg: 'Uno de los requisitos necesita cumplirse, por favor verifiquelos.',\n buttons: Ext.Msg.OK,\n icon: Ext.MessageBox.WARNING\n }); \n grdCgg_res_solicitud_requisito.focus();\n flagValidar = false;\n }\n return flagValidar;\n }", "function checkNumerator() {\n var medMin = 10;\n\n // List of medications\n var medList = patient.medications();\n\n // Filters\n var medActive = filter_activeMeds(medList);\n\n return isMatch(medActive) && ( medMin <= medActive.length );\n\n }", "function validarValor(valor){\n cadena=/^[0-9]+(\\.+[0-9]+)*$/;\n if(cadena.test(valor))\n return 1;\n else\n return 0;\n}" ]
[ "0.6833627", "0.66488755", "0.6527119", "0.6515081", "0.64495075", "0.6447154", "0.64043987", "0.63646114", "0.6309656", "0.6294315", "0.62799543", "0.62775326", "0.62419873", "0.6202933", "0.6181346", "0.6152914", "0.614273", "0.6108729", "0.61048865", "0.6091144", "0.6079212", "0.60745686", "0.60509825", "0.6050914", "0.6047886", "0.60402167", "0.60287", "0.60220134", "0.6020734", "0.6009924", "0.5997414", "0.59928805", "0.5979732", "0.59513164", "0.59489524", "0.59410286", "0.5940794", "0.59331393", "0.5926918", "0.5922481", "0.59203136", "0.5918992", "0.5915698", "0.5913531", "0.59133416", "0.5909259", "0.59068656", "0.5904541", "0.59041667", "0.5900058", "0.58949995", "0.5871661", "0.5863643", "0.5842777", "0.5838988", "0.5829945", "0.581456", "0.58130217", "0.5809962", "0.5807786", "0.5791435", "0.57909745", "0.57900214", "0.5780358", "0.57727516", "0.5770229", "0.57687557", "0.5767113", "0.5762822", "0.5762331", "0.57623285", "0.5759417", "0.5752982", "0.57512546", "0.5751047", "0.575096", "0.5749452", "0.5749429", "0.57435334", "0.5737809", "0.57364476", "0.5735243", "0.57343316", "0.5702074", "0.57001644", "0.5698189", "0.569812", "0.56922024", "0.568766", "0.5687442", "0.5685075", "0.56818694", "0.56807727", "0.567419", "0.5672328", "0.5672288", "0.5671868", "0.56682515", "0.5665762", "0.5663271" ]
0.60487604
24
Funcao usada para realizar a pesquisa de acordo com a opcao de campo (nome, logradouro, cpf,...) escolhida pelo usuario Esta funcao eh chamada pela funcao confirmarBuscarTodos(campo, op)
function submeter(op) { // Seta a opcao de pesquisa escolhida para o action correspondente funcionar corretamente document.formPaciente.opcao.value = op; switch(op){ // PESQUISAR PELO NOME case 0: { // Linha abaixo comentada para manter acentos //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(document.formPaciente.nome.value).toLowerCase()); document.formPaciente.nome.value = primeirasLetrasMaiusculas(document.formPaciente.nome.value).toLowerCase(); document.formPaciente.submit(); }break; // PESQUISAR PELO CPF case 1: { document.formPaciente.submit(); }break; // PESQUISAR PELO LOGRADOURO case 2:{ // Linha abaixo comentada para manter acentos //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(document.formPaciente.logradouro.value).toLowerCase()); document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(document.formPaciente.logradouro.value).toLowerCase(); document.formPaciente.submit(); }break; // PESQUISAR PELO CODIGO case 3:{ document.formPaciente.submit(); }break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmarBuscarTodos(campo, op) {\n if ((trim(campo.value) == '') || (campo.value == null)) {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n submeter(op);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n submeter(op);\n return true;\n }\n}", "function confirmarBuscarTodos(campo, op) {\n if ((trim(campo.value) == '') || (campo.value == null)) {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n submeter(op);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n submeter(op);\n return true;\n }\n}", "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function consultarComEnter(event, campo, op) {\n var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;\n if (keyCode == 13)\n return confirmarBuscarTodos(campo, op);\n else\n return event;\n}", "function consultarComEnter(event, campo, op) {\n var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;\n if (keyCode == 13) {\n return confirmarBuscarTodos(campo, op);\n }\n else {\n return event;\n }\n}", "function CheckOp(op) {\n //si el campo no esta vacio\n if (Number(tfInput.value) || tfInput.value === \"0\") {\n if (cOperador) {//a partir del segundo dato\n numActual = Number(tfInput.value);\n strOperacion += cOperador + String(numActual);\n igual();\n cOperador = op;\n numPrevio = numAcumulado;\n }\n else {//primer dato\n numPrevio = Number(tfInput.value);\n strOperacion += numPrevio;\n cOperador = op;\n }\n limpiaTF();\n }\n}", "function verTodos() {\n\n document.getElementById(\"txtNombreFiltroCargo\").value = '';\n document.getElementById(\"selArea2\").value = '-1';\n listarCargos(1);\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 }", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "function buscarUsuarioDisponible(itemUsuario,itemSubmit) {\n\t// Almacenamos en el control al funcion que se invocara cuando la peticion cambie de estado\n\tajax = new XMLHttpRequest();\n\tajax.onreadystatechange = validaUsuarioDisponible;\n\titem[0] = itemUsuario;\n\titem[1] = itemSubmit;\n\tvar usuario = id(itemUsuario).value;\n\tvar variables = \"&usuario=\" + usuario;\n\tvariables += \"&esAjax=\" + true;\n\t\n\tajax.open(\"POST\", \"BuscarInformacionFormularios?metodoDeBusqueda=1\" + variables, true);\n\tajax.send(\"\");\n}", "function realizarBusqueda(){\r\n let criterioDeBusq = document.querySelector(\"#buscadorDeEjercicios\").value;\r\n let mensaje = \"\";\r\n if (validarCampoLleno(criterioDeBusq)&& criterioDeBusq.length!==1){\r\n mensaje = buscarSegunCriterio(criterioDeBusq);\r\n document.querySelector(\"#divEjElegido\").innerHTML = mensaje;\r\n addEventsEntrega();\r\n }else{\r\n document.querySelector(\"#errorBuscadorDeEjercicios\").innerHTML = \"Debe llenar el campo con al menos dos caracteres\"; \r\n }\r\n}", "function executarOperacao(evt) {\n console.log('Form Submit');\n // \tanular a submissão automática da form\n evt.preventDefault();\n switch (operacao) {\n case 'create':\n criarAluno();\n break;\n case 'read':\n lerAluno();\n break;\n case 'update':\n actualizarAluno();\n break;\n case 'delete':\n apagarAluno();\n break;\n\n }\n\n\n}", "function validarFormulario(eventopordefecto)\t\n{\t\n // Pediremos la confirmacion del envio al usuario y posteriormente comprobaremos todas las funciones de validacion.\n\tif (confirm(\"¿Deseas enviar el formulario?\") &&validarNombre() && validarApellidos() && validarEdad() && validarNif() && validarEmail() && validarProvincia() && validarFecha() && validarTelefono() && validarHora())\n { \n // si el usuario pulsa aceptar y todo esta bien, enviaremos el formulario.\n return true;\n }\n \telse\n {\t\n // si el usuario cancela el envio o alguna de las comprobaciones no son correctas, volveremos al formulario.\n // sumaremos uno al contador de intentos y lo haremos visible.\n eventopordefecto.preventDefault();\n count += 1;\n document.cookie = \"contador=\"+count;\n document.getElementById(\"intentos\").innerHTML = \"Intento de envios del formulario: \"+count;\n\t\treturn false;\n }\n}", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "function checarNroApoliceVazio(nroApolice){\r\n\tif (nroApolice.length==0 || nroApolice==\"\"){\r\n\t\tif ($('#statusOperacional').val()==2){\r\n\t\t\tif (confirm(\"Esta alteração ira limpar todas as informações de Apólice e retornar o estado de Proposta! \\n CONFIRMA?\")){\r\n\t\t\t\t$('#dataEmissaoApolice').val(\"\");\r\n\t\t\t\t$('#dataBaixaApolice').val(\"\");\r\n\t\t\t\t$('#dataLanctoApolice').val(\"\");\r\n\t\t\t\t$('#dataRecebApolice').val(\"\");\r\n\t\t\t\t$('#propostaCodigoIdentificacao').val(\"\");\r\n\t\t\t}else\r\n\t\t\t\tdocument.formEdit.reset();\r\n\t\t}else if ($('#statusOperacional').val()==0 || $('#statusOperacional').val()==4){\r\n\t\t\t$('#dataEmissaoApolice').val(\"\");\r\n\t\t\t$('#dataBaixaApolice').val(\"\");\r\n\t\t\t$('#dataLanctoApolice').val(\"\");\r\n\t\t\t$('#dataRecebApolice').val(\"\");\r\n\t\t\t$('#propostaCodigoIdentificacao').val(\"\");\r\n\t\t}\r\n\t}\r\n}", "function modificarUsuarioVertodos(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2Todos\").val(nombreusuario);\n $(\"#newemailUpTodos\").val(emailusuario);\n $(\"#checkUpTodos\").val(userStatus);\n $(\"#idusuarioUpTodos\").val(id);\n $(\"#pass2UpTodos\").val(passusuario);\n}", "function listarTodosPreguntaGenerico(metodo){\r\n\r\n\tvar idCuerpoTabla = $(\"#cuerpoTablaPregunta\");\r\n\tvar idLoaderTabla = $(\"#loaderTablaPregunta\");\t\r\n\tvar idAlertaTabla = $(\"#alertaTablaPregunta\");\r\n\r\n\tlimpiarTabla(idCuerpoTabla,idLoaderTabla,idAlertaTabla);\r\n\r\n\tloaderTabla(idLoaderTabla,true);\r\n\r\n\r\n\tconsultar(\"pregunta\",metodo,true).done(function(data){\r\n\t\t\r\n\t\tvar cantidadDatos = data.length;\r\n\t\tvar contador = 1;\r\n\r\n\t\tdata.forEach(function(item){\r\n\r\n\t\t\tvar datoNumero = $(\"<td></td>\").text(contador);\r\n\t\t\tvar txtAreaNombre = $(\"<textarea class='textarea-table' disabled='disabled'></textarea>\").text(item.nombre);\r\n\t\t\tvar datoTipoFormacion = $(\"<td></td>\").text(item.detalleTipoFormacion.nombre);\r\n\t\t\tvar datoEstado = $(\"<td></td>\").text(item.detalleEstado.nombre);\r\n\r\n\r\n\t\t\tvar datoOpciones = \"<td>\"+\r\n\t\t\t'<button id=\"btnModificarPregunta'+contador+'\" class=\"btn btn-table espacioModificar\" data-toggle=\"modal\" data-target=\"#modalModificarPregunta\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></button>'+\r\n\t\t\t\"</td>\";\r\n\r\n\r\n\t\t\t\r\n\t\t\tvar datoNombre = $(\"<td></td>\").append(txtAreaNombre);\r\n\t\t\t\r\n\t\t\tvar fila = $(\"<tr></tr>\").append(datoNumero,datoNombre,datoTipoFormacion,datoEstado,datoOpciones);\r\n\t\t\t\r\n\t\t\tidCuerpoTabla.append(fila);\r\n\r\n\t\t\t\r\n\t\t\tasignarEventoClickPregunta(item.id,item.nombre,item.detalleTipoFormacion.id,item.detalleEstado.id,contador);\r\n\r\n\t\t\tcontador++; \t\r\n\t\t})\r\n\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tverificarDatosTabla(idAlertaTabla,cantidadDatos);\r\n\r\n\t}).fail(function(){\t\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tagregarAlertaTabla(idAlertaTabla,\"error\");\r\n\t})\r\n}", "obtenerTodosOperarioPersona() {\n return axios.get(`${API_URL}/v1/operario/`);\n }", "function fEliminar(){\n if (cPermisoPag != 1){\n fAlert(\"No tiene Permiso de ejecutar esta acción\");\n return;\n }\n\n if(lBandera == true){\n fAlert(\"No puede efectuar esta operación mientras se encuentre realizando otra transacción\");\n return;\n }\n\n frm.hdCveOpinionEntidad.value = \"\";\n frm.iCveSistema.value = \"\";\n frm.hdCveModulo.value = \"\";\n frm.iNumReporte.value = \"\";\n\n aDoc = FRMListado.fGetObjs(0);\n\n for(cont=0;cont < aDoc.length;cont++){\n if(aDoc[cont]){\n if (frm.hdCveOpinionEntidad.value==\"\") frm.hdCveOpinionEntidad.value=aResLis[cont][0]; else frm.hdCveOpinionEntidad.value+=\",\"+aResLis[cont][0];\n if (frm.iCveSistema.value==\"\") frm.iCveSistema.value=aResLis[cont][1]; else frm.iCveSistema.value+=\",\"+aResLis[cont][1];\n if (frm.hdCveModulo.value==\"\") frm.hdCveModulo.value=aResLis[cont][2]; else frm.hdCveModulo.value += \",\" + aResLis[cont][2];\n if (frm.iNumReporte.value==\"\" ) frm.iNumReporte.value=aResLis[cont][3]; else frm.iNumReporte.value+=\",\"+aResLis[cont][3];\n }\n }\n\n if (frm.iCveSistema.value == \"\"){\n fAlert ('\\nSeleccione al menos un registro para realizar esta operación.');\n return;\n }\n\n frm.hdBoton.value = \"Borrar\";\n frm.hdFiltro.value = \"\";\n if(fEngSubmite(\"pgGRLReporteXOpinion.jsp\",\"idElimina\")){\n FRMPanel.fSetTraStatus(\"UpdateComplete\");\n fDisabled(true);\n FRMListado.fSetDisabled(false);\n }\n\n fCargaListadoA();\n }", "function irAAgregarMaestro(){\r\n\tvar msg = \"Desea Agregar un NUEVO REGISTRO?.. \";\r\n\tif(confirm(msg)) Cons_maestro(\"\", \"agregar\",tabla,titulo);\r\n}", "ListarPermisosEnviados_Usuario(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { envia, id_empleado } = req.params;\n const DATOS = yield database_1.default.query('SELECT rn.id, rn.id_send_empl, rn.id_receives_empl, ' +\n 'rn.id_receives_depa, rn.estado, rn.create_at, rn.id_permiso, e.nombre, e.apellido, e.cedula, ' +\n 'ctp.descripcion AS permiso, p.fec_inicio, p.fec_final ' +\n 'FROM realtime_noti AS rn, empleados AS e, permisos AS p, cg_tipo_permisos AS ctp ' +\n 'WHERE id_permiso IS NOT null AND e.id = rn.id_receives_empl AND rn.id_send_empl = $1 AND ' +\n 'rn.id_receives_empl = $2 AND ' +\n 'p.id = rn.id_permiso AND p.id_tipo_permiso = ctp.id ORDER BY rn.id DESC', [envia, id_empleado]);\n if (DATOS.rowCount > 0) {\n return res.jsonp(DATOS.rows);\n }\n else {\n return res.status(404).jsonp({ text: 'No se encuentran registros' });\n }\n });\n }", "function listarPuntos(event) {\n whichWorkMode.then(function (esModoConsulta) {\n\n // Valida que hayan puntos en el cuerpo para mostrar\n if (lesiones.length > 0) {\n\n var infoL = '';\n var idL;\n var onclickL;\n var str;\n\n // Si esta función ya se había ejecutado limpia los datos imprimidos en el DOM\n $(\".body_m_lesiones\").html('');\n\n // Recorrer los elementos con esta clase .lesion que sean hijos de #cont_cuerpo\n $('#cont_cuerpo > .lesion').each(function(indice, elemento) {\n\n // Recorre el arreglo infoLesion en la lesión seleccionada y arma la estructura\n // Html para concatenar en la estructura siguiente.\n for (var i = 0; i < 3; i++) {\n if (lesiones[indice].infoLesion[i]) {\n var Imprimir = (i == 2) ? 'CONSULTAR PARA VER EL RESTO.' : lesiones[indice].infoLesion[i].nombre;\n if (lesiones[indice].infoLesion[i]) {\n infoL += '<p>'+ Imprimir +'</p>\\n';\n }\n }\n }\n\n // Almacena el atributo #id del elemeto\n idL = $(elemento).attr('id');\n\n // Almacena el atributo onclick() del elemeto\n onclickL = $(elemento).attr('onclick');\n\n // Sustraer el primer argumento de la función onclick()\n // el cual es un indice que apunta a una posición del arreglo lesiones\n str = onclickL.substring(16,17);\n\n // Contador para completar el titulo Punto # ?\n var contador = indice + 1;\n\n var btnEliminar = \"\\\n <div onclick=\\\"EliminarLesion(\"+ str +\" , null , '\"+ idL +\"' , true )\\\" class='btn btn-eliminar tooltip'>\\\n <span class='fa fa-trash-o'></span>\\\n <span class='tooltiptext'>Eliminar</span>\\\n </div>\\\n \";\n\n if (esModoConsulta) {\n btnEliminar = \"\";\n }\n\n // Estructura de la consulta de un punto\n $(\".body_m_lesiones\").hide().append('\\\n <div class=\"item_lesion item_punto\">\\\n <div class=\"item_codigo\">\\\n <p><strong>Punto:</strong><span>#'+ contador +'</span></p>\\\n </div>\\\n <div class=\"item_text\">\\\n <div class=\"item_list_lesiones\">\\\n '+ infoL +'\\\n </div>\\\n <div>\\\n <div onclick=\"localizarPunto(\\''+ idL +'\\')\" class=\"btn btn-consultar tooltip\">\\\n <span class=\"fa fa-map-marker\"></span>\\\n <span class=\"tooltiptext\">Localizar</span>\\\n </div>\\\n <div onclick=\"consultarLesion('+ str +' , \\''+ idL +'\\', event, false)\" class=\"btn btn-registrar tooltip\">\\\n <span class=\"fa fa fa-eye\"></span>\\\n <span class=\"tooltiptext\">Consultar</span>\\\n </div>\\\n '+ btnEliminar +'\\\n </div>\\\n </div>\\\n </div>\\\n ').fadeIn('fast');\n\n // Reseteo de variables\n infoL = '';\n idL = '';\n str = '';\n\n });\n\n // Mostrar menu lateral\n event.stopPropagation();\n $('.menu_lesiones').css({right: '0px'});\n\n } else {\n\n // alerta de error\n Notificate({\n tipo: 'error',\n titulo: 'Error:',\n descripcion: 'No se ha agregado ningun punto.',\n duracion: 4\n });\n\n }\n\n }, function (err) {\n alert('No se pudó obtener el modo de trabajo.');\n });\n\n }", "function buscarPedidos(opcion){\n\t\tif(opcion=='1'){\n\t\t\tvar fecha1=$(\"#fechadel\").val();\n\t\t\tvar fecha2=$(\"#fechaal\").val();\n\t\t\t//var FechaInicioConv = convierteFechaJava(fecha1);\n\t\t\t//var FechaFinConv = convierteFechaJava(fecha2);\n\t\t\tif(fecha2<fecha1)\n\t\t\t{ \n\t\t\t\talert(\"La fecha incial no puede ser mayor a la fecha final\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\tvar FechaInicioConv = cambiarFormatoFecha(fecha1,'ymd','/');\n\t\t\tvar FechaFinConv = cambiarFormatoFecha(fecha2,'ymd','/');\n\n\t\t\t\n\t\t\tvar id_cliente=$(\"#select-cliente\").val();\n\t\t\tvar datos='cliente='+id_cliente+'&fecha1='+FechaInicioConv+'&fecha2='+FechaFinConv;\n\t\t}\n\t\tif(opcion=='2'){\n\t\t\tvar pedido=$(\"#pedido\").val();\n\t\t\tvar datos='pedido='+pedido;\n\t\t\tif(pedido==''){\n\t\t\t\talert(\"Ingrese un Pedido\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t$(\"#scroll-tabla\").html('');\n\t\t$.ajax({\n\t\t\tmethod:'POST',\n\t\t\turl:'../../code/ajax/especiales/buscarPedidos.php',\n\t\t\tdata:datos,\n\t\t\tsuccess: function(data) {\n\t\t\t\t$(\"#scroll-tabla\").html(data);\n\t\t\t}\n\t\t});\n\t}", "function listarTodosAprendizGenerico(metodo){\r\n\r\n\tvar idCuerpoTabla = $(\"#cuerpoTablaAprendiz\");\r\n\tvar idLoaderTabla = $(\"#loaderTablaAprendiz\");\t\r\n\tvar idAlertaTabla = $(\"#alertaTablaAprendiz\");\r\n\r\n\tlimpiarTabla(idCuerpoTabla,idLoaderTabla,idAlertaTabla);\r\n\r\n\tloaderTabla(idLoaderTabla,true);\r\n\r\n\r\n\tconsultar(\"aprendiz\",metodo,true).done(function(data){\r\n\t\t\r\n\t\tvar cantidadDatos = data.length;\r\n\t\tvar contador = 1;\r\n\r\n\t\tdata.forEach(function(item){\r\n\r\n\t\t\tvar datoNumero = $(\"<td></td>\").text(contador);\r\n\t\t\tvar datoIdentificacion = $(\"<td></td>\").text(item.identificacion);\r\n\t\t\tvar datoNombreCompleto = $(\"<td></td>\").text(item.nombreCompleto);\r\n\t\t\tvar datoFicha = $(\"<td></td>\").text(item.ficha.numero);\r\n\t\t\tvar datoDetalleEstado = $(\"<td></td>\").text(item.detalleEstado.nombre);\r\n\r\n\r\n\t\t\tvar datoOpciones = \"<td>\"+\r\n\t\t\t'<button id=\"btnModificarAprendiz'+contador+'\" class=\"btn btn-table espacioModificar\" data-toggle=\"modal\" data-target=\"#modalModificarAprendiz\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></button>'+\r\n\t\t\t\"</td>\";\r\n\r\n\r\n\r\n\t\t\tvar fila = $(\"<tr></tr>\").append(datoNumero,datoIdentificacion,datoNombreCompleto,datoFicha,datoDetalleEstado,datoOpciones);\r\n\r\n\t\t\tidCuerpoTabla.append(fila);\r\n\r\n\t\t\t\r\n\t\t\tasignarEventoClickAprendiz(item.id,item.identificacion,item.nombreCompleto,item.ficha.id,item.detalleEstado.id,contador);\r\n\r\n\t\t\tcontador++; \t\r\n\t\t})\r\n\t\t\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tverificarDatosTabla(idAlertaTabla,cantidadDatos);\r\n\r\n\t}).fail(function(){\t\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tagregarAlertaTabla(idAlertaTabla,\"error\");\r\n\t})\r\n}", "function guardarTodo(){\n \n pantallaDetalle.style.display = 'none'\n /* Agarramos los elementos de input con su id dentro de getElementById */\n /* Value nos da el contenido del elemento */\n let producto = document.getElementById('pantallaCargaProducto').value\n let tipo = document.getElementById('pantallaCargaTipo').value\n let descripcion = document.getElementById('pantallaCargaDescripcion').value\n if (producto != \"\" && tipo != \"\" && descripcion != \"\") {\n /* De una forma mas practica que correcta vamos a limpiar los inputs */\n document.getElementById('pantallaCargaProducto').value = ''\n document.getElementById('pantallaCargaTipo').value = ''\n document.getElementById('pantallaCargaDescripcion').value = ''\n /* Creamos nuestro modelo de itemlist y le insertamos los valores que levantamos arriba */\n let modelo = `<li class=\"list-group-item pantallaListado__itemLista\" aria-current=\"true\" data-producto=\"${producto}\" data-icono=\"${tipo}\" data-descripcion=\"${descripcion}\">\n <img src=\"${tipo}\" alt=\"${producto}\"class=\"pantallaListado__itemLista__icono\" data-producto=\"${producto}\" data-icono=\"${tipo}\" data-descripcion=\"${descripcion}\">\n <p class=\"pantallaListado__itemLista__nombre\" data-producto=\"${producto}\" data-icono=\"${tipo}\" data-descripcion=\"${descripcion}\">${producto}</p>\n </li>`\n\n /* Agarro la lista de pantalla listado */\n let pantallaListadoLista = document.getElementById('pantallaListado__lista')\n /* Voy a insertarle nuevos elementos */\n pantallaListadoLista.innerHTML += modelo\n\n /* Al final, ocultamos el modal de carga que contiene el formulario */\n pantallaCarga.hide()\n\n pantallaVacio.style.display = 'none'\n pantallaListado.style.display = 'flex'\n } else {\n alert(\"ERROR~Debe completar todos los campos correctamente\")\n pantallaCarga.hide()\n pantallaVacio.style.display = 'none'\n pantallaListado.style.display='flex'\n }\n}", "elminarCompletados() {\n this.todos = this.todos.filter( todo => !todo.completado )\n // Cuando eliminamos un todo, se debe guardar en el LocalStorange.\n this.guardarLocalStorage();\n }", "function verificarFiltro() {\n listarCargos(1);\n\n limpiar();\n}", "function vinculaEditarClienteAdicionarCampos(btnNovoCampo, divListaCampos, dadosAdicionais) {\n $(btnNovoCampo).click(function(event) {\n $(divListaCampos).append(dadosAdicionais);\n vinculaClienteRemoveCampoAdicional($('.btn-excluir-campo'));\n });\n}", "function confirmarPedido() {\n valorTotal = valorPrato + valorBebida + valorSobremesa;\n const botao = document.querySelector(\".botao-confirmar\");\n if(botao.classList.contains(\"liberar-confirmacao\")) {\n nomeUsuario = prompt(\"Qual é o seu nome?\");\n enderecoUsuario = prompt(\"Qual é o seu endereço?\");\n mensagem = encodeURIComponent( `Olá, gostaria de fazer o pedido:\n - Prato: ${nomePrato}\n - Bebida: ${nomeBebida}\n - Sobremesa: ${nomeSobremesa}\n Total: R$ ${valorTotal.toFixed(2)}\n \n Nome: ${nomeUsuario}\n Endereço: ${enderecoUsuario}`);\n janelaConfirmacao();\n }\n}", "function buscarUsuario(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role') // para que solo se muestre esos campos\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuarios) => {\n if (err) {\n reject('error al cargar usuarios');\n\n } else {\n resolve(usuarios);\n }\n });\n\n });\n\n}", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function verificarEmpleadoConceptos(form) {\r\n\tvar secuencia=document.getElementById(\"secuencia\").value;\r\n\tvar registro=document.getElementById(\"registro\").value;\r\n\tvar accion=document.getElementById(\"accion\").value;\r\n\tvar codconcepto=document.getElementById(\"codconcepto\").value; codconcepto=codconcepto.trim();\r\n\tvar pdesde=document.getElementById(\"pdesde\").value; pdesde=pdesde.trim(); var esPdesde=esPContable(pdesde);\r\n\tvar phasta=document.getElementById(\"phasta\").value; phasta=phasta.trim(); var esPhasta=esPContable(phasta);\r\n\tvar codproceso=document.getElementById(\"codproceso\").value; codproceso=codproceso.trim();\r\n\tvar monto=document.getElementById(\"monto\").value; monto=monto.trim(); monto=monto.replace(\",\", \".\");\r\n\tvar cantidad=document.getElementById(\"cantidad\").value; cantidad=cantidad.trim(); cantidad=cantidad.replace(\",\", \".\");\r\n\tvar status=document.getElementById(\"status\").value; status=status.trim();\r\n\tif (document.getElementById(\"flagproceso\").checked) var flagproceso=\"S\"; else var flagproceso=\"N\";\r\n\t\r\n\tif (codconcepto==\"\" || status==\"\" || codproceso==\"\" || pdesde==\"\") msjError(1010);\r\n\telse if (isNaN(monto)) alert(\"¡MONTO INCORRECTO!\");\r\n\telse if (isNaN(cantidad)) alert(\"¡CANTIDAD INCORRECTA!\");\r\n\telse if (pdesde!=\"\" && !esPdesde) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (phasta!=\"\" && !esPhasta) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (pdesde!=\"\" && phasta!=\"\" && (!esPdesde || !esPhasta || (pdesde>phasta))) alert(\"¡PERIODO INCORRECTO!\");\r\n\t//else if (monto == 0) alert(\"¡NO SE PUEDE ASIGNAR UN CONCEPTO CON MONTO EN CERO!\");\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=EMPLEADOS-CONCEPTOS&accion=\"+accion+\"&codpersona=\"+registro+\"&secuencia=\"+secuencia+\"&codconcepto=\"+codconcepto+\"&pdesde=\"+pdesde+\"&phasta=\"+phasta+\"&codproceso=\"+codproceso+\"&monto=\"+monto+\"&cantidad=\"+cantidad+\"&status=\"+status+\"&flagproceso=\"+flagproceso);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tif (resp!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse cargarPagina(form, \"empleados_conceptos.php\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function operadorDesactivado(req,res){\n var id_operador = req.params.id; \n var flag=buscarOperador(id_operador);\n if(flag.flag==true){\n operadores.splice(flag.i-1,1);\n res.status(200).send({message:[{'flag':'guardada','se guardo solicitud en la base de datos':[]}]});\n console.log('Operador desconectado...Tabla Operadores Actualizada: ');\n console.log(operadores);\n res.status(200).send({message:['Estado: Desconectado']})\n }else{\n res.status(404).send({message:['Error: No se encontro el operador']})\n }\n}", "function mostrarPermisos(data){\n\n\t\tif(data.add == 1){\n\t\t\taddIcoPermOk(\"add-est\");\n\t\t\taddBtnQuitar(\"add\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"add-est\");\n\t\t\taddBtnAdd(\"add\");\n\t\t}\n\t\tif(data.upd == 1){\n\t\t\taddIcoPermOk(\"upd-est\");\n\t\t\taddBtnQuitar(\"upd\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"upd-est\");\n\t\t\taddBtnAdd(\"upd\");\n\t\t}\n\t\tif(data.del == 1){\n\t\t\taddIcoPermOk(\"del-est\");\n\t\t\taddBtnQuitar(\"del\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"del-est\");\n\t\t\taddBtnAdd(\"del\");\n\t\t}\n\t\tif(data.list == 1){\n\t\t\taddIcoPermOk(\"list-est\");\n\t\t\taddBtnQuitar(\"list\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"list-est\");\n\t\t\taddBtnAdd(\"list\");\n\t\t}\n\n\t\t/*Una vez dibujados los permisos del usuario, \n\t\tel selector de usuario obtiene el foco */\n\t\t$('select#usuario').focus(); \n\n\t}", "function borrarDatos(parId) {\n var re = confirm(\"¿Está seguro que quiere borrar el campo \" + parId + \"?\");\n if (re == true) {\n db.collection(\"usuarios\").doc(parId).delete()\n .then(function () {\n console.log(\"Dato borrado correctamente.\");\n }).catch(function (error) {\n console.error(\"Error: \", error);\n });\n }\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 buscar(){ // função de executar busca ao clicar no botão\n \n let buscaId = document.getElementById('txtBuscar');\n buscaDados(buscaId.value.toLowerCase());\n}", "function validarLogin() {\n let user = document.querySelector(\"#txtLoginUser\").value.trim();\n let password = document.querySelector(\"#txtLoginPassword\").value.trim();\n let validacionAcceso = false;\n if (user.length > 0 && password.length > 0) {\n // VALIDACIONES \n let tipoUser = \"\";\n for (let i = 0; i < listaUsuarios.length; i++) {\n let element = listaUsuarios[i];\n if (element.nombreUsu === user && element.clave === password) {\n validacionAcceso = true;\n tipoUser = element.tipo;\n i = listaUsuarios.length + 1;\n }\n }\n if (validacionAcceso) {\n ingreso(tipoUser, user);\n } else {\n document.querySelector(\"#divResultadoLogin\").innerHTML = `No se pudo ingresar verifique los datos ingresados.`;\n }\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 chequearDatosEnvio(){\n // chequeo de calle, nropuerta, esquina\n let calle = document.getElementById(\"calle\").value;\n let nropuerta = document.getElementById(\"numeropuerta\").value;\n let esquina = document.getElementById(\"esquina\").value;\n let pais = document.getElementById(\"pais\").value;\n let envio = document.getElementById(\"metodoEnvio\").value;\n\n if(calle == \"\"){\n alert(\"Agregue una calle para el envío.\");\n return false;\n } else if(nropuerta == \"\"){\n alert(\"Agregue un número de puerta para el envío.\");\n return false;\n } else if(esquina == \"\"){\n alert(\"Agregue una esquina para el envío.\");\n return false\n } else if(pais == \"\"){\n alert(\"Agregue un país para el envío.\");\n return false;\n } else if(envio == 0){\n alert(\"Seleccione método de envío.\");\n return false;\n }\n\n return true;\n}", "function verificarExistenciaCampos(metodoNombre,datosEnvio,mensajeError,idDivMensaje){\n\n $.ajax({\n url: \"/SisConAsadaLaUnion/servicio/\"+metodoNombre,\n type: \"POST\",\n data: \"valor=\"+datosEnvio,\n beforeSend: function(){\n\n idDivMensaje.fadeIn(1000).html('<img class=\"center-block\" src=\"/SisConAsadaLaUnion/public/assets/images/Loading.gif\" alt=\"Cargando\" width=\"38px\"/>');\n\n },\n success: function(respuesta){\n\n idDivMensaje.fadeIn(1000).html(respuesta);\n \n },\n error: function(error){\n\n alertify.error(\"Error de conexión al tratar de verificar la disponibilidad \"+mensajeError);\n\n }\n\n });\n\n }", "function accionConsultarProducto(){\n listado1.actualizaDat();\n var numSelec = listado1.numSelecc();\n if ( numSelec < 1 ) {\n GestionarMensaje(\"PRE0025\", null, null, null); // Debe seleccionar un producto.\n } else {\n var codSeleccionados = listado1.codSeleccionados();\n var arrayDatos = obtieneLineasSeleccionadas(codSeleccionados, 'listado1'); \n var cadenaLista = serializaLineasDatos(arrayDatos);\n var obj = new Object();\n obj.hidCodSeleccionadosLE = \"[\" + codSeleccionados + \"]\";\n obj.hidListaEditable = cadenaLista;\n //set('frmContenido.conectorAction', 'LPModificarGrupo');\n mostrarModalSICC('LPModificarOferta','Consultar producto',obj,795,495);\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 buscaProductoDetalleOrdenVenta(){\n\t\t//var codigoProducto = $.trim($('#txtCodigoProducto').val());\n\t\tvar codigoProducto = $('#txtCodigoProducto').val();\n\t\tvar existe = $(\"#tblDetalleOrdenVenta .codigo:contains('\"+codigoProducto+\"')\").length;\n\t\tif(existe > 0){\n\t\t\t$.msgbox(msgboxTitle,'El producto <strong>' + codigoProducto + '</strong> ya esta agregado en el<br>detalle de la guia de pedido.');\n\t\t\t$('#msgbox-ok, #msgbox-cancel, #msgbox-close').click(function(){\n\t\t\t\t$('#txtCantidadProducto').val('');\n\t\t\t\t$('#txtDescuento').val('');\n\t\t\t\t$('#txtCodigoProducto').val('').focus();\n\t\t\t});\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\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 addDelPermisosUsuario(accion,permiso,boton){\n\n\t\tvar user = $('select#usuario').val();\n\t\t//alert(\"Usuario \"+usuario+\" Pass \"+ pasword +\" Agencia \"+agencia+\" User \"+user+\" Accion \"+accion+\" Permiso \"+permiso);\n\n\t\t$.ajax({\n\n\t\t\tdata: { user: usuario, \n\t\t\t\t\tpass: pasword,\n\t\t\t\t\tagencia: agencia,\n\t\t\t\t\tusuario: user,\n\t\t\t\t\tpermiso: permiso,\n\t\t\t\t\taccion: accion},\n\t\t\t\t\turl: 'http://apirest/permisos/addDel/',\n\t\t\t\t\ttype: 'POST',\n\n\t\t\tsuccess: function(data, status, jqXHR) {\n\t\t\t\tconsole.log(data);\n\t\t\t\t\n\t\t\t\tif(data.message == 'Autentication Failure'){\n\t\t\t\t\tmostrarMensajePermisos(\"Ha habido un fallo de Autenticacion\");\n\t\t\t\t}else if(data.message == 'NOK'){\n\t\t\t\t\tmostrarMensajePermisos(\"No estas autorizado para añadir/eliminar permisos a ese usuario\");\n\t\t\t\t}else{\n\t\t\t\t\tif(data.message == 'add OK' || data.message == 'del OK'){\n\t\t\t\t\t\trefreshBtnPermiso(accion,boton);\n\t\t\t\t\t}else if(data.message == 'add NOK' || data.message == 'del NOK'){\n\t\t\t\t\t\t//mostrarMensajePermisos(\"Alguien ha cambiado este mismo permiso antes de que tú.\");\n\t\t\t\t\t\t//refreshBtnPermiso(accion,boton);//Si al modificar un permiso solo queremos actualizar el boton pulsado sin actualizar los demas.\n\t\t\t\t\t\tobtenerPermisosUsuario();//Si queremos aprovechar para refrescar el estado de todos los botones de permisos de la tabla seleccionada.\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmostrarMensajePermisos(data.message); //Mostramos el mensaje de error cuando se produzca\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\terror: function (jqXHR, status) {\n\t\t\t\tconsole.log(jqXHR); \n\t\t\t\t//console.log(\"Fallo en la petición al Servicio Web\");\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t}", "function buscarUsuarios(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find()\n // .or - para buscar en dos propiedades de la misma coleccion\n .or([ { 'nombre' : regex }, { 'email' : regex } ])\n .exec((error, usuariosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los usuarios', error);\n } else {\n resolve(usuariosEncontrados);\n }\n\n });\n });\n }", "function handleSubmitCancelOs(e) {\n e.preventDefault();\n\n console.log(idServiceOrder);\n console.log(idSituationServiceOrder);\n\n if (idServiceOrder === \"\" || idSituationServiceOrder === \"\") {\n notify(\n \"warning\",\n \"Os dados de ordem de serviço devem estar preenchidos, por favor verifique.\"\n );\n return;\n }\n\n if (idSituationServiceOrder === 4 || idSituationServiceOrder === \"4\") {\n confirmationAlert(\n \"Atenção!\",\n \"Deseja realmente CANCELAR essa ordem de serviço? Na situação que ela está será cobrado uma taxa de cancelamento.\",\n \"cancelOs\"\n );\n } else if (\n idSituationServiceOrder !== 1 ||\n idSituationServiceOrder !== \"1\" ||\n idSituationServiceOrder !== 2 ||\n idSituationServiceOrder !== \"2\" ||\n idSituationServiceOrder !== 3 ||\n idSituationServiceOrder !== \"3\"\n ) {\n confirmationAlert(\n \"Atenção!\",\n \"Deseja realmente CANCELAR essa ordem de serviço?\",\n \"cancelOs\"\n );\n }\n }", "function valida_actio(action) {\n console.log(\"en la mitad\");\n if (action === \"crear\") {\n crea_acompanamiento();\n } else if (action === \"editar\") {\n edita_acompanamiento();\n };\n }", "function Preguntar(Mensaje,objeto,enlace,marco){\n\t\t\t\tif(confirm(Mensaje)==true){ \n\t\t\t\t cargar(objeto,enlace,marco);\n\t\t\t\t return true;\n \t\t\t\t} \n\t\t\t\telse \n\t\t\t\t return false;\n\t\t\t\t}", "function mostrarResultado(respuesta){\n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Eliminación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la eliminación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al eliminar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\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}", "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 carrega_opcao(obj){\n var contador = $(obj).parents('div.div_pergunta').attr('contador');\n\n clean_pergunta_opcao($(obj));\n\n if ($(obj).val() == 1) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_texto').html(opcao_texto(contador));\n } else if ($(obj).val() == 2) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_paragrafo').html(opcao_paragrafo(contador));\n } else if ($(obj).val() == 3) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_multipla_escolha').html(opcao_multipla_escolha(contador)).append(button_add_opcao());\n } else if ($(obj).val() == 4) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_caixa_selecao').html(opcao_caixa_selecao(contador)).append(button_add_opcao());\n } else if ($(obj).val() == 5) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_lista').html(opcao_lista(contador)).append(button_add_opcao());\n } else if ($(obj).val() == 6) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_escala_numero').html(opcao_escala_numero(contador));\n } else if ($(obj).val() == 7) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_escala_estrela').html(opcao_escala_estrela(contador));\n } else if ($(obj).val() == 8) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_escala_rosto').html(opcao_escala_rosto(contador));\n } else if ($(obj).val() == 9) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_grade_linha').html(opcao_grade_linha(contador, 1));\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_grade_linha').append(opcao_grade_linha(contador, 2)).append(button_add_opcao());\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_grade_coluna').html(opcao_grade_coluna(contador, 1));\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_grade_coluna').append(opcao_grade_coluna(contador, 2)).append(button_add_opcao());\n } else if ($(obj).val() == 10) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_data').html(opcao_data(contador));\n } else if ($(obj).val() == 11) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_horario').html(opcao_horario(contador));\n } else if ($(obj).val() == 12) {\n $(obj).parents('div#div_pergunta_'+contador).find('#div_op').find('#div_op_curtir').html(opcao_curtir(contador));\n }\n }", "function confirmDelete(entity) {\n\tvar message = \"Sei sicuro di proseguire con la cancellazione\";\n\tif(entity != null && entity != undefined){\n\t\tif(entity == \"ordiniClienti\"){\n\t\t\tmessage = message + \" degli ordini?\"\n\t\t}\n\t}\n return confirm(message);\n}", "filtrarSugerencias(resultado, busqueda){\n \n //filtrar con .filter\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\n console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }", "function chequearVacio(field) {\r\nif (vacio(field.value.trim())) {\r\n setInvalido(field, `${field.name} no debe estar vacío`);\r\n return true;\r\n} else {\r\n setValido(field);\r\n return false;\r\n}\r\n}", "executarPocao() {\n\t\tlet tempoPocaoResta = null; //quanto tempo a pocao fica ativo ateh desaparecer de novo (em milisegundos)\n\t\tlet pocaoMudaPers; //soh obrigatorio para pocoes que tenham desexecutar\n\n\t\tswitch (this._codPocao) {\n\t\t\tcase TipoPocao.DiminuirTamanhoPers:\n\t\t\t\ttempoPocaoResta = 7500;\n\t\t\t\tpocaoMudaPers = true;\n\t\t\t\tControladorJogo.pers.mudarTamanho(porcentagemSetTam); //50% do tamanho\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.MatarObjetos1Tiro:\n\t\t\t\t//mudanca na propria classe Obstaculo e Inimigo\n\t\t\t\ttempoPocaoResta = 3000;\n\t\t\t\tpocaoMudaPers = false;\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.RUIMPersPerdeVel:\n\t\t\t\ttempoPocaoResta = 5000;\n\t\t\t\tpocaoMudaPers = true;\n\t\t\t\tControladorJogo.pers.mudarVelocidade(porcentagemSetVelRuim);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.TiroPersMaisRapidoMortal:\n\t\t\t\ttempoPocaoResta = 8500;\n\t\t\t\tpocaoMudaPers = true;\n\n\t\t\t\t//porque depende do aviao do personagem, qual o index que vai ter o tiro bom\n\t\t\t\tconst indexTiroMelhor = ControladorJogo.pers.indexTiroMelhor;\n\t\t\t\t//mudar frequencia\n\t\t\t\tconst freqFuncAtual = ControladorJogo.pers.getFreqFuncAtirar(indexTiroMelhor);\n\t\t\t\tthis._frequenciaAtirarAntigo = freqFuncAtual.freq;\n\t\t\t\tfreqFuncAtual.freq = freqAtirarMaisRapidoMortal;\n\t\t\t\t//mudar infoTiro\n\t\t\t\tControladorJogo.pers.getControladorTiros(indexTiroMelhor).colocarInfoTiroEspecial(ArmazenadorInfoObjetos.infoTiro(\"TiroForte\", true));\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.MatarInimigosNaoEssenc:\n\t\t\t\tControladorJogo.controladoresInimigos.forEach(controladorInims => {\n\t\t\t\t\tif (!controladorInims.ehDeInimigosEssenciais)\n\t\t\t\t\t\t//soh mata os inimigos nao essenciais\n\t\t\t\t\t\tcontroladorInims.matarTodosInim();\n\t\t\t\t});\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.ReverterTirosJogoInimDirInim:\n\t\t\t\tthis._reverterTirosContraInimigos(false);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.GanharPoucaVida:\n\t\t\t\tControladorJogo.pers.mudarVida(qtdGanhaPoucaVida);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.RUIMPersPerdeVida:\n\t\t\t\tControladorJogo.pers.mudarVida(-qtdPerdeVida);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.ReverterTirosJogoInimSeguirInim:\n\t\t\t\tthis._reverterTirosContraInimigos(true);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.DeixarTempoMaisLento:\n\t\t\t\ttempoPocaoResta = 5000;\n\t\t\t\tpocaoMudaPers = false;\n\t\t\t\t/* para deixar tempo mais lento:\n\t\t\t\t -> tiros tela. OK\n\t\t\t\t -> inimigos (incluindo tiros deles, atirar e inimigosSurgindo). OK\n\t\t\t\t -> obstaculos. OK\n\t\t\t\t -> Timers (aqui soh os que jah existem). OK\n\t\t\t\t ps1: verificar se nao existem Timers no PersonagemPrincipal\n\t\t\t\t ps2: verificar se nao podem ser criados freqFuncs sem ser do pers durante esse tempo\n\t\t\n\t\t\t\tresto:\n\t\t\t\t -> quando Timers forem criados. OK\n\t\t\t\t -> quando tiros(sem ser do personagem), obstaculos ou inimigos(freqFuncAtirar tambem) forem criados. OK\n\t\t\t\t*/\n\t\t\t\t//tiros sem dono\n\t\t\t\tControladorJogo.controladorOutrosTirosNaoPers.mudarTempo(porcentagemDeixarTempoLento);\n\t\t\t\t//suportes aereos\n\t\t\t\tControladorJogo.controladorSuportesAereos.suportesAereos.forEach(suporteAereo => suporteAereo.mudarTempo(porcentagemDeixarTempoLento));\n\t\t\t\t//inimigos (incluindo tiros deles e freqFuncAtirar)\n\t\t\t\tControladorJogo.controladoresInimigos.forEach(controladorInims =>\n\t\t\t\t\tcontroladorInims.mudarTempo(porcentagemDeixarTempoLento));\n\t\t\t\t//obstaculos\n\t\t\t\tControladorJogo.controladoresObstaculos.forEach(controladorObsts =>\n\t\t\t\t\tcontroladorObsts.mudarTempo(porcentagemDeixarTempoLento));\n\t\t\t\t//escuridao\n\t\t\t\tif (ControladorJogo.escuridao !== undefined)\n\t\t\t\t\tControladorJogo.escuridao.mudarTempo(porcentagemDeixarTempoLento);\n\t\t\t\t//Timers\n\t\t\t\tConjuntoTimers.mudarTempo(porcentagemDeixarTempoLento);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.RUIMTirosPersDirEle:\n\t\t\t\t//virar tiros contra criador\n\t\t\t\tControladorJogo.pers.virarTirosContraCriador(false);\n\t\t\t\t//diminuir a velocidade e o dano\n\t\t\t\tControladorJogo.pers.armas.forEach(arma => {\n\t\t\t\t\tarma.controlador.mudarQtdAndarTiros(porcentagemVelTiroSeVoltarPers);\n\t\t\t\t\tarma.controlador.mudarMortalidadeTiros(porcentagemMortalidadeTiroSeVoltarPers, true);\n\t\t\t\t});\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.GanharMuitaVida:\n\t\t\t\tControladorJogo.pers.mudarVida(qtdGanhaMuitaVida);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.PersMaisRapido:\n\t\t\t\ttempoPocaoResta = 7500;\n\t\t\t\tpocaoMudaPers = true;\n\t\t\t\tControladorJogo.pers.mudarVelocidade(porcentagemSetVel);\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.PersComMissil:\n\t\t\t\ttempoPocaoResta = 4500;\n\t\t\t\tpocaoMudaPers = true;\n\n\t\t\t\t//setar novo tiro\n\t\t\t\tControladorJogo.pers.getControladorTiros(indexArmaMissilPers).colocarInfoTiroEspecial(ArmazenadorInfoObjetos.infoTiro(\"TiroMissil\", true));\n\n\t\t\t\t//guardar frequencia e atirarDireto antigo antes de muda-los\n\t\t\t\tthis._informacoesNaoMissil = {\n\t\t\t\t\tfreq: ControladorJogo.pers.getFreqFuncAtirar(indexArmaMissilPers).freq,\n\t\t\t\t\tatirarDireto: ControladorJogo.pers.getConfigArma(indexArmaMissilPers).atirarDireto\n\t\t\t\t};\n\n\t\t\t\t//mudar freqAtirar e atirarDireto\n\t\t\t\tControladorJogo.pers.getFreqFuncAtirar(indexArmaMissilPers).freq = freqMissilPers;\n\t\t\t\tControladorJogo.pers.getFreqFuncAtirar(indexArmaMissilPers).setContadorUltimaEtapa(); //ele jah vai atirar missil em seguida\n\t\t\t\tControladorJogo.pers.getConfigArma(indexArmaMissilPers).atirarDireto = true;\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.TirarVidaTodosInim:\n\t\t\t\t//passa por todos os controladores de inimigos\n\t\t\t\tControladorJogo.controladoresInimigos.forEach(controladorInims =>\n\t\t\t\t\tcontroladorInims.tirarVidaTodosInim(qtdTiraVidaTodosInim));\n\t\t\t\tbreak;\n\n\t\t\tcase TipoPocao.CongelarInimigos:\n\t\t\t\ttempoPocaoResta = 5000;\n\t\t\t\tpocaoMudaPers = false;\n\t\t\t\t//congelar todos os inimigos\n\t\t\t\tControladorJogo.controladoresInimigos.forEach(controladorInims =>\n\t\t\t\t\tcontroladorInims.mudarCongelarTodosInim(true));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow \"Esse codigo pocao nao existe!\";\n\t\t}\n\n\t\tif (this.mudaAviaoPersTemp)\n\t\t\t//para mudancas feitas em uma certa nave do personagem nao desexecutar em outra\n\t\t\tthis._numeroAviaoPers = ControladorJogo.pers.numeroAviao;\n\n\t\tif (tempoPocaoResta !== null) //se tem que desexecutar depois de um tempo, programa esse Timer (pode ser soh uma acao pontual)\n\t\t{\n\t\t\t//programa quando quando vai parar com esse pocao\n\t\t\tthis._timerDesexecutar = new Timer(() => { this.desexecutarPocao(); }, tempoPocaoResta, false, false /*pocao transcende o level (mesmo se o level acabar ainda vai ter que desexecutar)*/,\n\t\t\t\tpocaoMudaPers, { obj: this, atr: \"_tempoRestante\" }); //atualiza quanto tempo falta\n\n\t\t\tthis._tempoTotal = tempoPocaoResta;\n\t\t\t//this._tempoRestante = tempoPocaoResta; nao precisa setar tempoRestante porque Timer jah faz isso\n\t\t} else\n\t\t\tdelete this._timerDesexecutar;\n\t}", "function botaoFecharVoltar() {\n \n if(document.querySelector('#tituloCaixa').style.color == 'rgb(0, 185, 0)') {\n\n // limpa campos do usuario\n document.querySelector('.campoAno').value = ''\n document.querySelector('.campoMes').value = ''\n document.querySelector('#dia').value = ''\n document.querySelector('.campoTipo').value = ''\n document.querySelector('#descricao').value = ''\n document.querySelector('#valor').value = ''\n }\n \n document.querySelector('.secaoCaixa').style.display = 'none'\n}", "consultaUsuario(p_Clave,\n p_Email,\n p_Opcion){ \n \n let consultar = usuarioModel.consultaUsuario(p_Clave,\n p_Email,\n p_Opcion);\n return consultar;\n }", "function recogerBusqueda(e) { \n\n let palabraBuscar = e.target.value.toLowerCase();\n\n var listaBusqueda = filtrarBusqueda(agendaActividades, palabraBuscar); //funcion filtrarBusqueda linea 22/interno\n\n pintarActividades(listaBusqueda); //Pintamos el resultado del filtro con la funcion pintarActividades que a su vez usa la funcion pintarActividad\n}", "function abrir_orden_compra(nuevo,modificar,eliminar){\n var url = \"\";\n if(nuevo==1){\n url=\"../../../../webapp/modulos/mrp/index.php/buy_order/form\";\n } else {\n if(modificar==1){\n url=\"../../../../webapp/modulos/mrp/index.php/buy_order/grid\";\n } else { \n \t\turl=\"../../../../webapp/modulos/mrp/index.php/buy_order/grid/2\";\n }\n }\n var frop = document.getElementById(\"opciones\");\n frop.src = url;\n }", "function doActualizarCuenta(tipo){\r\n\t\tvar frm = document.forms[0];\r\n\t\t\r\n\t\tif(frm.numeros){\r\n\t\t\tif(frm.numeros.selectedIndex == 0){\r\n\t\t\t\tif(tipo==\"0\")\r\n\t\t\t\t\talert('Selecciona un n\\xfamero.');\r\n\t\t\t\telse\r\n\t\t\t\t\talert('Seleccione un n\\xfamero.');\r\n\t\t\t\tfrm.numeros.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(frm.teleRefCon.value==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu Tel\\xE9fono de Contacto.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su Tel\\xE9fono de Contacto.');\r\n\t\t\tfrm.teleRefCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\r\n\t\tif(frm.persCon.value==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu Contacto Cliente.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su Contacto Cliente.');\r\n\t\t\tfrm.persCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(frm.emailCon.value ==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu E-mail.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su E-mail.');\r\n\t\t\tfrm.emailCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(!validarFormatoMail(document.forms[0].emailCon,'Formato de E-mail incorrecto.')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!valida_campo_direccion(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!valida_notas_direccion(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!validarCombosUbigeo(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(tipo==\"0\"){\t\t\r\n\t\t\tif(!confirm('\\xBFEst\\xE1s seguro de guardar los cambios?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!confirm('\\xBFEst\\xE1 seguro de guardar los cambios?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdoOperacion('actualizarcuenta');\r\n\t}", "function buscarUsuarios(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n // al poner 2do argumento , no traigo el pass\n Usuario.find({}, 'nombre imagen ') // enviamos un obj vacio y buscamos por nombre email etc : es lo que quiero traer , es lo que va a mostrar \n .or([{ 'nombre': regex }, { 'email': regex }]) // en cambio aqui envio un array de condiciones para buscar, busco por email y nombre\n .exec((err, usuarios) => {\n\n if (err) {\n reject('error al cargar usuarios', err)\n } else {\n // usuarios ira como respuesta en el array respuesta[2]\n resolve(usuarios) // devuelve los usuarios encontrados en el find\n }\n })\n });\n}", "function editarDatos(parId, parTipo, parIden, parfechaIni, parfechaFin, parCuando, parEmpleado) {\n document.getElementById(\"tipo\").value = parTipo;\n document.getElementById(\"iden\").value = parIden\n document.getElementById(\"fechaIni\").value = parfechaIni;\n document.getElementById(\"fechaFin\").value = parfechaFin;\n document.getElementById(\"cuando\").value = parCuando;\n document.getElementById(\"empleado\").value = parEmpleado;\n $(\"#guardar\").css(\"display\", \"none\");\n $(\".linea\").attr(\"disabled\", true);\n $(\"#act\").append(\"<button class='btn btn-info my-3' id='actualizar'>Guardar</button>\");\n $(\"#actualizar\").on(\"click\", function () {\n var userRef = db.collection(\"usuarios\").doc(parId);\n tipos = document.getElementById(\"tipo\").value;\n idens = document.getElementById(\"iden\").value;\n fechaInis = document.getElementById(\"fechaIni\").value;\n fechaFins = document.getElementById(\"fechaFin\").value;\n cuandos = document.getElementById(\"cuando\").value;\n empleados == document.getElementById(\"empleado\").value;\n\n if (tipos.trim() === \"\" || idens.trim() === \"\" || fechaInis.trim() === \"\" || fechaFins.trim() === \"\" || cuandos.trim() === \"\" || empleados.trim() === \"\") {\n alert(\"Todos los datos son obligatorios.\");\n return false;\n } else {\n return userRef.update({\n tipo: document.getElementById(\"tipo\").value,\n iden: document.getElementById(\"iden\").value,\n fechaIni: document.getElementById(\"fechaIni\").value,\n fechaFin: document.getElementById(\"fechaFin\").value,\n cuando: document.getElementById(\"cuando\").value,\n empleado: document.getElementById(\"empleado\").value\n })\n .then(function () {\n console.log(\"Usuario actualizado correctamente.\");\n document.getElementById(\"tipo\").value = \"\";\n document.getElementById(\"iden\").value = \"\";\n document.getElementById(\"fechaIni\").value = \"\";\n document.getElementById(\"fechaFin\").value = \"\";\n document.getElementById(\"cuando\").value = \"\";\n document.getElementById(\"empleado\").value = \"\";\n $(\"#guardar\").css(\"display\", \"inline\");\n $(\".linea\").attr(\"disabled\", false);\n $(\"#act\").empty();\n })\n .catch(function (error) {\n // The document probably doesn't exist.\n console.error(\"Error actualizando datos: \", error);\n });\n }\n })\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 actualizarGetPuntosTipoSelecciondado(){\n // no se realizo la busqueda de tipo de puntos\n if(vm.nameTipoSeleccionado == null){\n return;\n }\n // volvemos a realizar la busqueda de puntos para mantener actualizada la lista de edicion\n if((vm.nameTipoSeleccionado.nombre == \"todos\")||(vm.nameTipoSeleccionado.nombre == vm.tipoSeleccionado.nombre)){\n console.log(\"[EDIT]: va a traer los ptoInteres\");\n getTipoPuntos();\n }\n else{\n console.log(\"[EDIT]: lo deja como esta, no busca puntos\");\n }\n \n }", "function fAgregar(){\n if (cPermisoPag != 1){\n fAlert(\"No tiene Permiso de ejecutar esta acción\");\n return;\n }\n\n if(lBandera == true){\n fAlert(\"No puede efectuar esta operación mientras se encuentre realizando otra transacción\");\n return;\n }\n frm.iCveSistema.value = \"\";\n frm.hdCveModulo.value = \"\";\n frm.iNumReporte.value = \"\";\n\n aDocDisp = FRMListadoA.fGetObjs(0);\n\n for(cont=0;cont < aDocDisp.length;cont++){\n if(aDocDisp[cont]){\n if (frm.iCveSistema.value==\"\") frm.iCveSistema.value=aResTemp[cont][0]; else frm.iCveSistema.value+=\",\"+aResTemp[cont][0];\n if (frm.hdCveModulo.value==\"\") frm.hdCveModulo.value=aResTemp[cont][1]; else frm.hdCveModulo.value += \",\" + aResTemp[cont][1];\n if (frm.iNumReporte.value==\"\" ) frm.iNumReporte.value=aResTemp[cont][2]; else frm.iNumReporte.value+=\",\"+aResTemp[cont][2];\n }\n }\n\n if (frm.iCveSistema.value == \"\"){\n fAlert ('\\nSeleccione al menos un registro para hacer esta operación.');\n return;\n }\n\n\n frm.hdBoton.value = \"Guardar\";\n frm.hdFiltro.value = \"\";\n if(fEngSubmite(\"pgGRLReporteA.jsp\",\"idAgrega\")){\n FRMPanel.fSetTraStatus(\"UpdateComplete\");\n fDisabled(true);\n FRMListado.fSetDisabled(false);\n }\n\n fCargaListadoA();\n}", "function doConsultar(flagOperacion,flagActualizaDatos){ \r\n\t\tvar frm = document.forms[0];\r\n\t\t\r\n\t\tif(flagOperacion!=\"2\"){\r\n\t\t\tif(frm.nombre.value=='') {\r\n\t\t\t\talert('Ingresa tus Nombres.');\r\n\t\t\t\tfrm.nombre.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t\r\n\t\t\tif(frm.apePat.value=='') {\r\n\t\t\t\talert('Ingresa tus Apellidos.');\r\n\t\t\t\tfrm.apePat.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(frm.tipoDoc.selectedIndex=='0') {\r\n\t\t\t\talert('Selecciona un Tipo de Documento.');\r\n\t\t\t\tfrm.tipoDoc.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*VALIDAR LONGITUDES DEL TIPO DE DOCUMENTO, SI ES MENOR DE EDAD NO PIDE NUMDOC*/\r\n\t\tif(frm.tipoDoc.selectedIndex!='7' && frm.tipoDoc.selectedIndex!='1') {\r\n\t\t\tif(frm.numeDoc.value==''){\r\n\t\t\t\talert('Ingresa el N\\xFAmero de Documento.');\r\n\t\t\t\tfrm.numeDoc.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t}\r\n\t\t/*FIN VALIDAR LONGITUDES*/\r\n\t\t\r\n\t\tif(frm.teleRef.value=='') \r\n\t\t{\r\n\t\t\talert('Ingresa tu Tel\\xe9fono de Referencia.');\r\n\t\t\tfrm.teleRef.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\r\n\t\tif(flagActualizaDatos==\"1\"){\r\n\t\t\t/*ES DOL -> sexo e email no obligatorios*/\r\n\t\t\tif(!frm.sexo[0].checked && !frm.sexo[1].checked) \r\n\t\t\t{\talert('Selecciona el Sexo.');\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(frm.emailUsuario.value =='') \r\n\t\t\t{\talert('Ingresa tu E-mail.');\r\n\t\t\t\tfrm.emailUsuario.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t\t/*FIN ES DOL*/\r\n\t\t}\r\n\t\t\r\n\t\tif(frm.emailUsuario.value !=''){\r\n\t\t\tif(!validarFormatoMail(document.forms[0].emailUsuario,'Formato de E-mail incorrecto.'))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(frm.lugarNaci.selectedIndex=='0') \r\n\t\t{\r\n\t\t\talert('Selecciona un Lugar de Nacimiento.');\r\n\t\t\tfrm.lugarNaci.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(frm.fechaNaci.value=='') \r\n\t\t{\r\n\t\t\talert('Ingresa tu Fecha de Nacimiento.');\r\n\t\t\tfrm.fechaNaci.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(!validarFormatoFecha(document.forms[0].fechaNaci,'Formato de fecha no v\\xE1lida.','Fecha de Nacimiento no v\\xE1lida.')){\r\n\t\t\tfrm.fechaNaci.focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\t\r\n\t\tif(document.forms[0].buttonActualizar.value=='Actualizar'){\r\n\t\t\tif(!confirm('\\xBFEst\\xE1s seguro de actualizar los datos?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ttry{\r\n\t\t\t\thabilitarPrepago();\r\n\t\t\t}catch(err){}\r\n\t\t\tdoOperacion('actualizar');\r\n\t\t}else{\r\n\t\t\tif(!confirm('\\xBFEst\\xE1s seguro de registrar los datos?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tdoOperacion('registrar');\r\n\t\t}\r\n\t}", "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 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 listarTodosFiltroAprendiz(){\r\n\t\r\n\tvar identificacionFiltro = $(\"#txtIdentificacionAprendizFiltro\").val();\r\n\tvar nombreCompletoFiltro = $.trim($(\"#txtNombreCompletoAprendizFiltro\").val());\r\n\tvar idFichaFiltro = $(\"#selectFichaAprendizFiltro\").val();\r\n\tvar idDetalleEstadoFiltro = $(\"#selectDetalleEstadoAprendizFiltro\").val();\r\n\t\r\n\t\r\n\tlistarTodosAprendizGenerico(\"listarTodosFiltro?identificacion=\"+identificacionFiltro+\"&nombreCompleto=\"+nombreCompletoFiltro+\"&idFicha=\"+idFichaFiltro+\"&idDetalleEstado=\"+idDetalleEstadoFiltro);\t\t\t\t\r\n}", "function ingresarRetirarMonto() {\n const user = cuentas.find(cuenta => cuenta.username === username);\n const saldoAnterior = user.saldo;\n const respuesta = document.getElementById(\"mensaje\");\n \n if (document.getElementById(\"monto\").value.length == 0) { // Validar campo vacíos\n respuesta.innerHTML = \"<p>Sin dato</p>\";\n return;\n }\n \n const montoOperacion = parseFloat(document.getElementById(\"monto\").value); // Hay que convertir el value a float con 'parseFloat()'\n\n if (montoOperacion <= 0) { // Validación de inputs negativos\n respuesta.innerHTML = \"<p>El monto debe ser mayor a $0</p>\";\n return;\n }\n\n if(opcionHome === \"2\") { // Validamos si se ingresó 2 ó 3 para ver si sumamos o restamos\n if ((user.saldo + montoOperacion) > 990) {\n respuesta.innerHTML = \"<p>No se puede superar el monto de $990</p><p>Saldo actual: $\" + user.saldo + \"</p>\";\n } else {\n user.saldo += montoOperacion;\n respuesta.innerHTML = \"<p> Saldo anterior a la operación: $\" + saldoAnterior + \"</p><p> Instrucción: Depositar $\" + montoOperacion + \"</p><p>Nuevo saldo: $\" + user.saldo + \"</p>\";\n }\n } else if (opcionHome === \"3\") {\n if ((user.saldo - montoOperacion) < 10) {\n respuesta.innerHTML = \"<p>No puedes tener menos de $10</p><p>Saldo actual: $\" + user.saldo + \"</p>\";\n } else {\n user.saldo -= montoOperacion;\n respuesta.innerHTML = \"<p> Saldo anterior a la operación: $\" + saldoAnterior + \"</p><p> Instrucción: Retirar $\" + montoOperacion + \"</p><p>Nuevo saldo: $\" + user.saldo + \"</p>\";\n }\n }\n\n document.getElementById(\"monto\").value = \"\";\n}", "function CorroborarCampoUsers(corroborado){\n username = $(\"#username\"),\n password = $(\"#password\"),\n nombres = $(\"#nombres\"),\n apellidos = $(\"#apellidos\"),\n email = $(\"#email\");\n allFields = $( [] ).add(username).add(password).add(nombres).add(apellidos).add(email);\n\t\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 && checkRegexp(username, /^[a-z]([0-9A-Z a-z])+$/i,\"Nombre de Usuario no valido!\" );\n\t\t\t\tbValid = bValid && comprobar_longitud(password, \"campo Clave \", 5, 85);\n\t\t\t\tbValid = bValid && checkRegexp(nombres,/^[a-z]([A-Z a-z])+$/i, \"Campo Nombres esta vacio!\");\n\t\t\t\tbValid = bValid && checkRegexp(apellidos, /^[a-z]([A-Z a-z])+$/i, \"Campo Apellidos esta vacio!\");\n\t\t\t\tbValid = bValid && checkRegexp(email,/^[0-9a-z_\\-\\.]+@[0-9a-z\\-\\.]+\\.[a-z]{2,4}$/i, \"Email no valido!\");\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 TodoProvider(props){\n\n \n //Llamada al custom react hook\n const {item:todos,saveItem:saveTodos,loading,error}=useLocalStorage('TODOS_V1',[]); \n //todos:estado\n //saveTodos:funcion que guarda los datos(en localstorage y estado)\n //loading:estado\n //error:estado\n\n const [searchValue,setSearchValue]=React.useState('');\n //React hook de estado\n\n const[openModal,setOpenModal]=React.useState(false);\n //React hook de estado para modal formulario\n\n const[openModalApp,setOpenModalApp]=React.useState(false);\n //React hook de estado para modal app\n \n const [openModalAutor, setOpenModalAutor]=React.useState(false);\n //React hook de estado para modal autor\n \n const completedTodos=todos.filter(todo=>todo.completed===true).length;\n const totalTodos=todos.length;\n\n let searchedTodos=[];\n\n if(!searchValue>=1){\n\n searchedTodos=todos;\n //Arreglo que tenga almacenado el estado\n\n }else{ \n\n //Filtro de acuerdo a lo ingresado por usuario\n searchedTodos=todos.filter(todo=>{\n\n const searchText=searchValue.toLowerCase();\n const todoText=todo.text.toLowerCase();\n\n return todoText.includes(searchText);\n \n });\n } \n\n\n const addTodo=(text)=>{\n\n const newTodos=[...todos];\n\n newTodos.push({\n text:text,\n completed:false,\n });\n\n saveTodos(newTodos);\n }\n\n\n\n\n const completeTodo=(text)=>{\n\n const todoIndex=todos.findIndex(todo=>todo.text===text);\n //Se encuentra el index dentro del array todos, segun el texto recibido\n\n const newTodos=[...todos];//Se copia el array del estado orginal\n\n newTodos[todoIndex].completed=!newTodos[todoIndex].completed;\n //El valor de complete, va a cambiar siempre al estado contrario, cada vez que \n //se ejecuta la funcion\n\n saveTodos(newTodos);//se llama a la funcion modificadora del estado\n\n };\n\n\n const deleteTodo=(text)=>{\n\n const todoIndex=todos.findIndex(todo=>todo.text===text);\n //Se encuentra el index dentro del array todos, segun el texto recibido\n\n const newTodos=[...todos];\n console.log(newTodos[todoIndex]);\n\n newTodos.splice(todoIndex,1);\n //Se elimina el elemento del arreglo\n\n saveTodos(newTodos);//se llama a la funcion modificadora del estado\n };\n\n\n return(\n //value es un objeto, envuelve todos los estados y variables que se compartiran en el contexto\n <TodoContext.Provider value={{\n \n loading,\n error,\n totalTodos,\n completedTodos,\n searchValue,\n setSearchValue,\n searchedTodos,\n completeTodo,\n deleteTodo,\n openModal,\n setOpenModal,\n addTodo,\n openModalApp, \n setOpenModalApp,\n openModalAutor,\n setOpenModalAutor,\n }}>\n\n {props.children} \n {/*Aqui se almacena el componente AppUI*/}\n\n </TodoContext.Provider>\n );\n}", "function criaComentario(comentario){\n\tlet newTemplate = document.querySelector('#comentario');\n\tlet caixa_comentario = document.createElement('div');\n\tcaixa_comentario.innerHTML = newTemplate.innerHTML;\n\n\tlet c = {\n\t\tobjetoComentario: comentario,\n\t\tcaixa: caixa_comentario.children[0],\n\t\tdiv_lista_respostas: null\n };\n\n c.email = c.caixa.children[0];\n c.textoComentario = c.caixa.children[1];\n c.botoes = c.caixa.children[3];\n\n /**\n * Preenche as informacoes do comentario\n */\n function preenche(){\n if(comentario.comentario==\"\"){\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = 'comentario apagado';\n c.botaoEnviarComentario = c.botoes.children[0];\n }else{\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = comentario.comentario;\n c.botaoEnviarComentario = c.botoes.children[0];\n }\n };\n preenche();\n\n if(localStorage.getItem('email') == comentario.usuario.email){\n let deletarComentario = document.createElement('button');\n deletarComentario.innerText = 'Deletar Comentário';\n c.botaoDeletarComentario = deletarComentario;\n c.botoes.appendChild(deletarComentario);\n\n let idComentario = c.objetoComentario.id;\n\n /**\n * Deleta o comentario feito pelo Usuario\n */\n c.botaoDeletarComentario.addEventListener('click', \n async function fetch_cadastro_usuario(){\n let resposta = await fetch(URI + `/apagarComentario/${idComentario}/`,{\n \"method\":\"DELETE\",\n 'headers': {'Content-Type': 'application/json', \"Authorization\": `Bearer ${localStorage.token}`}\n });\n console.log(resposta)\n let dados = await resposta.json();\n if(resposta.status == 200){\n alert(\"Seu Comentario Foi Apagado!\");\n campanha(localStorage.getItem('hash'));\n }\n }\n );\n }\n\n /**\n * Envia o Comentario feito no proprio comentario\n */\n c.botaoEnviarComentario.addEventListener('click', \n async function escreverComentario(){\n let espacoComentario = c.caixa;\n let novoComentario = document.querySelector('#formato_novo_comentario');\n espacoComentario.innerHTML += novoComentario.innerHTML;\n\n /**\n * Envia o Comentario\n */\n let buttonEnviar = document.querySelector('#enviar_comentario');\n buttonEnviar.addEventListener('click', \n async function enviarComentario(){\n let novo_texto = document.querySelector('#texto_novo_comentario');\n let resposta3 = await fetch(URI + `/comentaComentario`,{\n 'method':'POST',\n 'body':`{\"idCampanha\": \"${comentario.id}\",\"comentario\": \"${novo_texto.value}\",\"email\": \"${localStorage.getItem('email')}\" }`,\n 'headers': {'Content-Type': 'application/json', \"Authorization\": `Bearer ${localStorage.token}`}\n })\n if(resposta3.status==201){\n alert(\"Seu comentário foi registrado!\");\n campanha(localStorage.getItem('hash'));\n }\n }\n ) \n })\n c.caixa.classList.add('caixa_comentario');\n return c;\n}", "function cargarDisponiblesProcesar(form) {\r\n\tvar frm = document.getElementById(\"frmentrada\");\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar ftiponom = document.getElementById(\"ftiponom\").value;\r\n\tvar fperiodo = document.getElementById(\"fperiodo\").value;\r\n\tvar ftproceso = document.getElementById(\"ftproceso\").value;\r\n\t\r\n\tif (ftiponom==\"\" || fperiodo==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE NOMINA Y PERIODO!\"); return false; }\r\n\telse if (ftproceso==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE PROCESO!\"); return false; }\r\n\telse return true;\r\n}", "function guardarProductosFiltrados(datos) {\n //Utilizamos un objeto con el mismo formato que maneja la API (.data) para los productos, para que la funcion que genera el listado de productos no nos devuelva error\n productosFiltrados = { data: Array(), error: \"\" };\n //Nos posicionamos dentro de la clave data de los productos que recibimos desde la API\n const losProductos = datos.data;\n let textoIngresado = $(\"#txtFiltroProductos\").val();\n if (datos && losProductos.length > 0) {\n for (let i = 0; i < losProductos.length; i++) {\n let unProducto = losProductos[i];\n let prodX = new Producto(unProducto._id, unProducto.codigo, unProducto.nombre, unProducto.precio, unProducto.urlImagen, unProducto.estado, unProducto.etiquetas);\n //Guardamos y pusheamos todos los productos filtrados que nos mande la API en la variable global productosFiltrados\n productosFiltrados.data.push(prodX);\n }\n }\n if (textoIngresado != \"\") {\n textoIngresado = textoIngresado.toLowerCase();\n for (let i = 0; i < productos.length; i++) {\n let unProd = productos[i];\n let lasEtiquetas = unProd.etiquetas;\n let x = 0;\n let encontrado = false;\n while (!encontrado && x < lasEtiquetas.length) {\n let etiquetaX = lasEtiquetas[x];\n //Verificamos que el texto ingresado por el usuario sea subcadena de una etiqueta de un objeto\n if (etiquetaX.includes(textoIngresado)) {\n let j = 0;\n let existeElProdFiltrado = false;\n while (!existeElProdFiltrado && j < productosFiltrados.data.length) {\n let unProdFiltrado = productosFiltrados.data[j];\n if (unProd.nombre == unProdFiltrado.nombre) {\n existeElProdFiltrado = true;\n }\n j++;\n }\n if (!existeElProdFiltrado) {\n productosFiltrados.data.push(unProd);\n }\n }\n x++;\n }\n }\n }\n //Llamamos a la funcion de Crear listado de productos, y le pasamos el Objeto con los productos filtrados\n crearListadoProductos(productosFiltrados);\n}", "function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }", "function verificarCampos(){\n let añoS=parseInt(fechafinal.value.substr(0,4));\n let mesS=parseInt(fechafinal.value.substr(5,7));\n let diaS=parseInt(fechafinal.value.substr(8,10));\n \n\n if(idC.value==''|| producto.value=='' || estanteria.value==''|| precio.value==''||\n descripcion.value==''|| ubicacion.value=='' ||fechafinal.value=='' ){\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n LLene todo los Campos\n </div>\n `;\n mensaje.style.display='block';\n }else if((añoS<anoActual || mesS<mesActual) || diaS<=dia ){\n mensaje.style.display='block';\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n La fecha escojida debe ser superior a la actual \n </div>\n `;\n \n }else{\n insertarDatosEmpeno();\n }\n }", "function activarInputMontoGenericoPar(matriz,valor){\n if(valor==1){\n $(\"#monto_mod\"+matriz).attr(\"readonly\",true);\n $(\"#monto_modal\"+matriz).attr(\"readonly\",true);\n \n if(($(\"#habilitar\"+matriz).is(\"[checked]\"))){\n $(\"#habilitar\"+matriz).removeAttr(\"checked\");\n }\n }else{\n $(\"#monto_mod\"+matriz).removeAttr(\"readonly\");\n $(\"#monto_modal\"+matriz).removeAttr(\"readonly\");\n \n if(!($(\"#habilitar\"+matriz).is(\"[checked]\"))){\n }\n }\n var respu= matriz.split('RRR');\n calcularTotalPartidaGenerico(respu[0],1);\n}", "function checkSelection(tipo, destino){\n\n\tif ( get('frmBuscar.txtNombrePerfil') != ''\n\t\t && (validaChars(get('frmBuscar.txtNombrePerfil')) == false) )\n\t{\n\t\tcdos_mostrarAlert(GestionarMensaje('121'));\n\t\tfocaliza('frmBuscar.txtNombrePerfil');\n\t\treturn false;\t\t\t\t\t\t\n\t}\n\t\n\tif(tipo!=\"busca\"){\n\t\tif(lstResultado.seleccion.longitud!=1){\n\t\t\tGestionarMensaje('50',null,null,null);\n\t\t\treturn false;\n\t\t}\n\t}\n\t/*\n\telse{\n\t\tif(get(\"frmBuscar.txtNombrePerfil\")==\"\"){\n\t\t\tGestionarMensaje('9');\n\t\t\treturn false;\n\t\t}\n\t}\n\t*/\n\tset('frmBuscar.accion',tipo);\n\tif(tipo=='elimina')\n\t{\t\t\t\t\t\n\t\tif(!window.confirm(GestionarMensaje('51',null,null,null)+\" \"+lstResultado.getSeleccion() + \" ?\"))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tif(get('frmBuscar.seleccion')==\"\"){\n\t\tset('frmBuscar.seleccion',lstResultado.getSeleccion());\n\t}\n\tpostForm(tipo==\"busca\");\n}", "async sendOpsToUsers (op) {\n\t\tconst requestId = UUID();\n\t\tthis.log(`\\tSending Pubnub op to ${Object.keys(this.users).length} users, reqid=${requestId}...`);\n\t\tawait Promise.all(Object.keys(this.users).map(async userId => {\n\t\t\tawait this.sendUserOp(userId, op, requestId);\n\t\t}));\n\t}", "function buscarModulos(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Modulo.find({}, 'nombre tipo estado usuario') // envamos un obj vacio y buscamos por nombre enail y role \n .or([{ 'nombre': regex }, { 'tipo': regex }]) // envio un array de condiciones , busco por dos tipos \n .populate('usuario', 'nombre email') // se pueden poner mas populate de otras colecciones\n .exec((err, modulos) => {\n\n if (err) {\n reject('error al cargar modulos', err)\n } else {\n // modulos ira comno respuesta en el array respuesta[0]\n resolve(modulos) // devuelve los modulos encontrados en el find\n }\n })\n });\n}", "function usuarioDonoDoComentario(comentarioId, disciplinaId, email) {\n if (localStorage.getItem(\"userEmail\") == email) {\n const comentarioDelete = document.createElement(\"input\")\n comentarioDelete.type = \"image\"\n comentarioDelete.className = \"comentarioDelete\"\n comentarioDelete.src = \"./images/delete.svg\"\n comentarioDelete.onclick = async function () {\n await deletarComentarioFetcher(disciplinaId, comentarioId)\n await perfilModController(disciplinaId)\n }\n return comentarioDelete;\n }\n return \"\";\n}", "function editarPedido(id, fila) {\n let celdas = fila.querySelectorAll(\"td\");\n \n //CARGA INPUTS CON DATOS DE LA FILA\n inputNombre.value = celdas[0].innerHTML.trim();\n inputDireccion.value = celdas[1].innerHTML.trim();\n inputSelect.value = celdas[2].innerHTML.trim();\n inputCantidad.value = celdas[3].innerHTML.trim();\n inputCodigo.value = celdas[4].innerHTML.trim();\n\n //OCULTA BOTON AGREGAR\n let btnAgregar = document.querySelector(\"#btn_agregar\");\n btnAgregar.style.display = \"none\";\n\n //AGREGA Y ASIGNA FUNCIONAMIENTO A BOTONES GUARDAR Y CANCELAR\n document.querySelector(\"#botonesEditar\").innerHTML =\n `<button id=\"btnGuardar\"> GUARDAR </button> <button id=\"btnCancelar\"> CANCELAR </button>`;\n document.querySelector(\"#btnGuardar\").addEventListener(\"click\", function () {\n let pedidoEditado = {\n nombre: inputNombre.value,\n direccion: inputDireccion.value,\n producto: inputSelect.value,\n cantidad: parseInt(inputCantidad.value),\n codigodescuento: inputCodigo.value,\n id: id,\n }\n editarPedidoAPI(pedidoEditado, celdas);\n btnAgregar.style.display = \"flex\";\n document.querySelector(\"#botonesEditar\").innerHTML = \"\";\n });\n document.querySelector(\"#btnCancelar\").addEventListener(\"click\", function () {\n btnAgregar.style.display = \"flex\";\n document.querySelector(\"#botonesEditar\").innerHTML = \"\";\n vaciarInputs();\n });\n}", "function cambiausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.addVar(\"usuario_id\",f.f2usrid.value);\n x.go(\"clientes\",\"editausr\",llenausr);\n }\n}", "function TodosUsuarios(req, res, next)\n {\n connection.query('SELECT * FROM `usuario`', \n function (error, results)\n {\n if(error) throw error;\n console.log(results);\n res.send(200, results);\n return next();\n }\n );\n }", "function obterLista(elemento) {\n switch (elemento) {\n case 'insetos':\n crudService.listarRegistros(rotaInseto, sucessoInseto)\n\n function sucessoInseto(res) {\n $scope.listInsetos = res.data;\n }\n break;\n case 'ordem':\n crudService.listarRegistros(rotaOrdem, sucessoOrdem)\n\n function sucessoOrdem(res) {\n $scope.listOrdem = res.data;\n }\n break;\n }\n }", "function preenche(){\n if(comentario.comentario==\"\"){\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = 'comentario apagado';\n c.botaoEnviarComentario = c.botoes.children[0];\n }else{\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = comentario.comentario;\n c.botaoEnviarComentario = c.botoes.children[0];\n }\n }", "_validateAddUsuarioAction() {\n if (this._validateData() != true) {\n this._saveUsuario();\n } else {\n this._renderAlert(false, '¡Debe de llenar los campos requeridos!');\n }\n }", "function confirmarModificarPregunta(){\r\n\r\n\tvar idBoton = $(\"#btnConfirmarModificarPregunta\");\r\n\tvar idLoader = $(\"#loaderModificarPregunta\");\r\n\r\n\tidBoton.click(function(){\r\n\r\n\t\tif($(\"#formModificarPregunta\").valid()){\r\n\r\n\t\t\tefectoProcesamiento(idBoton,idLoader,true);\r\n\r\n\r\n\t\t\tvar idPregunta = $(\"#txtIdPregunta\").val();\r\n\r\n\t\t\tvar nombre = $.trim($(\"#txtNombrePreguntaMod\").val());\r\n\t\t\tvar idDetalleTipoFormacion = $(\"#selectDetalleTipoFormacionPreguntaMod\").val();\r\n\t\t\tvar idDetalleEstado = $(\"#selectDetalleEstadoPreguntaMod\").val();\r\n\t\t\t\r\n\r\n\t\t\tvar detalleTipoFormacion = {\t\t\t\r\n\t\t\t\t\t\"id\" : idDetalleTipoFormacion\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar detalleEstado = {\t\t\t\r\n\t\t\t\t\t\"id\" : idDetalleEstado\t\t\t\r\n\t\t\t}\r\n \r\n\r\n\t\t\tvar pregunta = {\t\t\r\n\t\t\t\t\t\"id\" : idPregunta,\r\n\t\t\t\t\t\"nombre\" : nombre,\r\n\t\t\t\t\t\"detalleTipoFormacion\" : detalleTipoFormacion,\r\n\t\t\t\t\t\"detalleEstado\" : detalleEstado\t\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\r\n\t\t\tguardar(\"pregunta\",pregunta,\"PUT\",false).done(function(){\r\n\r\n\t\t\t\tefectoProcesamiento(idBoton,idLoader,false);\r\n\t\t\t\t$('#modalModificarPregunta').modal('hide');\r\n\t\t\t\ttostadaActualizar();\t\r\n\t\t\t\tlistarTodosFiltroPregunta();\r\n\r\n\t\t\t}).fail(function(){\r\n\t\t\t\tefectoProcesamiento(idBoton,idLoader,false);\r\n\t\t\t\ttostadaError();\r\n\t\t\t});\r\n\r\n\t\t}\t\t\r\n\t})\r\n}", "function validarNomeDeUsuario(nomeDeUsuario) {\n if (trim(nomeDeUsuario.value) != '') {\n document.formFuncionario.nomeDeUsuario.value = retirarAcentos(trim(document.formFuncionario.nomeDeUsuario.value)).toLowerCase();\n }\n}", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "function notificacionMasiva(titulo, cuerpo) {\n Usuario.find({}).then((usuarios) => {\n var allSubscriptions = [];\n usuarios.forEach((usuario) => {\n allSubscriptions = allSubscriptions.concat(usuario.suscripciones);\n });\n notificar(allSubscriptions, titulo, cuerpo);\n });\n}", "function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n let inputNombre = document.getElementById(\"inombre\");\n\n const sexo = selectorSexo.value;\n const nombre = inputNombre.value.trim().toLowerCase();\n\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\n console.debug(\"personas %o\", personas);\n\n //creamos una copia para no modificar el original\n let personasFiltradas = personas.map((el) => el);\n\n //filtrar por sexo, si es 't' todos no hace falta filtrar\n if (sexo == \"h\" || sexo == \"m\") {\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\n console.debug(\"filtrado por sexo %o\", personasFiltradas);\n }\n\n //filtrar por nombre buscado\n if (nombre != \" \") {\n personasFiltradas = personasFiltradas.filter((el) =>\n el.nombre.toLowerCase().includes(nombre)\n );\n console.debug(\"filtrado por nombre %o\", personasFiltradas);\n }\n\n maquetarLista(personasFiltradas);\n}", "function confirmarAcao(acao) {\n if(confirm(\"Tem certeza que deseja incluir este paciente na fila de \" + acao + \"?\")) {\n return true;\n }\n else {\n return false;\n }\n}", "function ConfirmarBoton(controlar) {\n\n\tif (controlar==\"si\") {\n\t\tresp=confirm(\"¿Está seguro que desea borrar el registro?\") \n\t\tif(resp) return true;\n\t\telse return false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function valida_actio(action) {\n console.log(\"en la mitad\");\n if (action === \"crear\") {\n crea_documento();\n } else {\n edita_documento();\n }\n }" ]
[ "0.80265516", "0.80265516", "0.67630863", "0.67630863", "0.61554533", "0.6106358", "0.58928365", "0.54975146", "0.5472808", "0.545245", "0.5437709", "0.542456", "0.5419351", "0.5368439", "0.5365553", "0.53437465", "0.531203", "0.5305149", "0.52963907", "0.5285123", "0.5276386", "0.5244962", "0.52366906", "0.523173", "0.52071047", "0.51934874", "0.5182205", "0.51584065", "0.5156618", "0.51543885", "0.5144735", "0.5132656", "0.5129314", "0.51172394", "0.50988674", "0.50976115", "0.5093092", "0.50923234", "0.5081621", "0.50732046", "0.5066684", "0.50643367", "0.5063651", "0.50543255", "0.50534165", "0.50502765", "0.5047853", "0.5044371", "0.50438917", "0.5038516", "0.5031986", "0.50258523", "0.50248146", "0.5023116", "0.5018459", "0.50153804", "0.50141066", "0.50126696", "0.5010892", "0.50001925", "0.4995032", "0.49920005", "0.4985606", "0.49620432", "0.4959318", "0.49570557", "0.49536562", "0.49512553", "0.49507758", "0.49416083", "0.49389726", "0.49283484", "0.49149913", "0.49092233", "0.4896422", "0.48940036", "0.48849112", "0.48822474", "0.48805973", "0.48790252", "0.48766056", "0.48755264", "0.48754957", "0.48734164", "0.48725334", "0.487182", "0.48710957", "0.4870339", "0.48681948", "0.48649776", "0.48645136", "0.4863546", "0.48582456", "0.48578268", "0.48522186", "0.48507762", "0.48495945", "0.4845478", "0.48435706", "0.4836612", "0.48354185" ]
0.0
-1
Funcao para exibir alert com opcoes de OK ou Cancelar quando o paramentro 'campo' for vazio Esta funcao eh usada na pagina consultarPaciente para garantir que o usuario queira mesmo buscar todos os registros
function confirmarBuscarTodos(campo, op) { if ((trim(campo.value) == '') || (campo.value == null)) { if(confirm("Tem certeza que deseja pesquisar todos os registros?\nEsta operacao pode ser demorada devido a quantidade de registros.")) { submeter(op); return true; } else { return false; } } else { submeter(op); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function act_cliente()\r\n{\r\n\t'domready',Sexy = new SexyAlertBox();\r\n\tname = document.actualizar_cliente_form.nombre.value;\r\n\tvar exp = new RegExp('^[A-Za-z]{1,60}$');\r\n\tif(!exp.test(name))\r\n\t{\r\n\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Nombres) sólo admite letras (mayúsculas, minúsculas).</p>', \r\n\t\t{ onComplete: \r\n\t\t\tfunction(returnvalue) { \r\n\t\t\t if(returnvalue)\r\n\t\t\t {\r\n\t\t\t\t document.getElementById(\"nombre_id\").style.borderColor=\"red\";\r\n\t\t\t\t document.getElementById(\"nombre_id\").style.background=\"#FA5858\";\r\n\t\t\t\t document.registrar_cliente_form.nombre.focus();\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\telse\r\n\t{\r\n\t\tapll = document.actualizar_cliente_form.apellido.value;\r\n\t\tvar exp = new RegExp('^[A-Za-z]{1,60}$');\r\n\t\tif(!exp.test(apll))\r\n\t\t{\r\n\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Apellidos) sólo admite letras (mayúsculas, minúsculas).</p>', \r\n\t\t\t{ onComplete: \r\n\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\tif(returnvalue)\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.getElementById(\"apll\").style.borderColor=\"red\";\r\n\t\t\t\t\tdocument.getElementById(\"apll\").style.background=\"#FA5858\";\r\n\t\t\t\t\tdocument.registrar_cliente_form.apellido.focus();\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdocument.actualizar_cliente_form.submit();\r\n\t\t}\r\n\t}\r\n}", "function registroUsuario() {\r\n\r\n /*\r\n * VALIDAR EL NOMBRE\r\n */\r\n var nombre = $(\"#regUsuario\").val();\r\n if (nombre != \"\") {\r\n var expresion = /^[a-zA-ZñÑáéíóúÁÉÍÓÚ ]*$/;\r\n\r\n if (!expresion.test(nombre)) {\r\n $(\"#regUsuario\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>No se permite numeros ni caracteres especialies</div>');\r\n return false;\r\n }\r\n } else {\r\n $(\"#regUsuario\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>Este campo es obligatório</div>');\r\n return false;\r\n }\r\n\r\n\r\n\r\n\r\n /*\r\n * VALIDAR EL EMAIL\r\n */\r\n var email = $(\"#regEmail\").val();\r\n\r\n if (email != \"\") {\r\n\r\n var expresion = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\r\n\r\n if (!expresion.test(email)) {\r\n $(\"#regEmail\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>Escriba correctamente el correio electrónico</div>');\r\n return false;\r\n }\r\n\r\n if (validarEmailRepetido) {\r\n $(\"#regEmail\").parent().before('<div class=\"alert alert-danger\"><strong>ERROR:</strong>El correo electrónico ya existe en la base de datos, por favor ingrese otro diferente </div>');\r\n return false;\r\n }\r\n } else {\r\n $(\"#regEmail\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>Este campo es obligatório</div>');\r\n return false;\r\n }\r\n\r\n\r\n\r\n\r\n /*\r\n * VALIDAR CONTRASEÑA\r\n */\r\n var password = $(\"#regPassword\").val();\r\n if (password != \"\") {\r\n var expresion = /^[a-zA-Z0-9]*$/;\r\n if (!expresion.test(password)) {\r\n $(\"#regPassword\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>No se permite caracteres especialies</div>');\r\n return false;\r\n }\r\n } else {\r\n $(\"#regPassword\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>Este campo es obligatório</div>');\r\n return false;\r\n }\r\n\r\n\r\n\r\n\r\n /*\r\n * VALITAR POLITICAS DE PRIVACIDAD\r\n */\r\n var politicas = $(\"#regPoliticas:checked\").val();\r\n if (politicas != \"on\") {\r\n $(\"#regPoliticas\").parent().before('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong>Debe aceptar nuestras condiciones de uso y políticas de privacidad</div>')\r\n return false;\r\n }\r\n return true;\r\n}", "function irAAgregarMaestro(){\r\n\tvar msg = \"Desea Agregar un NUEVO REGISTRO?.. \";\r\n\tif(confirm(msg)) Cons_maestro(\"\", \"agregar\",tabla,titulo);\r\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 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 Fnc_BuscarInformacionHogar(s, e) {\n\n if (txtIdentidad.GetText() != \"\" || txtHogar.GetText() != \"\") {\n var NumHogar = (txtHogar.GetText() == \"\") ? 0 : txtHogar.GetText()\n if (txtIdentidad.GetText() != \"\") {\n if (txtIdentidad.GetText().length != 13) {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error dede de ingresar un numero de identidad valido\")\n $(\".error\").show()\n return 0;\n }\n }\n Fnc_PeticionInformacionHogarSuspender(NumHogar, txtIdentidad.GetText())\n\n } else {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error no debe de haber campos vacios\")\n $(\".error\").show()\n }\n\n}", "function cadastrar(){\n\n\n if(emailU!=emailConfU){\n alert(\"O email não confere com o digitado no primeiro campo\");\n }\n else if(senhaU!=senhaConfU){\n alert(\"A senha não confere com a digitada no campo acima\");\n }\n else if(emailU==emailConfU && senhaU==senhaConfU){\n \n }\n}", "function doAceptar(){\r\n\tvar error = \"\";\r\n\t$j(\".error\").each( function(){ $j(this).removeClass(\"error\");});\r\n\t\r\n\tif ( $j('#nombre').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Cliente</li>\";\r\n\t\t$j('#nombre').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#email').val().replace(/^\\s*/, '')==\"\" || !isValidEmailAddress($j('#email').val()) ){\r\n\t\terror += \"<li>E-mail no es correcto</li>\";\r\n\t\t$j('#email').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#password').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Contrase&ntilde;a</li>\";\r\n\t\t$j('#password').addClass(\"error\");\r\n\t}else{\r\n\t\tif ( $j('#password').val().length < 3 ){\r\n\t\t\terror += \"<li>Contrase&ntilde;a corta (min. 4)</li>\";\r\n\t\t\t$j('#password').addClass(\"error\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ( $j('#estado').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Estado</li>\";\r\n\t\t$j('#estado').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#suscripcion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Recibir informaci&oacute;n</li>\";\r\n\t\t$j('#suscripcion').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#direccion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Direccion de env&iacute;o</li>\";\r\n\t\t$j('#direccion').addClass(\"error\");\r\n\t}\t\r\n\t\r\n\tif ( $j('#poblacion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Poblaci&oacute;n de env&iacute;o</li>\";\r\n\t\t$j('#poblacion').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#id_provincia').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Provincia de env&iacute;o</li>\";\r\n\t\t$j('#id_provincia').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#cpostal').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Codigo Postal de env&iacute;o</li>\";\r\n\t\t$j('#cpostal').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#f_id_pais').val().replace(/^\\s*/, '')!=\"\" ){\t\t\r\n\t\tif ( $j('#razon').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Razon social</li>\";\r\n\t\t\t$j('#razon').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#nifcif').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>DNI/CIF</li>\";\r\n\t\t\t$j('#nifcif').addClass(\"error\");\r\n\t\t}else{\r\n\t\t\tif ( $j('#nifcif').val().length < 7 ){\r\n\t\t\t\terror += \"<li>DNI/CIF no es correcto</li>\";\r\n\t\t\t\t$j('#nifcif').addClass(\"error\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#fdireccion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Direcci&oacute;n de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fdireccion').addClass(\"error\");\r\n\t\t}\t\r\n\t\t\r\n\t\tif ( $j('#fpoblacion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Poblaci&oacute;n de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fpoblacion').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#f_id_provincia').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Provincia de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#f_id_provincia').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#fcpostal').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Codigo Postal de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fcpostal').addClass(\"error\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif ( error ){\r\n\t\t$j( \"<div>Los siguientes campos resaltados tienen alg&uacute;n error:<br><br>\"+error+\"<br></div>\" ).dialog({\r\n\t\t modal: true,\r\n\t\t buttons: {\r\n\t\t VALE: function(){ $j( this ).dialog( \"close\" ); }\t \r\n\t\t }\r\n\t\t});\r\n\t\treturn false;\r\n\t}\t\r\n\tsendForm(\"doUpdate\",\"html\");\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 valida_campo(campo,id_campo,id_erro){\n if(campo == \"\" || campo == null ){\n document.getElementById(id_erro).innerHTML = \"Campo obrigatório.\" ;\n document.getElementById(id_campo).focus();\n return false;\n }\n document.getElementById(id_erro).innerHTML = \"\" ; //limpar mensagem\n return true;\n}", "function chequearDatosEnvio(){\n // chequeo de calle, nropuerta, esquina\n let calle = document.getElementById(\"calle\").value;\n let nropuerta = document.getElementById(\"numeropuerta\").value;\n let esquina = document.getElementById(\"esquina\").value;\n let pais = document.getElementById(\"pais\").value;\n let envio = document.getElementById(\"metodoEnvio\").value;\n\n if(calle == \"\"){\n alert(\"Agregue una calle para el envío.\");\n return false;\n } else if(nropuerta == \"\"){\n alert(\"Agregue un número de puerta para el envío.\");\n return false;\n } else if(esquina == \"\"){\n alert(\"Agregue una esquina para el envío.\");\n return false\n } else if(pais == \"\"){\n alert(\"Agregue un país para el envío.\");\n return false;\n } else if(envio == 0){\n alert(\"Seleccione método de envío.\");\n return false;\n }\n\n return true;\n}", "function checarNroApoliceVazio(nroApolice){\r\n\tif (nroApolice.length==0 || nroApolice==\"\"){\r\n\t\tif ($('#statusOperacional').val()==2){\r\n\t\t\tif (confirm(\"Esta alteração ira limpar todas as informações de Apólice e retornar o estado de Proposta! \\n CONFIRMA?\")){\r\n\t\t\t\t$('#dataEmissaoApolice').val(\"\");\r\n\t\t\t\t$('#dataBaixaApolice').val(\"\");\r\n\t\t\t\t$('#dataLanctoApolice').val(\"\");\r\n\t\t\t\t$('#dataRecebApolice').val(\"\");\r\n\t\t\t\t$('#propostaCodigoIdentificacao').val(\"\");\r\n\t\t\t}else\r\n\t\t\t\tdocument.formEdit.reset();\r\n\t\t}else if ($('#statusOperacional').val()==0 || $('#statusOperacional').val()==4){\r\n\t\t\t$('#dataEmissaoApolice').val(\"\");\r\n\t\t\t$('#dataBaixaApolice').val(\"\");\r\n\t\t\t$('#dataLanctoApolice').val(\"\");\r\n\t\t\t$('#dataRecebApolice').val(\"\");\r\n\t\t\t$('#propostaCodigoIdentificacao').val(\"\");\r\n\t\t}\r\n\t}\r\n}", "function validarAgroquimicoUnico(){\n var select = document.getElementById(\"medida\");\n var options=document.getElementsByTagName(\"option\");\n var idRol= select.value;\n var x = select.options[select.selectedIndex].text;\n var nombreAgroquimico = document.getElementById(\"nombreAgroquimico\").value;\n var nombreAgroquimico_UnidadMedida= nombreAgroquimico + \" \" +x;\n var route = \"http://localhost:8000/validarAgroquimicoUnico\";\n var oculto =document.getElementById(\"oculto\").value;\n if(nombreAgroquimico != oculto){\n $.get(route,function(res){\n $(res).each(function(key,value){\n agroquimico= value.nombre+ \" \"+value.nombreUnidadMedida+\" \"+value.cantidadUnidadMedida+ \" \"+ value.unidad_medida;\n if(nombreAgroquimico_UnidadMedida == agroquimico ){\n document.getElementById('submit').disabled=true;\n document.getElementById(\"alerta\").innerHTML = \"<div class=\\\"alert alert-danger\\\" id=\\'result\\'><strong>El agroquímico\" +\n \" que intentas registrar ya existe en el sistema.</strong></div>\";\n return false;\n } else {\n document.getElementById(\"alerta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n }\n });\n });\n } \n}", "function validarPlacas(){\n\n var placa =document.getElementById('placas').value;\n var ocultoPlaca =document.getElementById('ocultoPlaca').value;\n var route = \"http://localhost:8000/validarPlacas/\"+placa;\n\n\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idVehiculo = res[0].id;\n document.getElementById(\"idVehiculo\").value= idVehiculo;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].placas != ocultoPlaca ) {\n\n\n document.getElementById(\"errorPlaca\").innerHTML = \"El vehiculo que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n console.log(res.length);\n document.getElementById(\"errorPlaca\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\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", "function registroUsuario(){\n\n\t$(\".alert\").remove();\n\t/*=============================================\n\tVALIDAR EL CODIGO\n\t=============================================*/\n\n\tvar nombre = $(\"#regCodigo\").val();\n\t\n\tif(nombre != \"\"){\n\n\t\tvar expresion = /^[0-9]*$/;\n\n\t\tif(!expresion.test(nombre)){\n\n\t\t\t$(\"#regCodigo\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong>Solo se admite Numeros</div>')\n\n\t\t\treturn false;\n\n\t\t}else if(nombre.length != 8){\n\t\t\t\n\t\t\t$(\"#regCodigo\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong>Solo Se admite 8 digitos</div>')\n\n\t\t\treturn false;\n\t\t}\n\n\t}else{\n\n\t\t$(\"#regCodigo\").parent().after('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong> Este campo es obligatorio</div>')\n\n\t\treturn false;\n\t}\n\t\n\t/*=============================================\n\tVALIDAR EL NOMBRE\n\t=============================================*/\n\n\tvar nombre = $(\"#regUsuario\").val();\n\n\tif(nombre != \"\"){\n\n\t\tvar expresion = /^[a-zA-ZñÑáéíóúÁÉÍÓÚ ]*$/;\n\n\t\tif(!expresion.test(nombre)){\n\n\t\t\t$(\"#regUsuario\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong> No se permiten números ni caracteres especiales</div>')\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}else{\n\n\t\t$(\"#regUsuario\").parent().after('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong> Este campo es obligatorio</div>')\n\n\t\treturn false;\n\t}\n\n\t/*=============================================\n\tVALIDAR EL USER\n\t=============================================*/\n\n\tvar nombre = $(\"#regUser\").val();\n\n\tif(nombre != \"\"){\n\n\t\tvar expresion = /^[a-zA-Z0-9]*$/;\n\n\t\tif(!expresion.test(nombre)){\n\n\t\t\t$(\"#regUser\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong> No se permiten caracteres especiales</div>')\n\n\t\t\treturn false;\n\n\t\t}\n\t\tif(validarUserI == true){\n\t\t\t\n\t\t\t$(\"#regUser\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong> El usuario ya existe en la base de datos</div>')\n\n\t\t\treturn false;\n\t\t}\n\n\t}else{\n\n\t\t$(\"#regUser\").parent().after('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong> Este campo es obligatorio</div>')\n\n\t\treturn false;\n\t}\n\n\t/*=============================================\n\tVALIDAR EL EMAIL\n\t=============================================*/\n\n\tvar email = $(\"#regEmail\").val();\n\n\tif(email != \"\"){\n\n\t\tvar expresion = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n\n\t\tif(!expresion.test(email)){\n\n\t\t\t$(\"#regEmail\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong> Escriba correctamente el correo electrónico</div>')\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}else{\n\n\t\t$(\"#regEmail\").parent().after('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong> Este campo es obligatorio</div>')\n\n\t\treturn false;\n\t}\n\n\n\t/*=============================================\n\tVALIDAR CONTRASEÑA\n\t=============================================*/\n\n\tvar password = $(\"#regPassword\").val();\n\n\tif(password != \"\"){\n\n\t\tvar expresion = /^[a-zA-Z0-9]*$/;\n\n\t\tif(!expresion.test(password)){\n\n\t\t\t$(\"#regPassword\").parent().after('<div class=\"alert alert-warning\"><strong>ERROR:</strong> No se permiten caracteres especiales</div>')\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}else{\n\n\t\t$(\"#regPassword\").parent().after('<div class=\"alert alert-warning\"><strong>ATENCIÓN:</strong> Este campo es obligatorio</div>')\n\n\t\treturn false;\n\n\t}\n\n\treturn true;\n}", "function validaPreenchimentoCamposFaixa(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.localidadeOrigemID.value != \"\" && form.localidadeDestinoID.value == \"\"){\r\n\t\talert(\"Informe Localidade Final.\");\r\n\t\tform.localidadeDestinoID.focus();\r\n\t\tretorno = false;\r\n\t}else if(form.localidadeDestinoID.value != \"\" && form.localidadeOrigemID.value == \"\"){\r\n\t\talert(\"Informe Localidade Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != \"\" && form.setorComercialDestinoCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.setorComercialDestinoCD.value != \"\" && form.setorComercialOrigemCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.quadraOrigemID.value != \"\" && form.quadraDestinoID.value == \"\"){\r\n\t\talert(\"Informe Quadra Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.quadraDestinoID.value != \"\" && form.quadraOrigemID.value == \"\"){\r\n\t\talert(\"Informa Quadra Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.loteOrigem.value != \"\" && form.loteDestino.value == \"\"){\r\n\t\talert(\"Informe Lote Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.loteDestino.value != \"\" && form.loteOrigem.value == \"\"){\r\n\t\talert(\"Informe Lote Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function verificarEmpleadoConceptos(form) {\r\n\tvar secuencia=document.getElementById(\"secuencia\").value;\r\n\tvar registro=document.getElementById(\"registro\").value;\r\n\tvar accion=document.getElementById(\"accion\").value;\r\n\tvar codconcepto=document.getElementById(\"codconcepto\").value; codconcepto=codconcepto.trim();\r\n\tvar pdesde=document.getElementById(\"pdesde\").value; pdesde=pdesde.trim(); var esPdesde=esPContable(pdesde);\r\n\tvar phasta=document.getElementById(\"phasta\").value; phasta=phasta.trim(); var esPhasta=esPContable(phasta);\r\n\tvar codproceso=document.getElementById(\"codproceso\").value; codproceso=codproceso.trim();\r\n\tvar monto=document.getElementById(\"monto\").value; monto=monto.trim(); monto=monto.replace(\",\", \".\");\r\n\tvar cantidad=document.getElementById(\"cantidad\").value; cantidad=cantidad.trim(); cantidad=cantidad.replace(\",\", \".\");\r\n\tvar status=document.getElementById(\"status\").value; status=status.trim();\r\n\tif (document.getElementById(\"flagproceso\").checked) var flagproceso=\"S\"; else var flagproceso=\"N\";\r\n\t\r\n\tif (codconcepto==\"\" || status==\"\" || codproceso==\"\" || pdesde==\"\") msjError(1010);\r\n\telse if (isNaN(monto)) alert(\"¡MONTO INCORRECTO!\");\r\n\telse if (isNaN(cantidad)) alert(\"¡CANTIDAD INCORRECTA!\");\r\n\telse if (pdesde!=\"\" && !esPdesde) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (phasta!=\"\" && !esPhasta) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (pdesde!=\"\" && phasta!=\"\" && (!esPdesde || !esPhasta || (pdesde>phasta))) alert(\"¡PERIODO INCORRECTO!\");\r\n\t//else if (monto == 0) alert(\"¡NO SE PUEDE ASIGNAR UN CONCEPTO CON MONTO EN CERO!\");\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=EMPLEADOS-CONCEPTOS&accion=\"+accion+\"&codpersona=\"+registro+\"&secuencia=\"+secuencia+\"&codconcepto=\"+codconcepto+\"&pdesde=\"+pdesde+\"&phasta=\"+phasta+\"&codproceso=\"+codproceso+\"&monto=\"+monto+\"&cantidad=\"+cantidad+\"&status=\"+status+\"&flagproceso=\"+flagproceso);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tif (resp!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse cargarPagina(form, \"empleados_conceptos.php\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function realizarBusqueda(){\r\n let criterioDeBusq = document.querySelector(\"#buscadorDeEjercicios\").value;\r\n let mensaje = \"\";\r\n if (validarCampoLleno(criterioDeBusq)&& criterioDeBusq.length!==1){\r\n mensaje = buscarSegunCriterio(criterioDeBusq);\r\n document.querySelector(\"#divEjElegido\").innerHTML = mensaje;\r\n addEventsEntrega();\r\n }else{\r\n document.querySelector(\"#errorBuscadorDeEjercicios\").innerHTML = \"Debe llenar el campo con al menos dos caracteres\"; \r\n }\r\n}", "function consulta_filtro_cartera(){\ndocument.getElementById(\"escogecliente\").innerHTML=\"\";\n var IdCliente=$(\"#cartera\").val();\n //alert(IdCliente);\n if (parseInt(IdCliente) === 0){\n alert(\"Debe escoger un cliente\");\n document.getElementById(\"escogecliente\").innerHTML=\"Debe escoger un cliente\";\n document.getElementById(\"escogecliente\").style.color=\"red\";\n return;\n \n } \n \n var pagos_ini=$('#pagos').val();\n var pagos_fin=$('#pagos1').val();\n var tvencido_ini=$('#tvencido').val();\n var tvencido_fin=$('#tvencido1').val();\n var vcompromiso_ini=$('#vcompromiso').val();\n var vcompromiso_fin=$('#vcompromiso1').val();\n var saldos_ini=$('#saldos').val();\n var saldos_fin=$('#saldos1').val();\n var dia_mora_ini=$('#dia_mora').val();\n var dia_mora_fin=$('#dia_mora1').val();\n var fUltimo_pago_ini=$('#datetimepicker10').val();\n var fUltimo_pago_fin=$('#datetimepicker11').val();\n var fUltimo_gestion_ini=$('#datetimepicker12').val();\n var fUltimo_gestion_fin=$('#datetimepicker13').val();\n var fUltimo_compromiso_ini=$('#datetimepicker14').val();\n var fUltimo_compromiso_fin=$('#datetimepicker15').val();\n var SelectTipoGestion=$(\"#tgestion\").val();\n var SelectTipoResultado=$(\"#tresultado_gestion\").val();\n var carteras=$('#tcartera').val();\n var subcartera=$('#tsub_cartera').val();\n var segmento=$('#tsegmento').val();\n var subsegmento=$(\"#tsub_segmento\").val();\n var testatus_cre=$(\"#testatus_cre\").val();\n var cartera = $(\"#cartera\").val();\n console.log(\"Paso1: >>>\"+cartera);\n var accion = \"nuevaConsulta\";\n var order_by=$('#order_by').val();\n var lv_select=\" select count(*) OVER (ORDER BY s.id_transaccion) AS secuencia2,\";\n var lv_select2=\" select \";\n var lv_datos=\" '<a href=\\\"#\\\" onclick=\\\"GestionCliente('||s.id_cliente||','||s.id_datos_deudor||');\\\" >'||s.nombres_completo||'</a>' nombres_completo2,s.* \";\n var lv_from=\" from \"; \n var lv_mi_empleado=$('#mi_empleado').val();//\"IDEmpleadoConsulta\";\n var lv_query=\" vw_consulta_cartera s \";\n var IDEmpleadoConsulta=\"\";\n var estatus=\"\";\n if(lv_mi_empleado===\"\"){\n IDEmpleadoConsulta=\"and s.id_empleado=IDEmpleadoConsulta\";\n \n }else{\n IDEmpleadoConsulta=\"and s.id_empleado=\"+lv_mi_empleado;\n }\n //testatus_cre\n if(testatus_cre!==\"0\"){\n estatus=\" and s.tipo_estatus=\"+testatus_cre; \n }\n if(lv_mi_empleado===\"0\"){\n var txt;\n var r = confirm(\"Esta seguro que desea consultar todos los Gestores \\nRecuerde que esta consulta puede detener los procesos actuales del Sistema. \\nProcure utilizar los filtros\");\n if (r == false) {\n return;\n } \n \n IDEmpleadoConsulta=\"\";\n }\n \n \n var lv_filtros=\" where s.id_cliente=IDClienteConsulta \"+IDEmpleadoConsulta+\" and s.estado != 'E' \" +estatus;\n var sqlQuery=lv_select+lv_datos+lv_from+lv_query+lv_filtros;\n \n //\n var fmontos=\"\";\n /*valida critrios de pagos*/\n if (pagos_ini.length !== 0 && pagos_fin.length !==0 && parseInt(pagos_ini) >= parseInt(pagos_fin)){ alert(\"El valor de PAGO Inicial debe ser MENOR a la PAGO final para realizar la consulta\"); return; }\n if (pagos_ini.length !== 0 && pagos_fin.length !==0 && parseInt(pagos_ini) < parseInt(pagos_fin)){ fmontos+= \" AND s.pagos >= \"+pagos_ini+\" AND s.pagos <= \"+pagos_fin; }\n if (pagos_ini.length !== 0 && pagos_fin.length === 0 && parseInt(pagos_ini) < 0){ alert(\"El valor en PAGOS ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (pagos_ini.length !== 0 && pagos_fin.length === 0 && parseInt(pagos_ini) > 0){ fmontos+= \" AND s.pagos >= \"+pagos_ini ; }\n if (pagos_ini.length === 0 && pagos_fin.length !== 0 && parseInt(pagos_fin) < 0){ alert(\"El valor ingresdo en PAGOS debe ser mayo a 0 para realizar la consulta\"); return; }\n if (pagos_ini.length === 0 && pagos_fin.length !== 0 && parseInt(pagos_fin) > 0){ fmontos+= \" AND s.pagos <= \"+pagos_fin ; }\n /*valida critrios de Total Deuda*/ \n if (tvencido_ini.length !== 0 && tvencido_fin.length !==0 && parseInt(tvencido_ini) >= parseInt(tvencido_fin)){ alert(\"El valor de Deudoa Total Inicial debe ser MENOR a la PAGO final para realizar la consulta\"); return; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length !==0 && parseInt(tvencido_ini) < parseInt(tvencido_fin)){ fmontos+= \" AND s.total_vencidos >= \"+tvencido_ini+\" AND s.total_vencidos <= \"+tvencido_fin; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length === 0 && parseInt(tvencido_ini) < 0){ alert(\"El valor en Total Deuda ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length === 0 && parseInt(tvencido_ini) > 0){ fmontos+= \" AND s.total_vencidos >= \"+tvencido_ini ; }\n if (tvencido_ini.length === 0 && tvencido_fin.length !== 0 && parseInt(tvencido_fin) < 0){ alert(\"El valor ingresdo en Total Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (tvencido_ini.length === 0 && tvencido_fin.length !== 0 && parseInt(tvencido_fin) > 0){ fmontos+= \" AND s.pagtotal_vencidosos <= \"+tvencido_fin ; }\n \n /*valida critrios de Valor Compromiso*/ \n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length !==0 && parseInt(vcompromiso_ini) >= parseInt(vcompromiso_fin)){ alert(\"El valor de Compromiso de Pago Inicial debe ser MENOR a Compromiso de Pago final para realizar la consulta\"); return; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length !==0 && parseInt(vcompromiso_ini) < parseInt(vcompromiso_fin)){ fmontos+= \" AND s.valor_compro >= \"+vcompromiso_ini+\" AND s.valor_compro <= \"+vcompromiso_fin; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length === 0 && parseInt(vcompromiso_ini) < 0){ alert(\"El valor en Compromiso de Pago ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length === 0 && parseInt(vcompromiso_ini) > 0){ fmontos+= \" AND s.valor_compro >= \"+vcompromiso_ini ; }\n if (vcompromiso_ini.length === 0 && vcompromiso_fin.length !== 0 && parseInt(vcompromiso_fin) < 0){ alert(\"El valor Compromiso de Pago Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (vcompromiso_ini.length === 0 && vcompromiso_fin.length !== 0 && parseInt(vcompromiso_fin) > 0){ fmontos+= \" AND s.valor_compro <= \"+vcompromiso_fin ; }\n \n /*valida critrios de Saldos*/ \n if (saldos_ini.length !== 0 && saldos_fin.length !==0 && parseInt(saldos_ini) >= parseInt(saldos_fin)){ alert(\"El valor de Saldo Inicial debe ser MENOR al Saldo final para realizar la consulta\"); return; }\n if (saldos_ini.length !== 0 && saldos_fin.length !==0 && parseInt(saldos_ini) < parseInt(saldos_fin)){ fmontos+= \" AND s.saldo >= \"+saldos_ini+\" AND s.saldo <= \"+saldos_fin; }\n if (saldos_ini.length !== 0 && saldos_fin.length === 0 && parseInt(saldos_ini) < 0){ alert(\"El valor Saldo ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (saldos_ini.length !== 0 && saldos_fin.length === 0 && parseInt(saldos_ini) > 0){ fmontos+= \" AND s.saldo >= \"+saldos_ini ; }\n if (saldos_ini.length === 0 && saldos_fin.length !== 0 && parseInt(saldos_fin) < 0){ alert(\"El valor Saldo Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (saldos_ini.length === 0 && saldos_fin.length !== 0 && parseInt(saldos_fin) > 0){ fmontos+= \" AND s.saldo <= \"+saldos_fin ; }\n \n /*valida critrios de Dias de Mora*/ \n if (dia_mora_ini.length !== 0 && dia_mora_fin.length !==0 && parseInt(dia_mora_ini) >= parseInt(dia_mora_fin)){ alert(\"El valor de Dias Mora Inicial debe ser MENOR a Dias Mora final para realizar la consulta\"); return; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length !==0 && parseInt(dia_mora_ini) < parseInt(dia_mora_fin)){ fmontos+= \" AND s.dias_mora >= \"+dia_mora_ini+\" AND s.dias_mora <= \"+dia_mora_fin; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length === 0 && parseInt(dia_mora_ini) < 0){ alert(\"El valor Dias Mora ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length === 0 && parseInt(dia_mora_ini) > 0){ fmontos+= \" AND s.dias_mora >= \"+dia_mora_ini ; }\n if (dia_mora_ini.length === 0 && dia_mora_fin.length !== 0 && parseInt(dia_mora_fin) < 0){ alert(\"El valor Dias Mora Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (dia_mora_ini.length === 0 && dia_mora_fin.length !== 0 && parseInt(dia_mora_fin) > 0){ fmontos+= \" AND s.dias_mora <= \"+dia_mora_fin ; }\n \n /*valida critrios de Fecha Ultimo Pago*/ \n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length !==0 && Date.parse(fUltimo_pago_ini) >= Date.parse(fUltimo_pago_fin)){ alert(\"La fecha de Ultimo Pago Inicial debe ser MENOR a la fecha de Ultimo Pago final para realizar la consulta\"); return; }\n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length !==0 && Date.parse(fUltimo_pago_ini) < Date.parse(fUltimo_pago_fin)){ fmontos+= \" AND s.fecha_ult_pagos >= '\"+fUltimo_pago_ini+\"' AND s.fecha_ult_pagos <= '\"+fUltimo_pago_fin+\"' \"; }\n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length === 0 ){ fmontos+= \" AND s.fecha_ult_pagos >= '\"+fUltimo_pago_ini+\"' \"; }\n if (fUltimo_pago_ini.length === 0 && fUltimo_pago_fin.length !== 0 ){ fmontos+= \" AND s.fecha_ult_pagos <= '\"+fUltimo_pago_fin+\"' \"; }\n \n /*valida critrios de Fecha Ultima Gestión*/ \n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length !==0 && Date.parse(fUltimo_gestion_ini) >= Date.parse(fUltimo_gestion_fin)){ alert(\"La fecha de Ultimo Gestión Inicial debe ser MENOR a la fecha de Ultimo Gestión final para realizar la consulta\"); return; }\n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length !==0 && Date.parse(fUltimo_gestion_ini) < Date.parse(fUltimo_gestion_fin)){ fmontos+= \" AND s.fech_ultima_gestion >= '\"+fUltimo_pago_ini+\"' AND s.fech_ultima_gestion <= '\"+fUltimo_gestion_fin+\"' \"; }\n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length === 0 ){ fmontos+= \" AND s.fech_ultima_gestion >= '\"+fUltimo_gestion_ini+\"' \"; }\n if (fUltimo_gestion_ini.length === 0 && fUltimo_gestion_fin.length !== 0 ){ fmontos+= \" AND s.fech_ultima_gestion <= '\"+fUltimo_gestion_fin+\"' \"; }\n \n /*valida critrios de Fecha Ultima Compromiso*/ \n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length !==0 && Date.parse(fUltimo_compromiso_ini) >= Date.parse(fUltimo_compromiso_fin)){ alert(\"La fecha de Compromiso inicial debe ser MENOR a la fecha de Compromiso final para realizar la consulta\"); return; }\n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length !==0 && Date.parse(fUltimo_compromiso_ini) < Date.parse(fUltimo_compromiso_fin)){ fmontos+= \" AND s.fecha_comp >='\"+fUltimo_compromiso_ini+\"' AND s.fecha_comp <= '\"+fUltimo_compromiso_fin+\"' \"; }\n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length === 0 ){ fmontos+= \" AND s.fecha_comp >= '\"+fUltimo_compromiso_ini+\"'\"; }\n if (fUltimo_compromiso_ini.length === 0 && fUltimo_compromiso_fin.length !== 0 ){ fmontos+= \" AND s.fecha_comp <= '\"+fUltimo_compromiso_fin+\"' \"; }\n \n// alert(SelectTipoGestion);\n// return;\n if (SelectTipoGestion!== \"0\"){\n fmontos+= \" AND s.ultima_gestion = '\"+$('#tgestion').find('option:selected').text()+\"'\"; \n } \n if (SelectTipoResultado!== \"0\"){\n fmontos+= \" AND s.resultado_gestion = '\"+$('#tresultado_gestion').find('option:selected').text()+\"'\"; \n } \n if ((carteras!== \"0\")&&(carteras!== null)){\n \n fmontos+= \" AND s.id_cartera = \"+$('#tcartera').find('option:selected').val(); \n }\n if ((subcartera!== \"0\")&&(subcartera!==null)){\n \n fmontos+= \" AND s.id_sub_cartera = \"+$('#tsub_cartera').find('option:selected').val(); \n }\n if ((segmento!== \"0\")&&(segmento!==null)){\n \n fmontos+= \" AND s.id_segmento = \"+$('#tsegmento').find('option:selected').val(); \n }\n if ((subsegmento!== \"0\")&&(subsegmento!== null)){\n \n fmontos+= \" AND s.id_sub_segmento = \"+$('#tsub_segmento').find('option:selected').val(); \n }\n if (order_by!==\"\"){\n \n order_by= \" ORDER BY s.\"+order_by+\" DESC\";\n }\n \n $('#id_loader').css(\"display\", \"block\");\n //arma el query para la consula\n sqlQuery=sqlQuery+fmontos+order_by;\n document.getElementById(\"input_query\").value = \"\";\n document.getElementById(\"input_query\").value = sqlQuery;\n console.log(sqlQuery);\n //var htmlTable=\"<table id='consul_cartera' class='table table-striped table-bordered dt-responsive nowrap table-hover' cellspacing='0' width='100%'><thead><tr bgcolor='#FBF5EF'><th class='col-sm-1 text-left hidden' style='color: #3c8dbc'>ID</th><th align='left' class='col-sm-1 text-left'><a id='IdentificacionID' onclick='orderIdent()'>Identificación</a></th><th class='col-sm-2 text-left'><a id='NombresID' onclick='orderNombre()'>Nombres</a></th> <th class='col-sm-1 text-left'><a id='DiasMoraID' onclick='orderDiasMora()' >Días Mora</a></th> <th class='col-sm-1 text-right'><a id='TotalID' onclick='orderTotalVenc()' >Total Vnc</a></th> <th align='center' class='col-sm-1 text-right'><a id='PagosID' onclick='orderPagos()'>Pagos</a></th><th align='center' class='col-sm-1 text-right'><a id='FecUltPagosID' onclick='orderFechaUltPagos()'>Fecha Ult. Pagos</a></th><th align='rigth' class='col-sm-1 text-right'><a id='SaldosID' onclick='orderSaldo()'>Saldo</a></th><th align='center' class='col-sm-1 text-right'><a id='ValorCompID' onclick='orderValorComp()'>Valor Comp.</a></th> <th align='center' class='col-sm-2 text-center'><a id='FechaCompID' onclick='orderFechaComp()'>Fecha Comp.</a></th><th align='center' class='col-sm-3'><a id='FechaID' onclick='orderFchGestion()' >Fecha Ult. Gestión</a></th> <th align='center' class='col-sm-3'><a id='UltimaID' onclick='orderUltima()'>Ult. Gestión</a></th> <th align='center' class='col-sm-2'><a id='ResultadoID' onclick='orderResultado()'>Resultado Gestión</a></th></tr> </thead><tbody>\";\n var parametros = {\n \"sqlQuery\":sqlQuery,\n \"cartera\": cartera,\n \"accion\": accion\n };\n console.log(\"Paso2: >>>\"+cartera);\n document.getElementById(\"tabla_div\").innerHTML = \"\"; \n var htmlTable=\"<table id='consul_cartera' class='table table-striped table-bordered dt-responsive nowrap table-hover' cellspacing='0' width='100%'><thead><tr bgcolor='#FEC187'><th class='col-sm-1 text-left ' style='color: #3c8dbc'>ID</th><th align='left' class='col-sm-1 text-left'><a >#</a></th><th align='left' class='col-sm-1 text-left'><a onclick='orderIdent()' id='IdentificacionID' >Identificación</a></th><th class='col-sm-2 text-left'><a onclick='orderNombre();' id='NombresID' >Nombres</a></th> <th class='col-sm-1 text-left'><a onclick='orderDiasMora();' id='DiasMoraID' >Días Mora</a></th> <th class='col-sm-1 text-right'><a onclick='orderTotalVenc();' id='TotalID' >Total Vnc</a></th> <th align='center' class='col-sm-1 text-right'><a onclick='orderPagos();' id='PagosID' >Pagos</a></th><th align='center' class='col-sm-1 text-right'><a onclick='orderFechaUltPagos();' id='FecUltPagosID' >Fecha Ult. Pagos</a></th><th align='rigth' class='col-sm-1 text-right'><a onclick='orderSaldo();' id='SaldosID' >Saldo</a></th> <th align='center' class='col-sm-1 text-right'><a onclick='orderValorComp();' id='ValorCompID' >Valor Comp.</a></th> <th align='center' class='col-sm-2 text-center'><a onclick='orderFechaComp();' id='FechaCompID' >Fecha Comp.</a></th><th align='center' class='col-sm-3'><a onclick='orderFchGestion();' id='FechaID' >Fecha Ult. Gestión</a></th> <th align='center' class='col-sm-3'><a onclick='orderUltima();' id='UltimaID' >Ult. Gestión</a></th> <th align='center' class='col-sm-2'><a onclick='orderResultado();' id='ResultadoID' >Resultado Gestión</a></th></tr> </thead><tbody></tbody></table>\";\n document.getElementById(\"tabla_div\").innerHTML = htmlTable;\n \n$('#consul_cartera').DataTable( {\n \"ajax\": { \n \"data\": {\"accion\": accion,\"sqlQuery\": sqlQuery,\"cartera\": cartera},\n \"url\": \"consultacartera\",\n \"type\": \"GET\"\n },\n \"columns\": [\n { \"data\": \"id_datos_deudor\",\"title\":\"ID\", \"visible\": false },\n { \"data\": \"secuencia2\",class:'text-right' },\n { \"data\": \"identificacion\" },\n { \"data\": \"nombres_completo2\" },\n { \"data\": \"dias_mora\",class:'text-right' },\n { \"data\": \"total_vencidos\",class:'text-right' },\n { \"data\": \"pagos\",class:'text-right' },\n { \"data\": \"fecha_ult_pagos\" },\n { \"data\": \"saldo\",class:'text-right' },\n { \"data\": \"valor_compro\",class:'text-right' },\n { \"data\": \"fecha_comp\" },\n { \"data\": \"fech_ultima_gestion\" },\n { \"data\": \"ultima_gestion\" },\n { \"data\": \"resultado_gestion\" }\n ],\"language\": {\n \t\t\t\t\"emptyTable\":\t\t\t\"No hay datos disponibles en la tabla.\",\n \t\t\t\t\"info\":\t\t \t\t\"Del _START_ al _END_ de _TOTAL_ \",\n \t\t\t\t\"infoEmpty\":\t\t\t\"Mostrando 0 registros de un total de 0.\",\n \t\t\t\t\"infoFiltered\":\t\t\t\"(filtrados de un total de _MAX_ registros)\",\n \t\t\t\t\"infoPostFix\":\t\t\t\"(actualizados)\",\n \t\t\t\t\"lengthMenu\":\t\t\t\"Mostrar _MENU_ registros\",\n \t\t\t\t\"loadingRecords\":\t\t\"Cargando...\",\n \t\t\t\t\"processing\":\t\t\t\"Procesando...\",\n \t\t\t\t\"search\":\t\t\t\"Buscar:\",\n \t\t\t\t\"searchPlaceholder\":\t\t\"Dato para buscar\",\n \t\t\t\t\"zeroRecords\":\t\t\t\"No se han encontrado coincidencias.\",\n \t\t\t\t\"paginate\": {\n \t\t\t\t\t\"first\":\t\t\t\"Primera\", \n \t\t\t\t\t\"last\":\t\t\t\t\"Última\",\n \t\t\t\t\t\"next\":\t\t\t\t\"Siguiente\",\n \t\t\t\t\t\"previous\":\t\t\t\"Anterior\"\n \t\t\t\t},\"aria\": {\n \t\t\t\t\t\"sortAscending\":\t\"Ordenación ascendente\",\n \t\t\t\t\t\"sortDescending\":\t\"Ordenación descendente\"\n \t\t\t\t}\n \t\t\t},\n scrollY: 500,\n scrollX: true,\n scrollCollapse: true,\n paging: false\n } );\n \n $('#id_loader').css(\"display\", \"none\");\n // $('#det_filtro').modal('hide'); \n \n consulta_sec(sqlQuery,cartera,\"\");\n \n \n\n\nvar table = $('#consul_cartera').DataTable();\ntable\n .column( '0:visible' )\n .order( 'asc' )\n .draw();\n\n$('#consul_cartera thead').on('click', 'th', function () {\n var index = table.column(this).index();\nconsole.log('consulta de columna: '+index);\n switch (index) {\n case 1:\n orderIdent();\n break;\n case 2:\n orderNombre(); \n break;\n case 3:\n orderDiasMora();\n break;\n case 4:\n orderTotalVenc();\n break;\n case 5:\n orderPagos();\n break;\n case 6:\n orderFechaUltPagos();\n break;\n case 7:\n orderSaldo();\n break;\n case 8:\n orderValorComp();\n break;\n case 9:\n orderFechaComp();\n break;\n case 10:\n orderFchGestion();\n break;\n case 11:\n orderUltima();\n break;\n case 12:\n orderResultado();\n break; \n}\n\n \n $('#id_loader').css(\"display\", \"none\");\n // alert('index : '+index);\n});\n\n\n // alert(sqlQuery); \n \n var qCantClientes=lv_select2+\" count(*) \"+lv_from+lv_query+lv_filtros+fmontos+order_by;\n var qSum=lv_select2+\" COALESCE(sum(s.total_vencidos), 0::numeric) as total_vencidos, COALESCE(sum(s.pagos), 0::numeric) as pagos, COALESCE(sum(s.total_vencidos) - COALESCE(sum(s.pagos), 0::numeric), 0::numeric) as saldo, (\"+qCantClientes +\") as total_clientes \"+lv_from+lv_query+lv_filtros+fmontos+order_by;\n console.log(\">>>>>QSUM: \"+qSum);\n Totales_Suman(qSum, IdCliente);\n}", "function campoObrigatorio(campoDependencia, dependente, msg){\r\n\tif (dependente.value.length < 1){\r\n\t\treturn false\r\n\t}\r\n\telse if (campoDependencia.value.length < 1){\r\n\t\talert(msg);\r\n\t\tcampoDependencia.focus();\r\n\t\treturn true\r\n\t}\r\n}", "function validar_formu() {\n\tvar valido = true;\n\tvar campo1 = document.getElementById(\"cod_cliente\");\n\tvar campo2 = document.getElementById(\"nombre_cliente\");\n\tif (campo_vacio(campo1) && campo_vacio(campo2)) {\n\t\tvalido = false;\n\t\talert(\"Uno de los dos campos son obligatorios para realizar la consulta de los datos del cliente.\");\n\t}\n\treturn valido;\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 validerTra(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txttraControle\").value==\"\")\n msg=\"ajouter un Controle s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraModule\").value==\"\")\n msg=\"ajouter un Module s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraFrancais\").value==\"\")\n msg=\"ajouter un texte francais s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraAnglais\").value==\"\")\n msg=\"ajouter un texte Anglais s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function valideBlank(F) { \n if( vacio(F.campo.value) == false ) {\n alert(\"Introduzca un cadena de texto.\");\n return false;\n } else {\n alert(\"OK\");\n //cambiar la linea siguiente por return true para que ejecute la accion del formulario\n return false;\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 verificarServicio(objeto){\n\t\tvalorBS=$(objeto).val();\n\t\t/**OBTENENEMOS CANTIDAD SI EXISTE GUIAS DE REMISION RELACIONADAS**/\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tif(total>0){\n\t\t\t/**si es servicio***/\n\t\t\tif(valorBS=='S'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = false;\n\t\t\t\t$(\"#idDivAgregarProducto\").show(200);\n\t\t\t}\n\t\t\t/**si es Bien**/\n\t\t\tif(valorBS=='B'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = true;\n\t\t\t\t$(\"#idDivAgregarProducto\").hide(200);\n\t\t\t}\n\t\t}\n\t}", "function registroUsuario(){\n\t/*---------- valdando nombre ----------*/\n\tvar nombre =$(\"#regUsuario\").val();\n\n\tif(nombre != \"\"){\n\t\tvar expresion = /^[a-zA-ZñÑáéíóúÁÉÍÓÚ ]*$/;\n\n\t\t\t//Si no cumple la expresion\n\t\t\tif(!expresion.test(nombre)){\n\t\t\t\t$(\"#regUsuario\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Caracteres especiales, NO</div>')\n\t\t\t return false;\n\t\t\t}\n\n\t\t}else{\n\t\t\t$(\"#regUsuario\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Ponga su nombre pues</div>')\n\t\t\treturn false;\n\t\t}\n\n\n\n\n\t/*---------- Validando email ----------*/\n\tvar email =$(\"#regEmail\").val();\n\n\tif(email != \"\"){\n\t\tvar expresion = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n\t\t\t//Si no cumple la expresion\n\t\t\tif(!expresion.test(email)){\n\t\t\t\t$(\"#regEmail\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Escriba bien el correo</div>')\n\t\t\t return false;\n\t\t\t}\n\n\t\t\t//Si validarEmailRepetido es falso\n\t\t\tif(validarEmailRepetido){\n\n\t\t\t\t$(\"#regEmail\").parent().before('<div class=\"alert alert-danger\"><strong>Uy </stron>Correo previamente registrado pliz agrega otro </div>')\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}else{\n\t\t\t$(\"#regEmail\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Ponga su email pues</div>')\n\t\t\treturn false;\n\t\t}\n\n\n\n\n\t/*---------- Validando contrasela ----------*/\n\n\tvar password =$(\"#regPassword\").val();\n\n\tif(password != \"\"){\n\t\tvar expresion = /^[a-zA-Z0-9]*$/;\n\t\t\t//Si no cumple la expresion\n\t\t\tif(!expresion.test(password)){\n\t\t\t\t$(\"#regPassword\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Caracteres especiales, NO</div>')\n\t\t\t return false;\n\t\t\t}\n\n\t\t}else{ \n\t\t\t$(\"#regPassword\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Ponga su correo pues</div>')\n\t\t\treturn false;\n\t\t}\n\n\n\n\n\t/*---------- Validando politicas ----------*/\n\tvar politicas = $(\"#regPoliticas:checked\").val();\n\t\t// si checkbox #regPoliticas es diferente a checked\n\t\tif (politicas!=\"on\") {\n\t\t\t// Coloca encima del checkbox un alert\n\t\t\t$(\"#regPoliticas\").parent().before('<div class=\"alert alert-warning\"><strong>Uy </stron>Debe aceptar nuestras politicas</div>')\n\t\t\treturn false;\n\t\t}\n\n\n\treturn true\n}", "function validarFormulario(eventopordefecto)\t\n{\t\n // Pediremos la confirmacion del envio al usuario y posteriormente comprobaremos todas las funciones de validacion.\n\tif (confirm(\"¿Deseas enviar el formulario?\") &&validarNombre() && validarApellidos() && validarEdad() && validarNif() && validarEmail() && validarProvincia() && validarFecha() && validarTelefono() && validarHora())\n { \n // si el usuario pulsa aceptar y todo esta bien, enviaremos el formulario.\n return true;\n }\n \telse\n {\t\n // si el usuario cancela el envio o alguna de las comprobaciones no son correctas, volveremos al formulario.\n // sumaremos uno al contador de intentos y lo haremos visible.\n eventopordefecto.preventDefault();\n count += 1;\n document.cookie = \"contador=\"+count;\n document.getElementById(\"intentos\").innerHTML = \"Intento de envios del formulario: \"+count;\n\t\treturn false;\n }\n}", "function validarMaterialEmpaqueUnico(){\n var select = document.getElementById(\"medida\");\n var options=document.getElementsByTagName(\"option\");\n var idRol= select.value;\n var x = select.options[select.selectedIndex].text;\n var select = document.getElementById(\"formaEmpaque\");\n var options=document.getElementsByTagName(\"option\");\n var idEmpaque = select.value;\n var nombreMaterialEmpaque = select.options[select.selectedIndex].text;\n var nombreMaterialEmpaque_UnidadMedida = nombreMaterialEmpaque +\" \" +x;\n var route = \"http://localhost:8000/validarMaterialEmpaqueUnico\";\n var oculto =document.getElementById(\"oculto\").value;\n if(nombreMaterialEmpaque != oculto){\n $.get(route,function(res){\n $(res).each(function(key,value){\n nombreMaterialEmpaqueBD = value.formaEmpaque+ \" \"+value.nombreUnidadMedida+\" \"\n +value.cantidadUnidadMedida+ \" \"+ value.unidad_medida;\n if(nombreMaterialEmpaque_UnidadMedida == nombreMaterialEmpaqueBD){\n document.getElementById('submit').disabled=true;\n document.getElementById(\"alerta\").innerHTML =\n \"<div class=\\\"alert alert-danger\\\" id=\\'result\\'><strong>El material de empaque \"\n + \"que intentas registrar ya \"+ \n \"existe en el sistema.</strong></div>\";\n return false;\n } else {\n document.getElementById(\"alerta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n }\n });\n });\n } \n }", "function validerUti(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txtutiNom\").value==\"\")\n msg=\"ajouter un nom d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiPrenom\").value==\"\")\n msg=\"ajouter un prenom d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiMotdepass\").value==\"\")\n msg=\"ajouter un mot de pass d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiAdmin\").value==\"\")\n msg=\"ajouter un admin d'Utilisateur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txtutiInactif\").value==\"\")\n msg=\"ajouter actif ou inactif d'Utilisateur s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function validarNumeroSerie(){\n\n var serie =document.getElementById('no_serie').value;\n var ocultoSerie =document.getElementById('ocultoSerie').value;\n var route = \"http://localhost:8000/validarPlacas/\"+serie;\n\n\n\n $.get(route,function(res){\n\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idVehiculo = res[0].id;\n document.getElementById(\"idVehiculo\").value= idVehiculo;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].no_Serie != ocultoSerie ) {\n\n\n document.getElementById(\"errorSerie\").innerHTML = \"El vehiculo que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n\n document.getElementById(\"errorSerie\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function validarLogin() {\n let user = document.querySelector(\"#txtLoginUser\").value.trim();\n let password = document.querySelector(\"#txtLoginPassword\").value.trim();\n let validacionAcceso = false;\n if (user.length > 0 && password.length > 0) {\n // VALIDACIONES \n let tipoUser = \"\";\n for (let i = 0; i < listaUsuarios.length; i++) {\n let element = listaUsuarios[i];\n if (element.nombreUsu === user && element.clave === password) {\n validacionAcceso = true;\n tipoUser = element.tipo;\n i = listaUsuarios.length + 1;\n }\n }\n if (validacionAcceso) {\n ingreso(tipoUser, user);\n } else {\n document.querySelector(\"#divResultadoLogin\").innerHTML = `No se pudo ingresar verifique los datos ingresados.`;\n }\n }\n}", "function entrar() {\n var senha = pass.value;\n\n // SE A SENHA FOR VALIDA\n if (dig == 1 && senha == 'recife' || dig == 2 && senha == 'manaus' || dig == 3 && senha == 'fortaleza') {\n telaSenha.style = 'display: none';\n cadeira.style = 'display: block';\n }\n // SE A SENHA FOR INVALIDA\n else {\n res.innerHTML += \"<p>Senha invalida!</p>\";\n contador++;\n }\n\n // SE AS TENTATIVAS FOREM EXCEDIDAS\n if (contador >= 4) {\n contador = 0;\n alert(\"Você excedeu o número de tentativas, sua conta está bloqueada, PROCURE O SUPORTE\");\n telaSenha.style = 'display: none';\n content.style = 'display: block';\n }\n}", "function verificarExistenciaCampos(metodoNombre,datosEnvio,mensajeError,idDivMensaje){\n\n $.ajax({\n url: \"/SisConAsadaLaUnion/servicio/\"+metodoNombre,\n type: \"POST\",\n data: \"valor=\"+datosEnvio,\n beforeSend: function(){\n\n idDivMensaje.fadeIn(1000).html('<img class=\"center-block\" src=\"/SisConAsadaLaUnion/public/assets/images/Loading.gif\" alt=\"Cargando\" width=\"38px\"/>');\n\n },\n success: function(respuesta){\n\n idDivMensaje.fadeIn(1000).html(respuesta);\n \n },\n error: function(error){\n\n alertify.error(\"Error de conexión al tratar de verificar la disponibilidad \"+mensajeError);\n\n }\n\n });\n\n }", "function guardar_ejercicio(){\n\tsalvaEstado()\n\tif(no_identificado)\n\t{\n\t\tif(confirm(\"Los resultados se han guardado temporalmente.\\n\\n\"+\n\t\t\t\"Para guardar definitivamente y poder recuperarlos mas adelante debe registrarse o identificarse.\\n\\n\"+\n\t\t\t\"¿Desea registrarse ahora?\"))\n\t\t\twindow.location=\"pag420\";\n\t}\n\treturn false;\n}", "function buscarUsuarioDisponible(itemUsuario,itemSubmit) {\n\t// Almacenamos en el control al funcion que se invocara cuando la peticion cambie de estado\n\tajax = new XMLHttpRequest();\n\tajax.onreadystatechange = validaUsuarioDisponible;\n\titem[0] = itemUsuario;\n\titem[1] = itemSubmit;\n\tvar usuario = id(itemUsuario).value;\n\tvar variables = \"&usuario=\" + usuario;\n\tvariables += \"&esAjax=\" + true;\n\t\n\tajax.open(\"POST\", \"BuscarInformacionFormularios?metodoDeBusqueda=1\" + variables, true);\n\tajax.send(\"\");\n}", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function checkExistLogin(ressult){\n msjClean();\n\n if(ressult.length > 0) { msjDanger('REGISTRO', '<strong>Existe un login con esa cuenta</strong>'); }\n else { registroManager.getRegistro(\"id=\" + $(\"#usuario\").val(), 'checkExistRegistro'); }\n}", "function valida() /* OK */\r\n{\r\n //valido el nombre\r\n\tif ((document.index.user.value.length==0)||(document.index.user.value.length<4))\r\n\t {\r\n alert(\"Tiene que escribir su nombre o su nombre es demasiado corto!!!\")\r\n document.index.user.focus();\r\n return false;\r\n }\r\n\tif ((document.index.pass.value.length==0)||(document.index.pass.value.length<4))\r\n\t {\r\n alert(\"Tiene que escribir su contraseņa o su contraseņa no tiene la cantidad de caracteres requeridos!!!\")\r\n document.index.pass.focus();\r\n return false;\r\n }\r\n\t \r\n\t document.index.oper.value=\"V\";//Operacion Validar Usuario en BD\r\n\t //document.index.submit();\r\n\r\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 validarEmpresa(){\n\n var rfc =document.getElementById('RFC').value;\n var oculto =document.getElementById('oculto').value;\n\n var route = \"http://localhost:8000/validarEmpresa/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idEmpresa = res[0].id;\n document.getElementById(\"idEmpresa\").value= idEmpresa;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"La empresa que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n}\nelse {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n}\n});\n\n}", "function validarEmpleado()\n{\n var datosCorrectos=true;\n var error=\"\";\n if(document.getElementById(\"USUARIO\").value==\"\"){\n alert(\"error USUARIO no valido\");\n datosCorrectos=false;\n }else{\n if(document.getElementById(\"CONTRASEÑA\").value==\"\"){\n alert(\"error contraseña no valida\");\n datosCorrectos=false;\n }\n }\n if(!datosCorrectos){\n alert('No se puede continuar');\n }else{\n alert('Bienvenido');\n }\n return datosCorrectos;\n}", "function traercontacto_empresa(req,res){\n\tCONN('contacto_empresa').select().then(registros =>{\n\t\tif (!registros){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de contacto_empresa', registros:registros});\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function valida_usuario()\n {\n var _token= $('input[name=_token]').val();\n var correo= $('#txt_correo').val();\n\n if (correo!=\"\")\n {\n $.ajax({\n type: 'POST',\n url: '/vendedor/correo', //llamada a la ruta\n data: {\n _token:_token,\n correo:correo\n },\n success: function (data) {\n\n if (Object.entries(data).length==0)\n {\n alertError(\"No existe ningun usuario con este correo asociado\");\n $('#txt_correo').val(\"\");\n }else if (data[0].correo!=null)\n {\n alertError(\"Ya existe un usuario con este correo asociado\");\n $('#txt_correo').val(\"\");\n }\n else\n alertSuccess(\"Usuario:\"+data[0].usuario);\n showLoad(false);\n },\n error: function (err) {\n alertError(err.responseText);\n showLoad(false);\n }\n });\n }\n }", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "function registrar(nuevoPaciente) {\n if (nuevoPaciente.nombre == \"\" || nuevoPaciente.edad == \"\" || nuevoPaciente.peso == \"\"|| nuevoPaciente.altura == \"\"|| nuevoPaciente.dia == \"\"|| nuevoPaciente.mes == \"\"|| nuevoPaciente.hora == \"\") {\n return Swal.fire({\n icon: 'error',\n title: 'Error de Carga',\n text: 'Por favor chequee datos ingresados',\n })\n } else {\n registrados.forEach(function (item) {\n if (nuevoPaciente.dia === item.dia && nuevoPaciente.mes === item.mes && nuevoPaciente.hora === item.hora) {\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: 'Ese turno está utilizado!',\n })\n throw console.log(\"Turno ocupado\");\n }\n })\n\n registrados.push(nuevoPaciente);\n mostrar();\n localSave();\n };\n}", "function mostrarResultado(respuesta){\n\n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Cierre de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó el cierre del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al cerrar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }", "function validarNumeroCuentaEmProvedor(){\n\n var num_cuenta =document.getElementById('num_cuenta').value;\n\n var ocultoNumCuenta =document.getElementById('ocultoNumCuenta').value;\n var route = \"http://localhost:8000/validarNumCuenta_Cve_Interbancaria/\"+num_cuenta;\n\n\n\n $.get(route,function(res){\n\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idCuenta = res[0].id;\n document.getElementById(\"idCuenta\").value= idCuenta;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].num_cuenta != ocultoNumCuenta ) {\n\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"El numero de cuenta que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function validarBanco(){\n\n var nombre =document.getElementById('nombre').value;\n var oculto =document.getElementById('oculto').value;\n\n var route = \"http://localhost:8000/validarBanco/\"+nombre;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idBanco = res[0].id;\n document.getElementById(\"idBanco\").value= idBanco;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].nombre != oculto ) {\n\n document.getElementById(\"errorNombre\").innerHTML = \"El banco que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorNombre\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n });\n\n }", "function validacion(){\n\n\t/*Recibe en una variable los textos ingresados en los input del formulario*/\n\tnombre = document.getElementById(\"nombre\").value;\n\tpais = document.getElementById(\"pais\").value;\n\tcorreo = document.getElementById(\"correo\").value;\n\t\n\t/*Verifica si el nombre esta vacio y si esta correctamente escrito segun la expresion regular*/\n\tif( nombre == null || nombre == 0 || !(validar_letrasyespacios(nombre)) ) {\n\n\t\tdocument.getElementById(\"nombrevalido\").innerHTML = \"Error, por favor ingrese un nombre valido\";\n\t\tlimpiar();\n\t\treturn false;\n\n\t\tif (validar_letrasyespacios(nombre)==true) {\n\n document.getElementById(\"nombrevalido\").innerHTML = \"\";\n }\n \n\t}\n\t/*Verifica si el pais esta vacio y si esta correctamente escrito segun la expresion regular*/\n\telse if (pais == null || pais.length == 0 || !(validar_letrasyespacios(pais))) {\n\n\t\tdocument.getElementById(\"paisvalido\").innerHTML = \"Error, por favor ingrese un nombre de pais valido\";\n\t\tlimpiar();\n\t\tif (validar_letrasyespacios(nombre)==true) {\n\n document.getElementById(\"paisvalido\").innerHTML = \"\";\n }\n\t\treturn false;\n\t}\n\t/*Verifica si el e-mail esta vacio y si esta correctamente escrito segun la expresion regular*/\n\telse if (!(validar_email(correo))) {\n\n\t\tdocument.getElementById(\"correovalido\").innerHTML = \"Error, por favor ingrese un correo valido\";\n\t\tlimpiar();\n\t\tif (validar_email(nombre)==true) {\n\n document.getElementById(\"correovalido\").innerHTML = \"\";\n }\n\t\treturn false;\n\n\t}\n\n\n\t/*Si el usuario ha escrito todos los campos correctamente le muestra un alert diciendo que los campos han sido enviados correctamente*/\n\talert('Su mensaje ha sido enviado correctamente');\n\treturn true;\n\n\n\n\t\n\n}", "function ControleErreur(){\n//récupération des valeurs nécessaires à la validation d'un ajout ou d'une modification\n\tvar nom = document.getElementById(\"txtNom\").value;\n\tif(nom != \"\")\n\t{\n\t\t//Le boutton redevient clicable\n\t\tdocument.getElementById(\"cmdCreerProjet\").disabled = false;\n\t\tdocument.getElementById(\"cmdCreerProjet\").className = \"button\";\t\n\t}\n\telse {\n\t\t//Le boutton d'ajout devient inclicable\n\t\tdocument.getElementById(\"cmdCreerProjet\").disabled = true;\n\t\tdocument.getElementById(\"cmdCreerProjet\").className = \"\";\n\t}\n}", "function enc_cliente()\r\n{\r\n\t'domready', Sexy = new SexyAlertBox();\r\n\tif(document.encontrar_cliente_form.numero_cliente.value == \"\") \r\n { \r\n \tSexy.error('<h1>Error</h1><p>Señor usuario por favor escriba el numero de ID del cliente para realizar la busqueda.</p>',\r\n\t\t{ onComplete: \r\n\t\t\tfunction(returnvalue) \r\n\t\t\t{ \r\n\t\t\t\tif(returnvalue)\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.getElementById('numero_cliente_id').style.backgroundColor=\"#FA5858\";\r\n\t\t\t\t\tdocument.getElementById('numero_cliente_id').style.borderColor=\"red\";\r\n\t\t\t\t\tdocument.getElementById('numero_cliente_id').focus();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n }\r\n\telse\r\n\t{\r\n\t\tif(document.encontrar_cliente_form.numero_cliente.value.match(/\\D/))\r\n\t\t{\r\n\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario solo se permiten números de ID para realizar la busqueda.</p>',\r\n\t\t\t{ onComplete: \r\n\t\t\t\tfunction(returnvalue) \r\n\t\t\t\t{ \r\n\t\t\t\t\tif(returnvalue)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.getElementById('numero_cliente_id').style.backgroundColor=\"#FA5858\";\r\n\t\t\t\t\t\tdocument.getElementById('numero_cliente_id').style.borderColor=\"red\";\r\n\t\t\t\t\t\tdocument.getElementById('numero_cliente_id').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdocument.encontrar_cliente_form.submit();\r\n\t\t}\r\n\t}\r\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n \n $(\".requisito\").each(function(index,value){\n \n id= $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo= $(value).children(\".nombre_requisito\").text();\n estatusViejo= $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n { \n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function setValidacaoRemota(erro) {\n\n if (!erro) {\n $(\"#salvar-erros\").html(null);\n return;\n }\n\n $(\"#salvar-erros\").append(\"<p>\" + erro + \"</p>\")\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}", "function checkExistRegistro(ressult){\n if(ressult.length > 0) { msjDanger('REGISTRO', '<strong>Existe un registro pendiente con esa cuenta</strong>'); }\n else {\n gestor.addLocal(\"\", \"\", \"\", 'registro');\n\n let registro = {};\n registro[\"id\"] = $(\"#usuario\").val();\n registro[\"pass\"] = gestor.stringBase64($(\"#pass\").val());\n registro[\"nombre\"] = $(\"#nombre\").val();\n registro[\"departamento\"] = $(\"#departamento\").val();\n registro[\"nivel\"] = $(\"#nivel\").val();\n\n registroManager.addRegistro(registro, 'changePageIndex');\n }\n}", "function fncValidarLoginUsuario(frm){\n\ttry{\n\t\tvar username = trim(frm.username.value);\n\t\tvar password = trim(frm.password.value);\n\t\tvar msg = \"OCURRIERON LOS SIGUIENTES ERRORES:\\n\\n\";\n\t\tif(username==\"\"){ alert(msg+\"- No ingreso su USUARIO de ingreso.\"); frm.username.value=''; frm.username.focus(); return false; }\n\t\tif(password==\"\"){ alert(msg+\"- No ingreso su CLAVE de ingreso.\"); frm.password.value=''; frm.password.focus(); return false; }\n\t\treturn true;\n\t}catch(ex){\n\t\talert(ex.description); return false;\n\t}\n}", "function desafiocarro1(form) {\n resposta=form.resposta.value;\n if(resposta == \"44\") {\n alert(\"Parabens, voce acertou!\");\n carro6();\n }\n else{\n alert(\"Tente novamente!\");\n carro5();\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 freg_cliente()\r\n{\r\n\t'domready',Sexy = new SexyAlertBox();\r\n\tif((document.registrar_cliente_form.numero_cliente.value.match(/\\D/))||(document.registrar_cliente_form.numero_cliente.value == \"\"))\r\n\t{\r\n\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Número del documento) solo admite números. Por favor borre los caracteres especiales, los espacios y verifique que no este vacio.</p>', \r\n\t\t{ onComplete: \r\n\t\t\tfunction(returnvalue) { \r\n\t\t\t if(returnvalue)\r\n\t\t\t {\r\n\t\t\t\t document.getElementById(\"numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t document.getElementById(\"numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t document.registrar_cliente_form.numero_cliente.focus();\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.getElementById(\"numero_cliente_id\").style.borderColor=\"\";\r\n\t\tdocument.getElementById(\"numero_cliente_id\").style.background=\"\";\r\n\t\tcadena = document.registrar_cliente_form.numero_cliente.value;\r\n\t\tmin_num = cadena.length;\r\n\t\tif((min_num < 6)||(document.registrar_cliente_form.numero_cliente.value == \"\"))\r\n\t\t{\r\n\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Número del documento) debe tener minímo 6 digitos y no debe estar vacio.</p>', \r\n\t\t\t{ onComplete: \r\n\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t if(returnvalue)\r\n\t\t\t\t {\r\n\t\t\t\t\t document.getElementById(\"numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t document.getElementById(\"numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t document.registrar_cliente_form.numero_cliente.focus();\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdocument.getElementById(\"numero_cliente_id\").style.borderColor=\"\";\r\n\t\t\tdocument.getElementById(\"numero_cliente_id\").style.background=\"\";\r\n\t\t\tif((document.registrar_cliente_form.confirmar_numero_cliente.value.match(/\\D/))||(document.registrar_cliente_form.confirmar_numero_cliente.value == \"\"))\r\n\t\t\t{\r\n\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Confirmar número del documento) solo admite números. Por favor borre los caracteres especiales, los espacios y verifique que no este vacio.</p>', \r\n\t\t\t\t{ onComplete: \r\n\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t document.registrar_cliente_form.confirmar_numero_cliente.focus();\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"\";\r\n\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.background=\"\";\r\n\t\t\t\tcadena = document.registrar_cliente_form.confirmar_numero_cliente.value.length;\r\n\t\t\t\tif((cadena < 6)||(document.registrar_cliente_form.confirmar_numero_cliente.value == \"\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Confirmar número del documento) debe tener minímo 6 digitos y no debe estar vacio.</p>', \r\n\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t document.registrar_cliente_form.confirmar_numero_cliente.focus();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\tcon1 = document.registrar_cliente_form.numero_cliente.value;\r\n\t\t\t\t\tcon2 = document.registrar_cliente_form.confirmar_numero_cliente.value;\r\n\t\t\t\t\tif(con1 != con2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario los campos (Número del documento) y (Confirmar número del documento) no coinciden.</p>', \r\n\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t document.getElementById(\"numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t document.getElementById(\"numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_numero_cliente_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t document.registrar_cliente_form.numero_cliente.focus();\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.getElementById(\"numero_cliente_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\tdocument.getElementById(\"numero_cliente_id\").style.background=\"\";\r\n\t\t\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\tdocument.getElementById(\"confirmar_numero_cliente_id\").style.background=\"\";\r\n\t\t\t\t\t\tname = document.registrar_cliente_form.nombre.value;\r\n\t\t\t\t\t\tvar exp = new RegExp('^[A-Za-z]{1,30}$');\r\n\t\t\t\t\t\tif(!exp.test(name))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Nombres) sólo admite letras (mayúsculas, minúsculas), y no debe estar vacio.</p>', \r\n\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t document.getElementById(\"nombre_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t document.getElementById(\"nombre_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.nombre.focus();\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\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\tdocument.getElementById(\"nombre_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\tdocument.getElementById(\"nombre_id\").style.background=\"\";\r\n\t\t\t\t\t\t\tape = document.registrar_cliente_form.apellido.value;\r\n\t\t\t\t\t\t\tvar exp = new RegExp('^[A-Za-z]{1,30}$');\r\n\t\t\t\t\t\t\tif((!exp.test(ape))||(document.registrar_cliente_form.apellido.value==\"\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Apellidos) sólo admite letras (mayúsculas, minúsculas), y no debe estar vacio.</p>', \r\n\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t document.getElementById(\"apellido_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t document.getElementById(\"apellido_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.apellido.focus();\r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"apellido_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"apellido_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\tcorreo = document.registrar_cliente_form.correo.value;\r\n\t\t\t\t\t\t\t\tif((!correo.match(\"@\"))||(document.registrar_cliente_form.correo.value==\"\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario falta el arroba (@) en el campo (correo electrónico).</p>', \r\n\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"correo_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"correo_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.correo.focus();\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"correo_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"correo_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\tif(!correo.match(/\\./))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario falta el punto (.) en el campo (Correo electrónico).</p>', \r\n\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"correo_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"correo_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.correo.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"correo_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"correo_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\tccorreo = document.registrar_cliente_form.confirmar_correo.value;\r\n\t\t\t\t\t\t\t\t\t\tif(!ccorreo.match(\"@\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario falta el arroba (@) en el campo (Confirmar correo electrónico).</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_correo_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_correo_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.confirmar_correo.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"confirmar_correo_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"confirmar_correo_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\tif(!ccorreo.match(/\\./))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario falta el arroba (@) en el campo (Confirmar correo electrónico).</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_correo_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"confirmar_correo_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.confirmar_correo.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"confirmar_correo_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"confirmar_correo_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tdir = document.registrar_cliente_form.direccion.value;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar exp = new RegExp('^[A-Za-z -_.]{1,50}$');\r\n\t\t\t\t\t\t\t\t\t\t\t\tif((!exp.test(dir))||(document.registrar_cliente_form.direccion.value==\"\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario los caracteres por fuera de este (A-Z a-z - _ .) rango no son permitidos en el campo direccion, si esta utilizando el simbolo(#) remplácelo por (N).</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"direccion_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"direccion_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.direccion.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"direccion_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"direccion_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbar = document.registrar_cliente_form.barrio.value;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar exp = new RegExp('^[A-Za-z]{1,25}$');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif((!exp.test(bar))||(document.registrar_cliente_form.barrio.value==\"\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (barrio) solo admite letras (mayúsculas, minúscula), y no debe estar vacio.</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"barrio_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"barrio_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.barrio.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"barrio_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"barrio_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmuni = document.registrar_cliente_form.municipio.value;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar exp = new RegExp('^[A-Za-z]{1,25}$');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif((!exp.test(muni))||(document.registrar_cliente_form.municipio.value==\"\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (municipio) solo admite letras (mayúsculas, minúscula), y no debe estar vacio.</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"municipio_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"municipio_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.municipio.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"municipio_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"municipio_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(document.registrar_cliente_form.telefono.value.match(/\\D/)) \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el campo (Teléfono) sólo admite números.</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"telefono_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"telefono_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.telefono.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"telefono_id\").style.borderColor=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"telefono_id\").style.background=\"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif((document.registrar_cliente_form.telefono.value.length < 7)||(document.registrar_cliente_form.telefono.value==\"\")||(document.registrar_cliente_form.telefono.value.length==8)||(document.registrar_cliente_form.telefono.value.length >10)||(document.registrar_cliente_form.telefono.value.length==9))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.error('<h1>Error</h1><p>Señor usuario el número que ha digitado en el campo (Telefono) no parece ser un telefono fijo o celular.</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"telefono_id\").style.borderColor=\"red\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"telefono_id\").style.background=\"#FA5858\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.registrar_cliente_form.telefono.focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSexy.confirm('<h1>Confirmar</h1><p>¿Esta seguro que la información antes suministrada es correcta?</p><p>Pulsa \"Ok\" para continuar, o pulsa \"Cancelar\" para salir.</p>', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ onComplete: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(returnvalue) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(returnvalue)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.registrar_cliente_form.submit();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n\n $(\".requisito\").each(function(index,value){\n\n id = $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo = $(value).children(\".nombre_requisito\").text();\n estatusViejo = $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n {\n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function vacio(){\n\t var c_na = /^([a-z]|[A-Z]|├í|├ę|├*|├│|├║|├▒|├╝|\\s)+$/\n if(!c_na.test(solicitar.nombre.value)){\n alert('Escriba su nombre y apellido respetando may˙sculas, min˙sculas y acentos.');\n\t\t solicitar.nombre.focus();\n return false;\n }\n return true;\n }", "function enviar() {\n if (validar()) {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuarioAction\").val(),\n id: $(\"#idUsuario\").val(),\n nombre: $(\"#nom\").val(),\n apellidos: $(\"#ape\").val(),\n fechaNacimiento: $(\"#ano\").data('date'),\n correo: $(\"#email\").val(),\n direccion: $(\"#dir\").val(),\n telefono: $(\"#tel\").val(),\n celular: $(\"#cel\").val(),\n password: $(\"#pass\").val()\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 // consultarPersonas();\n } else {\n if(tipoRespuesta === \"P~\"){\n mostrarMensaje(\"alert alert-danger\", \"Ya existe un usuario con este número de cédula\", \"Error!\");\n $(\"#idUsuario\").addClass(\"has-error\");\n } \n else if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } \n \n else {\n mostrarMensaje(\"alert alert-danger\", \"Se generó un error, contacte al administrador\", \"Error!\");\n }\n }\n\n },\n type: 'POST'\n });\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n }\n}", "function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }", "function validar(e){\r\n borrarError();\r\n if(validaEdad && validaTelefono && ValidaNombre && confirm(\"pulsar aceptar si deseas enviar este formulario\")){\r\n return true;\r\n }else {\r\n e.preventDefault();\r\n return false;\r\n }\r\n}", "function gps_verificarParametrosRespuesta() {\n\n var fecha_ini = document.getElementById(\"fechaInicio\").value;\n var fecha_fin = document.getElementById(\"fechaFinal\").value;\n var placa = document.getElementById(\"splaca\").value;\n\n var pruebaFecha = document.getElementById(\"pruebaFecha\");\n var pruebaPlaca = document.getElementById(\"pruebaPlaca\");\n\n var msg = document.getElementById(\"msg\");\n msg.innerHTML = \"\"; \n msg.className = \"form-msg\";\n var smsg = \"\";\n\n if ((fecha_ini != \"\" && fecha_fin != \"\") && (pruebaFecha == null || pruebaFecha.value == 0))\n smsg = \"* Rango de fechas es incorrecto, se trabaja con fecha actual.\";\n\n if (placa != \"\" && (pruebaPlaca == null || pruebaPlaca.value == 0)) {\n var text = \" Placa es incorrecta.\";\n smsg += (smsg == \"\") ? \"*\" + text : text;\n }\n\n if (smsg != \"\") {\n msg.innerHTML = smsg;\n msg.className = \"form-msg style-msg\";\n }\n}", "function onSubmitConsultar(e){\n e.preventDefault();\n //Validar Formulario\n const moneda = document.querySelector(\"#moneda\").value;\n const criptomoneda = document.querySelector(\"#criptomonedas\").value;\n if(moneda === \"\" || criptomoneda === \"\"){\n if(!document.querySelector(\".error\")){\n const parrafoError = document.createElement(\"p\");\n parrafoError.textContent = \"Todos los campos son obligatorios\";\n parrafoError.classList.add(\"error\");\n formulario.insertBefore(parrafoError, document.querySelector(\"#formulario .row\"));\n setTimeout(() => {\n parrafoError.remove()\n }, 3000);\n }\n return;\n }\n\n consultarPrecioCriptomoneda(moneda, criptomoneda);\n}", "function mostrarResultado(respuesta){\n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Eliminación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la eliminación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al eliminar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }", "function buscarClima(e) {\n e.preventDefault(); \n\n // VALIDACION\n const ciudad = document.getElementById('ciudad').value;\n const pais = document.getElementById('pais').value;\n\n // console.log(ciudad)\n // console.log(pais)\n \n if(ciudad === '' || pais === ''){\n // HUBO UN ERROR\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: 'Todos los campos son obligatorios',\n \n })\n return;\n \n }\n // SE MANDA A LLAMAR LA FUNTION consultarApi con los parametros de (ciudad y pais)\n consultarApi(ciudad, pais);\n}", "function registrar(){\n\tvar regbtn=\"1\";\n\tvar email = $(\"#email\").val();\n\tvar pass = $(\"#password\").val();\n\tvar repass = $(\"#repassword\").val();\n\tvar nombre = $(\"#nombre\").val();\n\tvar apellido =$(\"#apellidos\").val();\t\n\tvar direccion = $(\"#direccion\").val();\n\tvar numero = $(\"#numero\").val();\n\tvar rut = $(\"#rut\").val();\n\tvar departamento = $(\"#departamento\").val();\n\tvar telfijo = $(\"#telefonofijo\").val();\n\tvar celular = $(\"#celular\").val();\n\tvar check=$(\"input:checkbox[name='checkregistro']:checked\").val();\n\tvar idUsuario=$(\"#confirmUsuario\").val();\n\t\n\t$(\"#contregpopup\").text(\"Cargando...\");\n\tif(pass == repass){\n\t\t//las contraseñas deben ser iguales\n\t\tif(pass.length < 6 || repass.length < 6) { \n\t\t\t$(\"#mensajepass\").text(\"Las contraseñas deben tener como mínimo 6 caracteres...\");\n\t\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\tscrollTop: '0px'\n\t\t\t}, 300);\n\t\t\t$(window).scroll(function(){\n\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t} else {\n\t\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger hidden\");\n\t\t\tif($(\"#email\").val().indexOf('@', 0) == -1 || $(\"#email\").val().indexOf('.', 0) == -1) {\n //alert('El correo electrónico introducido no es correcto.');\n $(\"#mensajeemail\").attr(\"class\",\"alert alert-danger text-center\");\n }else{\n \tif(email!='' && pass!='' && nombre!='' && repass!='' && email!='' && apellido!='' && direccion!='' && numero!='' && rut!=''){\n\t\t\t\t\t//no deben hacer campos vacios\n\t\t\t\t\tif (check) {\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Procesando registro\");\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t$.post('php/AgregarUsuario/intermediario.php',{regbtn:regbtn,email:email,pass:pass,nombre:nombre,apellido:apellido,direccion:direccion,numero:numero,rut:rut,departamento:departamento,telfijo:telfijo,celular:celular,idUsuario:idUsuario},\n\t\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(data);\n\t\t\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t\t\t\t}, 300);\n\t\t\t\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\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\tif(data == \"Se ha registrado correctamente...\"){\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Debe aceptar los terminos y condiciones para completar el registro\");\n\t\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-info text-center\");\n\t\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\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\n\t\t\t\t}else{\n\n\t\t\t\t\t$(\"#mensajeBtnRegistro\").text(\"Debe llenar todos los campos obligatorios...\");\n\t\t\t\t\t$(\"#mensajeBtnRegistro\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t\t\t\t$('#agregarUsuarioModal').animate({\n\t\t\t\t\t\tscrollTop: '500px'\n\t\t\t\t\t}, 300);\n\t\t\t\t\t$(window).scroll(function(){\n\t\t\t\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('.ir-arriba').slideUp(300);\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}else{\n\t\t$(\"#mensajepass\").text(\"Las contraseñas no coinciden\");\n\t\t$(\"#mensajepass\").attr(\"class\",\"alert alert-danger text-center\");\n\t\t$('#agregarUsuarioModal').animate({\n\t\t\tscrollTop: '0px'\n\t\t}, 300);\n\t\t$(window).scroll(function(){\n\t\t\tif( $(this).scrollTop() > 0 ){\n\t\t\t\t$('.ir-arriba').slideDown(300);\n\t\t\t} else {\n\t\t\t\t$('.ir-arriba').slideUp(300);\n\t\t\t}\n\t\t});\n\t}\n\n\t}//cierre registro usuario", "function validarAdministrador()\n{\n var datosCorrectos=true;\n var error=\"\";\n if(document.getElementById(\"USUARIO\").value==\"\"){\n alert(\"error USUARIO no valido\");\n datosCorrectos=false;\n }else{\n if(document.getElementById(\"CONTRASEÑA\").value==\"\"){\n alert(\"error contraseña no valida\");\n datosCorrectos=false;\n }\n }\n if(!datosCorrectos){\n alert('No se puede continuar');\n }else{\n alert('Bienvenido');\n }\n return datosCorrectos;\n}", "function tienenSaldoDisponible (callback){\n \n var arg = {}\n arg['falseId'] = {}\n arg['falseId']['$gt'] = rangos[0] \n arg['falseId']['$lt'] = rangos[1]\n \n obtenerParametros.conFiltros(arg,function(error,parametros){\n \n if (error){throw error}\n else {\n \n console.log('Tienen saldo ', parametros)\n var result = [] // Id's de los usuarios\n \n for (var a=0;a<parametros.length;a++){\n \n if (parametros[a]['totalDisponible'] >= parametros[a]['totalXInvs']){\n \n result.push(parametros[a]['_id']) // Id del usuario\n \n }\n }\n\n if (result.length > 0){\n\n return callback(result)\n\n }else {\n\n acabarPreInversion()\n\n }\n }\n })\n}", "function BuscarCorrespondencia(entrante)\n{\n if (verificarFormulario()===false)\n {\n var Mensaje='Debe llenar los campos necesarios de manera correcta para poder registrar.'; \n CajaDialogo(\"Alerta\", Mensaje); \n return false;\n } \n entrante=(entrante==='entrante')?'t':'f'; \n $.ajax({\n type:'POST',\n url:$('#base_url').val()+'registrar/buscar_correspondencia',\n data:{\n 'id_organismo':$('#id_organismo').val(), \n 'nro_comunicado':$('#nro_comunicado').val(), \n 'fecha_emision':$('#fecha_emision').val(), \n 'entrante':entrante // 't' o 'f'\n },\n beforeSend:function(){$(\"#cargandoModal\").show()},\n complete: function(){\n $(\"#cargandoModal\").hide()}, \n error: function(){\n var Mensaje='Ha Ocurrido un Error al Intentar Buscar la Correspondencia.';\n CajaDialogo('Error', Mensaje);\n return false},\n success: function(data){ \n if (data.cantidad==0) // SI NO HAY REPETIDAS POSIBLES REGISTRAMOS\n {\n RegistrarCorrespondencia(data.entrante); \n }\n else\n {\n var Mensaje='La Correspondencia parece estar Repetida.';\n var Botones={\n Revisar:function(){ \n var entrante=(data.entrante=='entrante')?'t':'f';\n window.open($('#base_url').val()+'bandeja/repetidas/'\n +data.id_organismo+'/'\n +data.nro_comunicado+'/'\n +data.fecha_emision+'/'\n +entrante,'','',false);\n $( this ).dialog( \"close\" );},\n Ignorar:function(){\n RegistrarCorrespondencia(data.entrante);\n $( this ).dialog( \"close\" );\n }\n };\n CajaDialogo('Alerta', Mensaje, Botones);\n } \n },\n dataType:'json'});\n return true;\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 comprobarDatosUser(resp) {\n if (resp) {\n $(\"#txtUsuario\").parent().after('<div class=\"alert alert-danger\" role=\"alert\" ><i class=\"mdi mdi-block-helper mr-2\"></i>El usuario ya esta registrado en la base de datos!!</div>');\n $(\"#txtUsuario\").val(\"\");\n \n }\n \n}", "function verificarProcesoControlIniciar(form, accion) {\r\n\tvar organismo=document.getElementById(\"organismo\").value; organismo=organismo.trim();\r\n\tvar tiponom=document.getElementById(\"tiponom\").value; tiponom=tiponom.trim();\r\n\tvar periodo=document.getElementById(\"periodo\").value; periodo=periodo.trim();\r\n\tvar proceso=document.getElementById(\"proceso\").value; proceso=proceso.trim();\r\n\tvar fdesde=document.getElementById(\"fdesde\").value; fdesde=fdesde.trim(); esFdesde=esFecha(fdesde);\r\n\tvar fhasta=document.getElementById(\"fhasta\").value; fhasta=fhasta.trim(); esFhasta=esFecha(fhasta);\r\n\tvar fprocesado=document.getElementById(\"fprocesado\").value; fprocesado=fprocesado.trim(); esFprocesado=esFecha(fprocesado);\r\n\tvar fpago=document.getElementById(\"fpago\").value; fpago=fpago.trim(); esFpago=esFecha(fpago);\r\n\tif (document.getElementById(\"activo\").checked) var status=\"A\"; else var status=\"I\";\r\n\tif (document.getElementById(\"flagmensual\").checked) var flagmensual=\"S\"; else var flagmensual=\"N\";\r\n\tif (organismo==\"\" || tiponom==\"\" || periodo==\"\" || proceso==\"\" || fdesde==\"\" || fhasta==\"\" || fprocesado==\"\" || fpago==\"\") msjError(1010);\r\n\telse if (!esFdesde || !esFhasta) alert(\"¡FECHA INCORRECTA!\");\r\n\telse if (!esFprocesado) alert(\"¡FECHA DE PROCESADO INCORRECTA!\");\r\n\telse if (!esFpago) alert(\"¡FECHA DE PAGO INCORRECTA!\");\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=PROCESOS-CONTROL&accion=\"+accion+\"&organismo=\"+organismo+\"&tiponom=\"+tiponom+\"&periodo=\"+periodo+\"&proceso=\"+proceso+\"&fdesde=\"+fdesde+\"&fhasta=\"+fhasta+\"&fprocesado=\"+fprocesado+\"&fpago=\"+fpago+\"&status=\"+status+\"&flagmensual=\"+flagmensual);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tif (resp!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse cargarPagina(form, form.action);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function checkAceptaCondiciones(field){\r\n\tvar acepta = $(\"input[name='acepto_aviso_legal']:checked\").val();\r\n\tif ( acepta === undefined) {\r\n\t\treturn \"Lea y acepta los términos y condiciones de uso.\";\r\n\t}\t\t\t\r\n}", "function buscaProductoDetalleOrdenVenta(){\n\t\t//var codigoProducto = $.trim($('#txtCodigoProducto').val());\n\t\tvar codigoProducto = $('#txtCodigoProducto').val();\n\t\tvar existe = $(\"#tblDetalleOrdenVenta .codigo:contains('\"+codigoProducto+\"')\").length;\n\t\tif(existe > 0){\n\t\t\t$.msgbox(msgboxTitle,'El producto <strong>' + codigoProducto + '</strong> ya esta agregado en el<br>detalle de la guia de pedido.');\n\t\t\t$('#msgbox-ok, #msgbox-cancel, #msgbox-close').click(function(){\n\t\t\t\t$('#txtCantidadProducto').val('');\n\t\t\t\t$('#txtDescuento').val('');\n\t\t\t\t$('#txtCodigoProducto').val('').focus();\n\t\t\t});\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\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 validarApellido(){\n val = in_apellido.value;\n if(val.length < 4){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Mínimo 03 caracteres.</strong>\"; \n validator_apellido = false;\n }else{\n if(expRegCadena.test(val)){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_disabled\";\n btn_registrar.disabled = false;\n validator_apellido = true;\n }else{\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Apellido no válido, solo letras.</strong>\"; \n validator_apellido = false;\n }\n }\n checkValidator();\n}", "function controllo(dati){\n if(dati.riscontro == \"positivo\"){\n alert(\"Messaggio inviato con successo\");\n }\n else{\n alert(\"Si è verificato un errore nell'invio del messaggio, si prega di riprovare\\n\" + \n \"Errore:\" + dati.riscontro);\n }\n $(\"#sub-form\").submit();\n}", "function validar(){\n var idComboPelo = document.getElementById('pelo');\n var idComboSexo = document.getElementById('sexo');\n var idComboGafas = document.getElementById('gafas');\n var idValidacion = document.getElementById('validacion');\n document.getElementById('iconoRojo').style.visibility = \"hidden\";\n document.getElementById('iconoVerde').style.visibility = \"hidden\";\n if(idComboPelo.value != \"null\" && idComboSexo.value != \"null\" || idComboPelo.value != \"null\" && idComboGafas.value != \"null\" || idComboSexo.value != \"null\" && idComboGafas.value != \"null\"){\n idValidacion.innerHTML = \"Error: estas haciendo 2 o más preguntas a la vez.\";\n idValidacion.style.color = \"red\";\n idComboPelo.value = \"null\";\n idComboSexo.value = \"null\";\n idComboGafas.value = \"null\";\n }else if(idComboPelo.value == \"null\" && idComboSexo.value == \"null\" && idComboGafas.value == \"null\"){\n idValidacion.innerHTML = \"No estas haciendo ninguna pregunta.\";\n idValidacion.style.color = \"red\";\n }else{\n idValidacion.innerHTML = preguntaServidor();\n idValidacion.style.color = \"white\";\n contadorPregunta++;\n document.getElementById('contadorPreguntas').innerHTML = contadorPregunta;\n document.form.contadorPregunta.value = contadorPregunta;\n }\n if(document.getElementById('easyButon').disabled == false){\n document.getElementById('easyButon').style.visibility = \"hidden\";\n }\n\n}", "function confirmarAcao(acao) {\n if(confirm(\"Tem certeza que deseja incluir este paciente na fila de \" + acao + \"?\")) {\n return true;\n }\n else {\n return false;\n }\n}", "function registrar() {\n let btnRegistrar = document.getElementById(\"btnRegistrar\");\n\n let cliente = document.getElementById(\"cboCliente\").value;\n let vehiculo = document.getElementById(\"cboVehiculo\").value;\n\n let serie = document.getElementById(\"txtSerie\").value;\n let numero = document.getElementById(\"txtNumero\").value;\n\n let importe = document.getElementById(\"txtImporte\").value;\n\n if (!validarDatos(cliente, \"Debe seleccionar un Cliente\")) {\n return;\n }\n\n if (!validarDatos(vehiculo, \"Debe seleccionar un Vehiculo\")) {\n return;\n }\n\n if (!validarDatos(serie, \"Debe Ingresar una Serie\")) {\n return;\n }\n\n if (!validarDatos(numero, \"Debe Ingresar un Numero\")) {\n return;\n }\n\n if (!validarDatos(importe, \"Debe Ingresar un Importe\")) {\n return;\n }\n\n if (btnRegistrar.value === \"Registrar\") {\n registrarFactura();\n } else {\n actualizarFactura();\n }\n\n}", "function cargarDisponiblesProcesar(form) {\r\n\tvar frm = document.getElementById(\"frmentrada\");\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar ftiponom = document.getElementById(\"ftiponom\").value;\r\n\tvar fperiodo = document.getElementById(\"fperiodo\").value;\r\n\tvar ftproceso = document.getElementById(\"ftproceso\").value;\r\n\t\r\n\tif (ftiponom==\"\" || fperiodo==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE NOMINA Y PERIODO!\"); return false; }\r\n\telse if (ftproceso==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE PROCESO!\"); return false; }\r\n\telse return true;\r\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 validarprovmat(){\n\n var rfc =document.getElementById('rfc').value;\n var oculto =document.getElementById('oculto').value;\n var route = \"http://localhost:8000/validarprovedormat/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idProvedor = res[0].id;\n document.getElementById(\"idProvedor\").value= idProvedor;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"El Provedor que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function validacionModalAddAutor() {\n let nombreau = $('#txtnombreau').val();\n let emailau = $('#txtemailau').val();\n let idpais = $('#selectpaisau').val();\n let estadoau = $('#selectestadoau').val();\n if ($.trim(nombreau) == \"\") {\n toastr.error(\"Ingrese nombre del editorial\", \"Aviso!\");\n $(\"#txtnombreau\").focus();\n return false;\n } else if ($.trim(emailau) == \"\") {\n toastr.error(\"Ingrese email del editorial\", \"Aviso!\");\n $(\"#txtemailau\").focus();\n return false;\n } else if ($.trim(idpais) == \"\") {\n toastr.error(\"Seleccione un pais del autor\", \"Aviso!\");\n $(\"#selectpaisau\").focus();\n return false;\n } else if ($.trim(estadoau) == \"\") {\n toastr.error(\"Seleccione un estado del autor\", \"Aviso!\");\n $(\"#selectestadoau\").focus();\n return false;\n } else if ($.trim(emailau) != \"\") {\n if (validacionEmail(emailau) == true) {\n return true;\n } else {\n return false;\n }\n }\n}", "function validacionForm() {\r\n\tvar reason = \"\";\r\n\tvar nom = document.getElementById(\"name\");\r\n\tvar mot = document.getElementById(\"cita\");\r\n\tvar tel = document.getElementById(\"numer\");\r\n\treason += validateName(nom);\r\n\treason += validateCita(mot);\r\n\treason += validatePhone(tel);\r\n\tif (reason != \"\") {\r\n\t\twindow.alert(\"Algunos de los campos necesita correción\\n\" + reason);\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function envoyer(){\n if (champOk()) {\n existe();\n nomP.value = \"\";\n nbrP.value = \"\";\n prixP.value = \"\";\n nomP.focus();\n }\n return false\n}", "function opcionRegistro(form, registro, modulo, accion) {\r\n\tif (registro == \"\") alert(\"¡DEBE SELECCIONAR UN REGISTRO!\");\r\n\telse if (accion == \"ELIMINAR\" && confirm(\"¿REALMENTE DESEA ELIMINAR ESTE REGISTRO?\")) {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_sia.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=\"+modulo+\"&accion=\"+accion+\"&registro=\"+registro);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp = ajax.responseText;\r\n\t\t\t\tif (resp != 0) alert (resp);\r\n\t\t\t\telse cargarPagina(form, form.action);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function confirmarAcao(acao) {\n if(confirm(\"Tem certeza que deseja \" + acao + \" ?\")) {\n return validarDados();\n }\n else {\n return false;\n }\n}", "function validerEdi(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txtediNom\").value==\"\")\n msg=\"ajouter un Nom d'Editeur s'il te plait\";\n if(msg==\"\" && document.getElementById(\"cboxedicodeville\").value==\"\")\n msg=\"ajouter une ville s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function enviar() {\n if (!validar()) {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n } else if (!validarTamCampos()) {\n mostrarMensaje(\"alert alert-danger\", \"Tamaño de los campos marcados Excedido\", \"Error!\");\n } else {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuariosAction\").val(),\n idUsuario: $(\"#idUsuario\").val(),\n password: $(\"#password\").val(),\n nombre: $(\"#nombre\").val(),\n apellido1: $(\"#primerApellido\").val(),\n apellido2: $(\"#segundoApellido\").val(),\n correo: $(\"#correo\").val(),\n fechaNacimiento: $(\"#fechaNacimiento\").data('date'),\n direccion: $(\"#direccion\").val(),\n telefono1: $(\"#telefono1\").val(),\n telefono2: $(\"#telefono2\").val(),\n tipo: \"normal\"\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 mostrarModal(\"myModal\", \"Exito\", \"Usuario agregado Correctamente!\", \"true\");\n limpiarForm();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n },\n type: 'POST'\n });\n }\n}", "function VerificaCamposDeTitulo(global){\n\tverificado=true;\n\tmen=\"\";\n\t//alert(\"inicial:\"+mensaje);\n\t// Verificar que el nombre tenga contenido\n\tif ($(\"#inputTitulo\").val().length<5){\n\t\tmen=men+\"Debe introducir el NOMBRE DEL PLATO con una longitud mínima de 5 caracteres\\n\";\n\t\tverificado=false;\n\t}\n\t// Verificar que la descripcion tenga contenido\n\tif ($(\"#inputDescripcion\").val().length<5){\n\t\tmen=men+\"Debe introducir LA DESCRIPCIÓN DEL PLATO con una longitud mínima de 5 caracteres\\n\";\n\t\tverificado=false;\n\t}\n\t// Verificar que se ha seleccionado un idioma\n\tif ($(\"#selectIdioma\").val().length<1){\n\t\tmen=men+\"Debe introducir El IDIOMA del plato\\n\";\n\t\tverificado=false;\n\t}\n\t// Asigna tabla y obtiene longitud\n\tvar tabla = document.getElementById(\"tablaTitulos\");\n\tvar nfilas=$(\"#tablaTitulos tr\").length;\n\t// verificar que el idioma no se haya introducido\n\tfor (var i=0, row;row = tabla.rows[i]; i++){\n\t\t//alert();\n\t\tif (tabla.rows[i].cells[2].innerHTML==$('#selectIdioma').val()){\n\t\t\tmen=men+\"Ya existe una descripción en este IDIOMA\\n\";\n\t\t\tverificado=false;\n\t\t}\n\t}\n\tif ((!(verificado)) && (global)){\n\t\tmensaje=mensaje+\"PESTAÑA TÍTULOS DE ESCANDALLO\\n----------------------------------------\\n\"+men;\n\t}else{\n\t\tmensaje=mensaje+men;\n\t}\n\t//alert(\"Final:\"+mensaje);\n\treturn verificado;\n}", "function ricaricaContiPerCausale(){\n var selectCausaleEP = $(\"#uidCausaleEP\");\n $.postJSON(baseUrl + \"_ottieniListaConti.do\", {\"causaleEP.uid\": selectCausaleEP.val()})\n .then(function(data) {\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n return;\n }\n aggiornaDatiScritture (data);\n });\n }" ]
[ "0.6851009", "0.6851009", "0.6372521", "0.6171562", "0.6170321", "0.61476344", "0.6146789", "0.6144102", "0.61305183", "0.61137265", "0.6093173", "0.60903144", "0.6079721", "0.60712004", "0.60670096", "0.6060402", "0.6054829", "0.60454863", "0.6040154", "0.6031249", "0.6026671", "0.600136", "0.59978765", "0.59896314", "0.5983091", "0.5982202", "0.5976103", "0.5976042", "0.5972175", "0.59717464", "0.5968074", "0.596512", "0.59579116", "0.5957157", "0.5956334", "0.5941856", "0.5934424", "0.5927176", "0.59202135", "0.59176177", "0.59153056", "0.5909017", "0.589818", "0.5893349", "0.5891667", "0.58811545", "0.58715814", "0.5863096", "0.5846613", "0.58463097", "0.5845986", "0.5840129", "0.5832249", "0.5831391", "0.5826892", "0.58196044", "0.5811986", "0.58072454", "0.5803643", "0.580063", "0.5800293", "0.5799315", "0.57975715", "0.57961303", "0.578754", "0.5784753", "0.57841134", "0.5782913", "0.5777019", "0.57767", "0.57758564", "0.5773791", "0.5773007", "0.5769718", "0.5768978", "0.57624227", "0.57618606", "0.5758291", "0.5749113", "0.5748429", "0.57482415", "0.5747896", "0.5736916", "0.5735568", "0.5727595", "0.5727441", "0.5726576", "0.5724469", "0.5723683", "0.5720227", "0.5719837", "0.571024", "0.5705903", "0.5705707", "0.5703219", "0.5701402", "0.569494", "0.5690749", "0.5688448" ]
0.71117973
1
Funcao usada para manipular tecla > no formulario de consulta
function consultarComEnter(event, campo, op) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { return confirmarBuscarTodos(campo, op); } else { return event; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fCidadeF10(opc,codCdd,foco,topo,objeto){\r\n let clsStr = new concatStr();\r\n clsStr.concat(\"SELECT A.CDD_CODIGO AS CODIGO,A.CDD_NOME AS DESCRICAO\" );\r\n clsStr.concat(\" ,A.CDD_CODEST AS UF\" ); \r\n clsStr.concat(\" FROM CIDADE A\" );\r\n \r\n let tblCdd = \"tblCdd\";\r\n let tamColNome = \"29em\";\r\n if( typeof objeto === 'object' ){\r\n for (var key in objeto) {\r\n switch( key ){\r\n case \"ativo\":\r\n clsStr.concat( \" {AND} (A.CDD_ATIVO='\"+objeto[key]+\"')\",true); \r\n break; \r\n case \"codcdd\":\r\n clsStr.concat( \" {WHERE} (A.CDD_CODIGO='\"+objeto[key]+\"')\",true); \r\n break; \r\n case \"tamColNome\": \r\n tamColNome=objeto[key]; \r\n break; \r\n case \"tbl\": \r\n tblCdd=objeto[key];\r\n break; \r\n case \"where\": \r\n clsStr.concat(objeto[key],true); \r\n break; \r\n }; \r\n }; \r\n };\r\n sql=clsStr.fim();\r\n console.log(sql);\r\n // \r\n if( opc == 0 ){ \r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdCdd=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdCdd.Assoc=false;\r\n bdCdd.select( sql );\r\n if( bdCdd.retorno=='OK'){\r\n var jsCddF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,{\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\",\"align\":\"center\"}\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColNome ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":3 ,\"labelCol\":\"UF\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"2em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"} \r\n ]\r\n ,\"registros\" : bdCdd.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblCdd // Nome da table\r\n ,\"div\" : \"cdd\"\r\n ,\"prefixo\" : \"Cdd\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : \"MODELO\" // Nome da tabela no banco de dados \r\n ,\"width\" : \"52em\" // Tamanho da table\r\n ,\"height\" : \"39em\" // Altura da table\r\n ,\"indiceTable\" : \"DESCRICAO\" // Indice inicial da table\r\n };\r\n if( objCddF10 === undefined ){ \r\n objCddF10 = new clsTable2017(\"objCddF10\");\r\n objCddF10.tblF10 = true;\r\n if( (foco != undefined) && (foco != \"null\") ){\r\n objCddF10.focoF10=foco; \r\n };\r\n }; \r\n var html = objCddF10.montarHtmlCE2017(jsCddF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',topo);\r\n ajudaF10.divHeight= '410px'; /* Altura container geral*/\r\n ajudaF10.divWidth = '54em';\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaCdd');\r\n document.getElementById('tblCdd').rows[0].cells[2].click();\r\n delete(ajudaF10);\r\n delete(objCddF10);\r\n };\r\n }; \r\n if( opc == 1 ){\r\n var bdCdd=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdCdd.Assoc=true;\r\n bdCdd.select( sql );\r\n return bdCdd.dados;\r\n }; \r\n}", "function recuperarDadosQuatroParametros(idRegistro, descricaoRegistro, codigoRegistro, tipoConsulta) {\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\r\n\tif (tipoConsulta == 'setorComercialOrigem') {\r\n form.setorComercialOrigemCD.value = codigoRegistro;\r\n form.setorComercialOrigemID.value = idRegistro;\r\n\t form.nomeSetorComercialOrigem.value = descricaoRegistro;\r\n\t form.nomeSetorComercialOrigem.style.color = \"#000000\";\r\n\t \r\n\t form.setorComercialDestinoCD.value = codigoRegistro;\r\n form.setorComercialDestinoID.value = idRegistro;\r\n\t form.nomeSetorComercialDestino.value = descricaoRegistro;\r\n\t form.nomeSetorComercialDestino.style.color = \"#000000\";\r\n\t form.quadraOrigemNM.focus();\r\n\t}\r\n\r\n\tif (tipoConsulta == 'setorComercialDestino') {\r\n form.setorComercialDestinoCD.value = codigoRegistro;\r\n form.setorComercialDestinoID.value = idRegistro;\r\n\t form.nomeSetorComercialDestino.value = descricaoRegistro;\r\n\t form.nomeSetorComercialDestino.style.color = \"#000000\"; \r\n\t form.quadraDestinoNM.focus();\r\n\t}\r\n\r\n//\tif (tipoConsulta == 'quadraOrigem') {\r\n // form.quadraOrigemNM.value = codigoRegistro;\r\n\t// form.quadraOrigemID.value = idRegistro;\r\n//\t form.quadraMensagemOrigem.value = descricaoRegistro;\r\n\t// form.quadraMensagemOrigem.style.color = \"#000000\";\r\n\t \r\n//\t form.quadraDestinoNM.value = codigoRegistro;\r\n\t// form.quadraDestinoID.value = idRegistro;\r\n\t //form.quadraMensagemDestino.value = descricaoRegistro;\r\n// }\r\n\r\n//\tif (tipoConsulta == 'quadraDestino') {\r\n // form.quadraDestinoNM.value = codigoRegistro;\r\n\t// form.quadraDestinoID.value = idRegistro;\r\n// \t form.quadraMensagemDestino.value = descricaoRegistro;\r\n //\t form.quadraMensagemDestino.style.color = \"#000000\";\r\n\t//}\r\n\tform.action = 'exibirFiltrarImovelOutrosCriteriosConsumidoresInscricao.do?menu=sim&gerarRelatorio=RelatorioCadastroConsumidoresInscricao&limpar=S';\r\n\tform.submit();\r\n\r\n}", "function llenarFormulario( t_data) {\n $('#smlSearch').hide();\n document.getElementById('inputSearch').value = t_data.codigo;\n document.getElementById('inputSearch').value = t_data.sku;\n document.getElementById('inputSearch').value = t_data.descripcion;\n}", "function fPadraoF10(padrao){\r\n var sql=\"SELECT \"+padrao.fieldCod+\" AS CODIGO,\"+padrao.fieldDes+\" AS DESCRICAO FROM \"+padrao.tableBd+\" A \";\r\n //\r\n //////////////////////////////////////////////////////////////////////////////////////////////////////\r\n // a tbl eh padrao \"tblPas\" mas quando em um mesmo form existir duas chamadas o obj padrao deve ter //\r\n // a propriedade tbl:\"tblXxx\" devido funcao function RetF10tblXxx(arr) que naum pode ser repetida //\r\n ////////////////////////////////////////////////////////////////////////////////////////////////////// \r\n var tblPad=\"tblPad\";\r\n // \r\n if( padrao.opc == 0 ){ \r\n sql+=\"WHERE (\"+padrao.fieldAtv+\"='S')\";\r\n let tamColCodigo = \"6em\"; \r\n let tamColNome = \"30em\";\r\n let divWidth = \"42%\";\r\n for (var key in padrao) {\r\n switch( key ){\r\n case \"tbl\" : tblPad=padrao[key] ;break; \r\n case \"where\" : sql+=padrao[key] ;break; \r\n case \"tamColCodigo\" : tamColCodigo=padrao[key] ;break; \r\n case \"tamColNome\" : tamColNome=padrao[key] ;break; \r\n case \"divWidth\" : divWidth=padrao[key] ;break; \r\n }; \r\n };\r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdPad=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdPad.Assoc=false;\r\n bdPad.select( sql );\r\n if( bdPad.retorno=='OK'){\r\n var jsPadF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,( padrao.typeCod==\"int\" ? \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"} : \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColCodigo ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"} )\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColNome ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ]\r\n ,\"registros\" : bdPad.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblPad // Nome da table\r\n ,\"prefixo\" : \"pad\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : padrao.tableBd // Nome da tabela no banco de dados \r\n ,\"width\" : \"52em\" // Tamanho da table\r\n ,\"height\" : \"38em\" // Altura da table\r\n ,\"indiceTable\" : \"DESCRICAO\" // Indice inicial da table\r\n };\r\n if( objPadF10 === undefined ){ \r\n objPadF10 = new clsTable2017(\"objPadF10\");\r\n objPadF10.tblF10 = true;\r\n }; \r\n \r\n if( (padrao.foco != undefined) && (padrao.foco != \"null\") ){\r\n objPadF10.focoF10=padrao.foco; \r\n };\r\n \r\n var html = objPadF10.montarHtmlCE2017(jsPadF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',padrao.topo);\r\n ajudaF10.divHeight= '400px'; /* Altura container geral*/\r\n ajudaF10.divWidth = divWidth;\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaPad');\r\n document.getElementById(tblPad).rows[0].cells[2].click();\r\n };\r\n }; \r\n if( padrao.opc == 1 ){\r\n sql+=\" WHERE (\"+padrao.fieldCod+\"='\"+document.getElementById(padrao.edtCod).value.toUpperCase()+\"')\"\r\n +\" AND (\"+padrao.fieldAtv+\"='S')\";\r\n var bdPad=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdPad.Assoc=true;\r\n bdPad.select( sql );\r\n return bdPad.dados;\r\n }; \r\n}", "function getOrdenes() {\n\tvar tabla = $(\"#ordenes_trabajo\").anexGrid({\n\t class: 'table-striped table-bordered table-hover',\n\t columnas: [\n\t \t{ leyenda: 'Acciones', style: 'width:100px;', columna: 'Sueldo' },\n\t \t{ leyenda: 'ID', style:'width:20px;', columna: 'id', ordenable:true},\n\t { leyenda: 'Clave de orden de trabajo', style: 'width:200px;', columna: 'o.clave', filtro:true},\n\t { leyenda: 'Tipo de orden', style: 'width:100px;', columna: 'o.t_orden', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'INSPECCIÓN' },\n\t { valor: '2', contenido: 'VERIFICACIÓN' },\n\t { valor: '3', contenido: 'SUPERVISIÓN' },\n\t { valor: '4', contenido: 'INVESTIGACIÓN' },\n\t ]\n\t });\n\t }},\n\t { leyenda: 'Número de oficio', style: 'width:200px;', columna: 'of.no_oficio',filtro:true},\n\t { leyenda: 'Fecha', columna: 'o.f_creacion', filtro: function(){\n \t\treturn anexGrid_input({\n \t\t\ttype: 'date',\n \t\t\tattr:[\n \t\t\t\t'name=\"f_ot\"'\n \t\t\t]\n \t });\n\t } },\n\t //{ leyenda: 'Participantes', style: 'width:300px;', columna: 'Correo' },\n\t { leyenda: 'Estado', style: 'width:120px;', columna: 'o.estatus', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'Cumplida' },\n\t { valor: '2', contenido: 'Parcial sin resultado' },\n\t { valor: '3', contenido: 'Parcial con resultado' },\n\t { valor: '4', contenido: 'Cumplida sin resultado' },\n\t { valor: '5', contenido: 'Cancelada' },\n\t ]\n\t });\n\t }},\n\t \n\t ],\n\t modelo: [\n\t \t\n\t \t{ class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n ];\n\t \t\t}else{\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n { href: \"javascript:open_modal('modal_cancelar_ot',\"+obj.id+\");\", contenido: '<i class=\"fa fa-ban text-red\"></i><b class=\"text-red\">Cancelar</b> '},\n ];\n\t \t\t}\n\t return anexGrid_dropdown({\n contenido: '<i class=\"glyphicon glyphicon-cog\"></i>',\n class: 'btn btn-primary ',\n target: '_blank',\n id: 'editar',\n data: acciones\n });\n\t }},\n\t \t\n\t { class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\ttr.addClass('bg-red-active');\n\t \t\t}\n\t return obj.id;\n\t }},\n\t { propiedad: 'clave' },\n\t { propiedad: 't_orden' },\n\t { propiedad: 'oficio' },\n\t { propiedad: 'f_creacion' },\n\t //{ propiedad: 'id'},\n\t { propiedad: 'estatus'}\n\t \n\t \n\t ],\n\t url: 'controller/puente.php?option=8',\n\t filtrable: true,\n\t paginable: true,\n\t columna: 'id',\n\t columna_orden: 'DESC'\n\t});\n\treturn tabla;\n}", "function mostrarResultado() {\n if (valorTela.value.includes(\"%\")) { \n valorTela.value = eval(porcento())\n } else if (valorTela.value.includes(\"!\")) {\n valorTela.value = eval(fatorial())\n } else if (valorTela.value.includes(\"mod\")) {\n valorTela.value = eval(mod())\n } else if (valorTela.value.includes(\"^\")) {\n valorTela.value = eval(exponencial())\n } else {\n valorTela.value = eval(valorTela.value)\n }\n \n}", "function cambiar(){\n \t var compania;\n \t //Se toma el valor de la \"compañia seleccionarda\"\n \t compania = document.formulariorecargas.compania[document.formulariorecargas.compania.selectedIndex].value;\n \t //se chequea si la \"compañia\" esta definida\n \t \n \t if(compania!=0){\n \t\t //Seleccionamos las cosas correctas\n \t\t \n \t\t mis_tipos=eval(\"tipo_\" + compania);\n \t\t //se calcula el numero de compania\n \t\t num_tipos=mis_tipos.length;\n \t\t //marco el numero de tipos en el select\n \t\t document.formulariorecargas.tipo.length = num_tipos;\n \t\t //para cada tipo del array, la pongo en el select\n \t\t for(i=0; i<num_tipos; i++){\n \t\t\t document.formulariorecargas.tipo.options[i].value=mis_tipos[i];\n \t\t\t document.formulariorecargas.tipo.options[i].text=mis_tipos[i];\n \t\t }\n \t\t \n \t\t }else{\n \t\t\t //sino habia ningun tipo seleccionado,elimino las cosas del select\n \t\t\t document.formulariocompania.tipo.length = 1;\n \t\t\t //ponemos un guion en la unica opcion que he dejado\n \t\t\t document.formulariorecargas.tipo.options[0].value=\"seleccionar\";\n \t\t\t document.formulariorecargas.tipo.options[0].text=\"seleccionar\";\n \t\t\t \n \t\t }\n \t \n \t\n \t \n \t \n \t\t //hacer un reset de los tipos\n \t document.formulariorecargas.tipo.options[0].selected=true;\n\n }", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "function Plansza(opis)\r\n{\r\n var i;\r\n plansza = \"<table class='table'><tbody>\";\r\n for(i = 0; i < opis.length; i++)\r\n {\r\n if (i % 9 == 0) plansza += \"<tr>\";\r\n plansza += \"<td class='field' id='td\"+ wspolrzedne(i) +\"'>\";\r\n if (opis[i] == '0') {\r\n plansza += \"<input type='text' class='input-mini' maxlength='1' id='i\" + wspolrzedne(i) + \"' onFocus='ustawId(this)' onkeypress='return isNumberKey(event)'>\";\r\n } else {\r\n plansza += \"<input type='text' class='input-mini' maxlength='1' readonly= '' id='i\" + wspolrzedne(i) + \"' value='\"+opis[i]+\"'>\";\r\n }\r\n plansza += \"</td>\";\r\n if (i % 9 == 8) plansza += \"</tr>\";\r\n }\r\n return plansza+\"</tbody></table>\";\r\n}", "function rellenoBusqueda()\n{\tcampoId\t\t= this.id;\n\tcampoId\t\t= $('#'+campoId).attr('campo');\n\tcampoVal \t= this.title;\n\tprocesando(\"Buscando Informacions ...\");\n\ttabla\t= $(\"#tabla\").attr('value');\n\tcadena\t= \"sstm__tabla=\"+tabla+\"&campoId=\"+campoId+\"&campoVal=\"+campoVal;\n\t// Lanzo el Ajax para Insertar Registro\n\tajaxTablas\t= $.ajax({\n \turl: 'index.php?ctr=FormularioAcciones&acc=getId',\n \ttype: 'POST',\n \tasync: true,\n \tdata: cadena,\n\tsuccess: cargarConsulta\n\t}); // dataType: 'json',\n}", "function recogerBusqueda(e) { \n\n let palabraBuscar = e.target.value.toLowerCase();\n\n var listaBusqueda = filtrarBusqueda(agendaActividades, palabraBuscar); //funcion filtrarBusqueda linea 22/interno\n\n pintarActividades(listaBusqueda); //Pintamos el resultado del filtro con la funcion pintarActividades que a su vez usa la funcion pintarActividad\n}", "function tablaresultadosordencompra(limite)\r\n{\r\n \r\n \r\n var decimales = document.getElementById('decimales').value;\r\n var base_url = document.getElementById('base_url').value;\r\n var controlador = base_url+'orden_compra/buscar_ordenescompra';\r\n let parametro = \"\";\r\n if(limite == 2){\r\n parametro = document.getElementById('filtrar').value;\r\n }else if(limite == 3){\r\n parametro = \"\";\r\n }\r\n //document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro},\r\n success:function(respuesta){\r\n var registros = JSON.parse(respuesta);\r\n var color = \"\";\r\n if (registros != null){\r\n //var formaimagen = document.getElementById('formaimagen').value;\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").html(n);\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n html += \"<tr>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+(i+1)+\"</td>\";\r\n html += \"<td style='padding: 2px;'>\"+registros[i]['usuario_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_id']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fecha\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_hora']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fechaentrega\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['proveedor_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-right'>\"+Number(registros[i]['ordencompra_totalfinal']).toFixed(decimales)+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['estado_descripcion']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='no-print'>\";\r\n html += \"<a href='\"+base_url+\"orden_compra/edit/\"+registros[i][\"ordencompra_id\"]+\"' class='btn btn-info btn-xs' title='Modificar orden compra' ><span class='fa fa-pencil'></span></a>&nbsp;\";\r\n html += \"<a class='btn btn-success btn-xs' onclick='mostrar_reciboorden(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-facebook btn-xs' onclick='mostrar_reciboordenp(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra para proveedor'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n if(registros[i]['estado_id'] == 33){\r\n html += \"<a class='btn btn-danger btn-xs' onclick='modal_ejecutarordencompra(\"+registros[i]['ordencompra_id']+\")' title='Ejecutar orden compra'><fa class='fa fa-bolt'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencompra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }/*else if(registros[i]['estado_id'] == 35){\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencmpra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }*/\r\n \r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n }\r\n $(\"#tablaresultados\").html(html);\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}", "function TratarCasilla(idCelda, textoMateria, diaTarea){\r\n\t\r\n\t // si ya ha pasado la hora no se deja introducir tareas\r\n\tif ( (document.getElementById(idCelda).style.textDecoration) == \"line-through\") {\r\n\t\treturn 0;\r\n\t}\r\n\t// si había un día seleccionado se quita la marca en ese día.\r\n\tif (celdaSelec != \"\") {\r\n\t\tdocument.getElementById(celdaSelec).style.borderWidth=\"thin\";\r\n\t}\r\n\t// Se rellenan los datos de día y materia en el formulario a partir de los datos de la celda pulsada\r\n\tdocument.getElementById(\"Materia\").value = textoMateria;\r\n\tdocument.getElementById(\"DiaTarea\").value = diaTarea;\r\n\tceldaSelec = idCelda; // Se guarda el id de la celda seleccionada\r\n\tvar posicion =0;\r\n\tvar encontrado=false;\r\n\t// Se busca si había una tarea para ese día\r\n\tfor ( var i =0; i<trabajosM.length; i=i+2) {\r\n\t\tif (trabajosM[i] == idCelda) {\r\n\t\t\t// Si había una tarea se rellena el formulario con dicha tarea\r\n\t\t\tdocument.getElementById(\"Tarea\").value= trabajosM[i+1];\r\n\t\t\tencontrado = true;\r\n\t\t}\r\n\t}\r\n\t// Si no había tarea para ese día se borra lo que hubiese en el formulario\r\n\tif (encontrado == false) {\r\n\t\tdocument.getElementById(\"Tarea\").value=\"\";\r\n\t}\r\n\t// Se marca la celda como seleccionada\r\n\tdocument.getElementById(idCelda).style.borderWidth=\"thick\";\r\n}", "function resultado_detalle(id_asoc, operacion)\r\n{\r\n var base_url = document.getElementById('base_url').value;\r\n var consumo_lec = operacion;\r\n var controlador = base_url+'lectura/obtenertarifa/';\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{id_asoc:id_asoc, consumo_lec:consumo_lec},\r\n success:function(respuesta){\r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n \r\n html = \"\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='box'>\";\r\n html += \"<div class='box-body table-responsive'>\";\r\n html += \"<table class='table table-striped'>\";\r\n html += \"<tr>\";\r\n html += \"<th class='text-center'>#</th>\";\r\n html += \"<th class='text-center'>DETALLE</th>\";\r\n html += \"<th class='text-center'>MONTO</th>\";\r\n html += \"</tr>\";\r\n \r\n html += \"<tr>\";\r\n html += \"<td>\"+1+\"</td>\";\r\n html += \"<td class='text-right' style='align-items: center'>Consumo Agua</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='consumo_agua\"+id_asoc+\"' type='text' value='\"+registros[1]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n html += \"<tr>\";\r\n html += \"<td>\"+2+\"</td>\";\r\n html += \"<td class='text-right' style='align-items: center'>Aportes</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='aportes\"+id_asoc+\"' type='text' value='\"+registros[2]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n html += \"<tr>\";\r\n html += \"<td>\"+3+\"</td>\";\r\n html += \"<td class='text-right' style='vertical-align: central'>Multas</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='multas\"+id_asoc+\"' type='text' value='\"+registros[3]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"<input id='tipo_asoc\"+id_asoc+\"' type='hidden' value='\"+registros[4]+\"'>\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n \r\n \r\n html += \"</table>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n \r\n $(\"#eldetalle\"+id_asoc).html(html);\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}", "function get_informe_entradas(){\n var ini = $('#ini').val();\n var out = $('#out').val();\n var proveedor = $('#field #id_proveedor').val();\n var tipo = $('#field #id_tipo_entrada').val();\n if (proveedor < 1) {\n proveedor = \"all\";\n };\n if (tipo < 1 ) {\n tipo = \"all\";\n };\n if (ini == \"\") {\n ini = \"all\";\n };\n if (out == \"\") {\n out = \"all\";\n };\n $.ajax({\n url: proveedor+\"/\"+tipo+\"/\"+ini+\"/\"+out+\"/\",\n dataType: \"json\",\n success: function(respuesta){\n var texto = \"\";\n if (respuesta.tablainf.length == 0 ) {\n texto += \"<div class='box box-danger'><div class='box-body'>\";\n texto += \"<h4 align='center'> No se encontraron resultados </h4></div></div>\";\n } else{\n texto = \"<div class='box box-success'><table class='table table-hover table-striped'>\";\n texto += \"<thead>\";\n texto += \"<tr>\";\n texto += \"<th>No. Entrada</th>\";\n texto += \"<th>Tipo</th>\"\n texto += \"<th>Proveedor</th>\"\n texto += \"<th>Equipo</th>\";\n texto += \"<th>Fecha</th>\";\n texto += \"<th>Cantidad</th>\";\n if (tipo == 2) {\n texto += \"<th>Precio</th>\";\n texto += \"<th>Factura</th>\";\n };\n texto += \"</tr>\";\n texto += \"</thead>\";\n if (tipo == 2) {\n $.each(respuesta.tablainf, function(index, itemm){\n texto += \"<tr><td>\" + itemm.id + \"</td><td>\" + itemm.tipo + \"</td><td>\"+ itemm.prov +\"</td><td>\"+ itemm.equipo + \"</td><td>\" + itemm.fecha +\"</td><td>\" + itemm.cantidad + \"</td><td>Q \" + itemm.precio +\"</td><td>\" + itemm.factura+\"</td></tr>\";\n })\n } else{\n $.each(respuesta.tablainf, function(index, item){\n texto += \"<tr><td>\" + item.id + \"</td><td>\"+ item.tipo +\"</td><td>\"+ item.prov +\"</td><td>\"+ item.equipo + \"</td><td>\" + item.fecha +\"</td><td>\" + item.cantidad +\"</td></tr>\";\n })\n texto += \"</table></div>\";\n };\n };\n document.getElementById('here').innerHTML = texto;\n }\n });\n}", "function editarFormulario(){\n //Trae la grid para poder actualizar al editar\n listadoCamposFormulario = Ext.getCmp('listadoCamposFormulario');\n if (listadoCamposFormulario.getSelectionModel().hasSelection()) {\n var row = listadoCamposFormulario.getSelectionModel().getSelection()[0];\n \n\n encontrado=1;\n if(ventana==null) \n ventana = Ext.create ('App.miVentanaBanco');\n\n // Precarga el nombre e id seleccionados\n Ext.getCmp('nombreBanco').setValue(row.get('nombre'));\n Ext.getCmp('idBanco').setValue(row.get('id'));\n\n\n ventana.show();\n \n }\n }", "function iniciareditaringresos(datos) {\n\n document.getElementById(\"idti\").value = datos[0][\"idtipoingresosganancias\"]\n document.getElementById(\"nombreingresoseditar\").value = datos[0][\"nombre\"];\n document.getElementById(\"descripcioningresoseditar\").value = datos[0][\"descripcion\"];\n document.getElementById(\"ayudaingresoseditar\").value = datos[0][\"ayuda\"];\n\n}", "function consulta_filtro_cartera(){\ndocument.getElementById(\"escogecliente\").innerHTML=\"\";\n var IdCliente=$(\"#cartera\").val();\n //alert(IdCliente);\n if (parseInt(IdCliente) === 0){\n alert(\"Debe escoger un cliente\");\n document.getElementById(\"escogecliente\").innerHTML=\"Debe escoger un cliente\";\n document.getElementById(\"escogecliente\").style.color=\"red\";\n return;\n \n } \n \n var pagos_ini=$('#pagos').val();\n var pagos_fin=$('#pagos1').val();\n var tvencido_ini=$('#tvencido').val();\n var tvencido_fin=$('#tvencido1').val();\n var vcompromiso_ini=$('#vcompromiso').val();\n var vcompromiso_fin=$('#vcompromiso1').val();\n var saldos_ini=$('#saldos').val();\n var saldos_fin=$('#saldos1').val();\n var dia_mora_ini=$('#dia_mora').val();\n var dia_mora_fin=$('#dia_mora1').val();\n var fUltimo_pago_ini=$('#datetimepicker10').val();\n var fUltimo_pago_fin=$('#datetimepicker11').val();\n var fUltimo_gestion_ini=$('#datetimepicker12').val();\n var fUltimo_gestion_fin=$('#datetimepicker13').val();\n var fUltimo_compromiso_ini=$('#datetimepicker14').val();\n var fUltimo_compromiso_fin=$('#datetimepicker15').val();\n var SelectTipoGestion=$(\"#tgestion\").val();\n var SelectTipoResultado=$(\"#tresultado_gestion\").val();\n var carteras=$('#tcartera').val();\n var subcartera=$('#tsub_cartera').val();\n var segmento=$('#tsegmento').val();\n var subsegmento=$(\"#tsub_segmento\").val();\n var testatus_cre=$(\"#testatus_cre\").val();\n var cartera = $(\"#cartera\").val();\n console.log(\"Paso1: >>>\"+cartera);\n var accion = \"nuevaConsulta\";\n var order_by=$('#order_by').val();\n var lv_select=\" select count(*) OVER (ORDER BY s.id_transaccion) AS secuencia2,\";\n var lv_select2=\" select \";\n var lv_datos=\" '<a href=\\\"#\\\" onclick=\\\"GestionCliente('||s.id_cliente||','||s.id_datos_deudor||');\\\" >'||s.nombres_completo||'</a>' nombres_completo2,s.* \";\n var lv_from=\" from \"; \n var lv_mi_empleado=$('#mi_empleado').val();//\"IDEmpleadoConsulta\";\n var lv_query=\" vw_consulta_cartera s \";\n var IDEmpleadoConsulta=\"\";\n var estatus=\"\";\n if(lv_mi_empleado===\"\"){\n IDEmpleadoConsulta=\"and s.id_empleado=IDEmpleadoConsulta\";\n \n }else{\n IDEmpleadoConsulta=\"and s.id_empleado=\"+lv_mi_empleado;\n }\n //testatus_cre\n if(testatus_cre!==\"0\"){\n estatus=\" and s.tipo_estatus=\"+testatus_cre; \n }\n if(lv_mi_empleado===\"0\"){\n var txt;\n var r = confirm(\"Esta seguro que desea consultar todos los Gestores \\nRecuerde que esta consulta puede detener los procesos actuales del Sistema. \\nProcure utilizar los filtros\");\n if (r == false) {\n return;\n } \n \n IDEmpleadoConsulta=\"\";\n }\n \n \n var lv_filtros=\" where s.id_cliente=IDClienteConsulta \"+IDEmpleadoConsulta+\" and s.estado != 'E' \" +estatus;\n var sqlQuery=lv_select+lv_datos+lv_from+lv_query+lv_filtros;\n \n //\n var fmontos=\"\";\n /*valida critrios de pagos*/\n if (pagos_ini.length !== 0 && pagos_fin.length !==0 && parseInt(pagos_ini) >= parseInt(pagos_fin)){ alert(\"El valor de PAGO Inicial debe ser MENOR a la PAGO final para realizar la consulta\"); return; }\n if (pagos_ini.length !== 0 && pagos_fin.length !==0 && parseInt(pagos_ini) < parseInt(pagos_fin)){ fmontos+= \" AND s.pagos >= \"+pagos_ini+\" AND s.pagos <= \"+pagos_fin; }\n if (pagos_ini.length !== 0 && pagos_fin.length === 0 && parseInt(pagos_ini) < 0){ alert(\"El valor en PAGOS ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (pagos_ini.length !== 0 && pagos_fin.length === 0 && parseInt(pagos_ini) > 0){ fmontos+= \" AND s.pagos >= \"+pagos_ini ; }\n if (pagos_ini.length === 0 && pagos_fin.length !== 0 && parseInt(pagos_fin) < 0){ alert(\"El valor ingresdo en PAGOS debe ser mayo a 0 para realizar la consulta\"); return; }\n if (pagos_ini.length === 0 && pagos_fin.length !== 0 && parseInt(pagos_fin) > 0){ fmontos+= \" AND s.pagos <= \"+pagos_fin ; }\n /*valida critrios de Total Deuda*/ \n if (tvencido_ini.length !== 0 && tvencido_fin.length !==0 && parseInt(tvencido_ini) >= parseInt(tvencido_fin)){ alert(\"El valor de Deudoa Total Inicial debe ser MENOR a la PAGO final para realizar la consulta\"); return; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length !==0 && parseInt(tvencido_ini) < parseInt(tvencido_fin)){ fmontos+= \" AND s.total_vencidos >= \"+tvencido_ini+\" AND s.total_vencidos <= \"+tvencido_fin; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length === 0 && parseInt(tvencido_ini) < 0){ alert(\"El valor en Total Deuda ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (tvencido_ini.length !== 0 && tvencido_fin.length === 0 && parseInt(tvencido_ini) > 0){ fmontos+= \" AND s.total_vencidos >= \"+tvencido_ini ; }\n if (tvencido_ini.length === 0 && tvencido_fin.length !== 0 && parseInt(tvencido_fin) < 0){ alert(\"El valor ingresdo en Total Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (tvencido_ini.length === 0 && tvencido_fin.length !== 0 && parseInt(tvencido_fin) > 0){ fmontos+= \" AND s.pagtotal_vencidosos <= \"+tvencido_fin ; }\n \n /*valida critrios de Valor Compromiso*/ \n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length !==0 && parseInt(vcompromiso_ini) >= parseInt(vcompromiso_fin)){ alert(\"El valor de Compromiso de Pago Inicial debe ser MENOR a Compromiso de Pago final para realizar la consulta\"); return; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length !==0 && parseInt(vcompromiso_ini) < parseInt(vcompromiso_fin)){ fmontos+= \" AND s.valor_compro >= \"+vcompromiso_ini+\" AND s.valor_compro <= \"+vcompromiso_fin; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length === 0 && parseInt(vcompromiso_ini) < 0){ alert(\"El valor en Compromiso de Pago ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (vcompromiso_ini.length !== 0 && vcompromiso_fin.length === 0 && parseInt(vcompromiso_ini) > 0){ fmontos+= \" AND s.valor_compro >= \"+vcompromiso_ini ; }\n if (vcompromiso_ini.length === 0 && vcompromiso_fin.length !== 0 && parseInt(vcompromiso_fin) < 0){ alert(\"El valor Compromiso de Pago Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (vcompromiso_ini.length === 0 && vcompromiso_fin.length !== 0 && parseInt(vcompromiso_fin) > 0){ fmontos+= \" AND s.valor_compro <= \"+vcompromiso_fin ; }\n \n /*valida critrios de Saldos*/ \n if (saldos_ini.length !== 0 && saldos_fin.length !==0 && parseInt(saldos_ini) >= parseInt(saldos_fin)){ alert(\"El valor de Saldo Inicial debe ser MENOR al Saldo final para realizar la consulta\"); return; }\n if (saldos_ini.length !== 0 && saldos_fin.length !==0 && parseInt(saldos_ini) < parseInt(saldos_fin)){ fmontos+= \" AND s.saldo >= \"+saldos_ini+\" AND s.saldo <= \"+saldos_fin; }\n if (saldos_ini.length !== 0 && saldos_fin.length === 0 && parseInt(saldos_ini) < 0){ alert(\"El valor Saldo ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (saldos_ini.length !== 0 && saldos_fin.length === 0 && parseInt(saldos_ini) > 0){ fmontos+= \" AND s.saldo >= \"+saldos_ini ; }\n if (saldos_ini.length === 0 && saldos_fin.length !== 0 && parseInt(saldos_fin) < 0){ alert(\"El valor Saldo Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (saldos_ini.length === 0 && saldos_fin.length !== 0 && parseInt(saldos_fin) > 0){ fmontos+= \" AND s.saldo <= \"+saldos_fin ; }\n \n /*valida critrios de Dias de Mora*/ \n if (dia_mora_ini.length !== 0 && dia_mora_fin.length !==0 && parseInt(dia_mora_ini) >= parseInt(dia_mora_fin)){ alert(\"El valor de Dias Mora Inicial debe ser MENOR a Dias Mora final para realizar la consulta\"); return; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length !==0 && parseInt(dia_mora_ini) < parseInt(dia_mora_fin)){ fmontos+= \" AND s.dias_mora >= \"+dia_mora_ini+\" AND s.dias_mora <= \"+dia_mora_fin; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length === 0 && parseInt(dia_mora_ini) < 0){ alert(\"El valor Dias Mora ingresdo debe ser mayor a 0 para realizar la consulta.\"); return; }\n if (dia_mora_ini.length !== 0 && dia_mora_fin.length === 0 && parseInt(dia_mora_ini) > 0){ fmontos+= \" AND s.dias_mora >= \"+dia_mora_ini ; }\n if (dia_mora_ini.length === 0 && dia_mora_fin.length !== 0 && parseInt(dia_mora_fin) < 0){ alert(\"El valor Dias Mora Deuda debe ser mayor a 0 para realizar la consulta\"); return; }\n if (dia_mora_ini.length === 0 && dia_mora_fin.length !== 0 && parseInt(dia_mora_fin) > 0){ fmontos+= \" AND s.dias_mora <= \"+dia_mora_fin ; }\n \n /*valida critrios de Fecha Ultimo Pago*/ \n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length !==0 && Date.parse(fUltimo_pago_ini) >= Date.parse(fUltimo_pago_fin)){ alert(\"La fecha de Ultimo Pago Inicial debe ser MENOR a la fecha de Ultimo Pago final para realizar la consulta\"); return; }\n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length !==0 && Date.parse(fUltimo_pago_ini) < Date.parse(fUltimo_pago_fin)){ fmontos+= \" AND s.fecha_ult_pagos >= '\"+fUltimo_pago_ini+\"' AND s.fecha_ult_pagos <= '\"+fUltimo_pago_fin+\"' \"; }\n if (fUltimo_pago_ini.length !== 0 && fUltimo_pago_fin.length === 0 ){ fmontos+= \" AND s.fecha_ult_pagos >= '\"+fUltimo_pago_ini+\"' \"; }\n if (fUltimo_pago_ini.length === 0 && fUltimo_pago_fin.length !== 0 ){ fmontos+= \" AND s.fecha_ult_pagos <= '\"+fUltimo_pago_fin+\"' \"; }\n \n /*valida critrios de Fecha Ultima Gestión*/ \n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length !==0 && Date.parse(fUltimo_gestion_ini) >= Date.parse(fUltimo_gestion_fin)){ alert(\"La fecha de Ultimo Gestión Inicial debe ser MENOR a la fecha de Ultimo Gestión final para realizar la consulta\"); return; }\n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length !==0 && Date.parse(fUltimo_gestion_ini) < Date.parse(fUltimo_gestion_fin)){ fmontos+= \" AND s.fech_ultima_gestion >= '\"+fUltimo_pago_ini+\"' AND s.fech_ultima_gestion <= '\"+fUltimo_gestion_fin+\"' \"; }\n if (fUltimo_gestion_ini.length !== 0 && fUltimo_gestion_fin.length === 0 ){ fmontos+= \" AND s.fech_ultima_gestion >= '\"+fUltimo_gestion_ini+\"' \"; }\n if (fUltimo_gestion_ini.length === 0 && fUltimo_gestion_fin.length !== 0 ){ fmontos+= \" AND s.fech_ultima_gestion <= '\"+fUltimo_gestion_fin+\"' \"; }\n \n /*valida critrios de Fecha Ultima Compromiso*/ \n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length !==0 && Date.parse(fUltimo_compromiso_ini) >= Date.parse(fUltimo_compromiso_fin)){ alert(\"La fecha de Compromiso inicial debe ser MENOR a la fecha de Compromiso final para realizar la consulta\"); return; }\n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length !==0 && Date.parse(fUltimo_compromiso_ini) < Date.parse(fUltimo_compromiso_fin)){ fmontos+= \" AND s.fecha_comp >='\"+fUltimo_compromiso_ini+\"' AND s.fecha_comp <= '\"+fUltimo_compromiso_fin+\"' \"; }\n if (fUltimo_compromiso_ini.length !== 0 && fUltimo_compromiso_fin.length === 0 ){ fmontos+= \" AND s.fecha_comp >= '\"+fUltimo_compromiso_ini+\"'\"; }\n if (fUltimo_compromiso_ini.length === 0 && fUltimo_compromiso_fin.length !== 0 ){ fmontos+= \" AND s.fecha_comp <= '\"+fUltimo_compromiso_fin+\"' \"; }\n \n// alert(SelectTipoGestion);\n// return;\n if (SelectTipoGestion!== \"0\"){\n fmontos+= \" AND s.ultima_gestion = '\"+$('#tgestion').find('option:selected').text()+\"'\"; \n } \n if (SelectTipoResultado!== \"0\"){\n fmontos+= \" AND s.resultado_gestion = '\"+$('#tresultado_gestion').find('option:selected').text()+\"'\"; \n } \n if ((carteras!== \"0\")&&(carteras!== null)){\n \n fmontos+= \" AND s.id_cartera = \"+$('#tcartera').find('option:selected').val(); \n }\n if ((subcartera!== \"0\")&&(subcartera!==null)){\n \n fmontos+= \" AND s.id_sub_cartera = \"+$('#tsub_cartera').find('option:selected').val(); \n }\n if ((segmento!== \"0\")&&(segmento!==null)){\n \n fmontos+= \" AND s.id_segmento = \"+$('#tsegmento').find('option:selected').val(); \n }\n if ((subsegmento!== \"0\")&&(subsegmento!== null)){\n \n fmontos+= \" AND s.id_sub_segmento = \"+$('#tsub_segmento').find('option:selected').val(); \n }\n if (order_by!==\"\"){\n \n order_by= \" ORDER BY s.\"+order_by+\" DESC\";\n }\n \n $('#id_loader').css(\"display\", \"block\");\n //arma el query para la consula\n sqlQuery=sqlQuery+fmontos+order_by;\n document.getElementById(\"input_query\").value = \"\";\n document.getElementById(\"input_query\").value = sqlQuery;\n console.log(sqlQuery);\n //var htmlTable=\"<table id='consul_cartera' class='table table-striped table-bordered dt-responsive nowrap table-hover' cellspacing='0' width='100%'><thead><tr bgcolor='#FBF5EF'><th class='col-sm-1 text-left hidden' style='color: #3c8dbc'>ID</th><th align='left' class='col-sm-1 text-left'><a id='IdentificacionID' onclick='orderIdent()'>Identificación</a></th><th class='col-sm-2 text-left'><a id='NombresID' onclick='orderNombre()'>Nombres</a></th> <th class='col-sm-1 text-left'><a id='DiasMoraID' onclick='orderDiasMora()' >Días Mora</a></th> <th class='col-sm-1 text-right'><a id='TotalID' onclick='orderTotalVenc()' >Total Vnc</a></th> <th align='center' class='col-sm-1 text-right'><a id='PagosID' onclick='orderPagos()'>Pagos</a></th><th align='center' class='col-sm-1 text-right'><a id='FecUltPagosID' onclick='orderFechaUltPagos()'>Fecha Ult. Pagos</a></th><th align='rigth' class='col-sm-1 text-right'><a id='SaldosID' onclick='orderSaldo()'>Saldo</a></th><th align='center' class='col-sm-1 text-right'><a id='ValorCompID' onclick='orderValorComp()'>Valor Comp.</a></th> <th align='center' class='col-sm-2 text-center'><a id='FechaCompID' onclick='orderFechaComp()'>Fecha Comp.</a></th><th align='center' class='col-sm-3'><a id='FechaID' onclick='orderFchGestion()' >Fecha Ult. Gestión</a></th> <th align='center' class='col-sm-3'><a id='UltimaID' onclick='orderUltima()'>Ult. Gestión</a></th> <th align='center' class='col-sm-2'><a id='ResultadoID' onclick='orderResultado()'>Resultado Gestión</a></th></tr> </thead><tbody>\";\n var parametros = {\n \"sqlQuery\":sqlQuery,\n \"cartera\": cartera,\n \"accion\": accion\n };\n console.log(\"Paso2: >>>\"+cartera);\n document.getElementById(\"tabla_div\").innerHTML = \"\"; \n var htmlTable=\"<table id='consul_cartera' class='table table-striped table-bordered dt-responsive nowrap table-hover' cellspacing='0' width='100%'><thead><tr bgcolor='#FEC187'><th class='col-sm-1 text-left ' style='color: #3c8dbc'>ID</th><th align='left' class='col-sm-1 text-left'><a >#</a></th><th align='left' class='col-sm-1 text-left'><a onclick='orderIdent()' id='IdentificacionID' >Identificación</a></th><th class='col-sm-2 text-left'><a onclick='orderNombre();' id='NombresID' >Nombres</a></th> <th class='col-sm-1 text-left'><a onclick='orderDiasMora();' id='DiasMoraID' >Días Mora</a></th> <th class='col-sm-1 text-right'><a onclick='orderTotalVenc();' id='TotalID' >Total Vnc</a></th> <th align='center' class='col-sm-1 text-right'><a onclick='orderPagos();' id='PagosID' >Pagos</a></th><th align='center' class='col-sm-1 text-right'><a onclick='orderFechaUltPagos();' id='FecUltPagosID' >Fecha Ult. Pagos</a></th><th align='rigth' class='col-sm-1 text-right'><a onclick='orderSaldo();' id='SaldosID' >Saldo</a></th> <th align='center' class='col-sm-1 text-right'><a onclick='orderValorComp();' id='ValorCompID' >Valor Comp.</a></th> <th align='center' class='col-sm-2 text-center'><a onclick='orderFechaComp();' id='FechaCompID' >Fecha Comp.</a></th><th align='center' class='col-sm-3'><a onclick='orderFchGestion();' id='FechaID' >Fecha Ult. Gestión</a></th> <th align='center' class='col-sm-3'><a onclick='orderUltima();' id='UltimaID' >Ult. Gestión</a></th> <th align='center' class='col-sm-2'><a onclick='orderResultado();' id='ResultadoID' >Resultado Gestión</a></th></tr> </thead><tbody></tbody></table>\";\n document.getElementById(\"tabla_div\").innerHTML = htmlTable;\n \n$('#consul_cartera').DataTable( {\n \"ajax\": { \n \"data\": {\"accion\": accion,\"sqlQuery\": sqlQuery,\"cartera\": cartera},\n \"url\": \"consultacartera\",\n \"type\": \"GET\"\n },\n \"columns\": [\n { \"data\": \"id_datos_deudor\",\"title\":\"ID\", \"visible\": false },\n { \"data\": \"secuencia2\",class:'text-right' },\n { \"data\": \"identificacion\" },\n { \"data\": \"nombres_completo2\" },\n { \"data\": \"dias_mora\",class:'text-right' },\n { \"data\": \"total_vencidos\",class:'text-right' },\n { \"data\": \"pagos\",class:'text-right' },\n { \"data\": \"fecha_ult_pagos\" },\n { \"data\": \"saldo\",class:'text-right' },\n { \"data\": \"valor_compro\",class:'text-right' },\n { \"data\": \"fecha_comp\" },\n { \"data\": \"fech_ultima_gestion\" },\n { \"data\": \"ultima_gestion\" },\n { \"data\": \"resultado_gestion\" }\n ],\"language\": {\n \t\t\t\t\"emptyTable\":\t\t\t\"No hay datos disponibles en la tabla.\",\n \t\t\t\t\"info\":\t\t \t\t\"Del _START_ al _END_ de _TOTAL_ \",\n \t\t\t\t\"infoEmpty\":\t\t\t\"Mostrando 0 registros de un total de 0.\",\n \t\t\t\t\"infoFiltered\":\t\t\t\"(filtrados de un total de _MAX_ registros)\",\n \t\t\t\t\"infoPostFix\":\t\t\t\"(actualizados)\",\n \t\t\t\t\"lengthMenu\":\t\t\t\"Mostrar _MENU_ registros\",\n \t\t\t\t\"loadingRecords\":\t\t\"Cargando...\",\n \t\t\t\t\"processing\":\t\t\t\"Procesando...\",\n \t\t\t\t\"search\":\t\t\t\"Buscar:\",\n \t\t\t\t\"searchPlaceholder\":\t\t\"Dato para buscar\",\n \t\t\t\t\"zeroRecords\":\t\t\t\"No se han encontrado coincidencias.\",\n \t\t\t\t\"paginate\": {\n \t\t\t\t\t\"first\":\t\t\t\"Primera\", \n \t\t\t\t\t\"last\":\t\t\t\t\"Última\",\n \t\t\t\t\t\"next\":\t\t\t\t\"Siguiente\",\n \t\t\t\t\t\"previous\":\t\t\t\"Anterior\"\n \t\t\t\t},\"aria\": {\n \t\t\t\t\t\"sortAscending\":\t\"Ordenación ascendente\",\n \t\t\t\t\t\"sortDescending\":\t\"Ordenación descendente\"\n \t\t\t\t}\n \t\t\t},\n scrollY: 500,\n scrollX: true,\n scrollCollapse: true,\n paging: false\n } );\n \n $('#id_loader').css(\"display\", \"none\");\n // $('#det_filtro').modal('hide'); \n \n consulta_sec(sqlQuery,cartera,\"\");\n \n \n\n\nvar table = $('#consul_cartera').DataTable();\ntable\n .column( '0:visible' )\n .order( 'asc' )\n .draw();\n\n$('#consul_cartera thead').on('click', 'th', function () {\n var index = table.column(this).index();\nconsole.log('consulta de columna: '+index);\n switch (index) {\n case 1:\n orderIdent();\n break;\n case 2:\n orderNombre(); \n break;\n case 3:\n orderDiasMora();\n break;\n case 4:\n orderTotalVenc();\n break;\n case 5:\n orderPagos();\n break;\n case 6:\n orderFechaUltPagos();\n break;\n case 7:\n orderSaldo();\n break;\n case 8:\n orderValorComp();\n break;\n case 9:\n orderFechaComp();\n break;\n case 10:\n orderFchGestion();\n break;\n case 11:\n orderUltima();\n break;\n case 12:\n orderResultado();\n break; \n}\n\n \n $('#id_loader').css(\"display\", \"none\");\n // alert('index : '+index);\n});\n\n\n // alert(sqlQuery); \n \n var qCantClientes=lv_select2+\" count(*) \"+lv_from+lv_query+lv_filtros+fmontos+order_by;\n var qSum=lv_select2+\" COALESCE(sum(s.total_vencidos), 0::numeric) as total_vencidos, COALESCE(sum(s.pagos), 0::numeric) as pagos, COALESCE(sum(s.total_vencidos) - COALESCE(sum(s.pagos), 0::numeric), 0::numeric) as saldo, (\"+qCantClientes +\") as total_clientes \"+lv_from+lv_query+lv_filtros+fmontos+order_by;\n console.log(\">>>>>QSUM: \"+qSum);\n Totales_Suman(qSum, IdCliente);\n}", "function cnsFornec_linha(i){\n var aux = objTabelaFornec.registros[i];\n\n //MONTA A LINHA\n var table = \"<td class='w80 inativo center'><input value='\"+aux.fo_number+\"' name='fo_number' readonly/></td>\"+\n\t\t\"<td class='w150 inativo'><input value='\"+aux.fo_abrev+\"' name='fo_abrev' readonly/></td>\"+\n\t\t\"<td class='w110 inativo'><input value='\"+aux.fo_contato+\"' name='fo_contato' readonly/></td>\"+\n\t\t\"<td class='w100 inativo'><input value='\"+aux.fo_fone+\"' name='fo_fone' readonly/></td>\"+\n\t\t\"<td class='w110 inativo'><input value='\"+aux.fo_fax+\"' name='fo_fax' class='uppercase' readonly/></td>\"+\n\t\t\"<td class='w70 inativo center'><input value='\"+aux.fo_grupo+\"' name='fo_grupo' class='uppercase' readonly/></td>\"+\n\t\t\"<td class='w50 inativo center last'><input value='\"+aux.fo_ativo+\"' name='fo_ativo' class='uppercase' readonly/></td>\";\n\n return table;\n\n}", "function cnsRH_linha(i){\n\tvar aux = objTabelaFuncRH.registros[i];\n var table = \"\" +\n\t\"<td class='w90 bg blue-light'><input type='text' value='\"+aux.codigo+\"' readonly/></td>\"+\n\t\"<td class='w350 inativo'><input type='text' value='\"+aux.descricao+\"' readonly/></td>\"+\n\t\"<td class='w80 inativo'><input type='text' value='\"+aux.cbo+\"' readonly/></td>\"+\n\t\"<td class='w110 number inativo'><input type='text' value='\"+aux.salario+\"' readonly/></td>\";\n\treturn table;\n}", "function build(params) {\n /*\n {\n \"key\": \"chave do catalogo\", //obrigatorio\n \"label\": \"label do catalogo\", //obrigatorio\n \"sql\": \"sql do catalogo\", //obrigatorio\n \"paths\": { //opcional\n \"entidade\": \"se definido substituira todos os valores da entidade\",\n \"entidade.coluna\": \"se definido substituira o caminho da coluna\"\n }\n }\n */\n \n // validando os dados obrigatorios\n if (!params.key)\n return {\"erro\": 'Propriedade \"key\" não informada.'};\n else if (!params.label)\n return {\"erro\": 'Propriedade \"label\" não informada.'};\n else if (!params.sql)\n return {\"erro\": 'Propriedade \"sql\" não informada.'};\n \n // valores padroes\n params = objUtils.merge({\"paths\": {}}, params);\n \n var doFields = function(objeto) {\n var fields = [];\n \n var defaults = {\n \"select\": true,\n \"filter\": true,\n \"sort\": true,\n \"group\": true,\n \"eval\": \"F\",\n \"objetobdfk\": null,\n \"querykeyfk\": null,\n \"campobdds\": null,\n \"functionsql\": null,\n \"functionresult\": null\n };\n \n // rodando as colunas\n objeto.colunas.forEach(function(coluna, i){\n // verifica se a coluna esta nos campos\n if (objeto.campos.indexOf(coluna.field.toLowerCase()) >= 0) {\n // define o caminho\n var path = params.paths[objeto.nome] || params.key;\n \n // adiciona ao fields\n fields.push(objUtils.merge(coluna, defaults, {\n \"key\": params.key + '.' + coluna.key,\n \"path\": params.paths[coluna.key] || path\n }));\n }\n });\n \n return fields;\n };\n \n var dados = {};\n var tabelas = {};\n \n var idxs = {\n \"select\": null,\n \"from\": null,\n \"where\": null,\n \"entity\": null\n };\n \n // quebra o sql em partes\n var sqls = params.sql.toLowerCase().split(' ');\n \n // percorre para encontrar os indices\n sqls.forEach(function(valor, i) {\n if (valor == 'select')\n idxs.select = i;\n else if (valor == 'from')\n idxs.from = i;\n else if (valor == 'where')\n idxs.where = i;\n });\n \n // forca o where ao ultimo registro\n idxs.where = idxs.where || sqls.length;\n \n // percorre a faixa dos campos\n for (var i = idxs.select + 1; i < idxs.from; i++) {\n // somente se nao tiver em branco\n if (sqls[i].trim() != '') {\n var item = sqls[i].replace(',', '').split('.');\n \n // cria a chave da tabela se nao existir\n if (!tabelas[item[0]]) {\n tabelas[item[0]] = {\n \"nome\": item[0],\n \"juncao\": null,\n \"campos\": []\n };\n }\n \n tabelas[item[0]].campos.push(item[1]);\n }\n }\n \n // identifica a entidade\n for (i = idxs.from + 1; i < sqls.length; i++) {\n if (sqls[i].trim() != '') {\n dados.entidade = sqls[i].trim();\n \n idxs.entity = i;\n break;\n }\n }\n \n // percore as tabelas para encontrar as juncoes\n var itensTabela = {};\n for (i = idxs.entity + 1; i < idxs.where; i++) {\n // variavel de quebra\n if (\n // quebra por left\n (sqls[i] == 'left') ||\n \n // quebra por join\n (sqls[i] == 'join' && itensTabela.qtde > 1)\n ) {\n // verifica se tem a tabela para armazenar\n if (itensTabela.tabela)\n tabelas[itensTabela.tabela].juncao = itensTabela.juncao.trim();\n \n itensTabela = {\n 'quebra': true,\n 'juncao': sqls[i],\n 'qtde': 1\n };\n }\n \n else {\n itensTabela.juncao += ' ' + sqls[i];\n itensTabela.qtde++;\n \n // precedente da tabela\n if (sqls[i] == 'join')\n itensTabela.precedente = true;\n \n // nome da tabela\n else if (!itensTabela.tabela && itensTabela.precedente)\n itensTabela.tabela = sqls[i];\n }\n }\n \n // verifica se tem a tabela para armazenar\n if (itensTabela.tabela)\n tabelas[itensTabela.tabela].juncao = itensTabela.juncao.trim();\n \n // roda as tabelas\n for (var tabela in tabelas) {\n // lista as colunas da tabela\n tabelas[tabela].colunas = dao.getDao(tabela.toUpperCase()).find(\n \"SELECT \" +\n \"LOWER(table_name + '.' + column_name) as [key], \" +\n \"LOWER('label.' + table_name + '.' + column_name) as label, \" +\n \"A.COLUMN_NAME AS field, \" +\n \"CASE \" +\n \"WHEN A.DATA_TYPE IN ('date', 'datetime') THEN 'T' \" +\n \"WHEN A.DATA_TYPE IN ('bigint', 'decimal', 'int') THEN 'N' \" +\n \"ELSE 'G' \" +\n \"END AS type \" +\n \"FROM INFORMATION_SCHEMA.COLUMNS A \" +\n \"WHERE \" +\n \"TABLE_NAME = '\" + tabela.toUpperCase() + \"'\"\n );\n }\n \n // montando a entidade principal\n var entidade = {\n \"name\": dados.entidade.toUpperCase(),\n \"join\": null,\n \"alias\": dados.entidade.toUpperCase(),\n \"entity\": dados.entidade.toUpperCase(),\n \"fields\": doFields(tabelas[dados.entidade]),\n \"children\": []\n };\n \n // remove a entidade principal\n delete tabelas[dados.entidade];\n \n // roda as tabelas para acrescentar ao child\n for (tabela in tabelas) {\n entidade.children.push({\n \"name\": tabelas[tabela].nome.toUpperCase(),\n \"join\": tabelas[tabela].juncao,\n \"alias\": tabelas[tabela].nome.toUpperCase(),\n \"entity\": tabelas[tabela].nome.toUpperCase(),\n \"fields\": doFields(tabelas[tabela])\n });\n }\n \n return {\n \"key\": params.key,\n \"label\": params.label,\n \"entity\": dados.entidade.toUpperCase(),\n \"inactive\": false,\n \"alias\": [entidade]\n };\n }", "function AgregarUsuario(admin)\n{ \n var form;\n form='<div class=\"EntraDatos\">';\n form+='<table>';\n form+='<thead>';\n form+='<tr><th colspan=\"2\">'; \n form+='Nuevo Usuario'; \n form+='</th></tr>'; \n form+='</thead>'; \n form+='<tbody>';\n form+='<tr>';\n form+='<td width=\"50%\">'; \n form+='<label>Cédula de Identidad:</label>';\n form+='<input type=\"text\" id=\"CI\" class=\"Editable\" tabindex=\"1000\" title=\"Introduzca el Número de Cédula\"/>';\n form+='<input type=\"button\" onclick=\"javascript:BuscarUsuario()\" tabindex=\"1001\" title=\"Buscar\" value=\"Buscar\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Correo Electrónico:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Correo\" title=\"Correo Electrónico\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nombre:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Nombre\" title=\"Nombre\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Apellido:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Apellido\" title=\"Apellido\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>'; \n form+='<tr>';\n form+='<td colspan=\"2\">';\n form+='<input type=\"hidden\" id=\"id_unidad\" />'; \n form+='<label>Unidad Administrativa:</label>';\n form+='<center><input type=\"text\" class=\"Campos Editable\" id=\"Unidad\" title=\"Unidad Administrativa\" tabindex=\"1002\"/></center>';\n form+='</td>'; \n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nivel de Usuario:</label>';\n form+='<select class=\"Campos Editable\" id=\"Nivel\" title=\"Seleccione el Nivel del Usuario\" tabindex=\"1003\">';\n form+='<option selected=\"selected\" value=\"0\">[Seleccione]</option>';\n form+='</select>';\n form+='</td>';\n form+='<td>';\n if (admin==1)\n {\n form+='<label>Rol de Usuario:</label>';\n form+='<div class=\"ToggleBoton\" onclick=\"javascript:ToggleBotonAdmin()\" title=\"Haga clic para cambiar\">';\n form+='<img id=\"imgAdmin\" src=\"imagenes/user16.png\"/>';\n form+='</div>';\n form+='<span id=\"spanAdmin\">&nbsp;Usuario Normal</span>'; \n }\n form+='<input type=\"hidden\" id=\"hideAdmin\" value=\"f\" />'; \n form+='</td>';\n form+='</tr>'; \n form+='</tbody>';\n \n form+='<tfoot>';\n form+='<tr><td colspan=\"2\">';\n form+='<div class=\"BotonIco\" onclick=\"javascript:GuardarUsuario()\" title=\"Guardar Usuario\">';\n form+='<img src=\"imagenes/guardar32.png\"/>&nbsp;'; \n form+='Guardar';\n form+= '</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n form+='<div class=\"BotonIco\" onclick=\"javascript:CancelarModal()\" title=\"Cancelar\">';\n form+='<img src=\"imagenes/cancel.png\"/>&nbsp;';\n form+='Cancelar';\n form+= '</div>';\n form+='</td></tr>';\n form+='</tfoot>';\n form+='</table>'; \n form+='</div>';\n $('#VentanaModal').html(form);\n $('#VentanaModal').show(); \n $('#CI').focus();\n \n selector_autocompletar(); \n}", "function generateQuery(){\n\t//Determinamos los valores para realziar la b?squeda\n\tjsCalGuiasCodGuia = get('calGuiasFrm.codGuia').toString();\n\tjsCalGuiasDpteOidDepa = get('calGuiasFrm.dpteOidDepa')[0];\n\tjsCalGuiasValTitu = get('calGuiasFrm.valTitu').toString();\n\tjsCalGuiasFecInicVali = get('calGuiasFrm.fecInicVali').toString();\n\tjsCalGuiasFecFinVali = get('calGuiasFrm.fecFinVali').toString();\n\tjsCalGuiasValDescGuia = get('calGuiasFrm.valDescGuia').toString();\n\t\n\t\n\tvar parametros = \"\";\n\tparametros += jsCalGuiasCodGuia + \"|\";\n\tparametros += jsCalGuiasDpteOidDepa + \"|\";\n\tparametros += jsCalGuiasValTitu + \"|\";\n\tparametros += jsCalGuiasFecInicVali + \"|\";\n\tparametros += jsCalGuiasFecFinVali + \"|\";\n\tparametros += jsCalGuiasValDescGuia + \"|\";\n\t\n\treturn parametros;\n}", "function listarTodosFiltroPregunta(){\r\n\r\n\tvar idDetalleTipoFormacionFiltro = $(\"#selectDetalleTipoFormacionPreguntaFiltro\").val();\r\n\tvar idDetalleEstadoFiltro = $(\"#selectDetalleEstadoPreguntaFiltro\").val();\r\n\r\n\tlistarTodosPreguntaGenerico(\"listarTodosFiltro?idDetalleTipoFormacion=\"+idDetalleTipoFormacionFiltro+\"&idDetalleEstado=\"+idDetalleEstadoFiltro);\t\t\t\t\r\n}", "function fplatosParaOcasion(){\n\tconsole.log(\"Llega a query cuatro\");\n\tvar input = $(\"#plato4\").val();\n\tif(input != \"\"){\n\t\tvar datos = {\n\t\t\t\"occasion\": \"%\"+input+\"%\"\n\t\t};\n\t\t$.post(\"platos-para-ocasion\",datos,function(data){\n\t\t\tconsole.log(data);\n\t\t\tvar builder = \"<tr> <th> Numero </th> <th>Platos</th> </tr>\";\n\t\t\tfor(var i=0; i<data.length; i++){\n\t\t\t\tbuilder += \"<tr> <th> #\" + (i+1) + \"</th> <td>\" +data[i].name+\"</td> </tr>\";\n\t\t\t}\n\t\t\t$(\"#my-table4\").html(builder);\n\t\t});\n\t}\n\telse{\n\t\tconsole.log(\"Input no valido :v\")\n\t\t$(\"#my-table4\").html(\"\");\n\t}\n}", "function seleccionarOrden(productos){\n \n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n rowProductos.innerHTML=\"\";\n\n let select = document.querySelector(\".selectOrdenProductos\");\n \n switch(select.value){\n\n case 'date':\n getPaginacion(ordenarProductosFecha(productos));\n break;\n \n case 'price-asc':\n getPaginacion(ordenarProductosPrecio(productos, \"asc\"));\n break;\n\n case 'price-des':\n getPaginacion(ordenarProductosPrecio(productos, \"des\"));\n break;\n\n }\n \n}", "function cargaComplementos(){\n //Cargado del DataTables\n if($('table').length>0){\n $('table').DataTable();\n }\n \n //Cargado del DatePicker\n if($(\".date-picker\").toArray().length>0){\n $('.date-picker').datepicker({\n format : \"dd/mm/yyyy\"\n });\n }\n \n //Cargado del Input Mask con el formato \"dd/mm/yyyy\"\n if($('.input-date').toArray().length>0){\n $(\".input-date\").inputmask(\"dd/mm/yyyy\");\n }\n if($('.select2').toArray().length>0){\n $(\".select2\").select2({\n placeholder : \"Seleccione una opción\"\n });\n }\n}", "function cargarCuerpoElectrico(data, fila, enfoque, bandera) {\n var tr = '<tr id=\"detalles-tr-' + fila + '\" data-value=\"' + fila + '0\" >';\n tr = tr + ' <th class=\"text-center\" data-encabezado=\"Número\" scope=\"row\" id=\"row-' + fila + '\">' + fila + '</th>';\n tr = tr + ' <td data-encabezado=\"Columna 01\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-1-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"2018\">2018</option>';\n tr = tr + cargarAnio();\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"date\" placeholder=\"\" id=\"dat-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 02\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-2-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 03\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-3-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 05\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-2-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 06\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-3-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-4-' + fila + '\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-5-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-6-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Subtotal\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-7-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td class=\"text-center text-xs-right\" data-encabezado=\"Acciones\">';\n tr = tr + ' <div class=\"btn-group\">';\n tr = tr + ' <div class=\"acciones fase-01 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"fas fa-ellipsis-h\"></i></div>';\n tr = tr + ' <div class=\"dropdown-menu dropdown-menu-right\">';\n tr = tr + ' <a class=\"dropdown-item agregarFila\" href=\"#\">';\n tr = tr + ' <i class=\"fas fa-plus-circle\"></i>&nbsp;Agregar';\n tr = tr + ' </a><a class=\"dropdown-item quitarCampos\" href=\"#\" onclick=\"fn_restarTotal(7, 8);\">';\n tr = tr + ' <i class=\"fas fa-minus-circle\"></i>&nbsp;Eliminar';\n tr = tr + ' </a>';\n tr = tr + ' </div>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + ' <td class=\"text-hide\" data-encabezado=\"ID_INDICADOR\" style=\"display:none;\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-8-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + '</tr>';\n $(\"#cuerpoTablaIndicador\").append(tr);\n if (bandera == 1) {\n fn_CargarListaTipoVehiculo(data, (fila - 1), enfoque);\n }\n //return tr;\n}", "function tablaresultados_asociado(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var consulta= \"\";\r\n var limit = limite;\r\n var base_url = document.getElementById('base_url').value;\r\n controlador = base_url+'asociado/buscar_asociado';\r\n \r\n if(limit == 1){\r\n consulta = \" limit 300\";\r\n }else if(limit == 3){\r\n consulta =\"\";\r\n }else{\r\n parametro = document.getElementById('filtrar').value;\r\n \r\n } \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, consulta:consulta},\r\n success:function(respuesta){\r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n if (registros != null){\r\n \r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n //$(\"#encontrados\").html(\"Registros Encontrados: \"+n+\" \");\r\n html = \"\";\r\n \r\n for (var i = 0; i < n ; i++){\r\n html += \"<tr>\";\r\n \r\n html += \"<td>\"+(i+1)+\"</td>\";\r\n html += \"<td>\";\r\n html += \"<div style='padding-left: 4px'>\";\r\n tam = 3;\r\n var nombre = registros[i][\"nombres_asoc\"]+\" \"+registros[i][\"apellidos_asoc\"]\r\n if(nombre.length>25){\r\n tam = 1; \r\n }\r\n html += \"<b><font face='Arial' size='\"+tam+\"' >\"+nombre+\"</font></b><br>\";\r\n html += \"<b>ZONA: </b>\"+registros[i]['zona_asoc']+\"<br>\";\r\n html += \"<b>TELF.: </b>\"+registros[i]['telefono_asoc'];\r\n html += \"</div>\";\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"codigo_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"ci_asoc\"]+\" \"+registros[i][\"cudad\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"direccion_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"nit_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"razon_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"medidor_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"servicios_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"categoria_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"estado\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += \"<a href='\"+base_url+\"asociado/edit/\"+registros[i]['id_asoc']+\"' class='btn btn-info btn-xs' title='Modificar datos'><span class='fa fa-pencil'></span></a>\";\r\n html += \"<a href='\"+base_url+\"imagen_asociado/catalogoasoc/\"+registros[i]['id_asoc']+\"' class='btn btn-soundcloud btn-xs' title='Catálogo de imagenes'><span class='fa fa-image'></span></a>\";\r\n /* html += \"<a class='btn btn-success btn-xs' data-toggle='modal' data-target='#modalecturar\"+registros[i][\"id_asoc\"]+\"' title='Lecturar'><span class='fa fa-file-text'></span></a>\";\r\n \r\n html += \"<!------------------------ INICIO modal para confirmar eliminación ------------------->\";\r\n html += \"<div class='modal fade' id='modalecturar\"+registros[i][\"id_asoc\"]+\"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel\"+i+\"'>\";\r\n html += \"<div style='white-space: normal' class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"<div><span class='text-bold'>LECTURAR DE:</span><br>\";\r\n html += \"<span style='display: inherit; text-align: center !important'>\"+registros[i]['nombres_asoc']+\" \"+registros[i]['apellidos_asoc']+\"</span>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Lect. Anterior</span>\";\r\n html += \"<div style='width: 70%' class='form-control' id='anterior_lec\"+registros[i]['id_asoc']+\"'>\"+registros[i]['ultima_lectura']+\"</div>\";\r\n //html += \"<input style='width: 70%' id='filtrar' type='text' class='form-control' onkeypress='buscar_asociado(event)' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Lect. Actual&nbsp;&nbsp;&nbsp;</span>\";\r\n html += \"<input style='width: 70%' id='actual_lec\"+registros[i]['id_asoc']+\"' type='text' class='form-control' onkeypress='calcular_consumo(event, \"+registros[i]['id_asoc']+\")' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Consumo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>\";\r\n html += \"<div style='width: 70%' class='form-control' id='consumo_lec\"+registros[i]['id_asoc']+\"'></div>\";\r\n //html += \"<input style='width: 70%' id='filtrar' type='text' class='form-control' onkeypress='buscar_asociado(event)' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='row' id='eldetalle\"+registros[i]['id_asoc']+\"'>\";\r\n html += \"</div>\";\r\n html += \"<input type='hidden' value='\"+registros[i]['fecha_anterior']+\"' id='fecha_anterior\"+registros[i]['id_asoc']+\"' >\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-footer' style='text-align: center !important'>\";\r\n html += \"<a onclick='registrar_lectura(\"+registros[i]['id_asoc']+\")' class='btn btn-success'><span class='fa fa-check'></span> Registrar </a>\";\r\n html += \"<a href='#' class='btn btn-danger' data-dismiss='modal'><span class='fa fa-times'></span> Cancelar </a>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para confirmar eliminación ------------------->\";\r\n */\r\n html += \"</td>\";\r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n\r\n $(\"#tablaresultados\").html(html);\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 adaptaFormulario () {\r\n\tvar secProfEl = getFormElementById(\"sectorprofesion_c\");\r\n\tif (! secProfEl) {\r\n\t\tconsole.error(\"No se ha definido el campo Sector Profesional.\");\r\n\t} else {\r\n\t\tvar secProf = secProfEl.options[secProfEl.selectedIndex];\r\n\t\tswitch (secProf.value) {\r\n\t\t\tcase \"otros\": visibilidadOtroSector(true); break;\r\n\t\t\tdefault:\t visibilidadOtroSector(false);\t break;\r\n\t\t}\r\n\t}\r\n}", "function consultarTrasladoPresupuestario(idtraslado_presupuestario)\n{\n\n\tvar dataString = \t'idtraslado_presupuestario=' + idtraslado_presupuestario +\n\t\t\t\t\t\t'&ejecutar=consultar_traslado_presupuestario';\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"modulos/presupuesto/controlador/trasladoPresupuesto.controller.php\",\n\t\tdata: dataString,\n\t\tsuccess: function(response) {\n\n\t\t\trespuesta = response.split(\"|.|\");\n\t\t\tfecha = respuesta[2].split(\"-\");\n\t\t\tfecha_solicitud = fecha[2]+\"-\"+fecha[1]+\"-\"+fecha[0];\n\t\t\tfecha = respuesta[4].split(\"-\");\n\t\t\tfecha_resolucion = fecha[2]+\"-\"+fecha[1]+\"-\"+fecha[0];\n\n\t\t\t$('input#idTrasladoPresupuestario').val(idtraslado_presupuestario);\n\t\t\t$(\"input#numeroSolicitud\").val(respuesta[1]);\n\t\t\t$('input#datetimepicker1').val(fecha_solicitud);\n\t\t\t$('input#numeroResolucion').val(respuesta[3]);\n\t\t\t$('input#datetimepicker2').val(fecha_resolucion);\n\t\t\t$('#concepto').val(respuesta[5]);\n\t\t\t$('input#estado_oculto').val(respuesta[6]);\n\t\t\tswitch(respuesta[6]){\n\n\t\t\t\tcase 'elaboracion':\n\t\t\t\t\t$('input#estado_mostrado').val('En elaboración');\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'procesado':\n\t\t\t\t\t$('input#estado_mostrado').val('Procesado');\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'anulado':\n\t\t\t\t\t$('input#estado_mostrado').val('Anulado');\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t\t$('input#disminucionesBs').val(formatNumber.new(respuesta[7]));\n\t\t\t$('input#aumentosBs').val(formatNumber.new(respuesta[8]));\n\t\t\tmostrarDiv();\n\t\t\tmostrarPartidasDisminuidas(idtraslado_presupuestario);\n\t\t\tmostrarPartidasAumentadas(idtraslado_presupuestario);\n\t\t\tactualizarBotones();\n\t\t}\n\t});\n\n}", "function fCargaListadoA(){\n frm.hdFiltro.value = \"ICVEMODULO = \" +frm.iCveModulo.value+ \" AND INUMREPORTE NOT IN (SELECT INUMREPORTE FROM GRLREPORTEXOPINION WHERE ICVEOPINIONENTIDAD = \"+frm.iCveOpinionEntidad.value+ \" AND ICVESISTEMA = 44 AND ICVEMODULO = \" +frm.iCveModulo.value+ \" )\";\n frm.hdOrden.value = \" CNOMREPORTE\";\n frm.hdNumReg.value = 100000;\n fEngSubmite(\"pgGRLReporteA.jsp\",\"GRLReporte\");\n }", "validarInfo() {\n if (this.erros.length > 0) {\n this.validador.style.display = \"table-row\";\n this.imprimirErros(this.erros);\n } else if ((this.validarRepetido(this.nome, this.peso, this.altura)) == false) {\n this.calculaIMC();\n this.adicionarElementos();\n this.validador.style.display = \"none\";\n this.form.reset();\n }\n }", "function filtrosPartidos(filtro, columna) {\n //Activar el filtro por letra\n var columna_elegida = document.getElementsByClassName('col_' + columna);\n var nuevo_texto = '';\n switch (filtro) {\n case '1':\n nuevo_texto = 'L';\n break;\n case '2':\n nuevo_texto = 'E';\n break;\n case '3':\n nuevo_texto = 'V';\n break;\n }\n for (var i = 0; i < columna_elegida.length; i++) {\n columna_elegida.item(i).innerHTML = nuevo_texto;\n }\n\n \n}", "function RelData(formulario)\r\n{\r\n\tif(\r\n\t(formulario.codunidade.value !=0) &&\r\n\t(formulario.dtinicial.value == '') &&\r\n\t(formulario.dtfinal.value == '')\r\n\t\t){\r\n\t\tformulario.action = window.location.href;\r\n\t\tformulario.submit();\r\n\t\treturn true;\r\n\t\t}\r\n\t\tif (formulario.dtinicial.value == '')\r\n\t\t{\r\n\r\n\t\t\talert('O Campo \"Data Inicial\" deve ser preenchido.');\r\n\t\t\tformulario.dtinicial.focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!ValidaDt(formulario.name,'dtinicial','Data Inicial')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (formulario.dtfinal.value == '')\r\n\t\t{\r\n\t\t\talert('O Campo \"Data Final\" deve ser preenchido.');\r\n\t\t\tformulario.dtfinal.focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!ValidaDt(formulario.name,'dtfinal','Data Final')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tformulario.action = window.location.href;\r\n\t\tformulario.submit();\r\n}", "function getRequestFilter() {\n var rf = new doEstadisticas();\n\n rf.Desde = parseInt($('#selAnoIni').val()) * 100 + parseInt($('#selMesIni').val());\n rf.Hasta = parseInt($('#selAnoFin').val()) * 100 + parseInt($('#selMesFin').val());\n\n $visible = $('.fk-ocultar').not('.hide');\n\n if (origen == \"ADM\" || origen ==\"EVA\") {//ADM: El idficepi es el atributo del textbox, la fecha de antigüedad se obtiene del datepicker y la foto del combo\n rf.t001_idficepi = $visible.find('input#evaluador').attr('idficepi');\n\n var sfecha = $visible.find('input#txtFantiguedad').val();\n var sd = sfecha.substring(0, 2);\n var sm = sfecha.substring(3, 5);\n var sa = sfecha.substring(6, 10);\n\n var fAntiguedad = new Date(sa, sm - 1, sd); \n\n rf.t001_fecantigu = fAntiguedad;\n\n rf.t932_idfoto = $(cboSituacion).val();\n }\n else {//EV: El idficepi es la vble de sesíón del ficepi conectado, la fecha de antigüedad se obtiene a partir del combo, y, como foto, la situación actual\n rf.t001_idficepi = idficepi;\n var fAntiguedad = new Date();\n fAntiguedad.setFullYear(fAntiguedad.getFullYear() - $(cboAntRef).val());\n \n rf.t001_fecantigu = fAntiguedad;\n rf.t932_idfoto = null; \n }\n\n //Como nivel de profundización, el valor del combo\n rf.Profundidad = $(cboProfundizacion).val();\n rf.t941_idcolectivo = $(cboColectivo).val();\n\n return rf;\n}", "function filtros1(){\n\t\n\t\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#empleados tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}", "function ResumenOrden()\r\n\t{\r\n\t var buffer = '';\r\n\t \r\n\t if (_orden.length == 0)\r\n\t {\r\n\t \t$(\"#search\").focus();\r\n\t }\r\n\t \r\n\t buffer += '<h1 class=\"titulo_resumen\">Resumen de la orden</h1>';\r\n\t \r\n\t \r\n\t buffer += '<table class=\"table\" id=\"seleccion_producto\">';\r\n\t var contadorMonto=0;\r\n\t var SimboloMoneda = $(\"#Moneda\").val();\r\n\t _total_adicionales=0;\r\n\t for (x in _orden)\r\n\t {\r\n\t \t\r\n\t var adicionales = '';\r\n\t if (_orden[x].adicionales.length > 0) {\r\n\t \t\r\n\t adicionales += '<b>Agregar:</b>';\r\n\t \r\n\t adicionales += '<ul>';\t \r\n\t for (y in _orden[x].adicionales) {\r\n\t \t\r\n\t \tadicionales += \"<li>\" + _orden[x].adicionales[y].item + \" \"+SimboloMoneda +\" \"+ _orden[x].adicionales[y].precio+\"</li>\";\r\n\t \t_total_adicionales += parseFloat(_orden[x].adicionales[y].precio);\r\n\t }\t \r\n\t adicionales += '</ul>';\r\n\r\n\t }\r\n\t \r\n\t var quitar = '';\t \r\n\t if (_orden[x].ingredientes.length > 0) {\r\n\t quitar += '<b>Quitar:</b>';\r\n\t quitar += '<ul>';\r\n\t \r\n\t for (y in _orden[x].ingredientes) {\r\n\t quitar += '<li>' + _orden[x].ingredientes[y].nombre_m + '</li>';\r\n\t }\t \r\n\t quitar += '</ul>';\t \r\n\t }\r\n\r\n\t var nota = '';\t \r\n\t if (_orden[x].llevar.abc==\"1\") {\t \t\r\n\t nota += '<b>Nota:</b>';\r\n\t nota += '<ul>';\r\n\t \r\n\t for (y in _orden[x].llevar) {\r\n\t nota += '<li>Para Llevar</li>';\r\n\t }\t \r\n\t nota += '</ul>';\t \r\n\t }\r\n\t \r\n\t contadorMonto += parseFloat(_orden[x].precio);\r\n\t buffer += '<tr ID_orden=\"' + x + '\">';\r\n\t buffer += '<td>' + (parseInt(x)+1) + '</td>';\r\n\t buffer += '<td><div style=\"color:blue;font-weight:bold;\">' + _orden[x].detalle + '</div><div>' + adicionales + '</div><div>' + quitar + nota+ '</div></td>';\r\n\t buffer += '<td>' +SimboloMoneda +' '+ _orden[x].precio + '</td>';\r\n\t buffer += '<td><button class=\"btn_eliminar_pedido\">Eliminar</button></td>';\r\n\t buffer += '</tr>';\r\n\t \r\n\t }\t \r\n\t buffer += '<tr><td>#</td><td></td><td>Total = '+ SimboloMoneda+' '+ (contadorMonto+_total_adicionales)+'</td><td></td></tr>';\r\n\t buffer += '</table>';\r\n\t \r\n\t \r\n\t //_orden[x].precio;\r\n\r\n\t if($(\"#resumen\").html() != \"\"){\r\n\t \t$(\"#scroller\").show();\r\n\t \t$(\"#resumen\").empty();\r\n\t }else{\r\n\t \t$(\"#resumen\").html(buffer);\r\n\t \t$(\"#scroller\").hide();\r\n\t }\t \r\n\t}", "function listarTodosFiltroAprendiz(){\r\n\t\r\n\tvar identificacionFiltro = $(\"#txtIdentificacionAprendizFiltro\").val();\r\n\tvar nombreCompletoFiltro = $.trim($(\"#txtNombreCompletoAprendizFiltro\").val());\r\n\tvar idFichaFiltro = $(\"#selectFichaAprendizFiltro\").val();\r\n\tvar idDetalleEstadoFiltro = $(\"#selectDetalleEstadoAprendizFiltro\").val();\r\n\t\r\n\t\r\n\tlistarTodosAprendizGenerico(\"listarTodosFiltro?identificacion=\"+identificacionFiltro+\"&nombreCompleto=\"+nombreCompletoFiltro+\"&idFicha=\"+idFichaFiltro+\"&idDetalleEstado=\"+idDetalleEstadoFiltro);\t\t\t\t\r\n}", "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function filtros(){\n\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#supernumerario tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\tif(recibe.length>0 && detector=='estado'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.estado\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\treturn false;\n}", "function fnFormatDetails(nTr) {\n var aData = uoTable.fnGetData(nTr);\n\n var oFormObject = document.forms['drugregimenname'];\n\n oFormObject.elements[\"regimennamename\"].value = aData[3];\n oFormObject.elements[\"regimennameedit\"].value = 'true';\n oFormObject.elements[\"regimennameuuid\"].value = aData[2];\n\n\n}", "function gridFormata(celula,formato, grid, coluna){\n\n\tcelula.val = celula.getValue();\n\tcelula.obj = document.createElement(\"input\");\n\tcelula.obj.id = \"celulaEditada\";\n\tcelula.obj.style.width = \"100%\";\n\tcelula.obj.style.height = (celula.cell.offsetHeight-4)+\"px\";\n\tcelula.obj.style.border = \"0px\";\n\tcelula.obj.style.margin = \"0px\";\n\tcelula.obj.style.padding = \"0px\";\n\tcelula.obj.style.overflow = \"hidden\";\n\tcelula.obj.style.fontSize = \"12px\";\n\tcelula.obj.style.fontFamily = \"Arial\";\n\tcelula.obj.style.textAlign = celula.cell.align;\n\tcelula.obj.className = formato;\n\tcelula.obj.value = celula.val\n\tcelula.cell.innerHTML = \"\";\n\tcelula.cell.appendChild(celula.obj);\n\tformata(celula.obj, grid, coluna);\n\t\n\tcelula.obj.setAttribute(\"timer\",setTimeout(function(){funcSetaFoco(celula.obj);},100));\n}", "function getIdBusquedaCaracteristicas(){\n\tvar tipo_formulario = jQuery('#tipoFormulario_hidden').val();\n\t\n\tvar param={};\n\tif (tipo_formulario==derecho_comercial){\n\t\tparam = {\n\t\t\t\tidDerechoComercial: jQuery(\"#idDerecho\").val()\n\t\t};\n\t} else if (tipo_formulario==derecho_cpi || \n\t\t\t tipo_formulario == derecho_trn || \n\t\t\t tipo_formulario == derecho_dis || \n\t\t\t tipo_formulario == derecho_int){\n\t\tparam = {\n\t\t\t\tidCaracteristica: jQuery(\"#idCaracteristica\").val()\n\t\t};\n\t} else if (tipo_formulario == plantillas){\n\t\tparam = {\n\t\t\t\tidPlantillaDerecho: jQuery(\"#idPlantillaDerecho\").val()\n\t\t};\n\t}\n\treturn param;\n}", "function mostrarXsumir(valor){\n // Dentista-Tratamento\n document.formFuncionario.croTratamento.value = \"\";\n document.formFuncionario.especialidadeTratamento.value = \"\";\n document.formFuncionario.comissaoTratamento.value = \"\";\n // Dentista-Orcamento\n document.formFuncionario.croOrcamento.value = \"\";\n document.formFuncionario.especialidadeOrcamento.value = \"\";\n document.formFuncionario.comissaoOrcamento.value = \"\";\n // Dentista-Orcamento-Tratamento\n document.formFuncionario.croOrcamentoTratamento.value = \"\";\n document.formFuncionario.especialidadeOrcamentoTratamento.value = \"\";\n document.formFuncionario.comissaoOrcamentoTratamento.value = \"\";\n document.formFuncionario.comissaoTratamentoOrcamento.value = \"\";\n if (valor == 'Dentista-Tratamento') {\n var abreDiv = document.getElementById('infoAddDentistaOrcamento');\n abreDiv.style.display = 'none';\n var abreDiv2 = document.getElementById('infoAddDentistaTratamento');\n abreDiv2.style.display = 'block';\n var abreDiv3 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv3.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = true;\n }\n else {\n if (valor == 'Dentista-Orcamento') {\n var abreDiv4 = document.getElementById('infoAddDentistaTratamento');\n abreDiv4.style.display = 'none';\n var abreDiv5 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv5.style.display = 'block';\n var abreDiv6 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv6.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = true;\n }\n else {\n if (valor == 'Dentista-Orcamento-Tratamento') {\n var abreDiv7 = document.getElementById('infoAddDentistaTratamento');\n abreDiv7.style.display = 'none';\n var abreDiv8 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv8.style.display = 'none';\n var abreDiv9 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv9.style.display = 'block';\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = false;\n }\n else {\n var abreDiv10 = document.getElementById('infoAddDentistaTratamento');\n abreDiv10.style.display = 'none';\n var abreDiv11 = document.getElementById('infoAddDentistaOrcamento');\n abreDiv11.style.display = 'none';\n var abreDiv12 = document.getElementById('infoAddDentistaOrcamentoTratamento');\n abreDiv12.style.display = 'none';\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaTratamento.disabled = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.disabled = true;\n }\n }\n }\n}", "function armarPeticion( t_strSearch, t_strTipo ) {\n return `localhost/consultarProductos?${t_strTipo}=${t_strSearch}`;\n}", "function tabla_funciones() {\n\n var nota = \"<a style=\\\"color: #fff;\\\" href=\\\"javascript:void(muestrafigura({file:'TEOS10notation',label:'Notation',ancho:'75%'}))\\\">Notation</a>\";\n\t\r\n var html = \"<table id=\\\"TABLA\\\" border=\\\"1px\\\" style=\\\"width:100%;font-size:90%;\\\">\\n\";\r\n\t\r\n for (var i=0; i < sect.length; i++) {\r\n\t html +=\"<tr><td class=\\\"b\\\" colspan=\\\"2\\\" style=\\\"padding-left:1ex;padding-right:2ex;background: #555; color:#fff;\\\">\" + sect[i] + \"<span style=\\\"float:right;\\\">\" + nota+\" </span></td></tr>\\n\";\r\n\t\tfor (var j=0; j < sectfunc[i].functions.length; j++) {\r\n\t\tvar ids =\"in_\" + j;\r\n\t\tvar boton = \"<input type=\\\"submit\\\" value=\\\" COMPUTE \\\" onclick=\\\"res=TEOS10.\" + sectfunc[i].functions[j] + \"(parametros);alert(res)\\\"> \";\r\n\t\t html += \"<td style=\\\"vertical-align:middle;padding-left:1ex;\\\">\" + boton + \"<a href=\\\"javascript:void(helprutine({tipo:'\"+sectfunc[i].functions[j]+\"',label:'cabecera', file:'TEOS10help',section:\"+i+\"}))\" + \"\\\">\" + sectfunc[i].funcdesc[j] + \"</a></td><td>\";\r\n\t\t var cadena = \"$('#\"+ids+\"_\"+sectfunc[i].funcpara[j][0]+\"').val()\";\r\n\t\t var cadenahelp = \"<span class=\\\\'azul\\\\'>\" + sectfunc[i].functions[j] + \"</span> (<span class=\\\\'ora\\\\'>\" + sectfunc[i].funcpara[j][0];\r\n\t\t for (var k=1; k < sectfunc[i].funcpara[j].length; k++) {\r\n\t\t cadena += \",\" + \"$('#\"+ids+\"_\" + sectfunc[i].funcpara[j][k] + \"').val()\";\r\n\t\t cadenahelp += \", \" + sectfunc[i].funcpara[j][k];\r\n\t\t }\r\n\t\t cadenahelp += \"</span>)\";\r\n\t\t html = html.replace('cabecera',cadenahelp);\r\n\t\t html = html.replace('parametros',cadena);\r\n\t\t for (var k=0; k < sectfunc[i].funcpara[j].length; k++) {\r\n\t\t if (sectfunc[i].functions[j] == \"gsw_gibbs\" && ( k==0 || k==1 || k==2 ) ) {\r\n\t\t html += sectfunc[i].funcpara[j][k] +\r\n\t\t\t \"<input type=\\\"text\\\" size=\\\"2\\\" id=\\\"\" + ids + \"_\" + sectfunc[i].funcpara[j][k] + \"\\\"> \";\r\n\t\t } else\r\n\t\t html += sectfunc[i].funcparat[j][k] +\r\n\t\t\t \"<input type=\\\"text\\\" size=\\\"8\\\" id=\\\"\" + ids + \"_\" + sectfunc[i].funcpara[j][k] + \"\\\"> \";\r\n\t\t }\r\n\t\t html +=\"</td></tr>\\n\";\r\n\t\t}\t\r\n\t}\r\n\thtml +='</table>\\n';\r\n\n document.write(html);\n\n}", "function condiçaoVitoria(){}", "function mostrarDatosProducto(producto){\n let transaccion = obtenerTransaccionInicial(producto.getCodigo());\n let datosProducto = [obtenerInputsIdsProducto(),producto.fieldsToArray()];\n let datosTransaccion = [obtenerInputsIdsTransaccion(),transaccion.fieldsToArray()];\n fillFields(datosProducto);\n fillFields(datosTransaccion);\n htmlValue('inputEditar', 'EDICION');\n htmlDisable('txtCodigo');\n htmlDisable('btnAgregarNuevo', false);\n}", "function testaTecla(e, campo){\r\n var linhas = get('GRID1').childNodes[1].getElementsByTagName('tr');\r\n\r\n var tela = '';\r\n if (location.href.indexOf(\"hwpp111\") > 0)\r\n tela = 'tar';\r\n else if (location.href.indexOf(\"hwpp112\") > 0)\r\n tela = 'prj';\r\n \r\n //Se for o número do projeto\r\n if (campo.id == 'GMS_filtro_proj'){\r\n GM_setValue(\"GMS_filtro_\"+tela+\"_proj\", campo.value);\r\n GM_setValue(\"GMS_filtro_\"+tela+\"_obj\", '');\r\n get('GMS_filtro_obj').value = '';\r\n //Se for a descrição da Tarefa\r\n }else if(campo.id == 'GMS_filtro_obj'){\r\n GM_setValue(\"GMS_filtro_\"+tela+\"_proj\", '');\r\n GM_setValue(\"GMS_filtro_\"+tela+\"_obj\", campo.value);\r\n get('GMS_filtro_proj').value = '';\r\n }else if(campo.id == 'GMS_filtro_tempo'){\r\n GM_setValue(\"GMS_filtro_tmp\", campo.selectedIndex);\r\n if (get('GMS_filtro_obj').value != '')\r\n campo = get('GMS_filtro_obj');\r\n else if (get('GMS_filtro_proj').value != '')\r\n campo = get('GMS_filtro_proj');\r\n else\r\n campo = get('GMS_filtro_proj');\r\n }\r\n\r\n for (var i = 1; i < linhas.length; i++) {\r\n var nome = '';\r\n\r\n //Se for o número do projeto\r\n if (campo.id == 'GMS_filtro_proj'){\r\n nome ='span__PRJTELA_'+('000'+i).slice(-4);\r\n //Se for a descrição da Tarefa/projeto\r\n }else if(campo.id == 'GMS_filtro_obj'){\r\n if (tela == 'tar')\r\n nome ='span__DSCTAREFA_'+('000'+i).slice(-4);\r\n else if (tela == 'prj')\r\n nome ='span__PRJDESC_'+('000'+i).slice(-4);\r\n }\r\n\r\n //busca o valor do campo\r\n var valor = get(nome).firstChild.firstChild.innerHTML;\r\n if (!valor){\r\n valor = get(nome).firstChild.innerHTML;\r\n }\r\n\r\n //faz a validação de tarefas com tempo\r\n var tempo = true;\r\n if (tela == 'tar'){\r\n if (get('GMS_filtro_tempo').selectedIndex != 2)\r\n tempo = false;\r\n }\r\n\r\n //faz a validação de projetos que não devem ser exibidos\r\n var proj = true;\r\n if ((tela == 'prj')&&(GM_getValue(\"GMS_filtro_nproj\", '').length>0)){\r\n nome = 'span__PRJTELA_'+('000'+i).slice(-4);\r\n var aux = get(nome).firstChild.firstChild.innerHTML;\r\n if (!aux){\r\n aux = get(nome).firstChild.innerHTML;\r\n }\r\n //alert(aux);\r\n var nproj = ','+GM_getValue(\"GMS_filtro_nproj\", '').toUpperCase()+',';\r\n \r\n if (nproj.indexOf(','+aux.toUpperCase()+',') >= 0)\r\n tempo = false;\r\n }\r\n\r\n //mostra ou não os registros da tabela\r\n if (((valor.toUpperCase().indexOf(campo.value.toUpperCase()) >= 0)||(campo.value == '')) && tempo && proj)\r\n linhas[i].style.display = '';\r\n else\r\n linhas[i].style.display = 'none';\r\n }\r\n}", "function filtrer_type() {\n\n\tfiltre_type = $(this).html();\n\trafraichirTable( 0 );\n}", "function consultaAperturaYCorteDelDia(fecha){\n // debugger;\n \t\tvar datos = {\n \t\t\t\tfecha : fecha,\n \t\t }\n \t\t$.ajax({\n url: base_url+'Cajero/CorteCaja/consultarApertura',\n type: \"post\",\n dataType: \"json\",\n \t\t\tdata : (datos),\n \t\t\tsuccess : function(response){\n $(\"#tbl_consultaCortesDelDia\").DataTable({\n data: response,\n responsive: true,\n columns: [\n {\n data: \"monto\",\n \"className\": \"text-center\",\n // \"visible\": false, // ocultar la columna\n render: function(data, type, row, meta) {\n var hayApertura = `${row.monto}`;\n var idApertura = `${row.id_apertura}`;\n if (hayApertura == 'null'){\n var a = '<div text-white\">'+'No hay apertura'+'</div>';\n $(\"#id_ventas\").val(\"No hay apertura\");\n }else {\n $(\"#id_apertura\").val(idApertura);\n $(\"#monto_apertura\").val(hayApertura);\n var a = '<div text-white\">'+hayApertura+'</div>';\n }\n return a;\n },\n },\n {\n data: \"monto_entregado\",\n \"className\": \"text-center\",\n },\n {\n data: \"gastos\",\n \"className\": \"text-center\",\n },\n {\n data: \"ventas\",\n // \"visible\": false, // ocultar la columna\n },\n {\n data: \"diferencia\",\n \"className\": \"text-center\",\n },\n {\n data: \"fecha\",\n \"className\": \"text-center\",\n },\n {\n data: \"usuario\",\n \"className\": \"text-center\",\n },\n\n ],\n \"language\" : language_espaniol,\n });\n \t\t\t }\n \t\t});\n }", "function setValor(nombreDelCampo,valorDelCampo)\r\n{\r\n\t//\tSi esta siendo ejecutado para la fila de una tabla\r\n\tif(_bnEjecuntandoFuncionPorFilas_ESt)\r\n\t{\r\n\t\t//\tPasa el objeto del campo a una variable\r\n\t\tvar objetoCampo_ESt=_oTablaActual_ESt.objetoCampoTablaNoFilaNombCol[_filaActual_ESt][nombreDelCampo];\r\n\t\t//\tMira que objeto es\r\n\t\tswitch(objetoCampo_ESt.campo_ESt.queSon)\r\n\t\t{\r\n\t\t\tcase 'texto':\r\n\t\t\t\t//\tGuardamos el nuevo valor real\r\n\t\t\t\tobjetoCampo_ESt.valorReal=valorDelCampo;\r\n\t\t\t\t//\tColocamos lo que debe verse\r\n\t\t\t\tobjetoCampo_ESt.innerHTML=mascaraInput_ESt(objetoCampo_ESt.campo_ESt.tipo,valorDelCampo);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'input':\r\n\t\t\tcase 'select':\r\n\t\t\t\t//\tGuardamos el nuevo valor real\r\n\t\t\t\tobjetoCampo_ESt.valorReal=valorDelCampo;\r\n\t\t\t\t//\tColocamos lo que debe veres\r\n\t\t\t\tobjetoCampo_ESt.value=mascaraInput_ESt(objetoCampo_ESt.campo_ESt.tipo,valorDelCampo);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tobjetoCampo_ESt.value=valorDelCampo;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//\tDevuelve el valor que hay\r\n\t\treturn document.getElementById(nombreDelCampo).value=valorDelCampo;\r\n\t}\r\n}", "function melhorEco(dados) {\n return dados;\n}", "function limparOrigem(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\r\n\t\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //De localidade pra baixo\r\n\r\n\t\t\tform.nomeLocalidadeOrigem.value = \"\";\r\n\t\t\tform.localidadeDestinoID.value = \"\";\r\n\t\t\tform.nomeLocalidadeDestino.value = \"\";\r\n\t\t\tform.setorComercialOrigemCD.value = \"\";\r\n\t\t form.setorComercialOrigemID.value = \"\";\r\n\t\t\thabilitaSQlS();\r\n\t\t\t\r\n\t\tcase 2: //De setor para baixo\r\n\r\n\t\t form.nomeSetorComercialOrigem.value = \"\";\r\n\t\t form.setorComercialDestinoCD.value = \"\";\r\n\t\t form.setorComercialDestinoID.value = \"\";\t\t \r\n\t\t form.nomeSetorComercialDestino.value = \"\";\r\n\t\t form.quadraOrigemNM.value = \"\";\r\n\t\t form.quadraOrigemID.value = \"\";\r\n///\t\t alert(\"limpar origem 2\");\r\n\t\tcase 3://De quadra pra baixo\r\n\r\n\t\t form.quadraDestinoNM.value = \"\";\r\n\t\t form.quadraDestinoID.value = \"\";\r\n \r\n\t\t form.loteDestino.value = \"\";\r\n\t\t form.loteOrigem.value = \"\";\r\n\t\t \r\n\t\t limparMsgQuadraInexistente();\t\t \r\n\t}\r\n}", "function fplatosParaEventoConOcasion(){\n\tconsole.log(\"Llega a query seis\");\n\tvar inputA = $(\"#plato6a\").val();\n\tvar inputB = $(\"#plato6b\").val();\n\tif(inputA != \"\" && inputB != \"\"){\n\t\tvar datos = {\n\t\t\t\"event\": \"%\"+inputA+\"%\",\n\t\t\t\"occasion\": \"%\"+inputB+\"%\"\n\t\t};\n\t\t$.post(\"platos-para-evento-con-ocasion\",datos,function(data){\n\t\t\tconsole.log(data);\n\t\t\tvar builder = \"<tr> <th> Numero </th> <th>Platos</th> </tr>\";\n\t\t\tfor(var i=0; i<data.length; i++){\n\t\t\t\tbuilder += \"<tr> <th> #\" + (i+1) + \"</th> <td>\" +data[i].name+\"</td> </tr>\";\n\t\t\t}\n\t\t\t$(\"#my-table6\").html(builder);\n\t\t});\n\t}\n\telse{\n\t\tconsole.log(\"Input no valido :v\")\n\t\t$(\"#my-table6\").html(\"\");\n\t}\n}", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "function consultar() {\r\n let consulta = lista.querySelector(\"#buscar\").value;\r\n consultarpokemon(consulta);\r\n form.reset();\r\n}", "function filtros3(){\n\t\n\t\n\tvar recibe=$(this).val();\t\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#admin tr').show();\n\t\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='area'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.area\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='super'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.super\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='baja'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.baja\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='inicio'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.inicio\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='fin'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.fin\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='jefe'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.jefe\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}", "function UpdateTratamientos(idt,tra){\n\tif(idt!=null){\n\t\tif(tra!='Seleccionar'){\n\t\t\tActualizarTratamiento(idt,tra)\n\t\t}else{\n\t\t\tEliminarTratamiento(idt)\n\t\t}\n\t}else{\n\t\tif(tra!='Seleccionar'){\n\t\t\tidcon=$('#idconsulta').val()\n\t\t\tAgregarTratamiento(tra,idcon)\n\t\t}\n\t}\n}", "function calGuiasPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('calGuiasListLayer', 'O');\n\t\tvisibilidad('calGuiasListButtonsLayer', 'O');\n\t\tif(get('calGuiasFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los par?metros de la ?ltima busqueda. (en la variable javascript)\n\tcalGuiasLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripci?n en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminaci?n)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:calGuiasViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, calGuiasChoiceColumn) + \"</A>\",\n\t\t\ti, calGuiasChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger s?lo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tcalGuiasList.setDatos(datosTmp.filtrar([0,1,2,3,4,5,6],'*'));\n\t\n\t//La ?ltima fila de datos representa a los timestamps que debemos guardarlos\n\tcalGuiasTimeStamps = datosTmp.filtrar([7],'*');\n\t\n\t//SI hay mas paginas reigistramos que es as? e eliminamos el ?ltimo registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tcalGuiasMorePagesFlag = true;\n\t\tcalGuiasList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tcalGuiasMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el bot?n de borrar si estamos en la acci?n\n\tif(get('calGuiasFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('calGuiasListLayer', 'V');\n\tvisibilidad('calGuiasListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('calGuiasList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tcalGuiasList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(calGuiasMorePagesFlag){\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(calGuiasPageCount > 1){\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "function trazilicaData() {\n // Zove ajax i funkcije za filtriranje\n if (osoba == \"Učenik\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterRazredi(data, dataL);\n } else if (osoba == \"Profesor\") {\n if (smjena == \"A/B\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesorAB(data);\n } else {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesor(data, dataL);\n }\n }\n }", "function getInputData(operacao) {\r\n\r\n\t\t\t\t\t\tvar descModelo = $('#tf_Descricao').val();\r\n\t\t\t\t\t\t// alert(nomeEstado);\r\n\r\n\t\t\t\t\t\t// Pega O Valor Do Option Sigla\r\n\t\t\t\t\t\t// var idEstado = $('#slc_Estado').attr('selected',\r\n\t\t\t\t\t\t// true).val();\r\n\r\n\t\t\t\t\t\tvar idMarca = $('#slc_Marca').children(\r\n\t\t\t\t\t\t\t\t\"option:selected\").val();\r\n\r\n\t\t\t\t\t\tvar idTipoV = $('#slc_TipoVeiculo').children(\r\n\t\t\t\t\t\t\t\t\"option:selected\").val();\r\n\r\n\t\t\t\t\t\t// Pega O Valor Do Option Status Selecionado\r\n\t\t\t\t\t\tvar statusModelo = $('#slc_Status').attr('selected',\r\n\t\t\t\t\t\t\t\ttrue).val();\r\n\t\t\t\t\t\t// alert(statusEstado);\r\n\r\n\t\t\t\t\t\tif (operacao == \"update\") {\r\n\t\t\t\t\t\t\tvar idModelo = $('#tf_Id').val();\r\n\r\n\t\t\t\t\t\t\tvar modelo = {\r\n\t\t\t\t\t\t\t\t\"idModelo\" : idModelo,\r\n\t\t\t\t\t\t\t\t\"descModelo\" : descModelo,\r\n\t\t\t\t\t\t\t\t\"idMarca\" : idMarca,\r\n\t\t\t\t\t\t\t\t\"idTipoV\" : idTipoV,\r\n\t\t\t\t\t\t\t\t\"statusModelo\" : statusModelo\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t} else if (operacao == \"insert\") {\r\n\t\t\t\t\t\t\tvar modelo = {\r\n\t\t\t\t\t\t\t\t\"descModelo\" : descModelo,\r\n\t\t\t\t\t\t\t\t\"idMarca\" : idMarca,\r\n\t\t\t\t\t\t\t\t\"idTipoV\" : idTipoV,\r\n\t\t\t\t\t\t\t\t\"statusModelo\" : statusModelo\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// console.log(estado.idEstado);\r\n\t\t\t\t\t\treturn modelo;\r\n\t\t\t\t\t}", "function consultar_trj() {\n\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\ttry {\n\t\t\tdocument.getElementsByClassName('lista_vendedores')[1].removeAttribute('selected', '')\n\t\t} catch (error) {\n\t\t}\n\t}\n\tvar envio = { numero: valor('numero_consulta') }\n\tcargando()\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-tarjetas/consultar-numero\",\n\t\tdata: envio\n\t}).done((respuesta) => {\n\t\tif (respuesta == 'Nada') {\n\t\t\t$('#div-error').html('Esta tarjeta no existe, o no ha sido vendida, individualmente sólo pueden modificarse tarjetas vendidas')\n\t\t\tdocument.getElementById('div-error').style.display = 'block'\n\t\t\tno_cargando()\n\t\t\treturn\n\t\t}\n\t\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\t\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\t\tif (opciones_vend[i].value == respuesta[0].vendedor) {\n\t\t\t\topciones_vend[i].setAttribute('selected', '')\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('div-error').style.display = 'none'\n\t\tasignar('mod_tar_num', respuesta[0].numero)\n\t\tasignar('mod_tar_inic', ordenarFechas(respuesta[0].fechainicial))\n\t\tasignar('mod_tar_fin', ordenarFechas(respuesta[0].fechafinal))\n\t\tvar cadena = '';\n\t\tfor (var i = 0; i < respuesta[0].locales.length; i++) {\n\t\t\ttry {\n\t\t\t\tcadena += `<div class=\"row fondo-blanco este-es-local\" style=\" width:100%\" id=\"${respuesta[1][i].codigo}\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-3 col-md-4\">\n\t\t\t\t\t\t\t\t<label>Local</label>\n\t\t\t\t\t\t\t\t<img width=\"100%\" src=\"${respuesta[1][i].logotipo}\"/>\n\t\t\t\t\t\t\t\t<h5 class=\"centrado\">${respuesta[1][i].nombre}</h5>\n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t<div class=\"col-lg-9 col-md-8\">\n\t\t\t\t\t\t\t\t<div class=\"table\">\n\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered\"><tr> <th>Beneficio</th><th colspan=\"2\">Estado</th></tr>`\n\t\t\t\tfor (var j = 0; j < respuesta[0].locales[i].beneficio.length; j++) {\n\t\t\t\t\tvar estado_benef = verificar_benef(respuesta[0].locales[i].beneficio[j].activo)\n\t\t\t\t\tcadena += `<tr>\n\t\t\t\t\t\t\t\t<td><textarea class=\"area-beneficios\" readonly style=\"width:100%; height:140px; border: solid 0px white\" resizable=\"none\">${ascii_texto(respuesta[0].locales[i].beneficio[j].beneficio)}\n\t\t\t\t\t\t\t\t</textarea></td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label><input value=\"1\" onchange=\"conSeleccion(this)\" class=\"benef_escog\" name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" ${estado_benef[0]} type=\"radio\"/> Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<label><input value=\"0\" onchange=\"sinSeleccion(this)\" class=\"benef_escog\" ${estado_benef[1]} name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" type=\"radio\"/> No Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t\tcadena += `</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`\n\t\t\t} catch (error) {\n\t\t\t\tcadena += ''\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('loc_mod_tar').innerHTML = cadena\n\t\tdocument.getElementById('edicion_individual').style.display = 'block'\n\t\tdocument.getElementById('consulta_edicion').style.display = 'none'\n\t\tasignar('numero_consulta', '')\n\t\tno_cargando()\n\t})\n}", "function cargardatos(id){\n $('#'+id+' td.id').each(function() {\n var id = $(this).text();\n $(\"#inputid\").val(id);\n });\n $('#'+id+' td.nombre').each(function() {\n var nombre = $(this).text();\n $(\"#inputnombre\").val(nombre);\n });\n $('#'+id+' td.descripcion').each(function() {\n var desc = $(this).text();\n $(\"#inputdescripcion\").val(desc);\n });\n $('#'+id+' td.precio').each(function() {\n var pre = $(this).text();\n $(\"#inputprecio\").val(pre);\n });\n $(\"#btninsert\").val(\"Modificar\");\n}", "function selecao(selecionado){\n if(selecionado != 'null'){\n renderAllPatrimonios()\n }\n \n}", "function limpiar() {\n document.getElementById('taConsulta').style.backgroundColor = \"#FFF\";\n document.getElementById('divEjecutaCMD').style.display = 'none';\n document.getElementById('divEjecutaSQL').style.display = 'block';\n document.getElementById('taConsulta').style.color = \"#000\";\n document.getElementById('taConsulta').value = '';\n document.getElementById('resultadoConsulta').innerHTML = '';\n //document.getElementById('msjVentana').innerHTML = '';\n paquete_global = '';\n}", "function parametros_infogps() {\n\n var veh_sel = document.getElementById(\"splaca\").value; // placa, numero interno, capacidad \n var fecha_ini = document.getElementById(\"fechaInicio\").value;\n var fecha_fin = document.getElementById(\"fechaFinal\").value;\n\n var filtros = document.getElementById(\"sfiltro\");\n\n // Coordinar indices con componente select sfiltro\n var verPuntoControl = (filtros.options[1].selected) ? 1 : 0;\n var verPasajero = (filtros.options[2].selected) ? 1 : 0;\n var verAlarma = (filtros.options[3].selected) ? 1 : 0;\n var verConsolidado = (filtros.options[4].selected) ? 1 : 0;\n var verOtros = (filtros.options[5].selected) ? 1 : 0;\n \n var fechaPredeterminada = 0;\n var sfecha = document.getElementById(\"sfecha\");\n if (sfecha != null) {\n fechaPredeterminada = sfecha.value;\n } \n\n var placa = \"\";\n\n if (veh_sel.indexOf(\",\") > 0) {\n placa = veh_sel.split(\",\")[0];\n }\n\n var infogps = new Object();\n infogps.placa = placa;\n infogps.fechaInicio = fecha_ini;\n infogps.fechaFinal = fecha_fin;\n infogps.verPuntoControl = verPuntoControl;\n infogps.verPasajero = verPasajero;\n infogps.verAlarma = verAlarma;\n infogps.verConsolidado = verConsolidado;\n infogps.verOtros = verOtros;\n infogps.fechaPredeterminada = fechaPredeterminada;\n\n return infogps;\n}", "function cargarEditar(posicion){\n\n document.getElementById('cedula').value= returnArr[posicion].cedula;\n document.getElementById('apellido').value= returnArr[posicion].apellido;\n document.getElementById('email').value= returnArr[posicion].email;\n document.getElementById('nombre').value= returnArr[posicion].nombre;\n document.getElementById('telefono').value= returnArr[posicion].telefono;\n document.getElementById('key_empleado').value= returnArr[posicion].key;\n\n mostrarExistente();\n}", "function agregarComentario(id_miembro){\n\n\n res= document.getElementById(\"comentar\").value; //Se toma a traves del id, el comentario realizado(valor).\n document.getElementById(\"mostrarComentario\").innerHTML+= res + \"<br>\"; //Hace visible el comentario relizado.\n\tres= document.getElementById(\"comentar\").value= \"\";//Despues que se genera el click vuelve al valor original.\n}", "function seleccionarFilaArticulo(articulo) {\n\n $(\"#modificar-comisiones\").show(); //Muestra el div para modificar articulo\n var table = document.getElementById(\"tablee-mostrar-articulos\");\n for (var i = 1; i < table.rows.length; i++) {\n table.rows[i].style.backgroundColor = 'rgb(245,245,246)';\n }\n var $row = $(\"#modificar-\" + articulo);\n $row.css({'background-color': '#c7ecee'}); //Cambia el color del row seleccionado\n //Agrega los valores al formulario de modificar\n $(\"#modificar-articulo\").val($row.children('td:eq(0)').text());\n $(\"#modificar-precio\").val($row.children('td:eq(1)').text());\n $(\"#modificar-costo\").val($row.children('td:eq(2)').text());\n $(\"#modificar-comision\").val($row.children('td:eq(3)').text());\n $(\"#modificar-objetivo\").val($row.children('td:eq(4)').text());\n\n\n}", "function FiltrosParaReporte(arreglo) {\n var text = \"\";\n //debugger;\n if (Array.isArray(arreglo)) {\n text += '<p style=\"text-align: left; \">'\n $.each(arreglo, function (key, item) {\n //debugger;\n if (item.prop.is(\"input\")) {\n if (item.prop.val() !== '') {\n text += '<strong>'+item.Nombre+'</strong>: ' + item.prop.val() + ' ';\n }\n } else if (item.prop.is('option')) {\n if (item.prop.val() !== '' && item.prop.val().toLowerCase() !== 'null'\n && item.prop.val() !== null) {\n text += '<strong>' + item.Nombre + '</strong>: ' + item.prop.text() + ' ';\n }\n }\n })\n }\n\n text += ' </p>';\n return text;\n}", "async parametroFormasPagamento(req, res) {\n\n const parametroFormaPagamento = await db.query(\"SELECT cod_parametro_forma_pagamento, descricao FROM parametro_forma_pagamento WHERE status = 0\");\n return res.json(parametroFormaPagamento.rows)\n\n }", "function RecuperaFilaCuentas(idfila) {\n var idfilac = $('#sele_asc').val();\n var elTableRow = document.getElementById(idfila);\n var elTableRow1 = document.getElementById(idfilac);\n elTableRow.style.backgroundColor = (elTableRow.style.backgroundColor === \"LightSkyBlue\") ? 'white' : 'LightSkyBlue';\n if (idfilac !== idfila) {\n elTableRow1.style.backgroundColor = (elTableRow.style.backgroundColor === \"white\") ? 'LightSkyBlue' : 'white';\n }\n var elTableCells = elTableRow.getElementsByTagName(\"td\");\n for (var i = 0; i < elTableCells.length; i++) {\n document.getElementById(\"txt_nrocuenta\").value = elTableCells[1].innerHTML;\n document.getElementById(\"txt_bancos\").value = elTableCells[2].innerHTML;\n document.getElementById(\"sele_asc\").value = idfila;\n }\n}", "function montaTr(empresa,textoBotao){\n var empresaTr = document.createElement(\"tr\");\n empresaTr.classList.add(\"empresa\");\n\n empresaTr.appendChild(montaTd(empresa.razaoSocial,\"razao-social\"));\n empresaTr.appendChild(montaTd(empresa.nomeFantasia,\"nome-fantasia\"));\n empresaTr.appendChild(montaTd(empresa.cnpj,\"cnpj\"));\n empresaTr.appendChild(montaTd(empresa.email,\"email\"));\n empresaTr.appendChild(montaTd(empresa.endereco,\"endereco\"));\n empresaTr.appendChild(montaTd(empresa.cidade,\"cidade\"));\n empresaTr.appendChild(montaTd(empresa.estado,\"estado\"));\n empresaTr.appendChild(montaTd(empresa.telefone,\"telefone\"));\n empresaTr.appendChild(montaTd(empresa.data,\"data\"));\n empresaTr.appendChild(montaTd(empresa.categoria,\"categoria\"));\n empresaTr.appendChild(montaTd(empresa.status,\"status\"));\n empresaTr.appendChild(montaTd(empresa.agencia,\"agencia\"));\n empresaTr.appendChild(montaTd(empresa.conta,\"conta\"));\n empresaTr.appendChild(adicionaBotao());\n return empresaTr;\n}", "function obtenerAnuncio(id){\n let auxSexo;\n\n if(rdoM.checked){\n auxSexo='m';\n }\n else if(rdoF.checked){\n auxSexo='f';\n }\n else{\n auxSexo='x';\n }\n\n return (new Persona(id, txtNombre.value, txtApellido.value, txtEmail.value, auxSexo));\n}", "function buscar(){ // função de executar busca ao clicar no botão\n \n let buscaId = document.getElementById('txtBuscar');\n buscaDados(buscaId.value.toLowerCase());\n}", "function cnsRH_abre(texto,divDaConsulta,ordem,naoPesquisa){\n\tif(!CNSRH_SAFETY){\n\t\tcnsRH_safety(function(){ cnsRH_abre(texto,divDaConsulta,ordem,naoPesquisa); },true,true);\n\t\treturn;\n\t}\n\n\t//COLOCA NO OBEJTO A DIV ONDE A CONSULTA FOI INSERIDA\n\tobjFuncRH.divDaConsulta = divDaConsulta;\n\n\t//ALTERA ORDEM DO COMBO DE PESQUISA\n\tif(!empty(ordem)){\n\t\t$('#cnsRH_ordem').parent().dropdown(\"set selected\",ordem);\n\t}\n\n\t//COLOCA NO CAMPO DE PESQUISA DA CONSULTA OQUE FOI PESQUISADO\n\tget('cnsRH_pesquisa').value = texto.trim();\n\n\tif(naoPesquisa !== undefined && naoPesquisa === true){\n\t\t$CNSRHdimmer.dimmer(\"consulta show\");\n\t}else{\n\t\t//MONTA A QUERY\n\t\tcnsRH_montaQuery();\n\t}\n}", "function affiche_formulaire() {\r\n\r\n\tif (document.choix.choix_type.selectedIndex == 0)\r\n\tdocument.getElementById('form_base').style.display = 'block';\r\n\telse\r\n\tdocument.getElementById('form_base').style.display = 'none';\r\n\r\n\t// Chat\r\n\tif (document.choix.choix_type.selectedIndex == 1)\r\n\tdocument.getElementById('form_chat').style.display = 'block';\r\n\telse\r\n\tdocument.getElementById('form_chat').style.display = 'none';\r\n\r\n\t// Chien\r\n\tif (document.choix.choix_type.selectedIndex == 2)\r\n\tdocument.getElementById('form_chien').style.display = 'block';\r\n\telse\r\n\tdocument.getElementById('form_chien').style.display = 'none';\r\n\t}", "addProductoe() {\n this._fila++;\n\n let tr = `\n <tr id=\"${this._alias}tr_${this._fila}\">\n <td>\n <input id=\"${this._alias}ehhbbproducto${this._fila}\" name=\"${this._alias}ehhbbproducto[]\" type=\"hidden\">\n <section style=\"margin-bottom: 0px;\">\n <label class=\"input\">\n <input id=\"${this._alias}etxt_producto${this._fila}\" name=\"${this._alias}etxt_producto[]\" type=\"text\" class=\"input-xs\" placeholder=\"${APP_ETIQUET.search_sensitive}\">\n </label>\n </section>\n </td>\n <td class=\"text-center _um\"></td>\n <td>\n <section style=\"margin-bottom: 0px;\">\n <label class=\"select\">\n <select id=\"${this._alias}elst_aplica_igv${this._fila}\" name=\"${this._alias}elst_aplica_igv[]\"><option value=\"1\">${APP_ETIQUET.e_si}</option><option value=\"0\">${APP_ETIQUET.e_no}</option></select>\n </label>\n </section>\n </td> \n <td>\n <section style=\"margin-bottom: 0px;\">\n <label class=\"input\">\n <input id=\"${this._alias}etxt_cantidad${this._fila}\" name=\"${this._alias}etxt_cantidad[]\" type=\"text\" class=\"input-xs _calcula\" autocomplete=\"off\">\n </label>\n </section>\n </td>\n <td>\n <section style=\"margin-bottom: 0px;\">\n <label class=\"input\">\n <input id=\"${this._alias}etxt_precio${this._fila}\" name=\"${this._alias}etxt_precio[]\" type=\"text\" class=\"input-xs _calcula _precio\" autocomplete=\"off\">\n </label>\n </section>\n </td>\n <td>\n <section style=\"margin-bottom: 0px;\">\n <label class=\"input\">\n <input id=\"${this._alias}etxt_subtotal${this._fila}\" name=\"${this._alias}etxt_subtotal[]\" type=\"text\" class=\"input-xs lv-disabled\" readonly=\"true\">\n </label>\n </section>\n </td>\n <td>\n <section style=\"margin-bottom: 0px;\">\n <label class=\"input\">\n <input id=\"${this._alias}etxt_total_unitario${this._fila}\" name=\"${this._alias}etxt_total_unitario[]\" type=\"text\" class=\"input-xs lv-disabled\">\n </label> \n </section> \n </td>\n\n <td class=\"text-center\" style=\"vertical-align: middle;\">\n <div class=\"btn-group\">\n <button class=\"btn btn-default btn-xs dropdown-toggle dropleft\" data-toggle=\"dropdown\" title=\"Acciones\" aria-expanded=\"true\">\n <i class=\"fa fa-gear fa-lg\"></i> \n <span class=\"caret\">\n </span>\n </button>\n <ul class=\"dropdown-menu dropdown-menu-right\">\n <li>\n <a type=\"button\" id=\"${this._alias}ebtn_md_ganancias${this._fila}\" data-toggle=\"modal\" data-target=\"#${this._alias}myModal${this._fila}\">\n <i class=\"fa fa-plus\"></i> \n <label id=\"cursorGanancia\">Ganancias</label>\n </a>\n </li>\n </ul>\n </div>\n </td>\n <td>\n <btn class=\"btn btn-danger\" style=\"padding-left:3px;padding-right:3px\"><i class=\"fa fa-trash\"></i></button>\n </td>\n \n \n </tr>\n `;\n \n // a este modal le falta los tr-language\n let modal =`<div class=\"modal\" id=\"${this._alias}myModal${this._fila}\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Ganancias en soles de : <input id=\"${this._alias}eproducto_nombre_ganancias${this._fila}\" type=\"text\" class=\"form-control\" readonly=\"true\"></h5>\n </div>\n <div class=\"modal-body\">\n <table class=\"\" id=\"tabla-ganancias\">\n <thead>\n <tr>\n <th scope=\"col\">Precio Compra</th>\n <th scope=\"col\">Precio Publico</th>\n <th scope=\"col\">Precio Ferreteria</th>\n <th scope=\"col\">Precio Distribuidor</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <input id=\"${this._alias}etxt_precio_compra${this._fila}\" name=\"${this._alias}etxt_precio_compra[]\" type=\"text\" class=\"form-control _precio _calcula\" readonly=\"true\" >\n </td>\n <td>\n <input id=\"${this._alias}etxt_pv_pub${this._fila}\" name=\"${this._alias}etxt_pv_pub[]\" type=\"text\" class=\"form-control input-xs\">\n </td>\n <td>\n <input id=\"${this._alias}etxt_pv_fer${this._fila}\" name=\"${this._alias}etxt_pv_fer[]\" type=\"text\" class=\"form-control input-xs\">\n </td>\n <td>\n <input id=\"${this._alias}etxt_pv_dis${this._fila}\" name=\"${this._alias}etxt_pv_dis[]\" type=\"text\" class=\"form-control input-xs\">\n </td>\n </tr>\n <tr>\n <td style:\"font-weight: bold;\">% De ganancia</td>\n <td>\n <input id=\"${this._alias}etxt_ganancia_pub${this._fila}\" name=\"${this._alias}etxt_ganancia_pub[]\" type=\"text\" class=\"form-control\">\n </td>\n <td>\n <input id=\"${this._alias}etxt_ganancia_fer${this._fila}\" name=\"${this._alias}etxt_ganancia_fer[]\" type=\"text\" class=\"form-control\">\n </td>\n <td>\n <input id=\"${this._alias}etxt_ganancia_dis${this._fila}\" name=\"${this._alias}etxt_ganancia_dis[]\" type=\"text\" class=\"form-control\">\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" onclick=\"CierraPopup(${this._alias}myModal${this._fila})\">Cerrar</button>\n </div>\n </div>\n </div>\n </div>`;\n\n\n $('#cursorGanancia').css('cursor', 'pointer')\n $(`#${this._alias}etb_detail`).append(tr);\n\n // parte de mi codigo donde agrego el modal y la interaccion con el precio de compra\n $(`#${this._alias}modales`).append(modal); \n\n let myModal = $(`#${this._alias}myModal${this._fila}`);\n let btnModalGanancias = $(`#${this._alias}ebtn_md_ganancias${this._fila}`)\n let pc = $(`#${this._alias}etxt_precio${this._fila}`)\n let pcm = $(`#${this._alias}etxt_precio_compra${this._fila}`)\n let gpub = $(`#${this._alias}etxt_ganancia_pub${this._fila}`)\n let gfer = $(`#${this._alias}etxt_ganancia_fer${this._fila}`)\n let gdis = $(`#${this._alias}etxt_ganancia_dis${this._fila}`)\n let pvpub = $(`#${this._alias}etxt_pv_pub${this._fila}`)\n let pvfer = $(`#${this._alias}etxt_pv_fer${this._fila}`)\n let pvdis = $(`#${this._alias}etxt_pv_dis${this._fila}`)\n let total = $(`#${this._alias}etxt_total_unitario${this._fila}`)\n let cant = $(`#${this._alias}etxt_cantidad${this._fila}`)\n let aplicaIGV = $(`#${this._alias}elst_aplica_igv${this._fila}`)\n let st = $(`#${this._alias}etxt_subtotal${this._fila}`)\n \n gpub.val(0)\n gfer.val(0)\n gdis.val(0)\n\n // CALCULAR LOS PRECIOS PARA EL MODAL GANANCIAS\n\n btnModalGanancias.click(() => {\n let tc = $(`#COM__etxt_tipo_cambio`).val();\n \n if (tc == \"\") {\n tc = 1\n }\n \n console.log(tc)\n pcm.val(parseFloat(pc.val() * tc).toFixed(2))\n // pvpub.val(parseFloat((pc.val()) * ( 1 + parseFloat(gpub.val()) / 100 ) * tc).toFixed(2));\n // pvfer.val(parseFloat((pc.val()) * ( 1 + parseFloat(gfer.val()) / 100 ) * tc).toFixed(2));\n // pvdis.val(parseFloat((pc.val()) * ( 1 + parseFloat(gdis.val()) / 100 ) * tc).toFixed(2));\n pc.data('precio',pc.val());\n \n console.log(event.pageX)\n \n myModal$.css('top', event.pageX - 100 + \"px\");\n });\n\n // CALCULAR LOS PRECIOS PARA DESDE PU\n\n total.keyup(function() {\n let tc = $(`#COM__etxt_tipo_cambio`).val();\n \n if (tc == \"\") {\n tc = 1\n }\n \n console.log(tc)\n\n pcm.val(parseFloat(pc.val() * tc).toFixed(2))\n // pvpub.val(parseFloat((pc.val()) * ( 1 + parseFloat(gpub.val()) / 100 ) * tc).toFixed(2));\n // pvfer.val(parseFloat((pc.val()) * ( 1 + parseFloat(gfer.val()) / 100 ) * tc).toFixed(2));\n // pvdis.val(parseFloat((pc.val()) * ( 1 + parseFloat(gdis.val()) / 100 ) * tc).toFixed(2));\n pc.data('precio',pc.val());\n });\n\n pc.keyup(function() {\n let tc = $(`#COM__etxt_tipo_cambio`).val();\n \n if (tc == \"\") {\n tc = 1\n }\n \n console.log(tc)\n\n pcm.val(parseFloat(pc.val() * tc).toFixed(2))\n // pvpub.val(parseFloat((pc.val()) * ( 1 + parseFloat(gpub.val()) / 100 ) * tc).toFixed(2));\n // pvfer.val(parseFloat((pc.val()) * ( 1 + parseFloat(gfer.val()) / 100 ) * tc).toFixed(2));\n // pvdis.val(parseFloat((pc.val()) * ( 1 + parseFloat(gdis.val()) / 100 ) * tc).toFixed(2));\n pc.data('precio',pc.val());\n });\n\n cant.keyup(function() {\n let tc = $(`#COM__etxt_tipo_cambio`).val();\n \n if (tc == \"\") {\n tc = 1\n }\n \n console.log(tc)\n \n pcm.val(parseFloat(pc.val() * tc).toFixed(2))\n // pvpub.val(parseFloat((pc.val()) * ( 1 + parseFloat(gpub.val()) / 100 ) * tc).toFixed(2));\n // pvfer.val(parseFloat((pc.val()) * ( 1 + parseFloat(gfer.val()) / 100 ) * tc).toFixed(2));\n // pvdis.val(parseFloat((pc.val()) * ( 1 + parseFloat(gdis.val()) / 100 ) * tc).toFixed(2));\n pc.data('precio',pc.val());\n });\n \n $('#COM__ed_tipo_moneda').change(function(){\n\n let tc = $(`#COM__etxt_tipo_cambio`).val();\n \n if (tc == \"\") {\n tc = 1\n }\n\n console.log($(tc))\n\n pcm.val(parseFloat(pc.val() * tc).toFixed(2))\n // pvpub.val(parseFloat((pc.val()) * ( 1 + parseFloat(gpub.val()) / 100 ) * tc).toFixed(2));\n // pvfer.val(parseFloat((pc.val()) * ( 1 + parseFloat(gfer.val()) / 100 ) * tc).toFixed(2));\n // pvdis.val(parseFloat((pc.val()) * ( 1 + parseFloat(gdis.val()) / 100 ) * tc).toFixed(2));\n pc.data('precio',pc.val());\n })\n\n // CALCULA EL PRECIO, DESDE EL TOTAL\n\n total.keyup(function() { \n\n let tigv, tIGV, tGravada, tTotal, subtotal\n\n let igv = parseFloat(store.get('IGV'))\n\n pc.val(parseFloat(parseFloat(total.val()) / parseFloat(cant.val())))\n\n let precioSIGV = parseFloat(pc.val()) / (1 + parseFloat(igv));\n\n if (aplicaIGV.val() == 0) {\n subtotal = parseFloat(cant.val()) * parseFloat(pc.val())\n } else {\n subtotal = parseFloat(cant.val()) * parseFloat(precioSIGV)\n }\n\n st.val(parseFloat(subtotal).toFixed(2))\n \n\n \n \n });\n \n // AÑADE UN CAMPO MÁS, AL DAR ENTER EN EL TOTAL\n\n total.keypress( function(e) {\n\n if ( e.keyCode === 13) {\n \n e.preventDefault();\n $('#BCTXT_COM__ITADD').click();\n\n }\n console.log(e.keyCode);\n });\n\n gpub.keyup(function() {\n let valor = parseFloat(pcm.val()) * ( 1 + parseFloat(gpub.val()) / 100 )\n pvpub.val(parseFloat(valor).toFixed(2));\n })\n\n gfer.keyup(function() {\n let valor = parseFloat(pcm.val()) * ( 1 + parseFloat(gfer.val()) / 100 )\n pvfer.val(parseFloat(valor).toFixed(2));\n })\n\n gdis.keyup(function() {\n let valor = parseFloat(pcm.val()) * ( 1 + parseFloat(gdis.val()) / 100 )\n pvdis.val(parseFloat(valor).toFixed(2));\n })\n\n pvpub.keyup(function() {\n let valor = 100 * ( ( parseFloat(pvpub.val()) / parseFloat(pcm.val()) ) - 1 )\n gpub.val(parseFloat(valor).toFixed(2));\n })\n\n pvfer.keyup(function() {\n let valor = 100 * ( ( parseFloat(pvfer.val()) / parseFloat(pcm.val()) ) - 1 )\n gfer.val(parseFloat(valor).toFixed(2));\n })\n\n pvdis.keyup(function() {\n let valor = 100 * ( ( parseFloat(pvdis.val()) / parseFloat(pcm.val()) ) - 1 )\n gdis.val(parseFloat(valor).toFixed(2));\n })\n\n\n\n $(`#${this._alias}tr_${this._fila}`).find('select').chosen();\n $(`#${this._alias}tr_${this._fila}`).find('.chosen-container').css({width: '100%'});\n \n \n \n $.widget(\"custom.autocomplete\", $.ui.autocomplete, {\n \n _resizeMenu: function() {\n this.menu.element.outerWidth( 400 );\n }\n \n });\n let fila = this._fila;\n $(`#${this._alias}etxt_producto${this._fila}`).autocomplete({\n source: (request, response) => {\n console.log(request.term.split(\" \"));\n $.ajax({\n type: \"POST\",\n url: \"facturacion/compra/getProducto\",\n dataType: \"json\",\n data: {\n term: request.term.split(\" \"), _qn: Tools.en(_tk_), _alias: this._alias, f: fila, local: $('#COM__elst_local').val()\n },\n success: function (data) {\n response(data);\n }\n })\n \n },\n minLength: 2,\n select: (event, ui) => {\n $(`#${this._alias}ehhbbproducto${ui.item.fila}`).val(ui.item.id);\n $(`#${this._alias}tr_${ui.item.fila}`).find('._um').html(ui.item.unidad_medida);\n $(`#${this._alias}tr_${ui.item.fila}`).find('td').eq(3).find('input:text').focus();\n \n $(`#${this._alias}eproducto_nombre_ganancias${ui.item.fila}`).val(ui.item.value);\n\n $(`#${this._alias}etxt_pv_pub${this._fila}`).val(ui.item.precio_publico);\n $(`#${this._alias}etxt_pv_dis${this._fila}`).val(ui.item.precio_distribuidor);\n $(`#${this._alias}etxt_pv_fer${this._fila}`).val(ui.item.precio_ferreteria);\n\n $(`#${this._alias}ecustomers2${ui.item.fila}`).remove();\n \n $.ajax({\n type: \"POST\",\n url: \"facturacion/compra/getUltimasCompras\",\n dataType: \"json\",\n data: {\n id_catalogo : ui.item.id, _qn: Tools.en(_tk_), _alias: this._alias, f: ui.item.fila\n },\n success: function (compras) {\n let registros = ''\n\n console.log(compras[0]['cantidad'])\n console.log(typeof(compras[0]['cantidad']))\n\n if ( compras[0]['cantidad'] == 0 ) {\n registros += `<tr class=\"d-flex\"> \n <td colspan=\"10\">Usted aun no realizo ninguna compra de este producto para este local</td>\n </tr>`\n } else{\n\n compras.forEach( function(compra, index) {\n registros += `<tr class=\"d-flex\">\n\n <td class=\"col-2\">` + compra.tipo_comprobante + `</td>\n <td class=\"col-2\">` + compra.fecha + `</td>\n <td class=\"col-2\">` + compra.proveedor + `</td>\n <td class=\"col-1\">` + compra.cantidad + `</td>\n <td class=\"col-4\">` + compra.value + `</td>\n <td class=\"col-3\">` + compra.precio_unitario + `</td>\n <td class=\"col-3\">` + compra.sub_total + `</td>\n <td class=\"col-1\">` + compra.total + `</td>`\n\n console.log(compra.tipo_cambio)\n\n if ( compra.tipo_cambio === null ) {\n registros += `<td class=\"col-1\">1</td>` +\n `<td class=\"col-1\">` + compra.simbolo + ` ` + compra.total + `</td></tr>`\n }else {\n registros += `<td class=\"col-1\">` + compra.tipo_cambio + `</td>` +\n `<td class=\"col-1\">` + compra.simbolo + ` ` + compra.total / compra.tipo_cambio + `</td></tr>`\n }\n \n });\n }\n\n $(`#${compras[0]['alias']}ultimas_compras${compras[0]['fila']}`).append(registros)\n }\n });\n\n $(`#${this._alias}tablas-compras`).append(`<div class=\"container customers2\" id=\"${this._alias}ecustomers2${this._fila}\">\n\n <button type=\"button\" id=\"${this._alias}cerrar_tabla${this._fila}\" class=\"close\"><span>×</span><span class=\"sr-only\"></span></button>\n <table class=\"table table-sm\" id=\"${this._alias}compra_tabla${this._fila}\">\n <thead>\n <tr class=\"d-flex\">\n <th class=\"col-2\">Comprobante</th>\n <th class=\"col-3\">Fecha</th>\n <th class=\"col-2\">Proveedor</th>\n <th class=\"col-1\">Cantidad</th>\n <th class=\"col-4\">Producto</th>\n <th class=\"col-1\">P/U(S/.)</th>\n <th class=\"col-1\">Precio(S/.)</th>\n <th class=\"col-1\">Importe(S/.)</th>\n <th class=\"col-1\">Tipo Cambio</th>\n <th class=\"col-1\">Importe</th>\n </tr>\n </thead>\n <tbody id=\"${this._alias}ultimas_compras${this._fila}\"> \n </tbody>\n </table>\n <script>\n document.getElementById('${this._alias}cerrar_tabla${this._fila}').addEventListener('click', function(){\n document.getElementById('${this._alias}ecustomers2${this._fila}').remove()});\n \n $('#${this._alias}ecustomers2${this._fila}').draggable();\n \n </script>\n </div>\n `);\n\n \n }\n });\n\n $(`#${this._alias}etxt_producto${this._fila}`).focus();\n $(`#${this._alias}tr_${this._fila}`).find('._calcula').keyup((e) => {\n if (!$.isNumeric($(e.currentTarget).val()) && $(e.currentTarget).val().length > 0) {\n $(e.currentTarget).val(0);\n }\n this._calculaTotalese();\n });\n\n\n $(`#${this._alias}tr_${this._fila}`).find('._precio').keyup((e) => {\n if (!$.isNumeric($(e.currentTarget).val()) && $(e.currentTarget).val().length > 0) {\n $(e.currentTarget).val(0);\n }\n $(e.currentTarget).data('precio',$(e.currentTarget).val());\n });\n \n $(`#${this._alias}tr_${this._fila}`).find('.btn-danger').click((e) => {\n $(e.currentTarget).parent().parent('tr').remove();\n this._calculaTotalese();\n });\n $(`#${this._alias}tr_${this._fila}`).find('select').change((e) => {\n this._calculaTotalese();\n });\n\n }", "function datosTablaVigencia(val){\n var nombre = $(\"input[name ^= vigenciaNombre\"+val+\"]\").val(),\n paterno = $(\"input[name ^= vigenciaPaterno\"+val+\"]\").val(),\n materno = $(\"input[name ^= vigenciaMaterno\"+val+\"]\").val(),\n nacimiento = $(\"input[name ^= vigenciaNacimiento\"+val+\"]\").val(),\n curp = $(\"input[name ^= vigenciaCurp\"+val+\"]\").val(),\n agregado = $(\"input[name ^= vigenciaAgregado\"+val+\"]\").val(),\n vigencia = $(\"input[name ^= vigencia\"+val+\"]\").val(),\n delegacion = $(\"input[name ^= vigenciaDelegacion\"+val+\"]\").val(),\n umf = $(\"input[name ^= vigenciaUmf\"+val+\"]\").val(),\n sexo = $(\"input[name ^= vigenciaSexo\"+val+\"]\").val(),\n colonia = $(\"input[name ^= vigenciaColonia\"+val+\"]\").val(),\n direccion = $(\"input[name ^= vigenciaDireccion\"+val+\"]\").val(),\n /*Se cuenta el numero de caracteres de la direccion para tomar los ultimos 5 digitos correspondientes\n al codigo postal del paciente*/\n longituddireccion = direccion.length,\n cpostal = direccion.substring(longituddireccion-5,longituddireccion);\n if(sexo == \"F\"){\n sexo = \"MUJER\";\n }else if(sexo == \"M\"){\n sexo = \"HOMBRE\";\n }\n // Verifica la vigencia del usuario para indicar un estado de color verde si esta activo o rojo en caso contrario\n if(vigencia == \"NO\"){\n $(\"input[name = pia_vigencia]\").css('background-color', 'rgb(252, 155, 155)');\n }else if(vigencia == \"SI\"){\n $(\"input[name = pia_vigencia]\").css('background-color', 'rgb(144, 255, 149)');\n }\n //Se agrega los datos seleccionados del modal al formulario principal\n $(\"input[name = pum_nss_agregado]\").val(agregado);\n $(\"input[name = pia_vigencia]\").val(vigencia);\n $(\"input[name = pum_delegacion]\").val(delegacion);\n $(\"input[name = pum_umf]\").val(umf);\n $(\"input[name = triage_paciente_curp]\").val(curp);\n $(\"input[name = triage_nombre_ap]\").val(paterno);\n $(\"input[name = triage_nombre_am]\").val(materno);\n $(\"input[name = triage_nombre]\").val(nombre);\n $(\"input[name = triage_fecha_nac]\").val(nacimiento);\n $(\"select[name = triage_paciente_sexo]\").val(sexo);\n $(\"input[name = directorio_colonia]\").val(colonia);\n $(\"input[name = directorio_cp]\").val(cpostal);\n}", "function crearTablaTransicion(entrada,alfabeto,tablaTransicion){\n var tablaPadre = document.createElement('table'),\n filaTitulo = document.createElement('tr');\n for(let i=0; i<transiciones.length ; i++){\n var columnaTitulo = document.createElement('td');\n columnaTitulo.className='formatoTablaTitulo';\n columnaTitulo.textContent = transiciones[i];\n filaTitulo.appendChild(columnaTitulo);\n }\n tablaPadre.appendChild(filaTitulo);\n for(let i=0; i<entrada.length; i++){\n for(let j=0; j<alfabeto.length; j++){\n var filaDatos = document.createElement('tr'), \n columnaEstados = document.createElement('td'), \n columnaAlfabeto = document.createElement('td'),\n columnaInput = document.createElement('td'),\n input = document.createElement('input');\n //estilos y contenido a las columnas\n columnaEstados.className='formatoTabla';\n columnaEstados.textContent = entrada[i];\n columnaAlfabeto.className='formatoTabla';\n columnaAlfabeto.textContent = alfabeto[j];\n input.className='form-control';\n input.setAttribute('placeholder','Estado Destino');\n input.setAttribute('type','text');\n input.id=`${entrada[i]}-${alfabeto[j]}`;\n //agrego los elementos a sus nodos padres\n columnaInput.appendChild(input);\n filaDatos.appendChild(columnaEstados);\n filaDatos.appendChild(columnaAlfabeto);\n filaDatos.appendChild(columnaInput);\n tablaPadre.appendChild(filaDatos);\n }\n }\n tablaTransicion.appendChild(tablaPadre);\n}", "function tablaresultadosproducto(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var categoriatext = \"\";\r\n var estadotext = \"\";\r\n var categoriaestado = \"\";\r\n var base_url = document.getElementById('base_url').value;\r\n //al inicar carga con los ultimos 50 productos\r\n if(limite == 1){\r\n controlador = base_url+'producto/buscarproductosexistmin/';\r\n // carga todos los productos de la BD \r\n }else{\r\n controlador = base_url+'producto/buscarproductosexistmin/';\r\n var categoria = document.getElementById('categoria_id').value;\r\n var estado = document.getElementById('estado_id').value;\r\n if(categoria == 0){\r\n categoriaestado = \"\";\r\n }else{\r\n categoriaestado = \" and p.categoria_id = cp.categoria_id and p.categoria_id = \"+categoria+\" \";\r\n categoriatext = $('select[name=\"categoria_id\"] option:selected').text();\r\n categoriatext = \"Categoria: \"+categoriatext;\r\n }\r\n if(estado == 0){\r\n categoriaestado += \"\";\r\n }else{\r\n categoriaestado += \" and p.estado_id = \"+estado+\" \";\r\n estadotext = $('select[name=\"estado_id\"] option:selected').text();\r\n estadotext = \"Estado: \"+estadotext;\r\n }\r\n \r\n $(\"#busquedacategoria\").html(categoriatext+\" \"+estadotext);\r\n \r\n parametro = document.getElementById('filtrar').value;\r\n }\r\n \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, categoriaestado:categoriaestado},\r\n success:function(respuesta){ \r\n \r\n \r\n $(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n var color = \"\";\r\n \r\n if (registros != null){\r\n var formaimagen = document.getElementById('formaimagen').value;\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").val(\"- \"+n+\" -\");\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n \r\n \r\n if (Number(registros[i]['existencia'])>0){\r\n color = \"\"; \r\n }else{ \r\n color = \"style='background-color: #ffffff; '\";\r\n }\r\n\r\n \r\n html += \"<tr \"+color+\">\";\r\n \r\n html += \"<td style='padding:0;'>\"+(i+1)+\"</td>\";\r\n html += \"<td style='padding:0;'>\";\r\n html += registros[i]['producto_nombre'];\r\n \r\n html += \"</td>\";\r\n \r\n html += \"<td style='padding:0;'>\"+registros[i]['producto_codigo']+\"</td>\";\r\n html += \"<td style='text-align: center;'><font size='2'><b>\"+Number(registros[i]['existencia']).toFixed(2)+\"</b></font></td>\";\r\n html += \"<td style='padding:0;'>\"+Number(registros[i]['producto_ultimocosto']).toFixed(2)+\"</td>\";\r\n html += \"<td style='padding:0;'>\"+registros[i]['moneda_descripcion']+\"</td>\";\r\n html += \"<td style='padding:0;'>\"+registros[i]['categoria_nombre']+\"</td>\";\r\n html += \"<td style='padding:0;' class='no-print'><button class='btn btn-info btn-xs' onclick='mostrar_historial(\"+registros[i]['producto_id']+\")'><fa class='fa fa-users'></fa> proveedores</button> </td>\";\r\n \r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n \r\n \r\n $(\"#tablaresultados\").html(html);\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 fct_AtualizaInputsTabela() {\n\n fct_Index(\"Codigo\", \"Codigo\");\n\n fct_Index(\"InicioVigencia\", \"DtInicioVigencia\");\n\n fct_Index(\"FimVigencia\", \"DtFimVigencia\");\n\n fct_Index(\"DiaDaSemana\", \"DiaDaSemana\");\n\n fct_Index(\"HoraInicio\", \"HoraDeInicioDasAulas\");\n\n fct_Index(\"HoraFim\", \"HoraDeFimDasAulas\");\n\n function fct_Index(id, campo) {\n\n var contador = 0;\n\n $('input[id=' + id + ']').each(function () {\n $(this).prop(\"name\", \"AulaPaa[\" + contador + \"].\" + campo);\n contador++;\n });\n }\n}", "function crearFiltro() {\n let filtro = {}\n let servicios = []\n let menus = []\n let categorias = []\n let orden = document.querySelector(\"#orden\").value;\n document.querySelector(\"#filtro_Servicios\").querySelectorAll(\"input\").forEach(x => x.checked ? servicios.push(x.name) : undefined);\n document.querySelector(\"#filtro_Menus\").querySelectorAll(\"input\").forEach(x => x.checked ? menu.push(x.name) : undefined);\n document.querySelector(\"#filtro_Categorias\").querySelectorAll(\"input\").forEach(x => x.checked ? categorias.push(x.name) : undefined);\n filtro.Servicios = servicios\n filtro.Menus = menus\n filtro.Categorias = categorias\n filtro.Orden = orden\n return filtro\n }", "function getform(nproductos,opcion){\n var html;\n if (parseInt(opcion)==1){\n html=\n '<div id=\"reactivos_'+nproductos+'\">'\n+'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div>'\n+'<div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n+'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Plazo de entrega</div>'\n+'<div>'\n +'<span class=\"small_text\">D&iacute;as</span><input id=\"txt_dias_'+nproductos+'\" value=\"\" class=\"mininputbox\" type=\"text\" />'\n +'<span class=\"small_text\">Semanas</span><input id=\"txt_semanas_'+nproductos+'\" value=\"\" class=\"mininputbox\" type=\"text\" />'\n +'<span class=\"small_text\">Meses</span><input id=\"txt_meses_'+nproductos+'\" value=\"\" class=\"mininputbox\" type=\"text\" />'\n+'</div><br>'\n+'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Existente en GECO</div>'\n+'<div>'\n +'<span class=\"small_text\">C&oacute;digo de Agrupaci&oacute;n</span><input id=\"txt_codagrup_'+nproductos+'\" value=\"\" class=\"midinputbox\" type=\"text\" />'\n +'<span class=\"small_text\">C&oacute;digo de Articulo</span><input id=\"txt_codart_'+nproductos+'\" value=\"\" class=\"midinputbox\" type=\"text\" />'\n+'</div><br>'\n+'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Proveedores</div>'\n+'<div>'\n+'<select type=\"text\" id=\"input-tags2\" multiple class=\"demo-default\">'\n+'<option>Gollo</option>'\n+'<option>Verdugo</option>'\n+'<option>Casa Blanca</option>'\n+'</select>'\n+'</div><br>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Nombre</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Pureza</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Grado</div><br>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrere_'+nproductos+'\" name=\"txt_nombrer_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\"fl input25\">'\n +'<input id=\"txt_purezare_'+nproductos+'\" name=\"txt_pureza_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_gradore_'+nproductos+'\" name=\"txt_grado_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div><div>-</div><br>'\n\n+'<div class=\"Arial14Morado subtitulosl fl\">Presentación</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Tipo de almacenamiento</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Similar a marca</div><br>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_presentacionre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\"fl input25\">'\n +'<input id=\"txt_condicionesre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_similarmre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div><div>-</div><br>'\n\n+'<div class=\"Arial14Morado subtitulosl fl\">Similar # catálogo</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\"># Cotizaci&oacute;n</div>'\n+'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div><br>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_similarcre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div>'\n+'<div class=\" fl input25\">'\n +'<input id=\"txt_otrosre_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n+'</div><div>-</div><br>'\n\n+'<div class=\"Arial14Morado subtitulosl \">Monto</div><br>'\n\n+'<div class=\" fl input25\">'\n+'<span class=\"small_text\">Colones</span><input id=\"txt_colones_'+nproductos+'\" value=\"\" class=\"midinputbox\" type=\"text\" />'\n+'<span class=\"small_text\">Dolares</span><input id=\"txt_dolares_'+nproductos+'\" value=\"\" class=\"midinputbox\" type=\"text\" />'\n+'</div>'\n \n+'</div><div><br>'\n\n }\n\n if (parseInt(opcion)==2){\n html=\n '<div id=\"gases_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Pureza</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Presentación</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrega_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_purezaga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_presentacionga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo entrega</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a Invitar</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_plazoga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_otrosga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_montoga_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">&nbsp;'\n +'</div>'\n \n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n }\n\n if (parseInt(opcion)==3){\n html=\n '<div id=\"cristaleria_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Clase</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Capacidad</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrecri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_clasecri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_capacidadcri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Presentación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar a marca</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar # catalogo</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_presentacioncri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_similarcri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_numerocri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo entrega</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros Detalles</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_plazocri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_otroscri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedorescri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacioncri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_montocri_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n \n\n +'</div>'\n +'<div>&nbsp;&nbsp;<br><br></div>'; \n }\n\n if (parseInt(opcion)==4){\n html=\n '<div id=\"repuestos_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre Repuesto</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Marca Equipo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Modelo Equipo</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrerep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_marcaequirep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_modeloequirep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># de catálogo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Representante(Equipo-Marca)</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo de entrega</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_catalogorep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_representanterep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_plazorep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Garantia en meses</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_garantiarep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_otrosrep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresrep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Marca Repuesto</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionrep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_montorep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<input id=\"txt_marcarep_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n } \n\n if (parseInt(opcion)==5){\n html=\n '<div id=\"equipos_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Representantes CR</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar a marca</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombreequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_representanteequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_similarmarequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Similan a modelo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar # catálogo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo de entrega</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_similarmodequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_similarcatequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_plazoequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Garantía en fabricación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Garantía en mantenimiento</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Requiere capacitación</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_garantiafabequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_garantiamanequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_capacitacionequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Requiere instalación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Lugar entrega</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_instalacionequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_lugarequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otrosequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_cotizacionequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_montoequi_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'</div><br><br>'\n +'<div>&nbsp;&nbsp;<br><br></div>'; \n }\n\n if (parseInt(opcion)==6){\n html=\n '<div id=\"materiales_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar a marca</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar # catálogo</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombreremat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_similarmat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_similarcat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo de entrega</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_plazomat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_otrosmat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedorermat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionmat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_montomat_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>';\n }\n\n if (parseInt(opcion)==7){\n html=\n '<div id=\"calibraciones_'+nproductos+'\">' \n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre equipo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Código</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Placa</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrerecal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_codcal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_placacal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Ubicación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Lugar de calibración</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_ubicacioncal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_lugarcal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_montocal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otroscal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_proveedorescal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacioncal_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Calibración acreditada INTE-ISO/IEC 17025</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\" fl input25\">'\n +'<span class=\"Arial14Negro\">No</span><input type=\"radio\" value=\"0\" id=\"rnd_acreditadocal_'+nproductos+'\" name=\"rnd_acreditadocal_'+nproductos+'\" ><span class=\"Arial14Negro\">S&iacute;</span><input type=\"radio\" value=\"1\" id=\"rnd_acreditadocal_'+nproductos+'\" name=\"rnd_acreditadocal_'+nproductos+'\">' \n +'</div>'\n +'<div class=\"fl input25\">&nbsp;&nbsp;' \n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div><br><br>'\n +'<div>&nbsp;&nbsp;<br><br></div>'; \n }\n\n if (parseInt(opcion)==8){\n html=\n '<div id=\"reparaciones_'+nproductos+'\">' \n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre equipo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Código</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Placa</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombrerepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_codrepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_placarepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Ubicación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_ubicacionrepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_otrosrepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresrepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionrepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_montorepa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>';\n }\n\n if (parseInt(opcion)==9){\n html=\n '<div id=\"interlaboratoriales_'+nproductos+'\">'\n +'<div class=\"Arial14Morado subtitulosl fl\">Análisis solicitados</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Ronda INTE-ISO/IEC 17043</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_analisisinte_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_rondainte_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_ontrointe_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresinte_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_cotizacioninte_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_montointe_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n }\n\nif (parseInt(opcion)==10){\n html=\n '<div id=\"medios_'+nproductos+'\">' \n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre del medio</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Tipo de medio</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar a marca</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombremed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_tipomed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_similarmarmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Similar # de catálogo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Plazo de entrega</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Presentación</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_similarcatmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_plazomed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_presentacionmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otrosmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_proveedoresmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionmed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>' \n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_montomed_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n +'<div class=\"fl input25\">&nbsp;&nbsp;' \n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div><br><br>'\n +'<div>&nbsp;&nbsp;<br><br></div>'; \n }\n\nif (parseInt(opcion)==11){\n html=\n '<div id=\"software_'+nproductos+'\">'\n +'<div align=\"left\" class=\"Arial14Morado subtitulosl fl\">Cantidad</div><div><input id=\"txt_cantidad_'+nproductos+'\"\" name=\"txt_cantidad_'+nproductos+' size=\"10\" value=\"\" class=\"inputbox\" type=\"text\" /></div><br>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Nombre del programa</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Desarrollador</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Versión</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_nombresoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_desarrolladorsoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_versionsoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\"># de cotización</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otrossoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_proveedoressoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionsoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Monto</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_montosoft_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n } \n\nif (parseInt(opcion)==12){\n html=\n '<div id=\"capacitaciones_'+nproductos+'\">'\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedor</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Tema capacitación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Fecha</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedorcapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_temacapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_fechacapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Costo</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\"># cotización</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_costocapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_cotizacioncapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otroscapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />' \n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_provinvicapa_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">&nbsp;&nbsp;' \n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>';\n +'<div>&nbsp;&nbsp;</div>'; \n } \n\nif (parseInt(opcion)==13){\n html=\n '<div id=\"inscripciones_'+nproductos+'\">'\n +'<div class=\"Arial14Morado subtitulosl fl\">Tema/Nombre</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Fecha</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Costo</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_temains_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_fechains_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_costoins_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Otros detalles</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Organizadores</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_otrosins_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_organizadoresins_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n }\n\n if (parseInt(opcion)==14){\n html=\n '<div id=\"referencia_'+nproductos+'\">'\n +'<div class=\"Arial14Morado subtitulosl fl\">Tipo material</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">Presentación</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\"># de cotización</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_tiporef_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">'\n +'<input id=\"txt_presentacionref_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_cotizacionref_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n\n +'<div class=\"Arial14Morado subtitulosl fl\">Proveedores a invitar</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div>'\n +'<div class=\"Arial14Morado subtitulosl fl\">&nbsp;&nbsp;</div><br>'\n +'<div class=\" fl input25\">'\n +'<input id=\"txt_proveedoresref_'+nproductos+'\" value=\"\" class=\"inputbox\" type=\"text\" />'\n +'</div>'\n +'<div class=\"fl input25\">&nbsp;&nbsp;' \n +'</div>'\n +'<div class=\" fl input25\">&nbsp;&nbsp;' \n +'</div>'\n\n +'</div>'\n +'<div>&nbsp;&nbsp;</div>'; \n } \n \n\n return html;\n}//end function", "function TipoDescuento3(){\n //recuperamos el valor descuento 3 anterior\n var descuento3=document.getElementById(\"tipo_des3\").value;\n \n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento3 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento3);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n \n var monto= document.getElementById('tipoDescuento3').value;\n document.getElementById(\"tipo_des3\").value=monto;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-monto;\n \n //codigo de descuento la cual guardaremos\n var posicion=document.getElementById('tipodescuento3').options.selectedIndex;\n var codigoDescuento3=document.getElementById('tipodescuento3').options[posicion].value;\n document.getElementById(\"cod_des3\").value=codigoDescuento3;\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function registroCarrito(curso) {\n return `<p> ${curso.nombreCurso} \n <span class=\"badge bg-warning\"> Precio Unitario: $ ${curso.precioCurso}</span>\n <span class=\"badge bg-dark\">${curso.cantidad}</span>\n <span class=\"badge bg-success\"> Precio total: $ ${curso.subtotal()}</span>\n <a id=\"${curso.id}\" class=\"btn btn-info btn-add\">+</a>\n <a id=\"${curso.id}\" class=\"btn btn-warning btn-restar\">-</a>\n <a id=\"${curso.id}\" class=\"btn btn-danger btn-delete\">x</a>\n \n </p>`\n}", "function filtrosMercado(){\n\t\tvar table = document.createElement(\"TABLE\");\n\t\ttable.setAttribute(\"class\", \"tbg\");\n\t\ttable.setAttribute(\"style\", \"width:100%\");\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\n\n\t\t// Se crea la tabla con 3 filas, Ofrezco, Busco y Tipo\n\t\tvar etiquetas = [T('OFREZCO'), T('BUSCO')];\n\t\tfor (var j = 0; j < 2; j++){\n\t\t\tvar tr = document.createElement(\"TR\");\n\t\t\ttr.appendChild(elem(\"TD\", etiquetas[j]));\n\t\t\t// Para Ofrezco y Busco se muestran 4 materiales y un quinto comodin\n\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\tvar td = document.createElement(\"TD\");\n\t\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + i);\n\t\t\t\tvar ref = elem(\"A\", \"<img src='\" + img('r/' + (i+1) + '.gif') + \"' width='18' height='12' border='0' title='\" + T('RECURSO' + (i+1)) + \"'>\");\n\t\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, i+1), 0);\n\t\t\t\ttd.appendChild(ref);\n\t\t\t\ttr.appendChild(td);\n\t\t\t}\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + \"4\");\n\t\t\tvar ref = elem(\"A\", T('CUALQUIERA'));\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, 5), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t\ttable.appendChild(tr);\n\t\t}\n\n\t\t// La fila del tipo especifica transacciones 1:1 o 1:x\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('TIPO')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1:1\", \"1:>1\", \"1:<1\", \"1:x\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 2 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(2, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('MAXTIME')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1\", \"2\", \"3\", \">3\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 4 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(4, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('DISPONIBLE')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_carencia = [T('SI'), T('NO')];\n\t\tfor (var i = 0; i < 2; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"colspan\", \"2\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 3 + i);\n\t\t\tif (i == 1) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_carencia[i]);\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(3, (i+1)), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\t// Busca la tabla de ofertas y la inserta justo antes\n\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]\", XPFirst);\n\t\tvar p = document.createElement(\"P\");\n\t\tp.appendChild(table);\n\t\ta.parentNode.insertBefore(p, a);\n\t}", "function TipoDescuento4(){\n //recuperamos el valor descuento 4 anterior\n var descuento4=document.getElementById(\"tipo_des4\").value;\n \n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento4 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento4);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n \n var monto= document.getElementById('tipoDescuento4').value;\n document.getElementById(\"tipo_des4\").value=monto;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-monto;\n \n //codigo de descuento la cual guardaremos\n var posicion=document.getElementById('tipodescuento4').options.selectedIndex;\n var codigoDescuento4=document.getElementById('tipodescuento4').options[posicion].value;\n document.getElementById(\"cod_des4\").value=codigoDescuento4;\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function inicializartipos(datos) {\n \n let editartiposif = document.getElementById('tipo1informacionpersonaleditar');\n let id;\n let tipo;\n \n datos[0]['idtipodireccionseccional'] ? tipo = \"Dirección Seccional\" : tipo = \"Actividad Economica\";\n\n editartiposif.innerHTML = `\n <option selected=\"true\" disabled=\"disabled\" class=\"noselected\">Seleccione el tipo de ${tipo}</option>`;\n datos.forEach(tipos => {\n tipos['idtipodireccionseccional'] ? id = tipos['idtipodireccionseccional'] : id = tipos['idtipoactividad'];\n editartiposif.innerHTML += `<option value=\"${id}\">${tipos['nombre']}</option>`;\n });\n\n}", "function TipoDescuento1(){\n //recuperamos el valor descuento 1 anterior\n var descuento1=document.getElementById(\"tipo_des1\").value;\n \n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento1 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento1);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n\n //el valor que se ingreso en monto\n var monto= document.getElementById('tipoDescuento1').value;\n document.getElementById(\"tipo_des1\").value=monto;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-monto;\n \n //codigo de descuento la cual guardaremos\n var posicion=document.getElementById('tipodescuento1').options.selectedIndex;\n var codigoDescuento1=document.getElementById('tipodescuento1').options[posicion].value;\n document.getElementById(\"cod_des1\").value=codigoDescuento1;\n \n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function tablaresultadosproducto(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var categoriatext = \"\";\r\n var estadotext = \"\";\r\n var categoriaestado = \"\";\r\n var base_url = document.getElementById('base_url').value;\r\n var parametro_modulo = document.getElementById('parametro_modulorestaurante').value;\r\n var tipousuario_id = document.getElementById('tipousuario_id').value;\r\n //var lapresentacion = JSON.parse(document.getElementById('lapresentacion').value);\r\n //al inicar carga con los ultimos 50 productos\r\n if(limite == 1){\r\n controlador = base_url+'producto/buscarproductoslimit/';\r\n // carga todos los productos de la BD \r\n }else if(limite == 3){\r\n controlador = base_url+'producto/buscarproductosall/';\r\n // busca por categoria\r\n }else{\r\n controlador = base_url+'producto/buscarproductos/';\r\n var categoria = document.getElementById('categoria_id').value;\r\n var estado = document.getElementById('estado_id').value;\r\n if(categoria == 0){\r\n categoriaestado = \"\";\r\n }else{\r\n categoriaestado = \" and p.categoria_id = cp.categoria_id and p.categoria_id = \"+categoria+\" \";\r\n categoriatext = $('select[name=\"categoria_id\"] option:selected').text();\r\n categoriatext = \"Categoria: \"+categoriatext;\r\n }\r\n if(estado == 0){\r\n categoriaestado += \"\";\r\n }else{\r\n categoriaestado += \" and p.estado_id = \"+estado+\" \";\r\n estadotext = $('select[name=\"estado_id\"] option:selected').text();\r\n estadotext = \"Estado: \"+estadotext;\r\n }\r\n \r\n $(\"#busquedacategoria\").html(categoriatext+\" \"+estadotext);\r\n \r\n parametro = document.getElementById('filtrar').value;\r\n }\r\n \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, categoriaestado:categoriaestado},\r\n success:function(respuesta){ \r\n \r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n if (registros != null){\r\n var formaimagen = document.getElementById('formaimagen').value;\r\n \r\n /*var cont = 0;\r\n var cant_total = 0;\r\n var total_detalle = 0; */\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").html(\"Registros Encontrados: \"+n+\" \");\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n// html += \"<td>\";\r\n var caracteristica = \"\";\r\n if(registros[i][\"producto_caracteristicas\"] != null){\r\n caracteristica = \"<div style='word-wrap: break-word;'>\"+registros[i][\"producto_caracteristicas\"]+\"</div>\";\r\n }\r\n// html+= caracteristica+\"</td>\"; \r\n \r\n html += \"<tr>\";\r\n \r\n html += \"<td>\"+(i+1)+\"</td>\";\r\n html += \"<td>\";\r\n html += \"<div id='horizontal'>\";\r\n html += \"<div id='contieneimg'>\";\r\n var mimagen = \"\";\r\n if(registros[i][\"producto_foto\"] != null && registros[i][\"producto_foto\"] !=\"\"){\r\n mimagen += \"<a class='btn btn-xs' data-toggle='modal' data-target='#mostrarimagen\"+i+\"' style='padding: 0px;'>\";\r\n mimagen += \"<img src='\"+base_url+\"resources/images/productos/thumb_\"+registros[i][\"producto_foto\"]+\"' class='img img-\"+formaimagen+\"' width='50' height='50' />\";\r\n mimagen += \"</a>\";\r\n //mimagen = nomfoto.split(\".\").join(\"_thumb.\");77\r\n }else{\r\n mimagen = \"<img src='\"+base_url+\"resources/images/productos/thumb_image.png' class='img img-\"+formaimagen+\"' width='50' height='50' />\";\r\n }\r\n html += mimagen;\r\n html += \"</div>\";\r\n html += \"<div style='padding-left: 4px'>\";\r\n html += \"<b id='masgrande'><font size='3' face='Arial'><b>\"+registros[i][\"producto_nombre\"]+\"</b></font></b><br>\";\r\n html += \"\"+registros[i][\"producto_unidad\"]+\" | \"+registros[i][\"producto_marca\"]+\" | \"+registros[i][\"producto_industria\"]+\"\";\r\n if(registros[i][\"destino_id\"] > 0){\r\n html +=\"<br><b>DESTINO:</b> \"+registros[i]['destino_nombre'];\r\n }\r\n if(parametro_modulo == 2){\r\n html +=\"<br>Principio Activo: \"+registros[i]['producto_principioact'];\r\n html +=\"<br>Acción Terapeutica: \"+registros[i]['producto_accionterap'];\r\n }\r\n \r\n html += caracteristica;\r\n html += \"\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</td>\";\r\n var escategoria=\"\";\r\n if(registros[i][\"categoria_id\"] == null || registros[i][\"categoria_id\"] == 0 || registros[i][\"categoria_id\"] ==\"\"){\r\n escategoria = \"No definido\";\r\n }else{\r\n escategoria = registros[i][\"categoria_nombre\"];\r\n }\r\n var esmoneda=\"\";\r\n if(registros[i][\"moneda_id\"] == null || registros[i][\"moneda_id\"] == 0 || registros[i][\"moneda_id\"] == \"\"){ \r\n esmoneda = \"No definido\";\r\n }else{\r\n esmoneda = registros[i][\"moneda_descripcion\"];\r\n }\r\n html += \"<td><b>CATEGORIA: </b>\"+escategoria+\"<br><b>UNIDAD: </b>\"+registros[i][\"producto_unidad\"]+\"<br>\";\r\n html += \"<b>CANT. MIN.: </b>\";\r\n var cantmin= 0;\r\n if(registros[i][\"producto_cantidadminima\"] != null || registros[i][\"producto_cantidadminima\"] ==\"\"){\r\n cantmin = registros[i][\"producto_cantidadminima\"];\r\n }\r\n html += cantmin+\"</td>\";\r\n\r\n html += \"<td>\";\r\n var sinconenvase = \"\";\r\n var nombreenvase = \"\";\r\n var costoenvase = \"\";\r\n var precioenvase = \"\";\r\n if(registros[i][\"producto_envase\"] == 1){\r\n sinconenvase = \"Con Envase Retornable\"+\"<br>\";\r\n if(registros[i][\"producto_nombreenvase\"] != \"\" || registros[i][\"producto_nombreenvase\"] != null){\r\n nombreenvase = registros[i][\"producto_nombreenvase\"]+\"<br>\";\r\n costoenvase = \"Costo: \"+Number(registros[i][\"producto_costoenvase\"]).toFixed(2)+\"<br>\";\r\n precioenvase = \"Precio: \"+Number(registros[i][\"producto_precioenvase\"]).toFixed(2);\r\n }\r\n }else{\r\n sinconenvase = \"Sin Envase Retornable\";\r\n }\r\n html += sinconenvase;\r\n html += nombreenvase;\r\n html += costoenvase;\r\n html += precioenvase;\r\n html += \"</td>\";\r\n var codbarras = \"\";\r\n if(!(registros[i][\"producto_codigobarra\"] == null)){\r\n codbarras = registros[i][\"producto_codigobarra\"];\r\n }\r\n html += \"<td>\"+registros[i][\"producto_codigo\"]+\"<br>\"+ codbarras +\"</td>\";\r\n html += \"<td>\";\r\n if(tipousuario_id == 1){\r\n html += \"<b>COMPRA: </b>\"+registros[i][\"producto_costo\"]+\"<br>\";\r\n }\r\n html += \"<b>VENTA: </b>\"+registros[i][\"producto_precio\"]+\"<br>\";\r\n html += \"<b>COMISION (%): </b>\"+registros[i][\"producto_comision\"];\r\n html += \"</td>\";\r\n html += \"<td><b>MONEDA: </b>\"+esmoneda+\"<br>\";\r\n html += \"<b>T.C.: </b>\";\r\n var tipocambio= 0;\r\n if(registros[i][\"producto_tipocambio\"] != null){ tipocambio = registros[i][\"producto_tipocambio\"]; }\r\n html += tipocambio+\"</td>\";\r\n html += \"<td class='no-print' style='background-color: #\"+registros[i][\"estado_color\"]+\"'>\"+registros[i][\"estado_descripcion\"]+\"</td>\";\r\n\t\t html += \"<td class='no-print'>\";\r\n html += \"<a href='\"+base_url+\"producto/edit/\"+registros[i][\"miprod_id\"]+\"' target='_blank' class='btn btn-info btn-xs' title='Modificar Información'><span class='fa fa-pencil'></span></a>\";\r\n html += \"<a href='\"+base_url+\"imagen_producto/catalogoprod/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-success btn-xs' title='Catálogo de Imagenes' ><span class='fa fa-image'></span></a>\";\r\n html += \"<a class='btn btn-danger btn-xs' data-toggle='modal' data-target='#myModal\"+i+\"' title='Eliminar'><span class='fa fa-trash'></span></a>\";\r\n html += \"<a href='\"+base_url+\"producto/productoasignado/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-soundcloud btn-xs' title='Ver si esta asignado a subcategorias' target='_blank' ><span class='fa fa-list'></span></a>\";\r\n html += \"<!------------------------ INICIO modal para confirmar eliminación ------------------->\";\r\n html += \"<div class='modal fade' id='myModal\"+i+\"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel\"+i+\"'>\";\r\n html += \"<div class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<h3><b> <span class='fa fa-trash'></span></b>\";\r\n html += \"¿Desea eliminar el Producto <b> \"+registros[i][\"producto_nombre\"]+\"</b> ?\";\r\n html += \"</h3>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-footer aligncenter'>\";\r\n html += \"<a href='\"+base_url+\"producto/remove/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-success'><span class='fa fa-check'></span> Si </a>\";\r\n html += \"<a href='#' class='btn btn-danger' data-dismiss='modal'><span class='fa fa-times'></span> No </a>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para confirmar eliminación ------------------->\";\r\n html += \"<!------------------------ INICIO modal para MOSTRAR imagen REAL ------------------->\";\r\n html += \"<div class='modal fade' id='mostrarimagen\"+i+\"' tabindex='-1' role='dialog' aria-labelledby='mostrarimagenlabel\"+i+\"'>\";\r\n html += \"<div class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"<font size='3'><b>\"+registros[i][\"producto_nombre\"]+\"</b></font>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<img style='max-height: 100%; max-width: 100%' src='\"+base_url+\"resources/images/productos/\"+registros[i][\"producto_foto\"]+\"' />\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para MOSTRAR imagen REAL ------------------->\";\r\n html += \"</td>\";\r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n \r\n \r\n $(\"#tablaresultados\").html(html);\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}", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function eduMatriCursoPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('eduMatriCursoListLayer', 'O');\n\t\tvisibilidad('eduMatriCursoListButtonsLayer', 'O');\n\t\tif(get('eduMatriCursoFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:eduMatriCursoViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, eduMatriCursoChoiceColumn) + \"</A>\",\n\t\t\ti, eduMatriCursoChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\teduMatriCursoList.setDatos(datosTmp.filtrar([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\teduMatriCursoTimeStamps = datosTmp.filtrar([44],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\teduMatriCursoMorePagesFlag = true;\n\t\teduMatriCursoList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\teduMatriCursoMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('eduMatriCursoFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('eduMatriCursoListLayer', 'V');\n\tvisibilidad('eduMatriCursoListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('eduMatriCursoList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\teduMatriCursoList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(eduMatriCursoMorePagesFlag){\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(eduMatriCursoPageCount > 1){\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "function TiraComboLinha(){\n\tvar actpos = $(\"#position\").val();\n\tif(empty(actpos)){\n\t\treturn;\n\t}\n\n\t//COMBO DESEJADO\n\tvar comboMor = DIV_TABELA + \" tr[posicao=\"+actpos+\"] select[name=fa_cstpis]\";\n\n\t//INPUT SELECIONADO\n\tvar inputMor = DIV_TABELA + \" tr[posicao=\"+actpos+\"] input[name=fa_cstpis]\";\n\n\t$(inputMor).val($(comboMor).val());\n\n\t//MOSTRA INPUT\n\t$(inputMor).show();\n\n\t//ESCONDE COMBO\n\t$(comboMor).hide();\n\n\tedicao($(inputMor));\n}", "function fResultado(aRes, cId, cError, cNavStatus, iRowPag, cLlave, cEtapas) {\n\t\n\tif (cError == \"Guardar\")\n\t\tfAlert(\"Existió un error en el Guardado!\");\n\tif (cError == \"Borrar\")\n\t\tfAlert(\"Existió un error en el Borrado!\");\n\tif (cError == \"Cascada\") {\n\t\tfAlert(\"El registro es utilizado por otra entidad, no es posible eliminarlo!\");\n\t\treturn;\n\t}\n\n\tif (cError != \"\"){\n\t\tfAlert(\"Ha ocurrido un error, intente más tarde.\");\n\t}\n\n\tif (cId == \"cIdCarretera\" && cError == \"\") {\n\t\tfFillSelect(frm.iCveCarretera, aRes, true, frm.iCveCarretera.value, 0,\n\t\t\t\t1);\n\t\tfOficina();\n\t}\n\n\t\n\tif (cId == \"ListadoHist\" && cError == \"\") {\n\t\t\n\t\taRes = setStatus(aRes);\n\t\tif(parseInt(frm.iCveStatus.value)>1)\n\t\t\taRes = filterSt(aRes);\n\t\t\n\t\tFRMListado.fSetListado(aRes);\n\t\tFRMListado.fShow();\n\t\tFRMListado.fSetLlave(cLlave);\n\t}\n\t\n\n\tif (cId == \"idTramite\" && cError == \"\") {\n\t\t\n\t\tfor (var i = 0; i < aRes.length; i++) {\n\t\t\taRes[i][1] = aRes[i][2] + \" - \" + aRes[i][1];\n\t\t}\n\t\t\n\t\tfFillSelect(frm.iCveTramite, aRes, true, 0, 0, 1);\n\t\t\n\t\tfObtenCarreteras();\n\t}\n\n\tif (cId == \"cIdOficina\" && cError == \"\") {\n\t\tfFillSelect(frm.iCveOficinaFiltro, aRes, true,\n\t\t\t\tfrm.iCveOficinaFiltro.value, 0, 1);\n\t}\n}", "getMisCurso(curso, id) {\n document.getElementById(\"Curso\").value = curso[0];\n document.getElementById(\"Estudiante\").value = curso[1];\n document.getElementById(\"Profesor\").value = curso[2];\n document.getElementById(\"Grado\").value = curso[3];\n document.getElementById(\"Pago\").value = curso[4];\n document.getElementById(\"Fecha\").value = curso[5];\n inscripcionID = id;\n }", "set tramite(valor)\r\n\t{\t\t\r\n\t\t$('#idFormularioInput').val(valor.id);\r\n\t\t$('#nombreTramiteFormularioInput').val(valor.nombreTramite);\t\t\r\n\t}", "function agregaform(datos){\n \n d=datos.split('||');\n $('#codigou').val(d[0]);\n $('#nombreu').val(d[1]);\n}", "function TipoDescuento2(){\n //recuperamos el valor descuento 2 anterior\n var descuento2=document.getElementById(\"tipo_des2\").value;\n \n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento2 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento2);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n var monto= document.getElementById('tipoDescuento2').value;\n document.getElementById(\"tipo_des2\").value=monto;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-monto;\n \n //codigo de descuento la cual guardaremos\n var posicion=document.getElementById('tipodescuento2').options.selectedIndex;\n var codigoDescuento2=document.getElementById('tipodescuento2').options[posicion].value;\n document.getElementById(\"cod_des2\").value=codigoDescuento2;\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }" ]
[ "0.6364463", "0.61970794", "0.6181174", "0.6151602", "0.604923", "0.6044036", "0.60373837", "0.6027106", "0.6019904", "0.59680444", "0.59525824", "0.5949489", "0.5947865", "0.5940497", "0.59354776", "0.5911324", "0.59108806", "0.58991563", "0.58905876", "0.5886648", "0.5882309", "0.5879682", "0.5869823", "0.5863298", "0.5845339", "0.5833071", "0.58265215", "0.5804085", "0.58028644", "0.5800512", "0.5795129", "0.57896435", "0.5789639", "0.5784112", "0.5782993", "0.57775515", "0.5775497", "0.5775389", "0.57711977", "0.57660747", "0.5766057", "0.57602847", "0.57589245", "0.57578325", "0.57575244", "0.57561725", "0.5748283", "0.57475656", "0.57460773", "0.57431835", "0.5742661", "0.5735749", "0.57343495", "0.57287455", "0.57208747", "0.57199377", "0.5715733", "0.5713452", "0.57101977", "0.57062113", "0.5705035", "0.57006675", "0.57000816", "0.57000643", "0.56966376", "0.5694445", "0.56934446", "0.5685648", "0.5684003", "0.56814283", "0.5681008", "0.56797045", "0.567588", "0.5672082", "0.5671162", "0.5670084", "0.5668359", "0.5668349", "0.566624", "0.56649774", "0.5664185", "0.5663556", "0.5662011", "0.56615573", "0.5661123", "0.56586283", "0.56586045", "0.56574535", "0.56533617", "0.5653053", "0.5650347", "0.56493837", "0.56492597", "0.5647574", "0.5643705", "0.56424725", "0.56421685", "0.5640116", "0.5638219", "0.5637441", "0.56314975" ]
0.0
-1
Funcao para exibir alert com opcoes de OK ou Cancelar confirmando opcao do usuario
function confirmarAcao(acao) { if(confirm("Tem certeza que deseja incluir este paciente na fila de " + acao + "?")) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modalDialog2_handleOK (e) {\r\n\t\tvar window = e.data.window;\r\n\t\tvar form = e.data.form;\r\n\t\tvar errorDiv = e.data.errorDiv;\r\n\t\tvar waitDiv = e.data.waitDiv;\r\n\t\tvar options = e.data.options;\r\n\t\t\r\n\t\tvar action = form ? form.attr(\"action\") : \"\";\r\n\r\n\t\terrorDiv.hide();\r\n\t\tvar message = form ? form.attr(\"confirm\") : \"\";\r\n\r\n\t\tif (options.confirmationMessageFunction)\r\n \t\tmessage = options.confirmationMessageFunction();\r\n \t\r\n \tif (options.confirmationMessage)\r\n \t\tmessage = options.confirmationMessage;\r\n\t\t\r\n \tif (message)\r\n \t{\r\n\t\t\tjConfirm(message, 'Confirma\\u00E7\\u00E3o', function(result) {\r\n\t\t\t\tif (result)\r\n\t\t\t\t\tmodalDialog2_executeCommand(window, form, action, errorDiv, waitDiv, options);\r\n\t\t\t});\r\n \t}\r\n \telse\r\n \t\tmodalDialog2_executeCommand(window, form, action, errorDiv, waitDiv, options);\r\n\t}", "confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, negativeOnPress, cancelableFlag){\n Alert.alert(\n title,\n message,\n [\n {text: negativeText, onPress: negativeOnPress, style: 'cancel',},\n {text: positiveText, onPress: positiveOnPress, style : 'default'},\n ],\n {cancelable: cancelableFlag},\n ); \n }", "confirmationAlertwithOptionButton(title, message, positiveText, negativeText, skipText, positiveOnPress, negativeOnPress, skipOnPress, cancelableFlag ){\n Alert.alert(\n title,\n message,\n [\n {text: skipText, onPress: skipOnPress, style: 'destructive',},\n {text: negativeText, onPress: negativeOnPress, style : 'cancel'},\n {text: positiveText, onPress: positiveOnPress, style : 'default'},\n ],\n {cancelable: cancelableFlag},\n ); \n }", "function cent_op2()\r\n{\r\n\t'domready', Sexy = new SexyAlertBox();\r\n \tSexy.confirm('<h1>Confimar</h1><p>¿Esta seguro que desea regresar al centro de operaciones?</p><p>Pulsa \"Ok\" para continuar, o pulsa \"Cancelar\" para salir.</p>', \r\n\t{ onComplete: \r\n\t\tfunction(returnvalue) { \r\n\t\t if(returnvalue)\r\n\t\t {\r\n\t\t\tdocument.location=\"centro_op.php\";\r\n\t\t }\r\n\t\t}\r\n\t})\r\n}", "confirmationAlert(title, message, positiveOnPress, cancelableFlag){\n confirmationAlert(title, message, \"OK\", \"Cancel\", positiveOnPress, () =>{console.log('Negative Pressed')}, cancelableFlag)\n }", "function confirmCerrar() {\r\n var respuesta = confirm(\"¿Seguro que deseas Salir?\");\r\n if (respuesta == true) {\r\n return true;\r\n }else if (respuesta == false) {\r\n return false;\r\n }else{\r\n alert(\"¡Error de Confirmacion!\");\r\n }\r\n}", "function confirmationAlertYesOrNo(id_alert, message, id_form, fonction_execution) {\n\n // -- Annuler le time out actuel -- //\n clearTimeout(function_setTimeout);\n\n // -- Mise à jour de id_element -- //\n id_alert = (!id_alert) ? 'appAlert'\n : id_alert;\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n\n // -- Afficher l'alert -- //\n $('#' + id_alert).html(\n\n '<div id=\"appAlert_id\" class=\"mmalert alert alert-secondary alert-dismissible fade show\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<span aria-hidden=\"true\">&times;</span>' +\n '</button>' +\n '<div class=\"row\">' +\n '<div class=\"col-lg-12\">' +\n '<div class=\"float-left\">' +\n '<b>Information</b><br/>' +\n ((!message) ? 'Confirm action'\n : message) +\n '</div>' +\n '<div class=\"float-right\">' +\n '<button id=\"alert_message_question_bouton_non\" type=\"button\" class=\"btn btn-sm btn-default bg-white\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<i class=\"fa fa-remove\"></i> ' + 'No' +\n '</button>' +\n '<button id=\"alert_message_question_bouton_oui\" type=\"button\" class=\"btn btn-sm btn-success\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<i class=\"fa fa-check\"></i> ' + 'Yes' +\n '</button>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>'\n );\n\n // -- Annuler tous les evenement précédement chargé -- //\n $('#alert_message_question_bouton_oui').off('click');\n $('#alert_message_question_bouton_non').off('click');\n $('#appAlert_id').off('closed.bs.alert');\n\n // -- Définir les nouveaux evenements -- //\n // -- Comportement du bouton Oui -- //\n $(\"#alert_message_question_bouton_oui\").on('click',\n function () {\n // -- Fermer le message box -- //\n $('#appAlert_id').alert('close');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = true;\n }\n );\n // -- Comportement du bouton Non -- //\n $(\"#alert_message_question_bouton_non\").on('click',\n function () {\n // -- Fermer le message box -- //\n $('#appAlert_id').alert('close');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n // -- Méthode quand le message box se fermer -- //\n $('#appAlert_id').on('closed.bs.alert',\n function () {\n // -- Activer/Desactiver formulaire -- //\n enableOrDisableForm(id_form, false);\n\n // -- Si la réponse est non -- //\n if (!$Confirmation_message_box) {\n return false;\n }\n\n // -- Si l'id est passé -- //\n if (id_form) {\n $(\"#\" + id_form).submit();\n }\n // -- Executer la fonction -- //\n else {\n fonction_execution();\n }\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n\n // -- Activer/Desactiver formulaire -- //\n enableOrDisableForm(id_form, true);\n\n // -- Ne pas fermer si la valeur est -1 -- //\n if ($DureeVisibiliteMessageBox > 0) {\n // -- Supprimer l'alert après un temps défini -- //\n function_setTimeout =\n setTimeout(\n function () {\n // -- Fermer l'alert -- //\n $('#appAlert_id').alert('close');\n },\n $DureeVisibiliteMessageBox\n );\n }\n\n}", "function alertaCancelar() {\n\n var mensaje;\n\tvar opcion = confirm(\"¿Desea volver a la pagina anterior?\");\n\t\n if (opcion == true) {\n\t\thistory.go(-1)\n\t\t\n\t} else {\n\t\tmensaje = \"Has clickeado Cancelar\";\n\t}\n}", "handleConfirm() {\n Alert.alert(\n \"Finaliser le regroupement de commandes\",\n \"Avant de finaliser ce bon, veuillez indiquer s'il est complet ou incomplet.\",\n [\n {text: 'Complet', onPress: () => this.sendConfirm(true) },\n {text: 'Incomplet', onPress: () => this.sendConfirm(false) }\n ],\n { cancelable: true }\n )\n }", "confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, cancelableFlag){\n confirmationAlert(title, message, positiveText, negativeText, positiveOnPress, () =>{console.log('Negative Pressed')}, cancelableFlag)\n }", "function confirm(confirmCallback, denyCallback)\n{\n\t$.jAlert({'type': 'confirm', 'onConfirm': confirmCallback, 'onDeny': denyCallback });\n}", "function confirmStampe() {\n\tvar message = \"Al termine dell'operazione verra' inviata un'email di riepilogo a [email protected].\\nConfermi?\";\n\treturn confirm(message);\n}", "promptAreYouSure(message, cb) {\n vscode_1.window\n .showWarningMessage(message, { modal: true }, { title: 'Yes', isCloseAffordance: false }, { title: 'No', isCloseAffordance: true })\n .then(answer => {\n if (answer.title === 'Yes') {\n cb();\n }\n });\n }", "function confirmacion() {\r\n\treturn confirm(\"Esta seguro de eliminar el registro?\");\r\n}", "function confirmCancel() {\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.close();\n document.getElementById(\"resultTxt\").innerHTML=\"Confirm result: false\";\n}", "function handleConfirmResponse(confirmWin)\n{\n\tvar dialogResponse = confirmWin.returnValue == \"ok\" || confirmWin.returnValue == \"continue\";\n\tCheckForErrors(dialogResponse);\n}", "function confirmBorrarCliente() {\r\n var respuesta = confirm(\"¿Seguro que deseas Borrar el Cliente?\");\r\n if (respuesta == true) {\r\n return true;\r\n }else if (respuesta == false) {\r\n return false;\r\n }else{\r\n alert(\"¡Error de Confirmacion!\");\r\n }\r\n}", "function ntOk() {\n removeMask();\n $('#nt-confirm-box').hide();\n if (nt.confirm_ok_callback)\n nt.confirm_ok_callback();\n nt.confirm_ok_callback = null;\n}", "function preguntarSiNo(codigo){\r\n\talertify.confirm('Eliminar Proveedor', '¿Esta seguro de eliminar este Proveedor?', \r\n\t\t\t\t\tfunction(){ eliminarDatos(codigo) }\r\n , function(){ alertify.error('Se cancelo')});\r\n}", "function userAcceptConfirm() {\n\t\n\tvar user_id = $('#modal_user_id').val();\n\tvar user_type = $('#user_type').val();\n\n\t$(\"#user_accept_alert_msg\").css(\"display\",\"none\");\n\t$(\"#user_accept_yes_btn\").button('loading');\n\t$(\"#user_accept_no_btn\").attr(\"disabled\",true);\n\n\t$.post(basePath+\"/users/acceptuser\", { q: 1, user_id: user_id, user_type:user_type }, function( data ) {\n\n\t\t$(\"#user_accept_no_btn\").attr(\"disabled\",false);\n\t\t$(\"#user_accept_yes_btn\").button('reset');\n\t\tif(data.success == false) {\n\t\t\t//$(\"#user_accept_yes_btn\").button('reset');\n\t\t\t$(\"#user_accept_alert_msg\").html(data.data.msg);\n\t\t\t$(\"#user_accept_alert_msg\").css(\"display\",\"block\");\n\t\t\treturn false;\n\t\t}\n\t\tif(data.success == true) {\n\t\t\t//$(\"#user_accept_yes_btn\").button('reset');\n\t\t\t$(\"#user_accept_alert_msg\").html(data.data.msg);\n\t\t\t$(\"#user_accept_alert_msg\").css(\"display\",\"block\");\n\t\t\twindow.location.reload();\n\t\t}\n\t},'json');\n\n}", "function confirmRejectAction()\r\n{\r\n if(confirm(\"Are You Sure To Reject The Property ..!!\")){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "function comprobar_envio(mensaje) {\n\tif (confirm(mensaje))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "showConfirmBox(title, content, detail) {\r\n return this.showMessageBox({\r\n buttons: ['Yes', 'No'],\r\n message: content,\r\n title,\r\n detail,\r\n defaultId: 1,\r\n cancelId: 1,\r\n type: 'warning',\r\n noLink: true,\r\n }).then((answer) => {\r\n return (answer == 0);\r\n });\r\n }", "function confirmarAcao(acao) {\n if(confirm(\"Tem certeza que deseja \" + acao + \" ?\")) {\n return validarDados();\n }\n else {\n return false;\n }\n}", "confirm() {}", "function confirmIt(){\n var r = confirm(\"You clicked the confirm box\");\n if (r == true){\n alert('You pressed OK');\n } \n else {\n var s = confirm('Do you want to cancel');\n if (s == false){\n alert('Glad you didnt cancel');\n }\n }\n}", "function Confirmacion(Texto) {\n //var seleccion = confirm(\"acepta el mensaje ?\");\n var seleccion = confirm(Texto);\n return seleccion;\n}", "function ConfirmDialog(){\r\n\r\n \r\n \r\n }", "function confirmExit(buttonIndex){\n //Success Callback function of confirmAlerter method\n if (buttonIndex==1) toastAlert(\"You have Clicked Ok Button\");//Based on the button pressed alerts shown\n else toastAlert(\"You have Clicked Cancel Button\")\n}", "function myFunc3() {\n var msg;\n if(confirm(\"You must click OK to continue or CANCEL to cancel\")){\n msg = \"You pressed OK\"\n }\n else {\n msg = \"You pressed CANCEL\"\n }\n document.getElementById(\"id3\").innerHTML = msg;\n}", "function confirmExtraTurn(){\n return confirm('Quieres jugar otro turno?');\n }", "function confirm() {\r\n var bReturn = false, a, msg, i, options = {\r\n ok: undefined,\r\n cancel: undefined,\r\n option: undefined,\r\n onOpen: undefined,\r\n onClose: undefined\r\n };\r\n\r\n // Process variable number of arguments.\r\n for (i = 0; i < arguments.length; i++) {\r\n a = arguments[i];\r\n if (typeof a === \"string\") {\r\n if (!msg) {\r\n msg = a;\r\n } else if (!options.ok) {\r\n options.ok = a;\r\n } else {\r\n options.cancel = a;\r\n }\r\n } else if (typeof a === \"function\") {\r\n options.onClose = a;\r\n } else {\r\n options = $.extend(options, a);\r\n }\r\n }\r\n\r\n function onOpen(dialogEl) {\r\n var dialog_ok_btn = dialogEl.find(\".ok\"), dialog_cancel_btn = dialogEl.find(\".cancel\"), dialog_option_btn;\r\n\r\n // Set OK button text.\r\n if (options.ok) {\r\n dialog_ok_btn.text(options.ok);\r\n } else {\r\n dialog_ok_btn.text(dialog_ok_btn.attr(\"data-default\"));\r\n }\r\n\r\n // Set Cancel button text.\r\n if (options.cancel) {\r\n dialog_cancel_btn.text(options.cancel);\r\n } else {\r\n dialog_cancel_btn.text(dialog_cancel_btn.attr(\"data-default\"));\r\n }\r\n\r\n // Change the message. If wider than 320 pixels change new lines to <br>.\r\n dialogEl.focus().find(\".msg\").html(msg.replace(/\\n/g, (document.body.offsetWidth > 320 ? \"<br>\" : \" \")));\r\n\r\n // If the user clicks ok, set the return value.\r\n dialogEl.find(\".ok\").on(\"click.confirm\", function () {\r\n bReturn = true;\r\n });\r\n\r\n // Add option button if requested.\r\n if (options.option) {\r\n // Create option button.\r\n dialog_option_btn = $(settings.confirm.option_btn_start + options.option + settings.confirm.option_btn_end);\r\n // Add it to the form.\r\n dialog_cancel_btn.before(dialog_option_btn);\r\n // If the user clicks ok, set the return value to the option button text.\r\n dialog_option_btn.on(\"click.confirm\", function (event) {\r\n event.stopPropagation();\r\n // Return the text of the button.\r\n bReturn = options.option;\r\n });\r\n }\r\n\r\n // If the user presses the Enter key, set the return value as if they\r\n // clicked the OK button.\r\n checkEnter(\"confirm\", function () {\r\n bReturn = true;\r\n });\r\n\r\n if (typeof options.onOpen === \"function\") {\r\n options.onOpen(dialogEl);\r\n }\r\n\r\n return dialogs.confirm.dialog;\r\n }\r\n\r\n function onClose(dialogEl) {\r\n if (typeof dialogEl === \"function\") {\r\n options.onClose = dialogEl;\r\n return dialogs.confirm.dialog;\r\n }\r\n\r\n // remove click handlers and option button.\r\n dialogEl.find(\".ok, .\" + settings.confirm.option_btn_class).off(\"click.confirm\");\r\n if (options.option && !settings.replace) {\r\n dialogEl.find(settings.confirm.option_btn_class).remove();\r\n }\r\n\r\n // Call the callback function with a return value.\r\n if (typeof options.onClose === \"function\") {\r\n options.onClose(bReturn);\r\n }\r\n return dialogs.confirm.dialog;\r\n }\r\n\r\n // Overwrite onClose method with confirm onClose method.\r\n open(\"confirm\", onOpen).onClose = onClose;\r\n return dialogs.confirm.dialog;\r\n }", "function prozori() {\n confirm(\"Odabrali ste nacin placanja Gotovina\");\n}", "promptCheck(message) {\n return window.confirm(message)\n }", "function mostrarDialogoConfirmacion(){\n\t$('#dialog-confirm-001').dialog('open');\n\treturn false;\n}", "function confirmarTransaccion(mensaje) {\n\n return confirm(mensaje);\n\n }", "function confirm() {\n ctrl.data.successHandler(ctrl.installer).success(function(){\n $uibModalInstance.dismiss('cancel');\n });\n\n }", "function confirmUser() {\n resetOutput();\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.showModal();\n}", "function confirm() {\n if (angular.isDefined(ctrl.data.successHandler)) {\n if(ctrl.testcase.name){\n ctrl.data.successHandler(ctrl.name, ctrl.testcase).success( function(){\n $uibModalInstance.close();\n })\n }\n else{\n ctrl.data.successHandler(ctrl.name, ctrl.testcase)\n }\n }\n }", "function areUSure() {\n if(confirm(\"Вы уверены?\")){\n return true;\n }else{\n return false;\n }\n}", "function confirm() {\n ctrl.data.successHandler(ctrl.scenario).success(function(){\n $uibModalInstance.dismiss('cancel');\n });\n\n }", "function dialog(text, type, onConfirm) {\n let box = $(admin).find('.sb-dialog-box').attr('data-type', type);\n $(box).find('p').html((type == 'alert' ? sb_('Are you sure?') + ' ' : '') + sb_(text));\n $(box).sbActivate().css({ 'margin-top': ($(box).outerHeight() / -2) + 'px', 'margin-left': ($(box).outerWidth() / -2) + 'px' });\n $(overlay).sbActivate();\n alertOnConfirmation = onConfirm;\n }", "function confirmBorrar() {\r\n var respuesta = confirm(\"¿Seguro que deseas Borrar el Registro?\");\r\n if (respuesta == true) {\r\n return true;\r\n }else if (respuesta == false) {\r\n return false;\r\n }else{\r\n alert(\"¡Error de Confirmacion!\");\r\n }\r\n}", "function showPromptAllStudent(obj) {\n var ui = SpreadsheetApp.getUi(),\n result = ui.alert(obj.appName,\n 'Are you sure you want to email all students?',\n ui.ButtonSet.YES_NO);\n\n if (result == ui.Button.YES) {\n return success(obj.appName, 'All students will be emailed.',\n true);\n }\n return fail(obj.appName, 'Emailing all students was cancelled.');\n}", "function confermaUscita()\n{\n\tnavigator.notification.confirm(\n\t\t'Vuoi davvero chiudere la app?', \n\t\texitFromApp, \n\t\t'Uscita', \n \t\t'OK,Annulla');\n}", "function areYouSure(){\n confirm('Are you sure?');\n}", "function confirmationYesOrNo(message, id_soumission, fonction_execution) {\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n\n // -- Mise à jour du message -- //\n $('#modal_message_question_message').html(\n (!message) ? 'Confirm action'\n : message\n );\n // -- Annuler tous les evenement précédement chargé -- //\n $('#modal_message_question_bouton_oui').off('click');\n $('#modal_message_question_bouton_non').off('click');\n $('#modal_message_question').off('hidden.bs.modal');\n\n // -- Définir les nouveaux evenements -- //\n // -- Comportement du bouton Oui -- //\n $(\"#modal_message_question_bouton_oui\").on('click',\n function () {\n // -- Cacher le message box -- //\n $('#modal_message_question').modal('hide');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = true;\n }\n );\n // -- Comportement du bouton Non -- //\n $(\"#modal_message_question_bouton_non\").on('click',\n function () {\n // -- Cacher le message box -- //\n $('#modal_message_question').modal('hide');\n // -- Mise à jour de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n // -- Méthode quand le message box se fermer -- //\n $(\"#modal_message_question\").on('hidden.bs.modal',\n function () {\n // -- Si la réponse est non -- //\n if (!$Confirmation_message_box) {\n return false;\n }\n\n // -- Si l'id est passé -- //\n if (id_soumission) {\n $(\"#\" + id_soumission).submit();\n }\n // -- Executer la fonction -- //\n else {\n fonction_execution();\n }\n\n // -- Initialisation de la réponse -- //\n $Confirmation_message_box = false;\n }\n );\n\n // -- Afficher le message box -- //\n $('#modal_message_question').modal('show');\n\n}", "function DialogAlertConfirm(msg, nombrefuncion) {\n\n if (cleanStr(msg) === \"\") {\n msg = \"Esta seguro que desea realizar esta operacion?\";\n }\n\n if (cleanStr(nombrefuncion) != \"\") {\n var booleano = true;\n nombrefuncion = nombrefuncion + \"(\" + booleano + \");\";\n } else {\n nombrefuncion = \"#\";\n }\n\n var dialogalert = \"\";\n dialogalert += '<div class=\"modal fade dialogbox\" id=\"DialogAlertConfirm\" data-bs-backdrop=\"static\" tabindex=\"-1\" role=\"dialog\">';\n dialogalert += '<div class=\"modal-dialog\" role=\"document\">';\n dialogalert += '<div class=\"modal-content\">';\n dialogalert += '<div class=\"modal-header\">';\n dialogalert += '<h5 class=\"modal-title\">MENSAJE IMPORTANTE</h5>';\n dialogalert += '</div>';\n dialogalert += '<div class=\"modal-body\">';\n dialogalert += msg;\n dialogalert += '</div>';\n dialogalert += '<div class=\"modal-footer\">';\n dialogalert += '<div class=\"btn-inline\">';\n dialogalert += '<a href=\"#\" class=\"btn btn-text-danger\" data-bs-dismiss=\"modal\">';\n dialogalert += '<ion-icon name=\"close-outline\"></ion-icon>';\n dialogalert += 'CANCELAR';\n dialogalert += '</a>';\n dialogalert += '<button onclick=\"' + nombrefuncion + '\" class=\"btn btn-text-primary\" data-bs-dismiss=\"modal\">';\n dialogalert += '<ion-icon name=\"checkmark-outline\"></ion-icon>';\n dialogalert += 'ACEPTAR';\n dialogalert += '</a>';\n dialogalert += '</div>';\n dialogalert += '</div>';\n dialogalert += '</div>';\n dialogalert += '</div>';\n dialogalert += '</div>';\n document.getElementById(\"divdialogalert\").innerHTML = \"\";\n document.getElementById(\"divdialogalert\").innerHTML = dialogalert;\n $(\"#DialogAlertConfirm\").modal('show');\n\n}", "verifyEditCedula() {\n if (this.cedulaWarning === true) {\n let Message = 'Advertnecia, Modificar la cedula podria ocacionar fallos en el sistema, ';\n Message = Message + 'se recomienda hacerlo solo en casos excepcionales. ';\n Message = Message + 'Queda bajo su responsabilidad los daños ocacionados por esta accion';\n const response = confirm(Message);\n if (response === true) {\n this.cedulaWarning = false;\n }\n else {\n this.cedulaWarning = true;\n }\n }\n }", "function alert(message, title) {\n if (!title) {\n title = '系统提示'\n }\n return Dialog.create({\n title: title,\n message: message,\n ok: '确认',\n persistent: true\n })\n}", "function promptConfirm(message, callback, detail, buttons)\n{\n\tif (navigator.notification != undefined && navigator.notification.confirm != undefined)\n\t{\t\t\n\t\tnavigator.notification.confirm(detail, function(choice)\n\t\t{\n\t\t\tif (choice == 1) callback();\n\t\t}, message, buttons);\n\t}\n\telse if (confirm(message) == true)\n\t{\n\t\tcallback();\n\t}\n}", "async function handleCancel() {\n if (\n name !== \"\" ||\n cpf_cnpj !== \"\" ||\n rg !== \"\" ||\n phone !== \"\" ||\n email !== \"\"\n ) {\n confirmationAlert(\n \"Atenção!\",\n \"Deseja realmente CANCELAR esse cadastro? Os dados não salvos serão perdidos.\",\n \"clearFields\"\n );\n }\n }", "function confirmDialog() {\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.close();\n document.getElementById(\"resultTxt\").innerHTML=\"Confirm result: true\";\n}", "function confirm_action(){\n\tif (confirm(\"Are you sure?\")) {\n return true;\n }\n else{\n \treturn false;\t\n }\n}", "fileWarning (Message, OptionA, OptionB, ActionA, ActionB) {\n dialog.showMessageBox({\n type: 'warning',\n buttons: [OptionA, OptionB], // string\n title: 'Unsaved Work',\n message: Message\n }, function (rdata) {\n if (rdata === 0) {\n ActionA()\n } else if (rdata === 1) { ActionB() }\n })\n }", "function ShowCheckDialog(message=\"Do you really submit?\", message2=null) {\n if (!confirm(message)) {\n event.preventDefault();\n } else if (message2 && !confirm(message2)) {\n event.preventDefault();\n }\n}", "function okAlertDialog () {\n\terrorspan\n\t}", "function confirmation() {\n\t\treturn confirm(\"Certain de faire cela ?\");\n\t}", "submitSave() {\n confirmAlert({\n title: 'Confirm To Save',\n message: 'Are you sure you want to do this?',\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.saveData()\n },\n {\n label: 'No',\n onClick: () => { }\n }\n ],\n closeOnEscape: true,\n closeOnClickOutside: true\n });\n }", "function ConfirmarBoton(controlar) {\n\n\tif (controlar==\"si\") {\n\t\tresp=confirm(\"¿Está seguro que desea borrar el registro?\") \n\t\tif(resp) return true;\n\t\telse return false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function confirmBox(message, btnOk, btnCancel, onOkFn) {\n\t\tvar padTop = \"10px\";\n\t\tif (message.length <= 40)\n\t\t\tpadTop = \"25px\";\n\t \tvar fn = \"parent.closeBox(\\\"response\\\")\";\n\t \tif (onOkFn!=null)\n\t \t\tfn = fn + \";\" + onOkFn;\n\t\tvar html = \"<!doctype html><html><head><style>html, body {height:100%; margin:0px; overflow-y:hidden} div {margin:0px;padding:0px;}</style></head>\" + \n\t\t\"<body><div style='font-family:Arial;font-weight:normal;font-size:10pt;text-align:center;height:60%;width:100%;'><div style='padding-top:\" + padTop +\";'>\" + message + \"</div></div>\";\n\t\thtml = html + \"<div style='text-align:center;height:40%;width:100%;background-color:#e9e9e9;padding-top:10px;'><button id='btnOK' onclick='\" + fn + \"'>\" + btnOk + \"</button>\";\n\t\tif (btnCancel!=null)\n\t\t\thtml = html + \"&nbsp;<button onclick='parent.closeBox(\\\"response\\\")'>\" + btnCancel + \"</button>\";\n\t\thtml = html + \"</div></body></html>\";\n\t\tshowBox(\"response\", 300,120, null, true, false, html);\n\t\tvar f = window.frames[\"response_iframe\"];\n\t\tif (btnCancel==null)\n\t\t\tf.document.getElementById(\"btnOK\").focus();\n}", "function pregunta2(){\n var confirmacion = false;\n //control es la variable que controla que la llamada siempre este activa\n //si el control es falso \n if(control == false){\n confirmacion = confirm(\"Usted ya puede crear aristas\"); //se mostra un mensaje de que se activaran las llamadas\n //si la confirmacion del usuario es afirmativa\n if(confirmacion) control = !control; //se procedera a cambiar el valor del control\n document.getElementById(\"btn-2\").focus();\n }\n //si no es el caso del control falso y sea verdadero\n else if (control == true){\n confirmacion = confirm(\"Usted ya no puede crear aristas\"); //se mostrara un mensaje que notificara que las llamdas se desactivaran\n //si la confirmacion del usuario es afirmativa\n if(confirmacion) control = !control; //se procedera a cambiar el valor del control\n document.getElementById(\"btn-2\").blur();\n }\n}", "function confirmApproveAction()\r\n{\r\n if(confirm(\"Are You Sure To Approve The Property ..!!\")){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "function confirmInput() {\n\talert(\"Your input is: \\n Username: \" + sUser + \n\t \"\\n PW: \" + sPassword );\n\t}", "function confirmMessage(msg, callback) {\r\n\r\n\t\t$(\"#general-dialog-text\").html(msg);\r\n\t\t$(\"#general-dialog\").dialog({\r\n\t\t\tresizable: false,\r\n\t\t\tmodal: true,\r\n\t\t\tbuttons: {\r\n\t\t\t\t\"Si\": function() {\r\n\t\t\t\t\t$(this).dialog( \"close\" );\r\n\t\t\t\t\tif (callback) {\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"No\": function() {\r\n\t\t\t\t\t$(this).dialog( \"close\" );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "alert(title, message, positiveText, positiveOnPress, cancelableFlag){\n Alert.alert(title, message,[{text: positiveText, onPress: positiveOnPress},], {cancelable: cancelableFlag}); \n }", "function confirmCheck()\r\n{\r\n\tresponse = confirm(\"Are you sure you want to save these changes?\");\r\n\tif(response)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "showExitConfirmation() {\n var res = confirm(\"Changes won't be saved! Are you sure you want to close?\") ? undefined : true\n return res\n }", "function optionsAlert () {\n alert(\"You can't use this command here.\")\n}", "ask(message) {\n return window.confirm(message);\n }", "function ok() {\n\n // TODO Don't add checks until they clear\n $rootScope.currentUser.balance += $ctrl.total;\n\n $uibModalInstance.close();\n }", "function confirm() {\n var custom = ctrl.custom;\n if(custom!=\"\" && custom!=undefined ){\n ctrl.customs = custom.split(/[ ,]+/).filter(Boolean);\n }\n ctrl.data.successHandler(ctrl.customs);\n $uibModalInstance.dismiss('cancel');\n\n }", "function confirmValidation(input) {\n if (input !== \"Yes\" || input !== \"No\" || input !== \"y\" || input !== \"n\") {\n return \"Incorrect asnwer\";\n } else if (input === \"No\" || input === \"n\") {\n process.exit();\n } else {\n return true;\n }\n}", "function showDialog($type){\n\tif($type == dltOK){\n\n\t}else if($type == dltValidate) {\n\t\tswal(\"Warning\", \"Please check your input key.\",\"warning\");\n\t}\n}", "@action\n confirmAction() {\n this.confirm(this.role);\n this.close();\n }", "function conf_session2()\r\n{\r\n 'domready', Sexy = new SexyAlertBox();\r\n Sexy.confirm('<h1>Confimar</h1><p>¿Deseas cerrar la sesion actual?</p><p>Pulsa \"Ok\" para continuar, o pulsa \"Cancelar\" para salir.</p>', \r\n\t{ onComplete: \r\n\t\tfunction(returnvalue) { \r\n\t\t if(returnvalue)\r\n\t\t {\r\n\t\t\tdocument.location=\"destroy.php\";\r\n\t\t }\r\n\t\t}\r\n\t}) \r\n}", "confirmationModalView() {\n Alert.alert(\n 'Are you sure that you save your mnemonic?',\n 'If no please do it again to not to loose access to your files in future.',\n [\n { text: 'YES', onPress: this.redirectToLoginScreen.bind(this) },\n { text: 'NO', onPress: this.cancelConfirmation.bind(this) },\n ],\n { cancelable: false }\n );\n }", "function alertUser() {\n resetOutput();\n let alertDialog = document.getElementById(\"alertCustomDialog\");\n alertDialog.showModal();\n\n}", "alertInfo2Options(title, msg, onPressOK = () => {}, onPressCancel = () => {}) {\n \tAlert.alert(title, msg, [\n \t\t{text: langs.ok, onPress: onPressOK},\n \t\t{text: langs.cancel, onPress: onPressCancel},\n \t]);\n }", "function confirm() {\n ctrl.data.successHandler(ctrl.name,ctrl.data.name).success( function() {\n $uibModalInstance.dismiss('cancel');\n })\n }", "alert(title, message, positiveText){\n alert(title, message, positiveText, () =>{console.log('Possitive Pressed')}, true); \n }", "function showConfirmationDialog() {\r\n\tconfirmationDialog = generateDialog(language.data.account_deleted, '<p>' + language.data.account_del_successful + '</p><input class=\"input-button\" type=\"submit\" id=\"okay\" value=\"' + language.data.okay + '\" />');\r\n\topenDialog(confirmationDialog);\r\n\t$('input#okay').click(function() {closeDialog(confirmationDialog);});\r\n}", "function confirmSubmit()\n\t{\n\t\tvar agree=confirm(\"¿Está seguro de eliminar este registro? !!!EL PROCESO ES IRREVERSIBLE!!!\");\n\t\tif (agree){\n\t\t \treturn true ;\n\t\t}else{\n\t\t \treturn false ;\n\t\t}\n\t}", "function errorDialog(status){\n window.alert(\"Chyba pri naÄŤĂ­tanĂ­ Ăşdajov zo servera.\\nStatus= \"+status);\n}", "function alertUI(title, msg) {\n\t$('#dialog-error-msg').html(msg);\n\t$('#dialog-error').dialog(\n\t\t\t'option', \n\t\t\t'buttons',\n\t\t\t{\n\t\t\t\t\"Accept\": function() { \n\t\t\t\t\t$('#dialog-error').dialog(\"close\"); \n\t\t\t\t}\n\t\t\t}\n\t);\n\t\n\t$('#dialog-error').dialog('option', 'title', title);\n\t$('#dialog-error').dialog('open');\n}", "function mensajes(respuesta){\n\n\t\t\t\tvar foo = respuesta;\n\n\t\t\t\t\tswitch (foo) {\n\n\t\t\t\t\t\tcase \"no_exite_session\":\n\t\t\t\t\t\t//============================caso 1 NO EXISTE SESSION==================//\n\t\t\t\t\t\tswal(\n\t\t\t\t\t\t\t\t'Antes de comprar Inicia tu Session en la Pagina?',\n\t\t\t\t\t\t\t\t'Recuerda si no tienes cuenta en la pagina puedes registrarte?',\n\t\t\t\t\t\t\t\t'question'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\tcase \"saldo_insuficiente\":\n\t\t\t\t\t\t//==============CASO 2 SALDO INSUFICIENTE=======================//\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\ttitle: 'Oops...',\n\t\t\t\t\t\t\ttext: 'Tu saldo es insuficiente para poder realizar la trasaccion, recarga tu monedero e intenta de nuevo',\n\t\t\t\t\t\t\tfooter: 'Puedes recargas tu saldo con nostros mas informacion en nuestras redes sociales'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tbreak;\n\n\n\n\t\t\t\t\t}\n\t\t\t}", "function actionCanceled() { \n\tOK = 3;\n\tdlg.hide();\n}", "function onConfirm(button) {\n if(button==2){//If User selected No, then we just do nothing\n return;\n }else{\n navigator.app.exitApp();// Otherwise we quit the app.\n }\n}", "function jqAlert(title, msg, okFunc) {\r\n var shutting = false;\r\n $(\"#confirmDialog .message\").empty();\r\n $(\"#confirmDialog .message\").html(msg);\r\n $(\"#confirmDialog\").dialog({ buttons: {\r\n \"OK\": function () { shutting = true; $(this).dialog(\"close\"); if (okFunc != undefined) { okFunc(); }; }\r\n },\r\n title: title,\r\n close: function (event, ui) { if (!shutting) { if (okFunc != undefined) { okFunc(); }; }; },\r\n width: 500,\r\n modal: true,\r\n position: [(($('body')[0].offsetWidth / 2) - 250), 'center']\r\n });\r\n return false;\r\n}", "function cAlert(message, idElementFocus, tipo, fnSuccessName, fnSuccessName2) {\n\n\t// verifica mensaje\n\tvar n = message.length;\n\tvar ancho = 320;\n\tvar alto = 170;\n\tif (n > 40) {\n\t\tancho = 400;\n\t\talto = 200;\n\t}\n\n\t//tipo:0\n\tif (tipo == \"0\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">'\n\t\t\t\t+ message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t// carga dialog\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Aceptar\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t\t// enfoca control\n\t\t\t\tidElementFocus = \"#\" + $.trim(idElementFocus);\n\t\t\t\t$(idElementFocus).focus();\n\t\t\t}\n\t\t});\n\n\t//tipo:1\n\t} else if (tipo == \"1\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">'\n\t\t\t\t+ message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Aceptar\" : function() {\n\t\t\t\t\twindow.location.href = \"inicio.htm\";\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t\twindow.location.href = \"inicio.htm\";\n\t\t\t}\n\t\t});\n\n\t//tipo:2\n\t} else if (tipo == \"2\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">' + message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : 375,\n\t\t\theight : 200,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Sí, satisfactoriamente\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"Generar PDF nuevamente\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName2 != \"\" && fnSuccessName2 != null){\n\t\t\t\t\t\teval(fnSuccessName2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t}\n\t\t});\n\t\t\n\t//tipo:3\n\t} else if (tipo == \"3\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">' + message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Realizar Nuevo Registro\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"Ir al Menú Principal\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName2 != \"\" && fnSuccessName2 != null){\n\t\t\t\t\t\teval(fnSuccessName2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t}\n\t\t});\n\t}\n\n}", "function confirmMessage(obj) {\n var msg = \"\" + obj;\n ans = confirm(msg);\n return ans;\n}", "function confirmMessage(obj) {\n var msg = \"\" + obj;\n ans = confirm(msg);\n return ans;\n}", "function eliminarventa() {\n\n var mensaje = confirm(\"¿Desea Eliminar Un accidente?\")\n\n if (mensaje) {\n alert(\"Accidente Eliminado\");\n }\n\n }", "function alertMessage(whichChange, extraInfo){\n \t\"use strict\";\n return new Promise((resolve,reject)=>{\n if (whichChange === \"onLoan\") {\n alert(\"This book is currently on loan to another user until \" + extraInfo);\n }\n if (whichChange === \"userAdded\"){\n alert(\"User has been added with a unique barcode of \" + extraInfo);\n }\n resolve();\n });\n}", "function confirm_dialog(mensaje) {\n\n var contenido='<div id=\"mensaje\">';\n\t contenido+='<p style=\"color:black; text-align:center;\" class=\"mensaje\">Esta Seguro de '+mensaje+' el Usuario?</p>';\n\t\t contenido+='<div class=\"botones\" style=\"text-align:center;\">';\n\t\t contenido+='<a href=\"#\" style=\"color:#fff;\" id=\"aceptar\" class=\"btn btn-primary\">Aceptar</a>';\n\t\t contenido+='<a href=\"#\" style=\"color:#fff; margin-left:10px;\" id=\"cancelar\" class=\"btn btn-primary\">Cancelar</a>';\n\t\t contenido+='</div>'\n\t contenido+='</div>';\n\t \n\t modals(\"Informaci&oacute;n <i class='icon-question-sign'></i>\",contenido);\n\t \n\t $(\"#aceptar\").click(function(){\n\t\n\t\tvar cuanto=$(\".cedula_super\").length;\n\t\tif(cuanto >0){\n\t\t\tvar cedula=$(\".cedula_super\").html();\n\t\t\tvar estado=$(\".estado_super\").html();\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\turl:'activar_super.php',\n\t\t\t\ttype:'POST',\n\t\t\t\tdata:\"cedula=\"+cedula+\"&estado=\"+estado,\n\t\t\t\tsuccess:function(data){\n\t\t\t\t\t//document.write(data); return false;\n\t\t\t\t\tif(data=='3'){\n\t\t\t\t\t\t$(\".mensaje\").html(\"\");\n\t\t\t\t\t\t$(\".mensaje\").html('No se puede inactivar el usuario porque esta cubriendo un turno');\n\t\t\t\t\t\t$(\"#cancelar\").css(\"display\",\"none\");\n\t\t\t\t\t\t $(\"#aceptar\").click(function(){\n\t\t\t\t\t\t\t$('#myModal2').modal('hide');\n\t\t\t\t\t\t });\t \t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(data=='1'){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".mensaje\").html(\"\");\n\t\t\t\t\t\t$(\".mensaje\").html('Se hicieron los cambios correctamente');\n\t\t\t\t\t\t $(\"#content\").load('supernumerario_catalogo.php');\n\t\t\t\t\t\t $(\"#cancelar\").css(\"display\",\"none\");\n\t\t\t\t\t\t$(\"#aceptar\").click(function(){\n\t\t\t\t\t\t\t$('#myModal2').modal('hide');\n\t\t\t\t\t\t })\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\t\n\t\t}\n\t\treturn false;\n\t });\n\t \n\t $(\"#cancelar\").click(function(){\n\t\t$('#myModal2').modal('hide');\n\t });\n\t \n\t \n}", "function statusConfirm(text, confirm, func) {\r\n\t\tvar content = '<form id = \"statusConfirm\">' + text + '<input type = \"submit\" value = \"'+ confirm +'\" /></form>';\r\n\t\t\r\n\t\topenStatusMessage(content);\r\n\t\t\r\n\t\tif(!func)\r\n\t\t\tvar callback = function(e) { e.preventDefault(); closeStatusMessage(); }\r\n\t\telse \r\n\t\t\tvar callback = function(e) { e.preventDefault(); closeStatusMessage(func); }\r\n\t\t\r\n\t\t$('#statusConfirm').submit(callback);\r\n\t\t\r\n\t}", "function functionAlert(theId, msg, myYes) {\n //debug(\"msg: \" + msg + \", myYes: \" + myYes + \", theID: \" + theId)\n var confirmBox = $(\"#\" + theId.replace(/ /g, \"\\\\ \") + \".confirm\");\n confirmBox.find(\".message\").text(msg);\n confirmBox.find(\".yes\").unbind().click(function() {\n confirmBox.hide();\n });\n confirmBox.find(\".yes\").click(myYes);\n confirmBox.show();\n }", "function verify_action(container, url, alert_msg, confirm_msg) {\n if ($(container).style.display == \"none\") {\n if ((confirm_msg.length == 0) || ((confirm_msg.length > 0) && confirm(confirm_msg))) {\n new Ajax.Request(url, {asynchronous:true, evalScripts:true});\n return false;\n }\n } else {\n alert(alert_msg);\n }\n return true;\n}", "function verifForm2(f){\n\n var telOk = verifTel(f.tel) ; \n var mailOk = verifMail(f.mail) ; \n var siteOk = verifLink(f.site) ;\n \n \n\n if (telOk || mailOk || siteOk ) {\n alert(\"Votre annonce a bien été envoyée, elle sera confirmée par nos équipes\");\n return true;\n } \n \n else{ \n \n alert(\"Veuillez remplir correctement tous les champs\");\n return false;\n }\n \n }", "function irAAgregarMaestro(){\r\n\tvar msg = \"Desea Agregar un NUEVO REGISTRO?.. \";\r\n\tif(confirm(msg)) Cons_maestro(\"\", \"agregar\",tabla,titulo);\r\n}" ]
[ "0.7049495", "0.70396626", "0.69722766", "0.68546766", "0.68477017", "0.6736305", "0.6681695", "0.6654357", "0.66375214", "0.65882206", "0.6564247", "0.65480965", "0.6510215", "0.64953274", "0.64436585", "0.6432796", "0.64258397", "0.64061934", "0.6393038", "0.63813233", "0.6359176", "0.6357083", "0.63507074", "0.634172", "0.6340094", "0.63390964", "0.6337628", "0.6315425", "0.6297369", "0.6294792", "0.62943953", "0.6290336", "0.6284311", "0.62775385", "0.62586915", "0.6258522", "0.62449974", "0.621491", "0.62128854", "0.62119544", "0.62004995", "0.61886764", "0.6186485", "0.61814255", "0.61734676", "0.6170685", "0.6155298", "0.6150675", "0.6143794", "0.6142883", "0.6136221", "0.6129787", "0.6125001", "0.6122645", "0.6117973", "0.6117357", "0.61128175", "0.6105135", "0.60993075", "0.60969394", "0.60833454", "0.60826886", "0.60785735", "0.60685724", "0.60661185", "0.6065854", "0.60522515", "0.60393834", "0.6021773", "0.6018824", "0.6018252", "0.60177094", "0.60082376", "0.60060483", "0.60022956", "0.6002289", "0.59852225", "0.59777135", "0.59707403", "0.59690714", "0.5965404", "0.5954541", "0.5946864", "0.59466416", "0.59394497", "0.59347326", "0.59344727", "0.59298426", "0.5929796", "0.59167355", "0.59029067", "0.59029067", "0.5902014", "0.5901852", "0.5895313", "0.58937794", "0.5888571", "0.5887538", "0.5887066", "0.5884969" ]
0.622793
37
Analyze log blocks delimited by Time : tag
function processLog() { var log_entry; var log_lines; var date; var time; var query_string; var entry_stats; logdata.shift(); // ignore server infos for (var i = 0; i < logdata.length; i++) { // load string log_entry = "# Time: " + logdata[i]; logdata[i] = {}; log_lines = log_entry.split("\n"); // get host logdata[i].db_name = log_lines[1].split("[")[1].split("]")[0]; // get stats entry_stats = log_lines[2].split(" "); logdata[i].query_time = parseInt(entry_stats[2]); // query time logdata[i].lock_time = parseInt(entry_stats[5]); // lock time logdata[i].rows_sent = parseInt(entry_stats[8]); // rows sent logdata[i].rows_examined = parseInt(entry_stats[11]); // row examined // update stats if (logdata[i].query_time < stats.query_time.min) stats.query_time.min = logdata[i].query_time; if (logdata[i].query_time > stats.query_time.max) stats.query_time.max = logdata[i].query_time; if (logdata[i].lock_time < stats.lock_time.min) stats.lock_time.min = logdata[i].lock_time; if (logdata[i].lock_time > stats.lock_time.max) stats.lock_time.max = logdata[i].lock_time; if (logdata[i].rows_sent < stats.rows_sent.min) stats.rows_sent.min = logdata[i].rows_sent; if (logdata[i].rows_sent > stats.rows_sent.max) stats.rows_sent.max = logdata[i].rows_sent; if (logdata[i].rows_examined < stats.rows_read.min) stats.rows_read.min = logdata[i].rows_examined; if (logdata[i].rows_examined > stats.rows_read.max) stats.rows_read.max = logdata[i].rows_examined; log_lines[0] = log_lines[0].replace(' ', ' '); date = str_split(log_lines[0].split(' ')[2],2); time = log_lines[0].split(' ')[3].split(":"); // parse date date = new Date("20" + date[0], date[1] - 1, date[2], time[0], time[1], time[2]); var year = date.getFullYear(); var month = date.getUTCMonth() + 1; if (month < 10) month = "0" + month; var day = date.getDate().toString(); if (day < 10) day = "0" + day; var hours = date.getHours().toString(); if (hours < 10) hours = "0" + hours; var mins = date.getMinutes().toString(); if (mins < 10) mins = "0" + mins; logdata[i].dateObj = date; // date logdata[i].date = year + "/" + month + "/" + day + " " + hours + ":" + mins; logdata[i].hour = hours; // isolate query log_lines.shift(); log_lines.shift(); log_lines.shift(); // query query_string = checkMulitpleQueries(log_lines.join("<br/>").split("# User@Host: "), date, i); // add formatted query tou the list logdata[i].query_string = query_string; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process_E1_History_Stats_15min_Out_Log_Record(record)\n{\n\tvar myId;\t\t\n\tvar subelement = LOOKUP.get(record.monitoredObjectPointer); \n\t\n\tif(subelement == null)\n\t{\n\t\tlogP5Msg(\"process_E1_History_Stats_15min_Out_Log_Record\", \"SAMUBA_E1_History_Stats_15min_Out_Log_Record\", \"Skipping 0 rid for --> \"+ record.monitoredObjectPointer);\n\t\treturn;\n\t}\n\tmyId = subelement.id;\n logP4Msg(\"process_E1_History_Stats_15min_Out_Log_Record\", \"SAMUBA_E1_History_Stats_15min_Out_Log_Record\", \"ENTERING for --> \"+ record.monitoredObjectPointer + \" with id == \" + myId);\n \n\tfor(var i in E1HistoryStats15minOutLogRecordMetrics)\n\t{\n\t var value = parseInt(record[E1HistoryStats15minOutLogRecordMetrics[i]]);\t\n\t if (!(value == null || isNaN(value))) {\n\t \tCreateSimpleMetricObject(myId, record, \"AP~Specific~Alcatel~5620 SAM~Bulk~tdmequipment~E1HistoryStats15minOut~\", E1HistoryStats15minOutLogRecordMetrics[i]);\n }\n\t}\n\tlogP4Msg(\"process_E1_History_Stats_15min_Out_Log_Record\", \"SAMUBA_E1_History_Stats_15min_Out_Log_Record\", \"LEAVING\");\n}", "function check_log(fileName)\n{\n\tvar content = fs.readFileSync(fileName, 'ascii').trim();\n\tvar lines = content.split('\\n');\n\tvar cnt = 0;\n\tvar previous = 0;\n\tfor (var i = 0; i < lines.length; i++) {\n\t var line = lines[i];\n\t var seg = line.split(',');\n\n\t if (seg[0].match(/2019-03-([0~3][7-9])\\s+/)) {\n\t //console.log(i, \" - ts\", seg[0]);\n\t if (cnt++ > 0) {\n\t \tvar ts = moment(seg[0]).unix();\n\t \tif (ts - previous > 10 * 60 + 30) {\n\t \t\tconsole.log(\"Warn: ts gap too big! at line\", i + 1)\n\t \t\tconsole.log(\"pre: \", i-1, lines[i-1]);\n\t \t\tconsole.log(\"cur: \", i, lines[i]);\n\t \t}\n\t \t\tprevious = ts;\n\n\t } else {\n\t \t\tprevious = moment(seg[0]).unix();\n\t }\n\t }\n\t}\n}", "function getEventTime()\n {\n var contentText = $(\".popover-main-content\").text();\n //const regex = RegExp('\\s*Kl.\\s\\d\\d:\\d\\d\\s-\\s\\d\\d:\\d\\d'); //Should work, but doesnt - TODO.\n var timestamp = false;\n\n //Goes through every line, and finds if the line contains timestamp\n var lines = contentText.split(\"\\n\");\n $.each(lines, function(n, elem) {\n elem = elem.trim();\n console.log(n.toString() + \" \" + elem);\n //If line starts with Kl. then timestamp\n if(elem.startsWith(\"Kl.\"))\n {\n timestamp = elem;\n console.log(\"Timestamp found in line nr \" + n.toString() + \" containing: \" + elem);\n }\n });\n\n //If timestamp is found, then analyse\n if(timestamp != false)\n {\n //Template: Kl. 10:00 - 10:45\n var tSplit = timestamp.replace(\"Kl.\",\"\").split(\"-\");\n var startTime = tSplit[0].trim();\n var endTime = tSplit[1].trim();\n\n console.log(\"Event starttime: \" + startTime);\n console.log(\"Event endtime: \" + endTime);\n\n timestamp = [startTime,endTime];\n }\n\n //Returns timestamp or false if not found.\n return timestamp;\n }", "*_parseLines(lines) {\n const reTag = /^:([0-9]{2}|NS)([A-Z])?:/;\n let tag = null;\n\n for (let i of lines) {\n\n // Detect new tag start\n const match = i.match(reTag);\n if (match || i.startsWith('-}') || i.startsWith('{')) {\n if (tag) {yield tag;} // Yield previous\n tag = match // Start new tag\n ? {\n id: match[1],\n subId: match[2] || '',\n data: [i.substr(match[0].length)]\n }\n : {\n id: 'MB',\n subId: '',\n data: [i.trim()],\n };\n } else { // Add a line to previous tag\n tag.data.push(i);\n }\n }\n\n if (tag) { yield tag; } // Yield last\n }", "parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe jsut a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }", "parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe jsut a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }", "function averageRunTime(logs){\n var hash = {};\n var totalTime = 0;\n var pairs = 0;\n var parts, time, operation, action;\n var str = readLine(logs);\n while(str){\n parts = str.split(' ');\n time = new Date(parts[0]).getTime();\n operation = parts[2];\n action = parts[3];\n hash[operation] = hash[operation] || {};\n hash[operation][action] = time;\n // only add when both start and end occur\n if(hash[operation].End && hash[operation].Start){\n totalTime += hash[operation].End - hash[operation].Start;\n // save space and incase operation occurs again in log\n delete hash[operation];\n pairs++;\n }\n str = readLine();\n }\n return totalTime / pairs;\n}", "function parseLog(txHash) {\n console.log(\"parsing log\");\n return new Promise(resolve => {\n C.web3.eth.getTransactionReceipt(txHash, function (e, receipt) {\n const decodedLogs = abiDecoder.decodeLogs(receipt.logs);\n\n for (let i = 0; i < decodedLogs.length; i++) {\n if (decodedLogs[i] && decodedLogs[i].events && decodedLogs[i].name && decodedLogs[i].name == \"Borrow\") {\n //console.log(decodedLogs[i].events)\n return resolve(decodedLogs[i].events[2].value);\n }\n }\n });\n });\n}", "function parseStorelog(p) {\n // need to fix up mall store log dates\n var tzoff = new Date().getTimezoneOffset(); \n tzoff = tzoff * 60000; // convert to ms\n // asymmetric is at UTC-7, or -25200000ms\n tzoff = 25200000 - tzoff; \n var nlist = new Array(); // for creating a new list of entries\n var endMarker = p.childNodes.length;\n for (var j=0;j<p.childNodes.length;j++) {\n var c = p.childNodes[j];\n if (c.tagName=='P') { // end of list\n endMarker = j;\n break;\n }\n // first entry should be a date\n var x = c.data.split(' ');\n var days = x[0];\n var times = x[1];\n var k = days.indexOf('/');\n var month = parseInt(days.substr(0,k),10);\n days = days.substr(k+1);\n k = days.indexOf('/');\n var day = parseInt(days.substr(0,k),10);\n var year = parseInt(days.substr(k+1),10)+2000;\n \n k = times.indexOf(':');\n var hour = parseInt(times.substr(0,k),10);\n times = times.substr(k+1);\n k = times.indexOf(':');\n var minute = parseInt(times.substr(0,k),10);\n var second = parseInt(times.substr(k+1),10);\n \n var d = new Date(year,month-1,day,hour,minute,second);\n d = new Date(d.getTime()+tzoff); //7200000;\n //GM_log('Entry: '+d + \" from \"+c.data);\n \n // we put the date together with all the children\n var e = new Array();\n e[0] = d;//document.createTextNode(d.toLocaleDateString());\n do {\n j++;\n c = p.childNodes[j];\n e[e.length] = c;\n } while(c.tagName!='BR');\n nlist[nlist.length] = e;\n }\n return {lst:nlist,marker:endMarker};\n}", "function parseTimeContainerNode(node) {\n if (!node) return;\n // Don't create a new smilTimeElement if this node already has a\n // parent time container.\n if (!node.timing) {\n consoleLog(\"Main time container found: \" + node.nodeName);\n consoleLog(node);\n // the \"timing\" property isn't set: this node hasn't been parsed yet.\n var smilPlayer = new smilTimeElement(node);\n smilPlayer.show();\n } else {\n consoleLog(\"Child time container found: \" + node.nodeName);\n }\n}", "function getLogEventStrings() {\n var eventsArr = [];\n var str = Logger.getLog();\n var arr = str.split(\"\\n\");\n// Logger.log(\"arr=\" + arr.length);\n for (var i in arr) {\n// Logger.log(\"arr[\" + i + \"]=\" + arr[i]);\n if ( arr[i].length > 0 ) {\n var regexResult = /.+?INFO: \\[EVENT\\] (.+)/.exec(arr[i]); //Is log string of [EVENT] type\n if (regexResult && regexResult[0].length>0) eventsArr.push(regexResult[1]);\n }\n }\n return eventsArr;\n}", "function addRawLog(node) {\n const logDiv = $('log-entries');\n if (!logDiv) {\n return;\n }\n logDiv.appendChild(document.createElement('hr'));\n if (node.type === 'fragment') {\n if ('children' in node) {\n node.children.forEach((child) => {\n logDiv.appendChild(nodeToDomNode(child));\n });\n }\n } else {\n logDiv.appendChild(nodeToDomNode(node));\n }\n}", "function handleSeparateTimestamp(\n out,\n buffer,\n argList,\n last_timestamp,\n flag,\n tagsz\n) {\n var tag = {}\n for (var i = 0; i < flag.nb_of_type_measure; i++) {\n tag.lbl = buffer.getNextSample(ST_U8, tagsz)\n var sampleIndex = findIndexFromArgList(argList, tag)\n var compressSampleNb = buffer.getNextSample(ST_U8, 8)\n if (compressSampleNb) {\n var timestampCoding = buffer.getNextSample(ST_U8, 2)\n for (var j = 0; j < compressSampleNb; j++) {\n var precedingRelativeTimestamp =\n out.series[sampleIndex].uncompressSamples[\n out.series[sampleIndex].uncompressSamples.length - 1\n ].data_relative_timestamp\n var currentMeasure = {\n data_relative_timestamp: 0,\n data: {}\n }\n var bi = buffer.getNextBifromHi(timestampCoding)\n currentMeasure.data_relative_timestamp = computeTimestampFromBi(\n buffer,\n precedingRelativeTimestamp,\n bi\n )\n if (currentMeasure.data_relative_timestamp > last_timestamp) {\n last_timestamp = currentMeasure.data_relative_timestamp\n }\n bi = buffer.getNextBifromHi(out.series[sampleIndex].codingTable)\n if (bi <= BR_HUFF_MAX_INDEX_TABLE) {\n var precedingValue =\n out.series[sampleIndex].uncompressSamples[\n out.series[sampleIndex].uncompressSamples.length - 1\n ].data.value\n if (bi > 0) {\n currentMeasure.data.value = completeCurrentMeasure(\n buffer,\n precedingValue,\n out.series[sampleIndex].codingType,\n argList[sampleIndex].resol,\n bi\n )\n } else {\n // bi <= 0\n currentMeasure.data.value = precedingValue\n }\n } else {\n // bi > BR_HUFF_MAX_INDEX_TABLE\n currentMeasure.data.value = buffer.getNextSample(\n argList[sampleIndex].sampletype\n )\n }\n out.series[sampleIndex].uncompressSamples.push(currentMeasure)\n }\n }\n }\n return last_timestamp\n}", "function looks_like_log_line(line) {\n return (typeof line == 'string' && Date.parse(line.split('T')[0]) > 0);\n }", "function parseLog(value){\n return parse(value);\n}", "function checkLogTag(blockTag) {\n if (blockTag === \"pending\") {\n throw new Error(\"pending not supported\");\n }\n if (blockTag === \"latest\") {\n return blockTag;\n }\n return parseInt(blockTag.substring(2), 16);\n}", "function checkLogTag(blockTag) {\n if (blockTag === \"pending\") {\n throw new Error(\"pending not supported\");\n }\n if (blockTag === \"latest\") {\n return blockTag;\n }\n return parseInt(blockTag.substring(2), 16);\n}", "function checkLogTag(blockTag) {\n if (blockTag === \"pending\") {\n throw new Error(\"pending not supported\");\n }\n if (blockTag === \"latest\") {\n return blockTag;\n }\n return parseInt(blockTag.substring(2), 16);\n}", "function process_line(line) {\n var res_array;\n\n // match [**name**]Octane-Splay\n res_array = /\\[\\*\\*name\\*\\*\\](.*)/.exec(line);\n if(res_array) {\n if(currentRow) {\n appendRow(currentRow);\n }\n currentRow = createRow();\n currentRow.data_name = res_array[1];\n return ;\n }\n\n // match [*]exp-done\n res_array = /\\[\\*\\]exp-done/.exec(line);\n if(res_array) {\n appendRow(currentRow);\n // dump information to string\n var result = dumpTableToString();\n var output_file = process.argv[3];\n fs.writeFileSync(output_file, result);\n console.log();\n console.log(result);\n return ;\n }\n\n // match [****]time: 0.7792110443115234s\n res_array = /\\[\\*\\*\\*\\*\\]time: (\\d+(\\.\\d+)*)/.exec(line);\n if(res_array) {\n currentRow.runtime = res_array[1];\n return ;\n }\n\n // match [****]instrument-eval-time: 5.523s\n res_array = /\\[\\*\\*\\*\\*\\]instrument-eval-time: (\\d+(\\.\\d+)*)/.exec(line);\n if(res_array) {\n currentRow.instru_eval_time += res_array[1];\n return ;\n }\n\n // match [****]loc: 123\n res_array = /\\[\\*\\*\\*\\*\\]loc:\\s*(\\d+)/.exec(line);\n if(res_array) {\n currentRow.loc = res_array[1];\n return ;\n }\n\n /*\n match:\n real\t0m0.047s\n user\t0m0.038s\n sys\t0m0.012s\n */\n res_array = /real[\\s]*((\\d+)m)?(\\d+(\\.\\d+)?)s/.exec(line);\n if(res_array) {\n var m = res_array[2];\n var s = res_array[3];\n currentRow.originaltime = m*60 + parseFloat(s);\n return ;\n }\n\n res_array = /sys[\\s]*((\\d+)m)?(\\d+(\\.\\d+)?)s/.exec(line);\n if(res_array) {\n //var m = res_array[2];\n //var s = res_array[3];\n //currentRow.total_time = m*60 + parseFloat(s);\n return ;\n }\n\n res_array = /user[\\s]*((\\d+)m)?(\\d+(\\.\\d+)?)s/.exec(line);\n if(res_array) {\n //var m = res_array[2];\n //var s = res_array[3];\n //currentRow.total_time = m*60 + parseFloat(s);\n return ;\n }\n\n\n // [****]HiddenClass: 5\n res_array = /\\[\\*\\*\\*\\*\\]HiddenClass: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.hc_num = res_array[1];\n return ;\n }\n\n // [****]AccessUndefArrayElem: 0\n res_array = /\\[\\*\\*\\*\\*\\]AccessUndefArrayElem: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.undef_array_access_num = res_array[1];\n return ;\n }\n\n // [****]SwitchArrayType: 0\n res_array = /\\[\\*\\*\\*\\*\\]SwitchArrayType: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.switch_array_type_num = res_array[1];\n return ;\n }\n\n // [****]NonContArray: 0\n res_array = /\\[\\*\\*\\*\\*\\]NonContArray: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.noncont_array_num = res_array[1];\n return ;\n }\n\n // [****]Nonconstructor: 0\n res_array = /\\[\\*\\*\\*\\*\\]Nonconstructor: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.nonconstructor_num = res_array[1];\n return ;\n }\n\n // [****]BinaryOpUndef: 0\n res_array = /\\[\\*\\*\\*\\*\\]BinaryOpUndef: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.binary_num = res_array[1];\n return ;\n }\n\n // [****]PolyFun: 0\n res_array = /\\[\\*\\*\\*\\*\\]PolyFun: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.polyfun_num = res_array[1];\n return ;\n }\n\n // [****]ArgLeak: 0\n res_array = /\\[\\*\\*\\*\\*\\]ArgLeak: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.argleak_num = res_array[1];\n return ;\n }\n\n // [****]typedArray: 0\n res_array = /\\[\\*\\*\\*\\*\\]typedArray: (\\d+)/.exec(line);\n if(res_array) {\n currentRow.typedarray_num = res_array[1];\n return ;\n }\n\n //console.log(' **** unmatched line ****');\n //console.log(line);\n}", "function ltbProcessLines(func) {\n var regexp = new RegExp($(\"#regexp\").val());\n $(\".log\").children().each(function (i) {\n if ($(this).text().match(regexp)) {\n func($(this));\n }\n });\n}", "function calcTimeComplete(log) {\n let timeComplete = 0;\n for (let entry of log) {\n timeComplete += entry.timeInMinutes;\n }\n return timeComplete;\n }", "function loadLogs()\n\t{\n\t\tvar counters = {\n\t\t\tgeneral : {g: $(\"[data-rel=log-counter]\")},\n\t\t\ttype : {},\n\t\t\tverbosity : {}\n\t\t};\n\n\t\tvar addCounter = function(cat, type, dom) {\n\t\t\t\tcounters[cat][type] = dom;\n\t\t};\n\n\t\tvar incrCounter = function(cat, type, step) {\n\t\t\t\tvar node = counters[cat][type];\n\t\t\t\tnode.html(parseInteger(node.html()) + step);\n\n\t\t};\n\n\t\tvar decrCounter = function(cat, type, step) {\n\t\t\t\tvar node = counters[cat][type];\n\t\t\t\tvar count = parseInteger(node.html());\n\t\t\t\tif (count - step >= 0)\n\t\t\t\t{\n\t\t\t\t\tnode.html(count - step);\n\t\t\t\t\tfireEffect(node, \"highlight\");\n\t\t\t\t}\n\t\t};\n\n\t\t// Update counters, by passing a list of nodes to be removed\n\t\tvar updateCounters = function(nodeList)\n\t\t{\n\n\t\t\tnodeList.each(function(){\n\n\t\t\t\tvar v = $(this);\n\n\t\t\t\tdecrCounter(\"type\", v.data(\"type\"), 1);\n\t\t\t\tdecrCounter(\"verbosity\", v.data(\"verbosity\"), 1);\n\t\t\t\tdecrCounter(\"general\", \"g\", 1);\n\n\t\t\t});\n\t\t};\n\n\t\tvar resetCounters = function()\n\t\t{\n\t\t\tfor(var cat in counters) {\n\t\t\t\tif (counters.hasOwnProperty(cat)) {\n\t\t\t\t\tfor (var type in counters[cat]) {\n\t\t\t\t\t\tif (counters[cat].hasOwnProperty(type)) {\n\t\t\t\t\t\t\tcounters[cat][type].html(0);\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\n\t\tvar events = {\n\t\t\tsleep\t: {expression: \"sleep\", format: function(data){\n\t\t\t\treturn \"for \" + data.second + \" seconds\";}},\n\t\t\tgot\t\t: {expression: \"got\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.args.payload.id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.args.payload.id + \"</a>\";}},\n\t\t\tprocess : {expression: \"process\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tfork\t: {expression: \"fork\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tdone\t: {expression: \"done\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tfail\t: {expression: \"fail\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tstart\t: {expression: \"start\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tstop\t: {expression: \"shutdown\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tpause\t: {expression: \"pause\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tresume\t: {expression: \"resume\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tprune\t: {expression: \"prune\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}}\n\t\t};\n\n\t\tfor(var i in events)\n\t\t{\n\t\t\tif (events.hasOwnProperty(i)) {\n\t\t\t\tinit(i);\n\t\t\t}\n\t\t}\n\n\t\tvar level = {\n\t\t\t\t100 : {name: \"debug\",\tclassStyle: \"label-success\"},\n\t\t\t\t200 : {name: \"info\",\tclassStyle: \"label-info\"},\n\t\t\t\t300 : {name: \"warning\", classStyle: \"label-warning\"},\n\t\t\t\t400 : {name: \"error\",\tclassStyle: \"label-important\"},\n\t\t\t\t500 : {name: \"critical\", classStyle: \"label-inverse\"},\n\t\t\t\t550 : {name: \"alert\",\tclassStyle: \"label-inverse\"}\n\t\t};\n\n\t\tvar workers = {};\n\n\t\tvar formatData = function(type, data){\n\t\t\treturn {\n\t\t\t\ttime: data.time,\n\t\t\t\thourTime: moment(data.time).format(\"H:mm:ss\"),\n\t\t\t\taction: type,\n\t\t\t\tlevelName: level[data.data.level].name,\n\t\t\t\tlevelClass: level[data.data.level].classStyle,\n\t\t\t\tdetail: events[type].format(data.data),\n\t\t\t\tworker: data.data.worker,\n\t\t\t\tworkerClass : cleanWorkerName(data.data.worker),\n\t\t\t\tcolor: getColor(data)\n\t\t\t};\n\t\t};\n\n\t\tvar getColor = function(data) {\n\t\t\tif (workers[data.data.worker] === undefined)\n\t\t\t{\n\t\t\t\t\tworkers[data.data.worker] = colors[Object.keys(workers).length];\n\t\t\t}\n\t\t\treturn workers[data.data.worker];\n\t\t};\n\n\n\t\tvar colors = [\"#1f77b4\", \"#aec7e8\", \"#ff7f0e\", \"#ffbb78\", \"#2ca02c\", \"#98df8a\",\n\t\t\"#d62728\", \"#ff9896\", \"#9467bd\", \"#c5b0d5\", \"#8c564b\", \"#c49c94\", \"#e377c2\",\n\t\t\"#f7b6d2\", \"#7f7f7f\", \"#c7c7c7\", \"#bcbd22\", \"#dbdb8d #\", \"17becf\", \"#9edae5\"];\n\n\n\t\t/**\n\t\t * Insert new events in the DOM\n\t\t *\n\t\t */\n\t\tfunction appendLog(type, data)\n\t\t{\n\t\t\tif ($(\"input[data-rel=\"+level[data.data.level].name+\"]\").is(\":checked\"))\n\t\t\t{\n\t\t\t\t$( \"#log-area\" ).append(\n\t\t\t\t\t$(\"#log-template\").render(formatData(type, data))\n\t\t\t\t);\n\n\t\t\t\tif (!counters.verbosity.hasOwnProperty(level[data.data.level].name)) {\n\t\t\t\t\taddCounter(\"verbosity\", level[data.data.level].name, $(\"#log-sweeper-form span[data-rel=\"+level[data.data.level].name+\"]\"));\n\t\t\t\t}\n\n\t\t\t\tif (!counters.type.hasOwnProperty([type])) {\n\t\t\t\t\taddCounter(\"type\", type, $(\"#log-sweeper-form span[data-rel=\"+type+\"]\"));\n\t\t\t\t}\n\n\t\t\t\tincrCounter(\"verbosity\", level[data.data.level].name, 1);\n\t\t\t\tincrCounter(\"type\", type, 1);\n\t\t\t\tincrCounter(\"general\", \"g\", 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction init(e)\n\t\t{\n\t\t\tvar socket = new WebSocket(\"ws://\"+CUBE_URL+\"/1.0/event/get\");\n\n\t\t\tsocket.onopen = function() {\n\t\t\t\tsocket.send(JSON.stringify({\n\t\t\t\t\t\"expression\": events[e].expression,\n\t\t\t\t\t\"start\": formatISO(stop)\n\t\t\t\t}));\n\t\t\t};\n\n\t\t\tsocket.onmessage = function(message) {\n\t\t\t\tappendLog(e, JSON.parse(message.data));\n\t\t\t};\n\t\t}\n\n\t\t$(\"#clear-log-area\").on(\"click\", function(){\n\t\t\t$(\"#log-area\").children().remove();\n\t\t\tresetCounters();\n\t\t});\n\n\t\t$(\"#log-filter-form\").on(\"change\", \"input\", function(e){\n\n\t\t\tvar rel = $(this).data(\"rel\");\n\n\t\t\t$(\"#log-area\").append(\"<li class=\\\"filter-event\\\"><b>\"+ ($(this).is(\":checked\") ? \"Start\" : \"Stop\") +\n\t\t\t\t\"</b> listening to <em>\" + rel + \"</em> events</li>\");\n\n\t\t\tvar mutedLevels = $.cookie(\"ResqueBoard.mutedLevel\", {path: \"/logs\"});\n\t\t\tmutedLevels = mutedLevels.split(\",\");\n\n\t\t\tif ($(this).is(\":checked\")) {\n\t\t\t\tvar index = mutedLevels.indexOf(rel);\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tmutedLevels.splice(index, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmutedLevels[mutedLevels.length] = rel;\n\t\t\t}\n\t\t\t$.cookie(\"ResqueBoard.mutedLevel\", mutedLevels.join(\",\"), {expires: 365, path : \"/logs\"});\n\n\t\t});\n\n\n\t\t$(\"#log-sweeper-form\").on(\"click\", \"button[data-rel=verbosity]\", function(e){\n\t\t\t\tvar toRemove = $(\"#log-area\").children(\"li[data-verbosity=\"+$(this).data(\"level\")+\"]\");\n\t\t\t\tupdateCounters(toRemove);\n\t\t\t\ttoRemove.remove();\n\n\t\t\treturn false;\n\t\t});\n\n\t\t$(\"#log-sweeper-form\").on(\"click\", \"button[data-rel=type]\", function(e){\n\t\t\tvar toRemove = $(\"#log-area\").children(\"li[data-type=\"+$(this).data(\"type\")+\"]\");\n\t\t\tupdateCounters(toRemove);\n\t\t\ttoRemove.remove();\n\n\t\t\treturn false;\n\t\t});\n\n\n\n\n\t}", "function logTimeEvent(element, details) {\n var timestamp = new Date().getTime()\n var postData = {\n \"duration\": \"\", // Component which produces the event\n \"userID\": userData.userId, // the id of the logged user\n \"datatype\": \"duration\",\n \"timeForElement\": element\n }\n insertLogEvent(postData);\n }", "function addFilterTrace(filter) {\n\n // We add line number for grokparsefailures\n\n if (!filter.includes(\"tag_on_failure\")) {\n var re = /grok\\s*{/g\n\n filter = filter.replace(re, function(match, index) {\n var sub = filter.substring(0, index) + match\n var currentLine = string.numberOfLinesString(sub) - 1\n\n return match + ' tag_on_failure => [\"_grokparsefailure\", \"failure line ' + currentLine + '\"]'\n })\n }\n\n // We display metadata if any\n\n filter += \"\\n\" + `filter {\n\n ruby {\n code => \"\n metadata = event.get('@metadata')\n unless metadata.nil? || metadata.length == 0\n event.set('@_metadata', Marshal.load(Marshal.dump(metadata)))\n end\n \n \"\n }\n \n }` + \"\\n\"\n\n return filter\n}", "function getLogEvents() {\n var eventMap = {};\n if ( Logger.getLog().length > 0 ) {\n var arr = Logger.getLog().split(\"\\n\");\n for (var i in arr) {\n var str = arr[i];\n var regexResultArr = str.match(\"(.+?) INFO: (.+)\");\n var timestamp = regexResultArr[0];\n var event = regexResultArr[1];\n eventMap[i] = timestamp + \" \" + event;\n }\n }\n return eventMap;\n}", "parse(timing) {\n const lines = timing.split(lineEnd);\n const tLine = lines.shift();\n const tokens = tLine.split(' ');\n if (tokens.length !== 2) {\n MsrpSdk.Logger.warn(`[SDP]: Unexpected timing line: ${tLine}`);\n return false;\n }\n\n this.start = this._getDate(tokens[0]);\n this.stop = this._getDate(tokens[1]);\n\n // Don't care about repeat lines at the moment\n this.repeat = lines;\n\n return true;\n }", "function splitLine(line)\n{\n\tif (line.endsWith(\":\")) line = line.slice(0, -1) // For entries that look like: 'Monday:'\n\tvar tokens = line.split(\" \") // Each token is delimited by a space\n\t\n\tvar classification = []\n\tvar tripData = {\n\t\t\"Source\": \"\", // To be filled in once more drives are logged\n\t\t\"Destination\": \"\",\n\t\t\"Date\": \"\",\n\t\t\"StartOdometer\": \"\",\n\t\t\"EndOdometer\": \"\",\n\t\t\"StartTime\": \"\",\n\t\t\"EndTime\": \"\",\n\t\t\"DateOrTimeIsAmbiguous\": false // There may be some cases where we want to look into fixing ambiguity. Only checking the most straightforward edge cases currently\n\t}\n\n\t//var token = \"\" // Vestigial\n\tvar lastTokenType = 0\n\tfor (var i = 0; i < tokens.length; i++)\n\t{\n\t\tvar token = tokens[i]\n\t\t\n\t\t// Turn the token into the binary represntation\n\t\tvar classification = classifyToken(token)\n\t\t//console.log(token, describeToken(classification))\n\t\t\n\t\t// Try to quickly resolve any simple conflict ambiguity\n\t\t// Check for various common causes of ambiguity and handle it based on extra parsing or previous classifications\n\t\tif (tokenIsAmbiguous(classification))\n\t\t{\n\t\t\tif (lastTokenType == DATE) classification = DATE // i.e The last token was 'August' and this token is '3rd'\n\t\t\tif (classification.length < 3) classification = DATE // Honestly no idea what I was writing here... leaving it in though\n\n\t\t\t// Check for ambiguity between a time and odometer. Use basic checking to categorize it\n\t\t\tif (tokenValueIs( classification, (TIME | ODOMETER) ))\n\t\t\t{\n\t\t\t\tif (parseInt(token) >= 2360) classification = ODOMETER\n\t\t\t\t//if (token.length == 2)\n\t\t\t\telse classification = TIME\n\t\t\t}\n\t\t}\n\n\t\tif (classification == 0)\n\t\t{\n\t\t\t// Do something? Ignore?\n\t\t}\n\n\t\t//if (isUnambiguous(classification))\n\t\t//{\n\t\t// See function description\n\t\tsaveData(tripData, classification, token)\n\t\t//}\n\n\t\t// Used for fixing ambiguous situations\n\t\tlastTokenType = classification\n\t}\n\t\n\t//console.log(tokens)\n\t//console.log(tripData)\n\treturn tripData\n}", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log('Average time to generate last 10 frames: ' + sum / 10 + 'ms');\n}", "function process_Pdh_Frame_Link_History_Data_Stats(record)\n{\n\tvar myId;\t\t\n\tvar subelement = LOOKUP.get(record.monitoredObjectPointer); \n\t\n\tif(subelement == null)\n\t{\n\t\tlogP5Msg(\"process_Pdh_Frame_Link_History_Data_Stats\", \"SAMUBA_Pdh_Frame_Link_History_Data_Stats\", \"Skipping 0 rid for --> \"+ record.monitoredObjectPointer);\n\t\treturn;\n\t}\n\tmyId = subelement.id;\n logP4Msg(\"process_Pdh_Frame_Link_History_Data_Stats\", \"SAMUBA_Pdh_Frame_Link_History_Data_Stats\", \"ENTERING for --> \"+ record.monitoredObjectPointer + \" with id == \" + myId);\n \n\tfor(var i in PdhFrameLinkHistoryDataStats15MinMetrics)\n\t{\n\t var value = parseInt(record[PdhFrameLinkHistoryDataStats15MinMetrics[i]]);\t\n\t if (!(value == null || isNaN(value))) {\n\t\t CreateSimpleMetricObject(myId, record, \"AP~Specific~Alcatel~5620 SAM~Bulk~radioequipment~PdhFrameLinkHistoryDataStats15Min~\", PdhFrameLinkHistoryDataStats15MinMetrics[i]);\n }\n\t}\n\tlogP4Msg(\"process_Pdh_Frame_Link_History_Data_Stats\", \"SAMUBA_Pdh_Frame_Link_History_Data_Stats\", \"LEAVING\");\n}", "function Process (csv)\n{\n\tconst packetsSent\t= new Accumulator (MonitorDuration);\n\tconst packetsLost\t= new Accumulator (MonitorDuration);\n\tconst bitrateSent\t= new Accumulator (MonitorDuration);\n\tconst bitrateRecv\t= new Accumulator (MonitorDuration);\n\tconst bitrateMedia\t= new Accumulator (MonitorDuration);\n\tconst bitrateRTX\t= new Accumulator (MonitorDuration);\n\tconst bitrateProbing\t= new Accumulator (MonitorDuration);\n\t\n\tlet lost = 0;\n\tlet minRTT = 0;\n\tlet minAcumulatedDelta = 0;\n\tlet acumulatedDelta = 0;\n\tlet lastFeedbackNum = 0\n\tlet first = true;\n\tlet firstInInterval;\n\tlet count = 0;\n\t//Convert each line to array\n\tfor (let ini = 0, end = csv.indexOf (\"\\n\", ini); end != -1; ini = end + 1, end = csv.indexOf (\"\\n\", ini))\n\t{\n\t\t//get line\n\t\tconst line = csv.substr (ini, end - ini).trim ();\n\t\t//Get data point\n\t\tconst point = line.split (\"|\").map (Number);\n\t\t//One more packet\n\t\tpacketsSent.accumulate(point[Metadata.sent],1);\n\t\t//Check if it was lost\n\t\tif (point[Metadata.sent] && !point[Metadata.recv])\n\t\t{\n\t\t\t//Increse lost\n\t\t\tpacketsLost.accumulate(point[Metadata.sent],1);\n\t\t\t//Update received, don't increase\n\t\t\tpoint[Metadata.bitrateRecv] = bitrateRecv.accumulate (point[Metadata.recv], 0);\n\t\t} else {\n\t\t\t//Update lost, don't increase\n\t\t\tpacketsLost.accumulate(point[Metadata.sent],0);\n\t\t\t//Add recevided bitrate\n\t\t\tpoint[Metadata.bitrateRecv] = bitrateRecv.accumulate (point[Metadata.recv], point[Metadata.size] * 8);\n\t\t}\n\t\t//Add lost count\n\t\tpoint[Metadata.lost] = 100 * packetsLost.getAccumulated () / packetsSent.getAccumulated ();\n\t\t//Add sent bitrate\n\t\tpoint[Metadata.bitrateSent]\t= bitrateSent.accumulate (point[Metadata.sent], point[Metadata.size] * 8);\n\t\tpoint[Metadata.bitrateMedia]\t= bitrateMedia.accumulate (point[Metadata.sent], !point[Metadata.rtx] && !point[Metadata.probing] ? point[Metadata.size] * 8 : 0);\n\t\tpoint[Metadata.bitrateRTX]\t= bitrateRTX.accumulate (point[Metadata.sent], point[Metadata.rtx] ? point[Metadata.size] * 8 : 0);\n\t\tpoint[Metadata.bitrateProbing]\t= bitrateProbing.accumulate (point[Metadata.sent], point[Metadata.probing] ? point[Metadata.size] * 8 : 0);\n\t\t//If there has been a discontinuity on feedback pacekts\n\t\tif (first || (point[Metadata.feedbackNum]!=lastFeedbackNum && ((lastFeedbackNum+1)%256)!=point[Metadata.feedbackNum]))\n\t\t{\n\t\t\t//Fix delta up to now\n\t\t\tfor(let i=firstInInterval; i<count; ++i)\n\t\t\t\t//Set base delay to 0\n\t\t\t\tdata[i][Metadata.delay] = Math.trunc((data[i][Metadata.delay] - minAcumulatedDelta) / 1000);\n\t\t\t//Reset accumulated delta\n\t\t\tacumulatedDelta = 0;\n\t\t\tminAcumulatedDelta = 0;\n\t\t\t//This is the first of the interval\n\t\t\tfirstInInterval = count;\n\t\t} else {\n\t\t\t//Get accumulated delta\n\t\t\tacumulatedDelta += point[Metadata.delta];\n\t\t}\n\t\t//Check min/maxs\n\t\tif (!minRTT || point[Metadata.rtt] < minRTT)\n\t\t\tminRTT = point[Metadata.rtt];\n\t\tif (acumulatedDelta < minAcumulatedDelta)\n\t\t\tminAcumulatedDelta = acumulatedDelta;\n\t\t//Set network buffer delay\n\t\tpoint[Metadata.delay] = acumulatedDelta;\n\t\t//Set sent time as Date\n\t\tpoint[Metadata.ts] = new Date(point[Metadata.sent] / 1000);\n\t\t//Set the delay of the feedback\n\t\tpoint[Metadata.fbDelay] = (point[Metadata.fb] - point[Metadata.sent])/1000;\n\t\t//append to data\n\t\tdata.push (point);\n\t\t//Store last feedback packet number\n\t\tlastFeedbackNum = point[Metadata.feedbackNum];\n\t\tfirst = false;\n\t\t//Inc count\n\t\tcount ++;\n\t}\n\t//Fix delta up to now\n\tfor(let i=firstInInterval; i<count; ++i)\n\t\t//Set base delay to 0\n\t\tdata[i][Metadata.delay] = (data[i][Metadata.delay] - minAcumulatedDelta) / 1000;\n\tlet i = 0;\n\tfor (const point of data)\n\t{\n\t\t//Find what is the estimation when this packet was sent\n\t\twhile (i<data.length && data[i][Metadata.sent]<point[Metadata.fb])\n\t\t\t//Skip until the estimation is newer than the packet time\n\t\t\ti++;\n\t\t//Set target to previous target bitate\n\t\tpoint[Metadata.target] = i ? data[i-1][Metadata.targetBitrate] : 0;\n\t\tpoint[Metadata.available] = i ? data[i-1][Metadata.availableBitrate] : 0;\n\t}\n\treturn data;\n}", "function _pf_insertLog(curLog) {\n var elementList = [];\n\n // Find elements that has changed in size or position\n for (var i = 0; i < _pf_elementList.length; i++) {\n var d = _pf_elementList[i][1];\n var curEleID = _pf_elementList[i][0];\n\n if ($(d).length) {\n var pos = [$(d).offset().left , $(d).offset().top];\n var size = [$(d).width(), $(d).height()];\n if (_pf_elementInfo[curEleID]['position'][0] === pos[0] && _pf_elementInfo[curEleID]['position'][1] === pos[1]\n && _pf_elementInfo[curEleID]['size'][0] === size[0] && _pf_elementInfo[curEleID]['size'][1] === size[1]) {\n continue;\n }\n // console.log($(d).attr('_pf_ele_id'));\n elementList.push([curEleID, $(d).offset().left , $(d).offset().top, $(d).width(), $(d).height()]);\n _pf_elementInfo[curEleID]['position'] = pos;\n _pf_elementInfo[curEleID]['size'] = size;\n }\n else {\n elementList.push([curEleID, -1, -1, -1, -1]);\n _pf_elementInfo[curEleID]['position'] = [-1,-1];\n _pf_elementInfo[curEleID]['size'] = [-1,-1];\n }\n }\n\n curLog['modifiedElements'] = elementList;\n _pf_logList.push(curLog);\n // send to the content script for every 100 records\n if (_pf_logList.length >= 100) {\n window.postMessage({\n '_pf_event_records': _pf_logList\n },\n '*'\n );\n _pf_logList = [];\n }\n }", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log(\"Average time to generate last 10 frames: \" + sum / 10 + \"ms\");\n}", "function log(event_name, thing) {\n // Create a HH:MM:SS:iii timestamp\n function create_timestamp() {\n const now = new Date();\n\n const hours = now.getHours().toString().padStart(2, '0');\n const minutes = now.getMinutes().toString().padStart(2, '0');\n const seconds = now.getSeconds().toString().padStart(2, '0');\n const millis = now.getMilliseconds().toString().padStart(3, '0');\n\n return `${hours}:${minutes}:${seconds}.${millis}`;\n }\n\n function new_entry() {\n // Copy from template\n const entry = entry_template.cloneNode(/* deep */ true);\n delete entry.id;\n entry.hidden = false;\n entry.classList.add(event_name.replace('.', '-'));\n\n // Timestamp\n entry.getElementsByClassName('timestamp')[0].textContent = create_timestamp();\n\n // Event\n const event_link = document.createElement('a');\n event_link.href = event_link_map[event_name];\n event_link.target = '_blank';\n event_link.textContent = event_name;\n entry.getElementsByClassName('event')[0].append(event_link);\n\n // Message\n entry.getElementsByClassName('entry-text')[0].textContent = thing.toString();\n\n return entry;\n }\n\n // Creates a new log entry group and adds it at the beginning of the log\n function new_entry_group() {\n // eslint-disable-next-line no-shadow\n const entry_group = document.createElement('div');\n entry_group.classList.add('entry-group');\n html_log_header.insertAdjacentElement('afterend', entry_group);\n return entry_group;\n }\n\n /* Group events if they happen within 100ms (= new_entry_timeout) of each other */\n if (create_entry_group) {\n entry_group = new_entry_group();\n }\n // Reset timeout\n clearTimeout(entry_group_timer);\n create_entry_group = false;\n entry_group_timer = setTimeout(() => { create_entry_group = true; }, new_entry_timeout);\n\n const entry = new_entry();\n entry_group.insertAdjacentElement('afterbegin', entry);\n}", "function workflowRecordHistory (row) {\n if ( row['DT_INSERTED'] !== null ) {\n ins_time = ellapseTime ( row['DT_INSERTED'] );\n }\n if ( row['DT_UPDATED'] !== null ) {\n upd_time = ellapseTime ( row['DT_UPDATED'] );\n }\n\n if (row['INSERTED_BY'] ) {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + '</span> ';\n if (ins_time) {\n txt += '<span class=\"timelogValue\" title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + ins_time + '</span>';\n }\n }\n\n if (row['CHANGED_BY'] ) {\n txt += '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\"><i class=\"fas fa-user-edit timelogIcon\"></i> ' + row['CHANGED_BY'];\n if (upd_time) {\n txt += ' <span title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + upd_time + '</span>';\n }\n txt += '</span> ';\n }\n return txt;\n}", "blockSessionParser(block) {\n block.protocol = null;\n block.originator = null;\n block.timeZone = null;\n block.sessionName = null;\n block.originator = null;\n block.protocol = null;\n block.uri = null;\n block.phoneNumber = null;\n block.email = null;\n block.timeDescription = null;\n block.timeRepeat = null;\n\n for (var j = 0; j < block.data.length; j++) {\n var res = block.data[j].split(\"=\");\n var key = res[0].replace(/ |\\n|\\r/g, \"\");\n var value = res[1];\n switch (key) {\n case \"v\":\n block.protocol = value;\n break;\n case \"o\":\n block.originator = this.parseOline(value);\n break;\n case \"s\":\n block.sessionName = value;\n break;\n case \"u\":\n block.uri = value;\n break;\n case \"e\":\n block.email = value;\n break;\n case \"p\":\n block.phoneNumber = value;\n break;\n case \"z\":\n block.timeZone = value;\n break;\n case \"a\":\n block.attributes.push(this.parseAline(value, block));\n break;\n case \"c\":\n block.connection = this.parseCline(value);\n break;\n case \"i\":\n block.information = value;\n break;\n case \"b\":\n block.bandwidths.push(value);\n break;\n case \"k\":\n block.encryption = value;\n break;\n // TIME DESCRIPTION\n case \"t\":\n block.timeDescription = this.parseTline(value);\n break;\n case \"r\":\n block.timeRepeat = this.parseRline(value);\n break;\n }\n }\n return block;\n }", "onLogDumpCreated(logDumpText) {\n const logDump = JSON.parse(logDumpText);\n\n logDump.constants.timeTickOffset = 0;\n logDump.events = [];\n\n const source = new NetInternalsTest.Source(1, EventSourceType.SOCKET);\n logDump.events.push(NetInternalsTest.createBeginEvent(\n source, EventType.SOCKET_ALIVE, this.startTime_, null));\n logDump.events.push(NetInternalsTest.createMatchingEndEvent(\n logDump.events[0], this.endTime_, null));\n logDumpText = JSON.stringify(logDump);\n\n assertEquals('Log loaded.', LogUtil.loadLogFile(logDumpText));\n\n endTime = this.endTime_;\n startTime = this.startTime_;\n if (startTime >= endTime) {\n --startTime;\n }\n\n sanityCheckWithTimeRange(false);\n\n this.onTaskDone();\n }", "listOfLogs() {\n\t\treturn this.bot.autobot.inventory.listBlocksByRegEx(/_log$/);\n\t}", "function twitterTrack(string) {\n var stream = twitter.stream(\"statuses/filter\", { track: string });\n \n console.log(separator.gray);\n logIt(\"<<<<<<<<<<<<<<<<<<<<<<<< NEW LOG STARTS HERE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n logIt(separator);\n stream.on(\"data\", function(event) {\n console.log(\"\");\n console.log(\" Name:.......\".gray + event.user.name.red);\n console.log(\" User:.......\".gray + event.user.screen_name.blue);\n console.log(\" Time:.......\".gray + event.created_at.yellow);\n console.log(\" Location:...\".gray + event.user.location);\n console.log(\" Tweet:......\".gray + event.text.red);\n console.log(separator.gray);\n\n logIt(\"\");\n logIt(\" Name:.......\" + event.user.name);\n logIt(\" User:.......\" + event.user.screen_name);\n logIt(\" Time:.......\" + event.created_at);\n logIt(\" Location:...\" + event.user.location);\n logIt(\" Tweet:......\" + event.text);\n logIt(separator);\n });\n\n stream.on(\"error\", function(error) {\n throw error;\n });\n}", "debug() {\n var counts = {};\n for (var key in BlockType) {\n counts[key] = 0;\n }\n for (var i = 0; i < this.blocks.length; ++i) {\n console.log(`${this.blocks[i].type}: ${this.blocks[i].lines[0]}`);\n }\n console.log(counts);\n }", "function handleCommonTimestamp(\n out,\n buffer,\n index_of_the_first_sample,\n argList,\n flag,\n tagsz\n) {\n // number of sample\n var nb_sample_to_parse = buffer.getNextSample(ST_U8, 8)\n var tag = {}\n\n var temp = initTimestampCommonTable(\n out,\n buffer,\n nb_sample_to_parse,\n index_of_the_first_sample\n )\n var timestampCommon = temp.timestampCommon\n var lastTimestamp = temp.lastTimestamp\n\n for (var j = 0; j < flag.nb_of_type_measure; j++) {\n var first_null_delta_value = 1\n tag.lbl = buffer.getNextSample(ST_U8, tagsz)\n var sampleIndex = findIndexFromArgList(argList, tag)\n for (var i = 0; i < nb_sample_to_parse; i++) {\n // Available bit\n var available = buffer.getNextSample(ST_U8, 1)\n if (available) {\n // Delta value\n var bi = buffer.getNextBifromHi(out.series[sampleIndex].codingTable)\n var currentMeasure = {\n data_relative_timestamp: 0,\n data: {}\n }\n if (bi <= BR_HUFF_MAX_INDEX_TABLE) {\n var precedingValue =\n out.series[sampleIndex].uncompressSamples[\n out.series[sampleIndex].uncompressSamples.length - 1\n ].data.value\n if (bi > 0) {\n currentMeasure.data.value = completeCurrentMeasure(\n buffer,\n precedingValue,\n out.series[sampleIndex].codingType,\n argList[sampleIndex].resol,\n bi\n )\n } else {\n // (bi <= 0)\n if (first_null_delta_value) {\n // First value is yet recorded starting from the header\n first_null_delta_value = 0\n continue\n } else {\n currentMeasure.data.value = precedingValue\n }\n }\n } else {\n // bi > BR_HUFF_MAX_INDEX_TABLE\n currentMeasure.data.value = buffer.getNextSample(\n argList[sampleIndex].sampletype\n )\n }\n currentMeasure.data_relative_timestamp = timestampCommon[i]\n out.series[sampleIndex].uncompressSamples.push(currentMeasure)\n }\n }\n }\n return lastTimestamp\n}", "function parseLogFile(path) {\n // Split on longer regex to avoid potential errors caused by splitting on strings within LineContents column of the table\n let regexFileNameHeader = RegExp(\"Filename: .*\\n\\nLine # Mem usage Increment Line Contents\\n================================================\", \"g\");\n\n let filenames = fs.readFileSync(path, 'utf8').match(regexFileNameHeader).filter(function (e) {\n return e;\n });\n parseAllTableFilenames(filenames);\n\n let functions = fs.readFileSync(path, 'utf8').split(regexFileNameHeader).filter(function (e) {\n return e;\n });\n parseAllTables(functions);\n}", "function extractDataFromLogs(request, logs){\n\tvar piece = logs.split(\" to \");\n\tvar count, count2 = 0;\n\tvar positionFlag = 0;\n\tvar thereIsAlready;\n\tvar accountFound;\n\tfor(count = 0; count <= piece.length - 1; count++){\n\t\tif (piece[count].search(\"#\") == 0){\n\t\t\tpositionFlag = piece[count].search(\" \");\n\t\t\tif (piece[count].search(\" at localhost\") == positionFlag){\n\t\t\t\taccountFound = piece[count].substr(1, positionFlag - 1);\n\t\t\t\tthereIsAlready = false;\n\t\t\t\tfor (count2 = 0; count2 <= request.account.length - 1; count2++){\n\t\t\t\t\tif (request.account[count2] == accountFound){\n\t\t\t\t\t\tthereIsAlready = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (accountFound == request.myAccount){\n\t\t\t\t\tthereIsAlready = true;\n\t\t\t\t}\n\t\t\t\tif (thereIsAlready == false){\n\t\t\t\t\trequest.account.push(accountFound);\n\t\t\t\t\tconsole.log(accountFound);\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n\treturn request;\n}", "logMetrics() {\n logger.info(`# of files indexed: ${this._filesIndexed}`);\n logger.info(`# of directories indexed: ${this._directoriesIndexed}`);\n logger.info(`# of unknown files: ${this._unknownCount}`);\n\n const endTimer = process.hrtime(this._startTimer);\n logger.info(`Execution time: ${endTimer[0] + endTimer[1] / 1E9}s`);\n }", "parse_merge_debug() {\n var merged = [];\n for (var i = 0; i < this.blocks.length; ++i) {\n if (this.blocks[i].matches(BlockPatterns.DEBUG)) {\n var offset = i + 1;\n if (offset < this.blocks.length) {\n this.blocks[i].merge(this.blocks[offset]);\n this.blocks[i].extract_debug_data();\n this.blocks[i].type = BlockType.DEBUG; // extract strips this already\n }\n merged.push(this.blocks[i]);\n i += 1; // Skip~\n }\n else {\n merged.push(this.blocks[i]);\n }\n }\n this.blocks = merged;\n }", "function start_log(node_name, element_id, options)\n{\n options = options || {};\n var position = -100;\n var element = $(element_id);\n var log_func = (() => {\n Hivemind.fetch_json(\n /* endpoint */\n '/nodes/' + node_name + '/log',\n\n /* options */\n {\n 'params' : {\n 'position' : position\n }\n },\n\n /* on_success */\n (data) => {\n\n // Auto scroll if we're at the bottom\n var autoScroll = false;\n var e = element[0];\n var offset = (e.scrollHeight - e.offsetHeight);\n if (e.scrollTop <= (offset + 1) && e.scrollTop >= (offset - 1))\n {\n autoScroll = true;\n }\n else\n {\n console.log(e.scrollTop, e.scrollHeight, e.offsetHeight, e.scrollHeight - e.offsetHeight);\n }\n\n data.content.forEach((line) => element.append(line + '<br/>'))\n position = data.position;\n\n if (autoScroll)\n {\n setTimeout(() => {\n console.log('running...');\n console.log(e.scrollTop, e.scrollHeight, e.offsetHeight, e.scrollHeight - e.offsetHeight);\n e.scrollTop = (e.scrollHeight - e.offsetHeight);\n }, 10);\n }\n });\n });\n setTimeout(log_func, 10);\n var interval = setInterval(log_func, 3000);\n}", "parseBlock(s, currentRehearsalGroup, latest_variables){\n // parase until block boundary is found\n // block boundary = \"[\" or 2 successive NL or NOL\n try{\n var r = null;\n var loop_cnt = 0;\n\n var block = new common.Block();\n var current_align = \"expand\";\n\n this.context.contiguous_line_break = 0; // This should be done only if NL is really consumed.\n\n let num_meas_row = 0;\n\n let MAX_LOOP = 1000;\n\n let end_of_rg = false;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n r = this.nextToken(s);\n if (r.type == TOKEN_END){\n s = r.s; // explicitly consume the last spaces if any.\n end_of_rg = true;\n break;\n }else if (r.type == TOKEN_NL) {\n this.context.line += 1;\n this.context.contiguous_line_break += 1;\n current_align = \"expand\"; // default is expand\n //if(this.context.contiguous_line_break >= 2) break; Do not break here. If the first non NL element is found, then break.\n } else if(r.type == TOKEN_BACK_SLASH){\n if(this.context.contiguous_line_break >= 2) break;\n // Expect TOKEN_NL \n r = this.nextToken(r.s);\n if(r.type != TOKEN_NL) this.onParseError(\"INVALID CODE DETECTED AFTER BACK SLASH\");\n this.context.line += 1;\n //block.appendChild(new common.RawSpaces(r.sss));\n //block.appendChild(new common.RawSpaces(r.token)); \n // Does not count as line break\n }else if(r.type == TOKEN_BRACKET_RA){\n if(this.context.contiguous_line_break >= 2) break;\n // Right aligh indicoator > which is outside measure\n current_align = \"right\";\n }else if(r.type == TOKEN_BRACKET_LA){\n if(this.context.contiguous_line_break >= 2) break;\n // Right aligh indicoator > which is outside measure\n current_align = \"left\";\n } else if (r.type == TOKEN_BRACKET_LS) {\n // Next rehearsal mark detected.\n // Do not consume.\n end_of_rg = true;\n break;\n } else if (\n [\n TOKEN_MB,\n TOKEN_MB_DBL,\n TOKEN_MB_LOOP_BEGIN,\n TOKEN_MB_LOOP_END,\n TOKEN_MB_LOOP_BOTH,\n TOKEN_MB_FIN,\n TOKEN_MB_DBL_SIMILE\n ].indexOf(r.type) >= 0\n ) {\n if(this.context.contiguous_line_break >= 2) break;\n\n let is_new_line_middle_of_block = num_meas_row > 0 && this.context.contiguous_line_break == 1;\n\n this.context.contiguous_line_break = 0;\n \n r = this.parseMeasures(r, r.s); // the last NL has not been consumed.\n // Apply the variables valid at this point for each measures\n //r.measures.forEach(m=>{ m.variables = common.shallowcopy(latest_variables);});\n r.measures.forEach(m=>{\n for(let key in latest_variables){\n m.setVariable(latest_variables[key]);\n }\n });\n\n // For the first measure, set align and new line mark.\n r.measures[0].align = current_align;\n r.measures[0].raw_new_line = is_new_line_middle_of_block; // mark to the first measure\n block.concat(r.measures);\n\n ++num_meas_row;\n\n } else if (r.type == TOKEN_PERCENT) {\n if(this.context.contiguous_line_break >= 2) break;\n // Expression\n r = this.parseVariable(r.s); // last NL would not be consumed\n let variable = new common.Variable(r.key, r.value);\n //block.setVariable(r.key, r.value); Do not do this as with this, only the last variable will be valid.\n latest_variables[r.key] = variable;\n block.appendChild(variable);\n this.context.contiguous_line_break = 0; // -= 1; // Does not reset to 0, but cancell the new line in the same row as this variable\n } else {\n console.log(r.token);\n this.onParseError(\"ERROR_WHILE_PARSE_MOST_OUTSIDER\");\n }\n s = r.s;\n loop_cnt++;\n if (loop_cnt >= MAX_LOOP){\n throw \"Too much elements or infnite loop detected with unkown reason\";\n }\n }\n return { block:block, s:s, end_of_rg:end_of_rg};\n }catch(e){\n console.error(e);\n return null;\n }\n }", "function log(text){\n var date = new Date();\n $('#log').prepend('<span class=\"time\">'+date.toLocaleString()+':</span>'+text+'<br>');\n}", "function formatLogFile() {\n var logText = readLogFile();\n var logTmp = logText.split('[logEnd]');\n var logArray = [];\n _.each(logTmp, function(aLog) {\n var decodedLog = Ti.Utils.base64decode(aLog);\n logArray.push(JSON.parse(decodedLog));\n });\n\n return logArray;\n }", "function cleanUp() {\n\tvar logJson = JSON.parse(fs.readFileSync(\"ping-log.json\",{encoding:\"UTF-8\"}) + \"]}\");\n\tfor(var i = 0;i < logJson.logs.length;i++){\n\t\t\t\tif(logJson.logs[i].t < (new Date().getTime() - 1000*60*60)){\n\t\t\t\t\tif(new Date(logJson.logs[i].t).getMinutes() === 0){\n\t\t\t\t\t\t//check if we can find more log-inputs from the same minute, if so, count average \n\t\t\t\t\t\tfor(var j = i + 1; j < 10; j++){\n\t\t\t\t\t\t\tif(logJson.logs[j]){\n\t\t\t\t\t\t\t\tif(logJson.logs[j].t - logJson.logs[i].t < 1000*60*2){\n\t\t\t\t\t\t\t\t\tlogJson.logs[i].ping = (logJson.logs[j].ping + logJson.logs[i].ping) / 2;\n\t\t\t\t\t\t\t\t\tlogJson.logs.splice(j,1);\n\t\t\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tlogJson.logs.splice(i,1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t}\n\tfs.writeFileSync(\"ping-log.json\",JSON.stringify(logJson).substring(0,JSON.stringify(logJson).length-2));\n}", "function createdOnParser(data) {\n let str = data.split('T');\n let date = str[0];\n let time = str[1].split('.')[0];\n return `${ date } at ${ time }`;\n }", "function _intervalParser() {\n this.regexes = [\n {\n name: \"hh?mmss\",\n regex: /(?:(\\d+)\\:)?(\\d+):(\\d+)/g,\n operate: function (regres, data) {\n if (regres[1]) {\n data.len = 60 * 60 * 1000 * Number(regres[1]);\n }\n data.len += 60 * 1000 * Number(regres[2]);\n data.len += 1000 * Number(regres[3]);\n }\n },\n {\n name: \"sOnly\",\n regex: /(\\d+)s/g,\n operate: function (regres, data) {\n data.len += 1000 * Number(regres[1]);\n }\n },\n {\n name: \"ms\",\n regex: /^\\s*(\\d+)\\s*$/g,\n operate: function (regres, data) {\n data.len += Number(regres[1]);\n }\n },\n ];\n this.reverse = false;\n this.extractTime = (str) => {\n this.tempdata = {\n len: 0\n };\n let seen = false;\n let regres;\n for (let z = 0; z < this.regexes.length; z++) {\n this.regexes[z].regex.lastIndex = 0; //force reset regexes\n while ((regres = this.regexes[z].regex.exec(str)) != null) {\n this.regexes[z].operate(regres, this.tempdata);\n seen = true;\n }\n }\n if (seen) return { string: str, t: this.tempdata.len };\n else return undefined;\n }\n}", "function quick_and_dirty_vtt_or_srt_parser(vtt) {\n console.log('--quick_and_dirty_vtt_or_srt_parser--');\n\tlet lines = vtt.trim().replace('\\r\\n', '\\n').split(/[\\r\\n]/).map(function(line) {\n\t\treturn line.trim();\n });\n // console.log(lines);\n\tlet cues = [];\n\tlet start = null;\n\tlet end = null;\n\tlet payload = null;\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tif (lines[i].indexOf('-->') >= 0) {\n\t\t\tlet splitted = lines[i].split(/[ \\t]+-->[ \\t]+/);\n\t\t\tif (splitted.length != 2) {\n\t\t\t\tthrow 'Error when splitting \"-->\": ' + lines[i];\n\t\t\t}\n\n\t\t\t// Already ignoring anything past the \"end\" timestamp (i.e. cue settings).\n\t\t\tstart = parse_timestamp(splitted[0]);\n\t\t\tend = parse_timestamp(splitted[1]);\n\t\t} else if (lines[i] == '') {\n\t\t\tif (start && end) {\n\t\t\t\tlet cue = { 'start': start, 'end': end, 'text': payload };\n\t\t\t\tcues.push(cue);\n\t\t\t\tstart = null;\n\t\t\t\tend = null;\n\t\t\t\tpayload = null;\n\t\t\t}\n\t\t} else if(start && end) {\n\t\t\tif (payload == null) {\n\t\t\t\tpayload = lines[i];\n\t\t\t} else {\n\t\t\t\tpayload += '\\n' + lines[i];\n\t\t\t}\n\t\t}\n\t}\n\tif (start && end) {\n\t\tlet cue = { 'start': start, 'end': end, 'text': payload };\n\t\tcues.push(cue);\n }\n \n console.log(cues);\n\n\treturn cues;\n}", "displayAspects() { console.log(this.logtags); }", "function logExecutionEvent(id, type, message, time) {\n\n if (logMode === 'l') {\n if (!eventList.executionEvents[id]) {\n eventList.executionEvents[id] = [];\n }\n eventList.executionEvents[id].push({'type': type, 'event': message, \"timestamp\": time});\n } else if (logMode === 'v') {\n console.log(type + ': Agent ' + id + ' ' + message + ' on ' + time);\n }\n\n }", "function parseSrt(srtString) {\n var lines = srtString.split('\\n');\n var subs = [];\n \n \n var SRT_STATE_SUBNUMBER = 0;\n var SRT_STATE_TIME = 1;\n var SRT_STATE_TEXT = 2;\n var SRT_STATE_BLANK = 3;\n\n var state = SRT_STATE_SUBNUMBER;\n var subNum = 0;\n var subText = '';\n var subTime = '';\n var subTimes = '';\n \n for (var i = 0; i < lines.length; i++) {\n switch(state) {\n case SRT_STATE_SUBNUMBER:\n subNum = lines[i].trim();\n state = SRT_STATE_TIME;\n break;\n\n case SRT_STATE_TIME:\n subTime = lines[i].trim();\n state = SRT_STATE_TEXT;\n break;\n\n case SRT_STATE_TEXT:\n if (lines[i].trim() === '' && subTime.indexOf(' --> ') !== -1) {\n subTimes = subTime.split(' --> ');\n \n subs.push({\n number: subNum,\n startTime: (parseInt(subTimes[0].substr(0, 2), 10) * 3600000) + (parseInt(subTimes[0].substr(3, 2), 10) * 60000) + (parseInt(subTimes[0].substr(6, 2), 10) * 1000) + parseInt(subTimes[0].substr(9, 3), 10),\n stopTime: (parseInt(subTimes[1].substr(0, 2), 10) * 3600000) + (parseInt(subTimes[1].substr(3, 2), 10) * 60000) + (parseInt(subTimes[1].substr(6, 2), 10) * 1000) + parseInt(subTimes[1].substr(9, 3), 10),\n text: subText\n });\n subText = '';\n state = SRT_STATE_SUBNUMBER;\n } else {\n if (subText.length > 0) {\n subText += '\\n';\n }\n subText += lines[i];\n }\n break;\n }\n }\n\n return subs;\n }", "lineParser(filename, lines) {\n return lines.split('\\n').map((el) => {\n return {\n logFilename: filename.split('.')[0],\n clientID: this.clientID,\n logLine: el\n }\n });\n }", "parseTime(timeStr)\n\t{\n\t\tlet times = timeStr.split(':');\n\n\t\tif (!times || times.length < 1 || times.length > 3)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\n\t\tlet timeAccumulation = 0;\n\n\t\t// We support up to H:M:S and on date should be used for longer\n\t\twhile (times.length > 0)\n\t\t{\n\t\t\tlet time = parseInt(times.shift(), 10);\n\n\t\t\tif (isNaN(time))\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif (times.length === 2)\n\t\t\t{\n\t\t\t\ttimeAccumulation += 1000 * 60 * 24 * time;\n\t\t\t}\n\t\t\telse if (times.length === 1)\n\t\t\t{\n\t\t\t\ttimeAccumulation += 1000 * 60 * time;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttimeAccumulation += 1000 * time;\n\t\t\t}\n\t\t}\n\n\t\tthis.m_eventEmitter.emit(\"message.log\", `${timeStr} = ${timeAccumulation}`);\n\n\t\treturn timeAccumulation;\n\t}", "function dumpEvents(result){\n for(var i=0; i<result.logs.length;i++){\n console.log(result.logs[i].event,'>>', result.logs[i].args.name,' ',result.logs[i].args.howmuch.toNumber())\n }\n}", "function dumpEvents(result){\n for(var i=0; i<result.logs.length;i++){\n console.log(result.logs[i].event,'>>', result.logs[i].args.name,' ',result.logs[i].args.howmuch.toNumber())\n }\n}", "group( state, pattern, phase, duration, overrideIncr=null ) {\n const start = phase.clone(),\n end = start.add( duration ),\n phaseIncr = overrideIncr === null \n ? getPhaseIncr( pattern ) \n : overrideIncr\n \n let eventList = []\n\n //console.log( \n // 'type:', pattern.type, \n // 'phase:', phase.toFraction(),\n // 'incr:', phaseIncr.toFraction(),\n // 'dur:', duration.toFraction()\n //)\n \n while( phase.compare( end ) < 0 ) {\n // if pattern is a list, read using current phase, else read directly\n const member = Array.isArray( pattern.values ) === true \n ? pattern.values[ getIndex( pattern, phase ) ] \n : pattern.value\n\n // get duration of current event being processed\n const dur = calculateDuration( phase, phaseIncr, end )\n\n // if value is not a numeric or string constant (if it's a pattern)...\n if( member === undefined || (isNaN( member.value ) && typeof member.value !== 'string') ) {\n // query the pattern and remap time values appropriately \n if( member !== undefined ) member.parent = pattern\n //console.log( 'processing ', pattern.type, member.type, dur.toFraction(), phaseIncr.toFraction() )\n const events = processPattern( \n member, \n Fraction(1), \n //member.type !== 'slow' ? Fraction(0) : phase.clone(), \n Fraction(0),\n null, //getPhaseIncr(member),\n null, \n false//shouldRemap( member )\n )\n .map( evt => {\n evt.arc.start = evt.arc.start.mul( dur ).add( phase )\n evt.arc.end = evt.arc.end.mul( dur ).add( phase )\n return evt\n })\n\n eventList = eventList.concat( events )\n }else{\n // XXX shouldn't we just process all patterns???\n // member does not need further processing, so add to event list\n const evt = { \n value:member.value, \n arc:Arc( phase, phase.add( dur ) ),\n }\n if( member.uid !== undefined ) evt.uid = member.uid \n\n eventList.push( evt )\n }\n\n // assuming we are starting / ending at a regular phase increment value...\n \n if( phase.mod( phaseIncr ).valueOf() === 0 ) {\n phase = advancePhase( phase, phaseIncr, end )\n }else{\n // advance phase to next phase increment\n phase = phase.add( phaseIncr.sub( phase.mod( phaseIncr ) ) ) \n }\n }\n\n // prune any events that fall before our start phase or after our end phase\n eventList = eventList.filter( evt => {\n return evt.arc.start.valueOf() >= start.valueOf() && evt.arc.start.valueOf() < end.valueOf()\n })\n \n return state.concat( eventList )\n }", "parse_tag_blocks() {\n for (var i = 0; i < this.blocks.length; ++i) {\n for (var key in BlockPatterns) {\n if (this.blocks[i].matches(BlockPatterns[key])) {\n this.blocks[i].type = key;\n }\n }\n }\n }", "blockMediaParser(block) {\n block.rtpmap = [];\n for (var j = 0; j < block.data.length; j++) {\n var res = block.data[j].split(\"=\");\n var key = res[0].replace(/ |\\n|\\r/g, \"\");\n var value = res[1];\n switch (key) {\n case \"a\":\n block.attributes.push(this.parseAline(value, block));\n break;\n case \"c\":\n block.connection = this.parseCline(value);\n break;\n case \"i\":\n block.information = value;\n break;\n case \"b\":\n block.bandwidths.push(value);\n break;\n case \"k\":\n block.encryption = value;\n break;\n }\n }\n return block;\n }", "dumpEvents(source) {\n const parser = this.instantiateParser();\n const lines = [];\n parser.on(\"*\", (event, data) => {\n /* ignore token events as it becomes to verbose */\n if (event === \"token\") {\n return;\n }\n lines.push({ event, data });\n });\n source.forEach((src) => parser.parseHtml(src));\n return lines;\n }", "onTimeSpanMouseEnter(event) {\n const record = event[`${this.eventName}Record`],\n element = event[`${this.eventName}Element`];\n this.showTerminals(record, DomHelper.down(element, event.source.eventInnerSelector));\n }", "function _initLog(){\n //Push the log header to an array\n currentAction.push(\"Timestamp\");\n currentAction.push(\"User Action\");\n currentAction.push(\"Time needed in s\");\n //Push the single action log to an array containing all action logs\n userActions[0] = currentAction;\n //Reset the sinle action array\n currentAction = [];\n }", "function liveTrace(spotDelay){\n\tvar live = document.getElementsByClassName('visible')[0];\n\t\tlive.addEventListener('timeupdate', function(){\n\t\t\tvar now = live.currentTime;\n\t\t\tvar delayVar = $('.sendVideo').attr('delay');\n\t\t\t// console.log(\"liveTrace \"+ now +\" \"+ delayVar);\t\n\n\t\t\tif (now == live.duration &&live.hasAttribute(\"playnext\") ) {\n\t\t\t\tvideo_play(live.getAttribute(\"playnext\"));\n\t\t\t\tload_spots(live.getAttribute(\"playnext\"));\t\t\t\t\n\t\t\t\t}\n\n\t\t\tif (now > delayVar ){\n\t\t\t\t$(\".sendVideo\").each(function(){\n\t\t\t\t\tvar col = $(this).attr(\"colour\")\n\t\t\t\t\t$(this).addClass(col);\n\t\t\t\t\t$(this).removeClass('hidden');\n\t\t\t\t});\n\t\t\t}\n\t\t})\n}", "function processData2(dat) {\n var allTextLines = dat.split(/\\r\\n|\\n/);\n lines = [];\n for (var i = 0; i < allTextLines.length; i++) {\n var data = allTextLines[i].split(' ');\n var tarr = [];\n for (var j = 0; j < data.length; j++) {\n tarr.push(data[j]);\n }\n lines.push(tarr);\n }\n init();\n animate();\n}", "function log() {\n var logElem = document.querySelector(\".tracker\");\n\n var time = new Date();\n console.log(time);\n logElem.innerHTML += time;\n}", "function log(log) {\n var dateTime = moment().format('YYYY/MM/DD @ hh:mm:ss a');\n console.log('PraxBot: ' + dateTime + ': ' + log);\n }", "_recordImageTime() {\n this._times.push((new Date()).getTime() / 1000);\n this._trimTimeArray();\n }", "function buildDataFn(data, result, childProcess) {\n let localMatch = data.toString('utf-8').match(/Time: (.*)ms/);\n if (localMatch) { result.match = Number(stripAnsi(localMatch[1])) };\n}", "onTimeSpanMouseEnter(event) {\n const record = event[`${this.eventName}Record`],\n element = event[`${this.eventName}Element`];\n this.showTerminals(record, DomHelper.down(element, event.source.eventInnerSelector));\n }", "function loadLog(id){\n var logList = document.getElementById(\"vLog\");\n while (logList.firstChild) {\n logList.removeChild(logList.lastChild);\n }\n var header = document.createElement(\"p\");\n header.innerHTML = \"Log\";\n header.classList.add(\"header3\");\n logList.appendChild(header);\n for (i = 0; i < trucks[id].log.length; i++){\n var listItem = document.createElement(\"a\");\n listItem.classList.add(\"my-list-item\");\n var type = document.createElement(\"div\");\n type.style.borderRight = \"1px solid #DFE0EB\";\n type.classList.add(\"item-section-short\");\n var content = document.createElement(\"div\");\n content.style.borderRight = \"1px solid #DFE0EB\";\n content.classList.add(\"item-section-long\");\n var time = document.createElement(\"div\");\n time.classList.add(\"item-section-short\");\n type.innerHTML = \"<p>\" + trucks[id].log[i].type + \"</p>\";\n content.innerHTML = \"<p>\" + trucks[id].log[i].content + \"</p>\";\n time.innerHTML = \"<p>\" + trucks[id].log[i].occ_time + \"</p>\";\n listItem.appendChild(type);\n listItem.appendChild(content);\n listItem.appendChild(time);\n if (i == trucks[id].log.length - 1){\n if (trucks[id].log.length <= 6){\n listItem.style.borderBottom = \"1px solid #DFE0EB\";\n }\n else{\n listItem.style.borderBottomLeftRadius = \"8px\";\n listItem.style.borderBottomRightRadius = \"8px\";\n }\n }\n listItem.style.borderTop = \"1px solid #DFE0EB\";\n listItem.href = \"#logitem\" + (i+1).toString();\n listItem.id = \"logitem\" + (i+1).toString();\n logList.appendChild(listItem);\n }\n}", "analyzeFrames(frames) {\n return frames.map((frame) => {\n const result = /(?:\\n|^)\\s*(?:at)?\\s*([^\\(\\[]+)(?:\\[([^\\]]+)\\])?\\s*\\(([^\\):]+):?([^\\):]+)?:?([0-9]+)?\\)/gi.exec(frame);\n\n if (result) {\n return {\n fn: result[1] ? result[1].trim() : null,\n alias: result[2] || null,\n path: this.truncatePath(result[3]),\n line: result[4] && result[4] !== 'null' ? result[4] : null,\n character: result[5] || null,\n };\n } else return {text: frame};\n });\n }", "function parseEvent(logEvent, logGroupName, logStreamName) {\n console.log(\"logEvent: \" + JSON.stringify(logEvent));\n return {\n // remove '\\n' character at the end of the event\n message: logEvent.message.trim(),\n logGroupName: logGroupName,\n logStreamName: logStreamName,\n timestamp: new Date(logEvent.timestamp).toISOString()\n };\n }", "replay() {\n for (let event of this.log) {\n console.log(event);\n }\n }", "recordTotal(){ //to record finished time\n return this.timeStampData.filter(time => time.timefinished) \n }", "parseStatsTime() {\r\n this._time_played = this.convertTime(this._datas_str[\"lifeTimeStats\"][13][\"value\"]);\r\n this._time_avg = this.convertTime(this._datas_str[\"lifeTimeStats\"][14][\"value\"]); \r\n }", "function parse_rhub_log(parser, log) {\n\n if (!parser || parser == \"rcmdcheck\") {\n\treturn parse_rcmdcheck_log(log);\n } else if (parser == \"sanitizers\") {\n\treturn parse_sanitizers_log(log);\n } else if (parser == \"rchk\") {\n\treturn parse_rchk_log(log);\n } else {\n\n\tvar last_lines = log.split(/\\n/)\n\t .slice(-100)\n\t .join('\\n');\n\n\treturn {\n\t 'result': {\n\t\t'status': 'parseerror',\n\t\t'notes': [],\n\t\t'warnings': [],\n\t\t'errors': [] },\n\t 'check_output': log,\n\t 'preperror_log': last_lines\n\t};\n }\n}", "function parseData(source) {\n const lines = source.split('\\n').map((l) => l.trim())\n let scale\n let currentScale = sharp11.scale.create('C', 'major')\n const rows = []\n let blockId = 0\n let youtubeId = null\n let bpm = 60\n let offset = 0\n let currentTime = 0\n let lastBlock\n let title\n let lastChord\n const makeBlock = (chord, blockIndex, size = 1) => {\n const start = currentTime\n if (lastBlock) lastBlock.end = start\n currentTime += (60 / bpm) * size\n const block = {\n size,\n chord,\n sustainedChord: chord || lastChord,\n blockId: blockId++,\n blockIndex,\n start,\n end: Infinity,\n }\n lastBlock = block\n lastChord = chord || lastChord\n return block\n }\n for (const line of lines) {\n const tokens = line.match(/\\S+/g) || []\n if (tokens.length === 0) {\n if (rows.length > 0 && rows[rows.length - 1].type !== 'blank') {\n rows.push({ type: 'blank' })\n }\n } else if (tokens[0] === ';') {\n const text = tokens.slice(1).join(' ')\n rows.push({ type: 'lyrics', text })\n } else if (tokens[0] === 'scale') {\n currentScale = sharp11.scale.create(tokens[1], tokens[2] || 'major')\n if (!scale) scale = currentScale\n } else if (tokens[0] === 'youtube') {\n youtubeId = tokens[1]\n } else if (tokens[0] === 'title') {\n title = tokens.slice(1).join(' ')\n } else if (tokens[0] === 'offset') {\n offset = +tokens[1]\n currentTime += +tokens[1]\n } else if (tokens.length === 1 && /:$/.test(tokens[0])) {\n rows.push({ type: 'section', name: tokens[0].slice(0, -1) })\n } else {\n const blocks = []\n let buf = null\n let size = 1\n for (const t of tokens) {\n if (t === 'bpm') {\n buf = 'bpm'\n } else if (buf === 'bpm') {\n buf = null\n bpm = +t\n } else if (t.substr(0, 1) === '*') {\n const [num, den] = t.substr(1).split('/')\n size = +num / (+den || 1)\n } else if (t === '/') {\n blocks.push(makeBlock(null, blocks.length, size))\n } else {\n const m = t.match(/^([b#]?)(\\d)(.*?)(\\/([b#]?)(\\d))?$/)\n if (m) {\n blocks.push(\n makeBlock(\n {\n scale: currentScale,\n root: [m[1], m[2]],\n bass: m[4] && [m[5], m[6]],\n extra: m[3],\n },\n blocks.length,\n size\n )\n )\n } else {\n console.warn('Cannot parse token:', t)\n }\n }\n }\n if (blocks.length) {\n rows.push({ type: 'chord', blocks })\n }\n }\n }\n if (!scale) scale = currentScale\n return { rows, youtubeId, bpm, offset, title, scale }\n}", "function parse() {\n currentToken = 0;\n parseProgram();\n if (document.getElementById('machine-code') !== null) {\n document.getElementById('machine-code').innerHTML += logString + \"Parse complete!\";\n }\n else {\n document.getElementById('error-log').innerHTML += logString;\n }\n logString = \"\";\n programCount = 0;\n}", "function logArrayElements(element, index, array) {\n dateFromPython = new Date(element['Date'])\n if(field == \"CO2 (PPM)\"){\n data.push([dateFromPython.getTime(), ( parseFloat(slope) * parseFloat(element[fieldName]) ) + parseFloat(intercept)] )\n } else if (field == \"CO (PPM)\"){\n data.push([dateFromPython.getTime(), ( parseFloat(slope) * parseFloat(element[fieldName]) ) + parseFloat(intercept)] )\n } else if (field == \"O3 (PPB)\"){\n data.push([dateFromPython.getTime(), ( parseFloat(slope) * (1/parseFloat(element[fieldName])) ) + parseFloat(intercept)] )\n } else if (field == \"Light VOCs (PPM)\"){\n data.push([dateFromPython.getTime(), ( parseFloat(slope) * parseFloat(element[fieldName]) ) + parseFloat(intercept)] )\n } else if (field == \"Heavy VOCs (PPM)\"){\n data.push([dateFromPython.getTime(), ( parseFloat(slope) * parseFloat(element[fieldName]) )] )\n } \n }", "function measureStep(stepName, stepNumber){\n end = new Date().getTime();\n //Push the log data(timestamp, stepname, time needed) to an array\n currentAction.push(new Date(Math.floor(Date.now())));\n currentAction.push(stepName);\n if(userActions[stepNumber+1] != undefined){\n \tcurrentAction.push((end - start)/1000 + userActions[stepNumber+1][2]); \t\n }else{\n \tcurrentAction.push((end - start)/1000);\n }\n //Push the single action log to an array containing all action logs\n userActions[stepNumber + 1] = currentAction;\n //Reset the sinle action array\n currentAction = [];\n //Save a new start time\n start = new Date().getTime();\n }", "function logGraphB(message) {\n\tvar arrayInfo = message.split(\":\");\n\t//splits message based on colon seperators\n\t//\tlogGraphBArr[arrayInfo[1]].push(arrayInfo[1]+\":\"+arrayInfo[2]); //writes to array from array message was seperated in to, writes variable as \"time:length\"\n\t//graphRender(\"logGraph\", \"logGraphBArr\"); //type of graph to draw and name of array to pull from\n\tif (arrayInfo[0] == 0) {\n\t\tvar widthOfBall = 15;\n\t}\n\tif (arrayInfo[0] == 1) {\n\t\tvar widthOfBall = 25;\n\t}\n\tif (arrayInfo[0] == 2) {\n\t\tvar widthOfBall = 45;\n\t}\n\t//x co-ordinate calculated by dividing length from point to ball over the width. Y is straight up time.\n\n\tvar x = Math.round(parseFloat(arrayInfo[2]) / widthOfBall * Math.pow(10, 2)) / Math.pow(10, 2);\n\tvar y = Math.floor(parseInt(arrayInfo[1]));\n\n\tlogResults[0].push(new Array(x, y));\n\tif (document.getElementById(frameToDrawTo).getAttribute(\"type\") == 'logGraph') {\n\t\tlogChart.series[0].addPoint(new Array(x, y));\n\t\tlogDat(frameToDrawTo,'logGraph', new Array('Distance versus time for two inputs', 'Distance from point / Ball width (px)', 'Time taken (ms)', new Array(new Array('Device One', '#0000FF', 'logResults[0]'), new Array('Device Two', '#FF0000', 'logResults[1]'))));\t\t\n\t}\n}", "function countVisitorsByTime(records) {\n var groupedByTime = {};\n var sorted = _.groupBy(_.sortBy(records, function(record) {\n return record.time;\n }), function(record) {\n var date = record.date;\n return date[0] + \"-\" + date[1] + \"-\" + date[2] + \" \" + date[3] + \":00:00\";\n });\n\n _.each(sorted, function(records, datetime) {\n if (!groupedByTime[datetime]) groupedByTime[datetime] = 0;\n\n groupedByTime[datetime] += records.length;\n });\n\n return groupedByTime;\n}", "onTimeSpanMouseEnter(event) {\n const\n record = event[`${this.eventName}Record`],\n element = event[`${this.eventName}Element`];\n this.showTerminals(record, DomHelper.down(element, event.source.eventInnerSelector));\n }", "function analyzeLine(line) {\n\tvar arr = line.split('] [');\n\tif (arr.length == 1) {\n\t\treturn false;\n\t}\n\tvar ret = {};\n\ttry{\n\t\tret['uid'] = arr[9].split('santorini_mm=')[1].split(';')[0].split('%3b')[0];\t//userId\n\t}catch(e){\n\t\tconsole.log('Error:', line, arr, arr[9])\n\t}\n\tgetCata(arr[3], ret);\t//type & catalog & method\n\tret['ip'] = arr[0].split('[')[1];\t//ip\n\tret['vtime'] = arr[2].split(' ')[0];\t//visit time\n\tret['refer'] = arr[6]; //refer\n\tret['url'] = arr[3];\t//url\n\treturn ret;\n}", "function retrieveTimeFragment(url) {\n offsettime = [];\n if (url.indexOf(\"#\") == -1) return [];\n var fragment = url.split(\"#\")[1];\n // first separate out the different components separated by \"&\"\n if (fragment == \"\" || fragment == null) return [];\n var components = [];\n if (fragment.indexOf(\"&\") == -1) {\n components[0] = fragment;\n } else {\n components = fragment.split(\"&\");\n }\n // then parse the component by separating name from value by \"=\"\n for (i=0; i<components.length; i++) {\n var name = components[i].split(\"=\")[0];\n var value = components[i].split(\"=\")[1];\n // then grab last \"t\" component and separate out start and end time\n if (name == \"t\") { // temporal URI\n if (value.indexOf(\"-\") == -1) {\n start = (1.0*value).toFixed(2);\n end = video.duration.toFixed(2);\n } else {\n start = (1.0*value.split(\"-\")[0]).toFixed(2);\n end = (1.0*value.split(\"-\")[1]).toFixed(2);\n }\n offsettime = [start,end];\n }\n }\n return offsettime;\n }", "function trace_print(){\n var tmp_date = new Date();\n trace_data[row_event] = {\"event\": \"printfile\", \"time\" : tmp_date , 'status' : 0, \"row\" :row_event}\n row_event++;\n debug_event();\n}", "async getLog(name) {\n let res = find(this.mission, { fileName: name })\n if (!res) return [];\n const logs = res.logModel;\n const list = await logs.findAll({ limit: 20 });\n return list.map((e) => {\n return { level: e.level, data: e.data, time: e.time };\n })\n }", "function omniTrackEv(omniStr,omniStr2) {\r\nif ((typeof(omniStr)!='string')||(typeof s_account!='string'))return 0;\r\nvar s_time = s_gi(s_account);\r\ns_time.linkTrackVars='events,eVar43,prop13,prop14,prop17';\r\nvar aEvent='event43';\r\nvar aList = [['comment','event44'],['love-it','event48'],['leave-it','event49'],['fb-like','event43'],['fb-share','event43'],['google+1','event43'],['twitter','event43']]\r\nfor (i=0; i < aList.length; i++) {\r\n\tif(omniStr.toLowerCase()==aList[i][0]){aEvent = s_time.apl(aEvent,aList[i][1],',','1');}\r\n}\r\ns_time.linkTrackEvents = s_time.events = aEvent;\r\ns_time.user_action = omniStr;\r\ns_time.prop14 = s_time.pageName;\r\ns_time.prop17;\r\nif((omniStr == 'comment') && typeof(omniStr2)!='undefined'){\r\ns_time.screen_name = omniStr2;\r\ns_time.linkTrackVars+=',eVar41';\r\n}\r\ns_time.tl(true,'o','Event:'+omniStr);\r\ns_time.linkTrackVars = s_time.linkTrackEvents = 'None';\r\ns_time.user_action = s_time.eVar43 = s_time.eVar41 = s_time.prop13 = s_time.prop14 = s_time.prop17 = s_time.events = ''; \r\n}", "function handleLogUpload(evt) {\n var files = evt.target.files; // FileList object\n\n\t// files is a FileList of File objects. List some properties.\n\tvar output = [];\n\tvar file = files[0];\n\tvar reader = new FileReader();\n\n\t// If we use onloadend, we need to check the readyState.\n\treader.onloadend = function(evt) {\n\t\tif (evt.target.readyState == FileReader.DONE) { // DONE == 2\n\t\t\tparseLogFile(evt.target.result);\n\t\t\t// Validate not working at the moment\n\t\t\t//validateLog(initialBoard, evt.target.result);\n\t\t}\n\t};\n\treader.readAsText(file);\n}", "function fnSplitLines(csvData) \n{\n\tvar strSystem = fnReadLocationBar(\"strSystem\",strSystem);\n\tvar strFilename = fnReadLocationBar(\"strFilename\",strFilename);\n\tvar intInterval = parseInt( fnReadLocationBar(\"intInterval\",intInterval) );\n\n\tvar arPingAnswerTime = [];\n\tvar arTimestamp = [];\n\n\tvar strPositionTimestamp = \"\";\n\tvar intTimestamp = 0;\n\tvar intLastTimestamp = 0;\n\n\tvar intPositionAnswerTime = 0;\n\tvar strPositionAnswerTime = \"\";\n\tvar intAnswerTime = 0;\n\tvar strAnswerTime = \"\";\n\n\tvar intPositionTTL = 0;\n\n\t// Split on Line break\n \tvar arZeilen = csvData.split(\"\\n\"); // am Zeilenumbruch aufteilen\n\n\tfor(i = 0; i <= arZeilen.length-2; i++) // do not read line before last line. might not be written yet.\n\t{\n//\t \tvar arWerte = arZeilen[i].split(\" \"); // am Leerzeichen in Zeile i aufteilen\n\n\n\t\t// Identify right column with answer time by operating system\n\t\tif (strSystem == \"win\")\n\t\t{\n\t\t\t// \"Antwort von 173.194.35.191: Bytes=32 Zeit=86ms TTL=53\"\n\n\t\t\tintLastTimestamp = arTimestamp[i-1];\n\t\t\tintPositionTTL = arZeilen[i].indexOf(\"TTL=\"); // \"TTL=\" is always the last entry\n\t\t\tif (intPositionTTL != -1) // if we found the string ...\n\t\t\t{\n\t\t\t\tstrAnswerTime = arZeilen[i].substring(0,intPositionTTL); // cut off until \"TTL=\"\n\t\t\t\tintPositionAnswerTime = strAnswerTime.lastIndexOf(\"=\"); // find last \"=\", this is the one at the ping time\n\t\t\t\tstrPositionAnswerTime = strAnswerTime.substring(intPositionAnswerTime+1,255); // cut off from \"=\" until the end of line\n\t\t\t\tintAnswerTime = parseFloat(strPositionAnswerTime) // automatic discovery of number\n\n\t\t\t\t// check if there are any timestamps recorded\n\t\t\t\tif (intLastTimestamp > 0)\n\t\t\t\t{\n\t\t\t\t\tintLastTimestamp = intLastTimestamp-1+1+intInterval;\n\t\t\t\t}\n\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\tintAnswerTime = 0;\n\n\t\t\t\t// check if a manual timestamp was recorded. Starts with keyword \"TIMESTAMP\"\n\t\t\t\tvar arValues = arZeilen[i].split(\" \"); // split on space\n\t\t\t\t// keyword found, save timestamp\n\t\t\t\tif (arValues[0] == \"TIMESTAMP\")\n\t\t\t\t{\n\t\t\t\t\tintLastTimestamp = arValues[1];\n\t\t\t\t}\n\t\t\t\t// keyword not found. Maybe start of file, error or similar.\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tintLastTimestamp = intLastTimestamp-1+1+intInterval;\n\t\t\t\t}\n\n\t\t\t} // end if-else\n\n\t\t\t// save answer time\n\t\t\tarPingAnswerTime.push(intAnswerTime);\n\t\t\tarTimestamp.push(intLastTimestamp);\n\n//\t\t\t$(\"#debug\").append(\"<br /> i: \"+i+\" intAT: \"+intAnswerTime+\" intTS: \"+intLastTimestamp+\" \");\n\n/*\n\t\t\tif (arWerte[4])\n\t\t\t{ \n\t\t\t\tvar strPingAnswerTime = arWerte[4].substring(5,10) // \"Zeit=12ms\" -> \"12ms\"\n\t\t\t\tvar intPositionMs = strPingAnswerTime.indexOf(\"ms\") // \"ms\" on 3rd position in \"12ms\" \n\t\t\t\tif (intPositionMs != -1)\n\t\t\t\t{\n\t\t\t\t\tvar intPingAnswerTime = strPingAnswerTime.substring(0,intPositionMs) // cut off \"ms\"\n\t\t\t\t\tintPingAnswerTime = parseFloat(intPingAnswerTime);\n\t\t\t\t\tarPingAnswerTime.push(intPingAnswerTime); // answer time on pos. 4\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t{ arPingAnswerTime.push(0)\n\t\t\t}\n\n*/\n\t\t}\n\t\t// LINUX / UNIX / MAC\n\t\telse if (strSystem == \"ix\")\n\t\t{\n\t\t\t// position 7: \"64 bytes from bk-in-f94.1e100.net (173.194.69.94): icmp_req=7 ttl=50 time=25.3 ms\"\n\t\t\t// position 7: \"[1350333849.952585] 64 bytes from 173.194.44.120: icmp_req=2669 ttl=56 time=31.1 ms\"\n\t\t\t// position 8: \"[1350750373.022535] 64 bytes from bk-in-f94.1e100.net (173.194.69.94): icmp_req=1115 ttl=50 time=25.0 ms\"\n\n\t\t\t// check if a timestamp was logged \n\t\t\tstrPositionTimestamp = arZeilen[i].substring(0,1) \n\t\t\tif (strPositionTimestamp == \"[\")\n\t\t\t{ \n\t\t\t\tintTimestamp = arZeilen[i].substring(1,11);\n//\t\t\t\t$(\"#debug\").text(\"<br /> i: \"+i+\" TS \"+intTimestamp);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tintTimestamp = null;\n//\t\t\t\t$(\"#warning\").text(\"<br /> i: \"+i);\n\t\t\t}\n\t\t\t// save timestamp\n\t\t\tarTimestamp.push(intTimestamp);\n\n\n\t\t\t// find \"time=\" and cut off from this position\n\t\t\tintPositionAnswerTime = arZeilen[i].indexOf(\"time=\")\n\t\t\tif (intPositionAnswerTime != -1)\n\t\t\t{\n\t\t\t\tstrPositionAnswerTime = arZeilen[i].substring((intPositionAnswerTime+5),256) // \"time=\": +5 characters\n\t\t\t\tintAnswerTime = parseFloat(strPositionAnswerTime)\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\tintAnswerTime = 0;\n\t\t\t}\n\t\t\t// save answer time\n\t\t\tarPingAnswerTime.push(intAnswerTime)\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar error = true;\n\t\t}\n\n\t} // end: for arZeilen\n\n//\t$(\"#debug\").append(arPingAnswerTime)\n\n\tif (error)\n\t{\n\t\t$(\"#warning\").text(\"<br /> No system given in <a href='system/configuration.js'>config-file</a> or system not found in location bar! Can not interpret the log file correctly. Please <a href='index.html'>reload file</a> with default values\");\n\t}\n\telse\n\t{\n\t\t// Show Analysis\n//\t\tfnAnalysis(arPingAnswerTime, arTimestamp, strSystem, strFilename, intNumberResults, intInterval, intBarWidth, intBarHeight)\n\t\tfnAnalysis(arPingAnswerTime, arTimestamp)\n\t}\n}", "function getAriaEventInfo(event) {\r\n var values = {\r\n 'CorrelationVector': event.vector.toString(),\r\n 'ValidationErrors': event.validationErrors,\r\n 'WebLog_FullName': event.eventName,\r\n 'WebLog_EventType': EventBase_1.ClonedEventType[event.eventType]\r\n };\r\n if (event.eventType === EventBase_1.ClonedEventType.End) {\r\n values.Duration = event.endTime - event.startTime;\r\n }\r\n var names = event.eventName.split(',');\r\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\r\n var name_1 = names_1[_i];\r\n if (name_1) {\r\n values[\"WebLog_Type_\" + name_1] = 1;\r\n }\r\n }\r\n var data = event.data, context = event.context;\r\n if (context) {\r\n for (var key in context) {\r\n if (Object.prototype.hasOwnProperty.call(context, key)) {\r\n var value = context[key];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var loggingName = index_1.capitalize(key);\r\n values[loggingName] = value;\r\n }\r\n }\r\n }\r\n if (data) {\r\n for (var field in data) {\r\n if (Object.prototype.hasOwnProperty.call(data, field)) {\r\n var value = data[field];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var propertyMetadata = event.metadata[field];\r\n if (propertyMetadata) {\r\n var loggingName = propertyMetadata.isPrefixingDisabled ?\r\n index_1.capitalize(field) :\r\n index_1.capitalize(propertyMetadata.definedInName) + \"_\" + field;\r\n var type = propertyMetadata.type;\r\n if (type === 4 /* Object */) {\r\n for (var subField in value) {\r\n if (Object.prototype.hasOwnProperty.call(value, subField)) {\r\n var subValue = value[subField];\r\n if (subValue !== undefined && subValue !== null && subValue !== '') {\r\n // Do not write values which would serialize as empty since they do not provide meaningful\r\n // information in instrumentation back-ends.\r\n values[loggingName + \"_\" + subField.replace('.', '_')] = subValue;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n values[loggingName] = type === 6 /* Enum */ ? propertyMetadata.typeRef[value] : value;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n name: event.isEventTypePrefixingDisabled ? names[names.length - 2] : \"ev_\" + names[names.length - 2],\r\n values: values\r\n };\r\n}", "function parse_block (source, opts) {\n const trim = opts.trim\n ? s => s.trim()\n : s => s\n\n const toggleFence = (typeof opts.fence === 'function')\n ? opts.fence\n : line => line.split(opts.fence).length % 2 === 0\n\n let source_str = source\n .map((line) => { return trim(line.source) })\n .join('\\n')\n\n source_str = trim(source_str)\n\n const start = source[0].number\n\n // merge source lines into tags\n // we assume tag starts with \"@\"\n source = source\n .reduce(function (state, line) {\n line.source = trim(line.source)\n\n // start of a new tag detected\n if (line.source.match(/^\\s*@(\\S+)/) && !state.isFenced) {\n state.tags.push({\n source: [line.source],\n line: line.number\n })\n // keep appending source to the current tag\n } else {\n const tag = state.tags[state.tags.length - 1]\n if (opts.join !== undefined && opts.join !== false && opts.join !== 0 &&\n !line.startWithStar && tag.source.length > 0) {\n let source\n if (typeof opts.join === 'string') {\n source = opts.join + line.source.replace(/^\\s+/, '')\n } else if (typeof opts.join === 'number') {\n source = line.source\n } else {\n source = ' ' + line.source.replace(/^\\s+/, '')\n }\n tag.source[tag.source.length - 1] += source\n } else {\n tag.source.push(line.source)\n }\n }\n\n if (toggleFence(line.source)) {\n state.isFenced = !state.isFenced\n }\n return state\n }, {\n tags: [{ source: [] }],\n isFenced: false\n })\n .tags\n .map((tag) => {\n tag.source = trim(tag.source.join('\\n'))\n return tag\n })\n\n // Block description\n const description = source.shift()\n\n // skip if no descriptions and no tags\n if (description.source === '' && source.length === 0) {\n return null\n }\n\n const tags = source.reduce(function (tags, tag) {\n const tag_node = parse_tag(tag.source, opts.parsers)\n if (!tag_node) { return tags }\n\n tag_node.line = tag.line\n tag_node.source = tag.source\n\n if (opts.dotted_names && tag_node.name.includes('.')) {\n let parent_name\n let parent_tag\n let parent_tags = tags\n const parts = tag_node.name.split('.')\n\n while (parts.length > 1) {\n parent_name = parts.shift()\n parent_tag = find(parent_tags, {\n tag: tag_node.tag,\n name: parent_name\n })\n\n if (!parent_tag) {\n parent_tag = {\n tag: tag_node.tag,\n line: Number(tag_node.line),\n name: parent_name,\n type: '',\n description: ''\n }\n parent_tags.push(parent_tag)\n }\n\n parent_tag.tags = parent_tag.tags || []\n parent_tags = parent_tag.tags\n }\n\n tag_node.name = parts[0]\n parent_tags.push(tag_node)\n return tags\n }\n\n return tags.concat(tag_node)\n }, [])\n\n return {\n tags,\n line: start,\n description: description.source,\n source: source_str\n }\n}", "_extractMessages(data) {\n // split the set of messages into lines, each representing a user or system message \n let lines = data.replace(/\\d{1,2}\\/\\d{1,2}\\/\\d{1,2},\\s\\d{1,2}:\\d{1,2}\\s-\\s/g, `${DEFAULT_LINE_SPLITTER}$&`);\n lines = lines.split(new RegExp(DEFAULT_LINE_SPLITTER, 'g')).filter(m => m).map(m => m.replace(/\\n$/, ''));\n\n const messages = [];\n\n // for each line parses the information as best as possible, creates an object Message and adds it to the messages array\n for (let line of lines) {\n let lastIndex = 0;\n let index = line.match(/,/).index;\n\n const date = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n index = line.match(/-/).index;\n\n const time = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n\n line = line.replace(/:/,'$');\n\n let user = DEFAULT_USER;\n // tries to get the message's text\n const match = line.match(/:/); // Fails if a system message contains ':', e.g. 5/7/17, 22:41 - Alvaro created group \"Grupo: de salir (official)\"\n if (match) {\n user = line.slice(lastIndex, match.index).trim();\n lastIndex = match.index+1;\n }\n\n const message = line.slice(lastIndex).trim();\n\n const isMedia = message == \"<Media omitted>\";\n const isUserMessage = user != \"System\";\n\n messages.push(new Message(date, time, user, message, isMedia, isUserMessage));\n }\n\n return messages;\n }", "parse(eventObject) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// method definition\n\t\tlet {name, time} = eventObject;\t\t\t\t\t\t\t\t\t\t\t// let keyword, destructuring\n\t\treturn `Received event ${name} at time ${time}`;\t\t\t\t\t\t// template string\n\t}", "function parseBody(input) {\n\tfor (var i = 0 ; i < input.length ; i++) {\n\t\tvar obj = input[i]\n\t\tswitch(obj.type) {\n\t\t\tcase 'message':\n\t\t\t\tswitch(obj.message.type) {\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\tmyLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.cyan(' said: ') + chalk.blue(obj.message.text))\n\t\t\t\t\t\tbreak\n case 'location':\n myLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.cyan(' sent a ') + chalk.blue(obj.message.type))\n break\n\t\t\t\t\tdefault:\n myLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.cyan(' sent a ') + chalk.blue(obj.message.type))\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'follow':\n\t\t\t\tmyLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.cyan(' joined the channel'))\n\t\t\t\tbreak\n\t\t\tcase 'unfollow':\n\t\t\t\tmyLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.red(' left the channel'))\n\t\t\t\tbreak\n\t\t\tcase 'join':\n\t\t\t\tmyLog('[' + obj.timestamp + '] ' + chalk.cyan('Joined ') + chalk.green(obj.source.groupId))\n\t\t\t\tchannel = obj.source.groupId\n\t\t\t\tline.sendText(channel, '大家好!我是退治報時機器人OwO')\n\t\t\t\tbreak\n default:\n myLog('[' + obj.timestamp + '] ' + chalk.green(obj.source.userId) + chalk.cyan(' made a ') + chalk.blue(obj.type) + chalk.cyan(' event'))\n\t\t}\n\t}\n}", "function timeAudit() {\n \n $(\".time-block\").each(function () {\n //convert each hour to moment object\n var taskTime = $(this).find(\".hour\").text().trim()\n var taskTimeM = moment(taskTime, \"h a\")\n \n //change color depending on relation to present\n if (moment().isAfter(taskTimeM)) {\n $(this).find(\".task-block\").removeClass(\"present future\").addClass(\"past\")\n }\n\n if (moment().startOf('hour').isSame(taskTimeM)) {\n $(this).find(\".task-block\").removeClass(\"time-test future\").addClass(\"present\")\n }\n\n else if (moment().isBefore(taskTimeM)) {\n $(this).find(\".task-block\").removeClass(\"time-test present\").addClass(\"future\")\n }\n \n })\n}", "liveTime() {\n\t\tthis.updateTime();\n\t\tthis.writeLog();\n\t}" ]
[ "0.552654", "0.54871875", "0.5452622", "0.53817314", "0.52517253", "0.52517253", "0.5249744", "0.51914006", "0.5134551", "0.5007868", "0.49654788", "0.49614042", "0.49240983", "0.48859766", "0.48845705", "0.4860869", "0.4860869", "0.4860869", "0.48470366", "0.48448303", "0.48438895", "0.48329255", "0.48308432", "0.48297977", "0.48279586", "0.4817034", "0.47874063", "0.47650313", "0.47364178", "0.4734284", "0.47232473", "0.4721124", "0.47186416", "0.47143632", "0.46926773", "0.46849704", "0.46619713", "0.4640174", "0.46350384", "0.46059483", "0.4597527", "0.45883656", "0.45858014", "0.4566076", "0.45569363", "0.45386553", "0.45359486", "0.4522148", "0.45127708", "0.45086896", "0.4503202", "0.44936296", "0.44867513", "0.44827288", "0.44825983", "0.4473538", "0.44729257", "0.44691077", "0.44691077", "0.44630036", "0.4460599", "0.44557238", "0.44261113", "0.4419072", "0.44173682", "0.44157916", "0.44081745", "0.4407167", "0.4402519", "0.44016728", "0.4397896", "0.439638", "0.43900728", "0.43839875", "0.4379543", "0.43690342", "0.43658322", "0.4360915", "0.43598035", "0.43576625", "0.43573123", "0.43516085", "0.43508372", "0.43500364", "0.43466717", "0.4345852", "0.43430194", "0.43412718", "0.43408033", "0.4340492", "0.43386623", "0.43380162", "0.43360168", "0.43347478", "0.43309236", "0.43295336", "0.43286398", "0.43285367", "0.43200755", "0.4314099" ]
0.5760078
0
Registers redirect rules assuming that currently no rules are registered by this extension, yet.
function registerRules() { var redirectRule = { priority: 100, conditions: [ // If any of these conditions is fulfilled, the actions are executed. new RequestMatcher({ // Both, the url and the resourceType must match. url: { pathSuffix: ".jpg" }, resourceType: ["image"], }), new RequestMatcher({ url: { pathSuffix: ".jpeg" }, resourceType: ["image"], }), ], actions: [new RedirectRequest({ redirectUrl: catImageUrl })], }; var exceptionRule = { priority: 1000, conditions: [ // We use hostContains to compensate for various top-level domains. new RequestMatcher({ url: { hostContains: ".google." } }), ], actions: [new IgnoreRules({ lowerPriorityThan: 1000 })], }; var callback = function () { if (chrome.runtime.lastError) { console.error("Error adding rules: " + chrome.runtime.lastError); } else { console.info("Rules successfully installed"); chrome.declarativeWebRequest.onRequest.getRules(null, function (rules) { console.info( "Now the following rules are registered: " + JSON.stringify(rules, null, 2) ); }); } }; chrome.declarativeWebRequest.onRequest.addRules( [redirectRule, exceptionRule], callback ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function addRedirect(inputs, {namespace, apihost}) {\n const redirectRules = []\n\n if (deployWeb) {\n redirectRules.push(`/* https://${namespace}-${apihost}/:splat 200!`)\n } else if (inputs.path) {\n const redirectPath = inputs.path.endsWith('/')\n ? inputs.path\n : inputs.path + '/'\n const pkg = isProject ? '' : 'default/'\n redirectRules.push(\n `${redirectPath}* https://${apihost}/api/v1/web/${namespace}/${pkg}:splat 200!`\n )\n }\n\n return redirectRules\n}", "addRedirect(props = {}) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticloadbalancingv2_ApplicationLoadBalancerRedirectConfig(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addRedirect);\n }\n throw error;\n }\n const sourcePort = props.sourcePort ?? 80;\n const targetPort = (props.targetPort ?? 443).toString();\n return this.addListener(`Redirect${sourcePort}To${targetPort}`, {\n protocol: props.sourceProtocol ?? enums_1.ApplicationProtocol.HTTP,\n port: sourcePort,\n open: props.open ?? true,\n defaultAction: application_listener_action_1.ListenerAction.redirect({\n port: targetPort,\n protocol: props.targetProtocol ?? enums_1.ApplicationProtocol.HTTPS,\n permanent: true,\n }),\n });\n }", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' +\n escapeHtml(loc) + '</a>')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'self'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}", "function createRedirectDirectoryListener () {\n return function redirect () {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var msg = 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' + escapeHtml(loc) + '</a>\\n'\n var res = this.res\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(msg))\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(msg)\n }\n}", "function $C1oV$var$createRedirectDirectoryListener() {\n return function redirect(res) {\n if (this.hasTrailingSlash()) {\n this.error(404);\n return;\n } // get original URL\n\n\n var originalUrl = $Cqnu$exports.original(this.req); // append trailing slash\n\n originalUrl.path = null;\n originalUrl.pathname = $C1oV$var$collapseLeadingSlashes(originalUrl.pathname + '/'); // reformat the URL\n\n var loc = $MAG5$exports($Jb61$export$format(originalUrl));\n var doc = $C1oV$var$createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + $QJeO$exports(loc) + '\">' + $QJeO$exports(loc) + '</a>'); // send redirect response\n\n res.statusCode = 301;\n res.setHeader('Content-Type', 'text/html; charset=UTF-8');\n res.setHeader('Content-Length', $C1oV$var$Buffer.byteLength(doc));\n res.setHeader('Content-Security-Policy', \"default-src 'self'\");\n res.setHeader('X-Content-Type-Options', 'nosniff');\n res.setHeader('Location', loc);\n res.end(doc);\n };\n}", "function createRedirectDirectoryListener() {\n return function redirect(res) {\n if (this.hasTrailingSlash()) {\n this.error(404);\n return;\n } // get original URL\n\n\n var originalUrl = parseUrl.original(this.req); // append trailing slash\n\n originalUrl.path = null;\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/'); // reformat the URL\n\n var loc = encodeUrl(url.format(originalUrl));\n var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href=\"' + escapeHtml(loc) + '\">' + escapeHtml(loc) + '</a>'); // send redirect response\n\n res.statusCode = 301;\n res.setHeader('Content-Type', 'text/html; charset=UTF-8');\n res.setHeader('Content-Length', Buffer.byteLength(doc));\n res.setHeader('Content-Security-Policy', \"default-src 'none'\");\n res.setHeader('X-Content-Type-Options', 'nosniff');\n res.setHeader('Location', loc);\n res.end(doc);\n };\n}", "function createRedirectDirectoryListener(){return function redirect(res){if(this.hasTrailingSlash()){this.error(404);return;}// get original URL\nvar originalUrl=parseUrl.original(this.req);// append trailing slash\noriginalUrl.path=null;originalUrl.pathname=collapseLeadingSlashes(originalUrl.pathname+'/');// reformat the URL\nvar loc=encodeUrl(url.format(originalUrl));var doc=createHtmlDocument('Redirecting','Redirecting to <a href=\"'+escapeHtml(loc)+'\">'+escapeHtml(loc)+'</a>');// send redirect response\nres.statusCode=301;res.setHeader('Content-Type','text/html; charset=UTF-8');res.setHeader('Content-Length',Buffer.byteLength(doc));res.setHeader('Content-Security-Policy',\"default-src 'self'\");res.setHeader('X-Content-Type-Options','nosniff');res.setHeader('Location',loc);res.end(doc);};}", "function onBeforeRedirect(details) {\n // Catch redirect loops (ignoring about:blank, etc. caused by other extensions)\n let prefix = details.redirectUrl.substring(0, 5);\n if (prefix === \"http:\" || prefix === \"https\") {\n let count = redirectCounter.get(details.requestId);\n if (count) {\n redirectCounter.set(details.requestId, count + 1);\n util.log(util.DBUG, \"Got redirect id \"+details.requestId+\n \": \"+count);\n } else {\n redirectCounter.set(details.requestId, 1);\n }\n }\n}", "async redirects() {\n return [\n {\n source: \"/\",\n destination: \"/login\",\n permanent: true,\n },\n ];\n }", "function redirect() {\n var reg_exp;\n var host = location.href;\n\n for (var i = 0, len = urls.length; i < len; i++) {\n reg_exp = '^.*' + urls[i] + '.*$';\n\n if (host.match(reg_exp)) {\n window.location = redirectSite;\n break;\n }\n }\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n function check(rule) {\n var handled = rule($injector, $location);\n if (handled) {\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n return false;\n }\n var n=rules.length, i;\n for (i=0; i<n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function AppliedRulesets() {\n this.active_tab_rules = new Map();\n this.active_tab_main_frames = new Map();\n\n let that = this;\n if (chrome.tabs) {\n chrome.tabs.onRemoved.addListener(function(tabId) {\n that.removeTab(tabId);\n });\n }\n}", "function removeProxyRules(ast, options) {\n function isProxyRule(node) {\n return node.type === \"rule\" && node.expression.type === \"rule_ref\";\n }\n\n function replaceRuleRefs(ast, from, to) {\n var replace = visitor.build({\n rule_ref: function(node) {\n if (node.name === from) {\n node.name = to;\n }\n }\n });\n\n replace(ast);\n }\n\n var indices = [];\n\n arrays.each(ast.rules, function(rule, i) {\n if (isProxyRule(rule)) {\n replaceRuleRefs(ast, rule.name, rule.expression.name);\n if (!arrays.contains(options.allowedStartRules, rule.name)) {\n indices.push(i);\n }\n }\n });\n\n indices.reverse();\n\n arrays.each(indices, function(i) { ast.rules.splice(i, 1); });\n }", "function addRules(state, newrules, rules) {\r\n var idx;\r\n for(idx in rules) {\r\n var rule = rules[idx];\r\n var include = rule.include;\r\n if(include) {\r\n if(typeof (include) !== \"string\") {\r\n Common.throwError(lexer, \"an 'include' attribute must be a string at: \" + state);\r\n }\r\n if(include[0] === \"@\") {\r\n include = include.substr(1);\r\n }// peel off starting @\r\n \r\n if(!json.tokenizer[include]) {\r\n Common.throwError(lexer, \"include target '\" + include + \"' is not defined at: \" + state);\r\n }\r\n addRules(state + \".\" + include, newrules, json.tokenizer[include]);\r\n } else {\r\n var newrule = new Rule(state);\r\n // Set up new rule attributes\r\n if(rule instanceof Array && rule.length >= 1 && rule.length <= 3) {\r\n newrule.setRegex(lexerMin, rule[0]);\r\n if(rule.length >= 3) {\r\n if(typeof (rule[1]) === \"string\") {\r\n newrule.setAction(lexerMin, {\r\n token: rule[1],\r\n next: rule[2]\r\n });\r\n } else if(typeof (rule[1]) === \"object\") {\r\n var rule1 = rule[1];\r\n rule1.next = rule[2];\r\n newrule.setAction(lexerMin, rule1);\r\n } else {\r\n Common.throwError(lexer, \"a next state as the last element of a rule can only be given if the action is either an object or a string, at: \" + state);\r\n }\r\n } else {\r\n newrule.setAction(lexerMin, rule[1]);\r\n }\r\n } else {\r\n if(!rule.regex) {\r\n Common.throwError(lexer, \"a rule must either be an array, or an object with a 'regex' or 'include' field at: \" + state);\r\n }\r\n if(rule.name) {\r\n newrule.name = string(rule.name);\r\n }\r\n if(rule.matchOnlyAtStart) {\r\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\r\n }\r\n newrule.setRegex(lexerMin, rule.regex);\r\n newrule.setAction(lexerMin, rule.action);\r\n }\r\n newrules.push(newrule);\r\n }\r\n }\r\n }", "resetRedirect() {\r\n this.queuedRedirectEvent = null;\r\n this.hasHandledPotentialRedirect = false;\r\n }", "function update(rules, otherwiseFn, evt) {\n\t if (evt && evt.defaultPrevented)\n\t return;\n\t function check(rule) {\n\t var handled = rule(coreservices_1.services.$injector, $location);\n\t if (!handled)\n\t return false;\n\t if (predicates_1.isString(handled)) {\n\t $location.setUrl(handled, true);\n\t }\n\t return true;\n\t }\n\t var n = rules.length;\n\t for (var i = 0; i < n; i++) {\n\t if (check(rules[i]))\n\t return;\n\t }\n\t // always check otherwise last to allow dynamic updates to the set of rules\n\t if (otherwiseFn)\n\t check(otherwiseFn);\n\t}", "function CustomRouter(rules) {\n var app_labels = rules.labels;\n var rule, route_map;\n\n this.add = function(rules) {\n rule = rules;\n route_map = h.map_array(rule.tabs, \"path\");\n };\n\n this.route = function(req) {\n\n // redirect custom hosts for bases\n var site_host = h.parse_uri(acre.freebase.site_host).host;\n var site_parts = site_host.split(\".\");\n var req_parts = req.server_name.split(\".\");\n if ((site_parts.length === 3) && (req_parts.length === 3)\n && (req_parts[1] === site_parts[1]) && (req_parts[2] === site_parts[2])) {\n // don't route site host\n if ((req_parts[0] === site_parts[0]) || (req_parts[0] === \"devel\")) {\n // no op\n }\n // special-case RDF service\n else if (req_parts[0] === \"rdf\") {\n var id = acre.request.path_info.replace(/^\\/(ns|rdf)/, \"\").replace(\".\", \"/\");\n h.redirect(scope, acre.freebase.googleapis_url + \"/rdf\" + id);\n }\n // special-case for redirecting robots.txt\n else if (acre.request.path_info === \"/robots.txt\") {\n h.redirect(scope, \"//\" + site_host + \"/robots.txt\");\n }\n // otherwise, assume it's a custom base hostname\n else if (req_parts[0].length >= 5) {\n h.redirect(scope, \"//\" + site_host + \"/base/\" + req_parts[0]);\n }\n }\n\n // handle homepage and \"/browse\"\n if ((req.path_info in route_map) ||\n (req.path_info === \"/\" && !(\n (\"props\" in req.params) || (\"links\" in req.params) || (\"ids\" in req.params)\n ))) {\n\n rule.tabs.forEach(function(item) {\n set_app(item, app_labels);\n item.promises && item.promises.forEach(function(p) {\n set_app(p, app_labels);\n });\n });\n\n rule.promises.forEach(function(item) {\n set_app(item, app_labels);\n });\n\n acre.write(acre.require(\"template/object.sjs\").main(rule, o));\n acre.exit();\n }\n\n return false;\n };\n\n}", "function doRedirectIfSaved(tabId, match_url) {\n var redirect = store[match_url[0]];\n\n if (redirect == null) {\n // No strict alias found. Check for dynamic alias\n\n // Check if we have a matching redirect\n for (var key in store) {\n if (key.startsWith(match_url[0])) {\n // Found the server\n redirect = store[key];\n break;\n }\n }\n\n if (redirect == null) {\n // Nothing to be done if there are no matching aliases\n return;\n }\n\n var num_parameters = match_url.length;\n \n for (var i = 1; i < num_parameters; i++) {\n // multi Variable substituion for dynamic alias\n redirect = redirect.replace(\"###\", match_url[i]);\n }\n }\n\n if (redirect.indexOf('://') < 0) {\n // Add a default protocol if required\n redirect = \"http://\" + redirect;\n }\n \n chrome.tabs.update(tabId, { url: redirect });\n}", "function appendSlashRedirect(req, res, next) {\n if (req.path[req.path.length-1] !== '/') {\n res.writeHead(301, {'Location': urlPrefix + req.path + '/' + req.url.substr(req.path.length)});\n res.end();\n return;\n }\n next();\n }", "function applyRedirects(moduleInjector,configLoader,urlSerializer,urlTree,config){return new ApplyRedirects(moduleInjector,configLoader,urlSerializer,urlTree,config).apply();}", "function removeProxyRules(ast, options) {\n function isProxyRule(node) {\n return node.type === \"rule\" && node.expression.type === \"rule_ref\";\n }\n\n function replaceRuleRefs(ast, from, to) {\n var replace = visitor.build({\n rule_ref: function(node) {\n if (node.name === from) {\n node.name = to;\n }\n }\n });\n\n replace(ast);\n }\n\n var indices = [];\n\n arrays.each(ast.rules, function(rule, i) {\n if (isProxyRule(rule)) {\n replaceRuleRefs(ast, rule.name, rule.expression.name);\n if (!arrays.contains(options.allowedStartRules, rule.name)) {\n indices.push(i);\n }\n }\n });\n\n indices.reverse();\n\n arrays.each(indices, function(i) { ast.rules.splice(i, 1); });\n}", "function addRules(dict, word, rules) {\n var curr = dict[word]\n\n // Some dictionaries will list the same word multiple times with different\n // rule sets.\n if (word in dict) {\n if (curr === NO_RULES) {\n dict[word] = rules.concat()\n } else {\n push.apply(curr, rules)\n }\n } else {\n dict[word] = rules.concat()\n }\n}", "function removeProxyRules(ast, options) {\n function isProxyRule(node) {\n return node.type === \"rule\" && node.expression.type === \"rule_ref\";\n }\n\n function replaceRuleRefs(ast, from, to) {\n var replace = visitor.build({\n rule_ref: function (node) {\n if (node.name === from) {\n node.name = to;\n }\n }\n });\n replace(ast);\n }\n\n var indices = [];\n arrays.each(ast.rules, function (rule, i) {\n if (isProxyRule(rule)) {\n replaceRuleRefs(ast, rule.name, rule.expression.name);\n\n if (!arrays.contains(options.allowedStartRules, rule.name)) {\n indices.push(i);\n }\n }\n });\n indices.reverse();\n arrays.each(indices, function (i) {\n ast.rules.splice(i, 1);\n });\n}", "function removeProxyRules( ast, session, options ) {\n\n function isProxyRule( node ) {\n\n return node.type === \"rule\" && node.expression.type === \"rule_ref\";\n\n }\n\n function replaceRuleRefs( ast, from, to ) {\n\n const replace = session.buildVisitor( {\n rule_ref( node ) {\n\n if ( node.name === from ) {\n\n node.name = to;\n\n }\n\n }\n } );\n\n replace( ast );\n\n }\n\n const indices = [];\n\n ast.rules.forEach( ( rule, i ) => {\n\n if ( isProxyRule( rule ) ) {\n\n replaceRuleRefs( ast, rule.name, rule.expression.name );\n if ( options.allowedStartRules.indexOf( rule.name ) === -1 ) {\n\n indices.push( i );\n\n }\n\n }\n\n } );\n\n indices.reverse();\n\n indices.forEach( i => {\n\n ast.rules.splice( i, 1 );\n\n } );\n\n}", "function addPhonyRule (alias, output_file) {\n if (!ninja_config.phony_rules.hasOwnProperty(alias)) {\n ninja_config.phony_rules[alias] = [];\n }\n\n ninja_config.phony_rules[alias] = ninja_config.phony_rules[alias].concat(output_file);\n}", "redirect(path, redirection) {\n _throwIfDestroyed(this);\n let keys = [];\n let regex = generate(path, keys);\n this[REDIRECTIONS].push({ regex, keys, redirection: prepare(redirection) });\n return regex;\n }", "async function insertRules() {\n let currentRules;\n\n try {\n // Gets the complete list of rules currently applied to the stream\n currentRules = await twitter.getAllRules();\n logger.info('[lib.bot.insertRules] successfully retrieved rules', {\n currentRules,\n });\n\n // Delete all rules. Comment the line below if you want to keep your existing rules.\n const deletedRules = await twitter.deleteAllRules(currentRules);\n logger.info('[lib.bot.insertRules] successfully deleted all rules', {\n deletedRules,\n });\n\n let rules = [];\n // Add rules to the stream. Comment the line below if you don't want to add new rules.\n\n if (config.twitter.useCustomRule) {\n rules = [\n {\n value: `${config.twitter.useCustomRule}`,\n tag: `${config.twitter.customRuleTag}`,\n },\n ];\n } else {\n rules = [\n {\n value: `(${config.twitter.terms\n .trim()\n .split(',')\n .join(' OR')}) from:${\n config.twitter.username_to_watch\n } -is:retweet`,\n tag: 'elon dogecoin tweets',\n },\n ];\n }\n const setRules = await twitter.setRules(rules);\n logger.info('[lib.bot.insertRules] successfully set rules', {\n setRules,\n });\n } catch (e) {\n logger.error({ error: e }, 'An error occured while inserting stream');\n throw e;\n }\n}", "constructor(props) {\n super(props)\n this.checkForRedirect = this.checkForRedirect.bind(this)\n }", "verifyRules()\r\n {\r\n for (let rule of RULES) {\r\n for (let entry of this.app.entries()) {\r\n rule(this, entry);\r\n }\r\n }\r\n }", "function reportDuplicateRules(ast) {\n var rules = {};\n var check = visitor.build({\n rule: function (node) {\n if (rules.hasOwnProperty(node.name)) {\n throw new GrammarError(\"Rule \\\"\" + node.name + \"\\\" is already defined \" + \"at line \" + rules[node.name].start.line + \", \" + \"column \" + rules[node.name].start.column + \".\", node.location);\n }\n\n rules[node.name] = node.location;\n }\n });\n check(ast);\n}", "resetRules() {\n // noop\n }", "function hookLinks() {\n\n\t\t//alert('hookLinks()');\n\t\t// do not allow to open external links\n\t\tdocument.addEventListener('click', function (ev) {\n\t\t\t//alert('click ' + ev.target.tagName);\n\t\t\tvar target = ev.target;\n\t\t\tif (ev.target.tagName && ev.target.tagName.toLowerCase() !== 'a') {\n\t\t\t\ttarget = ev.target.closest('a');\n\t\t\t}\n\n\t\t\tif (target && target.getAttribute('href')) {\n\n\t\t\t\t// if there's http or https it can be redirect to other page\n\t\t\t\tvar href = target.getAttribute('href');\n\t\t\t\tconsole.log('HREF:', href);\n\t\t\t\tconsole.log('RESULT:', /^https?:\\/\\//.test(href) && getDomain(href) !== getDomain(location.href));\n\t\t\t\tif (/^https?:\\/\\//.test(href) && getDomain(href) !== getDomain(location.href)) {\n\t\t\t\t\tev.preventDefault();\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\t\tsend('NOT_ALLOWED_URL', href);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t}", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function register(constructor) {\n const proto = constructor.prototype,\n ruleKeys = Object.getOwnPropertyNames(proto).filter(prop => !(nonRuleKeys.includes(prop)))\n types[constructor.name] = Rule.rulify(proto, ruleKeys);\n}", "function redirectHandler(redirectList) {\n\tvar domain = window.location.hostname;\n\tdomain = domain.replace(\"www.\", \"\").replace(\".com\", \"\").split(\"/\")[0]\n\n if (domain in redirectList) {\n \twindow.location.replace(\"http://www.\" + redirectList[domain] + \".com\")\n }\n}", "function reportDuplicateRules(ast) {\n var rules = {};\n\n var check = visitor.build({\n rule: function(node) {\n if (rules.hasOwnProperty(node.name)) {\n throw new GrammarError(\n \"Rule \\\"\" + node.name + \"\\\" is already defined \"\n + \"at line \" + rules[node.name].start.line + \", \"\n + \"column \" + rules[node.name].start.column + \".\",\n node.location\n );\n }\n\n rules[node.name] = node.location;\n }\n });\n\n check(ast);\n}", "async addRules (add) {\n if (!Array.isArray(add)) {\n add = [ add ]\n }\n\n const result = await needle('post', 'https://' + this.TWT_API_HOST + '/2/tweets/search/stream/rules', {\n add\n }, {\n headers: {\n \"content-type\": \"application/json\",\n Authorization: `Bearer ${this.BEARER}`\n }\n })\n if (result.body.data) {\n this.rules = this.rules.concat(result.body.data)\n return result.body.data\n }\n return []\n }", "function setupListeners() {\r\n removeHistoryListener = routerHistory.listen((to, _from, info) => {\r\n // cannot be a redirect route because it was in history\r\n const toLocation = resolve(to);\r\n // due to dynamic routing, and to hash history with manual navigation\r\n // (manually changing the url or calling history.hash = '#/somewhere'),\r\n // there could be a redirect record in history\r\n const shouldRedirect = handleRedirectRecord(toLocation);\r\n if (shouldRedirect) {\r\n pushWithRedirect(assign(shouldRedirect, { replace: true }), toLocation).catch(noop);\r\n return;\r\n }\r\n pendingLocation = toLocation;\r\n const from = currentRoute.value;\r\n // TODO: should be moved to web history?\r\n if (isBrowser) {\r\n saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());\r\n }\r\n navigate(toLocation, from)\r\n .catch((error) => {\r\n if (isNavigationFailure(error, 4 /* NAVIGATION_ABORTED */ | 8 /* NAVIGATION_CANCELLED */)) {\r\n return error;\r\n }\r\n if (isNavigationFailure(error, 2 /* NAVIGATION_GUARD_REDIRECT */)) {\r\n // Here we could call if (info.delta) routerHistory.go(-info.delta,\r\n // false) but this is bug prone as we have no way to wait the\r\n // navigation to be finished before calling pushWithRedirect. Using\r\n // a setTimeout of 16ms seems to work but there is not guarantee for\r\n // it to work on every browser. So Instead we do not restore the\r\n // history entry and trigger a new navigation as requested by the\r\n // navigation guard.\r\n // the error is already handled by router.push we just want to avoid\r\n // logging the error\r\n pushWithRedirect(error.to, toLocation\r\n // avoid an uncaught rejection, let push call triggerError\r\n )\r\n .then(failure => {\r\n // manual change in hash history #916 ending up in the URL not\r\n // changing but it was changed by the manual url change, so we\r\n // need to manually change it ourselves\r\n if (isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ |\r\n 16 /* NAVIGATION_DUPLICATED */) &&\r\n !info.delta &&\r\n info.type === NavigationType.pop) {\r\n routerHistory.go(-1, false);\r\n }\r\n })\r\n .catch(noop);\r\n // avoid the then branch\r\n return Promise.reject();\r\n }\r\n // do not restore history on unknown direction\r\n if (info.delta)\r\n routerHistory.go(-info.delta, false);\r\n // unrecognized error, transfer to the global handler\r\n return triggerError(error, toLocation, from);\r\n })\r\n .then((failure) => {\r\n failure =\r\n failure ||\r\n finalizeNavigation(\r\n // after navigation, all matched components are resolved\r\n toLocation, from, false);\r\n // revert the navigation\r\n if (failure) {\r\n if (info.delta) {\r\n routerHistory.go(-info.delta, false);\r\n }\r\n else if (info.type === NavigationType.pop &&\r\n isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ | 16 /* NAVIGATION_DUPLICATED */)) {\r\n // manual change in hash history #916\r\n // it's like a push but lacks the information of the direction\r\n routerHistory.go(-1, false);\r\n }\r\n }\r\n triggerAfterEach(toLocation, from, failure);\r\n })\r\n .catch(noop);\r\n });\r\n }", "function update(evt) {\n\t if (evt && evt.defaultPrevented) return;\n\t var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n\t lastPushedUrl = undefined;\n\t if (ignoreUpdate) return true;\n\n\t function check(rule) {\n\t var handled = rule($injector, $location);\n\n\t if (!handled) return false;\n\t if (isString(handled)) $location.replace().url(handled);\n\t return true;\n\t }\n\t var n = rules.length, i;\n\n\t for (i = 0; i < n; i++) {\n\t if (check(rules[i])) return;\n\t }\n\t // always check otherwise last to allow dynamic updates to the set of rules\n\t if (otherwise) check(otherwise);\n\t }", "function addRulesToSheet(rules, baseSelector) {\n for (var ndx = 0; ndx < rules.length; ++ndx) {\n addRule(baseSelector, rules[ndx]);\n }\n}", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "function fixRewriteRules(item) {\n return item.update(\"rewriteRules\", function (rr) {\n return Immutable.List([])\n .concat(rr)\n .filter(Boolean);\n });\n}", "function addRule (name, command) {\n if (!ninja_config.rules.hasOwnProperty(name)) {\n ninja_config.rules[name] = [];\n }\n\n ninja_config.rules[name] = ninja_config.rules[name].concat(command);\n}", "function setupListeners() {\n removeHistoryListener = routerHistory.listen((to, _from, info) => {\n // cannot be a redirect route because it was in history\n let toLocation = resolve(to);\n // due to dynamic routing, and to hash history with manual navigation\n // (manually changing the url or calling history.hash = '#/somewhere'),\n // there could be a redirect record in history\n const shouldRedirect = handleRedirectRecord(toLocation);\n if (shouldRedirect) {\n pushWithRedirect(assign(shouldRedirect, { replace: true }), toLocation).catch(noop);\n return;\n }\n pendingLocation = toLocation;\n const from = currentRoute.value;\n // TODO: should be moved to web history?\n if (isBrowser) {\n saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());\n }\n navigate(toLocation, from)\n .catch((error) => {\n if (isNavigationFailure(error, 4 /* NAVIGATION_ABORTED */ | 8 /* NAVIGATION_CANCELLED */)) {\n return error;\n }\n if (isNavigationFailure(error, 2 /* NAVIGATION_GUARD_REDIRECT */)) {\n // Here we could call if (info.delta) routerHistory.go(-info.delta,\n // false) but this is bug prone as we have no way to wait the\n // navigation to be finished before calling pushWithRedirect. Using\n // a setTimeout of 16ms seems to work but there is not guarantee for\n // it to work on every browser. So Instead we do not restore the\n // history entry and trigger a new navigation as requested by the\n // navigation guard.\n // the error is already handled by router.push we just want to avoid\n // logging the error\n pushWithRedirect(error.to, toLocation\n // avoid an uncaught rejection, let push call triggerError\n ).catch(noop);\n // avoid the then branch\n return Promise.reject();\n }\n // do not restore history on unknown direction\n if (info.delta)\n routerHistory.go(-info.delta, false);\n // unrecognized error, transfer to the global handler\n return triggerError(error);\n })\n .then((failure) => {\n failure =\n failure ||\n finalizeNavigation(\n // after navigation, all matched components are resolved\n toLocation, from, false);\n // revert the navigation\n if (failure && info.delta)\n routerHistory.go(-info.delta, false);\n triggerAfterEach(toLocation, from, failure);\n })\n .catch(noop);\n });\n }", "resetRules() {\n this.ruleCreatorSet = new RuleCreatorSet();\n }", "addRules(name, rules) {\n // Find the rule\n let rule = this._rules[name];\n\n // Check if the rule exits\n if( rule === undefined )\n return false;\n\n //\n if( !isArray(rule) ) {\n // Set the rule\n this._rules[name] = rules[0];\n\n // Return!\n return true;\n }\n\n // Push all the rules\n for( let i = 0; i < rules.length; i++ )\n rule.push(rules[i]);\n\n // Return!\n return true;\n }", "function applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n }", "function update(evt) {\n\t\t\t\tif (evt && evt.defaultPrevented) return;\n\t\t\t\tvar ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n\t\t\t\tlastPushedUrl = undefined;\n\t\t\t\t// TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n\t\t\t\t//if (ignoreUpdate) return true;\n\n\t\t\t\tfunction check(rule) {\n\t\t\t\t\tvar handled = rule($injector, $location);\n\n\t\t\t\t\tif (!handled) return false;\n\t\t\t\t\tif (isString(handled)) $location.replace().url(handled);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tvar n = rules.length, i;\n\n\t\t\t\tfor (i = 0; i < n; i++) {\n\t\t\t\t\tif (check(rules[i])) return;\n\t\t\t\t}\n\t\t\t\t// always check otherwise last to allow dynamic updates to the set of rules\n\t\t\t\tif (otherwise) check(otherwise);\n\t\t\t}", "function didGetRedirectRequestListener() {\n if(event.isMainFrame){\n /****\n * Update the urlToScrape to the new redirected location so we can\n * save the url it ends on.\n * (Using url.parse to add a trailing slash just in case).\n */\n urlToScrape = url.parse(event.newURL).href\n /****\n * So we dont get into an infinite redirect loop.\n */\n numTimesRedirected = numTimesRedirected + 1\n if(numTimesRedirected > 5){\n sendErrorToMainProcess('webview: possible infinite redirect loop')\n removeWebview()\n }\n }\n}", "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "addRule(rule) {\n if (!this.rules[rule.input]) this.rules[rule.input] = [];\n this.rules[rule.input].push(rule);\n }", "function fixRedirectUrlScheme(proxyRes) {\n if (proxyRes.headers['location']) {\n var loc = url.parse(proxyRes.headers['location']);\n if (loc.protocol == 'http:' && loc.port == tlsPort) {\n if (hostNames.indexOf(loc.hostname.toLowerCase()) >= 0) {\n loc.protocol = 'https:';\n proxyRes.headers['location'] = loc.format();\n console.log('### http -> https: ' + loc.protocol + loc.host + loc.path + ' ...');\n }\n }\n }\n}", "function deployResponseRules(rules) {\n for (i = 0; i < rules.length; i++) {\n var tar = rules[i].responsedetails__target.toLowerCase();\n var chn = rules[i].responsedetails__chain.toLowerCase();\n var prot = rules[i].responsedetails__protocol.toLowerCase();\n var source = rules[i].responsedetails__source.toLowerCase();\n var dest = rules[i].responsedetails__destination.toLowerCase();\n\n if (chn === \"input\") {\n buildAddRequest(tar, chn, prot, source, null);\n } else if (chn === \"output\") {\n buildAddRequest(tar, chn, prot, dest, null);\n } else if (chn === \"forward\") {\n buildAddRequest(tar, chn, prot, source, dest);\n } else {\n console.log(\"Something went wrong\");\n }\n }\n}", "function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }", "function loadRules() {\n console.log(\"Load rules\");\n api.storage.local.get(\"rules\", (data) => {\n var loaded = api.runtime.lastError ? [] : data[\"rules\"];\n if (!loaded) {\n loaded = [];\n }\n rules = loaded.filter(function (rule) {\n return rule.enabled;\n });\n console.log(\"Loaded rules: \" + JSON.stringify(rules));\n });\n}", "function check(rule) {\n\t var handled = rule($injector, $location);\n\n\t if (!handled) return false;\n\t if (isString(handled)) $location.replace().url(handled);\n\t return true;\n\t }", "async rewrites() {\n\t\treturn [...routesRewrites]\n\t}", "function addZoneRules(exp, toAdd) {\n assert.object(exp, 'exp');\n\n toAdd.forEach(function (r) {\n // console.log('adding: %s %s %s %s %s %j',\n // r[0].uuid, r[1], r[2], r[3], r[4], r[5]);\n\n var vm = r[0].uuid;\n if (!exp[vm]) {\n exp[vm] = defaultZoneRules();\n }\n\n if (r[1] === 'default') {\n return;\n }\n\n // [vm, 'in', 'pass', 'tcp', ip, ports]\n var proto = createSubObjects(exp[vm], r[1], r[2], r[3]);\n if (!hasKey(proto, r[4])) {\n proto[r[4]] = [];\n }\n\n var ports = typeof (r[5]) === 'object' ? r[5] : r[5];\n proto[r[4]] = proto[r[4]].concat(ports).sort(function (a, b) {\n return Number(a) > Number(b);\n });\n });\n}", "function apply_pending_page_rules () {\r\n\t Behaviour.list = new Array();\r\n Behaviour.register(pending_rules);\r\n Behaviour.apply();\r\n}", "function setupListeners() {\r\n removeHistoryListener = routerHistory.listen((to, _from, info) => {\r\n // cannot be a redirect route because it was in history\r\n const toLocation = resolve(to);\r\n // due to dynamic routing, and to hash history with manual navigation\r\n // (manually changing the url or calling history.hash = '#/somewhere'),\r\n // there could be a redirect record in history\r\n const shouldRedirect = handleRedirectRecord(toLocation);\r\n if (shouldRedirect) {\r\n pushWithRedirect(vue_router_esm_bundler_assign(shouldRedirect, { replace: true }), toLocation).catch(noop);\r\n return;\r\n }\r\n pendingLocation = toLocation;\r\n const from = currentRoute.value;\r\n // TODO: should be moved to web history?\r\n if (isBrowser) {\r\n saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());\r\n }\r\n navigate(toLocation, from)\r\n .catch((error) => {\r\n if (isNavigationFailure(error, 4 /* NAVIGATION_ABORTED */ | 8 /* NAVIGATION_CANCELLED */)) {\r\n return error;\r\n }\r\n if (isNavigationFailure(error, 2 /* NAVIGATION_GUARD_REDIRECT */)) {\r\n // Here we could call if (info.delta) routerHistory.go(-info.delta,\r\n // false) but this is bug prone as we have no way to wait the\r\n // navigation to be finished before calling pushWithRedirect. Using\r\n // a setTimeout of 16ms seems to work but there is not guarantee for\r\n // it to work on every browser. So Instead we do not restore the\r\n // history entry and trigger a new navigation as requested by the\r\n // navigation guard.\r\n // the error is already handled by router.push we just want to avoid\r\n // logging the error\r\n pushWithRedirect(error.to, toLocation\r\n // avoid an uncaught rejection, let push call triggerError\r\n )\r\n .then(failure => {\r\n // manual change in hash history #916 ending up in the URL not\r\n // changing but it was changed by the manual url change, so we\r\n // need to manually change it ourselves\r\n if (isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ |\r\n 16 /* NAVIGATION_DUPLICATED */) &&\r\n !info.delta &&\r\n info.type === NavigationType.pop) {\r\n routerHistory.go(-1, false);\r\n }\r\n })\r\n .catch(noop);\r\n // avoid the then branch\r\n return Promise.reject();\r\n }\r\n // do not restore history on unknown direction\r\n if (info.delta)\r\n routerHistory.go(-info.delta, false);\r\n // unrecognized error, transfer to the global handler\r\n return triggerError(error, toLocation, from);\r\n })\r\n .then((failure) => {\r\n failure =\r\n failure ||\r\n finalizeNavigation(\r\n // after navigation, all matched components are resolved\r\n toLocation, from, false);\r\n // revert the navigation\r\n if (failure) {\r\n if (info.delta) {\r\n routerHistory.go(-info.delta, false);\r\n }\r\n else if (info.type === NavigationType.pop &&\r\n isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ | 16 /* NAVIGATION_DUPLICATED */)) {\r\n // manual change in hash history #916\r\n // it's like a push but lacks the information of the direction\r\n routerHistory.go(-1, false);\r\n }\r\n }\r\n triggerAfterEach(toLocation, from, failure);\r\n })\r\n .catch(noop);\r\n });\r\n }", "add(rule) { \n this.rules[rule.type] = rule \n rule.parser = this\n }", "function loadRoutes() {\n\n registerRoute(\"/access/denied\", Controllers.Access.prototype.denied)\n registerRoute(\"/users/register\", Controllers.Users.prototype.register,true)\n\n }", "function _addHandlerForRule(_ruleID, _handlerFn) {\n _ruleHandlersList[_ruleID] = _handlerFn;\n}", "static redirect(location, res) {\n res.writeHead(303, {'Location': location});\n res.end();\n }", "function registerPropertyRule(rule) {\n var propRules = Property$getRules(rule.property);\n propRules.push(rule);\n // Raise events if registered.\n var subscriptions = getEventSubscriptions(rule.property._events.ruleRegisteredEvent);\n if (subscriptions && subscriptions.length > 0) {\n rule.property._events.ruleRegisteredEvent.publish(rule.property, { rule: rule });\n }\n}", "function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }", "function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }", "function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }", "function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }" ]
[ "0.574882", "0.546954", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5318327", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311433", "0.5311381", "0.5260532", "0.52460283", "0.52335984", "0.5126295", "0.5094236", "0.5084148", "0.49333873", "0.48918173", "0.48854837", "0.48813388", "0.48740262", "0.4873179", "0.48596102", "0.48076713", "0.47980842", "0.47861084", "0.47817442", "0.47774312", "0.4764964", "0.47128356", "0.46754423", "0.46364194", "0.46280354", "0.461157", "0.4608313", "0.46041217", "0.45894483", "0.45779273", "0.4577905", "0.4577905", "0.4577905", "0.4577905", "0.45762694", "0.45683986", "0.45554706", "0.4552664", "0.45047486", "0.44957393", "0.4471619", "0.44653878", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4434699", "0.4429484", "0.44182986", "0.44128042", "0.43899128", "0.43871188", "0.43806243", "0.43735212", "0.43703791", "0.43541306", "0.4352219", "0.4332788", "0.4330771", "0.43300244", "0.43166348", "0.42962137", "0.42880186", "0.42849106", "0.42847702", "0.42768243", "0.42670798", "0.42658365", "0.42574218", "0.4255619", "0.4252983", "0.42391893", "0.42391893", "0.42391893", "0.42391893" ]
0.7447899
0
Testing how to save the course in the courseCart of the DB
function MapAndJSONTesting(res) { let testMap = new Map(); let testArr = [0, 1, 2, 3, 4, 5, 6]; testMap.set("Schedule1", testArr); console.log(testMap.toString()); console.log(testMap); let testObj = { "ya": "okay" }; let testMap2Json = mapToJson(testMap); console.log(testMap2Json); console.log(jsonToMap(testMap2Json)); console.log(typeof testObj); res.status(200).json({ "testMap": testMap, "testMap2JSON": testMap2Json, "testArr": testArr, "testObj": testObj }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCourse(course) {\n course.coursename = course.coursefirstname + \"-\" + course.courselastname;\n course.semid = vm.semesterId;\n course.profid = vm.userInfo.professorid;\n courseService\n .createCourse(course)\n .then(function (cr) {\n courseService\n .getAllCoursesForProfessor(vm.semesterId, vm.userInfo.professorid)\n .then(function (uCourses) {\n vm.userCourses = uCourses;\n });\n $route.reload();\n });\n }", "function createCourse(course) {\n courseService.createCourse(course)\n .then(function (actualCourse) {\n courses.push(actualCourse)\n renderCourses(courses)\n })\n}", "function createCourse() {\n vm.course = datacontext.createCourse();\n }", "function addIntoCart(course) {\n // create a <tr>\n const row = document.createElement('tr');\n\n // Build the template\n row.innerHTML = `\n <tr>\n <td>\n <img src=\"${course.image}\" width=174>\n </td>\n <td>${course.title}</td>\n <td>${course.price}</td>\n <td>\n <a href=\"#!\" class=\"remove\" id=\"${course.id}\">X</a>\n </td>\n </tr>\n `;\n // Add into the shopping cart\n shoppingCartContent.appendChild(row);\n\n // Add course into Storage\n saveIntoStorage(course);\n }", "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 insertInCart(course){\n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n <img src = \"${course.image}\">\n </td>\n <td>\n ${course.title}\n </td>\n <td>\n ${course.price}\n </td>\n <td class=\"cross\">\n <a href = \"#\" class = \"deleteCourse\" data-id = \"${course.id}\">x</a>\n </td>\n ` ;\n listCourses.appendChild(row);\n saveCourseLocalStorage(course);\n}", "function saveCourses(courses){\n\tlet index = 0\n\tlet length = courses.length\n\tfor(let i=0; i<courses.length; i++){\n\t\tcoursesDb.insert({\n\t\t\tid: courses[i].id,\n\t\t\tmentor: courses[i].mentor,\n\t\t\tcompleted: courses[i].completed,\n\t\t\tstart_date: courses[i].start_date,\n\t\t\ttitle: courses[i].title,\n\t\t\tvalidity: courses[i].validity,\n\t\t\tresourceCount: courses[i].resourceCount\n\t\t}, function(err, docs){\n\t\t\tindex++\n\t\t\tif(index === length){\n\t\t\t\tsaveLessons(newLessons)\n\t\t\t}\n\t\t})\n\t}\n}", "function addToCart(course) {\n // create a tr\n const row = document.createElement('tr');\n\n // Build a template\n row.innerHTML = `\n <tr>\n <td>\n <img src = \"${course.image}\" width=100>\n </td>\n <td>${course.title}</td> \n <td>${course.price}</td> \n <td> <a href=\"#\" class=\"remove\" data-id=\"${course.id}\">X</a> </td>\n `;\n\n // Add to cart\n shoppingCartContent.appendChild(row);\n\n // Add course into Local Storage \n saveIntoStorage(course);\n}", "save() {\n store.put(`schedules.saved.${this.name}`, (this.courses));\n }", "async function createCourse() {\n const course = new CourseClass({\n name: 'Web development',\n author: 'Angela Yu',\n price: 129,\n tags: ['backend', 'webdesign', 'react', 'frontend'],\n isPublished: true\n });\n const result = await course.save();\n //console.log(result);\n}", "async function createCourse() {\n const course = new Course({\n name: 'aa',\n author: 'js',\n tags: ['a', 'b'],\n isPublished: true\n });\n\n try {\n const result = await course.save();\n console.log(result);\n } catch(error) {\n console.error(error.message);\n }\n}", "async function createCourse() {\n // Creating an item course\n const course = new Course({\n name: \"React JS Course\",\n author: \"Chris\",\n tags: ['tutorial', 'frontend', 'javascript'],\n isPublished: false\n });\n // Add the value to the database\n try{\n const result = await course.save();\n console.log(`Result from the operation: ${result}`);\n } catch (ex) {\n for (field in ex.errors)\n console.log(ex.errors[field].message);\n }\n\n}", "addCourse(course) {\r\n this.courses.push(course);\r\n }", "function getCourseInfo(course) {\n // Create Object of Course Data\n\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n //Insert Data into Cart\n addToCart(courseInfo);\n}", "async function saveToDB(course) {\n const result = await course.save();\n console.log(result);\n}", "async function CreateCourse(course, author) {\n let data = new courseModel({\n course,\n author\n });\n\n let item = await data.save();\n console.log(item);\n}", "async __save() {\n const courses = await Course.getAll(); // Обрабатываем промис из getAll()\n courses.push(this.toJSON());\n\n // return Promise to the add.js\n return new Promise((resolve, reject) => {\n fs.writeFile(\n path.join(__dirname, '../data', 'courses.json'),\n JSON.stringify(courses),\n err => {\n if (err) reject(err);\n resolve()\n })\n })\n }", "function insertCourse(course) {\n const table = document.querySelector(\"#table>tbody\");\n const id = document.createElement(\"td\");\n id.innerText = course.idCourse.toString();\n const label = document.createElement(\"td\");\n label.innerText = course.courseLabel.toString();\n const description = document.createElement(\"td\");\n description.innerText = course.courseDescription.toString();\n const tr = document.createElement(\"tr\");\n tr.appendChild(id);\n tr.appendChild(label);\n tr.appendChild(description);\n table.appendChild(tr);\n}", "async function createCourse() {\n const course = new Course({\n name: \"rahul\",\n author: \"sharma\",\n tags: ['red hat', 'devops'],\n isPublished: true\n })\n\n const result = await course.save();\n console.log(result);\n}", "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n \n courses.push(course);\n \n localStorage.setItem('courses', JSON.stringify(courses) );\n \n}", "addhsCourse() {\n\n if (this.get('subjectTemp') == null)\n {\n alert(\"Please select a subject.\");\n }\n else if (this.get('schoolTemp') == null)\n {\n alert(\"Please select a school\");\n }\n else\n {\n var newhsCourse = this.get('store').createRecord('high-school-course', {\n level: this.get('level'),\n source:this.get('source'),\n unit: this.get('unit'),\n school: this.get('schoolTemp'),\n course: this.get('subjectTemp')\n });\n newhsCourse.save();\n }\n }", "function insertincart(course) {\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td>\r\n <img src=\"${course.image}\" width=100>\r\n </td>\r\n <td>${course.title}</td>\r\n <td>${course.price}</td>\r\n <td>\r\n <a href=\"#\" class=\"delete-course\" data-id=\"${course.id}\">X</a>\r\n </td>\r\n `;\r\n listcourses.appendChild(row);\r\n savecourseLocalStorage(course);\r\n}", "static add(cours) {\r\n // cours.id = nextId++;\r\n // coursExtent.push(cours);\r\n // return cours;\r\n return db.execute('insert into Kurs (Nazwa, Opis, Cena, Wykladowca_Id_wykladowca) values (?, ?, ?, ?)', [cours.name, cours.description, cours.price, cours.id_instructor]);\r\n // return db.execute(\r\n // 'insert into Klient (imie, nazwisko, plec,email, data_urodzenia) values (?, ?, ?, ?, ?)',\r\n // [user.firstName, user.lastName, user.sex, user.email, user.dateOfBirth]\r\n // );\r\n }", "function saveCourseLocalStorage(course){\n let courses;\n courses = getCoursesLocalStorage();\n courses.push(course);\n localStorage.setItem('courses', JSON.stringify(courses));\n}", "'click #cb-save'( e, t ) {\n e.preventDefault();\n \n t.$( '#intro-modal' ).modal( 'hide' );\n\n // CHECK THAT THERE'S CONTENT\n\n\n let uname = Students.findOne( { _id: Meteor.userId() },\n { fullName:1 } ).fullName\n , cinfo = Session.get('cinfo'); \n \n let pobj = P.dump();\n if ( pobj.length <= 0 ) {\n Bert.alert(\"You can't save an EMPTY course!!\", 'danger');\n return;\n }\n\n Meteor.setTimeout(function(){\n Meteor.call('saveBuiltCourse', cinfo.cname,\n cinfo.company_id,\n cinfo.creator_type,\n cinfo.credits,\n cinfo.keywords,\n cinfo.passing_percent,\n cinfo.icon,\n pobj,\n uname,\n function( error, result )\n {\n if( error ) {\n alert( 'Error' );\n } else {\n console.log( 'result is ' + result );\n //Session.set(\"data\", result)\n Courses.insert({\n _id: result,\n credits: cinfo.credits,\n name: cinfo.cname,\n passing_percent: cinfo.passing_percent,\n company_id: [cinfo.company_id],\n times_completed: 0,\n icon: cinfo.icon,\n public: false,\n creator_type: cinfo.creator_type,\n creator_id: cinfo.creator_id,\n created_at: new Date(),\n approved: true,\n type: 'course',\n isArchived: false\n });\n }\n });\n \n //-----------------------------------------------\n /*\n * IF THE COURSE CREATOR IS A TEACHER\n * ASSIGN TEACHER A FIXED 2 CREDITS\n *--------------------------------------------- */\n if ( Meteor.user().roles && Meteor.user().roles.teacher ) {\n Students.update({ _id: Meteor.userId() },\n {\n $inc: { current_credits: 2 }\n });\n }\n //-----------------------------------------------\n // SET PAGE COUNTS\n t.page.set( 1 );\n t.total.set( 1 );\n }, 300);\n \n P = null;\n \n Session.set( 'my_id', null );\n Session.set( 'cinfo', null );\n Session.set( 'test_id', null );\n Session.set( 'Scratch', null );\n \n Meteor.setTimeout(function(){\n Bert.alert(\n 'Your Course was saved!',\n 'success',\n 'growl-top-right'\n );\n }, 500);\n \n let roles = Meteor.user() && Meteor.user().roles;\n \n if ( roles && roles.admin )\n {\n FlowRouter.go( 'admin-dashboard', { _id: Meteor.userId() });\n return;\n }\n if ( roles && roles.teacher )\n {\n FlowRouter.go( 'teacher-dashboard', { _id: Meteor.userId() });\n return;\n }\n if ( roles && roles.SuperAdmin )\n {\n FlowRouter.go( 'super-admin-dashboard', { _id: Meteor.userId() });\n return;\n }\n//---------------------------------------------/SAVE COURSE-------\n }", "function getCourseInfo(course) {\n //access to the course info\n const courseInfo = {\n image: course.querySelector(\"img\").src,\n title: course.querySelector(\"h4\").textContent,\n price: course.querySelector(\"span\").textContent,\n id: course.querySelectorAll(\"a\")[1].getAttribute(\"data-id\")\n\n }\n //adding the course to the card\n addToCart(courseInfo);\n}", "updateCourse(course) {\r\n this.log(course.userId);\r\n this.log(\"Updating course\");\r\n return this.context\r\n .execute( `\r\n UPDATE Courses\r\n SET userId = ?, title = ?, description = ?, estimatedTime = ?, materialsNeeded = ?, updatedAt = datetime('now')\r\n WHERE Courses.id = ?\r\n `, \r\n course.userId,\r\n course.title,\r\n course.description,\r\n course.estimatedTime,\r\n course.materialsNeeded,\r\n course.id\r\n )\r\n }", "function getCourseInfo(course) {\n\n // Create an Object with Course Data\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('h3').textContent,\n id: course.id\n\n }\n // Insert into the shopping cart\n addIntoCart(courseInfo);\n var btn = course.querySelector('button');\n btn.innerHTML = \"Added to cart\";\n\n }", "function buycourse(e) {\r\n e.preventDefault();\r\n // Delegation to add-cart\r\n if(e.target.classList.contains('add-cart')) {\r\n const course = e.target.parentElement.parentElement;\r\n // We send the selected course to take your data\r\n readDataCourse(course);\r\n }\r\n}", "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n\n // add the course into array\n courses.push(course);\n\n localStorage.setItem('courses', JSON.stringify(courses));\n}", "function addCourse(course) {\n myCourses = JSON.parse(localStorage.getItem(\"myCourses\")) || [];\n myCourses.push(course);\n localStorage.removeItem(\"myCourses\");\n // console.log(myCourses);\n addToLocalStorage(myCourses);\n }", "async function createCourse(name, author) {\n const course = new Course({\n name, author\n })\n const result = await course.save()\n console.log(result)\n}", "function buyCourse(e) {\n e.preventDefault();\n \n if (e.target.classList.contains('add-to-cart')) {\n \n const course = e.target.parentElement.parentElement;\n getCourseInfo(course);\n }\n}", "function setCourses(courses) {\r\n localStorage.setItem(\"courses\", JSON.stringify(courses));\r\n}", "function testSave(){\n setCurrentLangData();\n setCurrentData();\n saveData();\n}", "function saveIntoStorage(course) {\n let courses = getCoursesFromStorage();\n\n // add the course into the array\n courses.push(course);\n\n // since storage only saves strings, we need to convert JSON into String\n localStorage.setItem('courses', JSON.stringify(courses));\n }", "function savecourseLocalStorage(course) {\r\n let courses;\r\n // Take the value of an array with LS or empty data\r\n courses = getcoursesLocalStorage();\r\n // the selected course is added to the array\r\n courses.push(course);\r\n localStorage.setItem('courses', JSON.stringify(courses) );\r\n}", "function buyCourse(e){\n e.preventDefault();\n \n if(e.target.classList.contains('add-cart')){\n const course = e.target.parentElement.parentElement;\n readDataCourse(course);\n }\n}", "function addCourses(id, courses) {\n\tusers.findOneAndUpdate(\n\t\t{ cookie_uuid: id },\n\t\t{\n\t\t\t$set: {\n\t\t\t\tmemrise_courses: courses,\n\t\t\t},\n\t\t}\n\t);\n}", "function saveIntoStorage(course) {\n let courses;\n // If something exists on storage then we get value, otherwise, create empty array\n if(sessionStorage.getItem('courses') === null) {\n courses = [];\n } else {\n courses = JSON.parse(sessionStorage.getItem('courses'));\n }\n\n // Add the new course\n courses.push(course);\n\n // Since Storage only saves strings, we need to convert array into JSON\n sessionStorage.setItem('courses', JSON.stringify(courses) );\n}", "function getCourseInfo(course){\n\n const courseinfo={\n image:course.querySelector('img').src,\n title:course.querySelector('h4').textContent,\n price:course.querySelector('.price span').textContent,\n id:course.querySelector('a').getAttribute('data-id')\n };\n\n //add to the cart \n\n addToCart(courseinfo);\n\n}", "function addCourse(userId, newCourse, callback) {\n new Grade({\n user_id: userId,\n course_code: newCourse,\n grade: 0.0\n }).save().then(() => callback());\n}", "function getCourseInfo(course) {\n // Create an Object with Course Data\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n // Insert into the Shopping cart\n addIntoCart(courseInfo);\n console.log(courseInfo);\n}", "function readDataCourse(course){\n const infoCourse = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.discounted').textContent,\n id: course.querySelector('a').getAttribute('data-id')\n }\n insertInCart(infoCourse);\n}", "addCourse(newCourse) {\n if (this.getCourseDetails(newCourse.name)) {\n return \"Course already exists\";\n }\n\n const allCourses = this.getCoursesDetail();\n allCourses.push(newCourse);\n\n const newFileJson = JSON.stringify(allCourses, null, 4);\n fs.writeFileSync(this.fileName, newFileJson);\n return \"Course successfuly added\";\n }", "deleteCourse(course) {\r\n return this.context\r\n .execute(`\r\n DELETE FROM Courses\r\n WHERE id = ?\r\n `,\r\n course.id\r\n )\r\n }", "function getCourseInfo(course){\n const courseInfo = {\n image : course.querySelector('img').src,\n title : course.querySelector('h4').textContent,\n price : course.querySelector('.price span').textContent,\n id : course.querySelector(\"a\").getAttribute('data-id'),\n }\n //Try code to make sure everthing is working\n console.log(courseInfo);\n //OK! Now that the Course information had been read, it is time to pass the information into the shoppiung cart\n addCourseToCart(courseInfo);\n}", "setCourse(state, course) {\n state.course = course;\n }", "async function updatecourse(id){\r\n const course= await Course.findById(id);\r\n \r\n if(!course) return;\r\n\r\n course.isPublished=true;\r\n course.author='meghana';\r\n\r\n const result= await course.save();\r\n console.log(result)\r\n\r\n //OR\r\n // course.set({\r\n // isPublished:true,\r\n // author:'meghana'\r\n // });\r\n\r\n}", "addCourse(course){\n this.#course_list.push(course)\n }", "async addCourse(title, url, platform, category_id) {\n const res = await fetch(`/courses`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ title, url, platform, category_id }),\n });\n if (res.ok) return;\n else throw new Error(\"Something went wrong\");\n }", "async function updateCourse(id) {\n // Find\n const course = await Course.findById(id)\n // const course = await Course.find({ _id: '3424432432dsafdsds' })\n if(!course) return;\n\n // Change\n course.author = 'hphk-YEAH';\n course.tags = ['SDFSFD'];\n \n // Save\n const result = await course.save();\n console.log(result);\n}", "static create(params) {\n return CourseModel.send_post(\"/courses\", params)\n }", "async function insertNewCourse(course) {\n course = extractValidFields(course, CourseSchema);\n const db = getDBReference();\n const collection = db.collection('courses');\n const result = await collection.insertOne(course);\n return result.insertedId;\n}", "function CourseDetailCtrl($scope, $routeParams, $q, Course, Data) {\n $scope.date = new Date();\n $scope.saveEnabled = true;\n\n if ($routeParams.courseId === \"new\") {\n $scope.course = new Course();\n $scope.course.industryId = 1;\n } else {\n Course.query({courseId: $routeParams.courseId}, function (course) {\n course.noOfDays = parseInt(course.noOfDays);\n course.length = parseInt(course.length);\n course.cmPoints = parseFloat(course.cmPoints);\n course.ceuPoints = parseFloat(course.ceuPoints);\n course.cost = parseFloat(course.cost);\n $q.all([$scope.courseTitlesP, $scope.stateCodesP, $scope.courseLanguagesP, $scope.educationCentersP]).then(function () {\n $scope.course = course;\n Data.setCourse($scope.course);\n });\n });\n }\n\n $scope.formatDate = function (inDate) {\n// var date = new Date($scope.course.startDate);\n try{\n var date = new Date(inDate);\n var year = date.getFullYear().toString();\n var month = (\"0\" + (date.getMonth()+1).toString()).slice(-2);\n var day = (\"0\" + date.getDate().toString()).slice(-2);\n var newDate = year + \"-\" + month + \"-\" + day + \"T00:00:00-07:00\";\n } catch (e) {\n newDate = inDate;\n }\n return newDate;\n }\n\n $scope.isDate = function (inDate)\n {\n var date = new Date(inDate);\n return (null != inDate) && !isNaN(inDate) && (\"undefined\" !== typeof date.getDate);\n }\n\n $scope.save = function () {\n $scope.saveEnabled = false;\n $scope.course.startDate = $scope.formatDate($scope.course.startDate);\n $scope.course.endDate = $scope.formatDate($scope.course.endDate);\n if ($routeParams.courseId === \"new\") {\n Course.insert({}, $scope.course, function () {\n $scope.course = new Course();\n $scope.course.industryId = 1;\n $scope.saveEnabled = true;\n }, function () {\n $scope.changeView(\"courses\");\n $scope.saveEnabled = true;\n });\n } else {\n Course.update({}, $scope.course, function () {\n for (var i = 0; i < $scope.courses.length; i++) {\n if ($scope.courses[i].id === $scope.course.id) {\n $scope.courses[i] = $scope.course;\n break;\n }\n }\n\n $scope.changeView(\"courses\");\n $scope.saveEnabled = true;\n }, function (data, status) {\n if (data.status === 409) {\n alert(\"Record changed by another user\");\n $scope.changeView(\"courseConflict\");\n } else {\n $scope.pushLog(\"Error Updating Course: \" + status, 0, $scope.course);\n }\n $scope.saveEnabled = true;\n });\n }\n };\n\n $scope.deleteCourse = function () {\n $scope.course.activeInd = \"0\";\n $scope.save();\n $scope.changeView(\"courses\");\n };\n}", "async function updateCourse(id){\n const course = await Course.findById(id);\n if(!course) return;\n course.set({\n author:'another author',\n ispublished:false\n });\n\n const result = await course.save();\n console.log(result);\n}", "function updateCourse (req, res, next) {\n // req.course attached via params route findCourse()\n req.course.update(req.body)\n .then(course => {\n middleWare.onSuccessPost(res, course, 204)\n })\n .catch(err => {\n const errMsg = 'in POST create course '\n middleWare.onError(res, errMsg, err, next)\n })\n}", "async function addCourse(req) {\n let course = req.body;\n\n // validate\n if (await Course.findOne({ courseNumber: course.courseNumber, courseDept: course.courseDept, CRN: course.CRN, season: course.season, year: course.year })) {\n throw 'Course \"' + course.courseDept + course.courseNumber +'\" already exists';\n }\n else if(!req.user.sub){\n throw 'Error with the user submitting request. User information missing. Malformed request.';\n }\n //populate missing fields in the course object\n course.createdBy = req.user.sub;\n course.createdDate = Date.now();\n\n course = new Course(course);\n\n // save course\n return await course.save();\n}", "function add() {\n\n\t\t\t\tcourses.addCourse({\n\t\t\t\t\tname: self.newCourse.name || 'Curso sin nombre',\n\t\t\t\t\tevals: self.newCourse.evals || 1\n\t\t\t\t});\n\n\t\t\t\tself.newCourse = {};\n\n\t\t\t}", "function saveToLocalStorage(course) {\n let products = getFromLocalStorage();\n\n //adding new courses to the array courses\n products.push(course);\n\n //set courses to the localStorage\n localStorage.setItem(\"courses\" , JSON.stringify(products));\n}", "async function updateCourse(id) \n{\n \n // Creating an async await class to get the course by the id \n const course = await COURSE\n .findById(id); \n \n console.log(id); \n\n // if the course is empty, return a \"null\" value \n if ( !course ) return; \n\n // Changing the values \n // course.isPublished = true; \n // course.author = 'Changed Author'; \n\n course.set({\n isPublished: true, \n name: \"Python Course\", \n author: 'Mbonu Chinedu', \n price: 100.23\n }); \n\n // Saving the new changed values \n const resultOfSavedModifedCourse = await course.save();\n console.log(resultOfSavedModifedCourse); \n\n}", "function readDataCourse(course) {\r\n const infocourse = {\r\n image: course.querySelector('img').src,\r\n title: course.querySelector('h4').textContent,\r\n price: course.querySelector('.discount').textContent,\r\n id: course.querySelector('a').getAttribute('data-id')\r\n }\r\n insertincart(infocourse);\r\n}", "function createCourse(ev) {\n\t\tev.preventDefault();\n\t\tlet imgInput = $(this).find('input[name=\"imageUrl\"]');\n\t\tlet priceInput = $(this).find('input[name=\"price\"]');\n\t\tlet durationInput = $(this).find('input[name=\"duration\"]');\n\t\tlet placeInput = $(this).find('input[name=\"place\"]');\n\t\tlet descInput = $(this).find('textarea[name=\"description\"]');\n\t\t// TODO: create select input for category. Load all categories from db.Set categoryId as option value or data-categoryId\n\t\t//$('#example').append('<option value=\"foo\" selected=\"selected\">Foo</option>');\n\t\tlet categoryInput = $(this).find('select[name=\"category\"]');\n\n\t\t// TODO: add validation\n\t\t// if (urlInput.val() === '' || titleInput.val() === '') {\n\t\t// \tshowError('Url/Title cannot be empty!');\n\t\t// \treturn;\n\t\t// }\n\n\t\t// if (!urlInput.val().startsWith('http')) {\n\t\t// \tshowError('Url should start with http!');\n\t\t// \treturn;\n\t\t// }\n\n\t\tlet userId = sessionStorage.getItem('userId');\n\n\t\tlet description = descInput.val();\n\t\tlet imageUrl = imgInput.val();\n\t\tlet price = priceInput.val();\n\t\tlet duration = durationInput.val();\n\t\tlet place = placeInput.val();\n\t\tlet categoryId = categoryInput.find(':selected').val();\n\n\t\tauthorService.loadAuthorByUserId(userId)\n\t\t\t.then((author) => {\n\t\t\t\tlet authorId = author._id;\n\t\t\t\tcoursesService.createPost(authorId, categoryId, description, imageUrl, price, duration, place)\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tplaceInput.val('');\n\t\t\t\t\t\tdurationInput.val('');\n\t\t\t\t\t\tpriceInput.val('');\n\t\t\t\t\t\timgInput.val('');\n\t\t\t\t\t\tdescInput.val('');\n\t\t\t\t\t\tshowInfo('Course created. Please wait for admin approval.');\n\t\t\t\t\t\tloadMyCourses();\n\n\t\t\t\t\t});\n\t\t\t}).catch(handleError);\n\t}", "function storeTrainerCourseData() {\n trainerCourseTypeRadio = document.querySelector('input[name=\"type_trainerC\"]:checked');\n if (validateTrainerperCourseForm()) {\n const TrainerCourse1 = new TrainerperCourse(trainerCourseFirstName.value, trainerCourseLastName.value, trainerCourseSubject.value, trainerCoursestartDate.value, trainerCourseendDate.value, trainerCourseTypeRadio.value);\n trainerPerCourseArray.push(TrainerCourse1);\n trainerCourseForm.submit();\n updateSavedColumns();\n } else {\n console.log('wrong input');\n }\n}", "function editingCourse(){\n\t \tvar id = $(\"#e_course_id\").text().trim();\n\t \tvar code = $(\"#e_course_code\").val().trim();\n\t \tvar title = $(\"#e_course_title\").val().trim();\n\t \tvar unit = $(\"#e_units\").val().trim();\n\t \tvar lec = $(\"#e_lecture\").val().trim();\n\t \tvar lab = $(\"#e_laboratory\").val().trim();\n\t \tvar req_standing = $(\"#e_req_standing\").val().trim();\n\t \tvar prereq_id = getAddedPrereqs();\t\n\n\t\t$.post( \"../Tab_Course/course_edit_save.php\", {\n\t\t\tid: id,\n\t\t\tcode: code,\n\t\t\ttitle: title,\n\t\t\tunit: unit,\n\t\t\tlec: lec,\n\t\t\tlab: lab,\n\t\t\treq_standing, req_standing,\n\t\t\tprereq_id, prereq_id\n\t\t}, function( data ) {\n \t\t\tif(data.alert==\"success\"){\n\t\t\t\t$('#cancel_edit').click();\n\t\t\t\tvar page = parseInt($(\".course_pagination .active a\").attr(\"id\"));\n\t\t\t\tsearchCourses(page=page);\n\t\t\t\tcourseInfo(id);\n\t\t\t\t$('.modal-backdrop').remove();\n \t\t\t}\n \t\t\t$('.is-invalid').removeClass('is-invalid');\n \t\t\tif (data.hasOwnProperty('error')) {\n \t\t\t\t$('.e_course_'+data.error).addClass('is-invalid');\n \t\t\t}\n \t\t\tswal(data.title, data.message, data.alert);\n\t\t}, \"json\");\n\t}", "addCourse(course){\n\t\t// add into correct array\n\t\tif(course.majorCode==this.major1){\n\t\t\tthis.major1Courses.push(course);\n\t\t}\n\t\telse if (course.majorCode==this.major2) {\n\t\t\tthis.major2Courses.push(course);\n\t\t}\n\t\telse{\n\t\t\tthis.outsideCourses.push(course);\n\t\t}\n\n\t\t// add to general array\n\t\tif(!this.allCourses.includes(course)){\n\t\t\tthis.allCourses.push(course);\n\t\t}\n\t\t// add major code\n\t\tif(!this.courseMajors.includes(course.majorCode)){\n\t\t\tthis.courseMajors.push(course.majorCode);\n\t\t}\n\t}", "async function createCourseWithValidation() {\n const course = new Course({\n name: 'Angular 8 course',\n category: ' WEB ',\n author: 'Mosh',\n stores: ['udemy'],\n tags: ['frontend'],\n isPublished: true,\n price: 15.8,\n });\n\n try {\n /** \n * validate returns void therefore it needs a callback in order to execute logic on validation result\n * course.validate(err => {\n if (err) {\n \n }\n });\n */ \n const result = await course.save();\n console.log('Save Model: ', result);\n } catch (error) {\n // display multiple errors\n for (field in error.errors) {\n console.log('Error: ', error.errors[field].message);\n }\n }\n}", "async function createCourse() {\n const course = new Course({\n name: 'node.js course',\n author: 'mosh',\n tags: ['node', 'backend'], // noSQL databases can contain complex data as there values unlike in SQL database we had to use three tables to store course,tags and courseTag \n isPublished: true\n })\n\n const result = await course.save(); // return the new document created as a promise\n console.log(result);\n}", "function addCourse() {\n // vars connecting back to the database\n let kode = addCoursekode.value;\n let name = addCoursename.value;\n let progress = addProgression.value;\n let plan = addCourseplan.value;\n\n let kurs = { 'kurskod': kode, 'kursnamn': name, 'progression': progress, 'kursplan': plan }\n// another link to the api\n fetch('https://studenter.miun.se/~tijo1901/writeable/w5/api.php', {\n // using metod post\n method: 'POST',\n // makes sure to turn them into a json format before sending them to the api\n body: JSON.stringify(kurs),\n })\n .then(response => response.json())\n .then(data => {\n getCourses();\n })\n // a catch checking for errors\n .catch(error => {\n console.log('error ', error);\n })\n}", "function save() {\n // console.log('Saving the unsatisfied.');\n\n var promise = CoursePlanService.update($scope.OmsCoursePlanVoForCreate);\n $scope.dataLoading = false;\n $scope.modal.hide();\n promise.then(function (OmsCoursePlanVoForCreate) {\n\n }, function (error) {\n //$scope.dataLoading = false;\n });\n\n }", "async function createCourse()\r\n\r\n{ //As await is there so, surrounded by a function\r\n\r\n\r\n//object to our class\r\nconst course = new Course({\r\n name:'Angular course',\r\n author:'Mosh',\r\n tags:['Angular','frontend'], //tags is an array \r\n isPublished:true\r\n\r\n}); \r\nconst result= await course.save(); //When await is there surround by async function\r\nconsole.log(result);\r\n}", "function saveCart() {\n localStorage.setItem('shoppingCart', JSON.stringify(cart));\n }", "addCourse(courseData) {\n let courseObject = new CourseObject(\n courseData,\n {\n x: this.x,\n y: this.courses.length*this.courseHeight + this.headerHeight,\n width: width,\n height: height,\n thickness: 12\n },\n this\n );\n courseObject.data.lp = this.lp;\n this.courses.push(courseObject);\n\n // Add all generated KCs to this timestamp.\n courseObject.data.Developed.forEach((value) => {\n let dockingPoint = courseObject.addOutGoingDockingPoint(value);\n\n // This function will only create A KC if no docking point exist already.\n this.timestamp.addKCSource(value,dockingPoint);\n });\n return courseObject;\n }", "static saveCart(cart){\n localStorage.setItem('cart',JSON.stringify(cart));\n }", "function saveCart(cart, req, res) {\n req.session.shoppingCart = cart;\n}", "function onCreateCourse() {\n dialogCreateCourse.showModal();\n }", "function wantTakeCourse(id, sid, cid) {\n this.id = id;\n this.sid = sid;\n this.cid = cid;\n}", "changeSchedulecourse(req, res) {\n const _id = req.params._id;\n const schedule = req.body.schedule;\n CourseModel.findOne({ _id: _id, isCheck: 0 })\n .then((data) => {\n data.schedule = schedule;\n data.save();\n res.status(200).json({\n status: 200,\n success: true,\n message: \"Successfully changed course time\",\n });\n })\n .catch((err) =>\n res.status(402).json({\n status: 402,\n success: true,\n message: \"No valid courses found\",\n })\n );\n }", "addMainCourse(mainCourse){\n this._mainCourses.push(mainCourse);\n }", "async function updateCourse(id) {\n //Approch name: Query First\n //findbyID\n //Modify its properties\n //save\n const course = await Course.findById(id);\n if (!course) return;\n course.set({\n isPublished: true,\n author: \"Another Author\"\n });\n const result = await course.save();\n console.log(result);\n}", "createComic(newComic){\n newComic.id = 'default';\n this.Comic.create(newComic)\n .then(comic=>{\n this.addComicLocalStore(newComic);\n Materialize.toast('Se ha creado el comic correctamente', 5000);\n $('#newComicModal').closeModal();\n })\n .catch((err) => {\n console.log(err);\n });\n }", "create(req, res, next) {\n console.log(\"Saving Cart\", req.body);\n var newCart = new Cart();\n var user = req.user;\n newCart.cartItems = req.body.cartItems;\n newCart.userid = user._id;\n newCart.date = Date.now();\n newCart.save(function(err, cart) {\n if (err) return validationError(res, err);\n var data = {\n creation: true,\n data: cart\n };\n perf.ProcessResponse(res).status(200).json(data);\n });\n }", "async function add(course) {\n const [id] = await db(\"classes\").insert(course);\n\n return db(\"classes as c\")\n .join(\"users as u\", \"c.instructor\", \"=\", \"u.id\")\n .join(\"types as t\", \"c.type_id\", \"=\", \"t.id\")\n .select(\n \"c.id as class_id\",\n \"c.class_name\",\n \"c.instructor\",\n \"u.username as instructor_username\",\n \"t.type\", \n \"c.class_date\",\n \"c.class_time\",\n \"c.duration\",\n \"c.intensity\",\n \"c.location\",\n \"c.number_of_attendees\",\n \"c.max_class_size\"\n )\n .where(\"c.id\", id)\n .first();\n}", "function saveSpec() {\n updateGeneralspe();\n if (!iserror && !iserrorOwnpanel && !iserrorGeneralSpec && !isSingleError) {\n document.forms['specForm'].action = '${pageContext.request.contextPath}/specification/Specification.action?saveandBack=';\n document.forms['specForm'].submit();\n }\n }", "function addProductToCart(){ \n cy.get(homePageControls.addToCartButton).click();\n}", "function saveCart() { \n localStorage.setItem(\"userCart\", JSON.stringify(cart));\n }", "function addCourse()\n{\n //let fieldValid = true;\n /* arrCourse = []; //clear\n $('#newCourse').find(\"td\").each(function() { //Find alla td for the specified newCourse\n arrCourse.push($(this).text())\n }); \n \n $(\"#myform input[type=text]\").each(function() {\n if(this.value === \"\") {\n fieldValid = false;\n }\n }); */\n\n if (isFormValid())\n {\n let course = { 'code': $('#code').val(), 'name': $('#name').val(), 'progression': $('#progression').val(), 'plan': $('#plan').val() };\n\n fetch(API, {\n method: 'POST',\n body: JSON.stringify(course),\n })\n .then(response => response.json())\n .then(data =>\n {\n getCourses();\n })\n .catch(error =>\n {\n console.log('Error:', error);\n //alert(\"An error occured when addCourse:\"+ error);\n })\n }\n else\n {\n alert(\"Du har tomma fält i din form\");\n }\n\n // These rows is because of forefox\n // If I don't have these rows an add is somwtimes lost\n for (let i = 1; i < 1000; i++)\n { }\n}", "function addCourse() {\n let name = nameInput.value;\n let code = codeInput.value;\n let progression = progressionInput.value;\n let syllabus = syllabusInput.value;\n\n let course = {'name' : name, 'code' : code, 'progression' : progression, 'syllabus' : syllabus};\n\n fetch(stdurl, {\n method: 'POST',\n body: JSON.stringify(course)\n }).then(response => response.json()).then(data => {\n getCourses();\n }).catch(error => {\n console.log('Error: ', error);\n })\n\n //Clear inputform\n nameInput.value = '';\n codeInput.value = '';\n progressionInput.value = '';\n syllabusInput.value = '';\n}", "async function addCourse(req, res) {\n const { id, code } = req.params;\n const student = await Student.findById(id);\n const course = await Course.findById(code);\n\n if (!student || !course) {\n return res.status(404).json('student or course not found')\n }\n\n student.courses.addToSet(course._id);\n course.studentId.addToSet(student._id);\n\n await student.save();\n await course.save();\n return res.json(student);\n}", "function saveObject(form) {\n /// know the object\n var which = form.dataset.which;\n // save values as vars\n let objectName = document.getElementById('' + which + 'Name');\n /// preparing form final validation\n //// checking what object to save in DB\n switch (which) {\n case 'student':\n /// gets all checkBox of courses selected to add them to Deals Table.\n var selectedCoursesArray = [];\n var myCheckBoxContChildren = $('#' + which + 'Courses').children();\n for (var i = 0; i < myCheckBoxContChildren.length; i++) {\n if (myCheckBoxContChildren[i].checked) {\n selectedCoursesArray.push(myCheckBoxContChildren[i].dataset.courseid)\n }\n }\n // phone and email validations happened onblur events\n var objectPhone = document.getElementById('' + which + 'Phone');\n var objectEmail = document.getElementById('' + which + 'Email');\n var formOk = (objectName.value.length > 0 && letSaveEmail && letSavePhone);\n break;\n case 'course':\n var objectDescription = document.getElementById('' + which + 'Description');\n ///Course name existence checked ontop on blur event.\n var formOk = (courseName.value.length > 0 && letSaveCName && objectDescription.value.length > 0);\n break;\n case 'administator':\n // phone and email validations happened onblur events\n var objectPhone = document.getElementById('' + which + 'Phone');\n var objectEmail = document.getElementById('' + which + 'Email');\n if (changePassword) {\n /// determine first if user clicked on change password button\n var objectPassword = document.getElementById('' + which + 'Password').value;\n ///add case\n if (objectPassword.length >= 4) {\n //letSavePass stays true\n $('#passErrMsg').hide();\n $('#passErrMsg').empty();\n /// edit case\n if (letSavePass === null) {\n ///null happens only in edit case: if no request to change its still a null.\n letSavePass = false;\n }\n ;\n } else {\n ///err.. password is too short\n $('#passErrMsg').html(\"password is too short-minimum length: 4 digits.\");\n $('#passErrMsg').show();\n }\n ;\n }\n ;\n var objectPassword = document.getElementById('' + which + 'Password');\n var objectRole = document.getElementById('beautifulSelect');\n if (letSavePass === null) {\n //edit case\n if (changePassword) {\n //need to add password.\n var formOk = (objectName.value.length > 0 && $('#' + which + 'Password').val().length >= 4 && letSaveEmail && letSavePhone && letAddRole);\n\n } else {\n //no need to add password.\n var formOk = (objectName.value.length > 0 && letSaveEmail && letSavePhone && letAddRole);\n }\n } else if (letSavePass === false || letSavePass === true) {\n // need to add password.\n var formOk = (objectName.value.length > 0 && $('#' + which + 'Password').val().length >= 4 && letSaveEmail && letSavePhone && letAddRole);\n }\n ;\n break;\n }\n ;\n let addingSucsMsg = document.getElementById('addingSucsMsg');\n let addingErrMsg = document.getElementById('addingErrMsg');\n addingSucsMsg.style.display = \"none\";\n //// make sure didn't upload any wrong type of image\n if ((letSaveImage) || letSaveImage === null) {\n ////\n ///// make sure name is set and email is in the right format.\n if (formOk) {\n addingErrMsg.innerHTML = \"\";\n addingErrMsg.style.display = \"none\";\n ////\n /// last modifying before calling controller.\n var formData = new FormData();\n formData.append('name', objectName.value);\n /// modifying depends on which object\n switch (which) {\n case 'student':\n formData.append('email', objectEmail.value);\n formData.append('phone', objectPhone.value.split('-').join(''));\n formData.append('selectedCourses', JSON.stringify(selectedCoursesArray));\n formData.append('addStudent', null);\n break;\n case 'course':\n formData.append('description', objectDescription.value);\n formData.append('addCourse', null);\n break;\n case 'administator':\n formData.append('email', objectEmail.value);\n formData.append('phone', objectPhone.value.split('-').join(''));\n if (!(letSavePass === null)) {\n ///user want to update password\n formData.append('password', objectPassword.value);\n } else {\n //no change needed\n formData.append('password', \"no\");\n }\n ;\n formData.append('role', objectRole.value);\n formData.append('addAdministator', null);\n break;\n }\n ;\n //// if chose to not use image - give him default image\n if (letSaveImage === null) {\n formData.append('image', 'useDefault');\n } else {\n //// user uploaded an image\n let fileSelect = document.getElementById('' + which + 'Image');\n let file = fileSelect.files[0];\n //// name is going to be student_id for future uses..\n let filename = '.jpg';\n formData.append('image', file, filename);\n }\n ;\n // use hidden\n var hidden = $('#hiddenInput')[0];\n var what = hidden.dataset.what;\n //check what we are doing right now.\n switch (what) {\n case 'add':\n //// calling XHR post Function. for adding new object\n XHRcall(formData, which);\n break;\n case 'edit':\n // gather data about the user and send it along with form\n let who = hidden.dataset.who;\n formData.append('objectID', who);\n formData.append('edit', null);\n setTimeout(() => {\n saveNUpdate(formData, which);\n }, 50);\n if (($('#existingImageOpinion')[0].checked)) {\n removeExistingImage(who, which);\n }\n ;\n break;\n }\n ;\n\n } else {\n ///// not everything is as requested.\n addingErrMsg.innerHTML = \"Some of the required fields are empty or not as requested.\";\n addingErrMsg.style.display = \"block\";\n /// wait 4 seconds, let this error gone away.\n setTimeout(function () {\n addingErrMsg.style.display = \"none\";\n }, 4000)\n }\n }\n ;\n}", "function readDataCourses(dataCourse){\n const data_course = {\n imagen: dataCourse.querySelector('img').src,\n titulo: dataCourse.querySelector('.card-body h5').textContent,\n profesor: dataCourse.querySelector('span.card-text').textContent,\n precio : dataCourse.querySelector('.new-price').textContent\n }\n insertCourse(data_course);\n}", "saveCourse(event) {\n\n event.preventDefault();\n\n if (!this.courseFormIsValid()) {\n return;\n }\n\n // This will cause the Save button to re-render as 'Saving...'\n // SEE CourseFrom.js\n this.setState({saving: true});\n\n // Only after the save AJAX call completes redirect to courses page.\n this.props.actions.saveCourse(this.state.course)\n .then(() => this.redirect())\n .catch(error => {\n toastr.error(error);\n this.setState({saving: false});\n });\n }", "function cookCoursesIfNeededToChooseSave(which) {\n switch (which) {\n case 'student':\n $.post('Controllers/adderAndAll/coursesController.php', {getAllChoose: null, which: which}, function (coursesToSign) {\n coursesToSign = JSON.parse(coursesToSign);\n //courses\n var texture = \"\";\n if (coursesToSign[0].length > 0) {\n ////start to organize it.\n coursesToSign[0].forEach(function (object, i) {\n texture += \"\" + object.name + \"&nbsp;<input class='i-b courseSelect' type='checkbox' data-courseId='\" + object.course_id + \"' value=''/>\";\n });\n }\n ;\n showAddCont({texture: texture, which: coursesToSign[1]});\n });\n break;\n case 'course':\n case 'administator':\n showAddCont({texture: \"\", which: which});\n break;\n }\n}", "function getCourse(courseId) {\n datacontext.getCourse(courseId)\n .then(function (data) {\n vm.course = data;\n });\n }", "function addCourseForm(courses) {\n //populate courses in formData\n var numCourses = $('.courses-group').length;\n var courseCodes = $('.courses-group input[name=\"code\"]');\n var courseRanks = $('.courses-group input[name=\"rank\"]');\n var courseExp = $('.courses-group input[name=\"experience\"]');\n for (let i = 0; i < numCourses; i++) {\n courses.push(\n {\n \"code\": courseCodes[i].value,\n \"rank\": courseRanks[i].value,\n \"experience\": courseExp[i].value\n });\n }\n}", "async addCourse(token, course) {\n let response = await axios.post(\n `${API_URL}/courses?access_token=${token}`,course\n );\n return response;\n }", "function addToCart(cInfo) {\n //creat <tr> tag\n const row = document.createElement(\"tr\");\n\n //Build HTML template\n row.innerHTML = `\n <tr>\n <td>\n <img src=\"${cInfo.image}\" width=\"100px\">\n </td>\n <td>${cInfo.title}</td>\n <td>${cInfo.price}</td>\n <td>\n <a href=\"#\" class=\"remove\" data-id=\"${cInfo.id}\">X</a>\n </td>\n </tr>\n `\n shoppingCartContent.appendChild(row);\n\n //adding courses to the localStorage\n saveToLocalStorage(cInfo);\n}", "handleSaveACart(event) {\n if (this.globals.loggedIn) {\n this.$refs.saveCartModal.open(event);\n } else {\n this.globals.setCookie('flow', 'cart');\n if (this.globals.siteConfig.isGuestList) {\n this.guestListName = this.i18n.guestList;\n } else {\n this.globals.navigateToUrl('login');\n globalEventBus.$emit(\n 'announce',\n 'For adding to list, you need to login',\n );\n setTimeout(() => {\n this.globals.navigateToUrl('login');\n }, 300);\n }\n }\n }", "function saveCart() {\n localStorage.setItem(\"shoppingCart\", JSON.stringify(cart));\n}", "saveClient3(params){\n var newClient = this.store.createRecord('client', params); //use params to create new question record in the store\n newClient.save(); //save new question\n\n // move to index page and see our new question in the list\n this.transitionTo('index');\n }", "function saveSubject(subjectForm) {\n console.log(subjectForm);\n console.log($rootScope.subject.id);\n subjectsService.editSubject(\n subjectForm,\n $rootScope.subject.id).then(\n function (data) {\n if (data == 200) {\n $scope.closeModal(true);\n $rootScope.onTableHandling();\n }\n });\n }" ]
[ "0.6486599", "0.64159745", "0.6343108", "0.63065195", "0.61627835", "0.6136635", "0.6093632", "0.6058487", "0.6056491", "0.6036487", "0.60346305", "0.5981917", "0.59663355", "0.59516203", "0.59490734", "0.5935352", "0.5933228", "0.59205437", "0.5914743", "0.58775425", "0.583109", "0.5817747", "0.5802709", "0.5795301", "0.579083", "0.57701594", "0.5766954", "0.5763376", "0.5743134", "0.5736674", "0.5723194", "0.5720662", "0.56995547", "0.5677935", "0.56737643", "0.566897", "0.56400347", "0.5615059", "0.56003857", "0.5593469", "0.5591227", "0.5589345", "0.5588647", "0.5582", "0.5578534", "0.5560027", "0.55564725", "0.5499397", "0.5497553", "0.5490676", "0.5489979", "0.5487349", "0.54843974", "0.54756707", "0.546061", "0.54573274", "0.54363674", "0.54085976", "0.5406381", "0.53891265", "0.53866565", "0.53614354", "0.533328", "0.5323425", "0.5318112", "0.5317612", "0.53130555", "0.53125197", "0.5310469", "0.53093666", "0.5294397", "0.5288572", "0.52732253", "0.52655", "0.5262019", "0.52570087", "0.52560306", "0.5248579", "0.5245731", "0.52449185", "0.52429706", "0.5232667", "0.5232662", "0.52280194", "0.52221817", "0.5210027", "0.5202068", "0.519145", "0.5190436", "0.51854175", "0.51770896", "0.5174755", "0.5166418", "0.5161208", "0.51400614", "0.5125342", "0.5121921", "0.51163083", "0.511506", "0.5106146", "0.5086462" ]
0.0
-1
================================ Promise Examples ================================================== Usage example of Async / Await in the project In this example data was fetched from DB step 1: create the async function analogous to a driverFunc() as follows:
async function asyncAddCourseSubController(userInput, req, res, next) { const query = await checkCourseExistDuringSemester(userInput, req, res, next); // console.log(query); // console.log(typeof query); // let queryObj = JSON.parse(query); console.log(query); let queryObj = query; // return.length -- works for findall() because return is an array console.log(queryObj.length); // return[object.termCode] -- works for findOne() because return is a JSON object console.log(queryObj.object.termCode); console.log(queryObj["object"]["termCode"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function printDataAsyncAwait() {\n let p = promiseFunction();\n const beta = await p;\n console.log(beta);\n}", "async function testAsync(conn) {\n let stmt = conn.prepareSync(\"select * from hits\");\n let result = stmt.executeSync();\n console.log(\"\\n\\n---------------------------------------\");\n console.log(\"Retrieve column data using async-await:\");\n console.log(\"---------------------------------------\");\n await result.fetch({fetchMode:0});\n process.stdout.write(\"First Row Data = \");\n let data = await result.getData(1, 4);\n process.stdout.write(data);\n data = await result.getData(1, 5);\n process.stdout.write(data);\n process.stdout.write(\", \" + await result.getData(2, 5));\n console.log(\", \", await result.getData(3, 5));\n await result.fetch({fetchMode:ibmdb.FETCH_NODATA});\n process.stdout.write(\"Second Row Data = \");\n process.stdout.write(await result.getData(1, 4));\n process.stdout.write(result.getDataSync(1, 5));\n process.stdout.write(\", \" + await result.getData(2, 5));\n console.log(\", \", result.getDataSync(3, 5));\n await result.close();\n console.log(\"------ return from testAsync --------\\n\");\n}", "async function printDataAsyncAwait() {\n const data = await promiseFunction();\n console.log(data);\n}", "async function fetchAsync(func) { // eslint-disable-line no-unused-vars\r\n const response = await func();\r\n return response;\r\n}", "async function awaitFetchData() {\n let returnedData = await fetchData();\n console.log(returnedData);\n}", "async function fetchAsyncSave(func, data) { // eslint-disable-line no-unused-vars\r\n const response = await func(data);\r\n return response;\r\n}", "async function getData() {\n let data = await getUsername1()\n data = await getAge1(data)\n data = await getDepartment1(data)\n data = await printDetails1(data)\n}", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "async function hitThatDB(query){\n const session = driver.session();\n var returnObject;\n return new Promise(resolve => {\n session.run(query)\n .then(result => {\n returnObject = result.records[0]._fields[0].properties;\n console.log(returnObject);\n })\n .catch(e => {\n console.log(e + \" WE MESSED UP!!!!\")\n })\n .then(() => {\n session.close();\n resolve(returnObject);\n })\n })\n}", "async function fetchUser() {\n return \"abc\";\n}", "async function getRecipeAW() { // the function always return a Promises\n //the await will stop executing the code at this point until the Promises is full filled\n // the await can be used in only async function\n const id = await getID;\n console.log(id)\n console.log('here 2');\n const recipe = await getRecipe(id[1]);\n console.log(recipe);\n const related = await getRelated('Publisher');\n console.log(related);\n\n return recipe;\n}", "async function myFunc() {\n // Function body here\n }", "async function getDetailsAsync(){\n const details = await getDetails(\"Here is your details from ASYNC AWAIT\");\n\n console.log(details);\n}", "async function getData() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('done'), 3000);\n });\n\n //Add await\n let result = await promise;\n console.log(result);\n}", "async function AppelApi(parfunc=api_tan.GenericAsync(api_tan.getTanStations(47.2133057,-1.5604042)),\nretour=function(par){console.log(\"demo :\" + JSON.stringify(par))}) {\n let demo = await parfunc \n retour(demo);\n // console.log(\"demo : \" + JSON.stringify(demo));\n}", "async function asyncFn(){\n\n return 1;\n}", "async function getDataFromDatabase() {\n const response = await fetch('/api');\n const data = await response.json();\n return new Promise((resolve, reject) => {\n if (data) {\n resolve(data);\n } else {\n reject(\"Er is iets misgegaan bij het ophalen van favorieten\");\n }\n })\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "async function myFunc() {\n return 'Hello';\n}", "async function TestAsync() {\n try {\n var parm = [];\n parm[0] = \"2017\"\n parm[1] = \"R\"\n parm[2] = \"02\"\n parm[3] = \"02M011\"\n parm[4] = \"1\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n const result = await DBase.DB.execSP(\"SPS_COM_TTOMODI\", parm);\n\n parm = [];\n parm[0] = \"000\"\n parm[1] = \"1111\"\n parm[2] = \"test\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n result = await DBase.DB.execSP(\"spi_teobj\", parm);\n /*\n spi_teobj 'null','1111','1234' \n if (result instanceof Error) {\n console.log(\"Error\")\n }\n */\n console.log(result)\n\n parm = [];\n parm[0] = \"TRTRQ\"\n result = await DBase.DB.execSP(\"sps_GetTTLOL\", parm);\n console.log(result)\n let resultObj = JSON.parse(result);\n //console.log(resultObj.data)\n console.log(resultObj.data[0][0].gs_ttl_i)\n\n result = await DBase.DB.execSQl(\"select top 1 gs_ttl_i from ttlol where gs_ttl_i = 'TRTRQ'\")\n resultObj = JSON.parse(result);\n console.log(\"After Title Call\")\n let gs_ttl_i = resultObj.data[0][0].gs_ttl_i;\n\n result = await DBase.DB.execSQl(\"select top 1 gs_oru_i from toru where gs_oru_i = '01M019'\")\n resultObj = JSON.parse(result);\n console.log(\"After School Call\")\n let gs_oru_i = resultObj.data[0][0].gs_oru_i;\n\n console.log(gs_oru_i)\n\n result = await DBase.DB.execSQl(\" Select top 10 gs_pr_name from ttodetail where gs_oru_i = '\" + gs_oru_i + \"' and gs_ttl_i = '\" + gs_ttl_i + \"'\")\n console.log(result)\n return \"After Test\";\n } catch (err) {\n console.log(\"error in TestAsync\")\n console.log(err)\n return err;\n //response.send(err); \n }\n}", "async function getData (url){ //aca getData nos esta devolviendo una promesa porque hace await \n const response = await fetch(url);\n const data = await response.json()\n return data;\n}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "async function getRecipesAW(){\n\t\t//waits till the promise is fulfilled and then stores the resolved value in the variable ie. Ids ,recipe ,related here\n\t\tconst Ids = await getIds; \n\t\tconsole.log(Ids);\n\t\tconst recipe=await getRecipe(Ids[2]);\n\t\tconsole.log(recipe);\n\t\tconst related = await getRelated('Jonas');\n\t\tconsole.log(related);\n\t\t\n\t\treturn recipe; //async function also returns a promise always!\n\t}", "async function myFunc() {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Hello'), 1000);\n });\n\n const res = await promise; // Wait until the promise is resolved\n\n return res;\n}", "async function miFuncionConPromesa ()\r\n{\r\n return 'saludos con promesa y async';\r\n}", "async function networkTest() {\n const rows = await database.execute(\"SELECT * FROM SensorData ORDER BY id ASC LIMIT 0, 10\");\n \n // return result list\n return rows[0];\n}", "async function WrapperForAsyncFunc() {\n const result = await AsyncFunction();\n console.log(result);\n}", "async function populateUserData(){\n return connect().then(function(connection){\n var users = [\n // id, first_name, last_name\n [5,'Mick','Baskers'],\n [10,'Dave','Bob'],\n [20,'Tom','Banana']\n ];\n let sql = `insert into user (id, first_name, last_name) values ?`;\n let result = connection.query(sql,[users]);\n connection.end();\n return result;\n }).then(function(result){\n return result;\n }).catch(function(error){\n console.log(error);\n throw error;\n })\n}", "async function main() {\n\n getUser(\"test1\");\n\n}", "async function test() {}", "async function helloWorld(){\n console.log(\"Were going to say something, but you have to wait 1.5 seconds\")\n await wait(1500);\n return(\n console.log(\"Hello world!\"),\n console.log(\"Congrats on waiting for the promise to fulfill, that took 1.5 seconds\")\n );\n }", "async function simpleReturn() {\n return 1;\n}", "async function miFuncionConPromesa(){\n return \"Saludos con promeso y async\";\n}", "async function wrapperForAsyncFunc() {\n const result1 = await AsyncFunction1();\n console.log(result1);\n const result2 = await AsyncFunction2();\n console.log(result2);\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "async function executeMpromise(){\n \n try{\n const val=await myPromiseFunc(10);\n console.log(val);\n }\n catch(error){\n console.log(\"Error\",err);\n }\n}", "async function asyncCall() {\n try {\n const result = await getListActivity();\n console.log(result);\n return result;\n // the next line will fail\n //const result2 = await apiFunctionWrapper(\"bad query\");\n //console.log(result2);\n } catch(error) {\n console.error(\"ERROR:\" + error);\n }\n }", "async function getValueWithAsync() {\n console.log('calling function');\n const value = await getPromise(5);\n console.log(`async result: ${value}`);\n}", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "async function myPromise (){\n return \"This is my promise\"\n}", "async function miAsyncFunction()\n{\n try \n { //Esto de acá sería como el then de la async function miAsyncFunction() \n const promesa = await miPromesa; //espera el resultado de la promesa satisfecha (resolved)\n console.log(`Este es el valor de la promesa ${promesa}`);\n } //Esto de acá sería como el catch de la async function miAsyncFunction() \n catch (error) {\n console.log(\"La pecheaste\"); \n }\n}", "async function MyAsyncFn () {}", "async function myFn() {\n await console.log('testing');\n}", "async function fetchData()\r\n{\r\n let url='https://opentdb.com/api.php?amount=10&type=multiple';\r\n try \r\n {\r\n let res = await fetch(url);\r\n return await res.json();\r\n } \r\n catch (error) \r\n {\r\n console.log(error);\r\n }\r\n}", "async function callDB(client, queryMessage) {\n\n var queryResult;\n await client.query(queryMessage)\n .then(\n (results) => {\n queryResult = results[0];\n //console.log(results[0]);\n return queryResult;\n })\n .then(\n (results) => {\n res = JSON.parse(JSON.stringify(results));\n return results\n })\n .catch(console.log)\n}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "function viewDepartments() { //async?\n console.log('~~~~~~~~~~ Company Departments ~~~~~~~~~~')\n const query = 'SELECT * FROM departments'\n // let [data, fields] = await db.query(query)\n // // console.table(results);\n // console.table(data);\n // console.log(db)\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error egtting the rows')\n .then(() => {\n menu()\n })\n}", "async function main(){\n try{\n\n\tlet ourDB = await dbManager.get(); //after this line we are connected. Notice that the async connect function can be awaited\n\t//if we put the call in another async function\n }catch(err){\n console.log(err.message)\n }\n \n}", "async function random_code(){\r\n\r\nconst response= fetch('https://jsonplaceholder.typicode.com/todos'\r\n);\r\n\r\nconst data= await (await response).json();\r\nconsole.log(data);\r\n// .then(response => response.json())\r\n// .then(data =>console.log(data))\r\n\r\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function func() {\n return 1;\n}", "async function getPromiseAsync() {\n try {\n const data = await createPromise(5);\n // console.log('Testing async function ${data}'); the wrong quotes selected for string literals,back-tick required\n console.log(`Testing async function ${data}`);\n } catch (error) {\n console.log(\"Error\", error);\n }\n}", "async function getEmployee() {\n const Ids = await getEmployeeIds;\n console.log(Ids);\n const employee = await Employee(Ids[2]);\n console.log(employee);\n return employee;\n}", "async function getProductos() {\r\n //se realiza una consulta de todos los productos de la tabla\r\n try {\r\n let rows = await query(\"SELECT * from productos\");\r\n //rows : array de objetos\r\n return rows;\r\n } catch (error) {\r\n //bloque en caso de que exista un error\r\n console.log(error);\r\n }\r\n}", "async function StoredDataGetter(){\n\n return await updated_data;\n\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}", "async function f(){\n return something\n}", "async function selectAllData() {\n let sql = 'SELECT sn,label FROM enterprise_info';\n console.log(sql);\n let dataList = await query(sql);\n return dataList;\n}", "async function myRequest(){\n const result = await firstFunc()\n console.log(\"testing\")\n const fullResult = await secondFunc(result)\n console.log(fullResult)\n}", "async function asyncAwait() {\n try {\n let result = await cekHariKerja(\"sabtu\");\n console.log(`${result} adalah hari kerja`);\n } catch (error) {\n console.log(error.message);\n }\n}", "async function request_table_data(url)\n{\n const response = await fetch(url);\n const data = await response.json()\n return data; \n}", "async function main() {\n const userInfo = await getUserInfo('12');\n console.log(userInfo);\n\n const userAddress = await getUserAddress('12');\n console.log(userAddress);\n\n console.log('ceva4');\n}", "async function makeCallSql(sqlSt){\n // let attachSql = \"ATTACH DATABASE '\" + cwd1 + dbFile1 + \"' \" + 'AS' + ' ' + dbName1;\n return async function(currentDB){\n console.log(\"makeCallSql:closure:currentDB=\"+currentDB);\n await callSql(currentDB, sqlSt);\n return Promise.resolve(currentDB);\n }\n}", "async function funcionConPromesaYAwait(){\n let miPromesa = new Promise((resolved) => {\n resolved(\"Promesa con await\"); \n });\n\n //Ya no es necesario utilizar .then() sino que con await va a recibir el valor\n // y se va a mostrar en consola \n console.log( await miPromesa );\n}", "async function selectfromtable() {\n const client = new Client ({\n host: \"localhost\",\n user: \"postgres\",\n port: \"5432\",\n password: \"arielle\",\n database: \"postgres\"\n });\n await client.connect();\n try {\n const res = await client.query(`Select * from buns`);\n const myrows = res.rows;\n \n await client.end();\n return myrows\n } catch(err) {\n console.log(err.message);\n }\n}", "async function getRecipesAW() {\n const IDs = await getIDs; //receives the resolve value of the promise\n console.log(IDs);\n \n const recipe = await getRecipe(IDs[2]);\n console.log(recipe);\n \n const related = await getRelated('Jonas');\n console.log(related);\n \n return recipe;\n}", "async function getExample() {\n let output = await getCompanies();\n return output;\n // let a = getCompanyName();\n // let b = a.then(function(resultA) {\n // // some processing\n // return getCompanies();\n // });\n // let c = b.then(function(resultB) {\n // // some processing\n // return getStreetAddress();\n // });\n\n // let d = c.then(function(resultC) {\n // // some processing\n // return getCityState();\n // });\n // return Promise.all([a, b,c,d ]).then(function([resultA, resultB, resultC, resultD]) {\n // // more processing\n // console.log(' resultB=', resultB);\n // console.log(' resultA=', resultA);\n // console.log(' resultC=', resultC);\n // console.log(' resultD=', resultD);\n\n\n // let output = _.merge(resultA, resultB, resultC, resultD);\n\n // console.log('110- output =', output );\n \n // return output; \n \n // });\n}", "async function main() {\n // await in front of whatever is resolved from a fct and then returned into a const for instance\n const name = await myPromise;\n name;\n}", "async function funcionAsincronaDeclarada (){\r\n try {\r\n console.log(`Inicio de Async function`)\r\n let obj = await cuadradoPromise(0);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n \r\n obj = await cuadradoPromise(1);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(2);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(3);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(4);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n}", "async function populateUserProfileData(){\n return connect().then(function(connection){\n var userProfiles = [\n // id, name, data, user_id\n [111,'sports','hockey',5],\n [222,'job','developer',5],\n [333,'kids','2',5],\n [444,'job','captain',10],\n [555,'transport','plane',10]\n ];\n let sql = `insert into user_profile (id, name, data, user_id) values ?`;\n let result = connection.query(sql,[userProfiles]);\n connection.end();\n return result;\n }).then(function(result){\n return result;\n }).catch(function(error){\n console.log(error);\n throw error;\n })\n}", "async function wrapperForAsyncFunc(){\n const [result1, result2] = await Promise.all([\n AsyncFunction1(),\n AsyncFunction2()\n ]);\n console.log(result1, result2)\n}", "async function main() {\n try {\n var id_data = await get_changed_ids_prices();\n console.log(id_data);\n //use the chained async functions to get the data to update\n //wait for it to complete\n await update_prices(id_data);\n //update the database, wait for it to complete\n db.close();\n }\n catch (e) {\n console.log(\"error\");\n console.log(e);\n }\n}", "function getData(callback){//make this a promise?\n db.collection(\"haikus\", function(err, collection){\n collection.find().toArray(function(err, items){\n if(err){\n console.log(err);\n }\n callback(items);\n });\n });\n }", "async function outPutEmployeeQuery() {\n console.log('function called')\n try {\n console.log('function called 1')\n const id = await getIds; // <--- will stop code execution until `resolved` \n console.log('function called 2')\n const name = await getEmployeeName(id);\n console.log('function called 3')\n const final = await finishingTouch(name);\n console.log(final);\n } catch (error) {\n console.log(`exception :: ${error}`);\n }\n}", "async function getTodos(){\n // const [result, ] = await pool.query(\"SELECT * FROM todos\"); // return Promise [results, fields] \n return await Todo.findAll({\n attributes:attributes\n });\n}", "function getDataAndDoSomethingAsync() {\n getDataAsync()\n .then((data) => {\n doSomethingHere(data);\n })\n .catch((error) => {\n throw error;\n });\n}", "async function accountEmployee(){\n\tconsole.log(\"First function\");\n\tlet res = await fetch('http://localhost:8080/ExpenseReimbursementSystem/api/employeeAccount');\n\tlet data = await res.json();\n\t//let data1 = JSON.stringify(data);\n\tconsole.log(data);\n\tconsole.log(\"First function\");\n\tpopulateAccount(data);\n}", "async function getDataAsync() {\n try {\n let data = getSomeData();\n return data;\n } catch (e) {\n throw e;\n }\n}", "function getDrivers () {\nreturn new Promise((resolve, reject)=> {\ndb = getDb()\ndb.collection(\"drivers\").find({}).toArray(function(err, drivers) {\n if (err) { \n reject (err)\n }\nconsole.log(\"Found the following drivers\");\nconsole.log(drivers)\n\nresolve(drivers);\n});\n})\n}", "function wrapInPromiseAsync(asyncFunc){\r\n var promise = new Promise(async((resolve, reject) => {\r\n resolve(await(asyncFunc()));\r\n }));\r\n return promise;\r\n}", "async function omdb(x){\n return fetch(`http://omdbapi.com/?apikey=b643c3d7&t=${x}`).then(\n async response => response.json().then(async function (json){\n return json\n })\n )\n}", "async function foo() {\n return 1\n}", "async function getData() {\n var data = await connectToDeviantArt();\n return data;\n }", "async function getData() {\n var data = await connectToDeviantArt();\n return data;\n }", "async function main() {\n\n const articleId = getArticleId();\n console.log(articleId);\n\tconst teddy = await getArticleContent(articleId);\n console.log(teddy);\n displayArticle(teddy);\n testOptions(teddy);\n}", "function callsASyncFunction() {\n var deferred = Q.defer();\n db.ConnectAndQuery(\"select * from UserGroup\", function () {\n console.log('Finished with non deffered async.');\n });\n return deferred.promise;\n}", "function getHrmsData(sunConn,hrmsConn,trans,userID){\ntry{\n \n let requestString='SELECT *'\n if(forceTransFlag==false){\n let d=new Date()\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${ d.getMonth()} AND User_ID=${1};`\n }\n else{\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${forcedMonth} AND User_ID=${1};`\n }\n //console.log(requestString)\n return new Promise((resolve,reject)=>{\n request = new Request(requestString,async (err,rowCount,rows)=> { \n if (err) { \n reject(err.message)\n console.log(err);\n }\n else{\n console.log(rowCount+' rows selected')\n const headerID=await insertIntoSunHeaders(sunConn)\n if(forceTransFlag==false){\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,d.getMonth())\n }\n else{\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,forcedMonth)\n }\n }\n }); \n request.on('requestCompleted', function() { \n resolve(1)\n }); \n hrmsConn.execSql(request); \n })\n}\ncatch(err){\n console.log(err.message)\n}\n}", "async function fetchUser() {\r\n // do network request in 10 secs....\r\n return 'ellie';\r\n}", "async function fetchUsers() {\n //The code below returns a promise \nconst res = await fetch ('http://jsonplaceholder.typicode.com/users')\n\nconst data = await res.json()\n//Transforming the res. to json format \nconsole.log(data)\n\n}", "async function getContactos(){\n try {\n const resultset = await db.query('SELECT * FROM contactos');\n console.log(resultset)\n return resultset;\n } catch (error) {\n console.log(error);\n }\n}", "async function myFn() {\n // wait\n}", "async function getUsers(){\n let users = await db.getUsers();\n return users;\n}", "async function hitThatDbForRelations(query){\n const session = driver.session();\n var returnObject = {\"relations\":[]};\n return new Promise(resolve => {\n session.run(query)\n .then(result => {\n for(var i = 0; i < result.records.length; i++){\n var key;\n var val;\n if(result.records[i]._fields[1].type === \"HAS_A_TYPE_OF\"){\n key = result.records[i]._fields[1].type + \"_\" + i;\n }\n else{\n key = result.records[i]._fields[1].type;\n }\n\n if(result.records[i]._fields[2].properties.name) {\n val = result.records[i]._fields[2].properties.name;\n };\n if(result.records[i]._fields[2].properties.gen) {\n val = result.records[i]._fields[2].properties.gen;\n };\n if(result.records[i]._fields[2].properties.legendary){\n if(result.records[i]._fields[2].properties.legendary == 0){\n val = \"Not Legendary\";\n }\n else {\n val = \"Legendary\"; \n }\n };\n returnObject.relations.push({[key]:val});\n };\n })\n .catch(e => {\n console.log(e + \" WE MESSED UP!!!!\")\n })\n .then(() => {\n session.close();\n console.log(returnObject);\n resolve(returnObject);\n })\n })\n}", "async function asyncFn() {\n return value;\n }", "async function asyncFn() {\n return value;\n }", "async function getObj(parking_lot_id) {\n\n var parkingLog_name;\n var parkingInfo_name;\n if(parking_lot_id) {\n parkingLog_name = 'parkingLog_' + parking_lot_id;\n parkingInfo_name = 'parkingInfo_' + parking_lot_id;\n }\n else {\n parkingLog_name = 'parkingLog';\n parkingInfo_name = 'parkingInfo';\n }\n\n await createTable(parkingLog_name, parkingInfo_name);\n\n const query = 'select * from ' + parkingInfo_name;\n const param = [];\n\n const resObj = await client.execute(query, param, { prepare: true });\n if(enableLog == 2)console.log(resObj);\n\n return resObj;\n\n}", "async function getPostFun(post_id){\n const sql = `SELECT * FROM posts WHERE post_id=${post_id};`;\n const promisePool = pool.promise();\n let rows = await promisePool.query(sql);\n console.log('post is :', rows[0][0])\n return rows[0][0];\n}", "do(func) {\n return async && data instanceof Promise\n ? using(data.then(func), async)\n : using(func(data), async)\n }" ]
[ "0.6733115", "0.667679", "0.6646334", "0.65305686", "0.64699066", "0.6430638", "0.6423003", "0.6406689", "0.64020073", "0.6366596", "0.6353627", "0.63467866", "0.63157725", "0.62763137", "0.62402797", "0.62385356", "0.6223069", "0.62206525", "0.62122625", "0.62117916", "0.6183835", "0.6173334", "0.61675173", "0.6142668", "0.6139981", "0.613556", "0.613071", "0.61240727", "0.6123041", "0.6085281", "0.60817295", "0.60658336", "0.6061205", "0.6048933", "0.6046157", "0.60272324", "0.60161144", "0.60080516", "0.60066277", "0.60014826", "0.60014826", "0.5999138", "0.5994905", "0.59729534", "0.5971917", "0.5962506", "0.5961878", "0.5953614", "0.5943525", "0.5936239", "0.59325683", "0.5915222", "0.5914011", "0.5912915", "0.58926386", "0.58925694", "0.5868561", "0.5868286", "0.58647966", "0.58644277", "0.584875", "0.5839388", "0.5838253", "0.5824185", "0.58086157", "0.5807826", "0.57893175", "0.5776587", "0.57733834", "0.5769347", "0.5767888", "0.575406", "0.57533604", "0.5747536", "0.5743281", "0.57402223", "0.57348686", "0.5733237", "0.57221425", "0.57188404", "0.5717356", "0.5715886", "0.5708412", "0.57080257", "0.5706504", "0.57056993", "0.57056993", "0.5704847", "0.57023776", "0.5691745", "0.56916773", "0.56914485", "0.56899893", "0.56853783", "0.5684042", "0.56699353", "0.5665695", "0.5665695", "0.56594306", "0.565735", "0.5656809" ]
0.0
-1
step2: create the functions that need to be called synchronously/sequentially in the above function
function checkCourseExistDuringSemester(userInput, req, res, next) { return new Promise((resolve,reject) => { // ============= How to do query =================================== // ======== Check if the course Exists ======================= // const query = scheduleModel.find(); const query = scheduleModel.findOne(); query.setOptions({lean: true}); query.collection(scheduleModel.collection); // example to do the query in one line // query.where('object.courseSubject').equals(userInput.courseSubject).exec(function (err, scheduleModel) { // building a query with multiple where statements query.where('object.courseSubject').equals(userInput.courseSubject); query.where('object.courseCatalog').equals(userInput.courseCatalog); // query.where('object.termTitle').equals(userInput.termTitle); query.where('object.termDescription').equals(userInput.termDescription); query.exec((err, result) => { // console.log("From the sub function: " + query); resolve(result); reject(err); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFunctions()\n{\n let _count = 100;\n const _getFn = () =>\n {\n const _n = _count++;\n return (cb) => setTimeout(\n () => cb(null, _n),\n Math.random() * 50\n );\n };\n jfSync(\n [\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn()\n ],\n (error, data) => checkData([100, 101, 102, 103, 104])\n );\n}", "async function first()\n{\n for (let i = 0; i< nbdepages+1 ; i++)\n {\n await sandbox2(i);\n }\n}", "inOrder(callback){\n \n}", "run_build_all(type, option1){\n message('Reconstruction de tout…', {keep:false})\n this.run_build_sequencier(true)\n .then(this.run_build_cover.bind(this, null, true))\n .then(this.run_build_quatrieme.bind(this, null, true))\n .then(this.run_build_statistiques.bind(this, null, true))\n .then(this.run_build_traitement.bind(this, null, true))\n .then(this.run_build_sequencier.bind(this, null, true))\n .then(this.run_build_synopsis.bind(this, null, true))\n .then(this.run_build_pfa.bind(this, true))\n .then(this.run_build_books.bind(this, type, option1, true))\n}", "function createRecipes(cb) {\n async.parallel(\n [\n function (callback) {\n recipeCreate(\n \"Dynamite Rolls\",\n \"Shrimp Tempura, Roe, Cucumber\",\n \"Delicious Dynamite Rolls\",\n 20.0,\n users[0],\n \"4\",\n \"Plates, knives\",\n \"https://gokuchefsmenu.s3.us-east-2.amazonaws.com/6e2b6f7627198ff966790ecae3644cb4c5ff69c9.png\",\n callback\n );\n },\n function (callback) {\n recipeCreate(\n \"4 Salmon Rolls\",\n \"Salmon, Seaweed, Rice\",\n \"Fresh Salmon\",\n 20.0,\n users[0],\n \"3\",\n \"Plates, knives\",\n \"https://gokuchefsmenu.s3.us-east-2.amazonaws.com/7924652b235b36f5f5dcef31621daa62480ce67d.png\",\n callback\n );\n },\n function (callback) {\n recipeCreate(\n \"Sashimi\",\n \"Raw Tuna\",\n \"Raw Fish\",\n 20.0,\n users[0],\n \"2\",\n \"Plates, knives\",\n \"https://gokuchefsmenu.s3.us-east-2.amazonaws.com/8e9be840c3490c329fd7790e8eb889b93dfa45a9.png\",\n callback\n );\n },\n function (callback) {\n recipeCreate(\n \"Shrimp Tempura\",\n \"Shrimp in Tempura Batter\",\n \"Salty\",\n 20.0,\n users[0],\n \"1\",\n \"Plates, knives\",\n \"https://gokuchefsmenu.s3.us-east-2.amazonaws.com/5644952c731e9c37e11b2d22f1aac39f8623025b.png\",\n callback\n );\n },\n ],\n cb\n );\n}", "function doTogether(firstCallback, secondCallback){\n firstCallback(); //execute the first function\n secondCallback(); //execute the second function\n console.log('at the same time!');\n}", "function async(multipliers, useResult)\r\n{\r\n setTimeout(step1, 500);\r\n\r\n\r\n function step1()\r\n {\r\n console.log('Step 1');\r\n var x = Math.random();\r\n setTimeout(step2.bind(null, 0, x), 500);\r\n }\r\n\r\n\r\n function step2(index, x)\r\n {\r\n if(index === multipliers.length)\r\n return useResult(x);\r\n\r\n console.log('Step 2, call #' + (index+1));\r\n x *= multipliers[index];\r\n setTimeout(step2.bind(null, index+1, x), 500);\r\n }\r\n}", "function Start_Messaging_App() {\r\n ////sequence\r\n log_info('(I) Start_Messaging_App() : <Start> ');\r\n accounts_connect_all_p()\r\n .then(res0=>{\r\n /*\r\n log_warn('---------->schedule_messages_p');\r\n schedule_messages_periodic_p().then(res1=>{});\r\n log_warn('---------->send_bulk_messages_p');\r\n send_bulk_messages_p().then(res2=>{});\r\n log_warn('---------->accounts_auto_responder_periodic_p');\r\n accounts_auto_responder_periodic_p().then(res3=>{});\r\n */\r\n\r\n setInterval(schedule_messages_periodic_p , GSchedulerTimeMSec);\r\n setInterval(send_bulk_messages_p , GBulkMsgTimeMSec);\r\n setInterval(accounts_auto_responder_periodic_p, GAutoRespTimeMSec);\r\n \r\n \r\n /*\r\n Promise.all(\r\n [ schedule_messages_periodic_p()\r\n ,send_bulk_messages_p()\r\n\t ,accounts_auto_responder_periodic_p()\r\n ]\r\n ).then(([result1, result2, result3]) => {\r\n \r\n })\r\n .catch(err => {\r\n // Receives first rejection among the Promises\r\n log_error('err ='+err);\r\n });*/\r\n })\r\n \r\n /*\r\n async1.waterfall([\r\n accounts_connect_all_p,\r\n //send_bulk_messages,\r\n\t\taccounts_auto_responder,\r\n\t\tschedule_messages_p, \r\n ], function(err, result) {\r\n // result now equals 'done'\r\n if(err) {\r\n log_error('Start_Messaging_App Err:'+err);\r\n }else{\r\n log_info('(I) Start_Messaging_App() : <End>');\r\n }\r\n\r\n });\r\n */\r\n}", "function triggerActions2 (count) {\n var result = [];\n var printOrder = 1;\n for (let i=1; i<=count; i++) {\n let pr = processActions2(i);\n pr.then( (val) => {\n result[i] = val;\n if (i === printOrder) {\n console.log(\"second method: \" + val);\n while(result[++printOrder]) {\n console.log(\"second method: \" + result[printOrder]);\n }\n }\n });\n }\n}", "function myRun(async){\n var gen = async();\n\n var isDone=false;\n\n var middle = [];\n\n while(!isDone){\n\n middle.push(gen);\n\n var res = gen.next();\n\n gen = res.value;\n\n isDone = res.done;\n\n }\n\n /*middle.forEach(function(item){\n\n item.next();\n\n\n })*/\n\n for(var i=0; i< 4;i++){\n middle.pop().next();\n\n }\n //gen.next();\n\n\n }", "function callback(){\n console.log('callback')\n setTimeout(function(){\n console.log('step1')\n return setTimeout(function(){\n console.log('step2')\n return setTimeout(function(){\n console.log('step3')\n return setTimeout(function(){\n console.log('step4')\n }, 100)\n }, 200)\n }, 200)\n }, 200)\n}", "function setup() {\n delay(4000)\n .then(() => console.log('finished the first'))\n .then(() => {\n delay(4000)\n .then(() => console.log('finished the second'))\n })\n}", "function main() {\n\n /*\n * Example template callback\n *\n * callback = function(message) {\n * if (message) console.log(message);\n * }\n *\n */\n\n /*\n * Example usage of connect and disconnect\n *\n * connect().then(callback, callback);\n * disconnect().then(callback, callback);\n */\n\n /*\n * Example usage of User routines\n *\n * addUser(\"user1\", \"token1\").then(callback, callback);\n * getUser(\"token1\").then(callback, callback);\n */\n\n /*\n * Example usage of TopTrack routines\n *\n * features = {[ACOUSTICNESS]: 0.3, [DANCEABILITY]: 0.5, \n * [ENERGY]: 0.8, [TEMPO]: 113.4, [VALENCE]: 0.8};\n * addTopTrack(\"user1\", \"uri1\", features).then(callback, callback);\n */\n\n /*\n * Example usage of Playlist routines\n *\n * addPlaylist(\"user1\", \"uri2\").then(disconnectCB, disconnectCB);\n * getPlaylistId(\"uri1\").then(disconnectCB, disconnectCB);\n * getUserPlaylists(\"user1\").then(disconnectCB, disconnectCB);\n * getPlaylistUri(\"15\").then(disconnectCB, disconnectCB);\n */\n\n}", "function executeInOrder() {\n var funcs = Array.prototype.concat.apply([], arguments);\n var func = function(callback) {\n funcs.shift();\n callback();\n };\n func(function() {\n if (funcs.length > 0) {\n executeInOrder.apply(this, funcs);\n }\n });\n}", "step_func(func) { func(); }", "function multi_phase_fun(phase1input,phase2input,finishinput,callback){\n console.log(\"phase 1 is executing \",phase1input)\n callback(\"phase 1 output\")\n console.log(\"phase 2 is executing \",phase2input)\n callback(\"phase 2 output\")\n console.log(\"final phase is executing \",finishinput)\n }", "function module1(folderpath, io_path, connection, callback) {\n async.waterfall([\n // SETUP: find files, connect, create userid, create io, insert io (result = [batches, null, null], returns batches)\n function setup(cb) {\n async.parallel([\n // Find the json files to be processed (returns batches)\n function find_files(pcb) {\n fs.readdir(folderpath, function(err, result) {\n if (err) {\n console.log('Error at find_files().')\n pcb(err)\n } else {\n let json_filepaths = []\n for (filename of result) { \n if (filename.endsWith('.json')) {\n json_filepaths.push(folderpath + '/' + filename)\n }\n }\n \n const batches = []\n const num_batches = Math.floor(json_filepaths.length / batch_size)\n for (let i = 0; i < num_batches; i ++) {\n batches.push(json_filepaths.slice(0, batch_size))\n json_filepaths.splice(0, batch_size)\n }\n batches.push(json_filepaths)\n \n console.log('Sorted folder: ' + folderpath + ': found ' + batches.length + ' batches.')\n pcb(null, batches)\n }\n })\n },\n // Create userid_table (returns null)\n function create_uuid(pcb) {\n create_table(userid_table, userid_example, userid_unique_keys, connection, (err, result) => {\n if (err) {\n console.log('Failed to create table: ' + userid_table)\n pcb(err)\n } else {\n console.log('Finished creating table: ' + userid_table)\n pcb(null)\n }\n })\n },\n // Submodule 1: create io, insert io (returns null)\n function submodule1(pcb) {\n async.waterfall([\n // Create io table.\n function create_io(sm_wcb) {\n create_table(io_table, io_example, undefined, connection, (err, result) => {\n if (err) {\n console.log('Failed to create table: ' + io_table)\n sm_wcb(err)\n } else {\n console.log('Finished creating table: ' + io_table)\n sm_wcb(null)\n }\n })\n },\n // Insert io file.\n function insert_io(sm_wcb) {\n read_csvfile(io_path, (err, result) => {\n if (err) {\n sm_wcb(err)\n } else { \n const headers = ['application', '_ID']\n const data = result.slice(1)\n const new_data = []\n for (d of data) {\n nd = []\n if (d[1]) {\n nd.push(d[1])\n } else {\n nd.push(d[0])\n }\n nd.push(d[3])\n new_data.push(nd)\n }\n const io_write = make_obj(headers, new_data)\n insert_table(io_write, io_table, connection, undefined, undefined, (err) => {\n if (err) {\n sm_wcb(err)\n } else {\n sm_wcb(null)\n }\n })\n }\n })\n }\n ], \n function (err) {\n if (err) {\n pcb(err)\n } else {\n pcb(null)\n }\n })\n }\n ], \n function (err, result) {\n if (err) {\n cb(err)\n } else {\n cb(null, result[0])\n }\n })\n },\n // Process batches (returns null)\n function process(batches, cb) {\n const pool = mysql.createPool({\n conncetionLimit: batches.length,\n host: 'localhost',\n port: '3306',\n database: 'LBLR_data',\n user: 'root',\n password: 'raceboorishabackignitedrum',\n })\n \n async.map(batches, \n (datum, map_callback) => {\n console.log(datum)\n batch(datum, userid_table, 0, connection, (err) => {\n if (err) {\n map_callback(err)\n }\n else {\n map_callback(null)\n }\n })\n },\n (err, result) => {\n if (err) {\n cb(err)\n }\n else {\n const select_query = \"SELECT * FROM \" + userid_table\n connection.query(select_query, (err, result, fields) => {\n if (err) {\n cb(err)\n } else {\n cb(null, result)\n }\n })\n }\n }\n )\n },\n\n // Drop io_table (returns null)\n function drop_io(output, cb) {\n drop_table(io_table, connection, (err, result) => {\n if (err) {\n console.log('Error dropping: ' + io_table)\n cb(err)\n } else {\n console.log('Dropped: ' + io_table)\n cb(null, output)\n }\n })\n },\n ], \n function (err, output) {\n if (err) {\n console.log('\\n\\t Trying to cleanup module 1\\n')\n cleanupTables(connection, (cleanErr) => {\n if (cleanErr) {\n console.log('Cleanup Error', cleanErr)\n }\n else {\n close_connection(connection, (conErr) => {\n if (conErr) {\n console.log('Close Connection Error', conErr)\n }\n else {\n callback(err)\n }\n })\n }\n })\n } else {\n module2(output, connection, callback)\n }\n })\n}", "async genAccomodations(){\n //Not yet implemented\n }", "function seq (asyncFuns) {\n return asyncFuns.reduce(followUp, Promise.resolve())\n}", "step_func_done(func) { func(); }", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "function SpaceifySynchronous()\r\n{\r\nvar self = this;\r\n\r\nvar methodId = 0;\r\nvar methods = [];\r\nvar results = {};\r\nvar waiting = null;\r\nvar finally_ = null;\r\n\r\n// Start traversing functions in the order they are defined. Functions are executed independently and results are not passed to the next function.\r\n// The results of operations are stored in the results object in the same order as the functions were executed.\r\nself.waterFall = function(_methods, callback)\r\n\t{\r\n\tif((!_methods || _methods.length == 0) && typeof callback == \"function\")\r\n\t\tcallback(results);\r\n\telse if(!_methods || _methods.length == 0 || typeof callback != \"function\")\r\n\t\treturn;\r\n\r\n\tfinally_ = callback;\r\n\r\n\tmethods = _methods;\r\n\r\n\tnext();\r\n\t}\r\n\r\n// Call the methods one after another recursively\r\nvar next = function()\r\n\t{\r\n\tif(methods.length == 0)\r\n\t\treturn finally_();\r\n\r\n\tvar calling = methods.shift();\r\n\r\n\t// Call a method that is asynchronous. Store the original callback and replace it with ours. It's assumed that\r\n\t// the original callback is the last parameter. After our callback returns call the original callback, if it is defined (not null).\r\n\tif(calling.type == \"async\")\r\n\t\t{\r\n\t\twaiting = calling.params[calling.params.length - 1];\r\n\t\tcalling.params[calling.params.length - 1] = wait;\r\n\t\tcalling.method.apply(calling.object, calling.params);\r\n\t\t}\r\n\t// Call a method that is synchronous.\r\n\telse\r\n\t\t{\r\n\t\tresults[++methodId] = calling.method.apply(calling.object, calling.params);\r\n\t\tnext();\r\n\t\t}\r\n\t}\r\n\r\nvar wait = function()\r\n\t{\r\n\tresults[++methodId] = Array.prototype.slice.call(arguments);\t\t\t// Array of return values rather than the arguments object\r\n\r\n\tif(typeof waiting == \"function\")\r\n\t\twaiting.apply(this, arguments);\r\n\r\n\tnext();\r\n\t}\r\n\r\nself.getResult = function(methodId)\r\n\t{\r\n\treturn (results[methodId] ? results[methodId] : null);\r\n\t}\r\n\r\nself.getResults = function()\r\n\t{\r\n\treturn results;\r\n\t}\r\n\r\n}", "function step1() {\n return new Promise((resolve, reject) => {\n console.log(1);\n console.log(2);\n console.log(3);\n resolve();\n });\n}", "async function testLib() {\n var initC = await initContract();\n var callOne = await makeRequest(\"ShipmentDelivered\");\n var callTwo = await makeRequest(\"ShipmentDelivered\");\n console.log(initC, callOne, callTwo)\n}", "async function main() {\n let exchange1 = {};\n let exchange2 = {};\n let lastPrice = \"\";\n let seconds = 0;\n let initialBalance = {};\n\n // TODO el exchange debe pasarse: conf.exchange1.apiKey; conf.exchange1.secret\n function init() {\n try {\n exchange1 = exchange.setExchange(conf.exch1Name, conf.exch1.apiKey, conf.exch1.secret, conf.exch1.uid);\n exchange2 = exchange.setExchange(conf.exch2Name, conf.exch2.apiKey, conf.exch2.secret);\n seconds = exchange2.seconds() * 1000;\n } catch (error) {\n log.bright.red(\"ERROR\", error.message)\n }\n };\n\n // TODO es resp de order\n async function cancelMultipleOrders(symbol, lowerId, uperId) {\n for (let i = lowerId; i <= uperId; i++) {\n try {\n let canceled = await exchange2.cancelOrder(i, symbol)\n log(canceled)\n } catch (error) {\n log(error)\n }\n }\n };\n\n function sleep(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms)\n })\n };\n\n try {\n let isFirstIteration = true;\n init();\n price.basePrice = await price.lastPrice(symbol2, exchange1);\n log(\"price at generation\", price.basePrice);\n initialBalance = await exchange.balances(exchange2);\n await order.placeScaledOrders(exchange2, conf.amount, symbol);\n await trade.getTradesByBalance(exchange1, exchange2, initialBalance, order.placedOrders, isFirstIteration); \n //await cancelMultipleOrders(symbol, 6064, 6251);\n } catch (error) {\n log(error);\n }\n}", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "async function syncPipeline() {\n await generateAllowance();\n // await confirmPendingBookings();\n // the server-side script does this now\n await updateContactList();\n await updateTourList();\n}", "producer(successCallback, failCallback) {\r\n const waitingPromise = new CustomPromise();\r\n //queue promises are based on their closures \r\n this.orderQueue.push([waitingPromise, successCallback, failCallback]);\r\n // console.log(this.orderQueue.length); //delete this\r\n\r\n if (this.state === states[1]) {\r\n this.backtrackTheChain();\r\n } else if (this._state === states[2]) {\r\n this.backtrackTheChainR();\r\n }\r\n\r\n return waitingPromise;\r\n }", "async function doWork() {\n try {\n console.log(\"s1\");\n await step1();\n console.log(\"s2\");\n await step2();\n console.log(\"s3\");\n await step3();\n console.log(\"s4\");\n } catch (err) {}\n}", "registerBootTasks(bootEngine, manifest, serviceLauncher) {\n let regAF; // var to assign arrow functions to so won't be anonymous in stack trace\n this.bootEngine.registerBootTask(\"initializeDeepLinkingTask\", regAF = (doneCallback) => {\n let initializeDeepLinkingTask = new initializeDeepLinkingTask_1.InitializeDeepLinkingTask();\n initializeDeepLinkingTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"initializeRouterTask\", regAF = (doneCallback) => {\n let initializeRouterTask = new initializeRouterTask_1.InitializeRouterTask({ manifest, serviceLauncher });\n initializeRouterTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"initializeFinsemblePubsubTask\", regAF = (doneCallback) => {\n let initializeFinsemblePubsubTask = new initializeFinsemblePubsubTask_1.InitializeFinsemblePubsubTask();\n initializeFinsemblePubsubTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"initializeSystemStateHandersTask\", regAF = (doneCallback) => {\n let initializeSystemStateHandersTask = new initializeSystemStateHandersTask_1.InitializeSystemStateHandersTask();\n initializeSystemStateHandersTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"testTask_initializeSplinterAgentPool\", regAF = (doneCallback) => {\n this.bootEngine.initializeSplinterAgentPoolTask(doneCallback);\n });\n this.bootEngine.registerBootTask(\"waitForAuthenticatedTask\", regAF = (doneCallback) => {\n let waitForAuthenticatedTask = new waitForAuthenticatedTask_1.WaitForAuthenticatedTask();\n waitForAuthenticatedTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"initializeSystemManagerAPITask\", regAF = (doneCallback) => {\n let initializeSystemManagerAPITask = new initializeSystemManagerAPITask_1.InitializeSystemManagerAPITask({ bootEngine, systemLog: systemLog_1.default });\n initializeSystemManagerAPITask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"startLoggerTask\", regAF = (doneCallback) => {\n let startLoggerTask = new startLoggerTask_1.StartLoggerTask();\n startLoggerTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"loadUserDefinedComponentsTask\", regAF = (doneCallback) => {\n let loadUserDefinedComponentsTask = new loadUserDefinedComponentsTask_1.LoadUserDefinedComponentsTask();\n loadUserDefinedComponentsTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"registerHotkeysTask\", regAF = (doneCallback) => {\n let registerHotkeysTask = new registerHotKeysTask_1.RegisterHotkeysTask();\n registerHotkeysTask.start(doneCallback);\n });\n ;\n this.bootEngine.registerBootTask(\"setupSearchLauncherTask\", regAF = (doneCallback) => {\n let setupSearchLauncherTask = new setupSearchLauncherTask_1.SetupSearchLauncherTask();\n setupSearchLauncherTask.start(doneCallback);\n });\n this.bootEngine.registerBootTask(\"loadSystemTrayIconTask\", regAF = (doneCallback) => {\n let loadSystemTrayIconTask = new loadSystemTrayIconTask_1.LoadSystemTrayIconTask();\n loadSystemTrayIconTask.start(doneCallback);\n });\n // test tasks -- load them so can test with only a config change. By default they are disabled (i.e. their bootParams.autostart is false)\n // the start function for these test tasks can be passed in directly since there's no binding problem (the test tasks won't reference `this`)\n this.bootEngine.registerBootTask(\"forceErrorTestTask\", new forceErrorTestTask_1.ForceErrorTestTask().start);\n this.bootEngine.registerBootTask(\"checkpointErrorTestTask\", new checkpointErrorTestTask_1.CheckpointErrorTestTask().start);\n this.bootEngine.registerBootTask(\"checkpointCircularDependencyTestTask\", new checkpointBadDependencyTestTask_1.CheckpointBadDependencyTestTask().start);\n this.bootEngine.registerBootTask(\"checkpointBadDependencyTestTask\", new checkpointCircularDependencyTestTask_1.CheckpointCircularDependencyTestTask().start);\n }", "backtrackTheChain() {\r\n this.orderQueue.forEach(([waitingPromise, successCallback]) => {\r\n //if the passed arg is not a function simply return the observed value w.out executing\r\n if (typeof successCallback !== 'function') return waitingPromise.onFulfilled(this.val);\r\n const res = successCallback(this.val);\r\n if (res && res.then === 'function') { //check if promise\r\n res.then(val => waitingPromise.onFulfilled(val), val => waitingPromise.onRejected(val));\r\n } else {\r\n waitingPromise.onFulfilled(res);\r\n }\r\n })\r\n this.orderQueue = [];\r\n }", "function setupQueueFunctionQueued() {\n // Generate all currently queued functions.\n generateAvailableQueued();\n }", "async function cookFood() {\n let a;\n let b;\n let c;\n\n try {\n a = await step1();\n } catch (err) {\n handleError(err);\n }\n\n try {\n b = await step2();\n } catch (err) {\n handleError(err);\n }\n\n try {\n c = await step3();\n } catch (err) {\n handleError(err);\n }\n\n return a + b + c;\n}", "function createFunctions_v2(number) {\n var callbacks = [], i;\n\n for (i = 0; i < number; i++) {\n (function (index) {\n callbacks.push(function () {\n return index;\n });\n })(i);\n }\n\n return callbacks;\n}", "function ejecucionPUE(cb) {\n PUEP(\"60d67e6809df6a0015937ede\", 1, \"PUE1\",2, 2, function () {\n PUEP(\"60d67e6809df6a0015937ede\", 2, \"PUE2\",2, 5, function () {\n PUEG(\"60d67e6809df6a0015937ede\", 1, \"PUE3\",4, 4, function () {\n PUEG(\"60d67e6809df6a0015937ede\", 0, \"PUE4\", 4,4, function () {\n PUEG(\"60d67e6809df6a0015937ede\", 2, \"PUE5\", 0,5, function(){\n PUEM(\"60d67e6809df6a0015937ede\", 2, textmas500,\"PUE6\", 1,5, function(){\n PUEB(\"60d67e6809df6a0015937ede\", 0, \"PUE7\", 3,3, function(){\n\n PUEM2(\"60d67e6809df6a0015937ede\", 2, \"PUE8\", 3, 3, function(){\n\n PUEG(\"CONSTANTINI\", 0, \"PUE9\", 5,5, function() {\n PUEM(\"60d67e6809df6a0015937ede\", 0, \"Hola\",\"PUE10\", 4,4, function(){\n cb(true);\n } )\n })\n })\n\n })\n })\n })\n })\n })\n })\n })\n}", "function framework(data,scb,fcb){ //scb and fcb are success and failure call back\n for(let i=2;i*i<data;i++){\n if(data%i==0){\n return fcb();\n }\n }\n return scb();\n}", "myFunctions() {\n this.getUserInfo().then( this.getFollowers()).then(this.getFollowing()).then(this.props.route.params.userid=0)\n \n }", "function actFn( ...actFn_params )\n{\n // console.log( \"actFn\", actFn_params )\n\n let np = actFn_params.length;\n\n assert( np > 0, 'actFn called with no parameters. Requires at least a function*' );\n assert( np < 3, 'actFn called with too many parameters ('+np+').' );\n\n if( np === 1 )\n {\n var generator_function = actFn_params[ 0 ];\n var actx_maybe = null;\n }\n else\n {\n var generator_function = actFn_params[ 1 ];\n var actx_maybe = actFn_params[ 0 ];\n assert( actx_maybe.constructor === Context );\n }\n if( generator_function.hasOwnProperty( ACT_FN_TAG ) )\n return generator_function;\n\n\n /* runToNextYield is the heart of the activity function\n * implementation. It gets called after every yield performed by\n * 'generator_function'.\n */\n function runToNextYield( actx, generator, is_err, yielded_value )\n {\n /* Parameter Types: */\n /* actx : activity context type */\n /* generator : generator type */\n /* is_err : boolean */\n /* yielded_value : any */\n // console.log( \"runToNextYield\", generator );\n\n assert( actx.continuation === null );\n\n if( actx.blockedByAtomic() )\n {\n actx.addToWaiting();\n return new Promise( function( resolve, reject ) {\n actx.continuation = resolve;\n } ).then(\n function() {\n return runToNextYield( actx, generator, is_err, yielded_value );\n } );\n }\n\n /* Either the system is not in atomic mode, or actx can run in the current atomic */\n actx.state = RUNNING;\n actx.waits = 0;\n try {\n if( is_err )\n {\n var next_yielded = generator.throw( yielded_value );\n }\n else\n {\n var next_yielded = generator.next( yielded_value );\n }\n actx.state = RESOLVING;\n }\n catch( err ) {\n // console.log( \"!!! generator error\", err, err.stack );\n actx.state = GENERATOR_ERROR;\n // Error.captureStackTrace( err, runToNextYield );\n return P.reject( err );\n }\n /* next_yielded : { done : boolean, value : `b } */\n\n function realReturn( v )\n {\n assert( actx.generator_fns.length > 0 );\n let g = actx.generator_fns.pop();\n assert( g === generator_function );\n return P.resolve( v );\n }\n\n if( next_yielded.done )\n return realReturn( next_yielded.value );\n /* \"else\": The generator yielded; it didn't return */\n\n return P.resolve( next_yielded.value ).then(\n function( next_yielded_value ) {\n try {\n if( RTRN_FROM_ATOMIC_TAG in next_yielded_value\n && !( next_yielded_value.value === undefined ) )\n {\n return realReturn( next_yielded_value.value );\n }\n }\n catch( err ) {}\n return runToNextYield( actx, generator, false, next_yielded_value );\n },\n function( err ) {\n return runToNextYield( actx, generator, true, err );\n } );\n }\n\n\n /* Finally, the code that actually runs when actFn is called */\n function fnEitherMode( actx, ...params )\n {\n /* actx : activity context type */\n let pass_actx = !actx.hasOwnProperty( DO_NOT_PASS_TAG );\n try {\n if( pass_actx )\n {\n var generator = generator_function( actx, ...params );\n }\n else\n {\n var generator = generator_function( ...params );\n }\n /* generator : iterator type */\n }\n catch( err ) {\n console.log( \"Error starting generator\" );\n return P.reject( err );\n }\n actx.generator_fns.push( generator_function );\n /* NOTE: leaving the value parameter out of the following call,\n * because the first call to 'next' on a generator doesn't expect\n * a real value. */\n return runToNextYield( actx, generator, false );\n }\n\n if( actx_maybe )\n {\n var f = function( ...params )\n {\n actx_maybe[ DO_NOT_PASS_TAG ] = 0;\n return fnEitherMode( actx_maybe, ...params );\n }\n }\n else\n {\n var f = function( ...params )\n {\n assert( params[ 0 ].constructor === Context );\n return fnEitherMode( ...params );\n }\n }\n f[ EXPECTS_CTX_TAG ] = !actx_maybe;\n f[ ACT_FN_TAG ] = 0;\n return f;\n}", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function sequence(funcsArray) {\n return function (result) {\n for (var i = 0; i < funcsArray.length; i++) {\n result = funcsArray[i].call(this, result);\n }\n return result;\n };\n }", "function processDuplicateFree(/* CODE HERE ONLY AFTER COMPLETING ALL OTHER TASKS */) {\n /* CODE HERE ONLY AFTER COMPLETING ALL OTHER TASKS */\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}", "function sequence(actions) {\n return () => {\n for (let i = 0; i < actions.length; i++) {\n actions[i]();\n }\n };\n }", "function makeHfcCall(hfcFunc,times,successCallback,failureCallback,user,enrollAttributes){\n return (function(){\n let counter = 0;\n // logger.info(\"hfcFunc,times,retryFunction,successCallback,failureCallback\");\n let innerFunction = function(){\n // firstStep(user,enrollAttributes)\n basic.enrollAndRegisterUsers(user,enrollAttributes)\n .then(hfcFunc)\n .then( rsp => {\n counter = times;\n successCallback(rsp);\n })\n .catch(err =>{\n if(counter < times){\n logger.info(\"AN ERROR OCCURED!!! atempt:\"+counter+\"\\n\");\n logger.info(err);\n counter ++;\n innerFunction();\n }else{\n logger.info(\"HfcService\");\n logger.info(err);\n // failureCallback(\"failed, to get supplements after \" + counter + \" attempts\");\n try{\n let error = JSON.parse(util.format(\"%j\",err));\n failureCallback(error.msg);\n }catch(e){\n logger.info(e);\n failureCallback(util.format(\"%j\",err));\n }\n }\n });\n };\n\n return innerFunction;\n })();\n}", "function multiple (first, second){\n first()\n second()\n}", "function fetchNewSurveys() {\n //fetch all surveys moving forward\n //send the API requests to surveyCTO - we probable also need attachments to process pictures\n fetchSurveys(survey_config.entrySurveyName, survey_config.entryCleaningPath, survey_config.gitRepoPath, function(entrySurveys, entry_changed, err) {\n if(err) {\n console.log(\"Error fetching and processing forms\");\n console.log(err);\n return;\n } else {\n //We can go ahead and generate the backcheck table here\n //We need to recreate the object so it doesn't mess up future asynchronous processing\n newEntrySurveys = JSON.parse(JSON.stringify(entrySurveys));\n generateBackcheckList(newEntrySurveys);\n\n fetchSurveys(survey_config.DWSurveyName, survey_config.DWCleaningPath, survey_config.gitRepoPath, function(DWSurveys, dw_changed, err) {\n if(err) {\n console.log(\"Error fetching and processing forms\");\n console.log(err);\n return;\n } else {\n fetchSurveys(survey_config.exitSurveyName, survey_config.exitCleaningPath, survey_config.gitRepoPath, function(exitSurveys, exit_changed, err) {\n if(err) {\n console.log(\"Error fetching and processing forms\");\n console.log(err);\n return;\n } else {\n //now get the two csv from the achimota deployment\n csv().fromFile(survey_config.gitRepoPath + '/old_deployment/deployment.csv').then(function(deployment) {\n csv().fromFile(survey_config.gitRepoPath + '/old_removal/removal.csv').then(function(removal) {\n //now append the json arrays to the entry and exit surveys\n entrySurveys = entrySurveys.concat(deployment);\n entrySurveys = entrySurveys.concat(DWSurveys);\n exitSurveys = exitSurveys.concat(removal);\n /*async.series([async.apply(processSurveys, entrySurveys, exitSurveys),\n updateViews], function(err,res) {\n console.log(err);\n });*/\n if(entry_changed || exit_changed || dw_changed) {\n async.series([async.apply(processSurveys, entrySurveys, exitSurveys),\n updateViews], function(err,res) {\n console.log(err);\n });\n } else {\n console.log(\"No new surveys, no new processing scripts. Exiting.\")\n }\n });\n });\n }\n });\n }\n });\n }\n });\n}", "function serial() {\n var tasks = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tasks[_i] = arguments[_i];\n }\n // tslint:disable-next-line:no-null-keyword\n var flatTasks = _flatten(tasks).filter(function (task) { return task !== null && task !== undefined; });\n for (var _a = 0, flatTasks_1 = flatTasks; _a < flatTasks_1.length; _a++) {\n var task_1 = flatTasks_1[_a];\n _trackTask(task_1);\n }\n return {\n execute: function (buildConfig) {\n var output = Promise.resolve();\n var _loop_1 = function (task_2) {\n output = output.then(function () { return _executeTask(task_2, buildConfig); });\n };\n for (var _i = 0, flatTasks_2 = flatTasks; _i < flatTasks_2.length; _i++) {\n var task_2 = flatTasks_2[_i];\n _loop_1(task_2);\n }\n return output;\n }\n };\n}", "function first() {\n console.log('I am first!');\n second();\n console.log('First is finished');\n}", "async function startFlow(){\n try{\n await helper.initialize();\n await helper.checkBalance();\n await helper.approveSCContract();\n await helper.topup();\n await helper.checkBalance();\n await helper.setPending();\n await helper.setResult();\n await helper.getResult();\n await helper.setFinished();\n await helper.checkBalance();\n process.exit(0);\n }catch(err){\n console.error(err);\n process.exit(1);\n }\n}", "async function runOrder() {\n fillArrays();\n cleanseDetails();\n meetingObjects();\n api();\n jsonNotation();\n addToMongo();\n}", "async function AppelApi(parfunc=api_tan.GenericAsync(api_tan.getTanStations(47.2133057,-1.5604042)),\nretour=function(par){console.log(\"demo :\" + JSON.stringify(par))}) {\n let demo = await parfunc \n retour(demo);\n // console.log(\"demo : \" + JSON.stringify(demo));\n}", "function testMix()\n{\n let _count = 0;\n const _fn = function (cb)\n {\n cb(null, _count++);\n };\n jfSync(\n [{fn : _fn}, _fn],\n (error, data) => checkData([0, 1])\n );\n}", "function _add(...args) {\n\t\t\tsequences = addToSequence(sequences, (s) => cancellableTimeout(s, 1), ...args)\n\t\t\tinputSequence.push({type:'function', data:args})\n\t\t}", "function createFunctions_v1(number) {\n var callbacks = [];\n\n for (var i = 0; i < number; i++) {\n var callback = (function (index) {\n return function () {\n return index;\n }\n })(i);\n\n callbacks.push(callback);\n }\n\n return callbacks;\n}", "function createReleases(cb) {\n async.parallel(\n [\n function (callback) {\n releaseCreate(\n \"Jeezuz\",\n false,\n artists[0],\n \"https://cdn11.bigcommerce.com/s-0c3e0/images/stencil/1280x1280/products/255/608/jesus-loves-you-personalized-kids-music-cd__23028.1293717951.jpg?c=2?imbypass=on\",\n genres[0],\n callback\n );\n },\n function (callback) {\n releaseCreate(\n \"We are 20 and we're cool\",\n bands[0],\n false,\n \"https://cdn11.bigcommerce.com/s-0c3e0/images/stencil/1280x1280/products/255/608/jesus-loves-you-personalized-kids-music-cd__23028.1293717951.jpg?c=2?imbypass=on\",\n genres[1],\n callback\n );\n },\n function (callback) {\n releaseCreate(\n \"Why I hate my wife\",\n bands[1],\n false,\n \"https://cdn11.bigcommerce.com/s-0c3e0/images/stencil/1280x1280/products/255/608/jesus-loves-you-personalized-kids-music-cd__23028.1293717951.jpg?c=2?imbypass=on\",\n genres[2],\n callback\n );\n },\n function (callback) {\n releaseCreate(\n \"Sippin on Da Devil Juice\",\n bands[2],\n false,\n \"https://cdn11.bigcommerce.com/s-0c3e0/images/stencil/1280x1280/products/255/608/jesus-loves-you-personalized-kids-music-cd__23028.1293717951.jpg?c=2?imbypass=on\",\n genres[3],\n callback\n );\n },\n ],\n // optional callback\n cb\n );\n}", "function call3Times(fun) {\n fun();\n fun();\n fun();\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "function chain() {\n var functions = Array.prototype.slice.call(arguments, 0);\n if (functions.length > 0) {\n var firstFunction = functions.shift();\n var firstPromise = firstFunction.call();\n firstPromise.done(function () {\n chain.apply(null, functions);\n });\n }\n }", "async function funcionAsincronaDeclarada (){\r\n try {\r\n console.log(`Inicio de Async function`)\r\n let obj = await cuadradoPromise(0);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n \r\n obj = await cuadradoPromise(1);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(2);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(3);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(4);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n}", "function seq (arr, callback, index) {\n // first call, without an index\n if (typeof index === 'undefined') {\n index = 0\n }\n //none script tags\n if(arr.length == 0){\n runScriptsCallback();\n return;\n }\n arr[index](function () {\n index++\n if (index === arr.length) {\n callback()\n } else {\n seq(arr, callback, index)\n }\n })\n }", "function success1(a){\n console.log(\"this is success1 \" + a + \"and now executing the new callback\");\n // another async call\n return new Promise(function(resolve,reject){\n setTimeout(function(){\n console.log(\"second promise executing\");\n resolve(\"kadam\");\n },2000);\n });\n\n}", "function cook(i1, i2, callback) {\n callback(i1)\n callback(i2)\n console.log(`I make ${i2} ${i1}`)\n}", "function done() {}", "function executingFirst(callback)\r\n{\r\n console.log(\"Executing current function...\");\r\n console.log(\"Calling callback function\")\r\n executingLast();//calling callback function\r\n /**callback function executes when it is invoked, no other script is running until the execution of callback function is completed\r\n * so it is synchronous\r\n */\r\n}", "function madeFirst() { \n //will print 'This is the start'\n console.log('This is the start, in madeFirst'); \n //calling madeSecond before it is made\n madeSecond(); \n // will print 'This is second and in madeFirst'\n console.log('This is second and in madeFirst'); \n }", "function next(...args) {\n\t\t// if the next function has been defined\n\t\tif (typeof utils.queue[utils.i + 1] !== 'undefined') {\n\t\t\targs.unshift(next);\n\t\t\tutils.i++;\n\t\t\treturn utils.queue[utils.i](...args);\n\t\t}\n\n\t\t// if there are no more function, next will re-init fang group\n\t\treturn init(args);\n\t}", "async function v3(v4,v5,v6,v7,v8) {\n}", "fa () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.f();\n\t}", "wrapSteps() {\n const sync = this.config.sync;\n const wrapStepSync = this.wrapStepSync;\n const wrapStepAsync = this.wrapStepAsync;\n Cucumber.setDefinitionFunctionWrapper(function syncAsyncRetryWrapper(fn, options = {}) {\n let retryTest = isFinite(options.retry) ? parseInt(options.retry, 10) : 0;\n let wrappedFunction = fn.name === 'async' || sync === false ? wrapStepAsync(fn, retryTest) : wrapStepSync(fn, retryTest);\n return wrappedFunction;\n });\n }", "async function concurrent() {\n const firstPromise = firstAsyncThing();\n const secondPromise = secondAsyncThing();\n console.log(await firstPromise, await secondPromise);\n }", "function example_1_normal(cb) {\n // TODO\n}", "function helper() {\n numStates--;\n if (numStates >= 0) {\n if(objects[numStates][1]) {\n // Force Creation is true\n adapter.setObject(objects[numStates][0], {type:'state', common:objects[numStates][2], native: {}}, function(err, obj) {\n if (!err && obj) adapter.log.debug('Object created (force:true): ' + objects[numStates][0]);\n setImmediate(helper); // we call function again. We use node.js setImmediate() to avoid stack overflows.\n });\n } else {\n // Force Creation is false\n adapter.setObjectNotExists(objects[numStates][0], {type:'state', common:objects[numStates][2], native: {}}, function(err, obj) {\n if (!err && obj) adapter.log.debug('Object created (force:false): ' + objects[numStates][0]);\n setImmediate(helper); // we call function again. We use node.js setImmediate() to avoid stack overflows.\n });\n }\n } else {\n // All objects processed\n return callback();\n }\n }", "function startUp(_x,_x2,_x3){return _startUp.apply(this,arguments);}", "function addAsync(x,y, onResult){\n console.log(\"[SP] processing \", x , \" and \", y);\n setTimeout(function(){\n var result = x + y;\n console.log(\"[SP] returning result\");\n if (typeof onResult === 'function')\n onResult(result);\n },3000);\n}", "function createFunctions(n) {\n var callbacks = [];\n for (let i=0; i<n; i++) {\n callbacks.push(function() {\n return i;\n });\n }\n return callbacks;\n}", "function doit(sequence, data, pipe, ctx) {\n\n return sequence.reduce(function(doWork, funcArr, funcIndex) {\n\n var systemEnvs = {\n both: {\n predicate: function () {\n return funcArr._env === 'both';\n },\n handler: function () {\n var toNextEnv = getNameNextEnv(PromisePipe.env);\n\n if (!toNextEnv) {\n return function (data) {\n return funcArr(data);\n };\n }\n\n return function (data) {\n return doWork.then(funcArr).then(function () {\n var msg = PromisePipe.createTransitionMessage(data, ctx, pipe._id, funcArr._id, funcArr._id, ctx._pipecallId);\n\n var range = rangeChain(funcArr._id, sequence);\n\n ctx._passChains = passChains(range[0]-1, range[0]-1);\n return TransactionHandler.createTransaction(msg)\n .send(PromisePipe.envTransitions[ctx._env][toNextEnv])\n .then(updateContextAfterTransition)\n .then(handleRejectAfterTransition)\n });\n };\n }\n },\n inherit: {\n predicate: function () {\n return funcArr._env === 'inherit';\n },\n handler: function () {\n funcArr._env = sequence[funcIndex]._env;\n\n return funcArr;\n }\n },\n cache: {\n predicate: function () {\n return funcArr._env === 'cache';\n },\n handler: function () {\n var toNextEnv = getNameNextEnv(PromisePipe.env);\n\n if (!toNextEnv) {\n return function (data) {\n return funcArr(data);\n };\n }\n var range = rangeChain(funcArr._id, sequence);\n ctx._passChains = passChains(range[0]+1, range[1]);\n return function (data) {\n var handler = {};\n function cacherFunc(data, context){\n var cacheResult = new Promise(function(resolve, reject){\n \t\t\t\thandler.reject=reject;\n \t\t\t\thandler.resolve=resolve;\n \t\t\t});\n var result = funcArr.call(this, data, context, cacheResult);\n if(!result) {\n return function(cacheResult){\n \t\t\t\t return handler.resolve(cacheResult);\n \t\t\t }\n } else {\n return result;\n }\n }\n return doWork.then(cacherFunc).then(function (cacheResult) {\n if(typeof(cacheResult) == \"function\"){\n var msg = PromisePipe.createTransitionMessage(data, ctx, pipe._id, sequence[range[0]+1]._id, sequence[range[1]]._id, ctx._pipecallId);\n\n return TransactionHandler.createTransaction(msg)\n .send(PromisePipe.envTransitions[ctx._env][toNextEnv])\n .then(updateContextAfterTransition)\n .then(fillCache)\n .then(handleRejectAfterTransition)\n function fillCache(response){\n cacheResult(response.data);\n return response;\n }\n } else {\n return cacheResult;\n }\n });\n };\n }\n }\n };\n\n function getNameNextEnv(env) {\n if (!PromisePipe.envTransitions[ctx._env]) {\n return null;\n }\n\n return Object.keys(PromisePipe.envTransitions[ctx._env]).reduce(function (nextEnv, name) {\n if (nextEnv) { return nextEnv; }\n\n if (name === env) {\n return nextEnv;\n }\n\n if (name !== env) {\n return name;\n }\n }, null);\n }\n\n /**\n * Get index of next env appearance\n * @param {Number} fromIndex\n * @param {String} env\n * @return {Number}\n */\n function getIndexOfNextEnvAppearance(fromIndex, env){\n return sequence.map(function(el){\n return el._env;\n }).indexOf(env, fromIndex);\n }\n\n /**\n * Check env of system behavoir\n * @param {String} env Env for checking\n * @return {Boolean}\n */\n function isSystemTransition (env) {\n return !!systemEnvs[env];\n }\n\n /**\n * Check valid is transition\n */\n function isValidTransition (funcArr, ctx) {\n var isValid = true;\n\n if (!(PromisePipe.envTransitions[ctx._env] && PromisePipe.envTransitions[ctx._env][funcArr._env])) {\n if (!isSystemTransition(funcArr._env)) {\n isValid = false;\n }\n }\n return isValid;\n }\n\n /**\n * Return filtered list for passing functions\n * @param {Number} first\n * @param {Number} last\n * @return {Array}\n */\n function passChains (first, last) {\n return sequence.map(function (el) {\n return el._id;\n }).slice(first, last + 1);\n }\n\n /**\n * Return lastChain index\n * @param {Number} first\n * @return {Number}\n */\n function lastChain (first) {\n var index = getIndexOfNextEnvAppearance(first, PromisePipe.env, sequence);\n\n return index === -1 ? (sequence.length - 1) : (index - 1);\n }\n\n /**\n * Return tuple of chained indexes\n * @param {Number} id\n * @return {Tuple}\n */\n function rangeChain (id) {\n var first = getChainIndexById(id, sequence);\n\n return [first, lastChain(first, sequence)];\n }\n\n /**\n * Get chain by index\n * @param {String} id\n * @param {Array} sequence\n */\n function getChainIndexById(id){\n return sequence.map(function(el){\n return el._id;\n }).indexOf(id);\n }\n\n //transition returns context in another object.\n //we must preserve existing object and make changes accordingly\n function updateContextAfterTransition(message){\n //inherit from coming message context\n Object.keys(message.context).reduce(function(context, name){\n if(name !== '_env') context[name] = message.context[name];\n return context;\n }, ctx);\n return message;\n }\n function handleRejectAfterTransition(message){\n return new Promise(function(resolve, reject){\n if(message.unhandledFail) return reject(message.data);\n resolve(message.data);\n })\n }\n\n function jump (range) {\n return function (data) {\n\n var msg = PromisePipe.createTransitionMessage(data, ctx, pipe._id, funcArr._id, sequence[range[1]]._id, ctx._pipecallId);\n\n var result = TransactionHandler.createTransaction(msg)\n .send(PromisePipe.envTransitions[ctx._env][funcArr._env])\n .then(updateContextAfterTransition)\n .then(handleRejectAfterTransition);\n\n return result;\n };\n }\n\n /**\n * Jump to next env\n * @return {Function}\n */\n function toNextEnv () {\n var range = rangeChain(funcArr._id, sequence);\n\n ctx._passChains = passChains(range[0], range[1]);\n\n if (!isValidTransition(funcArr, ctx)) {\n throw Error('there is no transition ' + ctx._env + ' to ' + funcArr._env);\n }\n\n return jump(range);\n }\n\n /**\n * Will we go to the next env\n */\n function goToNextEnv () {\n return ctx._env !== funcArr._env;\n }\n\n //it shows error in console and passes it down\n function errorEnhancer(data){\n //is plain Error and was not yet caught\n if(data instanceof Error && !data.caughtOnChainId){\n data.caughtOnChainId = funcArr._id;\n\n var trace = stackTrace({e: data});\n if(funcArr._name) {\n console.log('Failed inside ' + funcArr._name);\n }\n console.log(data.toString());\n console.log(trace.join('\\n'));\n }\n return Promise.reject(data);\n }\n\n /**\n * Skip this chain\n * @return {Function}\n */\n function toNextChain () {\n return function (data) {\n return data;\n };\n }\n\n /**\n * Check is skip chain\n * @return {Boolean}\n */\n function skipChain() {\n if (!ctx._passChains) {\n return false;\n }\n\n if (!!~ctx._passChains.indexOf(funcArr._id)) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Execute handler on correct env\n * @return {Function}\n */\n function doOnPropEnv () {\n\n var chain = Object.keys(systemEnvs).reduce(function (chain, name) {\n if (chain !== funcArr) {\n // fixed handler for current chain\n return chain;\n }\n if (systemEnvs[name].predicate(sequence, funcArr)) {\n return systemEnvs[name].handler(sequence, funcArr, funcIndex, ctx);\n }\n\n return chain;\n }, funcArr);\n\n if(chain == funcArr){\n\n if (goToNextEnv() && !skipChain()) {\n return toNextEnv();\n }\n\n if (goToNextEnv() && skipChain()) {\n return toNextChain();\n }\n }\n return chain;\n }\n\n if (funcArr && funcArr.isCatch) {\n return doWork.catch(funcArr);\n }\n\n return doWork.then(doOnPropEnv()).catch(errorEnhancer);\n }, Promise.resolve(data));\n }", "function multiFunction(options, done) {\n // iterate inputs\n // load input\n // print input as header (after load in case input provides a name)\n // iterate functions\n // thrash next function with input\n // print thrash result with function's name as tail\n // repeat until all functions are used with input\n // repeat until all inputs are used with all functions\n\n try { // catches require() error\n\n // TODO: accept return result to check if we had an error?\n iterateFns(options)\n\n done()\n\n } catch(error) {\n done(error)\n }\n\n}", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "function ex4_1() {\n console.log(\"A\");\n setImmediate(function() {\n console.log(\"B\");\n }, 0);\n setImmediate(function() {\n console.log(\"C\");\n }, 0);\n console.log(\"D\");\n} // output : A D B C", "step() { }", "function PromiseHelperV3() {\n var self = this;\n var p = PromiseHelperV3.prototype;\n self.starter = \"--\\t\\t\"\n self.debugName = self.starter + 'PromH'\n self.data = {}\n self.start = function start(arg1) {\n //var deferred = Q.defer();\n console.log('starting...')\n console.log('starting/', arg1)\n //deferred.resolve(arg1);\n //deferred.promise.fail(function (error) {\n //setTimeout( function wait500MsForLogToFlush() {\n /// self.proc(\"error occured: \" + error, JSON.stringify(error))//, error.stack);\n // }, 500)\n //console.error(\"error occured: \" + error);\n // })\n ///self.lastPromise = deferred.promise\n //return deferred.promise;\n setTimeout(self.startNextMethod, 10);\n }\n function defineTransportControlMethods() {\n self.startNextMethod = function () {\n if ( self.isPlaying == false ) {\n self.proc('double end call...')\n return;\n }\n self.currentOperation = self.methods.shift();\n if (self.currentOperation == null) {\n if (self.methods.length == 0) {\n if (self.token.name != null) {\n self.proc('***Chain Complete', self.token.name);\n } else {\n console.log('done'); //, self.token.name);\n }\n if ( self.token.fxDone != null ) {\n self.token.fxDone(self.token, self);\n }\n self.isPlaying = false;\n return;\n }\n setTimeout(self.startNextMethod, 10);\n return\n }\n\n var meth = self.currentOperation.fx;\n if ( self.currentOperation.fx == null ) {\n meth = self.currentOperation;\n }\n self.currentMethod = meth;\n //method is callled after chain is complete\n self.currentCallback = function currentCallback_onDoneMethod(token) {\n //self.showProgress();\n setTimeout(self.startNextMethod, 10);\n }\n\n var fxLinkFinishedCB = self.currentCallback;\n //REQ: support timeout delays\n /*\n var stillActive = false;\n setTimeout(function warnIfTooLong() {\n if ( stillActive== true) {\n console.warn('this method goes on for long time', self.currentOperation.fx.name)\n }\n },10*1000 );\n fxLinkFinishedCB = function endChain() {\n stillActive = false;\n sh.fxForward(self.currentCallback,arguments );\n }\n */\n self.cb = fxLinkFinishedCB\n self.next = fxLinkFinishedCB\n meth(self.token, fxLinkFinishedCB);\n\n }\n\n /**\n * Retry the previous method. (used when components are not ready)\n * @param delayTime\n */\n self.tryLater = function tryLater(delayTime) {\n self.methods.unshift(this.currentMethod);\n delayTime = sh.dv(delayTime, 500)\n setTimeout(self.startNextMethod, delayTime);\n }\n /**\n * simplify chaining\n * @param arg1\n * @returns {PromiseHelperV2}\n */\n self.startChain = function startChain(token, userSettings) {\n self.processSettings(userSettings)\n self.token = token;\n self.start(token);\n self.methods = []\n self.isPlaying = true;\n return self;\n }\n /**\n * Stop running this chain\n */\n self.stop = function stop() {\n self.methods = [];\n self.isPlaying = false;\n self.token = null; //overkill\n }\n }\n defineTransportControlMethods();\n\n /**\n * Mix in user settings.\n * @param userSettings\n * @returns {{}|*}\n */\n self.processSettings = function processSettings(userSettings) {\n self.defaultSettings = {}\n self.defaultSettings.addFailHandlerOnEnd = true\n self.defaultSettings.ignoreNull = true\n self.settings = self.defaultSettings;\n self.data = {}\n self.data.methods = {}\n self.data.methods.count = 0\n self.data.methods.currentIndex = 0\n return self.settings;\n }\n /**\n * Add method to work-chain\n * Method will be based 2 parameters,\n * token, and a callback\n * you must call the callback for the chain to proceed\n * @param fx\n * @returns {PromiseHelper}\n */\n self.add = function addNewFxToWorkChain(fx) {\n self.data.methods.count++\n self.methods.push({fx:fx, stack:sh.errors.storeError(6)})\n //self.lastAddition\n //self.lastPromise = self.lastPromise.then(self.w(fx))\n return self;\n }\n /**\n * Add method to work-chain at current step\n * Method will be based 2 parameters,\n * token, and a callback\n * you must call the callback for the chain to proceed\n * @param fx\n * @returns {PromiseHelper}\n */\n self.addNext = function addNext_NewFxToWorkChain(fx, offset) {\n self.data.methods.count++\n var method = {fx:fx, stack:sh.errors.storeError(6)}\n offset = sh.dv(offset,0);\n //self.data.offsetForAddNext++;\n //Remember: we remove method, so to add it next,\n //it goes to front of methods array\n self.methods.splice(offset, 0, method)\n return self;\n }\n //short for add Skip, stub does nothing\n self.addSkip = function addSkip(fx) {\n }\n self.addS = self.addSkip;\n self.sub = {}\n //alias to indicate substesps\n self.sub.add = self.add;\n /**\n * Add unwrapped method.\n * This is syncrhonous, no callback is passed\n * @param fx\n * @returns {PromiseHelper}\n */\n self.addSync = function addSync(fx) {\n self.data.methods.count++\n self.add(\n function rawWrapper (token, callback) {\n fx()\n callback(token)\n }\n )\n return self;\n }\n self.addRaw = self.addSync\n /**\n * Method indicates dev has completed adding methods to chain\n * @param fx\n * @returns {PromiseHelper}\n */\n self.end = function end(fx) {\n if ( self.settings.addFailHandlerOnEnd ) {\n self.failH = function (error) {\n self.proc(\"error occurred: \" + error);\n console.error(\"error occurred: \" + error);\n console.error(\"error occurred: \" + error.stack);\n } ;\n }\n self.addRaw(function () {\n console.log('finished.................', self.token.name, self.data.methods.count)\n });\n self.proc('added ', self.data.methods.count)\n return self;\n }\n self.showProgress = function showProgress() {\n var percentage = (self.data.methods.currentIndex/self.data.methods.count)\n percentage *= 100\n percentage = percentage.toFixed(2)\n percentage += '%'\n console.log(self.debugName, percentage)\n return\n self.proc('%',\n (percentage).toFixed(2), '%', self.data.methods.currentIndex, self.data.methods.count)\n return self;\n }\n\n// self.rawWrapper = function rawWrapper (token, callback) {\n// callback()\n// }\n self.fail = function fail(fx) {\n self.lastPromise = self.lastPromise.fail(fx)\n return self;\n }\n self.log = function log(arg1) {\n var deferred = Q.defer();\n //action(arg1, arg2, deferred.resolve);\n console.log('done...')\n console.log('log/', arg1)\n deferred.resolve(arg1);\n return deferred.promise;\n }\n self.log = function log(arg1) {\n self.add(function showToken(token, cb) {\n self.proc('log2', sh.toJSONString( self.token) )\n cb();\n })\n return self;\n }\n self.showToken = self.log\n// self.wrapMethod = function wrapMethod(fx) {\n// var wrapperFx = function autoGenWrapper(opts) {\n// var deferred = Q.defer();\n// fx(opts, deferred.resolve);\n// return deferred.promise;\n// }\n// return wrapperFx;\n// }\n self.wrapMethod = function wrapMethod(fx) {\n //this is for prototyping, devs may apply method placeholder\n //that do not exist\n if ( fx == null && self.defaultSettings.ignoreNull == true ) {\n return self.lastPromise;\n }\n var wrapperFx = function autoGenWrapper(token) {\n var deferred = Q.defer();\n function temp(token, resolve) {\n //console.log('-->', fx) //auto trace name\n //console.log('----------->')\n console.log()\n self.showProgress()\n self.data.methods.currentIndex++\n console.log(self.debugName, 'next method', fx.name)\n console.log()\n if ( token == null ) {\n //we used to show warnings\n //we have added token to self so if\n //user forgets to pass it to callback,\n // we will fix it ...\n if ( self.settings.showNullTokenWarnings ) {\n self.proc('token is null')\n }\n token = self.token;\n }\n fx(token, deferred.resolve);\n }\n function fxDone() {\n deferred.resolve(token) //auto commit token, and log\n }\n temp(token, fxDone);\n return deferred.promise;\n }\n return wrapperFx;\n }\n self.w = self.wrapMethod;\n //predefined helper methods to simpslify chain config\n self.utils = {}\n function utilsMethods() {\n self.utils.wait10Secs = function wait10Secs(token, callback) {\n if (self.wait == false) {\n callback(token)\n return\n }\n setTimeout(function wait10() {\n callback(token)\n }, 10 * 1000)\n var count = 10;\n var totalTime = 10000\n for (var i = 0; i < count; i++) {\n var time = i * 1000\n setTimeout(function tellTime(time) {\n console.log((totalTime - time) + '...')\n }, time, time)\n }\n }\n self.utils.wait3Secs = function wait3Secs(token, callback) {\n setTimeout(function wait3() {\n callback(token)\n }, 3 * 1000)\n }\n self.utils.wait = function wait(duration, addToChain) {\n if (duration == null ) {\n duration = 3;\n }\n var fxDelay = function instantWait(token, cb){\n setTimeout(function wait3() {\n cb(token)\n }, duration * 1000)\n }\n if ( addToChain != false ) {\n self.add(fxDelay);\n } else {\n return fxDelay;\n }\n }\n }\n utilsMethods();\n\n self.demo = {}\n self.demo.exampleUsage = function exampleUsage() {\n log(data)\n /*\n .then(pb.searchForTorrent)\n .then(log)\n .then(pb.getFirstQueryResult)\n .then(log)\n .then(pb.convertMagnetLinkToTorrent)\n .then(log)\n */\n //cleanup existing files beforehand(or after)\n .then(wrapMethod(pb.putIORemoveFiles))\n .then(log)\n }\n\n self.demo.exampleInnerFx = function exampleInnerFx(opts, callback) {\n callback(opts)\n }\n\n p.proc = function proc() {\n sh.sLog(arguments)\n }\n\n}", "doDemo()\n {\n let me = this;\n this.testData.reduce((previous, current, index, array) => {\n return previous // initiates the promise chain\n .then(()=>{\n return this.getScores(current.type,current.userId,this.mainObject)\n }) //adds .then() promise for each item\n }, Promise.resolve()).then(() =>\n {\n this.stepCallBack({state: 'COMPLETE',message: JSON.stringify(this.mainObject)})\n })\n }", "function run (fun1) {\n fun1()\n}", "function inparallel(parallel_functions, final_function) {\n n = parallel_functions.length;\n for(i = 0; i < n; ++i) {\n parallel_functions[i](function() {\n n--;\n if(n == 0) { \n final_function();\n } \n });\n }\n}", "function addOrUpdateService(request, reply) {\n // var _addUpdateUserId = 1; //get from token\n if (metadatafile.saveMetadata(request.payload.metadata)) {\n var _msg;\nasync.waterfall([\n function(callback){\n userModel.getUserIdByEmail(request.auth.credentials.email, function(err, res) {\n if (err) {\n callback(err, null);\n return;\n }\n callback(null, res);\n });\n }], function(err, result) {\n if (err) {\n sendResponse(\"something wrong.\",0,request, reply, err);\n }\n else{\n var updatedByUserId=result;\n async.series([\n function addupdateService(callback) {\n if (request.payload.actionType.toUpperCase() === 'ADD') {\n\n async.waterfall([\n function checkServiceExist(callback) {\n serviceModel.find_serive_by_name(request.payload, function(err, result) {\n callback(null, result);\n });\n }\n ], function(err, result) {\n if (result.length > 0) {\n sendResponse(\"service already exist\", 0, request, reply, \"\");\n } else {\n serviceModel.add_service(request.payload, updatedByUserId, function(err, res) {\n\n if (err) {\n callback(err, null);\n //return;\n }\n _msg = \"data has been saved successfully.\"\n callback(null, res);\n });\n }\n\n });\n\n } else if (request.payload.actionType.toUpperCase() === 'UPDATE') {\n async.waterfall([\n function checkServiceExist(callback) {\n serviceModel.find_serive_by_name_and_id(request.payload, function(err, result) {\n callback(null, result);\n });\n\n }\n ], function(err, result) {\n if (result.length > 0) {\n serviceModel.update_service(request.payload, updatedByUserId, function(err, res) {\n\n if (err) {\n callback(err, null);\n //return;\n }\n\n _msg = \"data has been updated successfully.\"\n callback(null, res);\n });\n }\n else\n {\n sendResponse(\"service does not exist\", 0, request, reply, \"\");\n }\n });\n }\n }\n ], function(err, result) {\n if (err) {\n sendResponse(\"data not saved.\", 0, request, reply, \"\");\n }\n sendResponse(_msg, 200, request, reply, result[0]);\n });\n }\n });\n\n\n } else {\n sendResponse(\"metadata not saved.\", 0, request, reply, \"\");\n }\n}", "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "wrapSteps () {\n const wrapStepSync = this.wrapStepSync\n const wrapStepAsync = this.wrapStepAsync\n\n Cucumber.setDefinitionFunctionWrapper((fn, options = {}) => {\n const retryTest = isFinite(options.retry) ? parseInt(options.retry, 10) : 0\n return fn.name === 'async' || !hasWdioSyncSupport\n ? wrapStepAsync(fn, retryTest)\n /* istanbul ignore next */\n : wrapStepSync(fn, retryTest)\n })\n }", "async function fn() {\n let content = await frP;\n console.log(\"content->\" + content);\n console.log(\"F2 read sent\");\n let f2rp = fs.promises.readFile(\"../f2.txt\");\n content = await f2rp\n console.log(\"content->\" + content);\n let f3rp = fs.promises.readFile(\"../f3.txt\");\n content = await f3rp;\n console.log(\"content->\" + content);\n // start next task\n console.log(\"All Task completed\");\n}", "function module2(userid_data, connection, callback) {\n async.waterfall([\n // Select from userid table (returns result)\n function select_userid(wcb) {\n if (userid_data) {\n console.log('Passed userid table data')\n wcb(null, userid_data)\n } else {\n const cols = comma(relevant_fields)\n const select_query = 'SELECT ' + cols + ', hash FROM ' + userid_table + ' GROUP BY ' + cols + ', hash'\n \n connection.query(select_query, (err, result, fields) => {\n if (err) {\n console.log('Error at select_uuid().')\n wcb(err)\n } else {\n console.log('Finished select userid: found ' + result.length + ' unique errors.') \n wcb(null, result)\n }\n })\n }\n },\n // Sort into seen and new using preclusters rows (returns _new)\n function sort_precluster(precluster_data, wcb) {\n const hash_select = 'SELECT hash FROM ' + master_precluster_table\n\n async.map(precluster_data, \n (datum, map_callback) => {\n let hash_query = hash_select + ' WHERE hash=\\'' + datum['hash'] + '\\''\n connection.query(hash_query, (err, result) => {\n if (err) {\n map_callback(err)\n } else {\n if (Array.isArray(result) && result.length) \n map_callback(null)\n else\n map_callback(null, datum)\n }\n })\n },\n (err, result) => {\n if (err) {\n console.log('Error at sort_precluster().')\n wcb(err)\n } else {\n const _new = result.filter((value, index, arr) => {\n return value !== undefined\n })\n console.log('Finished sorting precluster errors: found ' + _new.length + ' new errors.')\n wcb(null, _new)\n }\n })\n },\n // Submodule 2: insert precluster, flask convert, write flask (result = [null, flasked], returns flasked)\n function submodule2(_new, wcb) {\n async.parallel([\n // Insert _new into master_precluster (returns null)\n function insert_precluster(sm2_pcb) {\n if (_new && _new.length) {\n const error_keys = ['message', 'hash']\n const to_insert = []\n for (error of _new) {\n const error_values = {}\n for (key of error_keys) {\n error_values[key] = error[key]\n }\n to_insert.push(error_values)\n }\n\n insert_table(to_insert, master_precluster_table, connection, undefined, undefined, (err) => {\n if (err) {\n console.log('Error at insert precluster.')\n sm2_pcb(err)\n } else {\n console.log('Finished inserting new errors into ' + master_precluster_table + '.')\n sm2_pcb(null)\n }\n })\n } else {\n console.log('Finished inserting new errors into ' + master_precluster_table + ' (none found)')\n sm2_pcb(null)\n }\n },\n // Submodule 2a: flask convert, write flask (returns flasked)\n function submodule2a(sm2_pcb) {\n async.waterfall([\n // Send data to Flask server (returns flasked)\n function flask(sm2a_wcb) {\n const startFlask = new Date()\n const messages = []\n for (datum of _new) {\n let temp = {}\n temp['message'] = datum['message']\n messages.push(temp)\n }\n\n console.log('Converted data for flask: Collected ' + messages.length + ' messages.')\n\n flask_convert(messages, (err, body) => {\n if (err) {\n console.log('Error at flask service.')\n sm2a_wcb(err)\n } else {\n const endFlask = new Date()\n const execFlask = time_string(endFlask - startFlask)\n console.log('FLASK EXECUTION TIME: ' + execFlask)\n \n const flasked = []\n let length = body.length\n console.log('Received ' + body.length + ' essences.')\n for (let i = 0; i < length; i ++) {\n if (body[i]['essence'] !== 'TRUNCATED' && body[i]['essence'] !== '') {\n _new[i]['essence'] = body[i]['essence']\n flasked.push(_new[i])\n }\n }\n console.log('Found ' + flasked.length + ' untruncated errors.')\n sm2a_wcb(null, flasked)\n }\n })\n },\n // Write results to postflask.csv (returns flasked)\n function write_flask(flasked, sm2a_wcb) {\n const csvWriter = csv_writer({\n path: __dirname + '/postflask.csv',\n header: [\n {id: 'application', title: 'application'},\n {id: 'code', title: 'code'},\n {id: 'message', title: 'message'},\n {id: 'essence', title: 'essence'},\n {id: 'hash', title: 'hash'}\n ]\n })\n \n csvWriter.writeRecords(flasked)\n .catch((err) => {\n console.log('Error writing: postflask.csv')\n sm2a_wcb(err)\n })\n .then(() => {\n console.log('Finished writing: postflask.csv')\n sm2a_wcb(null, flasked)\n })\n }\n ], \n function (err, flasked) {\n if (err) {\n sm2_pcb(err)\n } else {\n sm2_pcb(null, flasked)\n }\n })\n }\n ], \n function (err, result) {\n if (err) {\n wcb(err)\n } else {\n wcb(null, result[1])\n }\n })\n }\n ],\n function (err, result) {\n if (err) {\n callback(err)\n } else {\n module3(result, connection, callback)\n } \n })\n\n}", "function f1(){\n var i=0;\n\n function f2(){\n i++;\n console.log(i);\n }\n\n function f3(){\n i--;\n console.log(i);\n }\n\n f2();f2();f2();\n \n f3(); f3(); f2();\n}", "function buildFunctions2() {\r\n \r\n var arr = [];\r\n \r\n for (var i = 0; i < 3; i++) {\r\n // Push the RESULT of the EXECUTING function, and executing the function returns us ANOTHER function\r\n arr.push(\r\n (function(j) { // This is an IIFE, peep the paranthesis, *invoked* every time the loop iterates creating a new execution context\r\n return function() { // This part is still only CREATED and stored into the array\r\n console.log(j); \r\n }\r\n }(i)); // **Passing i, every time the loop runs, the function is EXECUTED (IIFE) instead of just created like earlier\r\n )\r\n \r\n }\r\n \r\n return arr;\r\n}", "function BuildFunctions2() {\n var arr = [];\n for (var i = 0; i < 3; i++) {\n arr.push(\n function(j) {\n return function() {\n console.log(j);\n }\n }(i))\n //immediately invoke the function with an argument of i in parameter j. j will store whatever i it sees in the loop at that moment. so 0 1 2 logged.\n }\n return arr;\n}", "function ejecutar(){\n Concurrent.Thread.create(caballo,\"inputCaballo1\",\"metrosRecorridos1\",100000);\n Concurrent.Thread.create(caballo,\"inputCaballo2\",\"metrosRecorridos2\",100000);\n Concurrent.Thread.create(caballo,\"inputCaballo3\",\"metrosRecorridos3\",100000);\n }", "function Synchronized () {}", "function Synchronized () {}", "function Synchronized () {}", "function buku(){\r\n\treadBooksPromise(10000,books[0])\r\n\t.then(readBooksPromise(setTimeout, books[1]))\r\n\t.then(readBooksPromise(setTimeout, books[2]))\r\n}", "async function getData() {\n let data = await getUsername1()\n data = await getAge1(data)\n data = await getDepartment1(data)\n data = await printDetails1(data)\n}", "function setup() {\n delayES8(5000, 6000)\n .then(() => console.log('finished 1')) //will return after 3 seconds\n}", "function getRecipe() {\n\n \tsetTimeout(()=>{ //1st callback for getting all the ids\n\t\tconst recipeId=[2,4,6,8];\n\t\tconsole.log(recipeId); //to print all the recipe ids\n\n\t\tsetTimeout((id)=>{ //2nd callback to get the recipe of a particular id(done after the 1st callback)\n\t\t\tconst recipe={title:'pasta' , publisher:'Jonas'};\n\t\t\tconsole.log(`${id}: ${recipe.title}`);\n\n\t\t\tsetTimeout((publisher)=>{ //3rd callback to get a recipe of a particular publisher\n\t\t\t\tconst recipe2={title:'Pizza' ,publisher:'Jonas'};\n\t\t\t\tconsole.log(recipe2);\n\t\t\t},1500,recipe.publisher); //3rd callback ends\n\n\t\t},1500,recipeId[2]); //2nd callback ends\n\n\t},1500); //1st callback ends\n}" ]
[ "0.62581563", "0.60704714", "0.6002653", "0.59502167", "0.5950089", "0.59460443", "0.5940863", "0.59010917", "0.5874552", "0.5824157", "0.5800918", "0.5799899", "0.57769054", "0.5767607", "0.57646465", "0.57551473", "0.57367325", "0.57189244", "0.5712297", "0.5700772", "0.5661009", "0.5583637", "0.5573803", "0.5555307", "0.5553803", "0.5540797", "0.5539594", "0.5536918", "0.55289716", "0.5524346", "0.55231744", "0.5521514", "0.550984", "0.5506862", "0.5499137", "0.54973584", "0.5490882", "0.548933", "0.5474399", "0.547255", "0.5470859", "0.54589564", "0.54556817", "0.54528725", "0.5452763", "0.544697", "0.54418653", "0.5438572", "0.5429945", "0.54243004", "0.54212826", "0.54179424", "0.54097843", "0.5408913", "0.5397189", "0.5393768", "0.5389193", "0.5389193", "0.5389193", "0.5382789", "0.53770894", "0.5371733", "0.5370303", "0.5369961", "0.53696334", "0.5363425", "0.5352192", "0.5351573", "0.53339434", "0.53242", "0.53235936", "0.5321598", "0.53131056", "0.5304213", "0.5303288", "0.5295655", "0.5286443", "0.52809083", "0.5276344", "0.52756405", "0.5272762", "0.5271741", "0.527133", "0.5269419", "0.5269121", "0.52616835", "0.52614367", "0.52603954", "0.5258518", "0.5255824", "0.52548134", "0.5254812", "0.5253695", "0.52522075", "0.52505136", "0.52505136", "0.52505136", "0.5241811", "0.52408874", "0.5240557", "0.5239565" ]
0.0
-1
step 3: Now you can call the async function anywhere you like for the example I called it in one of the controller methods that gets by the REST Calls mainFunc(userInput, req, res, next); Async / Await examples Reference1 :::
async function asyncAwait() { var aVal = null; try { const first = await promiseFunc(aVal); console.log(first); const second = await promiseFunc(first); console.log(second); const third = await promiseFunc(second); console.log(third); aVal = third; console.log(aVal); } catch (e) { console("Error"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function main() {\n\n getUser(\"test1\");\n\n}", "async function fetchUser() {\n return \"abc\";\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "async function updateTheUserTwiceProd() {\n\n let userEmail = await getEmailFromDb('admin')\n let updateWorked = await updateUserBasedOnEmail(userEmail)\n updateWorked = await updateUserBasedOnEmail(userEmail)\n //await myBusinessLogic(username)\n\n // do some stuff\n\n return 'aukfhuseifh'\n}", "async function MyAsyncFn () {}", "async method(){}", "async function main() {\n const userInfo = await getUserInfo('12');\n console.log(userInfo);\n\n const userAddress = await getUserAddress('12');\n console.log(userAddress);\n\n console.log('ceva4');\n}", "function asyncHandler(cb) {\n\treturn async (req,res,next) => {\n\t\ttry {\n\t\t\tawait cb(req,res,next);\n\t\t} catch(err) {\n\t\t\tres.render('error', {error: err} );\n\t\t}\n\t}\n}", "async function middleware (ctx, next) {\n\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n next(error);\n }\n }\n}", "async function myFunc() {\n // Function body here\n }", "async function main() {\n try {\n const user = await getUser();\n const status = await login(user)\n const page = await showPage(status);\n console.log(user, status, page)\n }\n catch (err) {\n console.log(err)\n }\n}", "async function asyncFn(){\n\n return 1;\n}", "async function test() {}", "async function AppelApi(parfunc=api_tan.GenericAsync(api_tan.getTanStations(47.2133057,-1.5604042)),\nretour=function(par){console.log(\"demo :\" + JSON.stringify(par))}) {\n let demo = await parfunc \n retour(demo);\n // console.log(\"demo : \" + JSON.stringify(demo));\n}", "async function asyncAddCourseSubController(userInput, req, res, next) {\n const query = await checkCourseExistDuringSemester(userInput, req, res, next);\n // console.log(query);\n // console.log(typeof query);\n // let queryObj = JSON.parse(query);\n console.log(query);\n let queryObj = query;\n // return.length -- works for findall() because return is an array\n console.log(queryObj.length);\n // return[object.termCode] -- works for findOne() because return is a JSON object\n console.log(queryObj.object.termCode);\n console.log(queryObj[\"object\"][\"termCode\"]);\n\n}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n res.status(500).send(error);\n }\n }\n }", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "function asyncHandler(cb) {\n\treturn async (req, res, next) => {\n\t\ttry {\n\t\t\tawait cb(req, res, next);\n\t\t} catch (error) {\n\t\t\tres.status(500).send(error);\n\t\t}\n\t};\n}", "function asyncHandler(cb) {\n\treturn async (req, res, next) => {\n\t\ttry {\n\t\t\tawait cb(req, res, next);\n\t\t} catch (error) {\n\t\t\tres.status(500).send(error);\n\t\t}\n\t};\n}", "function asyncHandler(cb) {\n return async(req, res, next) => {\n try{\n await cb(req, res, next)\n } catch(error){\n return next();\n }\n }\n}", "async function helloCatAsync(callback) {\n console.log(\"2. callback here is the function passed as argument above...\")\n // 3. Start async operation:\n setTimeout(function () {\n console.log(\"3. start async operation...\");\n console.log(\"4. finished async operation, calling the callback, passing the result...\");\n // 4. Finished async operation,\n // call the callback passing the result as argument\n await callback('Nya');\n }, Math.random() * 2000);\n}", "function async_io_normal(cb) {\n\n}", "async function myRequest(){\n const result = await firstFunc()\n console.log(\"testing\")\n const fullResult = await secondFunc(result)\n console.log(fullResult)\n}", "async function adminAmountofUsers(req,res){\n var amountUsers = await Promise.resolve(functionPost.adminAmountUsers());\n app.adminGetAmountUsers(req,res,amountUsers);\n res.redirect(\"/amountUsers\")\n}", "async function testAddUser() {\n var result = await addUser('Z0CI');\n console.log(result);\n}", "async function displayUser(){\n //Rather than chaining our code we can use function expressions with await keyword in front\n const currentUser = await loginUser('[email protected]', 1234); //keyword await keeps track of every function\n const emails = await getUserEmails(currentUser.userEmail); //and we can move to the next line once the results are back\n const emailDetails = await emailDetails(emails[0]); //ensure you include the async keyword in front of the function\n console.log(emailDetails);\n}", "async function getAuthorList(request,response){\n\n //user logic to get user data\n let authors=await authorService.getAll(); //user logic\n //express sends JSON response directly to the client\n await response.send(authors); \n}", "async function fetchUser() {\n // do network reqeust in 10 secs....\n return 'ellie';\n}", "static async method(){}", "static async getUser(username) {\n let res = await this.request(`users/${username}`)\n console.log(`frontEnd getUser response`, res)\n return res;\n }", "async function makerequest() {\r\n \r\n}", "async function miFuncionConPromesa ()\r\n{\r\n return 'saludos con promesa y async';\r\n}", "async function submit(){\n \n // pull in values form the user inputs on the webpage\n getUserInput()\n \n // get the location data\n \n let data = await getData(geoURL)\n \n postData('/getLatLon', data);\n // let x = await postData('/getLatLon', data);\n // console.log(x) \n\n // update user interface with another async call\n // updateUI();\n \n // let imData = await getImage()\n await getImage()\n\n await getWeatBit()\n \n await getCountry()\n\n await updateUI()\n\n}", "async function myFunc() {\n return 'Hello';\n}", "async function fetchUser() {\r\n // do network request in 10 secs....\r\n return 'ellie';\r\n}", "async function miFuncionConPromesa(){\n return \"Saludos con promeso y async\";\n}", "async function getTodoListController(req, res) {\n\n\n let todoList = await model.getTodoListModel()\n\n res.json(todoList)\n}", "async function getuser(){\n //return user;\n return db;\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n // Forward error to the global error handler\n next(error);\n }\n }\n }", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n res.status(500).send(error);\n }\n }\n}", "function asyncHandler(cb) {\n return async (req, res, next) => {\n try {\n await cb(req, res, next)\n } catch (error) {\n console.log(error);\n res.status(500).send(error);\n }\n }\n}", "async function myAsyncFunction(arg) {\n return `Your argument is: ${arg}`\n}", "function asynch_func() {\n // console.log(req.responseText)\n if (req.status >= 200 && req.status < 400) {\n let res_JSON = JSON.parse(req.responseText);\n console.log(res_JSON.args);\n res_span.textContent = \"(*For Grader this message will dissapear in 10 sec) The response we got from our GET Request from https://httpbin.org/get is: \" + JSON.stringify(res_JSON.args)\n } else {\n console.log(\"Error: \" + req.statusText);\n res_span.textContent = req.statusText;\n }\n }", "function addOrUpdateService(request, reply) {\n // var _addUpdateUserId = 1; //get from token\n if (metadatafile.saveMetadata(request.payload.metadata)) {\n var _msg;\nasync.waterfall([\n function(callback){\n userModel.getUserIdByEmail(request.auth.credentials.email, function(err, res) {\n if (err) {\n callback(err, null);\n return;\n }\n callback(null, res);\n });\n }], function(err, result) {\n if (err) {\n sendResponse(\"something wrong.\",0,request, reply, err);\n }\n else{\n var updatedByUserId=result;\n async.series([\n function addupdateService(callback) {\n if (request.payload.actionType.toUpperCase() === 'ADD') {\n\n async.waterfall([\n function checkServiceExist(callback) {\n serviceModel.find_serive_by_name(request.payload, function(err, result) {\n callback(null, result);\n });\n }\n ], function(err, result) {\n if (result.length > 0) {\n sendResponse(\"service already exist\", 0, request, reply, \"\");\n } else {\n serviceModel.add_service(request.payload, updatedByUserId, function(err, res) {\n\n if (err) {\n callback(err, null);\n //return;\n }\n _msg = \"data has been saved successfully.\"\n callback(null, res);\n });\n }\n\n });\n\n } else if (request.payload.actionType.toUpperCase() === 'UPDATE') {\n async.waterfall([\n function checkServiceExist(callback) {\n serviceModel.find_serive_by_name_and_id(request.payload, function(err, result) {\n callback(null, result);\n });\n\n }\n ], function(err, result) {\n if (result.length > 0) {\n serviceModel.update_service(request.payload, updatedByUserId, function(err, res) {\n\n if (err) {\n callback(err, null);\n //return;\n }\n\n _msg = \"data has been updated successfully.\"\n callback(null, res);\n });\n }\n else\n {\n sendResponse(\"service does not exist\", 0, request, reply, \"\");\n }\n });\n }\n }\n ], function(err, result) {\n if (err) {\n sendResponse(\"data not saved.\", 0, request, reply, \"\");\n }\n sendResponse(_msg, 200, request, reply, result[0]);\n });\n }\n });\n\n\n } else {\n sendResponse(\"metadata not saved.\", 0, request, reply, \"\");\n }\n}", "async function doWork() {\n const response = await makeRequest('osu');\n console.log('response received')\n const finalResponse = await addSomething(response);\n console.log(finalResponse);\n\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n res.status(500).send(error);\n }\n }\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n // Forward error to the global error handler\n next(error);\n }\n }\n }", "async function fetchUser() {\n // do network request in 10 secs..\n return 'yuna';\n}", "async function updateDB(){\n // try async update DB\n try{\n console.log(\"async update started\");\n model.updateUserInfo(101,\"usr_type\",\"elder\");\n console.log(\"*** this line will display first before the update completed\");\n\n }catch(err){\n console.log(\"err \",err );\n }\n}", "async function updateDB(){\n // try async update DB\n try{\n console.log(\"async update started\");\n model.updateUserInfo(101,\"usr_type\",\"elder\");\n console.log(\"*** this line will display first before the update completed\");\n\n }catch(err){\n console.log(\"err \",err );\n }\n}", "addUser(req,res,next){\n async.parallel({\n hash: async.apply(bcrypt.hash, req.body.Password_Text, saltRounds) \n },function(err,results){\n console.log(results);\n req.body.Password_Text= checkInput.checkText(results[\"hash\"])\n airtable.createRecord(\"ii_user\",req.body,function(err,new_record){\n /* res.redirect('/teams/edit/'+id); */\n if(err) throw err;\n req.params.id= new_record;\n next();\n });\n });\n }", "async function main() {\n const mysql = require('mysql2/promise');\n const pool = mysql.createPool({\n host: process.env.MYSQL_HOST || 'localhost', \n database: process.env.MYSQL_DB || 'test',\n user: process.env.MYSQL_USER || 'root', \n password: process.env.MYSQL_PASSWORD\n });\n\n app.use('/api/user/', require('./routes/user')(pool))\n app.use('/api/sessions', require('./routes/sessions')(pool))\n app.use('/api/campaigns', require('./routes/campaigns')(pool))\n app.use('/api/top', require('./routes/top')(pool))\n app.use('/api/', require('./routes/misc')(pool))\n \n app.get('*',(req,res) => {\n res.status(404).json({error:'PageNotFound'})\n })\n}", "function someAsyncApiCall(callback) { callback(); }", "async function index(req, res) {}", "async function getRecipeAW() { // the function always return a Promises\n //the await will stop executing the code at this point until the Promises is full filled\n // the await can be used in only async function\n const id = await getID;\n console.log(id)\n console.log('here 2');\n const recipe = await getRecipe(id[1]);\n console.log(recipe);\n const related = await getRelated('Publisher');\n console.log(related);\n\n return recipe;\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try{\n await cb(req, res, next)\n } catch(error){\n //res.status(500).send(error);\n next(error);\n }\n }\n}", "function getUserFromDatabase(callbackFunction) {\n // does some async processing\n callbackFunction('Brad Stell')\n}", "AsyncProcessResponse() {\n\n }", "async function requestHandler(req, res) {\n try {\n const user = await User.findById(req.userId)\n const tasks = await Task.findById(user.tasksId)\n tasks.completed = true\n await tasks.save()\n res.send('Task completed')\n } catch (error) {\n res.send(error)\n }\n}", "function asyncHandler(cb) {\n return async (req, res, next) => {\n try {\n await cb(req, res, next)\n } catch (error) {\n if (error.name === 'SequelizeValidationError') {\n const errors = error.errors.map(err => err.message);\n res.status(400).json(errors);\n } else {\n return next(error) \n } \n }\n }\n}", "async function insertSingleUserData(req, res) {\n let name = req.body.username;\n let email = req.body.email;\n let address = req.body.address;\n // GET data from BODY object\n // INSERT data in user table\n model.insertUserData(name, email, address).then(function(result) {\n console.log(result)\n // Send successfully reponse\n res.jsonp({\n status: true,\n message: \"SuccessFullay data saved in DB\",\n data: result\n });\n }, function(err) {\n console.log(err);\n // IF some Error Occur Send Failure reponse\n res.jsonp({\n status: false,\n message: \"Error while saving the data\",\n data: err\n });\n })\n}", "function runAsyncWrapper(callback) {\n\t/*\n return async (req, res, next) => {\n callback(req, res, next).catch(next);\n }\n */\n\treturn async (req, res, next) => {\n\t\ttry {\n\t\t\tawait callback(req, res, next);\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t\tres.send({ success: false, message: \"Error with asynchronous registration.\" });\n\t\t\tnext(err);\n\t\t}\n\t};\n}", "async function dowork() {\n try {\n const response = await makeReques('Google');\n console.log('response received');\n const processingResponse = await processRequest(response);\n console.log(processingResponse);\n\n }\n catch (err) {\n console.log(err);\n }\n}", "async function main() {\n const User = require('./src/models/User');\n const db = require('./src/db/Database');\n const me = new User({name: 'Aleksandar', dateOfBirth: 1993});\n // await db.create(me);\n // const readUser = await db.findUser(1603392402201);\n // console.log(readUser);\n\n}", "function call(req, res) {\n // estatutos...\n}", "async function signup(req, res,name,email,password) {\n try{\n const returnSignup = await authenticationServices.signup(req,res,name,email,password);\n return returnSignup;\n }catch(error)\n {\n res.render('Error.ejs'); \n }\n \n}", "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function getData() {\n let data = await getUsername1()\n data = await getAge1(data)\n data = await getDepartment1(data)\n data = await printDetails1(data)\n}", "async fetchUser(){\n\t\treturn res.status(200).send({\n\t\t\tmessage: 'Successful Operation',\n\t\t\tuser: req.user\n\t\t})\n\t}", "function asyncHandler(cb) {\n return async (req, res, next) => {\n try {\n await cb(req, res, next);\n } catch (error) {\n res.status(500).send(error);\n }\n };\n}", "function asyncHandler(cb) {\n return async (req, res, next) => {\n try {\n await cb(req, res, next);\n } catch (error) {\n res.status(500).send(error);\n }\n }\n}", "function asyncHandler(cb) {\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(err) {\n res.status(500).send(err);\n }\n }\n}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(err){\n err = new Error()\n err.status = 500;\n err.message = \"Oh No! The book you are looking for does not exist\"\n next(err)\n }\n }\n}", "function requestHandler(req, res) {\n User.findById(req.userId, function(err, user) {\n if (err) {\n res.send(err)\n } else {\n Tasks.findById(user.tasksId, function(err, tasks) {\n if (err) {\n return res.send(err)\n } else {\n tasks.completed = true\n tasks.save(function(err) {\n if (err) {\n return res.send(err)\n } else {\n res.send('Task completed')\n }\n })\n }\n })\n }\n })\n}", "function requestHandler(req, res) {\n User.findById(req.userId)\n .then(function(user) {\n return Tasks.findById(user.tasksId)\n })\n .then(function(tasks) {\n tasks.completed = true\n return tasks.save()\n })\n .then(function() {\n res.send('Task completed')\n })\n .catch(function(errors) {\n res.send(errors)\n //*the same errors we used for all callbacks !!\n })\n}", "async runTest() {}", "function asyncHandler(cb){\n return async(req, res, next) => {\n try {\n await cb(req, res, next)\n } catch(error){\n // Forward error to the global error handler\n next(error);\n }\n }\n}", "async function callSendTransactionApi(asyncFunc, config) {\n let funcResult;\n\n try {\n\n if (!utils.isDev) {\n const unlockRes = await callAsyncFunc(web3.personal, 'unlockAccount', config.ACCOUNT_ADDRESS, config.ACCOUNT_PASSWORD);\n if (!unlockRes.result) {\n throw new Error(`error unlocking account: ${config.ACCOUNT_ADDRESS}`);\n }\n }\n\n // get balance\n console.log('config.ACCOUNT_ADDRESS', config);\n const balanceRes = await callAsyncFunc(web3.eth, 'getBalance', config.ACCOUNT_ADDRESS);\n const balanceInWei = balanceRes.result;\n\n // call the actual function\n funcResult = await asyncFunc(balanceInWei);\n\n if (!utils.isDev) {\n const lockRes = await callAsyncFunc(web3.personal, 'lockAccount', config.ACCOUNT_ADDRESS, config.ACCOUNT_PASSWORD);\n if (!lockRes) {\n throw new Error(`error locking account: ${config.ACCOUNT_ADDRESS}`);\n }\n }\n\n }\n catch(err) {\n console.log(err);\n console.error(`error invoking a callSendTransactionApi: ${err.message}`);\n throw err;\n }\n\n return funcResult;\n}", "async function adminAmountofMatches(req,res){\n var amountMatches = await Promise.resolve(functionPost.adminAmountMatches());\n\n app.adminGetAmountMatches(req,res,amountMatches);\n\n res.redirect(\"/amountMatches\");\n\n\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}", "async function asynFunc() {\r\n await createPost(\"title#3\", \"body#3\");\r\n getPosts();\r\n}", "async function fetchUser (){\r\n // do network request in 10seconds...\r\n\r\n return 'kiseo';\r\n}", "function asyncHandler(cb) {\n return async (req, res, next) => {\n try {\n await cb(req, res, next);\n } catch (error) {\n // Forward error to the global error handler\n next(error);\n }\n }\n}", "async function asyncFn() {\n return value;\n }", "async function asyncFn() {\n return value;\n }", "async function greet() {\n return 'HELLO!!!'\n}", "async function asyncCall() {\n if (cart.length > 0) {\n var cartItem = cart;\n //console.log(cartItem)\n for (var i = 0; i < cartItem.length; i++) {\n var sql = \"spSetSalInvoiceItem \" + reqBody.InvoiceItemID + \",\" + InvoiceID + \",\" + parseInt(cartItem[i].itemID) + \",\" + parseInt(cartItem[i].colorID) + \",\" + parseInt(cartItem[i].sizeID) + \",\" + cartItem[i].product_price + \",\" + cartItem[i].qty + \",\" + 0 + \",\" + 0 + \",\" + 0 + \",\" + 0 + \",\" + 0 + \",\" + reqBody.IsApproved + \",\" + reqBody.IsActive + \",\" + reqBody.IsDelivered + \",\" + reqBody.CompanyID + \",\" + reqBody.LoggedUserID + \", '\" + IpAddress.IP + \"', \" + reqBody.IsDeleted + \"\";\n //console.log(sql + \"This is spSetSalInvoiceItem\");\n\n var detailDelay = await Delay();\n db.executeSql(sql, function (data, err) {\n if (err) {\n throw err;\n } else {\n console.log(\"Order Details Posted\");\n }\n //res.end();\n });\n }\n }\n\n var sql = \"getSalInvoiceMasterByInvoiceID \" + InvoiceID + \" \";\n //console.log(sql + \"This is getSalInvoiceMasterByInvoiceID\");\n db.executeSql(sql, function (data, err) {\n if (err) {\n throw err;\n } else {\n var result = data.recordset[0]['JSON_F52E2B61-18A1-11d1-B105-00805F49916B'];\n console.log(result);\n if (result.length == 0) {\n result = \"[]\";\n res.send(result);\n console.log(result);\n //console.log(\"result \");\n } else {\n res.send(data.recordset[0]['JSON_F52E2B61-18A1-11d1-B105-00805F49916B']);\n }\n }\n\n });\n\n }", "function asyncRouteHandler(handle){\n return async (request,response,next)=>{\n try {\n await handle(request,response);\n } catch (error) {\n next(error);\n }\n };\n}", "run (req, res, next) {}", "async function auth_func (cb) {\n // let auth0 = await createAuth0Client(auth)\n\n // if (Array.isArray(cb)) cb.forEach(func => func(auth0))\n\n // else cb(auth0)\n}", "async function translate(file_path, book_id, trans_langs) {\n var arguments = [];\n arguments.push(file_path);\n arguments.push(book_id);\n for (var i = 0; i < trans_langs.length; i++) {\n arguments.push(trans_langs[i]);\n }\n console.log(arguments);\n let options = {\n mode: \"text\",\n executable: \"python3.9\",\n pythonOptions: [\"-u\"], // get print results in real-time\n scriptPath:\n \"./public/translation\",\n args: arguments, //An argument which can be accessed in the script using sys.argv[1]\n };\n console.log(\"entered the async\")\n try{\n await PythonShell.run(\n \"ParseAndTranslate.py\",\n options,\n function (err, result) {\n if (err) throw err;\n //result is an array consisting of messages collected\n //during execution of script.\n console.log(\"result: \", result.toString());\n for(var i = 0 ; i < trans_langs.length ; i++){\n console.log(\"doing something in this loop for downloads\");\n uploadTranslatedBook(book_id, trans_langs[i]);\n }\n }\n );console.log(\"ok this is it\")} catch (error){\n console.log(\"ded\")\n console.log(error)\n }\n console.log(\"exiting the async\")\n \n}", "function api (genFn) {\n let cr = bluebird.coroutine(genFn);\n return function (req, resp, next) {\n return cr(req, resp, next)\n .then(function(value) {\n resp.json(value);\n })\n .catch(next);\n };\n}", "async function querysearch(userInfo) {\r\n try{\r\n // console.log(userInfo+\"controller\");\r\n let response = await queryservice.searchQuery(userInfo);\r\n return response;\r\n }\r\n catch(errorMessage){\r\n throw new Error(errorMessage);\r\n }\r\n \r\n}", "async function setUp() {\n\t// load the lstm model\n\tlet model = await loadGen();\n\n\t// set up the server\n\tconst app = http.createServer(async function(request,response) {\n\t\tvar q, respJSON;\n\t\t\n\t\t// respond to query with generated text\n\t\tq = url.parse(request.url,true).query;\n\t\tif(q.inputText){\n\t\t\tconsole.log('there is input text!');\n\t\t\tlet generatedText = '';\n\t\t\tif(q.inputText == 'test'){\n\t\t\t\tconsole.log('this is a test');\n\t\t\t\tgeneratedText = 'test returned correctly';\n\t\t\t} else {\n\t\t\t\tif (q.inputText.length < sampleLen){\n\t\t\t\t\tconsole.log('inputText is too short. using previous seed.');\n\t\t\t\t} else {\n\t\t\t\tseedTextInput = q.inputText;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tconsole.log('seed: '+seedTextInput);\n\t\t\t\t// Generate text and output in console.\n\t\t\t\ttry {\n\t\t\t\t\tgeneratedText = await generateText(model, charSet, charSetSize, sampleLen, seedTextInput);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t}\n\t\t\t}\n\t\t\trespJSON = {generated: generatedText};\n\t\t} else {\n\t\t\tconsole.log('no input text.');\n\t\t\trespJSON = {generated: null};\n\t\t}\n\n\t\tresponse.writeHead(200, {'Content-Type': 'application/json','json':'true'});\n\t\tresponse.write(JSON.stringify(respJSON));\n\t\tresponse.end();\n\t});\n\t\n\t// start listening for requests\n\tapp.listen(port);\n}", "async function wrapperForAsyncFunc() {\n const result1 = await AsyncFunction1();\n console.log(result1);\n const result2 = await AsyncFunction2();\n console.log(result2);\n}", "async execute(){\n\t\tawait this.processRequest();\n\t\tawait this.formatRequest();\n\t\tawait this.processData();\n\t\tawait this.formatResponse();\n\t\tawait this.processResponse();\n\t}", "async function v3(v4,v5,v6,v7,v8) {\n}", "async function func() {\n return 1;\n}", "async function simpleReturn() {\n return 1;\n}" ]
[ "0.6948377", "0.65889823", "0.6489263", "0.6400034", "0.63576305", "0.6288742", "0.6282028", "0.6265965", "0.6238099", "0.6221576", "0.62209773", "0.62048906", "0.6180364", "0.61578697", "0.6127205", "0.61076176", "0.6106216", "0.6082266", "0.6082227", "0.6064737", "0.6064737", "0.60395676", "0.60311323", "0.60217804", "0.59960693", "0.59865916", "0.598039", "0.5977322", "0.59546006", "0.59502786", "0.5932047", "0.591815", "0.59177566", "0.59086955", "0.59064174", "0.5905367", "0.5902609", "0.5900134", "0.58959967", "0.5887571", "0.5881602", "0.5865292", "0.5859347", "0.58460903", "0.5843067", "0.5842719", "0.58353484", "0.583373", "0.58318114", "0.5831081", "0.58075076", "0.58075076", "0.5806922", "0.57822114", "0.57815677", "0.5772944", "0.5757431", "0.57489085", "0.57480776", "0.57425594", "0.5735758", "0.5726323", "0.57249194", "0.5716178", "0.5707887", "0.57070196", "0.5704396", "0.57033396", "0.5697916", "0.5695332", "0.56947076", "0.56806046", "0.5677544", "0.5675557", "0.5662409", "0.56472737", "0.56394595", "0.5629864", "0.5626864", "0.5625636", "0.5623482", "0.5614213", "0.5604664", "0.56020015", "0.5601079", "0.5601078", "0.5601078", "0.55948514", "0.5591577", "0.55853456", "0.5577599", "0.55746466", "0.5573188", "0.5558731", "0.5555592", "0.55521595", "0.554643", "0.5541047", "0.55368596", "0.5534104", "0.5533994" ]
0.0
-1
================================= Promise Examples ================================================= =============== Database test query functions =================================================== This is an example function not used anywhere in the project
function testQueryBuilder() { // user input should have the following: // -> userID // -> Semester selected // -> Course Subject // -> Course Code // const userInput = req.body; // Example or Test statement from postman --> in the body ->> x-www-form-urlencoded was selected // let testTitle = userInput.COEN; // setting the mongoose debugging to true const mongoose = require("mongoose"); mongoose.set('debug', true); dbHelpers.defaultConnectionToDB(); // both findOne() and find() works // const query = scheduleModel.find(); const query = scheduleModel.findOne(); query.setOptions({lean: true}); query.collection(scheduleModel.collection); // example to do the query in one line // query.where('object.courseSubject').equals(userInput.courseSubject).exec(function (err, scheduleModel) { // building a query with multiple where statements query.where('object.courseSubject').equals(userInput.courseSubject); query.where('object.courseCatalog').equals(userInput.courseCatalog); query.exec(function (err, scheduleModel) { try { res.status(200).json({ userInput, scheduleModel, message: "addCourseToSequence executed" }) // } } catch (err) { console.log("Error finding the course provided by the user"); res.status(200).json({ message: "Internal Server Error: Course not found" }) } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testQueries() {\n const queries = [\n // findAndSearch(),\n // createNote()\n // findById('000000000000000000000002')\n // findAndUpdate('5ba1566686d6ed45d030e4d9')\n findAndUpdate('5ba155cffeb22e8c6cf7965a'),\n findById('5ba155cffeb22e8c6cf7965a')\n ];\n\n \n return Promise.all(queries);\n}", "function queryProductsTable(){\n\n var asyncTableQuery = new Promise(function(resolve,reject){\n // do a thing possibly async, then... \n connection.query('SELECT * FROM products',function(error,results){\n if(error){\n console.log(error);\n reject(Error(\"it broke\"));\n }\n //console.log('query worked');\n resolve(resultsToTable(results));\n });\n });\n return asyncTableQuery;\n}", "function query_promise_then(result) {\n\n\n }", "function query_promise_then(result) {\n\n\n }", "function promisedQuery(sql) {\r\n console.log('query: ', sql);\r\n return new Promise((resolve, reject) => {\r\n connection.query(sql, function (err, rows) {\r\n if (err) {\r\n console.log('error: ', err);\r\n return reject(err);\r\n }\r\n console.log('success');\r\n resolve(rows);\r\n })\r\n });\r\n }", "function promisedQuery(sql) { \n return new Promise ((resolve, reject) => {\n console.log('query: ', sql);\n connection.query(sql, function(err, rows) {\n if ( err ) {\n return reject( err );\n }\n resolve( rows );\n })\n });\n }", "function query_promise_then(result) {\n }", "function query_promise_then(result) {\n }", "query(sql) {\n return new Promise((resolve, reject) => {\n this.connection.query(sql, (err, rows) => { //when results come back...\n if (err) return reject(err); // throw all errors\n resolve(rows); // resolve original promise with rows\n });\n })\n .catch(err => {\n console.log(`\\x1b[41m\\t[DB] Couldn't perform operation: ${err.sql}\\x1b[40m \\n\\t[DB] ${err.sqlMessage}`);\n throw err;\n });\n }", "function dbquery(query) {\n return new Promise( (r, j) => connection.query(query, null , (err, data) => {\n\t\tif (err) {\n\t\t\tlog.error(query);\n\t\t\treturn j(err);\n\t\t}\n\t\tr(data);\n\t}))\n}", "static fetchAll(db) {\n \n return new Promise(function (resolve, reject) {\n db.query(\"SELECT * FROM persons\", function (err, rows) {\n if (!err) {\n resolve(rows);\n } else {\n reject(err);\n }\n });\n });\n\n }", "function sqlPromiseWrapper(sql) {\n return new Promise((resolve, reject) => {\n database.query(sql, function (err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n}", "query(q, data) {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\ttry {\n\t\t\t\tthis.db.query(q, data, (err, rows) => {\n\t\t\t\t\tif(err) reject(err);\n\t\t\t\t\telse resolve(rows);\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t}", "getMatches(loggedInUserId, gender, religion, minAge, maxAge) {\n\n\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE gender=\"${gender}\"\n AND religion=\"${religion}\"\n AND age >= ${minAge}\n AND age <= ${maxAge}\n AND id != ${loggedInUserId}\n LIMIT 10`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n\n db.close();\n });\n }", "async function hitThatDB(query){\n const session = driver.session();\n var returnObject;\n return new Promise(resolve => {\n session.run(query)\n .then(result => {\n returnObject = result.records[0]._fields[0].properties;\n console.log(returnObject);\n })\n .catch(e => {\n console.log(e + \" WE MESSED UP!!!!\")\n })\n .then(() => {\n session.close();\n resolve(returnObject);\n })\n })\n}", "function queryInfo(sql, user){\n return new Promise((resolve, reject)=>{\n var results=[];\n var queryString=sql;\n var queryData=[user];\n\n db.query(queryString, queryData, function(res){\n for (var i in res){\n results.push(res[i]);\n };\n\n resolve(results);\n } );\n });\n\n}", "executeQuery(query){\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tthis.db_connection.query(query, err=>{\n\t\t\t\tif (err){\n\t\t\t\t\treject(err);\n\t\t\t\t}else{\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "function sqlquery(str, sqlObj) {\n //console.log(str);\n return new Promise((resolve, reject) => {\n db.query(str, sqlObj, (err, results) => {\n // console.log(results);\n if (err) reject(err);\n else resolve(results);\n }\n );\n });\n}", "function promiseQuery(zapytanie) {\n return new Promise(function (resolve, reject) {\n\n con.query(zapytanie, (err, rows) => {\n if (err) reject(err)\n resolve(rows)\n\n\n });\n })\n}", "async function callDB(client, queryMessage) {\n\n var queryResult;\n await client.query(queryMessage)\n .then(\n (results) => {\n queryResult = results[0];\n //console.log(results[0]);\n return queryResult;\n })\n .then(\n (results) => {\n res = JSON.parse(JSON.stringify(results));\n return results\n })\n .catch(console.log)\n}", "getAllTests(){\r\n\r\n console.log(\"Inside getAllTests in Atterberg DB\");\r\n return new Promise((resolve, reject)=>{ \r\n Determination_of_atterberg_limits.find().exec()\r\n .then(response => resolve(response))\r\n .catch(err => reject(err))\r\n });\r\n }", "async function hitThatDbForRelations(query){\n const session = driver.session();\n var returnObject = {\"relations\":[]};\n return new Promise(resolve => {\n session.run(query)\n .then(result => {\n for(var i = 0; i < result.records.length; i++){\n var key;\n var val;\n if(result.records[i]._fields[1].type === \"HAS_A_TYPE_OF\"){\n key = result.records[i]._fields[1].type + \"_\" + i;\n }\n else{\n key = result.records[i]._fields[1].type;\n }\n\n if(result.records[i]._fields[2].properties.name) {\n val = result.records[i]._fields[2].properties.name;\n };\n if(result.records[i]._fields[2].properties.gen) {\n val = result.records[i]._fields[2].properties.gen;\n };\n if(result.records[i]._fields[2].properties.legendary){\n if(result.records[i]._fields[2].properties.legendary == 0){\n val = \"Not Legendary\";\n }\n else {\n val = \"Legendary\"; \n }\n };\n returnObject.relations.push({[key]:val});\n };\n })\n .catch(e => {\n console.log(e + \" WE MESSED UP!!!!\")\n })\n .then(() => {\n session.close();\n console.log(returnObject);\n resolve(returnObject);\n })\n })\n}", "function query(q) {\n return new Promise(function (resolve, reject) {\n if (!validateQuery(q))\n return reject(new MysqlSyntaxError(\"Invalid query syntax\" + q));\n\n db.query(q, function(error, data, fields) {\n \n if (error) {\n return reject(error);\n }\n\n console.log('@query OK');\n return resolve(data);\n });\n });\n}", "initDatabase() {\n\n return new Promise( function (resolve,reject) {\n\n var exists = fs.existsSync(file);\n var db = new sqlite3.Database(file);\n\n if (exists) {\n return process.nextTick(_ => resolve());\n } else {\n console.log(\"Creating DB file.\");\n fs.openSync(file, \"w\");\n }\n\n db.serialize(function() {\n\n let createTableSql = \n `create table user(\n id INTEGER PRIMARY KEY,\n user_id TEXT,\n password TEXT,\n first_name TEXT,\n last_name TEXT,\n gender TEXT,\n age INTEGER,\n religion TEXT,\n avatar_image TEXT,\n min_preferred_age INTEGER,\n max_preferred_age INTEGER,\n preferred_religion TEXT,\n preferred_gender TEXT\n )`;\n\n db.run(createTableSql); \n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n\n users.forEach((user) => {\n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n });\n stmt.finalize();\n\n //\n // Debug, dump the newly created fake users.\n //\n db.each(\"SELECT * FROM user\", function(err, row) {\n console.log(row.id + \": \" + row.first_name + ' ' + row.last_name);\n });\n\n //\n // Hack. Only way I could think of (without wasting time) to be able to call \"resolve\" at the right time.\n //\n db.each(\"SELECT * from user LIMIT 1\", function(err, row) {\n resolve();\n });\n });\n\n db.close();\n }); \n }", "query(query){\n return (onSuccess,onFail) => {\n this.connect(() => {\n new sql.Request().query(query)\n .then((recordset) => {\n onSuccess(recordset);\n sql.close()\n })\n .catch((error) => {\n console.error('I fucked up',error);\n //lol like that ever happens\n if(onFail){\n onFail()\n }\n sql.close();\n });\n });\n }\n }", "function querySQL(sql){\n return new Promise(function (resolve, reject){\n con.query(sql , (err,results) => {\n if(err) throw reject(err);\n resolve(results);\n });\n });\n}", "async function get_booking(content) {\r\n var sql = 'SELECT * FROM `deliveries` WHERE `delivery_id` =' + content; \r\n\r\n let promise1 = new Promise((res, rej) => {\r\n\r\n pool.query(sql, function (err, result, fields) {\r\n\r\n if (err){ console.log(err); res(\"500\")}; \r\n \r\n // making sure the result isn't an empty response\r\n console.log({result});\r\n console.log({sql});\r\n if (result[0] != undefined) {\r\n res({result});\r\n } else {\r\n res(\"NO_ITEM_FOUND\");\r\n }\r\n //testing: console.log(pool.affectedrows);\r\n });\r\n\r\n\r\n });\r\n\r\n // wait until the promise returns a value\r\n return await promise1;\r\n \r\n}", "static async getJobsDescend() {\n try {\n const response = await db.any(\n `SELECT * FROM jobs ORDER BY date_posted DESC`\n );\n // Dev test\n console.log(response);\n return response;\n } catch (error) {\n // dev test\n console.error(\"ERROR: \", error);\n return error;\n }\n }", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "execute(query){\n return new Promise((resolve, reject) => {\n this.conn.query(query, (err, results, fields) => {\n if (err) reject(err);\n else resolve(results);\n })\n })\n }", "function exec(sql){\n const promise = new Promise((resolve,reject)=>{\n con.query(sql, (err,result)=>{\n \tif (err) {\n \t\treject(err)\n \t\treturn \n \t}\n \tresolve(result)\n })\n })\n return promise;\n}", "function query(query) {\n return new Promise((resolve, reject) => {\n db.find(query, (err, docs) => {\n if (err) console.error(\"There's a problem with the database: \", err);\n else if (docs) console.log(query + \" query run successfully.\");\n resolve(docs);\n });\n });\n}", "function sqlQuery(strSql, arr) {\n return new Promise(function (resolve, reject) {\n db.query(strSql, arr, (err, results) => {\n if (err) {\n reject(err)\n }\n else {\n resolve(results)\n }\n })\n //db.release()\n })\n}", "async function populateUserData(){\n return connect().then(function(connection){\n var users = [\n // id, first_name, last_name\n [5,'Mick','Baskers'],\n [10,'Dave','Bob'],\n [20,'Tom','Banana']\n ];\n let sql = `insert into user (id, first_name, last_name) values ?`;\n let result = connection.query(sql,[users]);\n connection.end();\n return result;\n }).then(function(result){\n return result;\n }).catch(function(error){\n console.log(error);\n throw error;\n })\n}", "function myAction(params) {\n\n return new Promise(function(resolve, reject) {\n console.log('Connecting to MySQL database');\n var mysql = require('promise-mysql');\n var connection;\n mysql.createConnection({\n host: params.MYSQL_HOSTNAME,\n user: params.MYSQL_USERNAME,\n password: params.MYSQL_PASSWORD,\n database: params.MYSQL_DATABASE\n }).then(function(conn) {\n connection = conn;\n console.log('Querying');\n/**\n * var queryText = 'SELECT * FROM cats WHERE id=?';\n * var result = connection.query(queryText, [params.id]);\n */\n var queryText = ' SELECT DISTINCT ' +\n ' APP.NAME AS app_name, ' +\n ' COMP.NAME AS comp_name, ' +\n ' COMP_ENV.ENVIROMENT_ID, ' +\n ' APP.LAST_UPDATED_BY AS app_last_updated_by, ' +\n ' COMP_ENV.LAST_UPDATED_DATE AS last_updated_date, ' +\n ' COMP.developmode AS developmode, ' +\n ' COMP.SUB_APP_TYPE AS subapp_type, ' +\n ' ENV.ENV_ALIAS AS env_alias, ' +\n/**\n\" decode (COMP_ENV.apply_type, \" +\n \" 'grey', \" +\n \" 'Grey', \" +\n \" 'dr', \" +\n \" 'Dr', \" +\n \" 'grey_dr', \" +\n \" 'Grey_Dr', \" +\n \" 'Normal') \" +\n \" AS apply_type, \" +\n*/\n ' APP.ID AS app_id, ' +\n ' PROT.NAME AS profile_name, ' +\n ' PROT.ID AS profileid, ' +\n/** \n \" TO_CHAR (COMP_ENV.CREATED_DATE, 'yyyy-MM-dd HH24:mi:ss') \" +\n*/\n \" date_format (COMP_ENV.CREATED_DATE, '%Y-%m-%d') \" +\n ' AS apply_created_date, ' +\n\n\n ' COMP_ENV.ID AS comp_id, ' +\n ' VM.HOSTNAME AS hostname, ' +\n ' VM.BUSINESSIP AS businessip, ' +\n ' COMP_ENV.RSC_TYPE AS rsc_type, ' +\n ' COMP.CONTEXT AS context ' +\n/** ' CASE lower ( ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/product/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000))) ' +\n ' WHEN \\'tomcat\\' ' +\n ' THEN ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/defaultPort/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000)) ' +\n ' WHEN \\'was\\' ' +\n ' THEN ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/wasDefaultPort/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000)) ' +\n ' ELSE ' +\n ' prot.ports ' +\n ' END ' +\n ' AS ports ' +\n*/\n ' FROM COMP_ENVIROMENT_T COMP_ENV ' +\n ' INNER JOIN APPLICATION_T APP ON APP.ID = COMP_ENV.APPLICATION_ID ' +\n ' INNER JOIN COMPONENT_T COMP ON COMP.ID = COMP_ENV.COMPONENT_ID ' +\n ' INNER JOIN ENVIROMENT_T ENV ON ENV.ID = COMP_ENV.ENVIROMENT_ID ' +\n ' LEFT JOIN COMPONENT_PROFILE_T COMP_PROFILE ' +\n ' ON COMP_ENV.ID = COMP_PROFILE.COMP_ENVIROMENT_ID ' +\n ' LEFT JOIN PROFILE_T PROT ON PROT.ID = COMP_PROFILE.PROFILE_ID ' +\n ' LEFT JOIN VIRTUAL_MACHINE_T VM ON VM.ID = PROT.VM_ID ' +\n' ORDER BY APP.NAME, ' +\n ' COMP.NAME, ' +\n ' ENV.ENV_ALIAS, ' +\n ' VM.HOSTNAME ' +\n' limit 10 '\n;\n/**\nqueryText = 'select * from COMP_ENVIROMENT_T limit 10';\n*/ \n var result = connection.query(queryText);\n connection.end(); \n return result;\n }).then(function(result) {\n console.log(result);\n if (result) {\n resolve({\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json'\n },\n body: result\n });\n } else {\n reject({\n headers: {\n 'Content-Type': 'application/json'\n },\n statusCode: 404,\n body: {\n error: \"Not found.\"\n }\n });\n }\n }).catch(function(error) {\n if (connection && connection.end) connection.end();\n console.log(error);\n reject({\n headers: {\n 'Content-Type': 'application/json'\n },\n statusCode: 500,\n body: {\n error: \"Error.\"\n }\n });\n });\n });\n\n}", "queryDatabase(query, placeholderArray) {\n\n if (!query || !placeholderArray) {\n\n return Promise.reject(\"ORM.queryDatabase() missing parameters.\");\n }\n\n const promise = this.mysqlDatabase.queryDatabase(query, placeholderArray);\n\n return promise;\n }", "loginCheck(username, password) {\n var connectionDB = this.connectDB()\n var loginProcess = connectionDB.then((connection) => {\n return new Promise ((resolve, reject) => {\n connection.query('SELECT id FROM' + dbTesterInfo +' WHERE ' +\n ' testerID = ? and passWord = ?', [username, password] ,function(err, results, fields) {\n if (results.length === 1) {\n resolve()\n } else {\n reject({err: {msg : 'Invalid password or username'}})\n }\n })\n connection.release()\n })\n\n }).catch((err) => {\n return Promise.reject(err)\n })\n\n return loginProcess\n }", "executeQuery(query) {\n return new Promise((resolve, reject) => {\n pool.getConnection((err, connection) => {\n if (err) {\n reject(err);\n }\n\n // execute query\n try {\n connection.query(query, function (err, result) {\n connection.release();\n if (err) reject(err);\n else resolve(result);\n });\n } catch (err) {\n console.log(\"mysqlApi executeQuery error: \", err);\n }\n });\n });\n }", "async function initializeDatabase(database){\n log.trace('console.log [OK]');\n //throw Promise.reject(\"FAKE FATAL ERROR\") //testOK\n database.connect();\n database.query('SELECT NOW() AS test', function(err, res){\n if (err) throw err;\n log.trace('test database.query 1 => '+ res.rows[0].test);\n //database.end() //commente sinon ferme la connection et empeche creation des tables\n });\n database.query('SELECT NOW() AS test', function(err, res){\n if (err) throw err;\n log.trace('test database.query 2 => '+ res.rows[0].test);\n });\n let sql = sqlCreateTables();\n database.query(sql, function(err, res){\n if (err){\n log.error('creation tables [NOK]');\n log.error(sql);\n log.error(res);\n throw err;\n }\n log.trace('creation tables [OK]');\n });\n}", "function customQuery(db, fun, opts) {\n\t return new PouchPromise(function (resolve, reject) {\n\t db._query(fun, opts, function (err, res$$1) {\n\t if (err) {\n\t return reject(err);\n\t }\n\t resolve(res$$1);\n\t });\n\t });\n\t }", "getUserByRowId(id) {\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE id=\"${id}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n db.close();\n });\n\n }", "executeQuery(query) {\n\n query = query.toQuery();\n\n debugQuery(query.text);\n\n return new Promise((resolve, reject) => {\n\n this.connection\n .then(driver => driver.executeQuery(query))\n .then(resolve);\n });\n }", "function runGenericQuery(query)\n{\n return new Promise((resolve, reject) => {\n var connection = new Connection(config);\n connection.on('connect', function(err) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n request = new Request(query.query, function(err) {\n if (err) {\n console.log(err);\n reject(new Error(err));\n } else {\n resolve(\"Operation successful\");\n }\n connection.close();\n }); \n \n query.params.forEach(function(param) {\n request.addParameter(param.paramName, param.paramType, param.paramValue);\n });\n\n connection.execSql(request);\n }\n });\n });\n}", "async function getAll(){\n try{\n return allTasks = await db.any(`\n SELECT * FROM todos;\n `) \n }\n catch(error){\n console.log('uh ohfda');\n console.log(error);\n return []\n }\n}", "getAllDepartments() {\n //https://www.w3schools.com/js/js_promise.asp\n //https://www.w3schools.com/nodejs/nodejs_mysql_select.asp\n return this.connection.promise().query(\n `SELECT * FROM department`\n );\n }", "getAll() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\t\t\n\t}", "function queryDB(query) {\n let connection = makeConnection();\n return new Promise((resolve, reject) => {\n connection.query(query, function(err, res) {\n if (err) throw err;\n connection.end();\n resolve(res);\n });\n });\n}", "function query_promise_then(result) {\n my_query.done.query=true;\n submit_if_done();\n }", "function viewDepartments() { //async?\n console.log('~~~~~~~~~~ Company Departments ~~~~~~~~~~')\n const query = 'SELECT * FROM departments'\n // let [data, fields] = await db.query(query)\n // // console.table(results);\n // console.table(data);\n // console.log(db)\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error egtting the rows')\n .then(() => {\n menu()\n })\n}", "async function simpleQuery(query, values = [], db){\n\n const client = await db.connect();\n let res;\n\n try { \n res = await client.query(query, values);\n\n } catch (err) {\n throw err;\n\n } finally {\n client.release();\n }\n \n return res;\n}", "function querySQL(sql) {\r\n return new Promise(function (resolve, reject) {\r\n con.query(sql, (err, result) => {\r\n if (err) throw reject(err);\r\n resolve(result);\r\n })\r\n })\r\n}", "function checkData(){\n var query3 = pool.query('select * from env_var;');\n query3\n .on('result', async function(row) {\n console.log(row)\n })\n}", "service_1(id) {\n //type your knex SQL query\n let query = this.knex.select().from('testtable')\n //\n return query.then((rows) => {\n return rows\n })\n }", "function customQuery(db, fun, opts) {\n\t return new PouchPromise$1(function (resolve, reject) {\n\t db._query(fun, opts, function (err, res) {\n\t if (err) {\n\t return reject(err);\n\t }\n\t resolve(res);\n\t });\n\t });\n\t }", "find(query={}){\n return new Promise((resolve , reject) => { //promise returns two values reject(),resolve()\n try {\n MongoClient.connect(url,{ useUnifiedTopology: true },function(err,db){ //// return value for err and data\n if (err) throw err; //if db not connected\n \n let dbo=db.db(\"mydb\");\n dbo.collection(\"users\").find(query).toArray(function(err,result){\n if(err) reject(err); //data not exists\n else{\n resolve(result); //data exists\n }\n db.close();\n \n });\n });\n\n }\n catch(e){\n console.log(e);\n \n }\n });\n\n}", "function checkUsername(username){\n let sql = \"SELECT * FROM admin WHERE username = ?\";\n return new Promise(function(resolve, reject){\n pool.query(sql,[username], function(err, rows,fields){\n if(err) throw err;\n //console.log(\"Rows found: \" + rows.length);\n resolve(rows);\n });//query\n });//promise\n }", "function testSinglePlan_Insert() {\n asyncTestCase.waitForAsync('testSinglePlan_Insert');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(rows[i].id(), results[i].id());\n assertObjectEquals(rows[i].payload(), results[i].payload());\n }\n asyncTestCase.continueTesting();\n }, fail);\n}", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "static fetchRestaurants(callback){\r\n //console.log(\"You have reached IndexedDB\");\r\n dbPromise.then(db => {\r\n const tx = db.transaction('restaurants');\r\n const store = tx.objectStore('restaurants');\r\n //console.log(store);\r\n return store.getAll();\r\n })\r\n .then(restaurants => {\r\n if (restaurants.length !== 0) {\r\n Promise.resolve(restaurants);\r\n }\r\n return DBHelper.getRestaurantsFromIDB(callback);\r\n //callback(null, restaurants);\r\n })\r\n }", "async function query_db(sql) {\n // avoid making unneccesary queries.\n if(sql.length == 0) return true;\n var result = await new Promise((res,rej) => {\n connection.query(sql, function(err, result) {\n if (err) res(null);\n res(result);\n });\n });\n return result;\n}", "function databaseSelect(query, params) {\n return new Promise((resolve, reject) => {\n db.all(query, params, (err, rows) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(rows);\n }\n })\n })\n}", "function sql2array(conn,key,value,table) {\n \n return new Promise(function(resolve, reject) { \n \n var query = \"SELECT * FROM \" + table + \" WHERE \" + key + \" = '\" + value + \"'\";\n //console.log(query);\n console.log('sql2array');\n conn.queryRowPromise(query)\n .then(function(rows) {\n //console.log('rows', rows);\n var resultRow = rows;\n if (!resultRow) {\n resultRow = null;\n }\n resolve(resultRow);\n },\n function(rows) {\n console.log(rows);\n })\n }); \n \n}", "async function TestAsync() {\n try {\n var parm = [];\n parm[0] = \"2017\"\n parm[1] = \"R\"\n parm[2] = \"02\"\n parm[3] = \"02M011\"\n parm[4] = \"1\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n const result = await DBase.DB.execSP(\"SPS_COM_TTOMODI\", parm);\n\n parm = [];\n parm[0] = \"000\"\n parm[1] = \"1111\"\n parm[2] = \"test\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n result = await DBase.DB.execSP(\"spi_teobj\", parm);\n /*\n spi_teobj 'null','1111','1234' \n if (result instanceof Error) {\n console.log(\"Error\")\n }\n */\n console.log(result)\n\n parm = [];\n parm[0] = \"TRTRQ\"\n result = await DBase.DB.execSP(\"sps_GetTTLOL\", parm);\n console.log(result)\n let resultObj = JSON.parse(result);\n //console.log(resultObj.data)\n console.log(resultObj.data[0][0].gs_ttl_i)\n\n result = await DBase.DB.execSQl(\"select top 1 gs_ttl_i from ttlol where gs_ttl_i = 'TRTRQ'\")\n resultObj = JSON.parse(result);\n console.log(\"After Title Call\")\n let gs_ttl_i = resultObj.data[0][0].gs_ttl_i;\n\n result = await DBase.DB.execSQl(\"select top 1 gs_oru_i from toru where gs_oru_i = '01M019'\")\n resultObj = JSON.parse(result);\n console.log(\"After School Call\")\n let gs_oru_i = resultObj.data[0][0].gs_oru_i;\n\n console.log(gs_oru_i)\n\n result = await DBase.DB.execSQl(\" Select top 10 gs_pr_name from ttodetail where gs_oru_i = '\" + gs_oru_i + \"' and gs_ttl_i = '\" + gs_ttl_i + \"'\")\n console.log(result)\n return \"After Test\";\n } catch (err) {\n console.log(\"error in TestAsync\")\n console.log(err)\n return err;\n //response.send(err); \n }\n}", "function queryOne(query) {\n return new Promise((resolve, reject) => {\n db.findOne(query, (err, docs) => {\n if (err) console.error(\"There's a problem with the database: \", err);\n else if (docs) console.log(query + \" queryOne run successfully.\");\n resolve(docs);\n });\n });\n}", "async function getProductos() {\r\n //se realiza una consulta de todos los productos de la tabla\r\n try {\r\n let rows = await query(\"SELECT * from productos\");\r\n //rows : array de objetos\r\n return rows;\r\n } catch (error) {\r\n //bloque en caso de que exista un error\r\n console.log(error);\r\n }\r\n}", "function customQuery(db, fun, opts) {\n return new Promise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n}", "function getHrmsData(sunConn,hrmsConn,trans,userID){\ntry{\n \n let requestString='SELECT *'\n if(forceTransFlag==false){\n let d=new Date()\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${ d.getMonth()} AND User_ID=${1};`\n }\n else{\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${forcedMonth} AND User_ID=${1};`\n }\n //console.log(requestString)\n return new Promise((resolve,reject)=>{\n request = new Request(requestString,async (err,rowCount,rows)=> { \n if (err) { \n reject(err.message)\n console.log(err);\n }\n else{\n console.log(rowCount+' rows selected')\n const headerID=await insertIntoSunHeaders(sunConn)\n if(forceTransFlag==false){\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,d.getMonth())\n }\n else{\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,forcedMonth)\n }\n }\n }); \n request.on('requestCompleted', function() { \n resolve(1)\n }); \n hrmsConn.execSql(request); \n })\n}\ncatch(err){\n console.log(err.message)\n}\n}", "function testReturnData() {\n describe('Return Test Data', function() {\n it('should return data from the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) RETURN t')\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Data Returned Result', function() {\n\n it('should return test data from database', function(done) {\n assert(record);\n done();\n });\n\n it('should have length of one', function(done) {\n assert.equal(record.length, 1);\n done();\n });\n\n var result = record._fields[0];\n\n it('should return correct label type', function(done) {\n assert.equal(typeof result.labels[0], 'string');\n done();\n });\n\n it('should have label \\'Test\\'', function(done) {\n assert.equal(result.labels[0], 'Test');\n done();\n });\n\n it('should return correct testdata type', function(done) {\n assert.equal(typeof result.properties.testdata,'string');\n done();\n });\n\n it('should have property \\'Testdata\\' containing \\'This is an integration test\\'', function(done) {\n assert.equal(result.properties.testdata, 'This is an integration test');\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function db_call(query_str){\n return new Promise( (resolve, reject) => {\n // execute a sql query to show all users\n conn_pool.query(query_str, function (err, result) {\n // if query failed then reject promise otherwise resolve with the data\n if (err) {\n reject(\"query failed\");\n } else {\n resolve(result)\n }\n })\n })\n}", "function customQuery(db, fun, opts) {\n\t return new PouchPromise(function (resolve, reject) {\n\t db._query(fun, opts, function (err, res) {\n\t if (err) {\n\t return reject(err);\n\t }\n\t resolve(res);\n\t });\n\t });\n\t}", "function getQueryResult(connection, query) {\n return new Promise((resolve, reject) => {\n var result = [];\n\n request = new Request(query.query, function(err, rowCount) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n resolve(result);\n }\n connection.close();\n });\n\n query.params.forEach(function(param) {\n request.addParameter(param.paramName, param.paramType, param.paramValue);\n });\n\n request.on('row', function(columns) {\n var row = {}; \n columns.forEach(function(column) {\n row[column.metadata.colName] = column.value;\n });\n result.push(row);\n });\n\n connection.execSql(request);\n }); \n}", "createNewUser(user) {\n\n console.log('CREATE USER WITH USER: ' + user);\n\n return new Promise( function (resolve,reject) {\n\n var db = new sqlite3.Database(file);\n\n db.serialize(function() {\n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n \n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n \n stmt.finalize();\n\n let sql = \n `SELECT * FROM user \n WHERE user_id=\"${user.userId}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n\n });\n\n db.close();\n }); \n }", "async function excuteSelectTotal() {\n try {\n const rows = await query('SELECT * FROM products');\n return rows;\n } catch (error) {\n console.log(error)\n }\n}", "query() { }", "function query_promise_then(result) {\n console.log(\"# result=\"+JSON.stringify(result));\n if(result.type!==\"menupage_url\"||result.url===\"\") {\n if(result.type===\"facebook\") {\n console.log(\"THIS IS FACEBOOK\");\n my_query.fb_about_url=result.url.replace(/(facebook\\.com\\/[^\\/]+).*$/,\"$1\")\n .replace(/facebook\\.com\\//,\"facebook.com/pg/\").replace(/\\/$/,\"\")+\"/about/?ref=page_internal\";\n let fb_promise=MTP.create_promise(my_query.fb_about_url,MTP.parse_FB_about,parse_fb_about_then);\n my_query.begin_fb=true;\n my_query.fields[result.type]=result.url;\n }\n else {\n my_query.done[result.type]=true;\n my_query.other_menus_list.sort(Item.cmp);\n console.log(\"my_query.other_menus_list=\"+JSON.stringify(my_query.other_menus_list));\n my_query.fields[result.type]=my_query.other_menus_list.length>0?my_query.other_menus_list[0].text:\"\";\n }\n \n\n submit_if_done();\n }\n else {\n\n my_query[result.type]=result.url;\n var promise=MTP.create_promise(my_query[result.type],find_menu_page,find_menu_then,function(response) {\n console.log(\"Failed menupages\");\n my_query.fields[result.type]=\"\";\n my_query.done[result.type]=true;\n submit_if_done();\n });\n }\n\n }", "static getCompletedOrdersForStudent(event_id, student_id){\n return new Promise((resolve, reject) => {\n const query = `\n select \"order\"\n from orders\n where event_id = $1\n and status = 'complete'\n and student_id = $2\n `\n connection.one(query, [event_id, student_id]).then(data => {\n resolve(data.order)\n }).catch(err => {\n //console.log(err)\n reject({\n error: `ERROR! There are no \"complete\" orders from admin getCompletedOrdersForStudent() for student ${student_id}.`\n })\n })\n })\n }", "static getReadyOrdersForStudent(event_id, student_id){\n return new Promise((resolve, reject) => {\n const query = `\n select \"order\"\n from orders\n where event_id = $1\n and status = 'ready'\n and student_id = $2\n `\n connection.one(query, [event_id, student_id]).then(data => {\n resolve(data.order)\n }).catch(err => {\n //console.log(err)\n reject({\n error: `ERROR! There are no \"ready\" orders from admin getReadyOrdersForStudent() for student ${student_id}.`\n })\n })\n })\n }", "function execute(sql) {\n return new Promise((resolve, reject) => {\n connection.query(sql, (err, result) => {\n if (err) {\n // console.log(\"Error \" + err);\n reject(err);\n return;\n }\n resolve(result);\n });\n });\n}", "_insertTestToken(){\n var self = this;\n if (!process.env.VCAP_SERVICES){\n var doc = {\n type: \"SESSION\",\n cn: 'BDD - Mocha Test Automation',\n uid: \"000000631\",\n mail: \"[email protected]\",\n expiration: moment().add(1, 'years').format(),\n cleanUp: moment().add(1, 'years').format(),\n token: this.tests.token\n };\n\n let options = {\n design: 'session',\n view: 'getAllSessions',\n query: {keys: [doc.token]}\n };\n\n this.select(options)\n .then((result) => {\n if (Array.isArray(result) && result.length === 0) {\n self.insert(doc); //is a promise but I dont care when it will be fulfilled.\n }\n });\n }\n }", "function customQuery(db, fun, opts) {\n return new PouchPromise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function getTareasById(fk_usuario) {\n return new Promise((resolve, reject) => {\n db.query('SELECT * FROM s9q90jl9ash7sm2k.tareas WHERE fk_usuario=?',\n [fk_usuario],\n (error, result) => {\n if (error) { return reject(error) }\n else {\n resolve(result);\n console.log(result);\n }\n })\n })\n}", "function initMontitor() {\n let query = 'SELECT * FROM feeds';\n let readFeeds = new Promise( function(resolve, reject) {\n feedDb.read(query).then( function(result) {\n resolve(result);\n })\n });\n\n readFeeds.then( function(result){\n console.log(result);\n })\n }", "getUser(userId) {\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE user_id=\"${userId}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n db.close();\n });\n }", "async testConnection () {\n await this.pool.query('SELECT version()')\n }", "async function networkTest() {\n const rows = await database.execute(\"SELECT * FROM SensorData ORDER BY id ASC LIMIT 0, 10\");\n \n // return result list\n return rows[0];\n}", "function execute_query_with_ID(query){\n return new Promise(function(resolve, reject) {\n\n pool.getConnection( function(err,connection) {\n if(err)\n reject(err);\n else{\n connection.query(query, function (err,result) {\n if (err) {\n return reject(err);\n }\n resolve(result);\n });\n connection.release();\n \n }\n \n });\n \n });\n}", "function customQuery(db, fun, opts) {\n return new PouchPromise$1(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function customQuery(db, fun, opts) {\n return new PouchPromise$1(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "function customQuery(db, fun, opts) {\n return new PouchPromise$1(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n }", "async get_message(msgid) { \n var return_value = false;\n return new Promise((resolve, reject) => {\n this.db().get(\"SELECT * FROM messages WHERE msgid = ?\", [msgid], (error, row) => {\n if(!error) {\n resolve(row);\n } else {\n // Provide feedback for the error\n console.log(error);\n resolve(false);\n }\n });\n }); \n }", "function searchDB(id, quantity) {\n return db.query(\"SELECT * FROM products WHERE ?\", [{ itemID: id }])\n .spread(function(rows) {\n\n // scenario where are no products with that ID left \n if (parseInt(rows[0].stockQuantity) < 1) {\n console.log(\"\\nI am sorry but this item is no longer in stock\\n\".rainbow);\n return questions();\n\n // scenario where the amount they entered is greater than the stock available \n } else if (parseInt(rows[0].stockQuantity) < parseInt(quantity)) {\n console.log(\"\\nI am sorry but we do not have enough items to fulfil your request\\n\".red);\n return questions();\n\n // If the store has enough product we need to fulfil the customers order and this will handle\n } else {\n var totalPrice = parseInt(quantity) * parseInt(rows[0].price);\n var newQuant = parseInt(rows[0].stockQuantity) - parseInt(quantity);\n var deptID = rows[0].departmentID;\n console.log(\"This is dept ID: \" + deptID, totalPrice);\n // pushes the new total sales number by department to the departments table in the DB\n updateTotalSales(totalPrice, deptID)\n // using this to send the data to the print receipt function\n \t.then(printReceipt(totalPrice, rows[0].productName, parseInt(quantity), id, newQuant));\n\n }\n\n })\n\n}", "function queryExecute(query, params) {\n\treturn new Promise(function(resolve, reject) {\n\t\tlet con = mysql.createConnection(dbconfig.connection);\n\t\tcon.connect(function(err) {\n\t\t\tif (err) throw err;\n\t\t});\n\t\tcon.query(query, params, function (err, result, fields) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(result);\n\t\t\tconsole.log(JSON.stringify(result));\n\t\t\tcon.end();\n\t\t\tresolve(result);\n\t\t});\n\t})\n}", "function test_setup() {\n (async () => {\n await connection\n .query(\n `\n TRUNCATE polls CASCADE;\n `\n )\n .then(() => {\n console.log(clc.green(\"Deleted\"));\n console.log(clc.blue(\"\\nTesting /save endpoint\"));\n needle(\n \"post\",\n `http://localhost:${process.env.APP_PORT}/save`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n console.log(clc.green(`Status: ${res.statusCode}`));\n console.log(clc.blue(\"\\nTesting /recall endpoint\"));\n succesfull += 1;\n\n needle(\n \"get\",\n `http://localhost:${process.env.APP_PORT}/recall/1294898935/my_poll2`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n console.log(\n clc.green(`Status: ${res.statusCode}`)\n );\n console.log(\n clc.blue(\"\\nTesting /check endpoint\")\n );\n succesfull += 1;\n\n needle(\n \"get\",\n `http://localhost:${process.env.APP_PORT}/check/1294898935/my_poll2`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n succesfull += 1;\n console.log(\n clc.green(\n `Status: ${res.statusCode}`\n )\n );\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n return 1;\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n });\n })().catch((err) => {\n console.error(err);\n console.log(\n clc.green(`\\nSuccesfully ran: ${succesfull} out of 3 test cases.`)\n );\n console.log(\n clc.red(`\\nFailed in : ${3 - succesfull} out of 3 test cases.`)\n );\n return 0;\n });\n}", "async function selectfromtable() {\n const client = new Client ({\n host: \"localhost\",\n user: \"postgres\",\n port: \"5432\",\n password: \"arielle\",\n database: \"postgres\"\n });\n await client.connect();\n try {\n const res = await client.query(`Select * from buns`);\n const myrows = res.rows;\n \n await client.end();\n return myrows\n } catch(err) {\n console.log(err.message);\n }\n}", "function query_promise_then(result) {\n\n my_query.url=result;\n var promise=MTP.create_promise(my_query.url,find_logo,submit_if_done,function() {\n if(!my_query.failed_once&&my_query.old_url) {\n my_query.failed_once=true;\n const queryPromise = new Promise((resolve, reject) => {\n console.log(\"Beginning URL search\");\n query_search(my_query.name+\" real estate agent\" , resolve, reject, query_response,\"query\");\n });\n queryPromise.then(query_promise_then)\n .catch(function(val) {\n console.log(\"Failed at this queryPromise \" + val); GM_setValue(\"returnHit\",true); });\n return;\n }\n\n\n\n\n GM_setValue(\"returnHit\",true); });\n\n }", "function executeStatement() {\n request = new Request(\"SELECT * FROM test2;\", function (err) {\n if (err) {\n console.log(err);\n }\n });\n var result = \"\";\n request.on('row', function (columns) {\n columns.forEach(function (column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n result += column.value + \" \";\n }\n });\n console.log(result);\n result = \"\";\n });\n\n request.on('done', function (rowCount, more) {\n console.log(rowCount + ' rows returned');\n });\n connection.execSql(request);\n}" ]
[ "0.7072084", "0.6965696", "0.6881106", "0.6881106", "0.68532574", "0.681616", "0.68005687", "0.68005687", "0.67238986", "0.6720794", "0.66493005", "0.6567426", "0.65658003", "0.65441704", "0.6538023", "0.65171593", "0.6513134", "0.6497586", "0.6497586", "0.6460553", "0.64556974", "0.6448039", "0.64244175", "0.6370023", "0.6360303", "0.6359707", "0.6356326", "0.63512015", "0.63113415", "0.6301332", "0.6283877", "0.62779963", "0.6246855", "0.6245633", "0.6242621", "0.62425625", "0.6231433", "0.62306815", "0.62176", "0.62106067", "0.62019527", "0.61991537", "0.6194166", "0.6187405", "0.6186234", "0.61802876", "0.61791235", "0.6172894", "0.61646104", "0.6156323", "0.6154907", "0.6143334", "0.6139681", "0.61326367", "0.6131323", "0.6122412", "0.6120804", "0.61172694", "0.6115542", "0.6103621", "0.6103621", "0.6103621", "0.6103621", "0.610248", "0.6095382", "0.60908204", "0.6076873", "0.60680544", "0.60644287", "0.60629606", "0.6053225", "0.6050926", "0.6046779", "0.60452235", "0.6042128", "0.6033123", "0.6015536", "0.60110533", "0.5994447", "0.5991653", "0.59855396", "0.5969149", "0.59650314", "0.5959409", "0.595864", "0.5946659", "0.5946109", "0.5945098", "0.5936082", "0.5934052", "0.59253037", "0.59163034", "0.59163034", "0.59163034", "0.5913761", "0.5912061", "0.5907914", "0.59058255", "0.5903357", "0.59022874", "0.5899573" ]
0.0
-1
============== Database test query ===================================================
function mapToJson(map) { return JSON.stringify([...map]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateDatabaseQuery() {}", "function testQueries() {\n const queries = [\n // findAndSearch(),\n // createNote()\n // findById('000000000000000000000002')\n // findAndUpdate('5ba1566686d6ed45d030e4d9')\n findAndUpdate('5ba155cffeb22e8c6cf7965a'),\n findById('5ba155cffeb22e8c6cf7965a')\n ];\n\n \n return Promise.all(queries);\n}", "function queryDB(tx) {\r\n tx.executeSql(\"SELECT * FROM DEMO\", [], querySuccess, errorCB);\r\n}", "getAllTests(){\r\n\r\n console.log(\"Inside getAllTests in Atterberg DB\");\r\n return new Promise((resolve, reject)=>{ \r\n Determination_of_atterberg_limits.find().exec()\r\n .then(response => resolve(response))\r\n .catch(err => reject(err))\r\n });\r\n }", "query() { }", "function testQueryBuilder() {\n // user input should have the following:\n // -> userID\n // -> Semester selected\n // -> Course Subject\n // -> Course Code\n // const userInput = req.body;\n // Example or Test statement from postman --> in the body ->> x-www-form-urlencoded was selected\n // let testTitle = userInput.COEN;\n\n // setting the mongoose debugging to true\n const mongoose = require(\"mongoose\");\n mongoose.set('debug', true);\n\n dbHelpers.defaultConnectionToDB();\n\n // both findOne() and find() works\n // const query = scheduleModel.find();\n const query = scheduleModel.findOne();\n query.setOptions({lean: true});\n query.collection(scheduleModel.collection);\n // example to do the query in one line\n // query.where('object.courseSubject').equals(userInput.courseSubject).exec(function (err, scheduleModel) {\n // building a query with multiple where statements\n query.where('object.courseSubject').equals(userInput.courseSubject);\n query.where('object.courseCatalog').equals(userInput.courseCatalog);\n query.exec(function (err, scheduleModel) {\n try {\n res.status(200).json({\n userInput,\n scheduleModel,\n message: \"addCourseToSequence executed\"\n })\n // }\n } catch (err) {\n console.log(\"Error finding the course provided by the user\");\n res.status(200).json({\n message: \"Internal Server Error: Course not found\"\n })\n }\n });\n}", "function startDatabaseQueries() {\n \n}", "function querytest() {\n for (let index = 0; index < 100000; index++) {\n const results2 = knex.select(knex.raw(`\n dalong4();`))\n results2.map(columes => {\n console.log(columes)\n }).catch(err => {\n console.log(err)\n })\n }\n}", "function runQuery(db_name, product_line, query, callback)\n{\n\tlet db = main_database.db(db_name);\n\tlet collection = db.collection(product_line);\n\tcollection.find(query,{}).toArray(function(error,docs){\n\t\tcallback(docs, error)\n\t\tassert.equal(null, error);\n\t});\n\n}", "function runQuery(db_name, product_line, query, callback)\n{\n\tlet db = main_database.db(db_name);\n\tlet collection = db.collection(product_line);\n\tcollection.find(query,{}).toArray(function(error,docs){\n\t\tcallback(docs, error)\n\t\tassert.equal(null, error);\n\t});\n\n}", "async all() {\n return this.db.any(\n 'SELECT $(columns:name) FROM $(table:name)',\n {\n columns: ['firstname', 'lastname', 'email', 'department'],\n table: this.table,\n },\n )\n .then((users) => users)\n .catch((error) => {\n throw error;\n });\n }", "static database_query(json, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.database_query({0})\".format(json));\n Database.query(json, fcn);\n }", "function executeStatement() {\n request = new Request(\"SELECT * FROM test2;\", function (err) {\n if (err) {\n console.log(err);\n }\n });\n var result = \"\";\n request.on('row', function (columns) {\n columns.forEach(function (column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n result += column.value + \" \";\n }\n });\n console.log(result);\n result = \"\";\n });\n\n request.on('done', function (rowCount, more) {\n console.log(rowCount + ' rows returned');\n });\n connection.execSql(request);\n}", "async function testDatabase () {\n let service = app.service('test')\n await service.create([\n { 'title': 'asdf' },\n { 'title': 'qwerty' },\n { 'title': 'zxcvb' },\n { 'title': 'hello world' },\n { 'title': 'world around' },\n { 'title': 'cats are awesome' },\n ])\n\n let res = await service.find({ query: { $search: 'world' } })\n\n console.log(res)\n // [ { title: 'world around', _id: '1RDM5BJWX4DWr1Jg' },\n // { title: 'hello world', _id: 'dX4bpdM1IsAFkAZd' } ]\n}", "function testSinglePlan_Insert() {\n asyncTestCase.waitForAsync('testSinglePlan_Insert');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(rows[i].id(), results[i].id());\n assertObjectEquals(rows[i].payload(), results[i].payload());\n }\n asyncTestCase.continueTesting();\n }, fail);\n}", "function queryDB(tx){\r\n tx.executeSql('SELECT * FROM Client',[],querySuccess,errorCB);\r\n }", "function execute(query)\n{\n console.log(query);\n var result = db.exec(query);\n printResult(result);\n}", "function queryInterviewDatabase() { \n console.log('Reading rows from the Table...');\n\n // Read all rows from table\n request = new Request(\"select * from interviewData;\", (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n\n request.on('row', function(columns) {\n columns.forEach(function(column) {\n console.log(\"%s\\t%s\", column.metadata.colName, column.value);\n });\n });\n\n connection.execSql(request);\n}", "function testAddData() {\n describe('Add Test Data', function() {\n it('should add data to the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('CREATE (t:Test {testdata: {testdata}}) RETURN t', {testdata: 'This is an integration test'})\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Added Data Returned Result', function() {\n it('should return added test data from database', function(done) {\n assert(record);\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Added Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function sqlEngine(results) {\n\n var foundResult = \"\";\n var entityString = whereQueryBuilder(results)\n\n if (results[2] == '') {\n var majors = ['analytics', 'computer_science', 'computer_intelligence', 'software_development', 'networks_and_security', 'it_service_science'];\n for (i = 0; i < majors.length; ++i) {\n foundResult = database(\"SELECT * FROM \" + majors[i] + entityString);\n if (foundResult != \"\") {\n break;\n }\n }\n } else {\n foundResult = database(\"SELECT code FROM\" + results[2].split(' ').join('_') + entityString);\n }\n\n}", "function testQueryProcessingFunctions() {\n testEvalQueryShow();\n testEvalQueryTopK();\n testEvalQuerySliceCompare();\n\n testGetTable();\n\n testCallGcpToGetQueryResultShow();\n testCallGcpToGetQueryResultTopK(); \n testCallGcpToGetQueryResultSliceCompare();\n\n testCallGcpToGetQueryResultUsingJsonShow();\n testCallGcpToGetQueryResultUsingJsonTopK(); \n testCallGcpToGetQueryResultUsingJsonSliceCompare();\n}", "function testReturnData() {\n describe('Return Test Data', function() {\n it('should return data from the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) RETURN t')\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Data Returned Result', function() {\n\n it('should return test data from database', function(done) {\n assert(record);\n done();\n });\n\n it('should have length of one', function(done) {\n assert.equal(record.length, 1);\n done();\n });\n\n var result = record._fields[0];\n\n it('should return correct label type', function(done) {\n assert.equal(typeof result.labels[0], 'string');\n done();\n });\n\n it('should have label \\'Test\\'', function(done) {\n assert.equal(result.labels[0], 'Test');\n done();\n });\n\n it('should return correct testdata type', function(done) {\n assert.equal(typeof result.properties.testdata,'string');\n done();\n });\n\n it('should have property \\'Testdata\\' containing \\'This is an integration test\\'', function(done) {\n assert.equal(result.properties.testdata, 'This is an integration test');\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function SBRecordsetPHP_getSQLForTest()\r\n\r\n{\r\n\r\n var sqlParams = new Array();\r\n\r\n var sql = this.getDatabaseCall(sqlParams);\r\n\r\n var enclosingToken;\r\n\r\n \r\n\r\n // remove SQL comments\r\n\r\n sql = SQLStatement.stripComments(sql);\r\n\r\n \r\n\r\n for (var i = 0; i < sqlParams.length; i++)\r\n\r\n {\r\n\r\n var theParamVal = \"\";\r\n\r\n \r\n\r\n if (this.paramValuePromptArray && this.paramValuePromptArray[i])\r\n\r\n {\r\n\r\n // ask the user for the value to replace\r\n\r\n // Pop up a dialog to get the default value to use in the test \r\n\r\n MM.paramName = this.paramValuePromptArray[i]\r\n\r\n dw.runCommand(\"GetTestValue\");\r\n\r\n if (MM.clickedOK)\r\n\r\n {\r\n\r\n theParamVal = MM.retVal.replace(/'/g, \"''\");\r\n\r\n }\r\n\r\n else\r\n\r\n {\r\n\r\n // user clicked cancel, so exit and set statement to blank\r\n\r\n sql = \"\";\r\n\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n else\r\n\r\n {\r\n\r\n theParamVal = String(sqlParams[i].defaultValue).replace(/'/g, \"''\");\r\n\r\n }\r\n\r\n \r\n\r\n enclosingToken = \"\";\r\n\r\n if (sqlParams[i] && sqlParams[i].varType && sqlParams[i].varType != \"int\") {\r\n\r\n \tenclosingToken = \"'\";\r\n\r\n }\r\n\r\n \r\n\r\n // If we have Begins with/Ends with/Contains statements => we'll add by default single quotes\r\n\r\n if (sql.match(new RegExp(\"%\" + sqlParams[i].varName, \"g\")) || sql.match(new RegExp(sqlParams[i].varName + \"%\", \"g\"))) {\r\n\r\n \tenclosingToken = \"'\";\r\n\r\n }\r\n\r\n\r\n\r\n var varRef = new RegExp(\"(\\\\b|%)\" + sqlParams[i].varName + \"(%|\\\\b)\",\"g\");\r\n\r\n sql = sql.replace(varRef, enclosingToken + \"$1\" + theParamVal + \"$2\" + enclosingToken);\r\n\r\n }\r\n\r\n return sql;\r\n\r\n}", "function getEntries() {\r\n db.transaction(queryDB,dbErrorHandler);\r\n}", "function queryTest1() {\n var query = new Parse.Query(Sleep);\n query.greaterThan(\"sleep_time\", 5);\n query.lessThan(\"sleep_time\", 8);\n query.limit(10);\n query.find( {\n success: function(results) {\n console.log(JSON.stringify(results));\n },\n error: function(object, error) {\n console.log(JSON.stringify(error));\n }\n })\n}", "function promisedQuery(sql) {\r\n console.log('query: ', sql);\r\n return new Promise((resolve, reject) => {\r\n connection.query(sql, function (err, rows) {\r\n if (err) {\r\n console.log('error: ', err);\r\n return reject(err);\r\n }\r\n console.log('success');\r\n resolve(rows);\r\n })\r\n });\r\n }", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "queryDatabase(query, placeholderArray) {\n\n if (!query || !placeholderArray) {\n\n return Promise.reject(\"ORM.queryDatabase() missing parameters.\");\n }\n\n const promise = this.mysqlDatabase.queryDatabase(query, placeholderArray);\n\n return promise;\n }", "executeQuery(res, query){ \n sql.connect(dbConfig, function (err) {\n if (err) { \n console.log(\"Error while connecting database :- \" + err);\n res.send(err);\n }\n else {\n // create Request object\n var request = new sql.Request();\n // query to the database\n request.query(query, function (err, res) {\n if (err) {\n console.log(\"Error while querying database :- \" + err);\n res.send(err);\n }\n else {\n res.send(res);\n }\n });\n }\n }); \n }", "static async getJobsDescend() {\n try {\n const response = await db.any(\n `SELECT * FROM jobs ORDER BY date_posted DESC`\n );\n // Dev test\n console.log(response);\n return response;\n } catch (error) {\n // dev test\n console.error(\"ERROR: \", error);\n return error;\n }\n }", "function TQuery() {}", "function TQuery() {}", "function TQuery() {}", "async function test2 () \n {\n const book = new Book({\n title:\"test\",\n writingPrompt:\"test\",\n image:\"test\",\n numberOfChapters:\"1\",\n duration:\"1\",\n authorArray:[],\n genre: \"test\"\n })\n \n \n \n await Book.create(book);\n\n let query = Book.findOne({});\n query.exec((err, bookT) => {\n var targetId = typeof String;\n targetId = bookT._id;\n //console.log(targetId)\n\n chai.request(server)\n // May have to change name because we haven't named it yet\n .get('/api/book/getById?books=' + targetId)\n .end((err, res) => {\n //console.log(res.body)\n //console.log(res.status)\n res.should.have.status(200)\n res.body.should.be.a('array')\n res.body.length.should.be.eql(1);\n done()\n })\n })\n }", "function randomQuery(randList) {\n\t\tvar transaction = db.transaction([collection], \"readonly\"),\n store = transaction.objectStore(collection),\n results = [],\n request;\n \n randList.forEach(function(id){\n \trequest = store.openCursor(IDBKeyRange.only(Number(id)));\n\n \t // gets called for each item\n\t request.onsuccess = function(event) {\n\t results.push(event.target.result.value);\n\t }\n\n\t request.onerror = function(e) {\n console.error(\"Error with db access: \" + e);\n \t}\n\n }); // end forEach()\n\n // when we're all done add the table to the page\n transaction.oncomplete = function(event) {\n drawTable(results);\n } \n\t}", "function test_case_effective_query(err, response) {\n\n if (err) {\n console.error(err);\n } else {\n\n assert.equal(response.headers['Content-Type'], 'text/json', 'content type is not text/json');\n assert.equal(response.statusCode, 200, 'status code must be 200');\n\n results = response.results;\n\n for (kw in results) {\n assert.isTrue(results[kw].no_results, 'no_result should be true');\n\n // effective query must be different to the original keyword\n assert.isOk(results[kw].effective_query, 'effective query must be ok');\n assert.isNotEmpty(results[kw].effective_query, 'effective query must be valid');\n\n assert(results[kw].effective_query !== keyword, 'effective query must be different from keyword');\n\n assert.typeOf(results[kw].num_results, 'string', 'num_results must be a string');\n assert.isEmpty(results[kw].num_results, 'no results should be a empty string');\n\n assert.typeOf(Date.parse(results[kw].time), 'number', 'time should be a valid date');\n }\n\n console.log('SUCCESS: all tests passed!');\n }\n}", "function insertQueries() {\n\n }", "function addQuery(query){\n databaseAccess(dbAdd, {'query': query, 'when': new Date()}, function(results){});\n}", "async function makeQuery(sql){\n try {\n let result = await query(sql)\n // if (Array.isArray(result)){\n // result = deepArrayScan(result)\n // }\n return result\n }\n catch(err){\n if (err.code ==='ER_DUP_ENTRY'){\n throw new Error('This entity already exist in DB');\n } else {\n throw err;\n } \n } \n}", "executeQuery(query) {\n\n query = query.toQuery();\n\n debugQuery(query.text);\n\n return new Promise((resolve, reject) => {\n\n this.connection\n .then(driver => driver.executeQuery(query))\n .then(resolve);\n });\n }", "executeQuery(query){\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tthis.db_connection.query(query, err=>{\n\t\t\t\tif (err){\n\t\t\t\t\treject(err);\n\t\t\t\t}else{\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function TQuery(){}", "selectOneQuery() {\n return `select * from ${this.tablename('selectOne')} where id = $1`;\n }", "query(sql) {\n return new Promise((resolve, reject) => {\n this.connection.query(sql, (err, rows) => { //when results come back...\n if (err) return reject(err); // throw all errors\n resolve(rows); // resolve original promise with rows\n });\n })\n .catch(err => {\n console.log(`\\x1b[41m\\t[DB] Couldn't perform operation: ${err.sql}\\x1b[40m \\n\\t[DB] ${err.sqlMessage}`);\n throw err;\n });\n }", "function results(callback) {\n var db = new sql.Database(\"football.db\");\n console.log(\"populating the results table\");\n fluent.create({\n table:\"results\", fileName:\"results\", db:db\n }).async({\n checkTableExists:checkTableExists\n }, \"table\", \"db\").async({\n createResultsTable:createResultsTable\n }, \"checkTableExists\", \"db\").wait().sync({\n getJsonData:getJsonData\n }, \"fileName\").sync({\n addResults: addResults\n }, \"getJsonData\", \"db\").wait().sync({\n close:close\n }, \"db\").run(callback);\n}", "function printCreateTableQueries() {\n for (table in model) {\n query = getCreateTableQuery(table)\n console.log(query)\n }\n}", "function agg(){\n\tvar db;\n\t\n\tdb = window.openDatabase('mydb', '1.0', 'TestDB', 2 * 1024 * 1024);\n\t\n\t\n\tdb.transaction(function (tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS TestiV2 (id unique, id_traduzione, italiano, inglese, francese, spagnolo)');\n\t\t\t\t \n tx.executeSql('DELETE FROM TestiV2', [], function (tx, results) {\n }, null);\n\t\n\t});\n\t\n\tagg2()\n\n}", "function checkDatabase(){\n // make trans and store(key word) variables\n // add a const(getE) for the store.getAll method\n // use const getE.onsuccess = function (){ fetch => .then (return trans in json) .then (delete the records if successful (store.clear))}\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n const all = store.all();\n\n all.onsuccess = function(){\n if(all.result.length >0){\n fetch(\"api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(all.result), \n headers: {\n Accept: \"application/json, text/plain, */*\", \n \"Content-Type\": \"application/json\"\n }\n })\n .then(response => {\n // delete record if successful in updating DB\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.clear();\n });\n }\n };\n}", "function getAll(){\n return db.any('SELECT * FROM Locations');\n}", "function TQueries() {}", "function TQueries() {}", "function TQueries() {}", "function addDummyData(){\n mydb.transaction(function (t) {\n t.executeSql(\"SELECT * FROM pokomonlocaties\", [], function(transaction, results){\n if(results.rows.length === 0){\n mydb.transaction(function (t) {\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[10,51.803347,5.235370]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[15,51.689980,5.295904]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[20,51.683874,5.292578]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[25,51.688264,5.279875]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[30,51.701711,5.277021]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[35,51.699583,5.303757]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[40,51.695327,5.303199]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[45,51.690898,5.304015]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[50,51.688397,5.286634]);\n t.executeSql(\"INSERT INTO pokomonlocaties (id, latitude, longitude) VALUES (?, ?,?)\",[55,51.686029,5.311911]);\n });\n }\n });\n });\n\n}", "function queryAllRows() {\n connection.query(\"SELECT * FROM products\", function (err, data) {\n if (err) throw err;\n\n console.table(data);\n selectItem(data);\n });\n}", "function executeUsersinfo(){\n\n let database_user = users_info_data.openUsersInfoDatabase();\n // users_info_data.insertUsersBasic(-1,'\\'lwjabcd\\'','\\'a987654321\\'','\\'[email protected]\\'');\n\n\n // TODO:create&insert can't be done in one time -BUG\n // users_info_data.createTable('test2', attributes, notes);\n // users_info_data.insertGeneral('test2',values);\n // users_info_data.updateUsersBasic(1,'','[email protected]')\n\n // users_info_data.getAllUsersBasic((result)=>{\n // result.forEach((row)=>{\n // console.log(row);\n // });\n // });\n\n users_info_data.checkUsersBasicValid((result)=>{\n console.log(result);\n }, 'lwja','a9876543s21');\n\n users_info_data.closeUsersInfoDatabase();\n\n}", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "function SQLRows(res,sql,params){\n if (!params){\n params = []\n }\n db.all(sql, params, (err, rows) => {\n if (err) {\n res.status(400).json({\"error\":err.message});\n return;\n }\n res.json({\n \"message\":\"success\",\n \"data\":rows\n })\n });\n}", "async function find(context) {\n let query = baseQuery;\n const binds = {};\n \n if (context.id) {\n binds.emp_id = context.id;\n \n query = `select ins_grade as \"grade\", count(ins_grade) as \"grade_count\"\nfrom inspection\nwhere ins_grade is not null and emp_id = :emp_id\ngroup by ins_grade\norder by ins_grade\n`;\n\t\n }\n \n const result = await database.simpleExecute(query, binds);\n \n return result.rows;\n}", "query(q, data) {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\ttry {\n\t\t\t\tthis.db.query(q, data, (err, rows) => {\n\t\t\t\t\tif(err) reject(err);\n\t\t\t\t\telse resolve(rows);\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t}", "async function sampleTest() {\n\n tabQuery.setCols([\n {\n col: {id: \"http://eurostat.linked-statistics.org/dic/geo\", \"label\":\"Geopolitical entity (reporting)\",\"type\": Constants.DATATYPE.SEMANTIC},\n vals: [\n { id: \"http://eurostat.linked-statistics.org/dic/geo#DE\", \"label\":\"Germany\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#IE\", \"label\":\"Ireland\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#IS\", \"label\":\"Iceland\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#ES\", \"label\":\"Spain\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#RO\", \"label\":\"Romania\"},\n ]\n },{\n col: {id: \"http://eurostat.linked-statistics.org/dic/time\", \"label\":\"Time\",\"type\": Constants.DATATYPE.TIME},\n vals: [],\n vals: {\n min: '2013-01-01',\n max: '2018-01-01'\n }\n },{\n col: {id: \"http://yavaa.org/ns/eurostat/meas/numberOfSheep\", \"label\":\"Number of sheep\", \"type\": Constants.DATATYPE.NUMERIC},\n vals: []\n },{\n col: {id: \"http://yavaa.org/ns/eurostat/meas/population\", \"label\":\"Population\", \"type\": Constants.DATATYPE.NUMERIC},\n vals: []\n }\n\n ]);\n\n return;\n\n }", "function postTestDataSummary(input) {\n\n let values = [input.employeeID, input.locationID, input.modelID, input.Qty, 0]\n let ourQuery = `Insert into QAA.testData_TB (employeeID, locationID, modelID,Qty,verified) values (?)`;\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig, values);\n}", "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM activite\";\n return this.common.findOne(sqlRequest);\n }", "function consultarQrInVal(){\n db.transaction(obtenerQrInVal,errorBD);\n}", "function makeStandardQuery(table, operation, reqBody) {\n curModel = model[table]\n curFields = curModel.fields\n\n // Get all\n if (operation == \"getAll\") {\n query = `SELECT * FROM ${table}`\n }\n\n // Find an element by certain fields given in request\n else if (operation == \"find\") {\n wherePairs = [] // Elements have format \"username = 'x'\"\n\n for (key in reqBody) {\n if (key in curFields) {\n val = reqBody[key]\n if (quoteTypes.indexOf(curFields[key]) >= 0) {\n curPair = `${key} = '${val}'`\n } else {\n curPair = `${key} = ${val}`\n }\n wherePairs.push(curPair)\n }\n }\n\n whereQuery = wherePairs.join(\" AND \")\n if (whereQuery != \"\") {\n whereQuery = \" WHERE \" + whereQuery\n }\n\n query = `SELECT * FROM ${table}${whereQuery}`\n }\n\n // Create an element\n else if (operation == \"create\") {\n keys = [\"createdAt\",\"updatedAt\"]\n vals = [\"NOW()\",\"NOW()\"]\n for (key in reqBody) {\n if (key in curFields) {\n val = reqBody[key]\n keys.push(key)\n // If it is a string, add quotes around it\n if (quoteTypes.indexOf(curFields[key]) >= 0) val = `'${val}'`\n vals.push(val)\n }\n }\n keysStr = keys.join(\",\")\n valsStr = vals.join(\",\")\n query = `INSERT INTO ${table} (${keysStr}) VALUES (${valsStr})`\n }\n\n // Update an element\n else if (operation == \"update\") {\n\n // Get primary key\n primaryKey = curModel.primaryKey\n primaryVal = reqBody[primaryKey]\n if (quoteTypes.indexOf(curFields[primaryKey]) >= 0) primaryVal = `'${primaryVal}'`\n\n // Get fields to update\n setClauseArr = [\"updatedAt = NOW()\"] // Change \"updatedAt\" field\n for (key in reqBody) {\n if (key in curFields & key != primaryKey) {\n val = reqBody[key]\n if (quoteTypes.indexOf(curFields[key]) >= 0) val = `'${val}'`\n curClause = `${key} = ${val}`\n setClauseArr.push(curClause)\n }\n }\n\n // Make query\n setClauseStr = setClauseArr.join(\", \")\n query = `UPDATE ${table} SET ${setClauseStr} WHERE ${primaryKey} = ${primaryVal}`\n\n }\n\n // Delete an element\n else if (operation == \"delete\") {\n primaryKey = curModel.primaryKey\n primaryVal = reqBody[primaryKey]\n if (quoteTypes.indexOf(curFields[primaryKey]) >= 0) primaryVal = `'${primaryVal}'`\n query = `DELETE FROM ${table} WHERE ${primaryKey} = ${primaryVal}`\n }\n\n return(query)\n}", "function getDataFromDB(conn, q, cb) {\n\tconn.query(q, function(err, rows) {\n\t\tcb(rows, err);\n\t});\n}", "async function get(query = {}) {\n const { limit = 10, sortby = \"id\", sortdir = \"asc\" } = query;\n const {\n location = \"\",\n urgency_level = 0,\n funding_goal = 0,\n deadline = \"\",\n title = \"\",\n description = \"\",\n specie_id = 0\n } = query;\n\n let rows = await db(\"campaigns\")\n .orderBy(sortby, sortdir)\n .limit(limit)\n .modify(function(queryBuilder) {\n if (location) {\n queryBuilder.where({ location });\n }\n if (urgency_level) {\n queryBuilder.where({ urgency_level });\n }\n if (funding_goal) {\n queryBuilder.where({ funding_goal });\n }\n if (deadline) {\n queryBuilder.where({ deadline });\n }\n if (title) {\n queryBuilder.where(\"title\", \"like\", \"%\" + title + \"%\");\n }\n if (description) {\n queryBuilder.where(\"description\", \"like\", \"%\" + description + \"%\");\n }\n if (specie_id) {\n queryBuilder.where({ specie_id });\n }\n });\n console.log(query);\n\n return rows;\n}", "function querySuccess(tx, results) {\n var len = results.rows.length;\n console.log(\"configuracion table: \" + len + \" rows found.\");\n for (var i=0; i<len; i++){\n console.log(\"Row = \" + i + \" ID = \" + results.rows.item(i).id + \" Data = \" + results.rows.item(i).data);\n }\n }", "function testDeleteData() {\n describe('Delete Test Data', function() {\n it('should delete test data in database and return success or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) DELETE t')\n .then(function (result) {\n session.close();\n describe('Deleting Data Returned Success', function() {\n it('should delete test data from database', function(done) {\n assert(result);\n done();\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Deleting Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function test_bottleneck_datastore() {}", "function queryJdeAuditLog(connection) \n{\n\n\tvar query = \"SELECT paupmj, paupmt, pasawlatm FROM testdta.F559859 ORDER BY pasawlatm DESC\";\n\n\tconnection.execute(query, [], { resultSet: true }, function(err, result) \n\t{\n\t\tif (err) { console.log(err.message) };\n\t\tfetchRowsFromJdeAuditLogRS( connection, result.resultSet, numRows, audit );\t\n\t}); \n}", "function SBRecordsetPHP_getSQLForTest()\r\n{\r\n var sqlParams = new Array();\r\n var sql = this.getDatabaseCall(sqlParams);\r\n \r\n // remove SQL comments\r\n sql = SQLStatement.stripComments(sql);\r\n \r\n for (var i = 0; i < sqlParams.length; i++)\r\n {\r\n var theParamVal = \"\";\r\n \r\n if (this.paramValuePromptArray && this.paramValuePromptArray[i])\r\n {\r\n // ask the user for the value to replace\r\n // Pop up a dialog to get the default value to use in the test \r\n MM.paramName = this.paramValuePromptArray[i]\r\n dw.runCommand(\"GetTestValue\");\r\n if (MM.clickedOK)\r\n {\r\n theParamVal = MM.retVal.replace(/'/g, \"''\");\r\n }\r\n else\r\n {\r\n // user clicked cancel, so exit and set statement to blank\r\n sql = \"\";\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n theParamVal = String(sqlParams[i].defaultValue).replace(/'/g, \"''\");\r\n }\r\n \r\n var varRef = new RegExp(\"\\\\b\" + sqlParams[i].varName + \"\\\\b\",\"g\");\r\n sql = sql.replace(varRef, theParamVal);\r\n }\r\n \r\n return sql;\r\n}", "function query(context, connection, queryString, rowProcessFunc) {\r\n const Request = require('tedious').Request;\r\n let data = [];\r\n let request = new Request(queryString, function(err, rowCount, rows) {\r\n if (err) {\r\n error(err, context);\r\n }\r\n else {\r\n context.res = {\r\n status: 200,\r\n body: data,\r\n headers: { \"Content-Type\": \"application/json\" }\r\n };\r\n context.done();\r\n }\r\n });\r\n\r\n request.on('row', function(columns) {\r\n data.push(rowProcessFunc(columns));\r\n });\r\n connection.execSql(request);\r\n}", "function afterExecute(err, results) {\n debug(`executed(${query.database.uuid || 'default'}) : ${query.sql}`);\n\n if (benchmark) {\n query.sequelize.log('Executed (' + (query.database.uuid || 'default') + '): ' + query.sql, Date.now() - queryBegin, query.options);\n }\n\n if (err) {\n err.sql = query.sql;\n reject(query.formatError(err));\n } else {\n const metaData = this;\n let result = query.instance;\n\n // add the inserted row id to the instance\n if (query.isInsertQuery(results, metaData)) {\n query.handleInsertQuery(results, metaData);\n if (!query.instance) {\n // handle bulkCreate AI primary key\n if (\n metaData.constructor.name === 'Statement'\n && query.model\n && query.model.autoIncrementField\n && query.model.autoIncrementField === query.model.primaryKeyAttribute\n && query.model.rawAttributes[query.model.primaryKeyAttribute]\n ) {\n const startId = metaData[query.getInsertIdField()] - metaData.changes + 1;\n result = [];\n for (let i = startId; i < startId + metaData.changes; i++) {\n result.push({ [query.model.rawAttributes[query.model.primaryKeyAttribute].field]: i });\n }\n } else {\n result = metaData[query.getInsertIdField()];\n }\n }\n }\n\n if (query.sql.indexOf('sqlite_master') !== -1) {\n if (query.sql.indexOf('SELECT sql FROM sqlite_master WHERE tbl_name') !== -1) {\n result = results;\n if (result && result[0] && result[0].sql.indexOf('CONSTRAINT') !== -1) {\n result = query.parseConstraintsFromSql(results[0].sql);\n }\n } else {\n result = results.map(resultSet => resultSet.name);\n }\n } else if (query.isSelectQuery()) {\n if (!query.options.raw) {\n // This is a map of prefix strings to models, e.g. user.projects -> Project model\n const prefixes = query._collectModels(query.options.include);\n\n results = results.map(result => {\n return _.mapValues(result, (value, name) => {\n let model;\n if (name.indexOf('.') !== -1) {\n const lastind = name.lastIndexOf('.');\n\n model = prefixes[name.substr(0, lastind)];\n\n name = name.substr(lastind + 1);\n } else {\n model = query.options.model;\n }\n\n const tableName = model.getTableName().toString().replace(/`/g, '');\n const tableTypes = columnTypes[tableName] || {};\n\n if (tableTypes && !(name in tableTypes)) {\n // The column is aliased\n _.forOwn(model.rawAttributes, (attribute, key) => {\n if (name === key && attribute.field) {\n name = attribute.field;\n return false;\n }\n });\n }\n\n return tableTypes[name]\n ? query.applyParsers(tableTypes[name], value)\n : value;\n });\n });\n }\n\n result = query.handleSelectQuery(results);\n } else if (query.isShowOrDescribeQuery()) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA INDEX_LIST') !== -1) {\n result = query.handleShowIndexesQuery(results);\n } else if (query.sql.indexOf('PRAGMA INDEX_INFO') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA TABLE_INFO') !== -1) {\n // this is the sqlite way of getting the metadata of a table\n result = {};\n\n let defaultValue;\n for (const _result of results) {\n if (_result.dflt_value === null) {\n // Column schema omits any \"DEFAULT ...\"\n defaultValue = undefined;\n } else if (_result.dflt_value === 'NULL') {\n // Column schema is a \"DEFAULT NULL\"\n defaultValue = null;\n } else {\n defaultValue = _result.dflt_value;\n }\n\n result[_result.name] = {\n type: _result.type,\n allowNull: _result.notnull === 0,\n defaultValue,\n primaryKey: _result.pk !== 0\n };\n\n if (result[_result.name].type === 'TINYINT(1)') {\n result[_result.name].defaultValue = { '0': false, '1': true }[result[_result.name].defaultValue];\n }\n\n if (typeof result[_result.name].defaultValue === 'string') {\n result[_result.name].defaultValue = result[_result.name].defaultValue.replace(/'/g, '');\n }\n }\n } else if (query.sql.indexOf('PRAGMA foreign_keys;') !== -1) {\n result = results[0];\n } else if (query.sql.indexOf('PRAGMA foreign_keys') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA foreign_key_list') !== -1) {\n result = results;\n } else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(query.options.type) !== -1) {\n result = metaData.changes;\n } else if (query.options.type === QueryTypes.UPSERT) {\n result = undefined;\n } else if (query.options.type === QueryTypes.VERSION) {\n result = results[0].version;\n } else if (query.options.type === QueryTypes.RAW) {\n result = [results, metaData];\n } else if (query.isUpdateQuery() || query.isInsertQuery()) {\n result = [result, metaData.changes];\n }\n\n resolve(result);\n }\n }", "function TQueries(){}", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_RoutineExercises\")\n }", "async function networkTest() {\n const rows = await database.execute(\"SELECT * FROM SensorData ORDER BY id ASC LIMIT 0, 10\");\n \n // return result list\n return rows[0];\n}", "function pet_view_db(tx){\n tx.executeSql('SELECT * FROM Pet',[], pet_view_data, errorDB);\n}", "readAllData(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n // const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n // paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender,str_reason as Reason\n // from dbo.employee\n // LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID `;\n // const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM todo\";\n return this.common.findOne(sqlRequest);\n }", "function dbquery(query) {\n return new Promise( (r, j) => connection.query(query, null , (err, data) => {\n\t\tif (err) {\n\t\t\tlog.error(query);\n\t\t\treturn j(err);\n\t\t}\n\t\tr(data);\n\t}))\n}", "function checkDatabase() {\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n const getAll = store.getAll();\n\n getAll.onsuccess = function () {\n if (getAll.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(getAll.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\" \n }\n })\n .then(response => response.json())\n .then(() => {\n // Deletes records in the indexdb if successful \n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.clear();\n });\n }\n };\n}", "function checkDatabase() {\n // getting the reference to the db\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n const getAll = store.getAll();\n\n getAll.onsuccess = function () {\n // posts if you have something bulk\n if (getAll.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(getAll.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n // delete records if successful\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.clear();\n });\n }\n };\n}", "function executeQuery(selectedQuery, parameters) {\n const session = driver.session({ database: database });\n\n if (selectedQuery == \"HR\") {\n return session.readTransaction((tx) =>\n tx.run('MATCH (P1:Person)-[AR:APP_REGISTERED_CONTACT]-(P2:Person) WHERE P1.ssn = \\'' + parameters.ssn + '\\' AND P2.ssn<>P1.ssn AND duration.inDays(AR.date,date(\"' + parameters.swabDate + '\")).days <= 2 AND duration.inDays(AR.date,date(\"' + parameters.swabDate + '\")).days >= 0 RETURN P2 AS p')\n )\n .then(result => {\n // Each record will have a person associated, I'll get that person\n return result.records.map(recordFromDB => {\n return new Person(recordFromDB.get(\"p\"));\n });\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n else if (selectedQuery == \"SB\") {\n return session.writeTransaction((tx) => {\n tx.run('CREATE (S:Swab {date: date(\\'' + parameters.date + '\\'), outcome: \\'' + parameters.outcome + '\\', type: \\'' + parameters.type + '\\'}) WITH S MATCH (P:Person) WHERE P.ssn = \\'' + parameters.ssn + '\\' MERGE (P)<-[:TAKES]->(S)')\n })\n .then(result => {\n return \"Successfully added swab to ssn: \" + parameters.ssn;\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n else if (selectedQuery == \"ALL\") {\n return session.readTransaction((tx) =>\n tx.run('MATCH (p:Person)-[r:APP_REGISTERED_CONTACT]->(:Person) RETURN DISTINCT p LIMIT(100)')\n )\n .then(result => {\n // Each record will have a person associated, I'll get that person\n return result.records.map(recordFromDB => {\n return new Person(recordFromDB.get(\"p\"));\n });\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n}", "function consultarQrVal(){\n db.transaction(obtenerQrVal,errorBD);\n}", "service_1(id) {\n //type your knex SQL query\n let query = this.knex.select().from('testtable')\n //\n return query.then((rows) => {\n return rows\n })\n }", "function LQuery(){}", "function test(req, res) {\n const sql = `SELECT * FROM Business WHERE ROWNUM <= 10`;\n req._oracledb\n .execute(sql)\n .then((data) => res.send(data))\n .catch((err) => console.log(err));\n}", "function populateDBWithDummyData() {\n Document.find({}).exec(function(err, collection) {\n if (collection.length === 0) {;\n Document.create({\n title: 'MIT',\n description: 'Mark 7 Plasma Generator',\n docType: 'Assembly Model',\n partType: 'Proprietary',\n project: 'Plasma Source',\n author: 'AAB',\n revision: 2,\n documentNum: 'ESK-002-334234',\n });\n }\n })\n}", "function query(query) {\n return new Promise((resolve, reject) => {\n db.find(query, (err, docs) => {\n if (err) console.error(\"There's a problem with the database: \", err);\n else if (docs) console.log(query + \" query run successfully.\");\n resolve(docs);\n });\n });\n}", "function queryDb(restaurant_id) {\n}", "\"filter:database\"(queryPayload) {\n return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));\n }", "function runSqlQuery(queryString, consoleLogging, options = null){ \r\n con.query(queryString, options, function(err, result, fields) {\r\n if (err) throw err;\r\n if(consoleLogging == true){\r\n console.log(\"\\n--------------------------------------------------\")\r\n console.log(queryString + \" --> DONE!\");\r\n console.log(result);\r\n console.log(\"--------------------------------------------------\")\r\n }\r\n });\r\n}", "async function query_db(sql) {\n // avoid making unneccesary queries.\n if(sql.length == 0) return true;\n var result = await new Promise((res,rej) => {\n connection.query(sql, function(err, result) {\n if (err) res(null);\n res(result);\n });\n });\n return result;\n}", "function test_candu_graphs_datastore_vsphere6() {}", "function queryDb(queryobj, param, callback) {\n \n //Error object has no query\n if (!queryobj.query) {\n callback('The query object does not have any query property: ' + JSON.stringify(queryobj), null);\n }\n //Eroor object has no arguments\n else if (!queryobj.nbr) {\n callback('The query object does not have any nbr property: ' + JSON.stringify(queryobj), null);\n }\n else if (!db){\n callback('No database initialized', null);\n }\n else {\n //Query string with '?'\n var query = queryobj.query;\n //Parameters array\n var args = fillArray(param, queryobj.nbr);\n\n db.all(query, args, function(err, rows) {\n if (err) {\n callback(err, null);\n }\n else {\n callback(null, rows);\n }\n });\n }\n\n}", "async testConnection () {\n await this.pool.query('SELECT version()')\n }", "function queryTest3() {\n XHR.GET(SERVER_URL+'/classes/Sleep?'+encodeURI('where={\"metadata.app_version\":{\"$gte\":1,\"$lte\":3}}'))\n}", "function promisedQuery(sql) { \n return new Promise ((resolve, reject) => {\n console.log('query: ', sql);\n connection.query(sql, function(err, rows) {\n if ( err ) {\n return reject( err );\n }\n resolve( rows );\n })\n });\n }", "getAll(collection,query){\n return this.connect().then(db=>{\n //llamamoos al metodo de mongo de busqueda por medio de una query \n return db.collection(collection).find(query).toArray();\n });\n }", "static findById(id) {\n return db.execute('SELECT * FROM products WHERE products.id = ?', [id]);\n }", "getMatches(loggedInUserId, gender, religion, minAge, maxAge) {\n\n\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE gender=\"${gender}\"\n AND religion=\"${religion}\"\n AND age >= ${minAge}\n AND age <= ${maxAge}\n AND id != ${loggedInUserId}\n LIMIT 10`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n\n db.close();\n });\n }" ]
[ "0.67630345", "0.6684823", "0.6263232", "0.6207665", "0.6201697", "0.6107374", "0.6038539", "0.6005674", "0.59990776", "0.59990776", "0.59958535", "0.59946406", "0.5946922", "0.59375215", "0.59108126", "0.5886826", "0.5854224", "0.5816241", "0.581162", "0.5800839", "0.57642746", "0.5759354", "0.5740652", "0.57320774", "0.5710759", "0.56942874", "0.5654121", "0.56462944", "0.56451094", "0.56355697", "0.56343853", "0.56343853", "0.56343853", "0.5630103", "0.5622964", "0.5602498", "0.55972046", "0.55929446", "0.55882525", "0.55880153", "0.5584164", "0.557422", "0.55681103", "0.55659205", "0.5556811", "0.5553063", "0.55492055", "0.5548133", "0.5540183", "0.5536546", "0.5536546", "0.5536546", "0.55335885", "0.5531954", "0.5529259", "0.5528514", "0.55271065", "0.5526843", "0.55216175", "0.5519001", "0.5518237", "0.55120534", "0.55067486", "0.55066943", "0.5506129", "0.550029", "0.5479415", "0.54756117", "0.54741234", "0.5469524", "0.5469045", "0.5468682", "0.5466535", "0.54651076", "0.5462491", "0.5459367", "0.5448386", "0.54428804", "0.5441436", "0.54411215", "0.5438966", "0.5435432", "0.5430428", "0.54279566", "0.5423501", "0.5422264", "0.5418772", "0.5391621", "0.539035", "0.53830093", "0.5381627", "0.5381475", "0.53795725", "0.537815", "0.53755695", "0.537501", "0.5374889", "0.53728074", "0.5372588", "0.5372405", "0.5366537" ]
0.0
-1
Adding a method to the constructor NB: fucking works !
greet() { return `${this.name} says hello.`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function _ctor() {\n\t}", "__previnit(){}", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {}", "function HelperConstructor() {}", "constructor (){}", "constructor( ) {}", "function tempCtor() {}", "function construct() { }", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "constructor() { super() }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {\n\t\t// ...\n\t}", "function Ctor() {\r\n }", "constructor () { super() }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xaa2769ed;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.customMethod = args.customMethod;\n this.params = args.params;\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor(...args) {\n super(...args);\n \n }", "constructor(a, b, c) {\n super(a, b, c);\n }", "function Ctor() {\n\t// Empty...\n}", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "constructor(){\r\n\t}", "consstructor(){\n \n\n }", "consructor() {\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "constructor(f,...args)\n {\n super(...args);\n this.f = f;\n }", "function YourConstructor() {\n\t// initialization\n}", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "constructor() {\n throw new Error('Not implemented');\n }", "constructor(x,y){\n super(x,y);\n }", "constructor () {\r\n\t\t\r\n\t}", "constructor() {\n\t}" ]
[ "0.7370769", "0.7263137", "0.7263137", "0.7263137", "0.712248", "0.6965426", "0.6959364", "0.69394857", "0.68425643", "0.6770985", "0.67553824", "0.67202747", "0.6710721", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6672627", "0.6551111", "0.65505445", "0.65505445", "0.65505445", "0.65505445", "0.65505445", "0.65505445", "0.65505445", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.6531207", "0.65256345", "0.65150416", "0.64864236", "0.646543", "0.6395711", "0.6392977", "0.6373079", "0.6357048", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319354", "0.6319287", "0.6306207", "0.6305545", "0.6294307", "0.62891066", "0.6275411", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62707597", "0.62639076", "0.6244836", "0.6231609", "0.6226243", "0.6220341" ]
0.0
-1
Get All User By Hospital ID
async GetAllUserByHospitalID (val) { // console.log(val) try { const response = await axios.get(`https://kidney-diary-service.yuzudigital.com/users?hospitalId=` + val.hospitalID) return response.data } catch (error) { return error.response } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserData(id) {\n const { users } = this.props;\n let data = users.users;\n let result = data.filter(user => user.login.uuid === id);\n\n return result;\n }", "function getAll(id) {\n return db('people').where({'user_id': id});\n}", "function getEmployees(req, res, next) {\n var id = parseInt(req.params.id);\n db.query(\"SELECT * FROM users WHERE id_entreprise = ?\", id, function (error, results, fields) {\n if (error)\n res.status(500)\n .json({\n status: \"ko\",\n data: \"error\"\n })\n else\n res.status(200)\n .json({\n status: \"ok\",\n data: results\n })\n });\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "static async findEmployee(id) {\n const user = await pool5.query(\n `\n select * from supervisor left join personal_information on personal_information.employee_id=supervisor.supervisor_id where personal_information.employee_id = $1`,\n [id]\n );\n return user.rows[0];\n }", "getUmpireUsingId(id) {\r\n let sql_getUmpire = `SELECT A.id, A.user_id, B.full_name \r\n FROM umpire_tb A\r\n INNER JOIN user_tb B\r\n ON (A.user_id = B.id)\r\n WHERE A.id = ${id}`;\r\n let result = this.apdao.all(sql_getUmpire);\r\n return result;\r\n }", "function getUserById(id) {\n return getUserByProperty('id', id);\n}", "function getUsers(query) {\n if ($scope.data.ACL.users.length) {\n var args = {\n options: {\n classUid: 'built_io_application_user',\n query: query\n }\n }\n return builtDataService.Objects.getAll(args)\n } else\n return $q.reject({});\n }", "function getUserById(id){\n return $http.get(url.user + id).then( handleSuccess, handleError);\n }", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "function getallusers() {\n\n\t}", "function getUsers() {\n\n intakeTaskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "function getUsers(ids) {\n return rp.get(\"https://api.twitch.tv/helix/users\", {\n headers: {\n \"Client-ID\": config[\"twitch-client-id\"],\n \"Authorization\": \"Bearer \" + config[\"twitch-access-token\"],\n },\n qs: {\n \"id\": ids,\n\n },\n json: true,\n });\n}", "getDataFromID(id) {\n return this.users.find((user) => id === user.id);\n }", "function getUserData (req, res, next) {\n db.oneOrNone(`SELECT * FROM \"user\" WHERE user_id = $1`, [req.params.user_id])\n .then((user) => {\n res.rows = user;\n next();\n })\n .catch(err => next(err));\n}", "function pullUserData(){\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.responseText && xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n var obj = jQuery.parseJSON( xmlHttp.responseText );\n $.each(obj, function() {\n FirstName[FirstName.length] = this['firstName'];\n LastName[LastName.length] = this['lastName'];\n if(h[this['_id']] != null){\n ID[ID.length] = h[this['_id']];\n }else{\n ID[ID.length] = \"Not Found\";\n }\n \n });\n }\n };\n xmlHttp.open(\"GET\", \"https://mydesigncompany.herokuapp.com/users\", true);\n //xmlHttp.open(\"GET\", \"https://infinite-stream-2919.herokuapp.com/users\", true);\n xmlHttp.send(null);\n }", "static getUserById(_id){\n return axios.get(`${baseUrl}${uniqUser}?_id=${_id}`)\n .then(function(res){\n return res\n }).catch((err) =>{\n throw(err)\n })\n }", "function findUserById(userId) {\n return window.httpGet(`https://openfin.symphony.com/pod/v2/user/?uid=${userId}`);\n }", "async getUserData(id) {\n return User.findByPk(id);\n }", "function getUser(id){\n for (i in users){\n if (i.userId === id){\n return i\n }\n }\n return null\n}", "function getUserById(req, res, next) {\n const sql = sqlString.format('SELECT * FROM users WHERE id = ?', [\n req.params.id\n ])\n db.execute(sql, (err, rows) => {\n if (err) return next(err)\n if (rows.length === 0) return next({ message: 'User not find' })\n res.send(rows[0])\n })\n}", "function findUserById(req, res){\n\t\tvar uid = req.params[\"uid\"];\n\t\tvar user = selectUserbyId(uid);\n\t\tres.json(user);\n\t\t// for (let x = 0; x < users.length; x++) {\n // \t\tif (users[x]._id === uid) { \n // \t\tres.json(users[x]);\n // \t\treturn; \n // \t\t}\n }", "getUserById(id) {\n return this.http.get(\"http://localhost:8080/api/users/\" + id);\n }", "function getAllUser(){\n return $http.get(url.user).then( handleSuccess, handleError );\n }", "findUser(request, response, next) {\n Users.findAll({\n where: { id: request.params.id }\n })\n .then((result) => response.formatter.ok(result))\n .catch((result) => response.formatter.serverError(result));\n }", "static async getUsersById(req,res){\n const id = parseInt(req.params.id)\n const user = await Users.findById(id).select('-__v') //find from monoDb user collection\n if(!user) return res.status(404).send(\"User not found\") //error if user is not available\n res.send(user) \n }", "function getAllJournals(req, res, next) {\n\tJournals.findAll({ \n\t\twhere: {\n\t\t\tuserID: req.params.id\n\t\t}\n\t})\n .then(found => res.json(found))\n .catch(err=>next(err));\n}", "getUser(id){\n return this.users.filter((user)=> user.id === id)[0]; /* FINDING AND RETURNING THE USER WITH SAME ID AND RETURNING IT WHICH WILL BE AT INDEX 0 */\n }", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "static getAll(userId) {\n const query = 'SELECT user_level FROM Members WHERE id = $1';\n return db.one(query, userId).then(() => {\n const query = 'SELECT * FROM MEMBERS WHERE id != $1';\n return db.any(query, userId);\n });\n }", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "async getAllWithUserId(id){\n\n\t\tif(!id || id === undefined || id === ''){\n\t\t\tthrow \"Error: appointments getAllWithUserId no id passed\"\n\t\t}\n\t\t\n\t\tconst appointmentsCollection = await appointments();\n\t\tlet res = await appointmentsCollection.find({userId: id}).toArray();\n\t\t\n\t\treturn(res)\n\n\t}", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function getAllRegUser(){\n var filter = {};\n $scope.regUsers = [];\n userSvc.getUsers(filter).then(function(data){\n data.forEach(function(item){\n if(item.email)\n $scope.regUsers[$scope.regUsers.length] = item;\n });\n })\n .catch(function(err){\n Modal.alert(\"Error in geting user\");\n })\n }", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "function getUsers() {\n\tif (ite <= 40) {\n\t\tsetTimeout(() => {\n\t\t\tite += 1;\n\t\t\tinit().then(() => {\n\t\t\t\tgetUsers();\n\t\t\t});\n\t\t}, 600000);\n\t}\n\n\tconst options = {\n\t\t'method': 'GET',\n\t\t'hostname': 'api.intra.42.fr',\n\t\t'path': '/v2/cursus/21/users/?access_token=' + accessToken.token.access_token + '&per_page=100&filter[primary_campus_id]=1&page=' + ite + '&filter[staff?]=false&sort=-pool_year&range[pool_year]=0,3000'\n\t};\n\tconst req = https.request(options, (res) => {\n\t\tlet data;\n\t\tres.on(\"data\", d => {\n\t\t\tdata += d;\n\t\t});\n\t\tres.on(\"end\", () => {\n\t\t\tconst json = JSON.parse(data.substring(9));\n\t\t\tjson.map((j) => {\n\t\t\t\tuserIds.push(j.id);\n\t\t\t});\n\t\t\tconsole.log('\\x1b[32mFetched ' + userIds.length + ' students ids\\x1b[0m');\n\t\t\tgetUsersInfo();\n\t\t});\n\t});\n\treq.end();\n}", "getUser(id) {\n return this.users.filter(user => user.id === id)[0]; //VOY A TENER EL PRIMER ELEMENTO DE LA LISTA ES DECIR SOLO UN USUARIO / AL COLOCARLE QUIERO EL PRIMER ELEMENTO SOLO ME DARA EL OBJETO YA NO COMO LISTA DE OBJETO SINO SOLO EL OBJETO\n }", "function getUsers(req, res, next){\r\n\r\n\tUser.find()\r\n\t.where({privacy: false})\r\n\t.exec(function(err, results){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"Error Getting all the users that have a private set to false => \" + err);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconsole.log(\"Found \" + results.length + \" matching people on the mongoose.\");\r\n\t\tres.status(200).render(\"pages/getUsers\", {users: results , id:req.session.userId});\r\n\t\treturn;\r\n\t});\r\n\r\n}", "function getUsers() {\n let ourQuery = 'SELECT employeeID, name FROM QAA.user_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "getAllUserData(data) {\n\t\treturn db.any(`SELECT user_information.id, user_id.uname, locations.location, fish_library.species, user_information.user_fish_weight, user_information.user_fish_info \n\t\t\tFROM user_information\n\t\t\tJOIN user_id\n\t\t\tON user_id.u_id = user_information.user_id\n\t\t\tJOIN locations\n\t\t\tON locations.id = user_information.user_fish_loc_id\n\t\t\tJOIN fish_library\n\t\t\tON fish_library.fish_lib_id = user_information.user_fish_id\n\t\t\tWHERE user_information.user_id = $1\n\t\t\tORDER BY fish_library.species`, data)\n\t}", "getAllUser(req, callback) {\n User.find({}, {_id: 0, firstName: 1, email: 1}, (err,res) => {\n if(err)\n callback(err);\n else\n callback(null, res)\n })\n }", "function getUser(id) {\n return $http.get('http://jsonplaceholder.typicode.com/users?id=' + id)\n .then(getUsersSuccess)\n .catch(getUsersError);\n }", "allUsers() { return queryAllUsers() }", "getUserById(id){\n return this.auth.get(`/user/${id}`,{}).then(({data})=> data);\n }", "async getUserById(id){\n let users = await db.query('SELECT id, name, email FROM users WHERE id = ?', id);\n\n return users[0];\n }", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "function findUser(req, res, next){\r\n\r\n\t\r\n connection.query('SELECT * FROM Usuarios WHERE ID='+req.params.userId, function(error, results){\r\n if(error) throw error;\r\n \r\n \t res.send(200, results);\r\n return next();\r\n });\r\n}", "async find(id) {\n const users = await this.ctx.model.Users.findByPk(id);\n if (!users) {\n this.ctx.throw(404, 'user not found');\n }\n return users;\n }", "function getUser(id){\n console.log(\"[inside getUser\", id);\n console.log(\"users array: \", users)\n return users.find((user) => user.id ===id);\n \n}", "async getUserIds() {\n console.log('GET /users')\n return this.server.getUserIds()\n }", "function $getUser(id_user) {\n return $(\"li.opt_user>span\").filter(function (index) {\n return id_user == parseIdUser($(this).text());\n }).eq(0);\n}", "getUserById(req, res) {\n const id = req.params.id\n model.getUserById(id)\n .then((result) => {\n helper.response(res, result, 200, null)\n })\n .catch((err) => {\n helper.response(res, null, 400, err)\n })\n }", "function findUserById(id) {\n return fetch(`${self.url}/${id}`).then(response => response.json())\n }", "function search(data) { \r\n for (var i=0 ; i < users.length ; i++) {\r\n if (users[i]._id == data) { \r\n return users[i]; // 5 le return \r\n }\r\n }\r\n }", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "getAllUser(){\n return this.auth.get(\"/user\", {}).then(({data})=> data);\n }", "async show(req, res) {\n const identifier = req.params.id;\n const results = await knex('users').where({id: identifier})\n return res.json(results)\n }", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "function getAll (query) {\n return service.get('/user/all', {\n params: query\n })\n}", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "static getAllUsers(req, res){\n User.find((err, users) => {\n if (err) return res.json({ success: false, error: err });\n return res.json({ success: true, data: users });\n });\n }", "function getUser(id,res) {\n var user;\n if ( id && id !== '' && id !== undefined ) {\n userDbStub.forEach(function(element) {\n if(element.id === id ) {\n user = element;\n }\n }, this); \n \n if( !user && user === undefined) {\n if(res != null){\n res.status(404).send('user not found');\n }else{\n console.log('user not found');\n } \n }\n \n } else {\n if(res != null){\n res.status(401).send('id isn\\'t defined'); \n }else{\n console.log('id isn\\'t defined');\n } \n } \n return user;\n}", "searchUser(id) {\n cy.searchUser(id)\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "async function getSpecific(){\n const users = await User\n .find({id:req.params.id});\n if(users.length===0){\n res.status(404).send(`HTTP 404 -- Not Found`);\n } else\n res.send(users);\n console.log(cap);\n }", "getRsvpUsers(req, res) {\n // res.send(req.params.eventId);\n const { eventId } = req.params;\n // const { event } = req;\n // user is put directly on req by passport\n // user => object with props username, id\n\n db.InterestedEvent.findAll({\n where: { EventId: eventId, rsvp: 'going' },\n })\n .then((users) => {\n res.status(200);\n res.json(users);\n })\n .catch(err => errorHandler(req, res, err));\n }", "function loadUserInfo(id) {\n return User.findById(id).then(function (user) {\n G_UserInfo = userRefDict(user, user.currentWorkoutID);\n thisUser = G_UserInfo[\"User\"];\n G_thisStats = G_UserInfo[\"Stats\"];\n thisPatterns = G_UserInfo[\"thisPatterns\"];\n userFound = true;\n });\n}", "function getAllUsers (req, res, next) {\n db.any('SELECT * FROM \"user\";')\n .then((users) => {\n res.rows = users;\n next();\n })\n .catch(err => next(err));\n}", "function getUser(req, res){\r\n var userId=req.params.id;\r\n User.findById(userId).exec((err, user) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!user){\r\n res.status(404).send({message:'No se ha encontrado lista de administradores de institucion'});\r\n }else{\r\n res.status(200).send({user});\r\n }\r\n }\r\n });\r\n}", "function getUserByIdQuery(_id) {\n return User.findById(_id);\n}", "function getAllUsers(req, res) {\n db.many('select * from ' + dbConfig.schema + '.empleados')\n .then(function (data) {\n res.status(200).send({\n data: data\n });\n })\n .catch(function (err) {\n if(err.received == 0){\n res.status(404).send({message: 'No se han encontrado usuarios'});\n console.log(err);\n }else{\n res.status(500).send({message:'Error en el servidor'});\n }\n });\n}", "function getUsers() {\n return Object.values(usersDictById);\n }", "function getUsers(request, response) {\n User.find({}, function(err, users) {\n if(err) {\n response.status(500).json({message: \"No users were found.\"});\n }\n if(!users) {\n response.status(404).json({message: \"No users were found.\"});\n }\n var userList = [];\n users.forEach(function(element) {\n userList.push({name: element.fullName, userId: element.userId});\n })\n\n response.status(200).send(userList);\n })\n}", "function getAirwatchUsers(groupId, search) {\n var tenant = scriptProps.getProperty(\"airWatchTenant\");\n var airwatchParams = getAirwatchParams();\n var response = UrlFetchApp.fetch(\"https://\" + tenant + \"/api/system/users/search?locationgroupId=\" + groupId + search, airwatchParams); \n var text = response.getContentText();\n var json = JSON.parse(text);\n var data = json.Users;\n\n var airwatchUsers = {\n \"options\": []\n };\n\n for (var i = 0; i < data.length; i++) {\n var value = data[i].Id.Value\n airwatchUsers.options[i] = {\n \"text\": {\n \"emoji\": true,\n \"type\": \"plain_text\",\n \"text\": data[i].FirstName + \" \" + data[i].LastName\n },\n \"value\": value.toString()\n }\n };\n\n return airwatchUsers;\n}", "user(_, { id }) {\n return User.find(id);\n }", "function findAllUsers(req, res, next){\r\n connection.query('SELECT * FROM Usuarios', function (error, results){\r\n if(error) throw error;\r\n res.send(200, results);\r\n return next();\r\n });\r\n}", "function getUser(id){\n return fetch(`http://localhost:3000/users/${id}`)\n .then(res => res.json())\n }", "async function getHaulages(user_id){\n try{\n var HaulageModel = await ModelFactory.getModel(\"Haulage\")\n let haulages = await HaulageModel.findAll(\n { where: { Id_user: user_id } }\n )\n //query returns array of users that match were clause\n if(haulages.length==0)\n {\n logger.info(\"HaulageController: User has zero haulages\")\n return {status:0, data:\"no hulages found\"}\n }\n else{\n logger.info(\"HaulageController: User haulages found\")\n //h[0] should be the only user in array, .dataValues is Json containing atributes return {status: 1,data: haulages.dataValues}\n return {status: 1, data: haulages}\n }\n\n } catch (error) {\n logger.info(\"HaulageController: \"+ error)\n return {status:-1, data:error}\n }\n}", "function getAllAchivementsUser(req, res, next) {\n if (validate(req, res)) {\n db.any('select * from achievements_x_user')\n .then(function(data) {\n res.status(200)\n .json({\n status: 'success',\n data: data\n });\n })\n .catch(function(err) {\n res.status(500)\n .json({\n status: 'error',\n err: err\n });\n });\n }\n}", "function readUserInformation(api, id, query) {\n return api_1.GET(api, `/users/${id}`, { query })\n}", "function getAccountsByUserId(req, res, next){\n var params = req.params;\n console.log(params.userId)\n Account\n .find( {userId : params.userId})\n \n .exec((err, accounts) => {\n if (err) return next(err);\n if (!accounts) return next({\n message: 'game not found.',\n status: 404\n });\n \n utils.sendJSONresponse(res, 200, accounts);\n });\n }", "function getUsers(data){\n users = JSON.parse(data).results;\n renderUsers();\n}", "function findBy(filter) {\n return db('users as u')\n .where(filter)\n .orderBy(\"u.id\")\n .select(\"u.id\", \"u.name\", \"u.password\");\n}", "function findByUser(id) {\n return db(\"property\").where(\"user_id\", \"=\", id);\n}", "find(id, res) {\n if(id > 0) {\n models['user'].findOne({\n attributes: ['id','userid','name'],\n where: {id: id}\n }).then(user => {\n res.json(user);\n }); \n }\n else {\n models['user'].findAll({\n attributes: ['id','userid','name']\n }).then(users => {\n res.json({ users: users});\n });\n }\n }", "function findUser(userlist, id){\n for (var i in userlist){\n if (userlist[i].uid === id){\n return userlist[i]\n }\n }\n}", "function getUsers(req, res, next) {\n db.any('SELECT users.id, users.name, users.surname, users.email, users.birthday, users.gender, roles.name as role FROM users INNER JOIN roles ON users.role_id = roles.id ORDER BY users.id DESC')\n .then(function (data) {\n // Return data\n return res.status(200)\n .json({\n status: 'success',\n users: data\n });\n })\n .catch(function (error) {\n // Error occured\n return next(error);\n });\n}", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "static getById(req, res) {\n const id = req.params.id;\n\n UsersModel.get(id)\n .then(user => {\n if (!user.empty) {\n const User = {\n id: User.id,\n data: User.data()\n };\n\n return res.json(User);\n\n } else {\n return res.sendStatus(404)\n .send({ message: 'This supplier doesn`t exist on our database.' });\n }\n })\n .catch(err => {\n return res.sendStatus(500).json(err);\n });\n }", "function findUsers(req, res) {\n var username = req.query[\"username\"];\n var password = req.query[\"password\"];\n // findUserByCredentials\n if (username && password) {\n var promise = userModel\n .findUserByCredentials(username, password);\n promise.then(function(user) {\n res.json(user);\n });\n return;\n }\n // findUserByUserName\n else if (username) {\n var promise = userModel\n .findUserByUserName(username);\n promise.then(function (user) {\n res.json(user)\n });\n return;\n }\n var promise = userModel\n .findAllUsers();\n promise.then(function(users) {\n \"use strict\";\n res.json(users)\n });\n res.json(users);\n }", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "function getUsers() {\n return db('users')\n .select('id', 'username')\n}", "list(req, res) {\n return Panic.findAll({\n include: [\n {\n model: User,\n as: \"user\",\n attributes: [\"user_name\", \"user_cell\"],\n },\n {\n model: Responder,\n as: \"responder\",\n attributes: [\"responder_name\", \"responder_cell\", \"responder_location\", \"responder_lat\", \"responder_lng\"],\n },\n ],\n })\n .then((users) => res.status(200).send(users))\n .catch((error) => {\n res.status(400).send(error);\n });\n }", "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "function getUser(app){\n\treturn function(req, res){\n\t\tconst id = req.params.id;\n\t\tif(typeof id === 'undefined'){\n\t\t\tres.sendStatus(BAD_REQUEST);\n\t\t}\n\t\telse{\n\t\t\treq.app.locals.model.users.getUser(id).\n\t\t\t\tthen((results) => res.json(results)).\n\t\t\t\tcatch((err) => {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\tres.sendStatus(NOT_FOUND);\n\t\t\t\t});\n\t\t}\n\t};\n}", "function getUser(id) {\n return \"Akhil\";\n}", "function getPersonsByHobby(hobby) {\n return fetch(URL + \"hobby/\" + hobby)\n .then(res => res.json()\n )\n \n}", "getOne(data) {\n\t\treturn userModel.findOne({ personalID: data }).then(\n\t\t\tusers => {\n\t\t\t\treturn users;\n\t\t\t},\n\t\t\te => {\n\t\t\t\treturn e;\n\t\t\t}\n\t\t);\n\t}", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}" ]
[ "0.65712804", "0.6507643", "0.64661324", "0.6444435", "0.6352326", "0.62574583", "0.62258863", "0.6223066", "0.62215537", "0.6211341", "0.6192594", "0.6171471", "0.6170969", "0.61689293", "0.61489487", "0.6142468", "0.61366373", "0.6107716", "0.61033773", "0.60999733", "0.6091028", "0.6073573", "0.6069697", "0.6063695", "0.60620564", "0.6056113", "0.6052168", "0.60444", "0.60411847", "0.6028498", "0.6027492", "0.600875", "0.60003054", "0.5995743", "0.5995536", "0.5995246", "0.5990554", "0.5983256", "0.59812456", "0.5978465", "0.5975325", "0.5971495", "0.5965861", "0.5960413", "0.5947303", "0.5946348", "0.5925042", "0.5912208", "0.5910365", "0.59031886", "0.5900523", "0.58998394", "0.5893947", "0.58933085", "0.5875384", "0.58669645", "0.5861711", "0.58587426", "0.5857638", "0.58501357", "0.5845421", "0.5834787", "0.58315873", "0.58275753", "0.582625", "0.58230287", "0.5822898", "0.58114475", "0.5807366", "0.58056474", "0.5804219", "0.5802725", "0.5801225", "0.57988083", "0.57937056", "0.57926565", "0.57885146", "0.5788143", "0.5784999", "0.5782757", "0.57805544", "0.5780244", "0.57796717", "0.5774206", "0.57738626", "0.57732147", "0.57727385", "0.57719797", "0.5771828", "0.5771803", "0.5762257", "0.5757298", "0.57572967", "0.57568693", "0.5754173", "0.57539284", "0.5751752", "0.5751599", "0.5750649", "0.5745796" ]
0.7225104
0
right to left function
function setRtl(lang) { switch (lang) { case "ar": return setRightoleft({ status: true }); default: return setRightoleft({ status: false }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toLeft(){\n}", "function LeftNodeRight(node) {\n if (node) {\n LeftNodeRight(node.left);\n result.push(node.value);\n LeftNodeRight(node.right);\n }\n }", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "rightLeftCase(node) {\n if (!node.right) {\n throw new Error(\"rightLeftCase: right child not set\");\n }\n node.right = this.rotateRight(this.nodes[node.right]).id;\n return this.rotateLeft(node);\n }", "leftRightCase(node) {\n if (!node.left) {\n throw new Error(\"leftRightCase: left child not set\");\n }\n node.left = this.rotateLeft(this.nodes[node.left]).id;\n return this.rotateRight(node);\n }", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "leftLeftCase(node) {\n return this.rotateRight(node);\n }", "rightRightCase(node) {\n return this.rotateLeft(node);\n }", "left(i) { return (2*i + 1); }", "function leftToRight() {\n _displaymode |= LCD_ENTRYLEFT;\n command(LCD_ENTRYMODESET | _displaymode);\n}", "left(pos) { return this.d*(pos-1)+2; }", "right(pos) { return this.d*pos+1; }", "function left(i) {\n return i << 1;\n}", "right(i) { return (2*i + 2); }", "function toLeft(a) {\n return P.succeed(E.left(a));\n}", "left() {\r\n this.v = -2;\r\n }", "rotateLeft(node) {\n if (!node.right) {\n throw new Error(\"rotateLeft: right child was unavailable.\");\n }\n let parent = (node.parent) ? this.nodes[node.parent] : null;\n let right = this.nodes[node.right];\n // assume rights (old) left branch as our (new) right branch\n node.right = right.left;\n if (node.right) {\n this.nodes[node.right].parent = node.id;\n }\n // right will be new parent to node and assume old node's parent\n right.left = node.id;\n right.parent = node.parent;\n node.parent = right.id;\n // remap parent child pointer to right\n if (parent) {\n if (parent.left === node.id) {\n parent.left = right.id;\n }\n else if (parent.right === node.id) {\n parent.right = right.id;\n }\n else {\n throw new Error(\"rotateLeft() : attempt to remap parent back to child failed... not found\");\n }\n }\n else {\n if (this.apex !== node.id) {\n throw new Error(\"rightRotate expecting parentless node to be apex\");\n }\n this.apex = right.id;\n }\n // recalculate height and balance for swapped nodes\n this.updateBalance(node);\n this.updateBalance(right);\n return right;\n }", "rotateLeft() {\n let valueBefore = this.value;\n let rightBefore = this.right;\n this.value = this.left.value;\n\n this.right = this.left;\n this.left = this.left.left;\n this.right.left = this.right.right;\n this.right.right = rightBefore;\n this.right.value = valueBefore;\n\n this.right.getDepthFromChildren();\n this.getDepthFromChildren();\n }", "leftRotate(node) {\n if (node.right) {\n const rightNode = node.right;\n node.right = rightNode.left;\n rightNode.left = node;\n \n node.height = Math.max(this.getHeight(node.left), this.getHeight(node.right)) + 1;\n rightNode.height = Math.max(this.getHeight(rightNode.left), this.getHeight(rightNode.right)) + 1;\n \n return rightNode;\n }\n }", "function toLeft(){\n imgIndex--;\n if(imgIndex == -1){\n imgIndex = imgItems.length-1;\n }\n changeImg(imgIndex);\n }", "function LeftToRight(){\r\n\t\tif(theimage > 0 && click_ok){\r\n\t\t\tclick_ok = false;\r\n\t\t\timages.eq(theimage-1).removeClass('left');\r\n\t\t\timages.eq(theimage).removeClass('the');\r\n\t\t\timages.eq(theimage-1).addClass('the');\r\n\t\t\timages.eq(theimage+1).removeClass('right');\r\n\t\t\timages.eq(theimage).addClass('right');\r\n\t\t\t\r\n\t\t\tsetTimeout(endSlideToRight,200);\r\n\t\t}\r\n\t}", "left(i) {\n return (i * 2) + 1;\n }", "function bnShiftRight(n) {\n\tvar r = nbi();\n\tif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\treturn r;\n }", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "getLeft(){return this.__left}", "left() {\n switch (this.f) {\n case NORTH:\n this.f = WEST;\n break;\n case SOUTH:\n this.f = EAST;\n break;\n case EAST:\n this.f = NORTH;\n break;\n case WEST:\n default:\n this.f = SOUTH;\n }\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "function bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}", "toRightOf(p1, p2, p)\n {\n let nx = p2.getY() - p1.getY()\n let ny = p1.getX() - p2.getX() \n let vx = p.getX() - p1.getX()\n let vy = p.getY() - p1.getY()\n let s = nx * vx + ny * vy\n return s < 0\n }", "getRight(){return this.__right}", "function bnShiftRight(n) {\n\t var r = nbi();\n\t if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\t return r;\n\t }", "function bnShiftRight(n) {\n\t var r = nbi();\n\t if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\t return r;\n\t }", "function bnShiftRight(n) {\n\t var r = nbi();\n\t if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\t return r;\n\t }", "function right(i) {\n return (i << 1) + 1;\n}", "function bnShiftRight(n) {\n\tvar r = nbi();\n\tif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\treturn r;\n\t}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "rotateLeft() {\n // a b\n // / \\ / \\\n // c b -> a.rotateLeft() -> a e\n // / \\ / \\\n // d e c d\n const other = this.right;\n this.right = other.left;\n other.left = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.rightHeight, this.height) + 1;\n return other;\n }", "function bnShiftRight(n) {\n\t var r = nbi();\n\t if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\t return r;\n\t}", "function bnShiftRight(n) {\r\n\t var r = nbi();\r\n\t if (n < 0) this.lShiftTo(-n, r); else this.rShiftTo(n, r);\r\n\t return r;\r\n\t}", "function bnShiftRight(n) {\r\n\t var r = nbi();\r\n\t if (n < 0) this.lShiftTo(-n, r); else this.rShiftTo(n, r);\r\n\t return r;\r\n\t}", "leftrotate(root) {\n var temp = root.right;\n root.right = temp.left;\n temp.left = root;\n return temp;\n }", "function reverseDirection( dir ) {\n if(dir === 'left') {\n return 'right';\n }\n return 'left';\n}", "static get DIRECTION_LEFT() {\n return \"left\";\n }", "rotateRight(node) {\n if (!node.left) {\n throw new Error(\"rotateRight : left child unavailable\");\n }\n let parent = (node.parent) ? this.nodes[node.parent] : null;\n let left = this.nodes[node.left];\n // assume left's (old) right branch as our (new) left branch\n node.left = left.right;\n if (left.right) {\n this.nodes[left.right].parent = node.id;\n }\n // 'node' will be right child of left\n left.right = node.id;\n left.parent = node.parent;\n node.parent = left.id;\n if (parent) {\n if (parent.left === node.id) {\n parent.left = left.id;\n }\n else {\n parent.right = left.id;\n }\n }\n else {\n if (this.apex !== node.id) {\n throw new Error(\"rightRotate expecting parentless node to be apex\");\n }\n this.apex = left.id;\n }\n // recalculate height and balance for swapped nodes\n this.updateBalance(node);\n this.updateBalance(left);\n return left;\n }", "rotateRight() {\n // b a\n // / \\ / \\\n // a e -> b.rotateRight() -> c b\n // / \\ / \\\n // c d d e\n const other = this.left;\n this.left = other.right;\n other.right = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.leftHeight, this.height) + 1;\n return other;\n }", "right(i) {\n return (i * 2) + 2;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function nextRight(v){var children=v.children;return children?children[children.length-1]:v.t}", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "function getLeft(ma) {\n return ma._tag === \"Right\" ? none : some(ma.left);\n}", "function leftOrRight() {\n random = Math.floor(Math.random() * 10)\n if (random % 2 == 0) {\n return 1\n } else {\n return -1\n }\n}", "get left() { return 0; }", "static get DIRECTION_RIGHT() {\n return \"right\";\n }", "function bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);else this.rShiftTo(n, r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);else this.rShiftTo(n, r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);else this.rShiftTo(n, r);\n return r;\n }", "function layout_treeLeft(v) {\n\t var children = v.children;\n\t return children.length ? children[0] : v.t;\n\t} // NEXT RIGHT", "function bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);\n else this.rShiftTo(n, r);\n return r;\n }", "getLeft(pos){\n const x = pos[0]-1;\n const y = pos[1];\n return [x,y];\n }", "mergeLeft() {\n this.left.right = this.right;\n this.right.left = this.left;\n return this.left;\n }", "moveRight() {\n this.x<303?this.x+=101:false;\n }", "function bnShiftLeft(n) {\n\tvar r = nbi();\n\tif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n\treturn r;\n }", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "function rightDirection() {\n if ((!leftPressed && !rightPressed) || (leftPressed && rightPressed)) {\n return undefined;\n } else {\n if (leftPressed) {\n return Math.PI;\n } else {\n return 0;\n }\n }\n}", "function bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);\n else this.rShiftTo(n, r);\n return r;\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }" ]
[ "0.7550095", "0.71720326", "0.71361285", "0.6994268", "0.6929432", "0.6865777", "0.66811967", "0.6646705", "0.66431296", "0.64886266", "0.6482068", "0.6424207", "0.64165175", "0.6284513", "0.6281804", "0.62790155", "0.62592065", "0.62270707", "0.6221941", "0.6196062", "0.6187908", "0.6154907", "0.6148366", "0.6137286", "0.6132687", "0.6131229", "0.6129769", "0.61225784", "0.6116073", "0.6116073", "0.6116073", "0.6116073", "0.6116073", "0.6116073", "0.6116073", "0.61158484", "0.6114801", "0.611408", "0.611408", "0.61115", "0.61062163", "0.60984325", "0.60783213", "0.6073656", "0.6055834", "0.6054698", "0.6054698", "0.60343", "0.6031054", "0.60211104", "0.6014294", "0.60090107", "0.599195", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.5985054", "0.59828544", "0.5973036", "0.5963138", "0.5956638", "0.59523284", "0.5947464", "0.59390354", "0.59390354", "0.59390354", "0.5935606", "0.59310335", "0.59273285", "0.5924958", "0.5922675", "0.59197485", "0.591767", "0.591767", "0.591767", "0.591767", "0.591767", "0.591767", "0.591767", "0.5914298", "0.59112895", "0.5910572" ]
0.0
-1
Write a function `minMaxProduct(array)` that returns the product between the largest value and the smallest value in the array. Assume `array` is an array of numbers. Assume an array of at least two numbers. Example minMaxProduct([0,1,2,3,4,5]) => 0 minMaxProduct([5,4,3,2,1]) => 5 minMaxProduct([4,2,5,1,5]) => 25
function minMaxProduct(array){ var min = array[0]; var max = array[0]; for (var i = 0; i < array.length; i++) { if (min > array[i]) { min = array[i]; } else if (max < array[i]) { max = array[i]; } } return min * max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minMaxProduct(array){\n var biggestNumber = Math.max.apply(null, array); //only used this after reading Mozilla docs\n var smallestNumber = Math.min.apply(null, array); // \"\"\n return (biggestNumber * smallestNumber);\n}", "function minMaxProduct(array){\n // your code here...\n}", "function maximum_product(arr){\n var max1 = -Infinity;\n var max2 = -Infinity;\n var max3 = -Infinity;\n\n for(var i = 0; i < arr.length; i++) {\n if (arr[i] > max1) {\n max3 = max2;\n max2 = max1;\n max1 = arr[i];\n } else if (arr[i] > max2) {\n max3 = max2;\n max2 = arr[i];\n } else if (arr[i] > max3) {\n max3 = arr[i];\n }\n }\n return max1 * max2 * max3;\n}", "function largestProduct(arr) {\n if (arr.length <= 1) {\n throw new Error('Must provide at least two numbers');\n }\n\n let largest = arr[0];\n let secondLargest = arr[1];\n if (secondLargest > largest) {\n [largest, secondLargest] = [secondLargest, largest];\n }\n let smallest = secondLargest;\n let secondSmallest = largest;\n for (let i = 2; i < arr.length; i++) {\n const value = arr[i];\n if (value > largest) {\n secondLargest = largest;\n largest = value;\n }\n else if (value > secondLargest) {\n secondLargest = value;\n }\n if (value < smallest) {\n secondSmallest = smallest;\n smallest = value;\n }\n else if (value < secondSmallest) {\n secondSmallest = value;\n }\n }\n\n const largestProduct = largest * secondLargest;\n const smallestProduct = smallest * secondSmallest;\n if (largestProduct > smallestProduct) {\n return largestProduct;\n }\n else {\n return smallestProduct;\n }\n}", "function maxProductSubarray(arr){\n let max = 0;\n \n for(let i = 0; i < arr.length; i++) {\n let prod = arr[i];\n for(let j = i + 1; j < arr.length; j++) {\n prod *= arr[j];\n if(prod > max) max = prod;\n }\n if(prod > max) max = prod;\n }\n \n return max;\n}", "function maxMin(array) {\n return [Math.max.apply(Math, array), Math.min.apply(Math, array)];\n}", "function products(arr) {\n const maxProduct = arr.reduce((acc, val) => {\n acc *= val;\n return acc;\n });\n \n return arr.map(num => maxProduct / num);\n}", "function adjacentElementsProduct(inputArray) {\n let maxProduct = -Infinity;\n let currentProduct = inputArray[0]*inputArray[1];\n maxProduct = currentProduct;\n \n // edge case - what about 0's? - not counted \n \n for (let ii=1; ii<inputArray.length; ii++) {\n currentProduct = (currentProduct / inputArray[ii-1]) * inputArray[ii+1];\n if (currentProduct > maxProduct) {\n maxProduct = currentProduct;\n }\n }\n return maxProduct;\n}", "function adjacentElementsProduct(array) {\n let arr = [];\n for (let i = 0; i < array.length-1; i++)\n arr.push(array[i]*array[i+1]);\n return Math.max(...arr); \n}", "function findMaxMin(array) {\n let min = Math.min(...array)\n //Math.min.apply(null, array)\n let max = Math.max(...array)\n //Math.max.apply(null, array)\n\n let arrSum = array.reduce((acc, item) => acc + item)\n let minSum = arrSum - max\n let maxSum = arrSum - min\n return `Max: ${maxSum} \\t Min: ${minSum}`\n}", "function MaximumProductOfThree(array) {\n let temp;\n for (let i = 0; i < array.length; i++) {\n for (let j = i; j < array.length; j++) {\n if (array[i] > array[j]) {\n temp = array[j];\n array[j] = array[i];\n array[i] = temp;\n }\n }\n }\n return (\n array[array.length - 1] * array[array.length - 2] * array[array.length - 3]\n );\n}", "function maxNumbers(array) {\n\n return Math.max(...array);\n}", "function minMax(arr) {\r\n\tvar minMax =[Math.min(...arr), Math.max(...arr)]\r\n\treturn minMax;\r\n}", "function largestProductOfThree (array) {\n array.sort((a, b) => a - b);\n const product = (sum, value) => (\n sum * value\n );\n const product1 = array.slice(Math.max(array.length - 3, 0)).reduce(product);\n\n // Edge Case: negative numbers\n const greatestPositive = array.reduce((greatest, value) => Math.max(greatest, value));\n const leastNegative = array.slice(0, Math.min(array.length, 2)).reduce(product);\n const product2 = leastNegative * greatestPositive;\n\n return Math.max(product1, product2);\n}", "function calculateMax(array) {\n return array.reduce(function(max, elem) {\n return (elem > max) ? elem : max;\n }, array[0]);\n}", "function arrayOfProducts(array) {\n let left_products = Array(array.length).fill(1); \n let right_products = Array(array.length).fill(1); \n let result_products = Array(array.length).fill(1); \n \n let left_running_prod = 1; \n for(let i = 0; i < array.length; i++) {\n left_products[i] = left_running_prod; \n left_running_prod *= array[i]; \n }\n\n let right_running_prod = 1; \n for (let i = array.length - 1; i >= 0; i--) {\n right_products[i] = right_running_prod; \n right_running_prod *= array[i]; \n }\n\n for(let i = 0; i < array.length; i++) {\n result_products[i] = left_products[i] * right_products[i]; \n }\n\n return result_products; \n}", "function max(array){\n\tvar number= array[0];\n\tvar num1;\n\tfor (var i=0; i < array.length; i++){\n\t\tnum1= array[i];\n\t\tnumber = Math.max(number, num1);\n\t}\n\treturn number;\n}", "function max(array) {\r\n if (array.length == 0) return 0;\r\n\r\n return array.reduce((a, v) => Math.max(a, v));\r\n}", "function adjacentElementsProduct(inputArray) {\n\n var max = inputArray[0] * inputArray[1]; // initalizing a max to compare though out the for loop\n\n for (var i = 1; i < inputArray.length - 1; i++) {\n\n if (inputArray[i] * inputArray[i + 1] > max) {\n\n max = inputArray[i] * inputArray[i + 1];\n\n }\n\n }\n\n return max;\n}", "function minAdnMax(array) {\n var max = [];\n var min = [];\n var minAdnMax = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] !== false || array[i] !== undefined || array[i] !== NaN) {\n max = array[i];\n min = array[i];\n break;\n }\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] > max && typeof array[i] === \"number\") {\n max = array[i];\n }\n if (array[i] < min && typeof array[i] === \"number\") {\n min = array[i];\n }\n }\n minAdnMax = [min, max];\n return minAdnMax;\n}", "function minAdnMax(array) {\n var max = [];\n var min = [];\n var minAdnMax = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] !== false || array[i] !== undefined || array[i] !== NaN) {\n max = array[i];\n min = array[i];\n break;\n }\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] > max && typeof array[i] === \"number\") {\n max = array[i];\n }\n if (array[i] < min && typeof array[i] === \"number\") {\n min = array[i];\n }\n }\n minAdnMax = [min, max];\n return minAdnMax;\n}", "function multiplies(array) {\n var minElement = []\n var trenutniMinimum = array[0];\n var position = 0;\n for (var i = 0; i < array.length; i++) {\n var trenutniElement = array[i]\n if (trenutniMinimum > trenutniElement) {\n trenutniMinimum = trenutniElement;\n position = i\n\n }\n }\n minElement = [trenutniMinimum, position]\n return minElement\n}", "function minMax(type, array) {\n\n const denominators = array.map(a => a[1]);\n const lcm = Math.lcm(denominators);\n const numerators = array.map(a => lcm / a[1] * a[0]);\n\n const index = numerators.indexOf((\n type == 0?\n Math.min(...numerators) :\n Math.max(...numerators) \n ))\n\n return array[index]\n}", "function productOfBiggestNegativeNumbers(array) {\r\n let isArray = array.every((e) => Array.isArray(e));\r\n let productOfNums = 1;\r\n let nonNegativeArraysCount = 0;\r\n\r\n if (!isArray) {\r\n return \"Invalid Argument\";\r\n }\r\n\r\n \r\n \r\n for (let i = 0; i < array.length; i++) {\r\n if (Math.min(...array[i]) >= 0) {\r\n nonNegativeArraysCount++;\r\n continue;\r\n }\r\n let biggestNegativeNum = -Infinity;\r\n \r\n for (let j = 0; j < array[i].length; j++) {\r\n if (array[i][j] > biggestNegativeNum && array[i][j] < 0) {\r\n biggestNegativeNum = array[i][j];\r\n } \r\n }\r\n\r\n console.log(biggestNegativeNum,333)\r\n\r\n productOfNums *= biggestNegativeNum;\r\n }\r\n \r\n return nonNegativeArraysCount === array.length ? \"No negatives\" : productOfNums;\r\n}", "function maxNumber(array = []) {\n const max = Math.max(...array)\n return max\n}", "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "function largestProduct(list) {\n let max = Number.MIN_VALUE;\n let ret = [];\n for (let i = 0; i < list.length; i++) {\n for (let j = i + 1; j < list.length; j++) {\n for (let k = j + 1; k < list.length; k++) {\n if ( max < list[i] * list[j] * list[k] ) {\n ret = [list[i], list[j], list[k]];\n }\n }\n }\n }\n return ret;\n}", "function getMaxValue(array){\n return Math.max.apply(null, array);\n}", "function adjacentElementsProduct(arr) {\n var largestProduct = Number.NEGATIVE_INFINITY;\n for(var i=0; i<=arr.length-1; i++){\n if(arr[i]*arr[i+1] > largestProduct) {\n largestProduct = arr[i]*arr[i+1];\n } \n }\n \n return largestProduct\n}", "function maxNumber(array = []){\n const max = Math.max(...array);\n return max;\n}", "function minMax(arr) {\n let result = []\n result.push(Math.min.apply(null, arr)) //apply accepts a context (null takes 'context' position and is arbitrary in this use case)\n result.push(Math.max.apply(null, arr)) //followed by an array of arguments to be used inside the Math function apply was called on \n\n //alt ES6 syntax is Math.min(...arr) and Math.max(...arr)\n return result\n}", "function largest(array){\r\n\treturn Math.max.apply(Math,array);\r\n}", "function maxNumber(array = []) {\n const max = Math.max(...array);\n return max;\n}", "function maxNumber(array = []) {\n const max = Math.max(...array);\n return max;\n}", "function sol1(array) {\n\tlet minMax = []\n\tarray.forEach((ar,i)=>{\n\t\tlet arr1 = [...arr]\n\t\tarr1.splice(i, 1)\n\t\tminMax.push(arr1.reduce((acc,v)=> {\n\t\t\treturn acc + v\n\t\t}))\n\t\t\n\t})\n\tlet min = Math.min.apply(null, minMax)\n\tlet max = Math.max.apply(null, minMax)\n\tconsole.log({min:min, max:max, minMaxxArr: minMax})\n}", "function max(array) {\r\n\tvar max = array[0];\r\n\tfor(var i = 1; i < array.length; i++) {\r\n\t\tif(array[i] > max)\r\n\t\t\tmax = array[i];\r\n\t}\r\n\t\treturn max;\r\n\t}", "function outputMaxPrice(array) {\n let item1 = Math.max.apply(Math, array);\n let item2 = Math.min.apply(Math, array);\n return item1 - item2;\n\t\t}", "static getMax(array) {\n return Math.max(...array)\n }", "function max(array){\n\tvar max = array[0];\n\tfor(var i = 1; i < array.length; i++){\n\t\tif(array[i] > max){\n\t\t\tmax = array[i]\n\t\t}\n\t} \n\treturn max;\n}", "function largestProductOf2 (arr) {\n let prod = [];\n for (let i = 0; i < arr.length; i++) {\n for (let j = 1; j < arr.length; j++) {\n if (arr[i] !== arr[j]) {\n prod.push(arr[i] * arr[j]);\n }\n }\n }\n prod.sort((a,b) => {\n return b-a;\n })\n return prod;\n}", "function maxNumber(array) {\n return Math.max.apply(null, array);\n}", "function max(array){\n var maxNumber = array[0];\n for (var index = 1; index < array.length; index++) {\n if (maxNumber < array[i]){\n maxNumber = array[i];\n }\n }\n return maxNumber;\n}", "function minMax(arr) {\n return [Math.min(...arr), Math.max(...arr)];\n}", "function solve(a) {\n let min = 1, max = 1;\n for (let x of a) {\n let cur = [];\n for (let y of x) cur.push(y * min), cur.push(y * max);\n min = Math.min(...cur);\n max = Math.max(...cur);\n }\n return max;\n }", "function maxValueOfArray(array) {\n\treturn Math.max.apply(Math, array);\n}", "function minAndMax (array) {\n var min = Infinity;\n var max = -Infinity;\n var output = [];\n for ( var i = 0; i < array.length; i++) {\n \n if (array[i] > max) {\n max = array[i];\n \n } \n if(array[i] < min) {\n min = array[i]; \n } \n \n }\n output[output.length] = min;\n output[output.length] = max;\n return output;\n}", "function arrayOfProducts(array) {\n // Write your code here.\n let products = Array(array.length).fill(1); \n \n let left_running_prod = 1; \n for(let i = 0; i < array.length; i++) {\n products[i] = left_running_prod; \n left_running_prod *= array[i]; \n }\n \n let right_running_prod = 1; \n for (let i = array.length - 1; i >= 0; i--) {\n products[i] = right_running_prod*products[i]; \n right_running_prod *= array[i]; \n }\n \n return products; \n}", "function getMaxOfArray(numArray) {\n console.log(Math.max.apply(null, numArray));\n\n }", "function max(array) {\n\tvar currentmax = array[0];\n\tarray.forEach(function(element) {\n\t\tif(element > currentmax) {\n\t\t\tcurrentmax = element;\n\t\t}\n\t});\n\treturn currentmax;\n}", "function max(array) {\n var maxNum = array[0];\n for (var i = 0; i < array.length; i++) {\n if (maxNum < array[i]) {\n maxNum = array[i];\n }\n }\n return maxNum;\n}", "function adjacentElementsProduct(inputArray) {\n let greatestProduct = -1000;\n for (i = 0; i < inputArray.length - 1; i++) {\n const product = inputArray[i] * inputArray[i + 1];\n console.log(\"product:\", product + \" index: \" + i);\n if (product > greatestProduct) {\n greatestProduct = product;\n }\n console.log(\"greatestProduct:\", greatestProduct);\n }\n return greatestProduct;\n}", "function getMax(array) {\n if (array.length === 0) return undefined;\n\n // let max = array[0];\n\n // for (let i = 1; i < array.length; i++) {\n // if (array[i] > max) {\n // max = array[i];\n // }\n // }\n // return max;\n\n return array.reduce((a, c) => (a > c ? a : c));\n}", "function arrayOfProducts(array) {\n\tlet res = [];\n\t\n let preIprod = 1, \n\t\tpostIprod = 1; \n\t\n\tfor(let i = 0; i < array.length; i++) {\n\t\tres[i] = preIprod;\n\t\tpreIprod = preIprod * array[i];\n\t}\n\t\n\tfor(let j = array.length-1; j >= 0; j--) {\n\t\tres[j] = res[j] * postIprod; \n\t\tpostIprod = postIprod * array[j]\n\t}\n\t\n\treturn res;\n}", "function minAndMax (array) {\n var min = Infinity;\n var max = -Infinity;\n var output = [];\n for ( var i = 0; i < array.length; i++) {\n if (array[i] > max) {\n max = array[i];\n } else if(array[i] < min) {\n min = array[i]; \n } \n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] === min) {\n output[output.length] = max;\n } else if (array[i] === max) {\n output[output.length] = min;\n } else {\n output[output.length] = array[i];\n }\n }\n return output\n}", "function arrayOfProductsOptimized(arr) {\n\tconst result = new Array(arr.length).fill(1)\n\n let leftProduct = 1\n for (let i = 0; i < arr.length; i++) {\n result[i] = leftProduct\n leftProduct *= arr[i];\n }\n\n let rightProduct = 1\n for (let i = arr.length - 1; i <= 0; i--) {\n result[i] *= rightProduct\n rightProduct *= arr[i]\n }\n\n return result;\n}", "function adjacentElementsProduct(array) {\n\n let show = []\n array = array.map((item, ind, ar) => {\n if (ind != ar.length - 1) {\n show.push(item * ar[ind + 1])\n }\n })\n\n return Math.max(...show)\n\n}", "function arrayOfProducts(array) {\n return array.map((num1,i) => {\n\t\tlet product = 1;\n\t\tarray.forEach((num2,j) => {\n\t\t\tif (i !== j) product *= num2;\n\t\t})\n\t\treturn product\n\t})\n}", "function maxP(a){\n if(a.length<2){\n \t//fast fail, invalid scenario...\n \tconsole.log(\"invalide array scenario, needs at least 2 values present\");\n \treturn -1;\n }\n //greedy concept, keeping the best solution so far and throwing the rest away\n //allows you to only have to loop through the array once.\n let min=a[0]\n let max=a[1]\n let profit=max-min\n for(let i=1; i<a.length; i++){\n //if (min > a[i] && profit < max - a[i]){\n if (a[i] < min && (max - a[i])/*<-new profit*/ > profit){\n min=a[i] //reset min\n max=a[i+1] //shift max over\n }\n //if (max < a[i+1]){\n if (a[i+1] > max){\n max = a[i+1]\n }\n if (max-min > profit){\n profit=max-min\n }\n }\n return profit\n}", "function findMaxMin() {\n numbers = [8, 6, 1, 3];\n console.log(`This max of the array is: ${Math.max(...numbers)}`);\n console.log(`This min of the array is: ${Math.min(...numbers)}`);\n}", "function maximum( array ) {\n\t\tvar m = 0;\n\t\tfor (var i=0; i<array.length; i++) m = Math.max(m, array[i]);\n\t\t\n\t\treturn m;\n\t}", "function findMaxAndMin(array) {\n var i;\n var maxElement = 0;\n var minElement = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] > maxElement && typeof array[i] == 'number') {\n maxElement = array[i]\n }\n if (array[i] < minElement && typeof array[i] == 'number') {\n minElement = array[i]\n\n\n }\n result = [minElement, maxElement];\n\n }\n return result;\n\n}", "function maxOfArray(numbers) {\n return Math.max(...numbers)\n \n}", "function maxArr( inputArr ){\n var maxNumber = -Infinity;\n minArr.forEach(element => {\n if(element > maxNumber)\n maxNumber = element;\n });\n return maxNumber;\n}", "function maxOfArray(array) {\n const sorted = array.sort(function (a, b) {\n return b - a;\n });\n return sorted[0];\n}", "function maximumProduct( matrix ){\n let maximum = Number.MIN_VALUE; //setting maximum to lowest possible value\n let i, j, product1, product2;\n let rows = matrix.length,\n cols = matrix[0].length;\n for( i=0 ; i<rows ; i++ ){\n for( j=0 ; j< cols ; j++ ){//iterating through matrix\n if((j+3)<cols){//if element have 4 adjacent along x-axis, find product\n product1 = matrix[i][j] * matrix[i][j+1] * matrix[i][j+2] * matrix[i][j+3] ;\n //debugging console.log(`${matrix[i][j]}*${matrix[i][j+1]}*${matrix[i][j+2]}*${matrix[i][j+3]} = ${product1}\\n`);\n }\n if((i+3)<rows){//if element has 4 adjacent along y-axis ,find product\n product2 = matrix[i][j] * matrix[i+1][j] * matrix[i+2][j] * matrix[i+3][j] ;\n //debugging console.log(`${matrix[i][j]}*${matrix[i+1][j]}*${matrix[i+2][j]}*${matrix[i+3][j]} = ${product2}\\n`);\n }\n //set maximum to max of product1,product2 and itself\n if(product1>product2){\n if(product1 > maximum){\n maximum = product1;\n }\n }\n else{\n if(product2 > maximum){\n maximum = product2;\n }\n }\n //debugging console.log(maximum);\n }\n }\n return maximum;//finally returning maximum\n}", "function max (array) {\n\tvar a = 0;\n\tfor (var i = 0 ; i < array.length ; i++) {\n\t\tif (array[i] > a) {\n\t\t\ta = array[i] ;\n\t\t}\n\t}\n\treturn a ;\n}", "function getMaxOfArray(numArray){\n return Math.max.apply(null,numArray);\n}", "function elementsProduct(arr) {\r\n let res = -Infinity;\r\n for (let i = 0; i < arr.length - 1; i++) {\r\n if (arr[i] * arr[i + 1] >= res) {\r\n res = arr[i] * arr[i + 1];\r\n }\r\n }\r\n return res;\r\n}", "function productify(arr) {\n let res = [];\n let leftProd = 1;\n for (let i = 0; i < arr.length; i++) {\n res.push(leftProd);\n leftProd = leftProd * arr[i];\n }\n let rightProd = 1;\n for (let j = arr.length - 1; j >= 0; j--) {\n res[j] = res[j] * rightProd;\n rightProd = rightProd * arr[j];\n }\n return res;\n}", "function findLargestProductOf3(array) {\n if (array.length < 3) throw new Error('Array too small!')\n let largest;\n let secondLargest;\n let thirdLargest;\n let smallest;\n let secondSmallest;\n\n for (let currNum of array) {\n if (currNum > largest || largest === undefined) {\n thirdLargest = secondLargest;\n secondLargest = largest;\n largest = currNum;\n } else if (currNum > secondLargest || secondLargest === undefined) {\n thirdLargest = secondLargest;\n secondLargest = currNum;\n } else if (currNum > thirdLargest || thirdLargest === undefined) {\n thirdLargest = currNum;\n }\n\n if (currNum < smallest || smallest === undefined){\n secondSmallest = smallest;\n smallest = currNum;\n } else if (currNum < secondSmallest || secondSmallest === undefined) {\n secondSmallest = currNum;\n }\n }\n\n if (largest < 0) return [largest, secondLargest, thirdLargest]\n return secondLargest * thirdLargest > smallest * secondSmallest ? [largest, secondLargest, thirdLargest] : [largest, secondSmallest, smallest];\n}", "function findProd(array) {\n let sumArray = [];\n let sum = 1;\n\n for (let i = 0; i < array.length; i++) {\n sum = sum * array[i];\n }\n\n for (let i = 0; i < array.length; i++) {\n sumArray.push(sum / array[i]);\n }\n return sumArray;\n}", "function highestProductOf3(arrayOfNumbers) {\n if (arrayOfNumbers.length < 3) {\n throw Error(\"Less than 3 items!\");\n }\n\n // we're going to start at the 3rd item (at index 2)\n // so pre-populate highests and lowests based on the first 2 items.\n // we could also start these as null and check below if they're set\n // but this is arguably cleaner\n var highest = Math.max(arrayOfNumbers[0], arrayOfNumbers[1]);\n var lowest = Math.min(arrayOfNumbers[0], arrayOfNumbers[1]);\n\n var highestProductOf2 = arrayOfNumbers[0] * arrayOfNumbers[1];\n var lowestProductOf2 = arrayOfNumbers[0] * arrayOfNumbers[1];\n /**\n * Write code more clean\n * var highestProductOf2 = lowestProductOf2 = arrayOfNumbers[0] * arrayOfNumbers[1];\n * or just avoid repeat calculation\n * var lowestProductOf2 = highestProductOf2;\n */\n\n // except this one--we pre-populate it for the first *3* items.\n // this means in our first pass it'll check against itself, which is fine.\n var highestProductOf3 = arrayOfNumbers[0] * arrayOfNumbers[1] * arrayOfNumbers[2];\n /**\n * Instead use Number.NEGATIVE_INFINITY if i start with 2\n * var highestProductOf3 = Number.NEGATIVE_INFINITY;\n */\n\n // walk through items, starting at index 2\n for (var i = 2; i < arrayOfNumbers.length; ++i) { /** Why ++i instead of i++? */\n var current = arrayOfNumbers[i];\n\n // do we have a new highest product of 3?\n // it's either the current highest,\n // or the current times the highest product of two\n // or the current times the lowest product of two\n highestProductOf3 = Math.max(\n highestProductOf3,\n current * highestProductOf2,\n current * lowestProductOf2);\n /**\n * This is for Negative value? For this you can use \n * highestProductOf3 = Math.max(highestProductOf3, current ? current * highestProductOf2 : current * lowestProductOf2);\n */\n\n // do we have a new highest product of two?\n highestProductOf2 = Math.max(\n highestProductOf2,\n current * highest,\n current * lowest);\n\n // do we have a new lowest product of two?\n lowestProductOf2 = Math.min(\n lowestProductOf2,\n current * highest,\n current * lowest);\n /**\n * Again reputation and negative case. Math.min or Math.max itself do comparision inside.\n * var currentLowest = current ? current * lowest : current * highest;\n * var currentHightest = current ? current * highest : current * lowest;\n * highestProductOf2 = Math.max(highestProductOf2, currentHightest);\n * lowestProductOf2 = Math.min(highestProductOf2, currentLowest);\n */\n\n // do we have a new highest?\n highest = Math.max(highest, current);\n\n // do we have a new lowest?\n lowest = Math.min(lowest, current);\n }\n\n return highestProductOf3;\n}", "function maxOfArray(numbers) {\n console.log(Math.max(...array));\n \n return array.length -1\n // \n}", "function maxOfArray(numbers) {\n return Math.max(...numbers)\n}", "function minNumbers(array) {\n\n return Math.min(...array);\n}", "function max(array){\n\n let maximum = array[0]; \n\n for(let i = 0 ; i < array.length ; i++)\n {\n\n if(array[i] > maximum)\n maximum = array[i];\n }\n\n return maximum ; \n}", "function findMax(array) {\n maxValue = Math.max.apply(null, array);\n console.log(maxValue);\n}", "function max(array){\n var tmp = array[0];\n for(var i = 0; i < array.length; i++){\n if (array[i] > tmp){\n tmp = array[i]\n }\n }\n return tmp\n}", "function arrayProd(array, begin, end) {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}", "function array_max_value(array) {\n\t\treturn Math.max.apply(Math, array);\n\t}", "function highestProductOf3_3(arr) {\n\tif (!arguments.length && !Array.isArray(arr))\n\t\tthrow new Error('Expecting an array to be passed as an argument');\n\t\n\tvar maxValues = [];\n\tfor (var i = 0, len = arr.length; i < len; i++) {\n\t\tif (!maxValues.length || maxValues.length < 3) {\n\t\t\tmaxValues.push(arr[i]);\n\t\t}\n\t\t\n\t\tif (maxValues.length && maxValues.length === 3) {\n\t\t\tvar m = Math.max.apply(Math, maxValues);\n\t\t\tif (arr[i] > m) {\n\t\t\t\tvar idx = maxValues.indexOf(m);\n\t\t\t\tmaxValues.splice(idx, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar res = 1;\n\tfor (var j = 0; j < maxValues.length; j++)\n\t\tres *= maxValues[j];\n\treturn res;\n}", "function arrayProd(array, begin, end) {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n var prod = 1;\n for (var i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}", "function arrayProd(array, begin, end) {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n var prod = 1;\n for (var i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}", "function max(array) {\n if (array.length === 0) {\n return null;\n }\n\n let currentMax = array[0];\n for (let i = 1; i < array.length; i++) {\n const item = array[i];\n if (item > currentMax) {\n currentMax = item;\n }\n }\n return currentMax;\n}", "function max(array) {\r\n var max = 0;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n if(array[i] > max) {\r\n max = array[i];\r\n }\r\n }\r\n\r\n return max;\r\n }", "function multiplier(array) {\n\treturn array.reduce((acc, cur) => acc * cur);\n}", "function maxMin(arr) {\n return arr.sort((a,b) => b-a)\n}", "function max(a){\n\n var max = a[0];\n for(let i=1;i<a.length;i++){\n\n if(max<a[i]){\n max = a[i];\n }\n\n }\n return max;\n }", "function min(array) {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n return Math.min(...array);\n}", "function min(array){\n\tvar num1= array[0];\n\tvar num2;\n\tfor (var i = 0; i< array.length; i++){\n\t\tnum2= array[i]\n\t\tnum1= Math.min(num1, num2);\n\t}\n return num1;\n}", "static getMax(array) {\n \n // todo: do stuff here\n let arrayMax = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] > arrayMax) {\n arrayMax = array[i]\n }\n }\n return arrayMax;\n }", "function Max(array) {\n var max = -Infinity;\n for ( var i = 0; i < array.length; i++) {\n if (isFinite(array[i]) && array[i] > max) {\n max = array[i];\n } \n }\n return max;\n }", "function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}", "function greatestProduct(input) {\n let result = [];\n for(let i = 0; i < input.length - 4; i++){\n result.push(input.slice(i, i+5).split('').reduce((a, b) => a * b, 1));\n };\n return result.sort((a, b) => b - a)[0];\n}", "function getMin(array) { \n return Math.min(...array) //accepts list of numbers, not arrays by default so need to spread\n}", "function max1(array1){\n\nreturn Math.max(...array1);\n\n}", "function smallestNumber(array) {\n return Math.min(...array) \n}", "function findMax(array) {\n}", "function maxOfArray(array) {\n const reduced = array.reduce(function (max, num) {\n return num > max ? num : max;\n }, 0);\n console.log(reduced);\n return reduced;\n}", "function minNumber(array) {\n return Math.min.apply(null, array);\n}" ]
[ "0.8783292", "0.8142232", "0.72863984", "0.72103554", "0.7036269", "0.69720227", "0.69512016", "0.6931631", "0.68986726", "0.68151355", "0.67547876", "0.6730858", "0.6714051", "0.6672191", "0.6661583", "0.66550887", "0.6652756", "0.66503114", "0.662717", "0.6606599", "0.6606599", "0.65905625", "0.6579252", "0.65765536", "0.6568568", "0.6551278", "0.6550681", "0.6539155", "0.65269727", "0.65221906", "0.6472112", "0.64691764", "0.64623046", "0.64623046", "0.64554554", "0.6448179", "0.64404863", "0.6437388", "0.6435385", "0.6433673", "0.6412248", "0.6397794", "0.6390097", "0.6380884", "0.63804", "0.63783514", "0.6376166", "0.63653374", "0.63621986", "0.63620144", "0.63592863", "0.6351002", "0.63419497", "0.6298238", "0.62885165", "0.6287271", "0.6285593", "0.6280975", "0.62771195", "0.6265169", "0.62649727", "0.62526107", "0.62521565", "0.6250476", "0.62480325", "0.6244201", "0.624246", "0.62285423", "0.62267673", "0.62258947", "0.62247235", "0.6216141", "0.6214789", "0.6208314", "0.6207993", "0.62064195", "0.6200177", "0.6197268", "0.61956066", "0.61954033", "0.6183382", "0.61772346", "0.61772346", "0.6177008", "0.61743397", "0.6173021", "0.61629707", "0.61556", "0.6144141", "0.61429125", "0.6139678", "0.61383575", "0.6135706", "0.61326945", "0.61264545", "0.61133564", "0.6112718", "0.6106137", "0.61052567", "0.6080534" ]
0.9041857
0
Write a function `leastCommonMultiple(num1, num2)` that returns the lowest number which is a multiple of both inputs. Example leastCommonMultiple(2, 3) => 6 leastCommonMultiple(6, 10) => 30 leastCommonMultiple(24, 26) => 312
function leastCommonMultiple(num1, num2){ if (num1 === 2 || num2 === 2) { return num1 * num2 } else if (num1 % 2 === 0) { return (num1 / 2) * num2; } else if (num2 % 2 === 0) { return (num2 / 2) * num1; } else { return num1 * num2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leastCommonMultiple(num1, num2){\n var smallerNumber = Math.min(num1, num2);\n var largerNumber = Math.max(num1, num2);\n var multiple = smallerNumber;\n\n while(true) {\n if (multiple % largerNumber === 0) {\n return multiple;\n }\n multiple += smallerNumber;\n }\n}", "function leastCommonMultiple(num1, num2){\n // your code here...\n}", "function lcm(num1, num2) {\n var least = num2;\n if(num1 > num2){\n least = num1;\n }\n\n while (true) {\n if(least % num1 === 0 && least % num2 === 0){\n return least;\n }\n least += 1;\n }\n}", "function leastCommonMultiple(min, max) {\n function range(min, max) {\n var arr = [];\n for (var i = min; i <= max; i++) {\n arr.push(i);\n }\n return arr;\n }\n\n function gcd(a, b) {\n return !b ? a : gcd(b, a % b);\n }\n\n function lcm(a, b) {\n return (a * b) / gcd(a, b);\n }\n\n var multiple = min;\n range(min, max).forEach(function (n) {\n multiple = lcm(multiple, n);\n });\n\n return multiple;\n}", "function lcm(num1, num2){\n var sumNum = num1 * num2;\n// console.log(sumNum);\n //Using Math.min() returns the lowest number:\n if(sumNum % num1 !== 0 && sumNum % num2 !== 0){\n // console.log(Math.min(num1, num2));\n return Math.min(sumNum);\n }\n }", "static smallestCommonMultiple(arr) {\n\n const gcd = (num1, num2) => {\n for(let i = Math.min(num1, num2) ; i >= 2 ; --i) {\n if( (num1 % i == 0) && (num2 % i == 0) ) {\n return i;\n }\n }\n return 1;\n }\n \n let min = Math.min(...arr);\n let max = Math.max(...arr);\n let gcm = min;\n for(let i = min + 1; i <= max ; ++i) {\n gcm = (gcm * i) / gcd( gcm, i);\n }\n return gcm;\n\n }", "function smallestMultiple(val1, val2) {\n var min = val1;\n var max = val2;\n var divisible = 0;\n var number = val2;\n\n while (divisible < max) {\n for (var i = max; i >= min; i--) {\n if (number % i == 0) {\n divisible += 1;\n } else {\n divisible = 0;\n number += 1;\n }\n }\n }\n\n return number;\n}", "function commonDivisor (numb1, numb2) {\n var divisor = 0;\n var min = numb1;\n if (numb2 < min) {\n min = numb2;\n }\n for (var i = min; i > 0; i--) {\n if (numb1 % i === 0 && numb2 % i === 0) {\n divisor = i;\n break;\n }\n }\n return divisor;\n}", "function smallestCommons(arr) {\n var workArr = [];\n for (var x = Math.min(arr[0], arr[1]); x <= Math.max(arr[0], arr[1]); x++) {\n workArr.push(x);\n }\n //Euclidean Algorithm maybe... Math isn't my thing\n function gcd(a, b) {\n return !b ? a : gcd(b, a % b);\n }\n \n function lcm(a, b) {\n return (a * b) / gcd(a, b); \n }\n\n var smallestCommon = workArr[0];\n workArr.forEach(function(n) {\n smallestCommon = lcm(smallestCommon, n);\n console.log(smallestCommon)\n });\n\n return smallestCommon;\n}", "function smallestCommons(arr) {\n const min = Math.min(arr[0], arr[1]),\n max = Math.max(arr[0], arr[1]);\n\n function range(min, max) {\n let arr = [];\n\n for (let i = max; i >= min; i--) {\n arr.push(i);\n }\n return arr;\n }\n\n function gcd(x,y) {\n return y === 0 ? x : gcd(y, x % y);\n }\n\n function lcm(x, y) {\n return (x * y) / gcd(x, y);\n }\n\n let multiple = min;\n\n range(min, max).forEach(value => {\n multiple = lcm(multiple, value);\n });\n\n return multiple;\n}", "function lcm(num1, num2) {\n var lowestMultiple;\n console.log(\"check: var lowestMultiple is: \" + lowestMultiple)\n if (num1 === 2 || num2 === 2) {\n return num1 * num2;\n console.log(\"check 1: lowestMultiple is: \" + lowestMultiple);\n } else if (num1 % 2 === 0) {\n console.log(\"check 2: num1 divided by 2 is: \" + (num1 / 2));\n lowestMultiple = (num1 / 2) * num2;\n console.log(\"check 3: lowestMultiple is: \" + lowestMultiple);\n return (num1 / 2) * num2;\n } else if (num2 % 2 === 0) {\n console.log(\"check 4: num2 divided by 2 is: \" + (num2 / 2));\n lowestMultiple = (num2 / 2) * num1;\n console.log(\"check 5: lowestMultiple is: \" + lowestMultiple);\n return (num2 / 2) * num1;\n }\n //return lowestMultiple; //This is not returned. Why?\n}", "function smallestCommons(arr) {\n // Sort the array\n let sorted = arr.sort((a, b) => a - b);\n let max = 1;\n\n // Worst case scenario, the common multiple is factorial\n for (let j = sorted[0]; j <= sorted[1]; j++) {\n max *= j;\n }\n\n // Build the range array\n let range = Array(sorted[1] - sorted[0] + 1)\n .fill(sorted[0])\n .map((num, ind) => num + ind);\n\n let k = sorted[0];\n let multiple = sorted[1] * k;\n while (multiple < max) {\n multiple = sorted[1] * k;\n if (range.every((divisor) => multiple % divisor == 0)) {\n return multiple;\n }\n k++;\n }\n return max;\n}", "function smallestCommon(arr) {\n var range = [];\n for (var i = Math.max(arr[0], arr[1]); i >= Math.min(arr[0], arr[1]); i--) {\n range.push(i);\n }\n\n // can use reduce() in place of this block\n var lcm = range[0];\n for (i = 1; i < range.length; i++) {\n var GCD = gcd(lcm, range[i]);\n // debugger;\n lcm = (lcm * range[i]) / GCD;\n }\n return lcm;\n\n function gcd(x, y) { // Implements the Euclidean Algorithm\n if(x%y === 0){\n return y;\n }else{\n return gcd(y, x%y);\n }\n }\n}", "function smallestCommons(arr) {\n let beginRange = Math.min(...arr);\n let endRange = Math.max(...arr);\n let smallesCommonMultiple = beginRange;\n for (let i = Math.min(endRange, beginRange + 1); i <= endRange; i++) {\n smallesCommonMultiple = lcm(smallesCommonMultiple, i);\n }\n return smallesCommonMultiple;\n}", "function smallestCommons(arr) {\r\n\tstart = arr[0] < arr[1] ? arr[0] : arr[1];\r\n\tend = arr[1] > arr[0] ? arr[1] : arr[0];\r\n\tvar mult = 1;\r\n\tvar needs = (end - start) + 1;\r\n\twhile (true) {\r\n\t\thas = 0;\r\n\t\tfor (var i = start; i <= end; i++) {\r\n\t\t\tif (mult % i === 0) {\r\n\t\t\t\thas++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (has === needs) {\r\n\t\t\treturn mult;\r\n\t\t}\r\n\t\tmult++;\r\n\t}\r\n}", "function smallestCommons(arr) {\n\n\t// use only one order to simplify things\n\tarr = (arr[0] < arr[1]) ? arr : arr.reverse();\n\n\tlet found = false;\n\tlet curr = arr[1];\n\n\twhile (found === false) {\n\n\t\t// key to efficiency is increase by largest factor each pass\n\t\tcurr += arr[1];\n\t\t\n\n\t\t// flag to switch off if a remainder from division attempt\n\t\tlet divisible = true;\n\t\tfor (let i = arr[1]; i >= arr[0]; i--) {\n\t\t\t\n\t\t\tif(curr % i !== 0) {\n\n\t\t\t\tdivisible = false;\n\n\t\t\t\t// we need to return to while loop to try a bigger num\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if we are still divisible here we made it through inner loop,\n\t\t// this will be our lowest multiple.\n\t\tif(!divisible) {\n\t\t\tcontinue;\n\t\t}\n\t\telse {\n\t\t\tfound = curr;\n\t\t\tbreak;\n\t\t}\n\t}\n\n return found;\n\t\t\n}", "function smallestCommons(arr) {\n // sort arr in an ascending order\n arr = arr.sort((a, b) => a - b);\n // create an arr that holds all number between the two nums\n const newArr = [];\n for (let i = arr[0]; i <= arr[1]; i++) newArr.push(i);\n // iterate thru the 2nd arr\n for (let num = arr[0]; num < Infinity; num++) {\n // check if the num is divisible by all num in arr\n let isDivisible = newArr.every((el) => num % el === 0);\n // return the num\n if (isDivisible) return num;\n }\n}", "function smallestCommons(arr) {\n let lcm = (a, b) => {\n let gcd = (a, b) => {\n let min = Math.min(a, b);\n let max = Math.max(a, b);\n while (min !== 0) {\n let c = max % min;\n max = min;\n min = c;\n }\n return max;\n };\n return a * b / gcd(a, b);\n };\n return Array.from({length: Math.max(...arr) - Math.min(...arr) + 1 }, (_, v) => v + Math.min(...arr))\n .reduce((p, v) => lcm(p, v));\n}", "function smallestMultiple(from, to){\n var n = 1;\n for(var i=from; i<=to; i++){\n n = lcm(n, i);\n }\n return n; \n}", "function lessCommonMultiplier(a, b) {\n return (a * b) / greatestCommonDivisor(a, b);\n}", "function smallestCommons(arr) {\n let multiplier = 1;\n let result = 0;\n const max = Math.max(...arr);\n\n while (true) {\n result = max * multiplier;\n let isCommon = true;\n for (let min = Math.min(...arr); min < max; min++) {\n // console.log('result',result,'min',min)\n if (result % min !== 0) {\n isCommon = false;\n break;\n }\n }\n if (isCommon) return result;\n multiplier++;\n }\n}", "function lcm(a, b) {\r\n /**Return lowest common multiple.**/\r\n return Math.floor((a * b) / gcd(a, b));\r\n }", "function smallestCommons(arr) {\n\tarr = arr.sort((a, b) => a - b);\n\tconst myArr = [];\n\tlet every;\n\tfor (let i = arr[0]; i <= arr[1]; i++) {\n\t\tmyArr.unshift(i);\n\t}\n\tlet lcm = myArr[0] * myArr[1];\n\twhile (!every) {\n\t\tevery = myArr.every(num => lcm % num === 0);\n\t\tif (!every) {\n\t\t\tlcm += arr[1];\n\t\t}\n\t}\n\treturn lcm;\n}", "function smallestCommons(arr) {\n //find min and max numbers, push to array in order of smaller to larger number\n var range = [];\n\n var min = Math.min(arr[0], arr[1]);\n console.log(min);\n var max = Math.max(arr[0], arr[1]);\n console.log(max);\n\n for (var x = min; x <= max; x++) {\n //get range of numbers between min and max, push to array\n range.push(x);\n }\n\n var lcm = range[0];\n\n for (i = 1; i < range.length; i++) {\n var GCD = gcd(lcm, range[i]);\n lcm = (lcm * range[i]) / GCD;\n }\n return lcm;\n //Euclidean algorithm\n function gcd(x, y) {\n if (y === 0)\n return x;\n else\n return gcd(y, x % y);\n }\n}", "function gcd(num1, num2) {\n var commonDivisor = [ ];\n let highNum = num1;\n if(num1 < num2){\n highNum = num2;\n \n }\n \n for (let i = 1; i <= highNum; i++) {\n if(num1 % i === 0 && num2 % i === 0){\n commonDivisor.push(i);\n }\n } \n const returnNum = Math.max(...commonDivisor);\n return returnNum; \n \n}", "function min(num1, num2){\n return Math.min(num1, num2);\n}", "function findLCM([input1, input2]) {\n let multiples = [];\n if (input1 < input2) {\n for (let i = input1; i <= input2; i++) {\n for (let j = 0; j < 1000; j++) {\n if (j * i) {\n multiples.push(j);\n }\n }\n }\n }\n if (input1 > input2) {\n for (let i = input2; i <= input1; i++) {\n for (let j = 0; j < 1000; j++) {\n if (j * i) {\n multiples.push(j);\n }\n }\n }\n }\n return Math.min.apply(null, multiples);\n}", "function min(num1, num2) {\n return Math.min(num1, num2);\n}", "function smallestCommons(arr) {\n const [min,mix] = arr.sort((a,b)=> a-b);\n const numberDivisors = max - min + 1;\n let upperBound = 1 ;\n for (let i = min; i <= max; i++) {\n upperBound *= i;\n }\n for (let multiple = max; multiple <= upperBound; multiple += max) {\n // Check if every value in range divides 'multiple'\n let divisorCount = 0;\n for (let i = min; i <= max; i++) {\n // Count divisors\n if (multiple % i === 0) {\n divisorCount += 1;\n }\n }\n if (divisorCount === numberDivisors) {\n return multiple;\n }\n }\n}", "function lcm(num1, num2) {\n if (num1 === 2 || num2 === 2) {\n return num1 * num2;\n } else if (num1 === 1 || num2 === 1) {\n return num1 * num2;\n } else if (num1 % 2 === 0) {\n return (num1 / 2) * num2;\n } else if (num2 % 2 === 0) {\n return (num2 / 2) * num1;\n } else if (num1 % 2 !== 0 && num2 % 2 !== 0) {\n return num1 * num2;\n }\n}", "function lcm(num1, num2) {\n if ((num1 === 2 || num2 === 2) || (num1 === 1 || num2 === 1)) return num1 * num2;\n\n if (num1 % 2 === 0) return (num1 / 2) * num2;\n\n if (num2 % 2 === 0) return (num2 / 2) * num1;\n\n if (num1 % 2 !== 0 && num2 % 2 !== 0) return num1 * num2;\n}", "function min(num1, num2) {\n\treturn Math.min(num1, num2);\n}", "function smallestCommons(arr) {\r\n let max = Math.max(...arr);\r\n let min = Math.min(...arr);\r\n\r\n //Start with result = max (smallest possible common multiple) and decrement through array \r\n let result = max;\r\n for (let i = max; i >= min; i--) {\r\n //if not divisible, jump to next increment of the array max and restart for loop\r\n if (result % i) {\r\n result += max; \r\n i = max; //Need to set i back to max because may not be not finished with loop\r\n }\r\n }\r\n //will exit loop when everything is divisible by result\r\n return result;\r\n}", "function smallestCommons(arr) {\r\n arr = arr.sort();\r\n\r\n let range = (function() {\r\n let range = [];\r\n for (let i = arr[0]; i <= arr[1]; i++) {\r\n range.push(i);\r\n }\r\n return range;\r\n })();\r\n\r\n let count = 0;\r\n let mult = range[range.length - 1];\r\n\r\n while (count < range.length) {\r\n count = 0;\r\n for (let i = range[0]; i <= range[range.length - 1]; i++) {\r\n if (mult % i === 0) count++;\r\n }\r\n mult += range[range.length - 1];\r\n }\r\n return mult - range[range.length - 1];\r\n}", "function smallestCommons(arr) {\n let range = createRangeArr (arr);\n \n return findSmallestCommonMultiple(range);\n }", "function lcm (A, B) {\n let min = Math.min(A, B)\n while(true) {\n if(min % A === 0 && min % B === 0) {\n return min\n } \n min++\n }\n}", "function smallestCommons(arr) {\n let newArr = [];\n for(let i = Math.max(...arr); i >= Math.min(...arr); i--){\n newArr.push(i);\n }\n let odd = 1;\n if(newArr[0]%2 !== 0){\n odd = newArr[0];\n newArr.splice(0,1);\n }\n if(newArr.length === 2){\n return odd * newArr[0] * newArr[1];\n }\n\n let product = (odd * newArr[0] * newArr[1] * newArr[2]) /2;\n\n if(newArr.length === 3){\n return product;\n }else if(Math.min(...newArr) <= newArr[0]/2){\n newArr = newArr.filter(x => x > newArr[0]/2);\n if(newArr.length <= 3){\n return odd * smallestCommons(newArr);\n }\n }\n for(let i = 3; i < newArr.length; i++){\n var greatestCD = gcd(product, newArr[i]);\n product = product * newArr[i]/greatestCD;\n }\n return product;\n\n function gcd(x, y) {\n // Implements the Euclidean Algorithm\n if (y === 0)\n return x;\n else\n return gcd(y, x%y);\n }\n}", "function greatest_common_factor(number1, number2) {\n let divider = 1;\n let largeNum = number1 >= number2 ? number1 : number2;\n let smallNum = largeNum === number1 ? number2 : number1;\n while (divider <= smallNum) {\n let testNum = smallNum / divider;\n if (largeNum % testNum === 0) {\n return testNum;\n }\n divider++;\n }\n}", "function smallestCommons(arr) {\n function multipleArr(num) {\n return Array.from(\n {\n length: 10000\n },\n (v, k) => k * num\n );\n }\n\n function divideLst(arr, step) {\n let start = Math.min(arr[0], arr[1]);\n let end = Math.max(arr[0], arr[1]);\n return Array.from(\n {\n length: (end - start) / step + 1\n },\n (_, i) => start + i * step\n );\n }\n var lst1 = multipleArr(arr[0]);\n var lst2 = multipleArr(arr[1]);\n var divider = divideLst(arr, 1);\n var multLst = [];\n for (let i = 0; i < lst1.length; i++) {\n if (lst2.indexOf(lst1[i]) > 0) {\n multLst.push(lst1[i]);\n }\n }\n for (let x = 0; x < multLst.length; x++) {\n for (let y = 0; y < divider.length; y++) {\n if (multLst[x] % divider[y] !== 0) {\n delete multLst[x];\n }\n }\n }\n return multLst.filter(Boolean)[0];\n}", "function smallestCommons(arr) {\n\tarr.sort(function (a, b) {\n\t\treturn b - a;\n\t});\n\tconst smallest = arr[1];\n\tconst biggest = arr[0];\n\tlet solution = biggest;\n\n\tfor (let i = biggest; i >= smallest; i--) {\n\t\tif (solution % i) {\n\t\t\tsolution += biggest;\n\t\t\ti = biggest;\n\t\t}\n\t}\n\treturn solution;\n}", "function smallestCommons(arr) {\n let smallestMult = 0\n let range = []\n for (let i = Math.min(...arr); i <= Math.max(...arr); i++) {\n range.push(i)\n }\n\n while (true) {\n smallestMult += range[range.length - 1]\n let check = false\n for (let i = 0; i < range.length; i++) {\n if (smallestMult%range[i] !== 0) {\n break\n }\n if (i === range.length -1) {\n check = true\n }\n }\n if (check) {\n break\n }\n }\n console.log(smallestMult)\n return smallestMult;\n}", "function leastCommonMultiple(arr) {\n if (arr.length == 1) {\n return arr[0];\n }\n for (let i = 0; i < arr.length - 1; i++) {\n arr[i + 1] = (arr[i] * arr[i + 1]) / (greatestCommonDenominator([arr[i], arr[i + 1]]));\n }\n return arr[arr.length - 1];\n }", "function min(number1, number2) {\n console.log(Math.min(number1,number2))\n}", "function Division(num1, num2) {\n var greatestSoFar = 1;\n var min = Math.min(num1, num2);\n for(var i = 2; i <= min; i++) {\n if(num1%i === 0 && num2%i === 0) {\n greatestSoFar = i;\n }\n }\n return greatestSoFar;\n}", "function greatestCommonDivisor(num1, num2) {\n var divisor = 2,\n greatestDivisor = 1;\n\n // if num1 or num2 are negative values\n if (num1 < 2 || num2 < 2) return 1;\n\n while (num1 >= divisor && num2 >= divisor) {\n if (num1 % divisor == 0 && num2 % divisor == 0) {\n greatestDivisor = divisor;\n }\n divisor++;\n }\n return greatestDivisor;\n}", "function smallestNumber(num1, num2){\n\tif(num1<num2){\n\t\treturn num1;\n\t} else{\n\t\treturn num2;\n\t}\n}", "function min(one, two){\n return Math.min(one, two);\n}", "function gcd(num1, num2){\n let numArray1 = [];\n let numArray2 = [];\n let finalArray = [];\n let longestArray;\n let shortestArray;\n for (let i = 1; i <= Math.floor(num1); i++) {\n if (num1 % i === 0) {\n numArray1.push(i);\n } \n }\n for (let i = 1; i <= Math.floor(num2); i++) {\n if (num2 % i === 0) {\n numArray2.push(i);\n } \n } \n for (let i = 0; i < numArray1.length || i < numArray2.length; i++) {\n if (numArray1.length > numArray2.length){\n longestArray = numArray1;\n shortestArray = numArray2;\n }\n else {\n longestArray = numArray2;\n shortestArray = numArray1;\n }\n }\n for (let i = 0; i < shortestArray.length; i++) {\n if(longestArray.indexOf(shortestArray[i]) > -1){\n finalArray.push(shortestArray[i]);\n } \n }\n return Math.max(...finalArray);\n }", "function minimum(num1, num2){\n if (num1 < num2)\n return num1;\n else\n return num2;\n}", "function gcd (num1, num2) {\n var num1Factors = [];\n var num2Factors = [];\n for (var i = 1; i <= num1; i++) {\n if (num1 % i === 0) {\n num1Factors.push(i);\n }\n }\n for (var j = 1; j <= num2; j++) {\n if (num2 % j === 0) {\n num2Factors.push(j);\n }\n }\n var commonFactors = [];\n for (var k = 0; k < num1Factors.length; k++) {\n for (var m = 0; m < num2Factors.length; m++) {\n if (num1Factors[k] === num2Factors[m]) {\n commonFactors.push(num1Factors[k])\n }\n }\n }\n return commonFactors.pop();\n}", "function minNumber(num1, num2){\n if(num1 < num2){\n return(num1);\n }\n return(num2);\n}", "function min(num1, num2) {\n if (num1 < num2)\n return num1;\n return num2;\n}", "function min(num1, num2) {\r\n\tif (num1 < num2)\r\n\t\treturn num1;\r\n\telse\r\n\t\treturn num2;\r\n}", "function lcm(a,b)\n{\n return (a*b)/gcd(a,b);\n}", "function smallestCommons(arr) {\n let newArr = [], multiplier = 2\n arr.sort(function(a,b){\n return b - a;\n })\n\n for(let i = arr[0]; i >=arr[1]; i--){\n newArr.push(i)\n }\n \n for (let j = 0; j < newArr.length; j++){\n if ((newArr[0] * multiplier) % newArr[j] !== 0){\n multiplier += 1\n j = 0\n }\n }\n\n return newArr[0] * multiplier \n}", "function smallestCommons(arr) {\r\n var scm = 0,\r\n tryAgain = true;\r\n\r\n arr.sort(function(a, b) {\r\n \"use strict\";\r\n return a > b;\r\n });\r\n\r\n scm = arr[0];\r\n\r\n while (tryAgain) {\r\n while(scm % arr[1] !== 0) {\r\n scm += arr[0];\r\n }\r\n\r\n for(var i = arr[0]; i <= arr[1]; i += 1) {\r\n if(scm % i !== 0) {\r\n scm += arr[0];\r\n break;\r\n }\r\n if(i === arr[1]) {\r\n tryAgain = false;\r\n }\r\n }\r\n }\r\n\r\n return scm;\r\n}", "function min (num1, num2){\n if (num1 < num2) {\n return num1;\n } else {\n return num2;\n }\n}", "function lcmOfTwo( a, b ) {\n return ( a * b ) / gcd( a, b );\n}", "function gcd(a, b) {\n const commonFactors = [];\n const min = Math.min(a, b);\n const max = Math.max(a, b);\n for (let i = 1; i <= min; i++) {\n if (min % i === 0 && max % i === 0) {\n commonFactors.push(i);\n }\n }\n return commonFactors[commonFactors.length - 1];\n}", "function min(num1, num2){\n if(num1 < num2){\n return num1;\n }\n else{\n return num2;\n }\n}", "function lcm(a, b) {\n\treturn a * b / gcd(a,b);\n}", "function minimumNumber(numbers){\n let sum = numbers.reduce((a,b)=>a+b);\n let minNum = 0;\n for(let i=2; i<sum; i++){\n if((sum)%i===0){\n sum++\n minNum++\n //reset i so we can loop through next number\n i=2;\n }\n } \n return minNum;\n}", "lcm(a, b) {\n return a.mul(b).div(integer.gcd(a, b)).toInteger();\n }", "function smallestCommons(arr) {\n\tvar lCM;\n\tvar myArr = [];\n\tif (arr[1] < arr[0]) {\n\t\tmyArr.push(arr[1]);\n\t\tmyArr.push(arr[0]);\n\t} else {\n\t\tmyArr = arr;\n\t}\n\tvar allNumsArr = [];\n\tfor (var i = myArr[0]; i <= myArr[1]; i++) {\n\t\tallNumsArr.push(i);\n\t}\n\n\tvar numsToMultiply = [];\n\n\tfor (var j = 10; j > 0; j--) {\n\t\tvar passed = allNumsArr.every(function (currVal) {\n\t\t\treturn currVal % j === 0;\n\t\t});\n \n\t\t//numsToMultiply.push(j);\n\t\tallNumsArr = allNumsArr.map(function (e) {\n\t\t\tif (e % j === 0) {\n\t\t\t\treturn e / j;\n\t\t\t} else {\n\t\t\t\treturn e;\n\t\t\t}\n\t\t});\n\n\t}\n\n\n\n}", "function smallestCommons(arr) {\n // Sort from greatest to lowest num\n arr.sort(function(a,b){\n return b - a;\n })\n // Create a new array and add all the values from greater to smaller from the original array\n var newArr = []; \n for(var i = arr[0]; i>= arr[1]; i--){\n newArr.push(i)\n }\n // variables needed declared outside of the loop\n var quot = 0;\n var loop = 1;\n var n;\n // Run the code while n is not the same as the array length\n do{\n quot = newArr[0] * loop * newArr[1];\n for(n = 2; n < newArr.length; n++){\n if(quot % newArr[n] !== 0){\n break;\n }\n }\n loop++;\n } while (n !== newArr.length);\n return quot;\n }", "function min(num1, num2){\n if (num1<=num2){return num1;}\n else {return num2;}\n}", "function min(num1, num2) {\nif (num1 < num2) {\n return num1;\n } else {\n return num2;\n } \n\n}", "function leastCommonAnc(nodeA, nodeB) {\n\n //Find depth of each node\n var depthA = getDepth(nodeA);\n var depthB = getDepth(nodeB);\n\n //Determine lower and upper\n var upper = Math.max(depthA, depthB);\n var lower = Math.min(depthA, depthB);\n\n //Find ancestor of lower that's at the same depth as upper\n var limit = 0;\n var currentNode = lower;\n\n while (limit < upper - lower) {\n currentNode = currentNode.parent;\n }\n\n //Now currentNode is lower's ancestor that's at the same depth as upper\n while (currentNode !== null) {\n if (currentNode.val === upper.val) {\n return currentNode;\n }\n\n //For both nodes, step up one parent at a time\n currentNode = currentNode.parent;\n upper = upper.parent;\n }\n return -1;\n}", "function min(num1,num2){\n\treturn num1 > num2 ? num2 : num1;\n}", "function minimum(num1, num2){\n if (num1 > num2){\n return num2;\n }\n else {\n return num1;\n }\n\n}", "function min(num1,num2){\n\tif(num1<num2){\n\t\treturn num1\n\t}\n\t return num2\n\n}", "function lcm(a, b) {\n return (a * b) / gcd(a, b); \n }", "function lcmTwoNumbers(x, y) {\n if ((typeof x !== 'number') || (typeof y !== 'number'))\n return false;\n return (!x || !y) ? 0 : Math.abs((x * y) / lcmTwoNumbers(x, y));\n}", "function getLCM(num1, num2) {\n if (num1 === 0 || num2 === 0) return 0;\n\n const gcd = getGCD(num1, num2);\n return Math.trunc((Math.max(num1, num2) / gcd) * Math.min(num1, num2));\n}", "function min(number1, number2){\n if (number1 < number2){\n return number1;\n }\n else {\n return number2;\n }\n}", "function minimumNumber(numbers) {\n\n // get the curret array sum\n const sum = numbers.reduce((s, v) => s += v);\n\n const isPrime = num => {\n if (num <= 1) return false;\n if (num < 4) return true;\n if (num % 2 === 0) return false;\n\n let divisor = 3\n while (divisor <= Math.sqrt(num)) {\n if (num % divisor === 0) {\n return false;\n } else {\n divisor += 2;\n }\n }\n return true;\n }\n\n let diff = 0;\n // loop upwards 1 by 1 until a prime is not found \n while (!isPrime(sum + diff)) {\n diff++;\n }\n\n return diff;\n}", "function smallestCommons(arr) {//locura\r\n //ordenamos el array\r\n let max\r\n let min\r\n//ordenamos\r\n if( arr[0]<arr[1]){\r\n min=arr[0]\r\n max=arr[1]\r\n }else {\r\n max=arr[0]\r\n min=arr[1]\r\n }\r\n //multiplos \r\n //obtenemos el array con el rango entre el min y el maximo\r\n function getRange(m, mx){\r\n let arrRange= []\r\n for(let i = min; i<=max; i++){\r\n arrRange.push(i)\r\n }\r\nreturn arrRange\r\n }\r\n let range= getRange(min, max)\r\n //console.log(range)\r\n let multiple= 1 //no podemos multiplicar por 0\r\n while(multiple<1000000){\r\n let mcm=(min*multiple)*max\r\n //miramos los que son divisibles en el rango\r\n\r\n let divTrue= 0\r\nfor(let i= 0;i <range.length;i++){\r\n //console.log(mcm, range)\r\n if(mcm % range[i]===0){\r\n divTrue+=1\r\n//console.log('divisible entre:',divTrue, 'rango',range.length)\r\n//divTrue nos dice cuando es divisible, en el caso de que sea divisible en todos los casos del rango, hemos encontrado la respuesta 6 es divisible entre 1, 2, 3, con resto 0. Por eso 6 es el minimoComunMultiplo del rango[1,2,3]\r\n if(divTrue===range.length){\r\n return mcm //retornamos el multiplo\r\n }\r\n }\r\n \r\n}\r\n multiple +=1\r\n }\r\nreturn ' Fuera de rango'\r\n}", "function minuse(num1,num2){\r\n return num1-num2;\r\n}", "function commonFactors(num1, num2) {\n const factors = []\n let max\n max = num1 > num2 ? num1 : num2\n for (let i = max; i >= 1; i--) {\n if (num1 % i === num2 % i) {\n factors.push(i)\n }\n }\n return factors\n}", "function findSmallestMultiple(){\n var i;\n var limit=20;\n var num=1;\n\n for(i=1;i<=limit;){\n if(num%i){\n num++;\n i=1;\n continue;\n }\n i++;\n }\n return num;\n}", "findGCD (num1, num2) {\n let max = num1 > num2 ? num1 : num2\n let min = num1 > num2 ? num2 : num1\n let diff = max - min\n while (diff !== 0) { \n let temp = min % diff\n min = diff\n diff = temp\n }\n return min\n }", "function greatestCommonDivisor (a, b) {\n var gcd = 1;\n var low = a <= b ? a : b;\n for (var i = 2; i < low; i++) {\n if (a % i == 0 && b % i == 0 ) {\n gcd *= i;\n a /= i; \n b /= i;\n low /= i;\n }\n }\n return gcd;\n}", "function findSmallestOnThree(num1, num2, num3) {\n if (num1 < num2 && num1 < num3) {\n return num1;\n }\n else if (num2 < num1 && num2 < num3) {\n return num2;\n }\n return num3;\n}", "function min(a, b) { return Math.floor(Math.min(a, b)); }", "function min(a, b) { return Math.floor(Math.min(a, b)); }", "function min(a, b) { return Math.floor(Math.min(a, b)); }", "function greatesrDivisor(num1, num2) {\n let divisors = [];\n for(i=1; i <= num2; i++)\n if(num1%i === 0 && num2%i === 0){\n divisors.push(i)\n }\n let largestDivisors = divisors.reduce(function(a,b){\n return Math.max(a, b);\n })\n return largestDivisors;\n\n}", "function smallestNumber (a, b) {\n if (a < b) {\n return a;\n } else {\n return b;\n }\n}", "function gcd(a,b){\n let am=Math.abs(a), bm=Math.abs(b), min=Math.min(a,b);\n for (var i=min;i>0;i--){\n if (am%i===0 && bm%i===0) return i;\n }\n }", "function lcm(a,b) {\n let theLCM = 0;\n let remainderA;\n let remainderB;\n\n do {\n theLCM ++;\n remainderA = theLCM % a;\n remainderB = theLCM % b;\n \n } while (remainderA !== 0 || remainderB !== 0);\n return theLCM;\n}", "function min(num1, num2) { \n if ((num1 == null) || (num2 == null)) {\n return(Infinity);\n } else if ((isNaN(num1)) || (isNaN(num2))) {\n \treturn(NaN);\n } else if (num1 < num2) {\n \treturn num1;\n } else if (num1 > num2) {\n \treturn num2;\n } else if (num1 = num2) { \n return num1;\n } else {\n return(\"Something didn't work\");\n }\n}", "function highestCommonFactor1(a, b) {\n if (b === 0) {\n return a;\n }\n return highestCommonFactor1(b, a%b);\n}", "function smallestMultiple(maxDivisor) {\n\tvar outerIndex, innerIndex;\n\n\tfor (outerIndex = maxDivisor; 1; outerIndex ++) {\n\t\tfor (innerIndex = 2; innerIndex <= maxDivisor; innerIndex++) {\n\t\t\tif (outerIndex % innerIndex) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (innerIndex === maxDivisor) {\n\t\t\t\treturn outerIndex;\n\t\t\t}\n\t\t}\n\t}\n}", "function greatestCommonDivisor(a, b) {\n\tvar divisor = 2,\n\t\tgreatestDivisor = 1;\n\n\tif (a < 2 || b < 2) \n\t\treturn 1;\n\n\twhile (a >= divisor && b >= divisor) {\n\t\tif (a % divisor == 0 && b % divisor == 0) {\n\t\t\tgreatestDivisor = divisor;\n\t\t}\n\n\t\tdivisor++;\n\t}\n\n\treturn greatestDivisor;\n}", "function gcdEuclid(num1, num2) {\n let min = Math.min(num1, num2);\n let max = Math.max(num1, num2);\n if(max % min === 0) return min;\n else return gcdEuclid(min, max % min);\n}", "function divisor(num1, num2){\n var small = getSmall(num1, num2);\n //var primes = [2,3,5,7];\n \n for (var i = small; i > 0; i--){\n if ( num1 % i === 0 && num2 % i === 0){\n return i;\n }\n \n // else, check if divisible by primes starting with highest number\n // don't need this\n /*for (var j = primes.length; j > 0; j--){\n if ( num1 % primes[j - 1] === 0 && num2 % primes[j - 1] === 0 ){\n return i;\n }\n }*/\n \n }\n \n return 1;\n}", "function gcf(num1, num2){\n if (num1 > num2){ //this ensures num1 is the smaller number\n var temp = num1; // 1...\n num1 = num2;\n num2 = temp;\n }\n for (var i = num1; i > 1; i--){ // n - dictated by size of num1\n if (num1 % i === 0 && num2 % i === 0){ // 2\n return i;\n }\n }\n return 1;\n}", "function greatestCommonDivisor(a, b) {\n var divisor = 2,\n greatestDivisor = 1;\n\n if (a < 2 || b < 2) {\n return 1;\n }\n\n while (a >= divisor && b >= divisor) {\n if (a % divisor == 0 && b % divisor == 0) {\n greatestDivisor = divisor;\n }\n divisor++;\n }\n return greatestDivisor;\n}", "function min (a, b) {\n return Math.min(a, b);\n}", "function Division(num1,num2) { \n var gcf = 1; // gcf represents the greatest common factor, which is what we're ultimately trying to figure out here. The GCD for 2 numbers is always at least 1.\n for (var i = 0; i <= num1 && i <= num2; i++){ // FOR-LOOP: Starting at 0, and up until i reaches either the value of num1 or num2 (whichever is lesser), for each number up to that point...\n if (num1 % i == 0 && num2 % i == 0){ // IF: i is a common factor of both num1 and num2... \n // ^ Think about the code here. var i reprsents potential common factors. If there is no remainder after dividing num1 by i, then i is a factor of num1. Using the && allows us to test if i is a COMMON factor b/w num1 and num2\n\n gcf = i; // -> if i is a common factor -> then make the value of i as the greatest common factor (which is subject to change as we proceed thru the for-loop)\n }\n }\n return gcf; // return the value of the greatest common factor\n}" ]
[ "0.9017953", "0.8722978", "0.7976531", "0.78440845", "0.7657435", "0.75450426", "0.75349295", "0.7462742", "0.74439675", "0.74222004", "0.7396669", "0.73602855", "0.73050475", "0.7280567", "0.7251591", "0.72227526", "0.72107136", "0.7208665", "0.7195854", "0.7193158", "0.7186878", "0.7172106", "0.7147205", "0.712315", "0.712141", "0.70614755", "0.70518106", "0.70514953", "0.7023096", "0.70139563", "0.70139486", "0.7008383", "0.70021695", "0.69846314", "0.6975961", "0.69497305", "0.69068855", "0.6893739", "0.6843768", "0.68365085", "0.68026984", "0.67983156", "0.6793451", "0.67817754", "0.67800504", "0.6778153", "0.67707926", "0.6746524", "0.6730461", "0.6725896", "0.6719434", "0.66959083", "0.6674822", "0.6669809", "0.6661505", "0.6660196", "0.6618681", "0.6609549", "0.65895283", "0.65749645", "0.6560065", "0.6552046", "0.65518093", "0.6549972", "0.65414953", "0.65094256", "0.65056413", "0.6505264", "0.6503704", "0.6495456", "0.6487695", "0.6486579", "0.64677423", "0.6466321", "0.6460612", "0.64526033", "0.64243144", "0.6422774", "0.6414307", "0.6411283", "0.64065135", "0.6378761", "0.63396746", "0.63303995", "0.63303995", "0.63303995", "0.6324425", "0.632228", "0.6316395", "0.62971205", "0.62913704", "0.62743324", "0.62643313", "0.6261776", "0.6256168", "0.62361264", "0.6223588", "0.620798", "0.6174026", "0.61706096" ]
0.8883312
1
Write a function `hipsterfy(sentence)` that takes takes a string containing several words as input. Remove the last vowel from each word. 'y' is not a vowel. Example hipsterfy("proper") => "propr" hipsterfy("proper tonic panther") => "propr tonc panthr" hipsterfy("towel flicker banana") => "towl flickr banan" hipsterfy("runner anaconda") => "runnr anacond" hipsterfy("turtle cheeseburger fries") => "turtl cheeseburgr fris" Solution from Paris with one function and two for loops
function hipsterfy(sentence){ var splitSentence = sentence.split(" "); var vowels = ["a","e","i","o","u"]; var newSentence = []; for (var i = 0; i < splitSentence.length; i++) { var word = splitSentence[i]; for (var k = word.length - 1; k >=0 ; k--) { // console.log(word[k]); if (vowels.indexOf(word[k]) !== -1) { // console.log("word[k] is: " + word[k]); word = word.slice(0,k) + word.slice(k+1); // console.log("word before the break is: " + word); break; } } newSentence.push(word); } return newSentence.join(" "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hipsterfy(sentence){\n\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n\n var sentArr = sentence.split(' ');\n//iterate through the array:\n for(var i = 0; i < sentArr.length; i++){\n var word = sentArr[i];\n // console.log(word);\n //iterate through the element itself:\n // for(var j = 0; j < word.length; j++)\n\n //reverse forloop, start from the back of string:\n // j >=0, you want to get to index 0 by iterating\n //from largest index position to lowest.\n for(var j = word.length - 1; j >= 0; j--){\n // console.log(word[j]);\n if(vowels.indexOf(word[j]) !== -1){\n // console.log(word[j]);\n // word.replace(word.substring(j, j+1), \"\");\n sentArr[i] = word.slice(0, j) + word.slice(j+1);\n console.log(word);\n break;\n }\n }\n\n }\n return sentArr.join(' ');\n}", "function hipsterfy(sentence) {\n var words = sentence.split(\" \");\n var hipsterfied = [];\n\n for(var i = 0; i < words.length; i ++){\n hipsterfied.push(hipsterfyWord(words[i]));\n }\n return hipsterfied.join(\" \");\n}", "function maybeReplaceVowels(phrase) {\n if (Math.random() > ILLITERACY_RATE) {\n return phrase;\n }\n\n var words = phrase.split(' ');\n\n // Choose longest word to replace.\n var bestWord;\n var index = 0;\n for (var i = 0, ii = words.length; i < ii; i += 1) {\n if (!bestWord || words[i].length > bestWord.length) {\n bestWord = words[i];\n index = i;\n }\n }\n\n var vowel = findBestVowel(bestWord);\n if (vowel) {\n words[index] = bestWord.replace(vowel, VOWELS[vowel]);\n }\n return words.join(' ');\n }", "function removeVowel(strToBeUpdated, stuffToRemove){\n let str = '';\n\n for(let i = 0; i <strToBeUpdated.length; i++){\n if(!stuffToRemove.includes(strToBeUpdated[i])){\n str+=strToBeUpdated[i];\n }\n }\n return str; \n}", "function removeVowels2(str){\n let vowels = \"AEIOUaeiou\";\n for (let i = 0; i < str.length; i++){\n if (vowels.includes(str[i])){\n str = str.slice(0,i) + str.slice(i+1);\n }\n }\n return str;\n}", "function removeVowels1(str){\n let vowels = \"AEIOUaeiou\";\n let res = '';\n for (let i = 0; i < str.length; i++){\n if (!vowels.includes(str[i])){\n res += str[i];\n }\n }\n return res;\n}", "function removeVowels(string){\n //for does a loop as long as the thing below\n//Below we're saying\n for (var a = 0; a < string.length; a++) {\n //\n var letter = string.charAt(a);\n //Above we create the variable letter, which uses the charAt command with the a variable\n //The charAt function says what character is at what position like how if you do Array[1] for an array it says the 2nd item in the array\n //The A variable is a number that is counting up as we go through each iteration of the function\n // letter will be each letter in the input\n if (isVowel(letter)){\n //Above we are saying if the input of letter comes out true from our function isVowel\n //Continue with the function to replace(), if not it will not conitune, and move on to the next letter\n //letter will be each letter in the word as shown above because it's part of the \"for\"\n string = string.replace(letter, \"\");\n //Above I took the string, and redefined as it with the removed letter from each iteration\n }\n\n //above closes the if {}\n }\n // above closes the for {}\n return string\n //The return command needs to be here because it needs to let the for run through each letter, and completely execute?\n}", "function deleteVowel(sentence) {\n var sentence = sentence.replace(/[aeiou]/g, '');\n document.write(\"Stirng after removing vowel is \" + sentence);\n}", "function wordHax(str) {\n \n \n \n for (i = 0; i < strArray.length; i++) {\n var strArray = str.split(\" \");\n }\n if (strArray[i].length > 3)\n {\n \n strArray[i] = strArray[i](/a|e|i|o|u/gi, \"\");\n \n }\n else\n {\n \n x.toUpperCase();\n \n }\n \n }", "handleYI (word) {\n // Initial y\n let result = word.replace(/^y/, 'Y')\n if (DEBUG) {\n console.log('handleYI: initial y: ' + result)\n }\n // y after vowel\n result = result.replace(/([aeioué])y/g, '$1Y')\n if (DEBUG) {\n console.log('handleYI: y after vowel: ' + result)\n }\n // i between vowels\n result = result.replace(/([aeioué])i([aeioué])/g, '$1I$2')\n if (DEBUG) {\n console.log('handleYI: i between vowels:' + result)\n }\n return result\n }", "function removeVowels(S) {\n let regex = /[aeiouAEIOU]/g;\n let newString = \"\";\n for(let i = 0; i < S.length; i++){\n if(!S[i].match(regex)) {\n newString+= S[i]\n }\n }\n return newString;\n}", "function longLongVowels(word) {\n let array = word.split('')\n for (i=0; array.length>i; i++) {\n if ( (array[i] === array[i+1]) && (array[i] === 'e' || array[i] === 'o' || array[i] === 'i'|| array[i] === 'u' || array[i] === 'a') ){\n let vowel = array[i];\n array.splice(i, 0, vowel, vowel, vowel);\n break;\n } \n \n }\n console.log(array.join(''));\n}", "function disemvowel(string) {\n // your code here...\n //let splitString = string.split('');\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let disemvoweledString = [];\n \n for (var i = 0; i < splitString.length; i++) {\n if (vowels.indexOf(splitString[i]) === -1) {\n disemvoweledString.push(splitString[i]);\n }\n }\n return disemvoweledString.join('');\n}", "function removeVowels(str){\n let vowels=['a','e','i','o','u'];\n return str.toLowerCase().split(\"\").filter(character => {\n if(!vowels.includes(character)) return character;\n }).join(\"\");\n}", "function delVowel(){\r\n var strings = [\"That which does not kill us makes us stronger.” \"];\r\n \r\n strings = strings.map(function (string) {\r\n return string.replace(/[aeiou]/g, '');\r\n });\r\n \r\n console.log(strings);\r\n }", "function removeVowels(str) {\n const answer = str.replace(/[aeiou]/g, '')\n console.log(answer)\n return answer\n}", "function removeVowels(str) {\n var vowels = 'aeiou';\n return str.toLowerCase().split('').filter(function (letter) {\n return !vowels.split('').includes(letter);\n }).join('');\n}", "function wordYeller(sentence) {\n let punc = \". , ! ? ; :\".split(' ');\n sentence = sentence.split(' ');\n let result = [];\n\n for (let i = 0; i < sentence.length; i++) {\n let word = sentence[i];\n let char = word[word.length - 1];\n if (punc.indexOf(char) < 0) word += '!';\n result.push(word);\n }\n\n return result.join(' ');\n}", "function nicer(sentence){\n // converted into array\n var sentenceArray = sentence.split(\" \");\n // console.log(sentenceArray);\n // create a var that makes both strings equal eachother.\n for (var i = 0; i < sentenceArray.length; i++) {\n\n var currentWord = sentenceArray[i];\n\n if(currentWord === \"heck\" || currentWord === \"darn\" || currentWord === \"crappy\" || currentWord === \"dang\"){\n sentenceArray.splice(i, 1);\n }\n // remove from array @ i\n // sentenceArray.splice(i.1)\n // sentenceArray[i] = currentSentence;\n // var str = \"dad get the heck in here and bring me a darn sandwich.\"\n // var res = sentence.slice(2,3,10); THIS DID NOT WORK\n }\n // var string1 = string2\n // need to define string2 THIS didn't work at all.\n var cleanSentence = sentenceArray.join(\" \");\n return cleanSentence;\n}", "function cleanup(word_f) {\n if (word_f === undefined) return \"\";\n let f_word;\n let word = word_f;\n word = word.toLowerCase();\n let wordar = word.split(\"\");\n let wordf = [];\n for (let i = 0; i < word.split(\"\").length; i++) {\n switch (wordar[i]) {\n case \"a\": wordf.push(\"a\"); break;\n case \"b\": wordf.push(\"b\"); break;\n case \"c\": wordf.push(\"c\"); break;\n case \"d\": wordf.push(\"d\"); break;\n case \"e\": wordf.push(\"e\"); break;\n case \"f\": wordf.push(\"f\"); break;\n case \"g\": wordf.push(\"g\"); break;\n case \"h\": wordf.push(\"h\"); break;\n case \"i\": wordf.push(\"i\"); break;\n case \"j\": wordf.push(\"j\"); break;\n case \"k\": wordf.push(\"k\"); break;\n case \"l\": wordf.push(\"l\"); break;\n case \"m\": wordf.push(\"m\"); break;\n case \"n\": wordf.push(\"n\"); break;\n case \"o\": wordf.push(\"o\"); break;\n case \"p\": wordf.push(\"p\"); break;\n case \"q\": wordf.push(\"q\"); break;\n case \"r\": wordf.push(\"r\"); break;\n case \"s\": wordf.push(\"s\"); break;\n case \"t\": wordf.push(\"t\"); break;\n case \"u\": wordf.push(\"u\"); break;\n case \"v\": wordf.push(\"v\"); break;\n case \"w\": wordf.push(\"w\"); break;\n case \"x\": wordf.push(\"x\"); break;\n case \"y\": wordf.push(\"y\"); break;\n case \"z\": wordf.push(\"z\"); break;\n }\n f_word = wordf.join(\"\");\n }\n return f_word;\n}", "function pigTrans(string) {\n if (typeof string !== 'string') return undefined;\n const strArr = string.split(' ');\n return strArr.map(word => {\n return word\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n }).join(' ');\n }", "function removeVowels(str) {\n var vowels = \"aeiou\";\n return str.toLowerCase().split('').filter(function(val) {\n return vowels.indexOf(val) === -1;\n }).join('');\n }", "function repeatingTranslate(sentence) {\r\n let splited = sentence.split(' ');\r\n let vowels = 'aeiouAEIOU'\r\n\r\n let newSentence = splited.map(function (word) {\r\n let lastLetter = word[word.length - 1]\r\n let is\r\n if (word.length < 3) {\r\n return word;\r\n } else {\r\n if (vowels.includes(lastLetter)) {\r\n let repeatedWord = repeater(word) //will return doubles\r\n return repeatedWord;\r\n } else {\r\n let pigLatinWord = pigLatinizer(word)\r\n return pigLatinWord;\r\n }\r\n }\r\n });\r\n let joined = newSentence.join(' ')\r\n return joined;\r\n}", "function disemvowel(str) {\n\n var vowels = ['a', 'i', 'u', 'e', 'o', 'A', 'I', 'U', 'E', 'O']\n var result = str\n \n for(var i = 0; i < str.length; i++){\n for(var j = 0; j < vowels.length; j++){\n if(str[i] == vowels[j]){\n result = result.replace(str[i], '')\n }\n }\n }\n\n return result\n }", "function withoutVowels(text) {\n let remplazar = text.replace([\"a\",\"e\",\"i\",\"o\",\"u\"], \" \");\n return remplazar;\n}", "function wordYeller(sentence)\n{\n\tvar splitSentence = sentence.split(\" \");\n\tvar yelledSentence = \"\";\n\tfor(var i = 0; i <= splitSentence.length - 1; i++)\n\t{\n\t\tif(!(isPunctuated(splitSentence[i])))\n\t\t{\t\n\t\t\tyelledSentence += splitSentence[i] + \"! \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tyelledSentence += splitSentence[i] + \" \";\n\t\t}\n\t}\n\n\treturn yelledSentence;\n}", "function pigIt(str){\n let wordArr = str.split(' ')\n wordArr.forEach((word,i)=>{\n if(!\".?!\".includes(word)){\n wordArr[i] = word.slice(1) + word[0] + 'ay'\n }\n })\n return wordArr.join(' ')\n }", "function reverseWord(word) {\n word = word.split('');\n let vowelsFound = [];\n let positions = [];\n // find vowels and positions in word\n for (let i = 0; i < word.length; i++) {\n let letter = word[i];\n // use vowels object literal to identify if vowel, then add vowel and index to corresponding array\n if (vowels[letter]) {\n vowelsFound.push(letter);\n positions.push(i);\n }\n }\n // for each position stored, change the value to the last item in vowelFound array, and remove it from vowelsFound array\n positions.forEach(v => {\n word[v] = vowelsFound.pop();\n })\n return word.join('');\n\n }", "function moveVowel(input) {\n\n // input: string\n // output: string\n \n // algo:\n // [] look at the string\n // [] pull out vowels\n // [] move vowels to end in the same order\n\n let consonants = \"\";\n let vowels = \"\";\n for(var i = 0; i < input.length; i++){\n if(/[aeiou]/.test(input[i])){\n vowels += input[i];\n } else {\n consonants += input[i];\n }\n }\n return(consonants.concat('', vowels));\n }", "function stemm (word) {\n /*\n Put u and y between vowels into upper case\n */\n word = word.replace(/([aeiouyäöü])u([aeiouyäöü])/g, '$1U$2')\n word = word.replace(/([aeiouyäöü])y([aeiouyäöü])/g, '$1Y$2')\n\n /*\n and then do the following mappings,\n (a) replace ß with ss,\n (a) replace ae with ä, Not doing these,\n have trouble with diphtongs\n (a) replace oe with ö, Not doing these,\n have trouble with diphtongs\n (a) replace ue with ü unless preceded by q. Not doing these,\n have trouble with diphtongs\n So in quelle, ue is not mapped to ü because it follows q, and in\n feuer it is not mapped because the first part of the rule changes it to\n feUer, so the u is not found.\n */\n word = word.replace(/ß/g, 'ss')\n // word = word.replace(/ae/g, 'ä');\n // word = word.replace(/oe/g, 'ö');\n // word = word.replace(/([^q])ue/g, '$1ü');\n\n /*\n R1 and R2 are first set up in the standard way (see the note on R1\n and R2), but then R1 is adjusted so that the region before it contains at\n least 3 letters.\n R1 is the region after the first non-vowel following a vowel, or is\n the null region at the end of the word if there is no such non-vowel.\n R2 is the region after the first non-vowel following a vowel in R1,\n or is the null region at the end of the word if there is no such non-vowel.\n */\n\n let r1Index = word.search(/[aeiouyäöü][^aeiouyäöü]/)\n let r1 = ''\n if (r1Index !== -1) {\n r1Index += 2\n r1 = word.substring(r1Index)\n }\n\n let r2Index = -1\n // let r2 = ''\n\n if (r1Index !== -1) {\n r2Index = r1.search(/[aeiouyäöü][^aeiouyäöü]/)\n if (r2Index !== -1) {\n r2Index += 2\n // r2 = r1.substring(r2Index)\n r2Index += r1Index\n } else {\n // r2 = ''\n }\n }\n\n if (r1Index !== -1 && r1Index < 3) {\n r1Index = 3\n r1 = word.substring(r1Index)\n }\n\n /*\n Define a valid s-ending as one of b, d, f, g, h, k, l, m, n, r or t.\n Define a valid st-ending as the same list, excluding letter r.\n */\n\n /*\n Do each of steps 1, 2 and 3.\n */\n\n /*\n Step 1:\n Search for the longest among the following suffixes,\n (a) em ern er\n (b) e en es\n (c) s (preceded by a valid s-ending)\n */\n const a1Index = word.search(/(em|ern|er)$/g)\n const b1Index = word.search(/(e|en|es)$/g)\n let c1Index = word.search(/([bdfghklmnrt]s)$/g)\n if (c1Index !== -1) {\n c1Index++\n }\n let index1 = 10000\n let optionUsed1 = ''\n if (a1Index !== -1 && a1Index < index1) {\n optionUsed1 = 'a'\n index1 = a1Index\n }\n if (b1Index !== -1 && b1Index < index1) {\n optionUsed1 = 'b'\n index1 = b1Index\n }\n if (c1Index !== -1 && c1Index < index1) {\n optionUsed1 = 'c'\n index1 = c1Index\n }\n\n /*\n and delete if in R1. (Of course the letter of the valid s-ending is\n not necessarily in R1.) If an ending of group (b) is deleted, and the ending\n is preceded by niss, delete the final s.\n (For example, äckern -> äck, ackers -> acker, armes -> arm,\n bedürfnissen -> bedürfnis)\n */\n\n if (index1 !== 10000 && r1Index !== -1) {\n if (index1 >= r1Index) {\n word = word.substring(0, index1)\n if (optionUsed1 === 'b') {\n if (word.search(/niss$/) !== -1) {\n word = word.substring(0, word.length - 1)\n }\n }\n }\n }\n\n /*\n Step 2:\n Search for the longest among the following suffixes,\n (a) en er est\n (b) st (preceded by a valid st-ending, itself preceded by at least 3\n letters)\n */\n\n const a2Index = word.search(/(en|er|est)$/g)\n let b2Index = word.search(/(.{3}[bdfghklmnt]st)$/g)\n if (b2Index !== -1) {\n b2Index += 4\n }\n\n let index2 = 10000\n // const optionUsed2 = ''\n if (a2Index !== -1 && a2Index < index2) {\n // optionUsed2 = 'a'\n index2 = a2Index\n }\n if (b2Index !== -1 && b2Index < index2) {\n // optionUsed2 = 'b'\n index2 = b2Index\n }\n\n /*\n and delete if in R1.\n (For example, derbsten -> derbst by step 1, and derbst -> derb by\n step 2, since b is a valid st-ending, and is preceded by just 3 letters)\n */\n\n if (index2 !== 10000 && r1Index !== -1) {\n if (index2 >= r1Index) {\n word = word.substring(0, index2)\n }\n }\n\n /*\n Step 3: d-suffixes (*)\n Search for the longest among the following suffixes, and perform the\n action indicated.\n end ung\n delete if in R2\n if preceded by ig, delete if in R2 and not preceded by e\n ig ik isch\n delete if in R2 and not preceded by e\n lich heit\n delete if in R2\n if preceded by er or en, delete if in R1\n keit\n delete if in R2\n if preceded by lich or ig, delete if in R2\n */\n\n const a3Index = word.search(/(end|ung)$/g)\n let b3Index = word.search(/[^e](ig|ik|isch)$/g)\n const c3Index = word.search(/(lich|heit)$/g)\n const d3Index = word.search(/(keit)$/g)\n if (b3Index !== -1) {\n b3Index++\n }\n\n let index3 = 10000\n let optionUsed3 = ''\n if (a3Index !== -1 && a3Index < index3) {\n optionUsed3 = 'a'\n index3 = a3Index\n }\n if (b3Index !== -1 && b3Index < index3) {\n optionUsed3 = 'b'\n index3 = b3Index\n }\n if (c3Index !== -1 && c3Index < index3) {\n optionUsed3 = 'c'\n index3 = c3Index\n }\n if (d3Index !== -1 && d3Index < index3) {\n optionUsed3 = 'd'\n index3 = d3Index\n }\n\n if (index3 !== 10000 && r2Index !== -1) {\n if (index3 >= r2Index) {\n word = word.substring(0, index3)\n let optionIndex = -1\n // const optionSubsrt = ''\n if (optionUsed3 === 'a') {\n optionIndex = word.search(/[^e](ig)$/)\n if (optionIndex !== -1) {\n optionIndex++\n if (optionIndex >= r2Index) {\n word = word.substring(0, optionIndex)\n }\n }\n } else if (optionUsed3 === 'c') {\n optionIndex = word.search(/(er|en)$/)\n if (optionIndex !== -1) {\n if (optionIndex >= r1Index) {\n word = word.substring(0, optionIndex)\n }\n }\n } else if (optionUsed3 === 'd') {\n optionIndex = word.search(/(lich|ig)$/)\n if (optionIndex !== -1) {\n if (optionIndex >= r2Index) {\n word = word.substring(0, optionIndex)\n }\n }\n }\n }\n }\n\n /*\n Finally,\n turn U and Y back into lower case, and remove the umlaut accent from\n a, o and u.\n */\n word = word.replace(/U/g, 'u')\n word = word.replace(/Y/g, 'y')\n word = word.replace(/ä/g, 'a')\n word = word.replace(/ö/g, 'o')\n word = word.replace(/ü/g, 'u')\n\n return word\n}", "function replaceBadWords(string){\n let stringLower = string.toLowerCase();\n let arr = stringLower.split(' ');\n\n let arrRes = arr.map((item)=>{\n if(item.includes(`fuck`)){\n return item.replace(`fuck`, `****`);\n };\n\n if(item.includes(`shit`)){\n return item.replace(`shit`, `****`);\n };\n\n return item;\n });\n \n return arrRes.join(` `)[0].toUpperCase()+arrRes.join(` `).slice(1, arrRes.join(` `).length);\n\n}", "function disemvowel(str) {\n let withoutVowel = \"\";\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== \"a\" && str[i] !==\"e\" && str[i] !==\"i\" && str[i] != \"o\" && str[i] !== \"u\") {\n withoutVowel += str[i];\n }\n }\n return withoutVowel;\n}", "function disemvowel(str) {\n let newStr = '';\n for(let i = 0; i < str.length; i++){\n if (str[i].toLowerCase() !== 'a' && str[i].toLowerCase() !== 'e' && str[i].toLowerCase() !== 'i' && str[i].toLowerCase() !== 'o' && str[i].toLowerCase() !== 'u'){\n newStr += str[i];\n }\n }\n return newStr;\n}", "function removeVowels(string myString) {\n\tlet noVowels = '';\n\tconst vowels = ['a', 'e', 'i', 'o', 'u'];\n\tforeach(myString as letter) {\n\t\tif(!vowels.contains(letter)) {\n\t\t\tnoVowels = noVowels.letter\n\t\t}\n\t}\n}", "function removeVowels(str) {\n const vowels = 'aeiou';\n return str\n .toLowerCase()\n .split(\"\")\n .filter(function(val) {\n return vowels.indexOf(val) !== -1;\n })\n .join(\"\");\n}", "function removeVowels(str){\n return str.replace(/[aouie]/gi, '');\n}", "function unpluralize(word) {\n if (word.match(/is\\b/g)) {\n return word;\n } else if (word.match(/ies\\b/g)) {\n return word.replace(/.{3}\\b/, 'y');\n } else if (word.match(/ses\\b|hes\\b|xes\\b|zes\\b/g)) {\n return word.replace(/.{2}\\b/, '');\n } else if (word.match(/s\\b/g)) {\n return word.replace(/.{1}\\b/, '');\n } else {\n return word;\n }\n}", "function disemvowel(str){\n result = ''\n for (let i=0; i < str.length; i++){\n if (str[i] !== 'a' && str[i] !== 'e' && str[i] !== 'i' && str[i] !== 'o' && str[i] !== 'u' && str[i] !== 'A' && str[i] !== 'E' && str[i] !== 'I' && str[i] !== 'O' && str[i] !== 'U'){\n result += str[i];\n }\n }\n console.log(result);\n str = result;\n return str;\n}", "function disemvowel(str) {\n const vowelsArr = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n const strArr = str.split(\"\")\n\n return strArr.filter(char => !vowelsArr.includes(char.toLowerCase())).join(\"\")\n}", "function toWeirdCase (string) {\n var arrOfWords = string.split(' ')\n //console.log(arr)\n //console.log(arrOfWords)\n\n var alteredArray = [];\n\n // arrOfWords.forEach((word) => {\n // var arr = word.split('')\n // for(let i = 0; i < arr.length; i++) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // }\n // if (arrOfWords.length > 1) {\n // alteredArray.push(' ')\n // }\n // })\n\n // needed to do it this way so I could add the last condition on line 116 so there wouldnt be spaces at end\n for(let j = 0; j < arrOfWords.length; j ++) {\n var arr = arrOfWords[j].split('')\n for(let i = 0; i < arr.length; i++) {\n if(i % 2 == 0) {\n alteredArray.push(arr[i].toUpperCase())\n } else {\n alteredArray.push(arr[i].toLowerCase())\n }\n }\n if (arrOfWords.length > 1 && j < (arrOfWords.length - 1)) {\n alteredArray.push(' ')\n }\n }\n\n var finalString = alteredArray.join('')\n \n //console.log(finalString)\n\n return finalString;\n\n\n //ALL ATTEMPTS\n\n // for(let i = 0; i < arr.length; i++) {\n // var fakeIndex;\n // // if we're on the first one, or the last position wasnt a space, continue as normal\n // if(i == 0 || (arr[i-1] !== ' ')) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // // if the last position was a space, and the current index is EVEN\n // } else if (arr[i - 1] == ' ' && i % 2 == 0) {\n // //if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // //} else {\n // // alteredArray.push(arr[i].toLowerCase())\n // //}\n // } else if (arr[i - 1] == ' ' && i % 2 !== 0) {\n // fakeIndex = 2\n // if(fakeIndex % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // }\n // }\n\n // //console.log(i)\n // // var index = i\n // // if (arr[i] == ' ') {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n \n // // else if (index % 2 == 0) {\n // // alteredArray.push(arr[i].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[i].toLowerCase())\n // // }\n\n // // 4 lines below are what I originally had that makes function work with single word strings\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n\n // // if its not a space, execute the block below\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n // // if it is a space\n // // \n\n // // if its a space, and its odd were fine (next index will be even anyways)\n // // if (arr[i] == ' ' && ((arr[i] % 2) !== 0)) {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n // // if its a space, and the index is EVEN, we want to make sure the next index is EVEN again somehow\n \n // }\n \n // //console.log(alteredArray)\n // var finalString = alteredArray.join('')\n // console.log(finalString)\n // return finalString;\n\n // END OF ATTEMPTS\n}", "function pigLatin(myString) {\n\n // check if the first letter is a vowel or consonant\n // first letter is consonant\n // then move it to the back and put an \"ay\" after\n // first letter is a vowel\n // just an an \"ay\" at the end\n\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n\n // if I get a sentence, how do I know when a word ends or begins\n // Ex: \"the quick brown fox jumps over the lazy dog\"\n\n const wordArray = myString.split(' '); // This separates every word for whatever I put in the string \"myString\"\n\n let newWordArray = [];\n\n for (let word of wordArray){\n if(word[0] == 'a' || word[0] == 'e' || word[0] == 'i' || word[0] == 'o' || word[0] == 'u'){\n word += 'ay' // Here we are ADDING an 'ay' to the end it is starts (index = [0]) with a vowel\n newWordArray.push(word)\n } else {\n let letters = word.split(''); // Here we are splitting each words into individual letters\n let shift = letters.shift(); // Here we are creating a variable called \"shift\" and setting it equal to removing the first letter of each word\n letters.push(shift, 'ay');\n word = letters.join(''); // Here we are overriding what word USED TO be equal to and setting it equal to letters.join('')\n // Notice: There is no space between the '' becasue we DO NOT want space between the letters\n newWordArray.push(word);\n }\n }\n console.log(newWordArray.join(' '));\n}", "function censorVowels(word) {\n const chars = [];\n\n for (const letter of word) {\n if ('aeiou'.includes(letter)) {\n chars.push('*');\n } else {\n chars.push(letter);\n }\n }\n\n return chars.join('');\n}", "function removevowel(str){\n var newstr = \"\";\n for(var i = 0; i <str.length; i++ ){\n if(str[i] != \"a\" && str[i] != \"e\" && str[i] != \"i\" && str[i] != \"o\" && str[i] != \"u\"){\n newstr += str[i];\n }\n\n }\n return newstr;\n }", "function disemvowel(str) {\n var vowels = 'aeiouAEIOU';\n var returnString =\n str.split('')\n .map(function removeVowels(char) {\n if (vowels.indexOf(char) === -1) {\n return char;\n }\n })\n .join('');\n\n return returnString;\n}", "function i_am_making_wordsStartsWithVowel_bolder() {\n var str = \"what ever i am writing here or have wrote this is all my (first) imagination (second) creation, words with all 5 vowels, which i got from dictionary one by one page, i think all will enjoy and increase knowledge thats my education.\";\n var s = '';\n var spaceFlag = 0;\n var capitalFlag = 0;\n for (var i = 0; i < str.length; i++) {\n if (spaceFlag == 1 || i == 0) {\n if (str[i].toLowerCase() == 'a' ||\n str[i].toLowerCase() == 'e' ||\n str[i].toLowerCase() == 'i' ||\n str[i].toLowerCase() == 'o' ||\n str[i].toLowerCase() == 'u') {\n capitalFlag = 1;\n }\n }\n if (str[i] == \" \" && spaceFlag == 0) {\n spaceFlag = 1;\n capitalFlag = 0;\n }\n else if (str[i] != \" \") {\n spaceFlag = 0;\n }\n if (capitalFlag == 1) {\n s += str[i].toUpperCase();\n }\n\n else {\n s += str[i];\n }\n\n }\n return s;\n}", "function convToUpperCase(sentence) {\n var perkata = sentence.toLowerCase().split(' ');\n for (var i = 0; i < perkata.length; i++) {\n perkata[i] = perkata[i].charAt(0).toUpperCase() +\n perkata[i].substring(1);\n }\n return perkata.join(' ');\n }", "function translatePigLatin(str) {\n var consonant = [];\n // returns first element that matches vowel regex \n function findFirstVowel(element) {\n if (element.match(/[aeiou]/i) !== null) {\n return element;\n }\n }\n // if the first char of str is a vowel -> add way to end \n if (str[0].match(/[aeiou]/i)) {\n str = str + \"way\";\n } else {\n // else split str into array\n str = str.split(\"\");\n // suffix array to be pushed onto new string\n var suffix = [\"a\", \"y\"];\n\n // calls findIndex() of letter returned from findFirstVowel(str) --> that index is number of elements to remove \n var numToRemove = str.findIndex(findFirstVowel);\n // starting at index 0 - remove numToRemove letters and save to consonant \n consonant = str.splice(0, numToRemove);\n // push suffix onto end of consonant\n consonant.push(...suffix);\n\n // push consonant onto end of str\n str.push(...consonant);\n // Join str into string \n str = str.join(\"\");\n }\n\n return str;\n}", "function disemvowel(str) {\n let new_arr = str.split('');\n new_arr.filter(function(char) {\n return char;\n })\n let result_arr = []\n for(let i = 0; i < new_arr.length; i++) {\n if(new_arr[i] == 'a' || new_arr[i] == 'A') {\n continue;\n } else if(new_arr[i] == 'e' || new_arr[i] == 'E') {\n continue;\n } else if(new_arr[i] == 'i' || new_arr[i] == 'I') {\n continue;\n } else if(new_arr[i] == 'o' || new_arr[i] == 'O') {\n continue;\n } else if(new_arr[i] == 'u' || new_arr[i] == 'U') {\n continue;\n } else {\n result_arr.push(new_arr[i]);\n }\n }\n return result_arr.join('');\n}", "function replaceVogals(str) {\n return str.replace(/[aeiou]/g,'?');\n}", "function longVowels(myString) {\n myArray=[];\n newString='';\n for (var x=0; x<myString.length; x++){\n myArray.push(myString[x]);\n }\n for (var y=0; y<myArray.length;y++){\n if ((myArray[y]==myArray[y-1]) && myArray[y]==\"o\"){\n myArray[y]=\"oooo\";\n }\n if ((myArray[y]==myArray[y-1]) && myArray[y]==\"e\"){\n myArray[y]=\"eeee\";\n }\n }\n newString = myArray.join('');\n console.log(newString);\n}", "function removeVowels(strings) {\n return strings.map(string => string.replace(/[aeiou]/gi, \"\"));\n}", "function removeVowels3(str){\n let res = '';\n for (let i = 0; i < str.length; i++){\n if (str[i] !== 'a' && str[i] !== 'o' && str[i] !== 'e' && str[i] !== 'u' && str[i] !== 'i' &&\n str[i] !== 'A' && str[i] !== 'O' && str[i] !== 'E' && str[i] !== 'U' && str[i] !== 'I'){\n res += str[i];\n }\n }\n return res;\n}", "function unpigPhrase (phrase) {\n var sentence = phrase.split(' ');\n var unpiggedPhrase = [];\n\n for (var i = 0; i <= sentence.length - 1; i++) {\n unpiggedPhrase.push(unpigWord(sentence[i]));\n };\n return unpiggedPhrase.join(' ');\n}", "function translate(str) {\n var first_letter,\n new_str,\n consonant_check = /^[^aeiou]+/,\n counter = 0,\n split_array = str.split(''),\n len = str.length;\n /*test if first letter is a vowel\n if so, concatenate way to end of string \n */\n if (!consonant_check.test(str[counter])) {\n return str + 'way';\n } else {\n //while word starts with a consonant, shift and add first_letter +'ay' to end\n while (consonant_check.test(str[counter])) {\n first_letter = split_array.shift();\n split_array.push(first_letter);\n counter++;\n }\n new_str = split_array.join('');\n new_str += 'ay';\n return new_str;\n }\n}", "function removeVowels(stringArray) {\n return stringArray.map(string => {\n let chars = string.split(\"\");\n let removedVowels = deleteVowels(chars);\n return removedVowels.join(\"\");\n });\n }", "function disemvowel(str){\n let vowels = /[aeiou]/gi\n let noVowels = str.replace(vowels, '')\n return noVowels\n}", "function reversifyOnlySequenceOfWords(str) {\n\tvar inputArray = str.split(' ');\n var outPurArray = [];\n for(var i = inputArray.length-1; i>=0; i-- ) {\n \toutPurArray.push(inputArray[i]);\n }\n return outPurArray.join(' ');\n}", "function removeVowels(strings) {\n for (let index = 0; index < strings.length; index += 1) {\n strings[index] = removeVowelsFromString(strings[index]);\n }\n return strings;\n}", "function disemvowel(string){\n\tvar result = \"\";\n\tvar vowels = [\"b\",\"c\",\"d\",\"f\",\"g\",\"h\",\"j\",\"k\",\"l\",\"m\",\"n\",\"p\",\"q\",\"r\",\"s\",\"t\",\"v\",\"w\",\"x\",\"z\",\"y\"];\n\tfor(var i=0; i<string.length; i++){\n\t\tfor(var j=0; j<vowels.length; j++){\n\t\t\tif(string.charAt(i) == vowels[j]){\n\t\t\t\tresult += string.charAt(i);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function hipsterfy(sentence) {\n var newWords = sentence.split(\" \");\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n console.log(\"check 1: The split sentence is: \" + newWords);\n for (var i = 0; i < newWords.length; i++) {\n console.log(\"check 2: The word that is being evaluated is: \" + newWords[i]);\n for (var k = newWords[i].length - 1; k >= 0; k--) {\n console.log(\"check 3: The word that is evaluated within the second for loop is \" + newWords[i]);\n console.log(\"check 4: The letter of the word that is being evaluated is: \" + newWords[i][k] + \", i: \" + i + \", k: \" + k);\n for (var l = vowels.length - 1; l >= 0; l--) {\n console.log(\"check 5: vowel to be compared is: \" + vowels[l]);\n var conjoinedWord = \"\";\n if (conjoinedWord !== 0) {\n console.log(\"The break should happen here\");\n } else if (newWords[i][k] === vowels[l]) {\n var splitWord = newWords[i].slice(0,[k]);\n var splitWord2 = newWords[i].slice(k+1);\n console.log(splitWord + splitWord2);\n conjoinedWord = splitWord + splitWord2;\n console.log(conjoinedWord);\n }\n // // continue;\n // // console.log(\"check 6: continue needs to get here bacause letter of newWords[i][k] is: \" + newWords[i][k] + \" and vowel is: \" + vowels[l]);\n // // //console.log(\"check 7: removal needed here (split - join) bacause letter of newWords[i][k] is: \" + newWords[i][k] + \" and vowel is: \" + vowels[l]);\n\n }\n }\n }\n return newWords;\n}", "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 wordYeller(sentence) {\n var wordYeller = [];\n var words = sentence.split(' ');\n var punctuation = '!.,;:?'.split('');\n for (var i = 0; i < words.length; i++) {\n var word = words[i];\n var lastCharacter = word.slice(-1);\n if (punctuation.indexOf(lastCharacter)!== -1) {\n wordYeller.push(word);\n } else {\n wordYeller.push(word + '!');\n }\n }\n return wordYeller;\n}", "function replaceEO(str) {\n var phrase = str.split(' ');\n // console.log(phrase);\n for (var i = 0; i < phrase.length; i++) {\n\n let word = phrase[i];\n\n if(i%2===0)\n {\n word = word.toUpperCase();\n }\n\n console.log(word);\n }\n\n}", "function nicer (str) {\n var strArr = str.split(' ')\n var badWords = ['heck', 'crappy', 'darn', 'dang', 'damn', 'crap', 'awful', 'dumb']\n for (var i = 0; i < strArr.length; i++) {\n for (var j = 0; j < badWords.length; j++) {\n if (strArr[i] === badWords[j]) {\n strArr.splice([i], 1)\n }\n }\n }\n return strArr.join(' ')\n}", "function forLoopSolution(obj) {\n let wordToBeIndexed = 'letter';\n let indexOfWord = obj.text.indexOf(wordToBeIndexed) + wordToBeIndexed.length; \n let sentence = obj.text.split('');\n for (i = indexOfWord; i < sentence.length; i += 1) {\n if (sentence[i] === 'e') {\n sentence.splice(i,1)\n }\n }\n return sentence.join('') ;\n}", "function sentence(str) {\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n return str.split(\"\").filter(\n function (elm) {\n return vowels.indexOf(elm.toLowerCase()) == -1\n }\n ).join(\"\")\n}", "function danish(sentence) {\n \nreturn sentence.replace(/\\bapple|blueberry|cherry\\b/, 'danish');\n\n}", "function disemvowel(str) {\n return str.replace(/[aeiou]/gi, '');\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }", "function translatePigLatin(str) {\n let regex = /[aeiou]/ig;\n let notVowel = /^[^aeiou]+/ig\n \n\n // if first letter is a vowel then add \"way\" at the end of the string\n if (regex.test(str[0])) {\n return str + \"way\";\n }\n // if the string doesn't contain any vowels add \"ay\" at the end \n if (regex.test(str) === false) {\n return str + \"ay\";\n }\n // if the string contains vowels and the first letter isn't a vowel, return the collection\n // of cononants plus \"ay\" at the end of the string\n let firstConsonants = str.match(notVowel).join(\"\");\n \n return str.replace(firstConsonants, \"\") + firstConsonants + \"ay\";\n}", "function byevowels(str) {\n\n var vowels = new RegExp(\"[aeiou]\",\"g\");\n\n str = str.replace(vowels,\"!\");\n\n console.log(str);\n\n\n}", "function translatePigLatin(str) {\n\n let vowels = /[aeiou]/;\n let consts = /[^aeiou]/;\n\n\n //if statement acts as an error prevention when using match.index, without it match.index finds a null value in words without vowels.\n if (str.includes(\"a\") || str.includes(\"e\")|| str.includes(\"i\")|| str.includes(\"o\")|| str.includes(\"u\")){\n //matches index of first vowel\n var index = str.match(vowels).index;\n //if the first letter of the word is not a vowel\n if (index !== 0) {\n //slice beginning from start of word UP TO first vowel\n let sliced = str.slice(0, index);\n console.log(sliced);\n //slice from first vowel to end, add letters before the vowel and add \"ay\"\n return str.slice(index) + sliced + 'ay';\n } else {\n //if first letter is a vowel, just add way to end\n return str + \"way\"\n } \n } else {\n //if no vowel is in word, add ay to end\n return str + \"ay\"\n }\n }", "function censorPalindromeWords(sentence){\n if (typeof sentence === 'string'){\n const palindromeSentence = sentence.split(' ').map(word => {\n const palindromeWord = word.toLowerCase().replace(/[^a-z\\s]/g, '').split('').reverse().join('')\n if (palindromeWord === word.toLowerCase().replace(/[^a-z\\s]/g, '')){\n const censoredWord = word.split('').map((letter, index) => {\n if (index !== 0 && index !== word.length - 1 && letter !== palindromeWord[palindromeWord.length - 1]){\n return '$'\n } else {\n return letter\n }\n }).join('')\n return censoredWord\n } else { \n return word\n }\n })\n return palindromeSentence.join(' ')\n } else {\n console.log('Please provide a string as a parameter')\n }\n}", "function translatePigLatin(str) {\n\nlet myRegex = /^([aeiou])/\n\nreturn str\n .replace(/^[aeiou]\\w*/,\"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n\n \n}", "function disemvowel(str) {\n new_str = \"\"\n for (let char of str) {\n if (char !== 'a' | char !== 'e' | char !== 'i' | char !== 'o' | char !== 'u') {\n new_str += char;\n }\n }\n return new_str;\n}", "function reverseCharactersButNotWords(sentence) {\n // For quick testing it is easier to return an array than console.log output.\n let res = '';\n\n const splitSentence = sentence.split(' ');\n\n const arrayOfReversedWords = splitSentence.map((word) => {\n const chArray = word.split('');\n const reverse = chArray.reverse();\n return reverse.join('');\n });\n\n arrayOfReversedWords.forEach((word, index) => {\n if (index == arrayOfReversedWords.length - 1) {\n res += word;\n }\n else {\n res += `${word} `;\n }\n });\n\n return res;\n}", "function teachManners(phrase) {\n return phrase.toLowerCase().replace(exclamations, '');\n\n}", "function censorCensoredWords(sentence, words){\n if (typeof sentence === 'string' && typeof words === 'object'){\n const censoredString = sentence.split(' ').map(item => {\n words.map(word => {\n if (word === item.toLowerCase().replace(/[^a-z\\s]/g, '')){\n item = item.split('').map((letter, index) => {\n if (index !== 0 && letter !== word[word.length - 1] && letter !== '.'){\n return '$'\n } else {\n return letter\n }\n }).join('')\n } \n })\n return item\n })\n return censoredString.join(' ')\n } else {\n console.log('Please provide a string as the first parameter and a array as the second parameter')\n }\n}", "function ifVowel(string) {\n if (string.length === 1) {\n string = string + \"ay\";\n return string;\n } else if (string.length > 1) {\n string = string + \"yay\";\n return string;\n }\n}", "function replaceNice (string) {\n return string.replace('-', ' ').split(' ').map(function (elm) {\n return elm.charAt(0).toUpperCase() + elm.slice(1)\n }).join(' ')\n }", "function f(str) {\n let phrase = str.split(\" \");\n let newPhrase = [];\n for (i=0; i < phrase.length; i++) {\n let word = phrase[i];\n let newWord = [];\n for (j=0; j < word.length; j++) {\n if (j === 0) newWord.push(word[j].toUpperCase());\n if (j !== 0) newWord.push(word[j].toLowerCase());\n };\n newWord = newWord.join('');\n newPhrase.push(newWord);\n };\n console.log(newPhrase.join(' '));\n return newPhrase.join(' ');\n}", "function translate(phrase){\n\tvar newPhrase = \"\";\n\tfor (count=0; count<phrase.length; count++){\n\t\tnewPhrase = newPhrase + phrase[count];\n\t\tif (!isVowel(phrase[count]) && phrase[count] !== \" \"){\n\t\t\tnewPhrase = newPhrase + \"o\" + phrase[count];\n\t\t}\n\t}\n\treturn newPhrase;\n}", "function pigWord (word) {\n return word.slice(findFirstVowel(word), word.length) + '-' + word.slice( -word.length, findFirstVowel(word)) + 'ay';\n}", "function determinator(word) {\n characters = word.split('');\n var leadVowelIndex = vowelLocator(word);\n var slicer = \"\";\n if (characters[0] === \"y\") {\n slicer = 1;\n } else if ((characters[leadVowelIndex] === \"u\") && (characters[leadVowelIndex - 1] === \"q\")) {\n slicer = leadVowelIndex + 1;\n } else {\n slicer = leadVowelIndex\n }\n return transformer(word, slicer);\n }", "function reverseWord(sentence) {\n return sentence\n .split(\" \")\n .map(function (word) {\n return word.split(\"\").reverse().join(\"\");\n })\n .join(\" \");\n}", "function vowelBack(str) {\n\tstr = str.split('');\n\tarr = ' abcdefghijklmnopqrstuvwxyz'.split('');\n\texcepObj = {c: 1, o: 1, d: 3, e: 4};\n\texcepRes = [\"c\", \"o\", \"d\", \"e\"];\n\tvowelLetter = ['a', 'i', 'u'];\n\tarr[0] = undefined;\n\tfor (var i = 0; i < str.length; i++) {\n\t\t// var changed = false;\n\t\tvar arrIndex = arr.indexOf(str[i])\n\t\tif(arrIndex - 5 <= 0){\n\t\t\tvar exceptionValVowel =excepRes.indexOf(arr[arrIndex - 5 + 26])\n\t\t}else {\n\t\t\tvar exceptionValVowel =excepRes.indexOf(arr[arrIndex - 5])\n\t\t}\n\n\t\tif(arrIndex + 9 > 26){\n\t\t\tvar exceptionValCons = excepRes.indexOf(arr[arrIndex + 9 - 26])\n\t\t}else {\n\t\t\tvar exceptionValCons = excepRes.indexOf(arr[arrIndex + 9 ])\n\t\t}\n\t\tif(excepObj[str[i]]){\n\t\t\tif(excepRes.indexOf(arr[arr.indexOf(str[i]) - excepObj[str[i]]]) === -1){\n\t\t\t\tstr[i] = arr[arrIndex - excepObj[str[i]]]\n\t\t\t}\n\t\t\t// changed = true;\n\t\t}else if(vowelLetter.indexOf(str[i]) != -1) {\n\t\t\tif(exceptionValVowel === -1) {\n\t\t\t\tif(arrIndex - 5 <=0){\n\t\t\t\t\tstr[i] = arr[arrIndex - 5 + 26]\n\t\t\t\t}else {\n\t\t\t\t\tstr[i] = arr[arrIndex - 5];\n\t\t\t\t}\n\t\t\t}\n\t\t}else {\n\t\t\tif(exceptionValCons === -1){\n\t\t\t\tif (arrIndex + 9 > 26) {\n\t\t\t\t\tstr[i] = arr[arrIndex + 9 - 26]\n\t\t\t\t}else{\n\t\t\t\t\tstr[i] = arr[arrIndex + 9]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn str.join('')\n\n}", "function removeDuplicateWords(s) {\n // your perfect code...\n var sNew = s.split(' ')\n var output = []\n\n for(var i = 0; i < sNew.length; i++){\n if (output.indexOf(sNew[i]) == -1) {\n output.push(sNew[i])\n }\n }\n\n return output.join(' ')\n}", "function pigLatin(str = \"\") {\n let vowel = [\"e\", \"i\", \"o\", \"y\", \"a\"];\n let arr = str.split(\"\");\n let result = [];\n\n if (vowel.includes(str[0])) return str.concat('way');\n for (let i = 0; i < arr.length; i++) {\n if (!vowel.includes(arr[i])) {\n result.push(arr.splice(0, 1)[0]);\n }\n\n }\n result.forEach((el) => arr.push(el));\n arr.push('ay')\n return arr.join('');\n}", "function toonify(accent, sentence){\n if (accent == 'daffy') {\n var newstr = sentence.replace(/s/g, 'th');\nconsole.log(newstr);\n}\nelse if (accent == 'elmer') {\n var newstr = sentence.replace(/r/g, 'w');\nconsole.log(newstr);\n}}", "function pigIt(str) {\r\n let temp = str.split(\" \");\r\n return temp\r\n .map(word => {\r\n return word.match(/[A-z]/i)\r\n ? `${word.substr(1)}${word.substr(0, 1)}ay`\r\n : word;\r\n })\r\n .join(\" \");\r\n\r\n}", "function s(text, words) {\n\n let copy = text;\n for( let word of words) {\n let length = word.length;\n\n for (let i = 0; i < copy.length; i++) {\n\n let piece = text.substr(i, length);\n\n if (word === piece)\n text = text.replace(piece, '-'.repeat(length));\n\n }\n }\n\n console.log(text);\n}", "function toonify(accent, sentence) {\n if(accent === 'daffy') {\n return sentence.replace(/s/g, 'th');\n } else if(accent === 'elmer') {\n return sentence.replace(/r/g, 'w');\n } else if(accent === 'porky') {\n return sentence.replace(/th/g, 'th-th-th-th');\n } else {\n return sentence;\n }\n}", "function solve(s) {\n const vowels = 'aeiou'\n let stringResult = '';\n const arr = []\n\n for (const x of s) {\n // console.log(x)\n if (vowels.includes(x)) {\n stringResult = x + stringResult\n } else {\n if (stringResult !== '') {\n arr.push(stringResult.length);\n stringResult = '';\n }\n }\n }\n return arr.sort((a, b) => b - a)[0];\n}", "function reverseWordsInPlace(str){\nreturn str.split(' ').reverse('').join(' ').split('').reverse('').join('');\n}", "function interrupter(interruptingWord) {\n return function (sentence) {\n let words = sentence.split(\" \");\n let newString = \"\";\n\n for (let index = 0; index < words.length; index++) {\n let word = words[index];\n if (index === words.length - 1) {\n newString += word;\n } else {\n newString += word + \" \" + interruptingWord + \" \";\n }\n }\n\n return newString;\n };\n}", "function noVowels(sentence) {\n sentence = sentence.replace(/[aeiouAEIOU]/ig, '');\n return $('<li>').text('No vowels: ' + sentence).appendTo('#outputs');\n}", "function vowelBack(string) {\n\tvar vowels = ['a', 'e', 'i', 'o'];\n\tvar movedLetters = ['c', 'o', 'f', 'e'];\n\tvar alphabet = \n\t['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n\tvar result = [];\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\t\tvar originalIndex = alphabet.indexOf(string[i]);\n\n\t\t\tif (!vowels.includes(string[i])) {\n\t\t\t\tif (string[i] === 'c' || string[i] === 'o') {\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 1]);\n\t\t\t\t} else if (string[i] === 'd'){\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 3]);\n\n\t\t\t\t} else if(string[i] === 'e') {\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 4]);\n\n\t\t\t\t} else {\n\t\t\t\t\tnewIndex = alphabet.indexOf(string[i]) + 9;\n\t\t\t\t\tif (newIndex > 25 ) {\n\t\t\t\t\t\tnewIndex = newIndex - 26;\n\t\t\t\t\t}\n\t\t\t\t\tresult.push(alphabet[newIndex]);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif (string[i] === 'c' || string[i] === 'o') {\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 1]);\n\t\t\t\t} else if (string[i] === 'd'){\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 3]);\n\n\t\t\t\t} else if(string[i] === 'e') {\n\t\t\t\t\tresult.push(alphabet[alphabet.indexOf(string[i]) - 4]);\n\t\t\t\t} else {\n\t\t\t\tnewIndex = alphabet.indexOf(string[i]) - 5;\n\t\t\t\tif (newIndex < 0 ) {\n\t\t\t\t\tnewIndex = newIndex + 26;\n\t\t\t\t}\n\t\t\t\tresult.push(alphabet[newIndex]);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (movedLetters.includes(result[i])) {\n\n\t\t\t\tresult[i] = alphabet[originalIndex];\n\t\t\t}\n\t\t}\n\n\treturn result.join('');\n}", "function revWords(str: string): string {\n\n let words = str.split(\" \");\n for (let i = 0; i < words.length; i++) {\n let revWord = \"\";\n for (let j = words[i].length - 1; j >= 0; j--) {\n revWord = revWord + words[i].charAt(j);\n }\n words[i] = revWord;\n }\n return words.join(\" \");}", "function pigIt(str){\n let newArr = [];\n let arr = str.split(\" \");\n for (let i=0; i<arr.length; i++) {\n if (arr[i]!='?' && arr[i]!='!') {\n let word = arr[i];\n let letter = word.charAt(0);\n let newWord = word.slice(1) + letter + \"ay\";\n newArr.push(newWord);\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr.join(\" \");\n}" ]
[ "0.7598701", "0.66150284", "0.6609498", "0.6352171", "0.6308119", "0.61867553", "0.61338073", "0.61263466", "0.60992587", "0.60802", "0.60788816", "0.6027845", "0.6003421", "0.59983814", "0.59888405", "0.5980003", "0.5970728", "0.5952415", "0.5944918", "0.5940205", "0.59363693", "0.5934577", "0.59327495", "0.59199864", "0.591321", "0.58989966", "0.58727115", "0.5869943", "0.58665293", "0.5852272", "0.58468", "0.5816792", "0.58129066", "0.5803839", "0.5791074", "0.57815814", "0.57731146", "0.5772572", "0.5768516", "0.57636017", "0.5753662", "0.5751015", "0.5748923", "0.5715878", "0.5711793", "0.5707199", "0.5697494", "0.56943315", "0.5649649", "0.56486845", "0.5645837", "0.5641703", "0.563233", "0.56301224", "0.5626296", "0.5618673", "0.5611919", "0.56102866", "0.5610252", "0.5608067", "0.56074655", "0.56068736", "0.5602081", "0.559663", "0.5583675", "0.5578506", "0.55504835", "0.5550197", "0.55473894", "0.55438846", "0.5536405", "0.5532686", "0.55218816", "0.551507", "0.549898", "0.5483954", "0.548272", "0.54707694", "0.5465393", "0.54553133", "0.54544324", "0.5447501", "0.54457694", "0.543535", "0.54334056", "0.5430451", "0.5430272", "0.5426293", "0.5418137", "0.54162216", "0.54129887", "0.54114413", "0.5390594", "0.539011", "0.5388469", "0.5386099", "0.53851974", "0.537883", "0.53778255", "0.5374309" ]
0.70518637
1
calculateProduksi get the permintaan and persediaan value from text field and prints the production amount calculated
function calculateProduksi() { var permintaan = document.getElementById('permintaan').value; var persediaan = document.getElementById('persediaan').value; document.write(defuzzyfikasi(permintaan, persediaan)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculPricePni(){\n this.panierPrice = 0;\n for (let product of this.list_panier) {\n var price = product.fields.price*product.quantit;\n this.panierPrice = this.panierPrice+price;\n }\n //on arrondi le price au deuxieme chiffre apres la virgule\n this.panierPrice = this.panierPrice.toFixed(2);\n }", "function calcular(){\r\n\t\"use strict\";\r\n\tvar pack=document.getElementById(\"pack\").value;\r\n\tvar array=pack.split(\",\");\r\n\tvar precio=array[1];\r\n\tvar cantidad=document.getElementById(\"cantidad\").value;\r\n\tdocument.getElementById(\"total\").innerHTML=\"$\"+precio*cantidad;\r\n}", "function newCost() {\n let precioSubtotal = 0;\n let precioTotal = 0;\n let productos = cart_products_info.articles\n for(let i = 0; i <productos.length; i++) {\n let units = document.getElementById(\"cart_\"+i+\"_units\").value;\n precioSubtotal += convertir(productos[i].currency)*units*productos[i].unitCost;\n }\n // precioTotal = precioSubtotal*(1+precioEnvio()).toFixed(0)\n\n document.getElementById(\"precioSubtotal\").innerHTML = \"UYU \" + precioSubtotal.toFixed(0)\n document.getElementById(\"precioEnvio\").innerHTML = \"UYU \" + (precioSubtotal*precioEnvio()).toFixed(0)\n document.getElementById(\"precioTotal\").innerHTML = \"UYU \" + (precioSubtotal*(1+precioEnvio())).toFixed(0)\n\n}", "function Puntaje(combos,de_donde){\r\n if(combos==\"reset\"){\r\n $(de_donde).text(\"0\")\r\n }\r\n else{\r\n var Puntaje_actual = $(de_donde).text()\r\n var Total = Number(Puntaje_actual)+combos;\r\n $(de_donde).text(Total.toString())\r\n }\r\n}", "function PresionPlato(){\n\tvar carga = document.getElementById(\"carga\").value;\n\tvar radio = document.getElementById(\"radioPlato\").value;\n\tvar total = (carga/(Math.PI *Math.pow(radio,2)));\n\tvar total2 = total.toFixed(3);\n\tdocument.getElementById(\"presionPlato\").value = total2;\n\t//Reporte\n\tdocument.getElementById('recibeformulaPres').innerHTML = \"p = \"+carga+\" lb / (3.14 * \"+radio+\" in ^ 2)\";\n\tdocument.getElementById('recibeformulaPres1').innerHTML = \"p = \"+total.toFixed(3)+\" psi\";\n}", "CalcImporte(prd) {\n //alert('calculando');\n insumo.UltPrd = prd; //validar\n insumo.precio = $(`#prec_${prd}`).val();\n insumo.cantBueno = $(`#cantBueno_${prd}`).val();\n insumo.cantMalo = $(`#cantMalo_${prd}`).val();\n insumo.valorBueno = parseFloat(insumo.precio) * parseInt(insumo.cantBueno);\n insumo.valorMalo = parseFloat(insumo.precio) * parseInt(insumo.cantMalo);\n insumo.subTotal = insumo.valorBueno + insumo.valorMalo; // subTotal linea\n //\n $(`#valorBueno_v${prd}`).val(insumo.valorBueno.toFixed(10));\n $(`#valorBueno_d${prd}`).val(\"¢\" + insumo.valorBueno.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n $(`#valorMalo_v${prd}`).val(insumo.valorMalo.toFixed(10));\n $(`#valorMalo_d${prd}`).val(\"¢\" + insumo.valorMalo.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n $(`#subtotal_v${prd}`).val(insumo.subTotal.toFixed(10));\n $(`#subtotal_d${prd}`).val(\"¢\" + insumo.subTotal.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n }", "function CalcImporte(prd){\n producto.UltPrd = prd;//validar\n pUnit = $(`#prec_${prd}`)[0].textContent.replace(\"¢\",\"\");\n cant = parseInt($(`#cant_${prd}`)[0].value);\n\n if(cant <= parseInt($(`#cant_${prd}`)[0].attributes[3].value)){\n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseFloat(cant)).toString();\n }\n else{\n // alert(\"Cantidad invalida, la cantidad maxima disponible es: \"+ $(`#cant_${prd}`)[0].attributes[3].value)\n alertSwal(producto.cantidad)\n $(\"#cant_\"+ producto.UltPrd).val($(`#cant_${prd}`)[0].attributes[3].value); \n }\n \n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseInt($(`#cant_${prd}`)[0].value)).toString();\n // $(`#importe_${prd}`)[0].textContent\n $(`#cant_${prd}`).keyup(function(e) {\n if(e.which == 13) {\n if (cant==0){\n BorraRow(prd);\n calcTotal();\n }\n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseInt($(`#cant_${prd}`)[0].value)).toString();\n calcTotal();\n $(\"#p_searh\").focus();\n }\n });\n if (cant==0){\n BorraRow(prd);\n calcTotal();\n $(\"#p_searh\").focus();\n }\n}", "function calculateTotal_pr_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\t\t\t\t\n\t//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 \n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice_pr_cm');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'Você vai precisar plantar ' + resultadodosdecimales2 + ' sementes por hectare, que representa ' + resultadodosdecimales1 + ' sementes em um metro linear para atingir o seu alvo população de ' + resultadodosdecimales3;\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function actualizoTotales() {\r\n var costoDeEnvio = 0;\r\n importeTotal = 0;\r\n costoDeEnvio = $(\"input[name='opcion']:checked\").val() * $(\"#productCostText\").text();\r\n importeTotal = costoDeEnvio + parseFloat($(\"#productCostText\").text());\r\n document.getElementById(\"comissionText\").innerHTML = costoDeEnvio.toFixed(0);\r\n document.getElementById(\"totalCostText\").innerHTML = importeTotal.toFixed(0);\r\n }", "function importe2()\n {\n var cant = document.getElementById('cantidad').value;\n var pUnitario = document.getElementById('pUnitario').value;\n document.getElementById('importe').value = cant * pUnitario;\n }", "function agregarProducto1() {\n if (etiquetaCantidad1.innerHTML > 0) {\n precioSubTotal += Number(etiquetaPrecio1.innerHTML) * Number(etiquetaCantidad1.innerHTML);\n etiquetaSubTotal.innerHTML = precioSubTotal;\n }\n etiquetaTotal.innerHTML = precioSubTotal + costoEnvio;\n}", "function pomoCode(){\n // pomo input call here \n const pomoInput = document.getElementById(\"pomo-input\");\n const pomoInputValue = pomoInput.value;\n // sellor given pomo code here \n const sellorPomo = 'stevekaku';\n // compare with sellor pomo code and customer pomo code \n if(pomoInputValue == sellorPomo){\n // total amount call here \n const totalSumPrice = document.getElementById('previous-total').innerText;\n // after using pomo code price showing place call here \n const pomoDiscountPrice = document.getElementById('before-pomo');\n // 20% discount by using pomo code \n const afterPomoTotalDescount = parseFloat(totalSumPrice)*20/100;\n // pomo discount amount subtruncate and get update price\n const afterPomoTotalPrice = parseFloat(totalSumPrice) - afterPomoTotalDescount;\n pomoDiscountPrice.innerText = afterPomoTotalPrice;\n pomoInput.value='';\n }\n}", "function calAmt() {\n\n if ($('#productAttribute :selected').val() != \"\") {\n $('#final_per_unit').hide();\n var psize = 0;\n if ($('#productAttribute')) {\n psize = $('#productAttribute :selected').text();\n }\n var amt = $('#pamt').val();\n var qty = $('#p_quantity').val();\n if (qty != null && qty != '') {\n qty = qty;\n } else {\n qty = 1;\n }\n var fprice = parseFloat(amt) * parseFloat(qty);\n if (psize != 0) {\n //console.log(parseFloat(psize));\n fprice = parseFloat(fprice) * parseFloat(psize);\n }\n var final_price = fprice.toFixed(2);\n //console.log(final_price);\n $('#final_amonut').html(final_price);\n } else {\n var amt = $('#pamt').val();\n $('#final_per_unit').show();\n $('#final_amonut').html(amt);\n }\n\n}", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function calcularPremio() {\n return ($(\"#numJugadores\").val() * $(\"#valCarton\").val()) * 0.8;\n}", "function calculateTip() {\n const billAmount = document.getElementById(\"billNumber\").value;\n const theQuality = document.getElementById(\"Quality\").value;\n const peapleNum = document.getElementById(\"peapleNumber\").value;\n\n // the validation input in the 3 fildes\n if( isNaN(billAmount) || theQuality == 0 ){\n document.getElementById(\"finalCalc\").innerHTML = \"this feilds accepts number only\";\n };\n\n if( isNaN(peapleNum) || peapleNum <= 0 ){ \n document.getElementById(\"finalCalc\").innerHTML = \"this feilds accepts number only\";\n\n }else{\n peapleNum == 1;\n \n document.getElementById(\"finalCalc\").style.display = \"block\";\n\n document.getElementById(\"results\").style.display = \"block\"; \n }\n\n //the mathimatical function\n let total = (billAmount * theQuality) / peapleNum / 100;\n\n document.getElementById(\"results\").innerHTML = total + \"<sup>$</sup>\";\n}", "function somaProdutos(){\n\tvalores = jQuery(\".valorProduto\").text();\n\tarrayValores = valores.split(\"R$\");\n\tqtdValores = (arrayValores.length) - 1;\n\tsoma = 0;\t\n\tfor(i = 1; i <= qtdValores; i++){\n\t\tarrayValores[i] = parseFloat(arrayValores[i]);\n\t\tsoma += arrayValores[i];\n\t}\n\t\n\tif(jQuery(\"select[name='custeio']\").val() == \"50% Loja e 50% DMcard\")\n\t{\n\t\tsoma=soma/2;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% Loja\")\n\t{\n\t\tsoma = 0;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"Sem Forma de Pagamento\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% DMcard\")\n\t{\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t}\n\t\n\tjQuery(\".valorTotal span\").text(\"R$\" + soma.toFixed(2));\n\tjQuery(\"input[name='valorTotal']\").val(soma.toFixed(2));\n}", "function calcularPuntos(){\n ganados = Number($(\"#txtGanados\").val());\n empatados = Number($(\"#txtEmpatados\").val());\n\n puntos = ganados * 3 + empatados;\n\n $(\"#pResultado\").html(\"Puntos totales: \" + (puntos));\n}", "function agregarProducto2() {\n if (etiquetaCantidad2.innerHTML > 0) {\n precioSubTotal += Number(etiquetaPrecio2.innerHTML) * Number(etiquetaCantidad2.innerHTML);\n etiquetaSubTotal.innerHTML = precioSubTotal;\n }\n etiquetaTotal.innerHTML = precioSubTotal + costoEnvio;\n}", "function promoClick(){\n const promoInput =document.getElementById(' promo-input');\n const promoInputValue = promoInput.value;\n if(promoInputValue == \"stevekaku\"){\n const total = document.getElementById(\"total-cost\");\n const totalText = total.innerText;\n const totalNum = parseFloat(totalText);\n // const discTotal =(totalNum-(totalNum *20)/100) ;\n let discounTotal = document.getElementById(\"total-cost2\");\n discounTotal.innerText = (totalNum-(totalNum *20)/100);\n \n }\n }", "function CalculoPrecio() {\n var margen = document.getElementById(\"Margen\").value/100;\n var costo = document.getElementById(\"Costo\").value;\n var oferta = document.getElementById(\"Oferta\").value; \n var aux = +costo+(+costo*margen);\n var discount = aux * (oferta/100);\n aux = aux - discount;\n document.getElementById(\"Precio\").value= new Number(JSON.parse(aux));\n }", "function planPrem(){\n console.log('standard plan')\n var $prem = $('#Recommended').val();\n console.log($prem)\n var $premElevCost = 12345;\n console.log($premElevCost)\n//showing the $std to the 'Cost by elevators' case plus $\n$('#elevatorCost').val($premElevCost.toFixed(2));\ndocument.getElementById('elevatorCost').value = document.getElementById('elevatorCost').value + '$';\n\nvar $premInstall = parseInt($prem * 12345);\nconsole.log($premInstall)\n $premFee = ($premInstall * 0.13);\n $premTotal = ($premInstall + $premFee);\n\n//showing the $premInstall to the 'Total cost for elevators' case plus $\n$('#totalElevators').val($premInstall.toFixed(2));\ndocument.getElementById('totalElevators').innerHtml = $premInstall + '$';\n\n\n//showing the $premFee to the 'Install Fee' case plus $\n$('#installFee').val($premFee.toFixed(2));\ndocument.getElementById('installFee').innerHTML = $premFee + '$';\n\n//showing the $premTotal to the 'Total ' case plus $\n$('#total').val($premTotal.toFixed(2));\ndocument.getElementById('total').innerHTML = $premTotal + '$';\n\n\n}", "function udregnValuta() {\n document.getElementById(\"resultatDivValuta\").style.display = \"block\";\n let dKK = document.getElementById(\"danskDKK\").value;\n if (!isNaN(dKK)) {\n\n let eurValuta = dKK * 7.5;\n\n document.getElementById(\"valuta\").innerHTML = eurValuta.toFixed(2) + \"€\";\n }\n else {\n alert(\"Hovsa! Prøv igen med hele tal\");\n }\n}", "function calcular_precio(id,pos){\n\tvar cant=document.getElementById(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\tvar i=Number(pos);\n\tif(cant!=null){\n\t\tconsole.log(cant);\n\t\tconsole.log(cant.value);\n\t\tconsole.log(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\tvar prec=0;\n\t\tvar valor_venta=document.getElementById(\"valor_venta_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\tvar pre=document.getElementById(\"precio_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\t\n\t\t\n\t\tconsole.log(Number(cant.value));\n\t\tconsole.log(Number(valor_venta.value));\n\t\t//calculo el precio \n\t\tvar ps=mi_ticket[_numero_ticket-1].productos[i];\n\t\tconsole.log(ps);\n\t\tif((ps.promocion==\"1\" && ps.tipo_venta_promo==\"unidad\") && \n\t\t\t\t(Number(cant.value)>=ps.promo_desde) && \n\t\t\t\t\t(Number(cant.value)<=ps.promo_hasta)){\n\t\t\t\n\t\t\t\tvalor_venta.value=ps.precio_promo_venta;\n\t\t\t\tvalor_venta.innerHTML=\"$ \"+formato_numero(ps.precio_promo_venta,\"0\",\",\",\".\");\n\n\t\t}else{\n\t\t\t\tvalor_venta.value=ps.precio_producto;\n\t\t\t\tvalor_venta.innerHTML=\"$ \"+formato_numero(ps.precio_producto,\"0\",\",\",\".\");\n\t\t}\n\n\t\t\n\t\t\n\t\t//for(var i in mi_ticket[_numero_ticket-1].productos){\n\t\t\t\n\t\t\t\t\tif(mi_ticket[_numero_ticket-1].productos[i].id==id){\n\t\t\t\t\t\tconsole.log(mi_ticket[_numero_ticket-1].productos[i].cantidad_existencias<=cant.value);\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(cambiar_cantidad(i,cant)==true){\n\t\t\t\t\t\t\tprec=Number(cant.value) * Number(valor_venta.value);\n\t\t\t\t\t\t\tpre.innerHTML=\"$ \"+formato_numero(prec,\"0\",\",\",\".\");\n\t\t\t\t\t\t\tpre.value=prec;\n\t\t\t\t\t\t\tactualizar_unidades_reservadas(mi_ticket[_numero_ticket-1].productos[i]);\n\t\t\t\t\t\t\tcalcular_total(mi_ticket[_numero_ticket-1]);\n\t\t\t\t\t\t\tagregar_local_storage(\"mis_tickets_\"+_usuario.id_usuario+\"_\"+_IdSede,mi_ticket);\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdocument.getElementById(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos).value=mi_ticket[_numero_ticket-1].productos[i].cantidad_para_venta;\n\t\t\t\t\t\t\tconsole.log(\"Ha dicidico no pedir producto\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\tconsole.log(mi_ticket[_numero_ticket-1].productos[i].id);\n\t\t\t\t\t\t\tconsole.log(id);\n\t\t\t\t\t}\n\t\t//}\n\n\t}\n\n\t\n}", "function CalcolaCostoTotale() {\r\n var totale = 0.0;\r\n\t\t\tvar CostoPranzoAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzo\").innerHTML);\r\n var CostoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbCena\").innerHTML);\r\n var CostoPranzoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzoCena\").innerHTML);\r\n var CostoEventoSpecialeER = NumberEU(document.getElementById(\"prezzoEventoSpecialeER\").innerHTML);\r\n\t\t\t\r\n var Iscrizione = document.getElementById(\"Iscrizione\"); \r\n var PranzoAbbonamento = document.getElementById(\"AbbonamentoPranzo\");\r\n \tvar CenaAbbonamento = document.getElementById(\"AbbonamentoCena\");\r\n \tvar EventoSpecialeER = document.getElementById(\"EventoSpecialeER\");\r\n\r\n\t\t\tvar ruoloIscr = document.getElementById(\"RuoloIscritto\");\r\n\t\t\t\r\n\t\t\t// calcolo l'iscrizione\t\t\t\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoIscrizione\").innerHTML)) {\r\n\t\t\t\tCostoIscrizione = document.getElementById(\"prezzoIscrizione\").innerHTML;\r\n\t\t\t} \r\n\t\t\tif (Iscrizione.checked){\r\n\t\t\t\ttotale += NumberEU(CostoIscrizione);\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t// calcolo i pranzi e le cene settimanali\r\n\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\r\n\t\t\t\t// abbonamento completo\r\n\t\t\t\ttotale += CostoPranzoCenaAbbonamento;\r\n\t\t\t} else {\t\t\t\r\n\t\t\t\tif (!PranzoAbbonamento.checked) {\r\n\t\t\t\t\t// pranzi singoli\r\n\t\t\t\t\tvar Pranzi = document.getElementsByName(\"Pranzo[]\");\r\n\t\t var CostoPranzi = document.getElementsByName(\"CostoPranzo[]\");\r\n\t\t var PranziGratis = document.getElementsByName(\"GratisPranzo[]\");\r\n\t\t for (i=0; i < PranziGratis.length; i++) {\r\n\t\t\t\t\t\tif (!PranziGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Pranzi[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoPranzi[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoPranzi[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//abbonamento pranzo\r\n\t\t\t\t\ttotale += CostoPranzoAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!CenaAbbonamento.checked) {\r\n\t\t\t\t\t// cene singole\r\n\t\t\t\t\tvar Cene = document.getElementsByName(\"Cena[]\");\r\n\t\t var CostoCene = document.getElementsByName(\"CostoCena[]\");\r\n\t\t var CeneGratis = document.getElementsByName(\"GratisCena[]\");\r\n\t\t for (i=0; i < CeneGratis.length; i++) {\r\n\t\t\t\t\t\tif (!CeneGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Cene[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoCene[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoCene[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// abbonamento cena\r\n\t\t\t\t\ttotale += CostoCenaAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo la cena finale e gli ospiti\r\n\t\t\tif (document.getElementById(\"CenaFinale\").checked) {\r\n\t\t\t\tvar CostoCenaFinale = 0;\r\n\t\t\t\tvar NrOspiti = document.getElementById(\"NrOspiti\");\r\n\t var CostoTotale = document.getElementById(\"CostoTotaleEuroCalcolato\"); \r\n\t\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoCenaFinale\").innerHTML)) {\r\n\t\t\t\t\tCostoCenaFinale = NumberEU(document.getElementById(\"prezzoCenaFinale\").innerHTML);\r\n\t\t\t\t}\r\n\t\t\t\tif (IsStringNumeric(NrOspiti.value)) {\r\n\t\t\t\t\t// se hanno l'abbonamento la cena finale e' gratis\t\t\t\t\t\r\n\t\t\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\t\t\t\t\t\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale) + CostoCenaFinale;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo l'evento speciale\r\n\t\t\tif (EventoSpecialeER.checked) {\r\n\t\t\t\ttotale += CostoEventoSpecialeER;\r\n\t\t\t}\r\n\t\t\treturn totale;\r\n\t\t}", "function precioSubtotal(article) {\n units = document.getElementById(\"cart_\"+article+\"_units\").value;\n units_price = cart_products_info.articles[article].unitCost\n subtotal = units*units_price\n document.getElementById(\"cart_\"+article+\"_cost\").innerHTML = \"<strong> UYU \" + convertir(cart_products_info.articles[article].currency)*subtotal + \"</strong>\"; /// Convertir() pasa de dolares a uruguayos ///\n}", "function calculatePieCost() {\n const price = priceInput.value;\n const cost = price * 2;\n console.log(cost);\n total.innerText = `₽ всего за срок вклада - ${cost}`;\n }", "function fnShowPrice(data) {\n\n if (typeof data === 'undefined') return null;\n\n var out = \"\", interest = \"\", priceNormal = data.pn, priceOriginal = data.po, code = data.cp, maxParcels = parseInt(data.mp), isSub = (typeof data.issub !== 'undefined') ? JSON.parse(data.issub) : false;\n var pricemin = data.pricemin, pricemax = data.pricemax;\n // console.log('pricemin', pricemin, 'pricemax', pricemax);\n /* verifica preços diferentes entre os subprodutos */\n if (typeof pricemin !== \"undefined\" && typeof pricemax !== \"undefined\") {\n if (parseFloat(pricemin) > 0 && parseFloat(pricemax) > 0 && parseFloat(pricemin) !== parseFloat(pricemax)) {\n var priceInicial = pricemin.toString().split(\".\");\n if (priceInicial.length == 2) {\n var priceIntMin = priceInicial[0], priceDecimalMin = priceInicial[1];\n if (priceDecimalMin.length == 1) priceDecimalMin += \"0\";\n }\n else {\n var priceIntMin = priceInicial, priceDecimalMin = \"00\";\n }\n\n var priceFinal = pricemax.toString().split(\".\");\n if (priceFinal.length == 2) {\n var priceInt = priceFinal[0], priceDecimal = priceFinal[1];\n if (priceDecimal.length == 1) priceDecimal += \"0\";\n }\n else {\n var priceInt = priceFinal, priceDecimal = \"00\";\n }\n\n var text_prom = \"\";\n if (priceNormal != priceOriginal && priceOriginal != pricemax) { //verfica se o produto está em promoção e também se não é igual ao valor maior\n text_prom = \"<div class=\\\"old-price\\\"><span><strike>\" + FormatPrice(priceOriginal, 'R$') + \"</strike></span></div>\";\n }\n var txt = (isSub == false) ? '<span style=\"font-size:14px\">Escolha o produto para ver o preço.</span>' : \"\";\n return '<div class=\"prices\">'\n + text_prom\n + \"<div class=\\\"price\\\">&nbsp;&nbsp;<span class=\\\"price-intro\\\"></span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceIntMin) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimalMin + \"</span></div>\"\n + \"<div class=\\\"price\\\"><span class=\\\"price-intro\\\"> - </span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimal + \"</span></div>\"\n + '</div>'\n + txt;\n }\n }\n\n if (priceNormal == 0 && priceOriginal == 0) {\n return \"<div class=\\\"prices\\\">\"\n + \" <div class=price>\"\n + \" <div class='currency zf-consult-price'>\"\n + \" <a href='/faleconosco.asp?idloja=\" + FC$.IDLoja + \"&assunto=Consulta%20sobre%20produto%20(Código%20\" + code + \")' target='_top' >Preço Especial - Consulte!</a>\"\n + \" </div>\"\n + \" </div>\"\n + \"</div>\";\n }\n\n var priceFinal = priceNormal.toString().split(\".\");\n if (priceFinal.length == 2) {\n var priceInt = priceFinal[0], priceDecimal = priceFinal[1];\n if (priceDecimal.length == 1) priceDecimal += \"0\";\n }\n else {\n var priceInt = priceFinal, priceDecimal = \"00\";\n }\n\n if (typeof Juros !== \"undefined\") {\n maxParcels = (maxParcels == 0 || maxParcels > Juros.length) ? Juros.length : maxParcels;\n interest = (Juros[maxParcels - 1] > 0) ? \"\" : \" s/juros\";\n }\n else {\n maxParcels = 0;\n }\n\n var text = (isSub == true) ? 'a partir de ' : (priceNormal != priceOriginal) ? '' : ''; //var text = (isSub==true) ? 'a partir de ': (priceNormal != priceOriginal)? 'de ': '';\n\n if (priceNormal != priceOriginal) {\n out += \"<div class=\\\"prices\\\">\";\n out += \" <div class=\\\"old-price\\\">\" + text + \" <span class=\\\"font-primary\\\"><strike>\" + FormatPrice(priceOriginal, 'R$') + \"</strike>&nbsp;</span></div>\";\n out += \" <div class=\\\"price font-primary\\\">por&nbsp;<span class=\\\"currency\\\">R$ </span><span class=\\\"int\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec\\\">,\" + priceDecimal + \"</span></div>\";\n out += \"</div>\";\n if (maxParcels > 1) out += \"<div class=\\\"installments\\\">ou&nbsp;<strong><span class=\\\"installment-count\\\">\" + maxParcels + \"</span>x</strong> de <strong><span class=\\\"installment-price\\\">\" + FormatPrecoReais(CalculaParcelaJurosCompostos(priceNormal, maxParcels)) + \"</span></strong>\" + interest + \"</div>\";\n }\n else {\n out += \"<div class=\\\"prices\\\">\";\n out += \"<div class=\\\"price\\\"><span class=\\\"price-intro\\\">\" + text + \"</span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimal + \"</span></div>\";\n out += \"</div>\";\n if (maxParcels > 1) out += \"<div class=\\\"installments\\\">ou&nbsp;<strong><span class=\\\"installment-count\\\">\" + maxParcels + \"</span>x</strong> de <strong><span class=\\\"installment-price\\\">\" + FormatPrecoReais(CalculaParcelaJurosCompostos(priceNormal, maxParcels)) + \"</span></strong>\" + interest + \"</div>\";\n }\n //retorna html da preço\n return out;\n }", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function sumWithSale() {\n \n let sum = prompt(\"Введите сумму покупки:\");\n sum = Number(sum);\n let sale;\n if (sum > 500 && sum < 800) {\n sale = 0.03;\n } else if (sum > 800) {\n sale = 0.05;\n } else {\n sale = 0;\n };\n sum = sum - (sum * sale);\n let viewSale = sale * 100;\n alert(`Сумма покупки с учетом скидки - ${viewSale}% составляет: ${sum} грн.`);\n console.log(`3) Purchase sum with sale ${viewSale}%: ${sum} uah.`);\n }", "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function total(event) {\n console.log(event.target);\n let changedIndex = products.indexOf(event.target.name);\n let ourtarget = document.getElementById(event.target.name);\n let value = itemNo.value * products[i].price;\n console.log(value);\n ourtarget.textContent = value + ' JOD';\n products[i].total = value;\n products[i].purshaceNo = itemNo.value;\n console.log('The total quantity', products[i].purshaceNo);\n megaTotal = megaSum();\n all.innerHTML = `Total: ${megaTotal} JOD`;\n }", "function calcularImporte() {\n\n subtotal = Number($(\"#txtSubtotal\").val());\n total = subtotal * 1.22;\n $(\"#pResultado\").html(\"El importe final es: \" + (total));\n\n}", "function calcularTotal() {\n \n const pesoAct = Number(document.getElementById('pesoAct').innerHTML);\n const cantidad = Number(document.getElementById('cantidad').value);\n \n const total = pesoAct * cantidad;\n \n document.getElementById('total').innerHTML = total.toFixed(2);\n \n }", "function calculate() {\r\n let totalBill = document.getElementById(\"total-bill\").value;\r\n if (isNaN(totalBill) || (totalBill <= 0)) {\r\n alert(`Plase enter a valid amount!`);\r\n return;\r\n }\r\n let tipPercentage = 0;\r\n let tipSelection = document.getElementsByClassName('service')[0].value;\r\n if (tipSelection === 'excellent') {\r\n tipPercentage = 20;\r\n } else if (tipSelection === 'good') {\r\n tipPercentage = 15;\r\n } else if (tipSelection === 'poor') {\r\n tipPercentage = 10;\r\n } else {\r\n alert(`Please select an option!`);\r\n }\r\n\r\n let totalTip = totalBill * tipPercentage / 100;\r\n\r\n let totalPersons = Number(document.getElementById('people-form').value);\r\n if (isNaN(totalPersons) || (totalPersons <= 0)) {\r\n alert(`Plase enter a valid number of persons!`);\r\n return;\r\n }\r\n\r\n if (Number.isInteger(totalPersons)) {\r\n let tipPerPerson = totalTip / totalPersons;\r\n let tipPerPersoninDollar = tipPerPerson.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });\r\n document.getElementById('tips').innerHTML = tipPerPersoninDollar;\r\n document.getElementById('total').style = 'display: inline';\r\n } else { alert('Plase enter an interger number') }\r\n }", "function pesanprosesdata() {\n\talert(\"Anda masih dalam proses penginputan/perubahan data\\nSelesaikan proses tersebut dengan mengklik tombol Simpan/Selesai/Batal (untuk membatalkan penginputan)\");\n}", "function NotaFinal() {\nvar pre1 = document.getElementById(\"pre1\").value;\nif(pre1==\"\")\n{\n alert(\"Califiqué todas la preguntas\");\n}\nelse\n{ \n pregunta1();\n pregunta2();\n pregunta3();\n pregunta4();\n pregunta5();\n\n var Nf =\n parseFloat(tpre1) +\n parseFloat(tpre2) +\n parseFloat(tpre3) +\n parseFloat(tpre4) +\n parseFloat(tpre5);\n var Vtotal = Nf.toFixed(2);\n $(\"#txtNota\").html(Vtotal);\n document.getElementById(\"bt_comprobar\").disabled = true;\n}\n}", "function ValidateProductFac(e){\n //compara si el articulo ya existe\n // carga lista con datos.\n if(e != \"false\"){\n producto = JSON.parse(e)[0];\n producto.UltPrd = producto.codigoRapido;\n var repetido = false;\n\n if(document.getElementById(\"productos\").rows.length != 0 && producto != null){\n $(document.getElementById(\"productos\").rows).each(function(i,item){\n if(item.childNodes[0].innerText==producto.codigoRapido){\n item.childNodes[3].childNodes[\"0\"].attributes[3].value = producto.cantidad;\n var CantAct = parseInt(item.childNodes[3].firstElementChild.value);\n if (parseInt(producto.cantidad) > CantAct ){\n item.childNodes[3].firstElementChild.value = parseFloat(item.childNodes[3].firstElementChild.value) + 1;\n item.childNodes[04].firstChild.textContent = \"¢\" + parseFloat((item.childNodes[2].firstChild.textContent).replace(\"¢\",\"\")) * parseFloat(item.childNodes[3].firstElementChild.value);\n calcTotal();\n }\n else{\n // alert(\"No hay mas de este producto\");\n alertSwal(producto.cantidad)\n // $(\"#cant_\"+ producto.UltPrd).val($(\"#cant_\"+ producto.UltPrd)[0].attributes[3].value); \n $(\"#cant_\"+ producto.UltPrd).val(producto.cantidad);\n }\n repetido=true;\n calcTotal();\n } \n });\n } \n if (repetido==false){\n // showDataProducto(e);\n AgregaPrd();\n }\n }\n else{\n CleanCtls();\n }\n}", "function actualizarPrecio() {\n var precioModelo = precioModelos[almohadonNuevo.modelo];\n var precioForma = precioFormas[almohadonNuevo.forma];\n var precioColor = precioColores[almohadonNuevo.color];\n var precioTexto = 0;\n if (hayTexto)\n precioTexto = 50;\n var total = parseFloat(precioModelo)+parseFloat(precioForma)+parseFloat(precioColor)+parseFloat(precioTexto);\n $(\"#precioModelo\").text(\"$\"+precioModelo);\n $(\"#precioForma\").text(\"$\"+precioForma);\n $(\"#precioColor\").text(\"$\"+precioColor);\n $(\"#precioTexto\").text(\"$\"+precioTexto);\n $(\"#precioTotal\").text(\"$\"+total);\n}", "function calcularTotales(){\n \tvar sub = document.getElementsByName(\"subtotal\");\n \tvar total = 0.0\n \tfor (var i = 0; i <sub.length; i++) {\n\t\ttotal += document.getElementsByName(\"subtotal\")[i].value;\n\t}\n\t$(\"#totalproductos\").html(total);\n $(\"#total_traspaso\").val(total);\n // evaluar();\n }", "function aumentarPrecio(){\n let disney=385;\n let inflacion = 150;\n\n document.write('El valor total del servicio de disnes plus $'+(disney+inflacion));\n}", "function botonCalcular(event) {\n event.preventDefault();\n\n let subtotalCamisa = camisaEvento.value * valorCamisa;\n let totalCamisa = subtotalCamisa - (subtotalCamisa * 0.07);\n\n let totalEtiqueta = etiquetaEvento.value * valorEtiquetas;\n let oculto = document.querySelector('#totalPagado');\n\n let paseTotalDia = campoDia.value * paseDia;\n let paseTotalCompleto = campoCompleto.value * paseCompleto;\n let paseTotalDos = campoDos.value * paseDos;\n\n\n if (regalo.value == \"\" || undefined ) {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n } else {\n errorRegalo.style.visibility = \"hidden\"\n let totalReserva = paseTotalCompleto + paseTotalDia + paseTotalDos + totalCamisa + totalEtiqueta;\n\n sumaTotal.innerHTML = `$ ${totalReserva.toFixed(2)}`;\n oculto.value = totalReserva;\n }\n \n \n let resumenProductos = [];\n\n if (campoDia.value >= 1) {\n resumenProductos.push(`${campoDia.value} Boletos de un dia`)\n }\n if (campoDos.value >= 1) {\n resumenProductos.push(`${campoDos.value} Boletos de dos dias`)\n }\n if (campoCompleto.value >= 1) {\n resumenProductos.push(`${campoCompleto.value} Boletos de todos los dias`)\n }\n if (camisaEvento.value >= 1) {\n resumenProductos.push(`${camisaEvento.value} Camisas del evento`)\n }\n if (etiquetaEvento.value >= 1) {\n resumenProductos.push(`${etiquetaEvento.value} etiquetas del evento `)\n }\n\n if(regalo.value !== \"\"){\n resumenProductos.push(`${regalo.value} es el regalo`)\n }\n\n listaProductos.innerHTML = '';\n\n resumenProductos.forEach(element => {\n if (regalo.value !== \"\") {\n listaProductos.innerHTML += `${element} </br>`\n } else {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n }\n })\n //si no le agregamos el += solo nos imprimira un solo elemento, ademas debemos inicializar listaProductos.innerHTML = ''; \n // vacio, ya que si no lo hacemos de esta manera, se sobre escribira el array\n\n botonRegistro.disabled = false;\n \n \n }", "function calcularPrecio()\n{\n\tvar precioTotal = 0;\n\t$(\".precioTotal\").each(function() {\n precioTotal += parseFloat($(this).text());\n });\n $(\"#botonPrecio\").text(\"Precio total: \" + precioTotal);\n}", "function update_product_price(product_id){\n var total = 0;\n var depqty = document.getElementById(\"product_licence_\" + product_id + \"_qty\")\n var depprice = document.getElementById(\"product_licence_\" + product_id + \"_price\")\n var depcost = document.getElementById(\"product_licence_\" + product_id + \"_cost\")\n var deplicence = document.getElementById(\"product_licence_id\").value\n var deptotal = document.getElementById(\"product_licence_total\")\n depcost.value = depqty.value * depprice.value\n var lic = deplicence.split(\",\")\n for (var i = 1; i < lic.length; i++){\n total = total + parseInt(document.getElementById(\"product_licence_\" + lic[i] + \"_cost\").value)\n }\n deptotal.value = total;\n}", "function total(){\n // regular price area call here \n const regularPrice = document.getElementById(\"regular-price\").innerText;\n // final memory price area call here \n const finalMemoryPrice =document.getElementById('previous-memory-cost').innerText;\n // final storage price area call here \n const finalStoragePrice = document.getElementById(\"previous-storage-cost\").innerText;\n // final delivery charge area call here \n const finalDeliveryFee = document.getElementById(\"delivery-fee\").innerText;\n // total price showing area call here \n const totalPrice = document.getElementById('previous-total');\n // pomo total price showing here \n const pomoFinalTotal = document.getElementById(\"before-pomo\");\n // total price calculation \n const sumTotalPrice = parseFloat(regularPrice) + parseFloat(finalMemoryPrice) + parseFloat(finalStoragePrice) + parseFloat(finalDeliveryFee );\n totalPrice.innerText = sumTotalPrice;\n pomoFinalTotal.innerText = sumTotalPrice;\n}", "function ReiniciarCalcularPrecioFinal() {\n var total = $(\"#total\").text();\n\n $(\"#mostrardescuento\").text(0);\n $(\"#descuentos\").val(1);\n $(\"#descuentos option:selected\").val(1);\n $('#descuentos').material_select();\n $('#calculoEfectivoBs').val(0);\n $('#calculoEfectivoSus').val(0);\n\n $('#efectivoBs').val(\"0.00\");\n $('#efectivoSus').val(\"0.00\");\n $('#dBancoBs').val(\"\");\n $('#dBancoSus').val(\"\");\n $('#chequeBs').val(\"\");\n $('#chequeSus').val(\"\");\n $('#tDebitoBs').val(\"\");\n $('#tDebitoSus').val(\"\");\n $('#tCreditoBs').val(\"\");\n $('#tCreditoSus').val(\"\");\n var idmoned = $(\"#idMoneda\").val();\n\n if (idmoned == 1) {//Bolivianos\n $(\"#money1\").text(\"Bs.\");\n $(\"#money2\").text(\"Bs.\");\n $(\"#money3\").text(\"Bs.\");\n $(\"#money4\").text(\"Bs.\");\n $(\"#money5\").text(\"Bs.\");\n $(\"#money6\").text(\"Bs.\");\n $(\"#money7\").text(\"Bs.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n var valor = LITERAL(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n\n } else {\n $(\"#money1\").text(\"Sus.\");\n $(\"#money2\").text(\"Sus.\");\n $(\"#money3\").text(\"Sus.\");\n $(\"#money4\").text(\"Sus.\");\n $(\"#money5\").text(\"Sus.\");\n $(\"#money6\").text(\"Sus.\");\n $(\"#money7\").text(\"Sus.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n\n var tipoCV = parseFloat($(\"#TCV\").text());\n var totalConversion = parseFloat(total);\n var totaltotal = totalConversion * tipoCV;\n var redondeo = totaltotal.toFixed(2);\n var valorConversion = LITERAL(redondeo);\n $(\"#totalventaliteralSus\").text(valorConversion);\n\n\n var valor = LITERALDOLAR(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n }\n\n\n\n}", "function calcular_promedio(type_calification, pr1, pr2, pr3, pa1, pa2, pe){\n if (type_calification === 'A') {\n\n pro_pr = 3*((pr1+pr2+pr3)/3)\n pro_pa = 2*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/6\n return Math.round(pro_gen)\n\n } else if (type_calification === 'B') {\n\n pro_pr = 3*((pr1+pr2+pr3)/3)\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/7\n return Math.round(pro_gen)\n\n } else if (type_calification === 'C') {\n\n pro_pr = 2*((pr1+pr2+pr3)/3)\n pro_pa = 4*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/7\n return Math.round(pro_gen)\n\n } else if (type_calification === 'D') {\n\n pro_pr = 2*((pr1+pr2+pr3)/3)\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/6\n return Math.round(pro_gen)\n\n } else if (type_calification === 'E') {\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pa + pe)/4\n return Math.round(pro_gen)\n\n } else {\n\n pro_pr = 4*((pr1+pr2+pr3)/3)\n pro_gen = (pro_pr + pe)/5\n return Math.round(pro_gen)\n }\n }", "function sumarTotalPrecio(){\n\n\t\t\tvar precioItem = $('.nuevoPrecioProducto');\n\n\t\t\tvar arraySumarPrecio = [];\n\n\t\t\tfor (var i = 0; i < precioItem.length; i++){\n\n\t\t\t\tarraySumarPrecio.push(Number($(precioItem[i]).val()));\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\tfunction sumarArrayPrecio(total, numero){\n\n\t\t\t\treturn total+numero;\n\n\n\t\t\t}\n\n\t\t\tvar sumaTotalPrecio = arraySumarPrecio.reduce(sumarArrayPrecio)\n\t\t\t\n\t\t\t$('#nuevoTotalVenta').val(sumaTotalPrecio);\n\t\t\t$('#totalVenta').val(sumaTotalPrecio);\n\t\t\t$('#nuevoTotalVenta').attr('total', sumaTotalPrecio);\n\t\t}", "function planEx(){\n console.log('excelium plan')\n var $ex = $('#Recommended').val();\n console.log($ex)\n var $exElevCost = 15400;\n console.log($exElevCost)\n//showing the $std to the 'Cost by elevators' case plus $\n$('#elevatorCost').val($exElevCost.toFixed(2));\ndocument.getElementById('elevatorCost').value = document.getElementById('elevatorCost').value;\n\nvar $exInstall = parseInt($ex * 15400);\nconsole.log($exInstall)\n $exFee = ($exInstall * 0.16);\n $exTotal = ($exInstall + $exFee);\n\n//showing the $premInstall to the 'Total cost for elevators' case \n$('#totalElevators').val($exInstall.toFixed(2));\ndocument.getElementById('totalElevators').innerHtml = $exInstall;\n\n\n//showing the $premFee to the 'Install Fee' case plus $\n$('#installFee').val($exFee.toFixed(2));\ndocument.getElementById('installFee').innerHTML = $exFee + '$';\n\n//showing the $premTotal to the 'Total ' case plus $\n$('#total').val($exTotal.toFixed(2));\ndocument.getElementById('total').innerHTML = $exTotal + '$';\n\n\n\n\n}", "function prixTotal() {\n let total = 0;\n for (let j= 0; j < objPanier.length; j++) {\n total = total + objPanier[j].price * objPanier[j].number;\n }\n let afficheTotal = document.querySelector(\"#total\");\n afficheTotal.textContent=(\"Total : \" + (total / 100).toLocaleString(\"fr\") + \" €\");\n}", "function hitungPVA() {\n\t\tvar MASKEr = document.getElementById(\"pva1\").value;\n\t\tvar MASKEi= document.getElementById(\"pva2\").value;\n\t\tvar MASKEn= document.getElementById(\"pva3\").value;\n\n\t\tvar Er = MASKEr.split(',').join('');\n\t\tvar Ei = MASKEi.split(',').join('');\n\t\tvar En = MASKEn.split(',').join('');\n\n\t\tvar Eip\t= Ei / 100;\n\t\tvar Efixed = (Math.pow(1+Eip,En)).toFixed(4);\n\t\tvar Epengalipva = (Efixed -1) / (Eip * Efixed);\n\t\tvar Epva = Er * Epengalipva;\n\t\tvar Erpva = Math.round(Epva);\n\t\tdocument.getElementById(\"outputPVA\").innerHTML = \n\t\t\"Faktor Pengali PV-annuitas : \\n\"+\n\t\t\"\t\t= (( 1 + i )^n + 1 ) / ( i x ( 1 + i )^n ) \\n\"+\n\t\t\"\t\t= (( 1 + \"+ Eip +\" )^\"+ En +\" + 1 ) / ( \"+ Eip +\" x ( 1 + \"+ Eip +\" )^\"+ En +\" ) \\n\"+\n\t\t\"\t\t= \"+ Epengalipva.toFixed(4) +\" \\n\"+\n\t\t\"Present Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali PV-annuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKEr +\" x \"+ Epengalipva.toFixed(4) +\"\\n\"+\n\t\t\"\t\t= \"+ uang(Erpva, \"Rp.\");\n\t}", "function ProteinCalculator(){\r\n\tlet kg;\r\n\tlet lvl;\r\n\tkg = parseInt(document.getElementById(\"i1\").value);\r\n\tlvl = document.getElementById(\"optiuni\").value;\r\n\tlet result;\r\n\tif(lvl == \"Sedentary\")\r\n\t{\r\n\t\tresult = kg*0.8;\r\n\t}\r\n\tif(lvl == \"Moderate Activity\") \r\n\t{\r\n\t\tresult = kg;\r\n\t}\r\n\tif(lvl == \"Endurance Training\") \r\n\t{\r\n\t\tresult= kg*1.2;\r\n\t}\r\n\tif(lvl == \"Weight Training\")\r\n\t{\r\n\t\tresult= kg*1.6;\r\n\t}\r\n\tdocument.getElementById(\"rez\").innerHTML = result;\r\n\r\n}", "function updateGesamtPreis() {\n \"use strict\";\n gesamtPreis = 0.0;\n warenkorb.forEach(WarenkorbRechner);\n /*Für jede option im Wk, werden in der Methode \"WarenkorbRechner\"\n die Preise Addiert*/\n var summeSite = document.getElementById(\"gesamtPreis\");\n //aktualisiere innerText mit neuem Preis\n summeSite.innerText = \"Gesamtpreis: \" + gesamtPreis.toFixed(2) + \"€\";\n}", "function NotaFinal() {\r\n var pre1a = document.getElementById(\"pre1a\").value;\r\n if (pre1a == \"\") {\r\n alert(\"Pregunta 1: Califiqué la pregunta\");\r\n } else {\r\n var pre3a = document.getElementById(\"pre3a\").value;\r\n if (pre3a == \"\") {\r\n alert(\"Pregunta 3: Califiqué la pregunta\");\r\n } else {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n var Nf =\r\n parseFloat(tpre1) +\r\n parseFloat(tpre2) +\r\n parseFloat(tpre3) ;\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n }\r\n }\r\n}", "function udregnTaxfreeSaving() {\n document.getElementById(\"resultatDivTax\").style.display = \"block\";\n\n let foer = document.getElementById(\"prisFørTax\").value;\n let taxfree = document.getElementById(\"nyPrisTax\").value;\n if (!isNaN(foer) && !isNaN(taxfree)) {\n\n let taxFreePris = foer / 100;\n let taxFreeSaving = taxfree * taxFreePris;\n\n document.getElementById(\"taxrabat\").innerHTML = taxFreeSaving.toFixed(2) + \"kr\";\n }\n else {\n alert(\"Hovsa! Prøv igen med hele tal\");\n }\n}", "function calculaPrecio(precio) {\n \n for (let i = 0; i < productoPrecio.length; i++) {\n \n \n if ( precio==productoPrecio[i] ) {\n \n \n console.log(productoPrecio.length + ' productos con precios iniciales:');\n console.log((productoPrecio[0]*1000) + ' pesos el Vainilla');\n console.log((productoPrecio[1]*1000) + ' pesos el Chocolate');\n console.log((productoPrecio[2]*1000) + ' pesos la Cacao');\n console.log((productoPrecio[3]*1000) + ' pesos las Trufas');\n\n console.log('El precio inicial del producto que se eligió era de ' + precio*1000 + ' pesos');\n\n \n precioFinal = precio * descuentoOperativo;\n\n\n\n alert('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs')\n \n return console.log('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs');\n \n }\n\n } \n}", "function NotaFinal() {\r\n var pre1a = document.getElementById(\"pre1a\").value;\r\n if (pre1a == \"\") {\r\n alert(\"Pregunta 1: Califiqué la pregunta\");\r\n } else {\r\n var pre2a = document.getElementById(\"pre2a\").value;\r\n if (pre2a == \"\") {\r\n alert(\"Pregunta 2: Califiqué la pregunta\");\r\n } else {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n pregunta4();\r\n pregunta5();\r\n pregunta6();\r\n pregunta7();\r\n pregunta8();\r\n var Nf =\r\n parseFloat(tpre1) +\r\n parseFloat(tpre2) +\r\n parseFloat(tpre3) +\r\n parseFloat(tpre4) +\r\n parseFloat(tpre5) +\r\n parseFloat(tpre6) +\r\n parseFloat(tpre7) +\r\n parseFloat(tpre8);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n }\r\n }\r\n}", "function calcTotal(){\n var subT=0; \n if($(document.getElementById(\"productos\").rows)[\"0\"].childElementCount>2){\n \n $(document.getElementById(\"productos\").rows).each(function(i,item){\n // alert(item.childNodes[3].innerText);\n \n subT= subT + parseFloat((item.childNodes[4].textContent).replace(\"¢\",\"\")); \n });\n $(\"#subTotal\")[0].textContent = \"¢\"+subT.toFixed(2); \n factura.descuento = $(\"#desc_val\")[0].textContent = \"¢\"+ (subT * (parseFloat(($(\"#desc_100\")[0].textContent).replace(\"%\",\"\"))) / 100).toFixed(2) ;\n factura.impuesto = $(\"#iv_val\")[0].textContent = \"¢\"+ ((subT * (parseFloat(($(\"#iv_100\")[0].textContent).replace(\"%\",\"\")) / 100)) - (parseFloat(($(\"#desc_val\")[0].textContent).replace(\"¢\",\"\")))).toFixed(2) ;\n $(\"#total\")[0].textContent = \"¢\" + ((($(\"#subTotal\")[0].textContent).replace(\"¢\",\"\")) - parseFloat(($(\"#desc_val\")[0].textContent).replace(\"¢\",\"\")) + parseFloat(($(\"#iv_val\")[0].textContent).replace(\"¢\",\"\"))).toFixed(2);\n }\n else{\n $('#open_modal_fac').attr(\"disabled\", true);\n $(\"#subTotal\")[0].textContent = \"¢0\"; \n $(\"#desc_val\")[0].textContent = \"¢0\";\n $(\"#iv_val\")[0].textContent = \"¢0\";\n $(\"#total\")[0].textContent = \"¢0\";\n \n }\n}", "function hitung_total(){\n\t\t\tvar b_kirim = $(\"#biaya_kirim\").val();\n\t\t\tvar b_packing = $(\"#biaya_packing\").val();\n\t\t\tvar b_asuransi = $(\"#biaya_asuransi\").val();\n\t\t\tvar dibayar = $(\"#dibayar\").val();\n\n\t\t\tvar totalnya = parseInt(b_kirim) + parseInt(b_packing) + parseInt(b_asuransi);\n\t\t\t$(\"#subtotal\").html(rupiah(totalnya));\n\t\t\t\n\t\t\tif(dibayar >= totalnya){\n\t\t\t\tvar totalakhir = parseInt(dibayar) - totalnya;\n\t\t\t\t$('#status_bayar').val('lunas');\n\t\t\t\t$('#ketuang').html('Kembalian');\n\t\t\t}else{\n\t\t\t\tvar totalakhir = totalnya - parseInt(dibayar);\n\t\t\t\t$('#status_bayar').val('belum_lunas');\n\t\t\t\t$('#ketuang').html('Kekurangan');\n\t\t\t}\n\t\t\t$(\"#total\").html(rupiah(totalakhir));\n\t\t}", "function calcularPerimetroCudrado(){\nconst input=document.getElementById(\"inputcuadrado\");\nconst value=input.value;\nconst perimetro=perimetroCuadrado(value);\nalert(perimetro);\n}", "function NotaFinal() {\r\n var pre1a = document.getElementById(\"pre1a\").value;\r\n if (pre1a == \"\") {\r\n alert(\"Pregunta 1: Califiqué la pregunta\");\r\n } else {\r\n pregunta1();\r\n pregunta2();\r\n var Nf = parseFloat(tpre1) + parseFloat(tpre2);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n }\r\n}", "function sumarTotalPrecio() {\n agregarImpuesto();\n const precioItem = $(\".nuevoPrecioProducto\");\n let arraySumaPrecio = [];\n\n const longitud = precioItem.length;\n for (let i = 0; i < longitud; i++) {\n arraySumaPrecio.push(Number($(precioItem[i]).val()));\n }\n\n // function sumarArrayPrecios(total, numero) {\n // return total + numero;\n // }\n\n // const sumarTotalPrecio = arraySumaPrecio.reduce(sumarArrayPrecios);\n const sumarTotalPrecio = arraySumaPrecio.reduce(\n (total, numero) => total + numero\n );\n\n $(\"#nuevoTotalVenta\").val(sumarTotalPrecio);\n $(\"#nuevoTotalVenta\").attr(\"total\", sumarTotalPrecio);\n}", "function NotaFinal() {\r\n var pre3a = document.getElementById(\"pre3a\").value;\r\n if (pre3a == \"\") {\r\n alert(\"Pregunta 3: Califiqué la pregunta\");\r\n } else {\r\n var pre6a = document.getElementById(\"pre6a\").value;\r\n if (pre6a == \"\") {\r\n alert(\"Pregunta 6: Califiqué la pregunta\");\r\n } else {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n pregunta4();\r\n pregunta5();\r\n pregunta6();\r\n var Nf =\r\n parseFloat(tpre1) +\r\n parseFloat(tpre2) +\r\n parseFloat(tpre3) +\r\n parseFloat(tpre4) +\r\n parseFloat(tpre5) +\r\n parseFloat(tpre6);\r\n\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n $(\"input\").attr('disabled', 'disabled');\r\n }\r\n }\r\n}", "function calculaTotalProdutos() {\n\n // var produtos = document.getElementsByClassName(\"produto\");\n // var produtos = $(\".produto\");\n\n var totalProdutos = 0;\n\n // for (var posicao = 0; posicao < produtos.length; posicao++) {\n // Preco\n // var elementoPreco = produtos[posicao].getElementsByClassName(\"preco\");\n // var precoEmTexto = elementoPreco[0].innerHTML;\n // var preco = textParaFloat(precoEmTexto);\n // Quantidade\n // var elementoQuantidade = produtos[posicao].getElementsByClassName(\"quantidade\");\n // Como quantidade é um input temos que busca um value\n // var quantidadeEmTexto = elementoQuantidade[0].value;\n // var quantidade = textParaFloat(quantidadeEmTexto);\n\n // var subTotal = quantidade * preco;\n // totalProdutos = totalProdutos + subTotal;\n //\n // var $produto = $(produtos[posicao]);\n // var quantidade = textParaFloat($produto.find('.quantidade').val());\n // var preco = textParaFloat($produto.find('.preco').text());\n // totalProdutos += quantidade * preco;\n //\n // }\n\n // EACH executa a function para elemento encontrado\n $(\".produto\").each(function(posicao, produto) {\n var $produto = $(produto);\n var quantidade = textParaFloat($produto.find(\".quantidade\").val());\n var preco = textParaFloat($produto.find(\".preco\").text());\n\n totalProdutos += quantidade * preco;\n });\n\n// console.log(produtos);\n\n return totalProdutos;\n}", "function pro_total() {\r\n\t\tvar pro_no = document.getElementById(\"pro\").value;\t\r\n\t\tpNumber = parseInt(pro_no);\r\n\t\tvar protick_text = document.getElementById(\"pro_label\").textContent;\r\n\t\t\r\n\t\tupdateProBasket(pNumber, protick_text);\r\n\t\t//updateDisplayTickets();\r\n\t\tsetCookie(\"pro_total\", pNumber,1);\r\n\t\t//alert(\"go to updateProBasket\");\r\n\t\t\r\n\t}", "function prom(){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"php/calculos.php\",\n\t\tsuccess: function (resp) {\n\t\t\tvar valor = resp.split(\"|\");\n\t\t\t$('#estadisticas').find('#prom').text(parseFloat(valor[0]).toFixed(1));\n\t\t\t$('#estadisticas').find('#porcent').text(parseFloat(valor[1]).toFixed(1));\n\t\t\t$('#estadisticas').find('#porcentm').text(100-(parseFloat(valor[1])).toFixed(1));\n\t\t}\n\t});\n}", "function calcularPerimetroCirculo() {\n const input = document.getElementById(\"InputCirculo\");\n const value = input.value;\n const perimetro = perimetroCirculo(value);\n resultTagCirculo.innerHTML = perimetro.toFixed(2);\n}", "function calcularPerimetroCuadrado () {\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n const perimetro = perimetroCuadrado(value);\n resultTagCuadrado.innerHTML = perimetro;\n}", "function datosCostoPA(producto_id) {\n tipo_movimiento = document.getElementById('tipo_movimiento').value;\n costo_abc = document.getElementById('costo_abc').value;\n if (tipo_movimiento != '0' && costo_abc != '0') {\n costo = '0';\n //contado\n if (tipo_movimiento == 'CONTADO') {\n if (costo_abc == 'A') {\n costo = precio_a[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c[producto_id];\n }\n }\n\n //FACTURA\n if (tipo_movimiento == 'FACTURA') {\n if (costo_abc == 'A') {\n costo = precio_a_factura[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_factura[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_factura[producto_id];\n }\n }\n\n //CONSIGNACION\n if (tipo_movimiento == 'CONSIGNACION') {\n if (costo_abc == 'A') {\n costo = precio_a_consignacion[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_consignacion[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_consignacion[producto_id];\n }\n }\n\n //planpago\n if (tipo_movimiento == 'PLANPAGO') {\n if (costo_abc == 'A') {\n costo = precio_a_pp[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_pp[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_pp[producto_id];\n }\n }\n\n //stock ids\n stock_ids = document.getElementById('stock_ids_' + producto_id).value;\n if (Trim(stock_ids) != '') {\n division = stock_ids.split(',');\n for (i = 0; i < division.length; i++) {\n costo_obj = document.getElementById('costo_' + division[i]);\n costo_obj.value = costo;\n }\n }\n\n }\n}", "function calculocompraslocales(cant,costo)\n{\n var ret; \n var pu//preciounitario\n pu=costo/cant;// calculamos el costo unitario \n //if($(\"#nfact_imp\").val()!=\"SF\") //si tiene el texto SF es sin factura \n // ret=pu*glob_factorIVA; //confactura\n //else \n // ret=pu*glob_factorRET+pu; //sinfactura \n // return ret;\n\n}", "function Descuento40(){\n //recuperamos el valor descuento40 anterior\n var descuento40=document.getElementById(\"sal_pyt40\").value;\n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento40 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento40);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n //sueldo bruto inicial\n var SaldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SaldoBrutoIni/30;\n //obtiene dias de permisos/llegada tardia\n var dias= document.getElementById('descuento40').value;\n //descuento por dia de 40 %\n var descuento40=((jornal*40)/100)\n //actualizar valor de sal_pyt\n document.getElementById(\"sal_pyt40\").value=(descuento40*dias);\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(descuento40*dias);\n \n \n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function calcul_price(){\n\t \t\tlet checked_language = $('.simulator_language:checkbox[name=estimate]:checked'),\n\t \t\t\ti = 0,\n\t \t\t\ttxt = '',\n\t \t\t\ttotal = 0,\n\t \t\t\tcurent_lang_name,\n\t \t\t\tcurent_lang_total;\n\n\t\t\tif ( checked_language.length <= 0 ){\n\t\t\t\t$('#simulator_result').html('');\n\t\t\t\t$('#simulator_total').html('');\n\t\t\t\talert('Please choose a language!');\n\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\t_simutator.languages = [];\n\t\t\tfor (; i <= checked_language.length - 1; i++) {\n\t\t\t\tlet price = $(checked_language[i]).data('simulatorPrice');\n\t\t\t\ttotal += curent_lang_total = (_simutator.text_length * price);\n\t\t\t\tcurent_lang_name = $(checked_language[i]).val();\n\n\t\t\t\t_simutator.languages.push({'lang': curent_lang_name, 'price': price});\n\t\t\t\ttxt += '<div>'+ curent_lang_name;\n\t\t\t\ttxt += ' <div> ' + curent_lang_total.toFixed(2) + '</div>';\n\t\t\t\ttxt += '</div>';\n\t\t\t}\n\t\t\t$('#simulator_result').html(txt);\n\t\t\t$('#simulator_total').html('total = '+ total.toFixed(2) +'$');\n\t \t}", "function totalPrice(){\n const memoryCost = document.getElementById('memory_cost').innerText;\n const storageCost = document.getElementById('storage_cost').innerText;\n const delivaryCost = document.getElementById('delivary_cost').innerText;\n const total = 1299 + parseInt(memoryCost) + parseInt(storageCost) + parseInt(delivaryCost);\n document.getElementById('total_cost').innerText = total;\n document.getElementById('total_cost_fainal').innerText = total;\n}", "function promoTotal(totalPrice)\n{\n const promoInput= document.getElementById('promo-input');\n if(promoInput.value== 'stevekaku')\n {\n totalPrice= parseFloat (totalPrice) * .80;\n promoInput.value= '';\n }\n document.getElementById('final-total').innerText= totalPrice;\n\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 muestroTotalProductos() {\r\n var subTotalCompleto = 0;\r\n subTotalCompletoImporte = 0;\r\n if ($('.articuloDeLista').length > 0) {\r\n $('.articuloDeLista').each(function () {\r\n subTotalCompleto = parseFloat($(this).children('.productSubtotal').text());\r\n subTotalCompletoImporte += subTotalCompleto;\r\n document.getElementById(\"productCostText\").innerHTML = subTotalCompletoImporte;\r\n });\r\n }\r\n }", "function calcular() {\n qtdCadeiras = Number(nCadeiras.value);\n var resp = 0;\n\n if ((qtdCadeiras.value) <= 0) {\n alert(\"A quantidade deve ser maior que 0!\");\n nCadeiras.value = '';\n }\n else {\n // ATRIBUINDO O VALOR DE ACORDO COM O MATERIAL E TIPO DA CADEIRA\n if (materialCadeira == 'aluminio' && tipoCadeira == 'praia'){\n resp = 75 * qtdCadeiras;\n }\n else if (materialCadeira == 'plastico' && tipoCadeira == 'praia') {\n resp = 50 * qtdCadeiras;\n }\n else if (materialCadeira == 'ferro' && tipoCadeira == 'praia') {\n resp = 80 * qtdCadeiras;\n }\n else if (materialCadeira == 'aluminio' && tipoCadeira == 'jardim') {\n resp = 70 * qtdCadeiras;\n }\n else if (materialCadeira == 'plastico' && tipoCadeira == 'jardim') {\n resp = 35 * qtdCadeiras;\n }\n else {\n resp = 55 * qtdCadeiras;\n }\n\n // DESCONTO DE 3%\n if (qtdCadeiras > 50) {\n resp -= (resp * 0.03);\n }\n\n // DESCONTO UNITARIO PGTO. À VISTA\n desconto = 0;\n console.log(resp);\n materialCadeira == 'aluminio' ? desconto = resp * 0.035 : desconto = resp * 0.05;\n respDesconto = resp - desconto;\n materialCadeira == 'aluminio' ? desco = 3.5 : desco = 5;\n \n\n respCalculo.innerHTML = `<p>O orçamento para a compra de <b>${qtdCadeiras}</b> <i>cadeira(s) de ${tipoCadeira}</i> de <i>${materialCadeira}</i> é R$ <b>${resp.toFixed(2)}</b></p>\n <p>Para pagamento a vista o desconto é de <b>${desco}%</b> e seu pedido ficará por R$ <b>${respDesconto.toFixed(2)}</b></p>`; \n }\n}", "function sum(productValue) {\n const a = Number(document.getElementById(\"extra-memory\").innerText);\n const b = Number(document.getElementById(\"extra-storage-cost\").innerText);\n const c = Number(document.getElementById(\"delivery-cost\").innerText);\n const totalCost = (document.getElementById(\"totalCost\").innerText =\n IMacPrice + a + b + c);\n cuponTotal.innerText = totalCost;\n}", "function calcularPerimetroCuadrado (){\n const input = document.getElementById(\"inputCuadrado\");\n const value = input.value;\n\n const resultadoPerimetro = perimetroCuadrado(value); \n alert(\"El resultado del perimetro es: \" + resultadoPerimetro)\n }", "function prixProduitTotal(prix, nombre) {\n let ppt = prix * nombre;\n return ppt;\n}", "function NotaFinal() {\r\n pregunta1();\r\n pregunta2();\r\n var Nf = parseFloat(tpre1) + parseFloat(tpre2);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n}", "function sum() {\r\n\r\n const promoCode = document.getElementById('promo-code');\r\n const promoCodeValue = promoCode.value;\r\n\r\n const sumOfTotal = document.getElementById('total-price');\r\n const sumOfTotalAll = document.getElementById('total-price-all');\r\n\r\n const allTotalPrice = calculateTotalPrice();\r\n\r\n if (promoCodeValue == 'stevekaku') {\r\n\r\n const discountPrice = (80 / 100) * allTotalPrice;\r\n const discounted = discountPrice;\r\n\r\n sumOfTotal.innerText = allTotalPrice;\r\n sumOfTotalAll.innerText = discounted;\r\n\r\n promoCode.value = '';\r\n\r\n } else if (promoCodeValue == '') {\r\n\r\n sumOfTotal.innerText = allTotalPrice;\r\n sumOfTotalAll.innerText = allTotalPrice;\r\n\r\n }\r\n\r\n}", "function multi(){\n var Num1 = document.getElementById(\"numcaja\").value;\n var Num2 = document.getElementById(\"tacoPrecio\").value;\n var r = Num1 * Num2;\n document.getElementById(\"Total\").value = r;\n }", "function perevod(money, currency, crypt)\n{\n //console.log(CURRENCY_DATA[crypt][currency])\n var result = money*0.9/CURRENCY_DATA[crypt][currency]\n $(\"#result\").attr(\"value\", result)\n}", "function sumTotal(){\r\n var sumTotal = 0;\r\n //On fait la somme\r\n $('#yes_facture').find('.input_payer').each(function(){\r\n sumTotal+= parseInt($(this).val());\r\n });\r\n //On modifie l'input somme\r\n $('.input_somme').val(sumTotal);\r\n }", "function calculaPR(){\n let bonusRS = 0;\n if(jogador1.arma.forca == undefined){\n bonusRS = 0;\n }else{\n jogador1.powerRS = parseInt(jogador1.powerRS);\n bonusRS = jogador1.arma.forca + (jogador1.powerRS * (jogador1.arma.pBonus));\n }\n\n let bonusColete = 0;\n if(jogador1.colete.resBonus == undefined){\n bonusColete = 0;\n }else{\n jogador1.colete.resBonus = parseInt(jogador1.colete.resBonus)\n bonusColete = jogador1.colete.resBonus;\n }\n\n let pr = ((jogador1.atributosJ*4)/4)*(70/100) + bonusRS + bonusColete;\n pr = pr + (.5/100);\n pr = pr.toFixed(0);\n return pr \n}", "function NotaFinal() {\r\n var pre2a = document.getElementById(\"pre2a\").value;\r\n if (pre2a == \"\") {\r\n alert(\"Pregunta 2: Califiqué la pregunta\");\r\n } else {\r\n var pre3a = document.getElementById(\"pre3a\").value;\r\n if (pre3a == \"\") {\r\n alert(\"Pregunta 3: Califiqué la pregunta\");\r\n } else {\r\n var pre4a = document.getElementById(\"pre4a\").value;\r\n if (pre4a == \"\") {\r\n alert(\"Pregunta 4: Califiqué la pregunta\");\r\n } else {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n pregunta4();\r\n var Nf = parseFloat(tpre1) + parseFloat(tpre2) + parseFloat(tpre3)+parseFloat(tpre4);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n }\r\n }\r\n }\r\n}", "function calcularPerimetroCuadrado(){\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n\n const perimetro = perimetroCuadrado(value);\n alert(\"El perimetro es: \" + perimetro + \"cm\");\n}", "function calculatePaymentAmount(whom){\n\n\t\ttotkmamount = $('.total'+whom+'kmamount').val();\n\t\ttothramount = $('.total'+whom+'hramount').val();\n\t\tnoofdays=$('.daysno').val();\n\n\t\tif($('.'+whom+'kmpaymentpercentage option:selected').val()==-1){\n\t\t\tkmpaymentpercentage=0;\n\t\t}else{\n\t\t\tkmpaymentpercentage=Number($('.'+whom+'kmpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif($('.'+whom+'hrpaymentpercentage option:selected').val()==-1){\n\t\t\thrpaymentpercentage=0;\n\t\t}else{\n\t\t\thrpaymentpercentage=Number($('.'+whom+'hrpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif(totkmamount!='' && (tothramount!='' || Number(noofdays)>1) && kmpaymentpercentage!='' && hrpaymentpercentage!=''){\n\n\t\t\tkmcommsn=(Number(totkmamount)*(Number(kmpaymentpercentage)/100)).toFixed(2);\n\t\t\thrcommsn=(Number(tothramount)*(Number(hrpaymentpercentage)/100)).toFixed(2);\n\n\t\t}else{\n\t\t\tkmcommsn = 0;\n\t\t\thrcommsn = 0;\n\t\t}\n\n\t\tvar ownership = $('.ownership').val();\n\t\tvar driver_status_id = $('.driver_status').val();\n\t\tvar driverbata = $('.driverbata').val();\n\t\tvar nighthalt = $('.nighthalt').val();\n\n\t\tif(whom == 'driver'){\n\t\t\tif((ownership == OWNED_VEHICLE && driver_status_id == ATTACHED_DRIVER) || (ownership == ATTACHED_VEHICLE && driver_status_id == OWNED_DRIVER)) {\n\t\t\t\tkmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\thrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t}\n\t\t}else{\n\t\t\tif(ownership == ATTACHED_VEHICLE && driver_status_id == ATTACHED_DRIVER){\n\t\t\t\t//kmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\t//hrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\tkmcommsn = Number(kmcommsn);\n\t\t\t\thrcommsn = Number(hrcommsn);\n\t\t\t}\n\t\t}\n\t\n\t\n\n\n\t\t$('.'+whom+'paymentkmamount').val(kmcommsn);\n\t\t$('.'+whom+'paymenthramount').val(hrcommsn);\n\n\t}", "function calcTotGeral() {\n var totDesconto = $(\".tdPercDesc\").text();\n var totAcrescimo = $(\".tdPercAcres\").text();\n\n totDesconto = parseFloat(totDesconto.replace(\".\", \"\").replace(\",\", \".\"));\n totAcrescimo = parseFloat(totAcrescimo.replace(\".\", \"\").replace(\",\", \".\"));\n\n var valSubTotal = $(\".tdSubTotGeral\").text();\n valSubTotal = parseFloat(valSubTotal.replace(\".\", \"\").replace(\",\", \".\"));\n\n valSubTotal = valSubTotal + totDesconto + totAcrescimo;\n\n $(\".tdTotalGeral\").text($.formatNumber(valSubTotal, { format: \"###,###,##0.00\", locale: \"br\" }));\n\n calcFormaPagamentos(\"#ddlParcBoletos\", \".tdValParcelaBoleto\", \".tdGeralBoleto\");\n calcFormaPagamentos(\"#ddlParcCheques\", \".tdValParcelaCheque\", \".tdGeralCheque\");\n calcFormaPagamentos(\"#ddlParcCartao\", \".tdValParcelaCartao\", \".tdGeralCartao\");\n}", "function calcularTotal(){\n //borrar el precio \n total=0;\n //recorrer el array de la cesta y obtener el precio de cada producto\n for(let item of arrayCesta){\n let itemcesta=productos.filter(function(objetoproductos){\n return objetoproductos['tag']==item;\n });\n //se suma el total\n total=total+itemcesta[0]['precio'];\n }\n //mostrar el precio\n $total.textContent=total.toFixed(2);\n}", "function calculation(){\n const bestPrice = getCosting('bestPrice');\n const extraMemoryCost = getCosting('extraMemoryCost');\n const extraStorageCost = getCosting('extraStorageCost');\n const deliveryCharge = getCosting('deliveryCharge');\n const totalSubPrice = bestPrice + extraMemoryCost + extraStorageCost + deliveryCharge; \n document.getElementById(\"totalPrice\").innerText = totalSubPrice;\n \n}", "function CalcularTotal() {\n // Selecionar todas as linhas\n var produtos = document.querySelectorAll(\".Produ\");\n let total = 0;\n // Percorrer a lista de produtos\n for (var i = 0; i < produtos.length; i++) {\n\n // Recupera o produto no indice i da lista de produtos\n var produto = produtos[i];\n\n // pegando id\n var id = produto.querySelector(\".id\").textContent;\n\n // pegando quantidade\n var qtd = produto.querySelector(\".qtd\").textContent;\n\n total = total + parseFloat(produto.querySelector(\".valor\").textContent);\n }\n return total;\n }", "function NotaFinal() {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n var Nf = parseFloat(tpre1) + parseFloat(tpre2) + parseFloat(tpre3);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n}", "function NotaFinal() {\r\n pregunta1();\r\n pregunta2();\r\n pregunta3();\r\n var Nf = parseFloat(tpre1) + parseFloat(tpre2) + parseFloat(tpre3);\r\n var Vtotal = Nf.toFixed(2);\r\n $(\"#txtNota\").html(Vtotal);\r\n document.getElementById(\"bt_comprobar\").disabled = true;\r\n}", "function calcular2() {\r\n\r\n //PESO\r\n if(document.getElementById(\"select-conversionpeso\").value == 4)\r\n {\r\n document.getElementById(\"resultado-conversionpeso\").value= document.getElementById(\"input-pesoconversion\").value / 1000 +\" Kilogramos\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversionpeso\").value == 5)\r\n {\r\n document.getElementById(\"resultado-conversionpeso\").value= document.getElementById(\"input-pesoconversion\").value * 1000 +\" Kilogramos\";\r\n }\r\n\r\n //DISTANCIA\r\n if(document.getElementById(\"select-conversiondistancia\").value == 6)\r\n {\r\n document.getElementById(\"resultado-conversiondistancia\").value= document.getElementById(\"input-distanciaconversion\").value / 100 +\" Metros\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversiondistancia\").value == 7)\r\n {\r\n document.getElementById(\"resultado-conversiondistancia\").value= document.getElementById(\"input-distanciaconversion\").value * 1000 +\" Metros\";\r\n }\r\n\r\n //TIEMPO\r\n if(document.getElementById(\"select-conversiontiempo\").value == 8)\r\n {\r\n document.getElementById(\"resultado-conversiontiempo\").value= document.getElementById(\"input-tiempoconversion\").value * 60 +\" Segundos\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversiontiempo\").value == 9)\r\n {\r\n document.getElementById(\"resultado-conversiontiempo\").value= document.getElementById(\"input-tiempoconversion\").value * 3600 +\" Segundos\";\r\n }\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 getPrecioSoporte(an, al) {\n\t\n\tvar idSoporte = $('#productoId').val();\n\tvar idTejido = $('#tejidoId').val();\n\t\n\tif (localStorage['idSoporte'] != 6) {\n\t\tvar ancho = $('input[name=\"ancho\"]').val();\n\t\tvar alto = $('input[name=\"alto\"]').val();\n\t} else {\n\t\tvar ancho = $('input[name=\"ancho\"]').val()/localStorage[\"vias\"];\n\t\tvar alto = $('input[name=\"alto\"]').val();\n\t} \n\t\n\tif (an && al) {\t\t\n\t\tvar ancho = an;\n\t\tvar alto = al;\n\t}\n\n\t$.ajax({\n\t url: url+\"calcularPrecioTejido.json\",\n\t type: \"POST\",\n \t data: {idsoporte : idSoporte, idtejido : idTejido, ancho : ancho, alto: alto, securitySession: sessionSecurity },\n\t success: function(data) {\n\t \t\n\t \tvar result = jQuery.parseJSON(data);\n\t \t\n\t \tif (localStorage[\"vias\"] > 0) {\n\t \t\t\n\t \t\tif ($('.viasPD .pvp span').text() == \"\") {\n\t \t\t\t\n\t\t \t\tfor (var i = 0; i < localStorage['vias']; i++) {\n\t\t \t\t\tvar viaSoporte = viasCarrito.at(i);\t\t\n\t\t\t\t\tviaSoporte.set({precio: result.precio});\n\t\t\t \t}\t\t\t \t\n\t\t\t \tsoporteProducto.set({precio: result.precio*localStorage[\"vias\"]});\n\t\t \t\n\t\t \t\n\t\t \t} else {\n\t\t \t\t\n\t\t \t\tvar pvp = 0;\n\t\t \t\t$('.livia').each(function(index, elem) {\t\t \t\t\t\n\t\t \t\t\tpvp += parseFloat($('.pvp span', elem).text());\t\t \t\t\t\n\t\t \t\t});\t \t\t\n\t\t \t\t\n\t\t \t\tsoporteProducto.set({precio: pvp.toFixed(2)});\n\t\t \t}\n\t \t} else {\n\t \t\tsoporteProducto.set({precio: result.precio});\n\t \t}\n\t \t\n\t \t\n\t \t\n\t },\n\t complete: function() {\n\t \t calcularTotal();\n\t }\n\t});\n\t\n}" ]
[ "0.69717216", "0.686301", "0.66871744", "0.6685071", "0.6645067", "0.6515604", "0.6502173", "0.64452", "0.6407038", "0.63952535", "0.6373846", "0.6366004", "0.6364821", "0.6350403", "0.6340947", "0.6327886", "0.63234204", "0.6283239", "0.6264719", "0.6258163", "0.62203205", "0.62194306", "0.6207724", "0.6206649", "0.6206581", "0.6182986", "0.61798096", "0.61765754", "0.61726254", "0.61703223", "0.615942", "0.6155045", "0.6153815", "0.6140413", "0.6137919", "0.6137293", "0.61357653", "0.6134446", "0.6092939", "0.60795945", "0.6074834", "0.6069641", "0.6066109", "0.60627866", "0.605907", "0.605668", "0.6056423", "0.6049761", "0.6046306", "0.6040851", "0.60401666", "0.60401225", "0.6036082", "0.60320354", "0.60295826", "0.6019322", "0.6016124", "0.6014245", "0.6003444", "0.60031205", "0.6001329", "0.59891784", "0.59855306", "0.59663296", "0.5957135", "0.59551394", "0.59487534", "0.5944039", "0.5943676", "0.5943259", "0.59415495", "0.5940422", "0.5935564", "0.5926677", "0.59224904", "0.5920677", "0.59199566", "0.5916615", "0.5914191", "0.590004", "0.5897895", "0.5895049", "0.58941656", "0.58941245", "0.589237", "0.5892314", "0.5891427", "0.5888753", "0.5881778", "0.58806485", "0.5870442", "0.58685243", "0.58608556", "0.58593833", "0.5856941", "0.58535844", "0.58535844", "0.58493567", "0.5848136", "0.5845345" ]
0.72264314
0
setMinPermintaan set the minPermintaan variable with value from text input
function setMinPermintaan () { minPermintaan = document.getElementById('newMinPermintaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMinPersediaan(params) {\n minPersediaan = document.getElementById('newMinPersediaan').value;\n }", "set min(value) {\n Helper.UpdateInputAttribute(this, 'min', value);\n }", "function setM(value) {\n document.getElementById(\"valueM\").innerHTML = value;\n mines = parseInt(value);\n}", "set _min(value) {\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function setMaxPermintaan() {\n maxPermintaan = document.getElementById('newMaxPermintaan').value;\n }", "function updateMinN(min) {\n reset();\n if (min < 1 || min > 100 || Math.round(min) != min) {\n alert(\"Minimum value of n must be an integer between 1 and 100\");\n document.getElementById(\"minInput\").value = minN;\n } else {\n minN = min;\n }\n}", "function setMaxPersediaan() {\n maxPermintaan = document.getElementById('newMaxPersediaan').value;\n }", "set min(value) {\n this.changeAttribute('min', value);\n }", "function minPrice(element, value) {\n element.min = value;\n element.placeholder = value;\n }", "setMin(min) {\n self.datePicker.min = new Date(min);\n }", "function getMinimum () {\n if ((document.getElementById('entMin').value)===\"\") {\n return 1;\n }\n else {\n return Number(document.getElementById('entMin').value)}\n}", "function getInputMin(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"mins>data\");\r\n\tif (result == null || result.text()==null) {return -100;}\r\n\telse return parseFloat(extract(result.text()));\r\n}", "function adicionaMinutos() {\n\n\n if(minutos === 5){\n setMinutos(10);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 15){\n setMinutos(20);\n setSegundos(0);\n }\n\n if(minutos === 20){\n setMinutos(25);\n setSegundos(0);\n }\n\n if(minutos === 25){\n setMinutos(30);\n setSegundos(0);\n }\n\n if(minutos === 30){\n setMinutos(35);\n setSegundos(0);\n }\n\n if(minutos === 35){\n setMinutos(40);\n setSegundos(0);\n }\n\n if(minutos === 40){\n setMinutos(5);\n setSegundos(0);\n }\n}", "function setMinCustomDie(){\r\n minCustomDie = inMinCustomDie.value;\r\n}", "setValueDiffMin (valueDiffMin) {\n this._valueDiffMin = valueDiffMin\n }", "function validaMinimo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock minimo invalido\");\n document.getElementById(\"minimo\").value=\"0\"; \n document.getElementById(\"minimo\").focus();\n }\n }", "_add_MinPSM_InputField__OnChange_Processing({ $project_page__ann_cutoff_defaults_project_level_psms_min }) {\n\n const project_page__ann_cutoff_defaults_project_level_psms_min_DOM = $project_page__ann_cutoff_defaults_project_level_psms_min[ 0 ];\n\n project_page__ann_cutoff_defaults_project_level_psms_min_DOM.addEventListener('input', ( eventObject ) => {\n try {\n eventObject.preventDefault();\n // console.log(\"'input' fired\");\n const eventTarget = eventObject.target;\n // const inputBoxValue = eventTarget.value;\n // console.log(\"'input' fired. inputBoxValue: \" + inputBoxValue );\n const $eventTarget = $( eventTarget );\n const $selector_invalid_entry = $(\"#project_page__ann_cutoff_defaults_project_level_psms_min_invalid_entry\");\n var fieldValue = $eventTarget.val();\n if ( ! this._isFieldValueValidMinimumPSMValue({ fieldValue }) ) {\n $selector_invalid_entry.show();\n\n if ( this._minPSMs_Entry_Valid ) {\n this._minPSMs_Entry_Valid = false;\n\n // Value changed so update dependent items\n this._update_enable_disable_SaveButton();\n }\n } else {\n $selector_invalid_entry.hide();\n\n if ( ! this._minPSMs_Entry_Valid ) {\n this._minPSMs_Entry_Valid = true;\n\n // Value changed so update dependent items\n this._update_enable_disable_SaveButton();\n }\n }\n return false;\n } catch( e ) {\n reportWebErrorToServer.reportErrorObjectToServer( { errorException : e } );\n throw e;\n }\n });\n }", "function resetMinMax() {\n minPermintaan = 1000;\n maxPermintaan = 5000;\n minPersediaan = 100;\n maxPersediaan = 600;\n }", "set min(value) {\n Helper.UpdateInputAttribute(this, 'minlength', value);\n }", "function habilitarSegundaFecha() {\n eval(\"debugger;\");\n var fchDesde = document.getElementById('inputInicioCursado').value;\n var fchHoy = document.getElementById('todayDate').value;\n \n if(fchDesde < fchHoy){\n document.getElementById('inputFinCursado').value = fchHoy;\n document.getElementById('inputFinCursado').min = fchHoy; \n }else{\n document.getElementById('inputFinCursado').value = fchDesde;\n document.getElementById('inputFinCursado').min = fchDesde; \n }\n \n \n document.getElementById('inputFinCursado').disabled = false;\n document.getElementById('inputFinCursado').readonly = false;\n\n}", "function showMinTemp(i, id){\n min = `\n ${currentData[i].app_min_temp} ° de mínima\n `\n document.getElementById(id).innerHTML = min;\n}", "function min() {\n memory = document.getElementById(\"display\").value;\n document.getElementById(\"display\").value = \"\";\n teken = \"-\";\n}", "function minValidator(min) {\n return control => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n\n const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n\n return !isNaN(value) && value < min ? {\n 'min': {\n 'min': min,\n 'actual': control.value\n }\n } : null;\n };\n}", "function findTheMinimumValueOfChemin(chemin) {\n var minimum = chemin[1].value;\n for(var i=1; i < chemin.length; i++) {\n if(chemin[i].value == \"E\" && chemin[i].marque == '-') {\n minimum = chemin[i].value;\n }\n if(chemin[i].value != \"E\" && chemin[i].value < minimum && chemin[i].marque == '-') minimum = chemin[i].value;\n }\n return minimum;\n }", "set minIndex(_val) {\n (typeof _val === \"number\") && this.setAttribute(\"min\", _val);\n }", "get min() {\n return this.args.min || 0;\n }", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function evaluateMin(min) {\r\n if (min == 1) {\r\n minutes = ' minute';\r\n } else {\r\n minutes = ' minutes';\r\n }\r\n return minutes;\r\n}", "function f_Qtd_String_Minima(obj, Qtd, Campo)\n{\n if(obj.value != \"\")\n {\n var TamanhoNome = obj.value;\n var Tamanho = TamanhoNome.length;\n\n if(Tamanho <= Qtd)\n {\n bootbox.alert({\n message: \"Este campo \" + Campo + \", precisa ter no mínimo \"+Qtd+\" caracteres!\",\n callback: function ()\n {\n obj.focus();\n }\n });\n Valor = false;\n }\n else\n {\n Valor = true;\n } \n }\n else\n {\n Valor = true;\n }\n}", "function setL(value) {\n document.getElementById(\"valueL\").innerHTML = value;\n lines = parseInt(value);\n adjustMines();\n}", "get min() {\r\n return this._min\r\n }", "get minimumValue() {\r\n return this.i.minimumValue;\r\n }", "minimum(min) {\n this.min = min;\n return this;\n }", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "function codificaTexto(){\n const texto = document.getElementById(\"InputTextoPlano\");\n const textoPlano = texto.value;\n const input = document.getElementById(\"InputN\");\n const value = Number(input.value);\n if(value <= 0 || value >= limit){\n alert(\"Debes ingresar n mayor que cero y menor que \"+limit)\n }else{\n //console.log(value)\n const res = codifica(String(textoPlano),value)\n resultado.value = res;\n }\n}", "get minValue() {\n return this.options.minValue || null;\n }", "get min() {\n return this._min;\n }", "function minimum() {\r\nvar mini = Math.min.apply(null, numbers);\r\nconsole.log(\"minimum cherez matem funchii-\",mini);\r\n}", "min(min) {\n this.checkSearchType();\n if (!this.options.block) {\n this.options.block = {};\n }\n this.options.block.min = min;\n return this;\n }", "get minNumber() {\n return 0\n }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "function setMinDate() {\n let aus = new Date();\n aus.setDate = aus.getDate();\n aus.setFullYear(aus.getFullYear() - 8); //imposto come data di nascita massima 8 anni fa\n let data = aus.toISOString().split('T')[0];\n $(\"#dataNascitaModProfilo\").attr(\"max\", data);\n}", "function generateMin() {\n if (getInputData() > 0 && getInputData() < 5) {\n removeBoardPaint();\n generateHeightDivs(5);\n generateWidthDivs(5);\n addWhiteToBoard();\n window.alert('mínimo: 5 | máximo: 50')\n }\n}", "function setMin (response) {\n curMin1 = 9999;\n for(var i = 0; i < 8; i++) {\n var tempMin1 = response.list[i].main.temp_min;\n //console.log(tempMin1);\n\n if (tempMin1 < curMin1) {\n curMin1 = Math.round(response.list[i].main.temp_min);\n }\n else if (curMin1 > curTemp) {\n curMin1 = Math.round(curTemp);\n }\n }\n}", "set _minTermLength(value) {\n this.__minTermLength = value;\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "function inputMinSliderLeft(){//slider update inputs\n inputMin.value=sliderLeft.value;\n}", "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n mines = parseInt(maxMines);\n }\n}", "minamp(val) {\n this._minamp = val;\n return this;\n }", "function centangStatus2(x,p){\n\t\tvar poinx; \n\t\tif(x=='anggota'){ // anggota \n\t\t\t$('#jumlahTB').val(1);\n\t\t\tvar n = $('#jumlahTB').val();\n\t\t\t$('#jumlahTB').attr('style','display:visible').attr('required','required');\n\t\t\tpoinx = (40/100 * parseFloat(p))/n;\n\t\t}else{ // ketua\n\t\t\t$('#jumlahTB').attr('style','display:none').removeAttr('required').val('');\n\t\t\tpoinx = 60/100 * parseFloat(p);\n\t\t}\n\t\t$('#poinTB').val(poinx.toFixed(2));\n\t}", "function sumaDuracion(){\n \n var sumHrs = parseInt(0), sumMin = parseInt(0);\n var auxHrs = parseInt(0), auxMin = parseInt(0);\n var totalHrs = parseInt(0), totalMin, i=1, ni=0;\n \n $('[name=\"minAP\"]').each(function(){\n \n var m = $(this).val();\n if (m !== \"\" && m!==\"99\"){ \n sumMin += parseInt(m);\n auxMin = sumMin % 60;\n auxHrs = Math.trunc(sumMin/60);\n \n var h = $('#hrsAP'+i).val();\n sumHrs += parseInt(h);\n }else if(m === \"99\"){\n ni++;\n }\n totalHrs = sumHrs + auxHrs;\n i++;\n });\n \n if(auxMin<10){//si es menor que 10 le concatena un cero para que se muestre en el select\n totalMin = '0' + auxMin;\n }else{\n totalMin = auxMin;\n }\n \n if(ni !== 5){//muestra el valor total de las horas y minutos\n $('#hrs').val(totalHrs);\n $('#min').val(totalMin);\n $('#chkDNI').prop('checked',false);\n }else{//si todos los campos son NI pone el valor NI\n $('#hrs').val(\"99\");\n $('#min').val(\"99\");\n $('#chkDNI').prop('checked',true);\n }\n}", "function setRange(min, max) {\n if(min > max) {\n alert(\"Please enter the lowest number in the left field\");\n } else {\n minNum = min;\n maxNum = max;\n }\n}", "get min() {\n\t\treturn this.__min;\n\t}", "min() {\n const { value, operation } = this.state;\n if (operation === 0) {\n this.setState({\n num1: Number(value),\n operation: 2,\n });\n this.clear();\n }\n }", "function minFunc() {\n let minNum = Math.min(num1, num2, num3);\n console.log(\"MIN: \" + minNum);\n results[1].textContent = \"Min: \" + minNum;\n}", "function setarTempo(pausa){\n\tvar segundos = parseInt(document.getElementById('segundos').innerHTML);\n\tvar minutos = parseInt(document.getElementById('minutos').innerHTML);\n\tvar soma = 0;\n\tvar tempo = \"\";\n\n\t//Se o jogo foi pausado ou verificado, adiciona 29 segundos ao tempo\n\t//(29 porque 1 segundo já está sendo incrementado pela função)\n\tif (pausa)\n\t\tsoma = 29;\n\n\tif (segundos < 59){ \n \tsegundos = segundos + 1 + soma;\n \tif ((segundos - 60) > 0){\n \t\tsegundos = segundos - 60;\n \t\tminutos = minutos + 1;\n \t}\n }\n else{\n \tsegundos = soma;\n \tminutos = minutos + 1;\n }\n document.getElementById('minutos').innerHTML = minutos;\n tempo = minutos;\n\n if (segundos < 10){\n \tdocument.getElementById('segundos').innerHTML = \"0\" + segundos;\n \ttempo = tempo + \":0\" + segundos;\n }\n else{\n \tdocument.getElementById('segundos').innerHTML = segundos;\n \ttempo = tempo + \":\" + segundos;\n }\n\n $(\"#hTempo\").val(tempo);\n}", "get min() {\n\t\treturn this.nativeElement ? this.nativeElement.min : undefined;\n\t}", "get min() {\n\t\treturn this.nativeElement ? this.nativeElement.min : undefined;\n\t}", "function verificarNumero(value, min, id){\n let res = \"\";\n let val = value.split(\"\");\n for(let i = 0; i < val.length; i++){\n res += (NUMBERS.includes(val[i])) ? val[i] : \"\";\n }\n if(Number.parseInt(res) > 20) {\n res = (Number.parseInt(res) > 20) ? res.slice(0,-1) : res;\n }\n document.getElementById(id).value = res;\n return (Number.isInteger(Number.parseInt(value[value.length - 1])) && !(Number.parseInt(value) < min));\n}", "function textBoxToSlider(textBox, isMin){\n $(textBox).on(\"change keyup paste\", function(){\n passCorrectedValuesToSliderAndGetThem(this, isMin)\n })\n }", "function OptionMin(option){\n option = YearArray(option, selectedyear1, selectedyear2);\n var min = d3.min(option,function(d) {\n return parseFloat(d);\n });\n return min;\n}", "function fieldMin(doc, field, value) {\n // Requires(doc !== undefined)\n // Requires(field !== undefined)\n // Requires(value !== undefined)\n\n fieldSet(doc, field, value, function (oldValue) {\n if (oldValue === undefined)\n return value;\n return compare(value, oldValue) < 0 ? value : oldValue;\n });\n }", "function min_t_sec(){\n const min = parseInt(document.getElementById(\"min\").value);\n const sec = min*60;\n document.getElementById(\"ans\").value = sec; \n}", "getMin() {\n return this.min;\n }", "function nota_menor(){\n\t\tvar menor = notas.indexOf(Math.min.apply(null, notas ));\n\t\tdocument.getElementById(\"menor\").innerHTML = \"La nota menor del estudiante: <b>\" + nombre_alumno(menor) + \"</b>\";\n\t}", "minVoltageForPlonkPreset(preset) {\n return (preset / (this.plonkPresetsCount - 1)) * plonkVoltageMax;\n }", "function angkaValid2(input,info,poin){\n\t\tvar n = $('#'+input).val();\n\n\t\tif($('#'+input).val()!=$('#'+input).val().replace(/[^0-9.]/g,'')){\n\t\t\t$('#'+input).val($('#'+input).val().replace(/[^0-9.]/g,''));\n\n\t\t\t$('#'+info).html('<span class=\"label label-important\"> hanya angka</span>').fadeIn();\n\t\t\tsetTimeout(function(){\n\t\t\t\t$('#'+info).fadeOut();\n\t\t\t},1000);\n\t\t}else{\n\t\t\tif(n<1 || n>5){\n\t\t\t\t$('#'+input).val('');\n\t\t\t\t$('#'+info).html('<span class=\"label label-important\"> antara 1 - 5</span>').fadeIn();\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t$('#'+info).fadeOut();\n\t\t\t\t},1000);\n\t\t\t}else{\n\t\t\t\t//rumus pembagian poin ketua = (60% * poin) , anggota = (40% * poin) / n\n\t\t\t\tvar poinx = (40/100 * parseFloat(poin) )/parseInt(n);\n\t\t\t\t$('#poinTB').val(poinx.toFixed(2));\n\t\t\t}\n\t\t}\n\t}", "function modelMin(newValue) {\n if(scope.getterSetter) {\n return arguments.length ? scope.modelMin(newValue) : scope.modelMin();\n } else {\n return arguments.length ? (scope.modelMin = newValue) : scope.modelMin;\n }\n }", "function setClosestMin(){\n var date = new Date();\n var m =date.getMinutes();\n var h = date.getHours();\n var defH = $('#hours').children('option:selected').val();\n var firstH = $('#hours').children('[active=\"\"]').val();\n if(defH==firstH || defH==h){ // pokud je aktivní hodnota hodiny shodná s reálným časem -> disable minut\n $('#minutes').children().each(function(){\n var realStep =($(this).val())-(minuteStep);\n if(realStep < m){\n $(this).attr('disabled','disabled');\n }\n });\n //store set values\n var currStep = ($('#currentState').attr('minute'))-(minuteStep);\n if(($('#currentState').attr('minute').length)>0 && (currStep>m)){\n $('#minutes option[value=\"'+$('#currentState').attr('minute')+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }else{ // selected 1h+ from curr time\n $('#minutes').children().each(function(){\n $(this).removeAttr('disabled','disabled');\n });\n var currStep = ($('#currentState').attr('minute'));\n if((currStep.length)>0){\n $('#minutes option[value=\"'+currStep+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }\n\n var countDisabled = $('#minutes').children('option:disabled').length;\n if(countDisabled > 5){ // plus 1 hour\n $('#currentState').attr('deprecated',h);\n $('#hours').children('option:enabled').eq(0).prop('disabled',true);\n $('#hours').children('option:enabled').eq(0).prop('selected',true);\n setClosestMin();\n }\n\n\n if((defH-h)==1){ // conversion minutes in next hour (16.51 -> 17:20)\n $('#minutes').children().each(function(){\n var remainsMin = 60-m;\n var realStep =($(this).val())-(minuteStep-remainsMin);\n if(realStep <= 0){\n $(this).attr('disabled','disabled');\n }\n });\n // store set values\n var currStep = ($('#currentState').attr('minute'));\n var firstEnabled = $('#minutes').children('option:enabled').eq(0).val();\n if(($('#currentState').attr('minute').length)>0 && currStep>firstEnabled){\n $('#minutes option[value=\"'+$('#currentState').attr('minute')+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }\n}", "function CheckMinPTValue(arrDDL,arrPDDL,arrMin,errHolder)\r\n{\t\t\r\n\tfor(var i=0;i<arrDDL.length;i++)\r\n\t{\t\t\r\n\t\tvar totalPT= isNumeric(arrDDL[i]) + isNumeric(arrPDDL[i]);\r\n\t\tvar minVal=isNumeric(arrMin[i]);\r\n\t\tif(totalPT<minVal)\r\n\t\t{\r\n\t\t\tvar msg=errMsgMinPT + minVal;\r\n\t\t\tShowError(msg,errHolder);\r\n\t\t\t$(arrDDL[i]).focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function up() {\n if(quantite.value < 10){\n \n quantite.value= parseInt(quantite.value)+1;\n}else {\n alert(\"Vous pouvez commander jusqu'a 10 appareils maximum\")\n}\n}", "function sliderLeftInput(){//input udate slider left\n sliderLeft.value=inputMin.value;\n}", "function plusmin() {\n let inputNumber = document.getElementById(\"display\").value;\n inputNumber = inputNumber - (inputNumber * 2);\n document.getElementById(\"display\").value = inputNumber;\n}", "minlength(input, minValue) {\n let inputLenght = input.value.length;\n let errorMessage = `O campo precisa ter pelo menos ${minValue} caracteres`\n if(inputLenght < minValue){\n this.printMessage(input, errorMessage)\n }\n\n }", "get minimumValue() {\r\n return this.i.bl;\r\n }", "function setMinBarValueText (performanceBar) {\n var $performanceBar = $('#' + performanceBar._element.id);\n $performanceBar.attr('data-minValue', performanceBar._minValue);\n }", "function GetIntegrer()\r\n{\r\nintegrer = parseInt(window.prompt( \"Entrez le nombre d'élément : \"));\r\n}", "getMin() {\n return this.min;\n }", "inputStartDate()\n {\n this.dateStartNew=pf.dateToSerbianFormat(this.dateStartModel);\n this.prosiriFormu();\n }", "get minIndex() {\n return Number(this.getAttribute(\"min\"));\n }", "get minimumValue() {\n return this.i.bl;\n }", "function showOrHiddenMin(operator,low){\n\tvar pct_operator = abRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.getFieldElement(operator);\n\tif(pct_operator.value!=\"Range\"){\n\t\tabRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.showField(low, false);\n\t}else{\n\t\tabRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.showField(low, true);\n\t}\n}", "function resetQuestionValueToMin(questionValue) {\n if (questionValue < 0) {\n questionValue = 0;\n }\n return questionValue;\n}", "function cambiarLimiteDeExtraccion() {\n let limiteExtraccionIngresado = parseInt(prompt(\"Ingrese nuevo limite de extraccion.\"));\n if (limiteExtraccionIngresado != null && limiteExtraccionIngresado != \"\") {\n limiteExtraccion = limiteExtraccionIngresado;\n actualizarLimiteEnPantalla()\n alert(\"Nuevo limite de extraccion: $\" + limiteExtraccion);\n }\n}", "minlength(input, minValue) {\n\n let inputLength = input.value.length;\n let errorMessage = `*O campo precisa ter pelo menos ${minValue} caracteres`;\n\n if (inputLength < minValue) {\n this.printMessage(input, errorMessage);\n\n }\n }", "get min() {\n return this.getMin();\n }", "function validaMaximo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock Maximo invalido\");\n document.getElementById(\"maximo\").value= \"0\"; \n document.getElementById(\"maximo\").focus();\n }\n }", "function passCorrectedValuesToSliderAndGetThem(textBox, isMin){\n newVal = $(textBox).val()\n theSlider = $(textBox).parent().parent().parent().find(\"div > .theSlider\")\n if(newVal){ //make sure the new value exists\n //create the range variables for each of the sliders\n low = (isMin) ? $(theSlider).slider(\"option\", \"min\") : $(theSlider).slider(\"values\", 0)\n high = (isMin) ? $(theSlider).slider(\"values\", 1) : high = $(theSlider).slider(\"option\", \"max\")\n \n //if we are not within range make ourselves within range\n if(newVal < low || high < newVal){\n if(newVal < low) newVal = low\n else newVal = high\n }\n } //set the slider value to its default\n else newVal = $(theSlider).slider(\"option\", (isMin) ? \"min\" : \"max\")\n\n //set the new value of the slider\n $(theSlider).slider(\"values\", (isMin) ? 0 : 1, newVal)\n\n //set the value for the textbox\n return newVal\n }", "function buatFormPemintaanPembelian() {\n $('#jumlahBarangRequestBeli').val(1);\n $('#keteranganRequestBeli').val(\"\");\n $('#namaBarangRequestBeli').val(\"\");\n $(\"#tgOrderRequestBeli\").html(changeDateFormat(getDateNow()));\n ajaxGetDropDownKategori();\n\n //keperluan untuk error handling pengisian form permintaan pembelian\n $(\":input\").bind('keyup mouseup blur focusout', function () {\n if($('#jumlahBarangRequestBeli').val() < 1){\n window.alert(\"Minimal jumlah barang 1\");\n $('#jumlahBarangRequestBeli').val(1);\n }\n });\n}", "function preenche(valor)\r\n\t{\r\n\t\tvar campo = document.getElementById(\"campo\");\r\n\t\t\r\n\t\t//pega o valor atual do elemento\r\n\t\tvar value = campo.value;\r\n\t\tvar caracteres = value.length;\r\n\t\t \r\n\t\t /*----- Limitar o numero de caracteres no campo ------*/\r\n\t\tif (caracteres < 8) \r\n\t\t\t{\r\n\t\t\t\t//pega o valor atual e soma com a valor que esta a ser acrescentado\r\n\t\t\t\tcampo.value = value+valor;\r\n\t\t\t};\r\n\r\n\t}", "function kiemtratuoi(mintuoi,maxtuoi) {\n\tvar ag = document.getElementById(\"age\");\n\tvar tb = document.getElementById(\"thongbao\");\n\tvar numbers = /^[0-9]+$/;\n\tif(ag.value.match(numbers)) {\n\t\tvar intTuoi = parseInt(ag.value);\n\t\tif(intTuoi < mintuoi || intTuoi > maxtuoi) {\n\t\ttb.style.display = \"block\";\n\t\ttb.innerHTML = \"Nhập tuổi từ 18 đến 50\";\n\t\treturn false;\n\t\t} else {\n\t\ttb.style.display = \"none\";\n\t\treturn true;\n\t\t}\n\t} else {\n\t\ttb.style.display = \"block\";\n\t\ttb.innerHTML = \"Hãy nhập tất cả la số\";\n\t\treturn false;\n\t}\n}", "min() {}", "function min(a, b) {\n console.log(\"Ini entre\", a, \"et\", b);\n return NaN;\n}" ]
[ "0.7858439", "0.6905027", "0.68398803", "0.67898595", "0.67226154", "0.6696683", "0.6590643", "0.65395427", "0.649166", "0.6344122", "0.6255673", "0.62309146", "0.6205384", "0.61770135", "0.61602587", "0.61048377", "0.6040299", "0.6015067", "0.6009302", "0.5949658", "0.5917329", "0.58664423", "0.584501", "0.58199227", "0.5807066", "0.5790217", "0.5778063", "0.5778063", "0.5778063", "0.5737158", "0.57043636", "0.56664246", "0.5653531", "0.56470376", "0.56442934", "0.5603116", "0.5599399", "0.55957496", "0.5590952", "0.55829525", "0.55750954", "0.55688685", "0.5557283", "0.5557283", "0.5557283", "0.5557283", "0.5557283", "0.5557283", "0.5543939", "0.55259854", "0.55230606", "0.55179834", "0.5512241", "0.5508164", "0.550109", "0.5484523", "0.54773545", "0.54755086", "0.54407144", "0.5435317", "0.5429008", "0.54280084", "0.5409287", "0.540844", "0.540844", "0.5405412", "0.5395833", "0.5390849", "0.537999", "0.53736067", "0.53728837", "0.53573513", "0.5356022", "0.53435373", "0.53386587", "0.53342295", "0.53177845", "0.53177553", "0.53025174", "0.52792716", "0.52783614", "0.5278358", "0.527727", "0.52768177", "0.52746034", "0.52725667", "0.5264113", "0.5259725", "0.5257734", "0.5257268", "0.5249454", "0.52485585", "0.523782", "0.5227329", "0.5225259", "0.5222087", "0.52103716", "0.5210012", "0.5203104", "0.5188565" ]
0.8304282
0
setMaxPermintaan set the maxPermintaan variable with value from text input
function setMaxPermintaan() { maxPermintaan = document.getElementById('newMaxPermintaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMaxPersediaan() {\n maxPermintaan = document.getElementById('newMaxPersediaan').value;\n }", "function maxDecimales (){\n inputDecimales.value;\n}", "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "function setMaxVeganAndVegetarian() {\n if (Number(inputVegan.value) > Number(inputVegan.max)) {\n inputVegan.value = inputVegan.max;\n } else {\n }\n if (Number(inputVegetarian.value) > Number(inputVegetarian.max)) {\n inputVegetarian.value = inputVegetarian.max;\n } else {\n }\n inputVegan.max = 0;\n inputVegetarian.max = 0;\n inputVegan.max = inputPerson.max - inputVegetarian.value;\n inputVegetarian.max = inputPerson.max - inputVegan.value;\n}", "set max(value) {\n Helper.UpdateInputAttribute(this, 'max', value);\n }", "set _max(value) {\n Helper.UpdateInputAttribute(this, \"max\", value);\n }", "function getMaximum () {\n if ((document.getElementById('entMax').value)===\"\") {\n return 100;\n }\n else {\n return Number(document.getElementById('entMax').value) }\n }", "function setMax() {\n var cd = curDay();\n var input = document.getElementById('date');\n input.setAttribute(\"max\", this.value);\n input.max = cd;\n input.setAttribute(\"value\", this.value);\n input.value = cd;\n}", "maxlength(input, maxValue) {\n\n let inputLength = input.value.length;\n\n let mensagem_error = `O campo precisa ter menos que ${maxValue} caracteres`;\n\n if (inputLength > maxValue) {\n this.imprimirMensagem(input, mensagem_error);\n }\n }", "set max(value) {\n Helper.UpdateInputAttribute(this, 'maxlength', value);\n }", "function setMaxDisplay(){\n //document.value returns a string, we need to convert it to a number in order to compare later on if we reached max wining number\n max.textContent = setMax.value;\n winningScore = Number(setMax.value);\n reset();\n}", "function max(txarea,tot){ \n if (tot==\"\"){ var total = 255; } else { var total=tot; }\n var tam = txarea.value.length; \n var str=\"\"; \n var str=str+tam; \n //Digitado.innerHTML = str; \n Restante.innerHTML = total - str; \n if (tam > total){ \n aux = txarea.value; \n txarea.value = aux.substring(0,total); \n //Digitado.innerHTML = total \n Restante.innerHTML = 0 \n } \n}", "function setMaxScore( maxScoreValue ) {\n maxScoreInput.value = maxScoreValue;\n maxScoreDisplay.textContent = maxScoreValue.toString();\n}", "function setMinPermintaan () {\n minPermintaan = document.getElementById('newMinPermintaan').value;\n }", "function codificaTexto(){\n const texto = document.getElementById(\"InputTextoPlano\");\n const textoPlano = texto.value;\n const input = document.getElementById(\"InputN\");\n const value = Number(input.value);\n if(value <= 0 || value >= limit){\n alert(\"Debes ingresar n mayor que cero y menor que \"+limit)\n }else{\n //console.log(value)\n const res = codifica(String(textoPlano),value)\n resultado.value = res;\n }\n}", "function validaMaximo(elemento, numMax) {\n var numTxt = elemento.val().length; // Número de caracteres actuales en el input\n var numero_maximo = numMax - 1;\n\n if (numTxt > numero_maximo) {\n return false;\n } else {\n return true;\n }\n}", "function salidaUno(ins){\n var tabla = $(ins).parent().parent();\n $(\"#idExiSal\").val(tabla.find(\"td\").eq(0).text()) ;\n $(\"#nomInsSal\").val(tabla.find(\"td\").eq(3).text());\n $(\"#coloInsSal\").val(tabla.find(\"td\").eq(4).text());\n $(\"#medInsSal\").val(tabla.find(\"td\").eq(5).text());\n $(\"#cantAct\").val(tabla.find(\"td\").eq(6).text());\n\n\n $(\"#cantSal\").attr(\"max\", tabla.find(\"td\").eq(6).text());\n $(\"#cantSal\").val(tabla.find(\"td\").eq(6).text());\n}", "function getMaxFromUser(){\n return $(\"#maxnum\").val();\n }", "function setMaxCustomDie(){\r\n maxCustomDie = inMaxCustomDie.value;\r\n}", "function setElementProgressMax(id, max)\n{\n let target = document.getElementById(id)\n target.max = max;\n let toolTip = target.value + ' / ' + max;\n target.setAttribute('title', toolTip);\n}", "function getInputMax(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"maxes>data\");\r\n\tif (result == null || result.text() == null) {return -100;}\r\n\telse return parseFloat(extract(result.text()));\r\n}", "function validaMaximo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock Maximo invalido\");\n document.getElementById(\"maximo\").value= \"0\"; \n document.getElementById(\"maximo\").focus();\n }\n }", "function count_and_redefine_max(e){\n\t try{\n\t // get the input and the maximum length\n\t var input = j( e.currentTarget || e )\n\t \n\t \n\t // cap at the maximum!\n\t //parseInt\n\t \n\t // Reformat the display\n\t if( input.siblings('.limit_input').length > 0 ){\n\t var max_val = input.siblings('.limit_input').text().match( /.*\\/(.*)/ )[1]\n\t input.siblings('.limit_input').text( input.val().length + \"/\" + max_val )\n\t }else{ // in case field has errors, it won't break stuff\n\t var limit_span = input.parent().prevAll('.limit_input:first')\n\t var max_val = limit_span.text().match( /.*\\/(.*)/ )[1]\n\t limit_span.text( input.val().length + \"/\" + max_val )\n\t }\n\t \n\t } catch(e){\n\t // if has no max, keep walking, JW\n\t }\n\t}", "maxlength(input, maxValue){\n let inputLenght = input.value.length;\n let errorMessage = `O campo não pode ter mais de ${maxValue} caracteres`\n if(inputLenght > maxValue){\n this.printMessage(input, errorMessage)\n }\n }", "set max(mL) {\n if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');\n this[MAX] = mL || Infinity;\n trim(this);\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "function findMax(){\n let maxVal = max(parseInt(document.getElementById(\"max1\").value), parseInt(document.getElementById(\"max2\").value));\n document.getElementById(\"resultMax\").innerHTML = maxVal;\n}", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity;\n trim(this);\n }", "function resetMinMax() {\n minPermintaan = 1000;\n maxPermintaan = 5000;\n minPersediaan = 100;\n maxPersediaan = 600;\n }", "function setMinPersediaan(params) {\n minPersediaan = document.getElementById('newMinPersediaan').value;\n }", "set maxIndex(_val) {\n (typeof _val === \"number\") && this.setAttribute(\"max\", _val);\n }", "function setMax(maxID) {\n MAX_ID = maxID;\n}", "maxlength(input, maxValue) {\n \n let inputLength = input.value.length\n\n let errorMessage = `O campo precisa ter menos que ${maxValue} caracteres`\n\n if(inputLength > maxValue) {\n this.printMessage(input, errorMessage)\n }\n\n }", "function setMaxNumber() {\r\n var level = getLevel();\r\n switch (level) {\r\n case ('1'):\r\n gMaxNumber = 10;\r\n break;\r\n case ('2'):\r\n gMaxNumber = 20;\r\n break;\r\n case ('3'):\r\n gMaxNumber = 10;\r\n break;\r\n default:\r\n window.location = '../index.html';\r\n break;\r\n }\r\n}", "maxlength(input, maxValue) {\n\n let inputLength = input.value.length;\n let errorMessage = `*O campo precisa ter menos que ${maxValue} caracteres`;\n\n if (inputLength > maxValue) {\n this.printMessage(input, errorMessage);\n\n }\n }", "function validaMaximo(elemento, numMax) {\n var numTxt = elemento.value.length; // Número de caracteres actuales en el textarea\n var numero_maximo = numMax - 1;\n\n if (numTxt > numero_maximo) {\n return false;\n } else {\n return true;\n }\n}", "function validaDesbordamientoAbono (e, field, totalPagos, max_value)\n{ var maximo=0;\n if(max_value>totalPagos)\n { maximo=parseFloat(totalPagos);\n }\n else\n { maximo=parseFloat(max_value);\n }\n //var valor = field.value;\n var valor_actual = field.value+String.fromCharCode(e.which);\n var valor_actual_real = parseFloat(valor_actual)*10;\n if( parseFloat(valor_actual_real) > parseFloat( maximo ) )\n { $.growl.error({ title: \"Educalinks informa\", message: \"Valor excedido, ingreso un monto menor o igual a la deuda\" });\n field.value='';\n return false;\n }\n}", "setValueDiffMax (valueDiffMax) {\n this._valueDiffMax = valueDiffMax\n }", "function maxLenght(){\n $('.max').maxlength({\n alwaysShow: true,\n warningClass: \"badge badge-success\",\n limitReachedClass: \"badge badge-danger\"\n });\n}", "setMax(max) {\n self.datePicker.max = new Date(max);\n }", "set max (mL) {\n\t if (typeof mL !== 'number' || mL < 0)\n\t throw new TypeError('max must be a non-negative number')\n\n\t this[MAX] = mL || Infinity;\n\t trim(this);\n\t }", "function fgetMaxValue(){\r\n\treturn 100;\r\n}", "function updateMinMaxFromJson(minMaxTxt){\n\towgis.interf.loadingatmap(false);\n\n var jsonMinMax = eval(\"(\"+minMaxTxt+\")\");\n $('#minPal').val(parseFloat(jsonMinMax[\"min\"]).toPrecision(4)); \n $('#maxPal').val(parseFloat(jsonMinMax[\"max\"]).toPrecision(4));\n UpdatePalette(mappalette);\n}", "function setLimits() {\n var t, rx = /\\d+(\\.\\d+)?/g,\n s, d, res = {s:6, d:6},\n config = Celestial.settings();\n\n d = config.dsos.data;\n \n //test dso limit\n t = d.match(rx);\n if (t !== null) {\n res.d = parseFloat(t[t.length-1]);\n }\n\n if (res.d !== 6) {\n $form(\"dsos-limit\").max = res.d;\n $form(\"dsos-nameLimit\").max = res.d;\n }\n \n s = config.stars.data;\n \n //test star limit\n t = s.match(rx);\n if (t !== null) {\n res.s = parseFloat(t[t.length-1]);\n }\n\n if (res.s != 6) {\n $form(\"stars-limit\").max = res.s;\n $form(\"stars-designationLimit\").max = res.s;\n $form(\"stars-propernameLimit\").max = res.s;\n }\n\n return res;\n}", "function charactLimit(){\n\tbtn.disabled= false;\n\n\tvar tweet = document.getElementById(\"tweet\").value; // aca se almacena valor de cada tweet//\n\tvar parrafo = document.getElementById(\"inp\");// var define el contador//\n\tvar max = 140; // define cantidad max de caracteres.//\n\tparrafo.innerHTML= max-tweet.length; //Modificar el contador para que a 140 se le reste el largo del tweet\n}", "function limitarCaracteres(campo, tamanhoMax)\r\n{\r\n if (campo.value.length > tamanhoMax)\r\n {\r\n campo.value = campo.value.substring(0, tamanhoMax);\r\n }\r\n}", "function cambiarLimiteDeExtraccion(){\n nuevoLimiteDeExtraccion = parseInt(prompt(\"¿Cuál es tu nuevo limite de extracción?\"))\n limiteExtraccion = nuevoLimiteDeExtraccion;\n actualizarLimiteEnPantalla();\n}", "setValueMax_by_ValueMaxObject( valueMax ) {\n this.htmlProgress.value = valueMax.valuePercentage;\n this.htmlProgress.max = valueMax.maxPercentage;\n }", "function kiemtratuoi(mintuoi,maxtuoi) {\n\tvar ag = document.getElementById(\"age\");\n\tvar tb = document.getElementById(\"thongbao\");\n\tvar numbers = /^[0-9]+$/;\n\tif(ag.value.match(numbers)) {\n\t\tvar intTuoi = parseInt(ag.value);\n\t\tif(intTuoi < mintuoi || intTuoi > maxtuoi) {\n\t\ttb.style.display = \"block\";\n\t\ttb.innerHTML = \"Nhập tuổi từ 18 đến 50\";\n\t\treturn false;\n\t\t} else {\n\t\ttb.style.display = \"none\";\n\t\treturn true;\n\t\t}\n\t} else {\n\t\ttb.style.display = \"block\";\n\t\ttb.innerHTML = \"Hãy nhập tất cả la số\";\n\t\treturn false;\n\t}\n}", "function setMaxValueOnJumpControl(search_paging_info){\n var maxPg;\n console.log(\"search paging info\");\n if (search_paging_info.max_page_available < \n search_paging_info.total_page_count){\n maxPg = search_paging_info.max_page_available;\n }else{\n maxPg = search_paging_info.total_page_count;\n }\n $(\"#user-page-number\").attr('max',maxPg );\n $(\"#max_pg_available\").text(maxPg);\n}", "function setValue(html,id){\n customval = $(html).attr('name');\n val = $(html).val();\n var Int = '';\n // $('#'+id).val(val);\n if(val){\n var string = val.match(/[a-z]+|\\d+/ig);\n if(string.length == 1 ){\n if(isNaN(parseInt(string[0]))){\n Int = ((id == 'Plotbudget_min')) ? '1000000' : '200000000' ;\n }else{\n Int = string[0];\n }\n }\n else{\n if(string[1] == 'K' || string[1] == 'k') {;\n string[0] += '000'\n } else if(string[1] == 'L' || string[1] == 'l') {\n string[0] += '00000'\n } else if(string[1] == 'Cr' || string[1] == 'cr') {\n string[0] += '0000000'\n }\n Int = (isNaN(parseInt(string[0]))) ? '200000000' : string[0] ;\n }\n $('input[name='+ customval+']').val(currencyFormat(Int));\n $('#'+id).val(Int);\n }\n \n\n \n\n HideMax(html, Int)\n}", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "function maxbet() {\r\n document.getElementById(\"mybet\").value = mypounds;\r\n message.innerHTML = \"Bet changed to £\"+ mypounds;\r\n }", "set maxHeight(value) {}", "setMaxLength(value, type) {\n if (value.length < SETTINGS.textLength[type]) return value\n return value.substring(0, SETTINGS.textLength[type] - 1) + '...'\n }", "function maxValidator(max) {\n return control => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n\n const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n\n return !isNaN(value) && value > max ? {\n 'max': {\n 'max': max,\n 'actual': control.value\n }\n } : null;\n };\n}", "function longitud(cadena, maximo) \n {\n\t var maximo;\n\t if (document.form1.titulo.value.length == maximo)\n\t {\n\t\tdocument.form1.resta.value = 0;\n\t\tdocument.getElementById('not-tit-long').style.display ='inline';\n\t\tdocument.getElementById('not-tit-long').style.visibility='visible';\n\t }\n\t else\n\t {\n\t\tdocument.form1.titulo.style.backgroundColor='#fff';\n\t\tdocument.form1.resta.value = maximo - document.form1.titulo.value.length;\n\t\tdocument.form1.resta.type = \"visible\";\n\t\tdocument.getElementById('not-tit-restantes').style.display='inline';\t\t\n\t\tdocument.getElementById('not-tit-restantes').style.visibility='visible';\n\t\tdocument.getElementById('not-tit-long').style.visibility='hidden';\t\n\n\t\tif (document.form1.titulo.value.length > 0)\n\t\t{\n\t\t\tdocument.form1.publicar.disabled=false;\n//\t\t\tdocument.getElementById('aviso').style.visibility='hidden'\t\t\t\n\t\t\tdocument.getElementById('aviso').style.display='none'\t\t\t\t\t\t\n\t\t}\n\t }\n }", "function rpManualEntry() {\n document.getElementById('reward-points-spent').oninput = function () {\n let max = parseFloat(this.max);\n if (this.value > max) {\n this.value = max;\n }\n }\n $('#reward-points-spent').on('change', function(){ document.getElementById('rp-payment').click();});\n}", "function getSystemMaxNumber() {\r\n\tvar t = document.getElementById('system_input').getAttribute('onkeyup').match(/\\d+/g);\r\n\r\n\treturn parseInt(t[1], 0);\r\n}", "get max() {\n return this.args.max || null;\n }", "function max(p1 , p2){\n\tvar maxVal= 0;\n\tif (p1 > p2){\n\t\tmaxVal = p1;\n\t} else{\n\t\tmaxVal = p2;\n\t}\n\tconsole.log(\"Los números son: \"+ p1 + \"-\" + p2 + \"\\n\" + \"El mayor de los números es: \" + maxVal)\n}", "function setM(value) {\n document.getElementById(\"valueM\").innerHTML = value;\n mines = parseInt(value);\n}", "function fc_MaxLength(pTextArea,num_caracteres_permitidos){ \n contenido_textarea = pTextArea.value;\n num_caracteres = pTextArea.value.length \n if (num_caracteres > num_caracteres_permitidos){ \n pTextArea.value = pTextArea.value.substring(0,num_caracteres_permitidos)\n } \n}", "function limitMaxText(limitField, limitNum) {\n if (limitField.value.length > limitNum) {\n limitField.value = limitField.value.substring(0, limitNum);\n }\n}", "get maxValue() {\n return this.options.maxValue || null;\n }", "getMax() {\n \n }", "function showMaxTemp(i, id){\n max = `\n ${currentData[i].app_max_temp} ° de máxima\n `\n document.getElementById(id).innerHTML = max;\n}", "function warning(){\n petiteRationValue = parseInt(document.getElementById('petiteRation_button').value);\n grosseRationValue = parseInt(document.getElementById('grosseRation_button').value);\n epeeValue = parseInt(document.getElementById('epee_button').value);\n shieldValue = parseInt(document.getElementById('shield_button').value);\n flaskValue = parseInt(document.getElementById('flask_button').value);\n bagValue = parseInt(document.getElementById('bag_button').value);\n let totalValue = (petiteRationValue + grosseRationValue + epeeValue + shieldValue + flaskValue + bagValue);\n document.getElementById('stock').value = totalValue;\n document.querySelector('#stock_announce').textContent = totalValue + ' / 15';\n if (totalValue >= 15) {\n document.getElementById('petiteRation_button').setAttribute('max',petiteRationValue);\n document.getElementById('grosseRation_button').setAttribute('max',grosseRationValue);\n document.getElementById('epee_button').setAttribute('max',epeeValue);\n document.getElementById('shield_button').setAttribute('max',shieldValue);\n document.getElementById('flask_button').setAttribute('max',flaskValue);\n document.getElementById('bag_button').setAttribute('max',bagValue);\n }\n else {\n document.getElementById('petiteRation_button').setAttribute('max',15);\n document.getElementById('grosseRation_button').setAttribute('max',15);\n document.getElementById('epee_button').setAttribute('max',15);\n document.getElementById('shield_button').setAttribute('max',15);\n document.getElementById('flask_button').setAttribute('max',15);\n document.getElementById('bag_button').setAttribute('max',15);\n }\n /* PROJET ABANDONNÉ \n if(grosseRationValue > 15){\n document.getElementById('grosseRation_button').value = 15 - (totalValue - grosseRationValue);\n }\n if(epeeValue > 15){\n document.getElementById('epee_button').value = 15 - (totalValue - epeeValue);\n }\n if(shieldValue > 15) {\n document.getElementById('shield_button').value = 15 - (totalValue - shieldValue);\n }\n if(flaskValue > 15) {\n document.getElementById('flask_button').value = 15 - (totalValue - flaskValue);\n }\n if(bagValue > 15) {\n document.getElementById('bag_button').value = 15 - (totalValue - bagValue);\n }\n\n getTotal();\n */\n\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function cambiarLimiteDeExtraccion() {\n let limiteExtraccionIngresado = parseInt(prompt(\"Ingrese nuevo limite de extraccion.\"));\n if (limiteExtraccionIngresado != null && limiteExtraccionIngresado != \"\") {\n limiteExtraccion = limiteExtraccionIngresado;\n actualizarLimiteEnPantalla()\n alert(\"Nuevo limite de extraccion: $\" + limiteExtraccion);\n }\n}", "function FormataValor(campo, tammax, teclapres) {\r\n\tvar tecla = teclapres.keyCode;\r\n\tvr = campo.value;\r\n\tvr = vr.replace(/[^\\d]*/gi, \"\");\r\n\ttam = vr.length;\r\n\r\n\tif (tam < tammax && tecla != 8) {\r\n\t\ttam = vr.length + 1;\r\n\t}\r\n\r\n\tif (tecla == 8) {\r\n\t\ttam = tam - 1;\r\n\t}\r\n\r\n\tif (tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105) {\r\n\t\tcampo.value = vr.substr(0, tam - 2) + ',' + vr.substr(tam - 2, tam);\r\n\t}\r\n\r\n\tif (tam <= 2) {\r\n\t\tcampo.value = vr;\r\n\t}\r\n\r\n\tif ((tam > 2) && (tam <= 5)) {\r\n\r\n\t\tif ((tam >= 6) && (tam <= 8)) {\r\n\t\t\tcampo.value = vr.substr(0, tam - 5) + '' + vr.substr(tam - 5, 3) + ',' + vr.substr(tam - 2, tam);\r\n\t\t}\r\n\t\tif ((tam >= 9) && (tam <= 11)) {\r\n\t\t\tcampo.value = vr.substr(0, tam - 8) + '' + vr.substr(tam - 8, 3) + '' + vr.substr(tam - 5, 3) + ',' + vr.substr(tam - 2, tam);\r\n\t\t}\r\n\t\tif ((tam >= 12) && (tam <= 14)) {\r\n\t\t\tcampo.value = vr.substr(0, tam - 11) + '' + vr.substr(tam - 11, 3) + '' + vr.substr(tam - 8, 3) + '' + vr.substr(tam - 5, 3) + ',' + vr.substr(tam - 2, tam);\r\n\t\t}\r\n\t\tif ((tam >= 15) && (tam <= 17)) {\r\n\t\t\tcampo.value = vr.substr(0, tam - 14) + '' + vr.substr(tam - 14, 3) + '' + vr.substr(tam - 11, 3) + '' + vr.substr(tam - 8, 3) + '' + vr.substr(tam - 5, 3) + ',' + vr.substr(tam - 2, tam);\r\n\t\t}\r\n\r\n\t\t//limpa zeros a esquerda\r\n\t\tif (campo.value.substr(0, 1) == '0' && campo.value.substr(0, 2) != '0.') campo.value = campo.value.substr(1, tam);\r\n\t}\r\n\r\n}", "function cambiarLimiteDeExtraccion() {\n let limite = parseInt(prompt(\"Ingrese el nuevo limite de extraccion: \"));\n if (isNaN(limite) || limite <= 0)\n return alert(\"Numero invalido\");\n else if (limite % 100)\n return alert(\"En este homebanking solo podes extraer billetes de $100.\");\n else {\n limiteExtraccion = limite;\n alert(`Tu nuevo limite de extraccion es: $${limiteExtraccion}`);\n }\n actualizarLimiteEnPantalla();\n}", "max(max) {\n this.checkSearchType();\n if (!this.options.block) {\n this.options.block = {};\n }\n this.options.block.max = max;\n return this;\n }", "function UtilPoFo() {\r\n if (perso.Pinv[0] != 0) { //Test si il reste des potion\r\n if (perso.Pfor >= 100) { //Test si le maximum est atteint\r\n alert(\"Vous avez atteint la force maximale\");\r\n console.log(\"Force au max / nombre de potion = \"+ perso.Pinv[0]);\r\n } else {\r\n perso.Pinv[0] -= 1; // -1 potion\r\n perso.Pfor += 1; // +1 caracteristique\r\n document.getElementById('nbPoFo').value = perso.Pinv[0]; //affichage du nombre de potion dans l'inventaire\r\n document.getElementById('force').value = perso.Pfor; //affichage de la force dans les caractéristique\r\n console.log(\"Utilisation d'une potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n console.log(\"La force de \"+ perso.Pnom + \" monte a \"+perso.Pfor);\r\n }\r\n } else {\r\n alert(\"Vous n'avez plus de potion\");\r\n console.log(\"Pas de potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n }\r\n\r\n}", "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n mines = parseInt(maxMines);\n }\n}", "function cambiarLimiteDeExtraccion() {\n var monto = prompt(\"Ingrese el nuevo limite de extraccion\");\n if(validaValoresNumericos(monto) && numeroNegativo(monto) && billetes100(monto)){\n cambiarLimite(monto);\n actualizarLimiteEnPantalla();\n}\n}", "function showMax(event, obj) {\n if (obj) {\n if (Number(obj.val().slice(1, obj.val().length))) {\n minAmount = obj.val();\n if ($(\"#max\").val()) {\n var maxText = $(\"#max\").val();\n }\n if (minAmount.indexOf(\"$\") === -1) {\n minAmount = \"$\" + obj.val();\n }\n if (maxText) {\n $(\"#rent-range\").html(minAmount + \"-$\" + maxText);\n }\n else {\n $(\"#rent-range\").html(minAmount + \"+\");\n }\n }\n else {\n if (maxVal) {\n $(\"#rent-range\").html(\"<\" + maxVal)\n }\n else {\n $(\"#rent-range\").html(\"Rent Range\");\n }\n }\n }\n $(\"#max-column\").css(\"display\", \"initial\");\n $(\"#min-column\").css(\"display\", \"none\");\n }", "function findLarge(){\r\n \r\n \r\n var boxvalue01=document.getElementById('inputBox07a').value;\r\n var boxvalue02=document.getElementById('inputBox07b').value;\r\n \r\n \r\n\r\n var largernum = Math.max(boxvalue01,boxvalue02);\r\n \r\n document.getElementById(\"ans07\").innerHTML =largernum +\" - is Larger\";\r\n \r\n return false\r\n}", "function setMaxStr(switcher, element, data) {\n switcher.addEventListener(\"input\", function (e) {\n $(element).css(\"font-size\", `${data.fontSize}px`);\n calcViewFont(\n element,\n e.target.value,\n parseInt($(element).css(\"font-size\"), 10)\n );\n data.maxStr = e.target.value;\n });\n}", "function getPersonalMax() {\n\t\t// Создаем экземпляр класса XMLHttpRequest\n\t\tlet request = new XMLHttpRequest();\n\t\t// Указываем путь до файла на сервере, который будет обрабатывать наш запрос \n\t\tlet url = \"proc/ad_getpersonalmax.php\";\n\n\t\trequest.open(\"POST\", url, true);\n\t\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\trequest.addEventListener(\"readystatechange\", () => {\n\t\t\tif (request.readyState === 4 && request.status === 200) {\n\t\t\t\tlet allPersonalPar = JSON.parse(request.responseText);\n\t\t\t\t//console.log(request.responseText);\n\t\t\t\t//console.log(allPersonalPar);\n\t\t\t\tcalorOutputDraw(allPersonalPar.weight, allPersonalPar.height, allPersonalPar.age);\n\t\t\t}\n\t\t});\n\t\t//\tВот здесь мы и передаем строку с данными, которую формировали выше. И собственно выполняем запрос. \n\t\trequest.send();\n\n\n\t}", "get max() {\r\n return this._max\r\n }", "get maximumValue() {\r\n return this.i.maximumValue;\r\n }", "get maxFee() { return this.get('maxFee'); }", "function textCounter( field, maxlimit )\r\n{\r\n if ( field.value.length > maxlimit )\r\n {\r\n field.value = field.value.substring( 0, maxlimit );\r\n alert( 'Textarea value can only be '+ maxlimit + ' characters in length.' );\r\n\r\n }\r\n }" ]
[ "0.82385206", "0.7557402", "0.72324264", "0.70395625", "0.7004344", "0.69728523", "0.680585", "0.6773965", "0.6625173", "0.6621312", "0.6562023", "0.6506439", "0.6458832", "0.6446216", "0.64046824", "0.63815355", "0.63498", "0.63414544", "0.63092923", "0.6305604", "0.63033473", "0.62996477", "0.62961614", "0.6285122", "0.6254612", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6252263", "0.6245032", "0.62363076", "0.62338084", "0.62223876", "0.6208438", "0.62053406", "0.6202472", "0.61734813", "0.616915", "0.6160161", "0.6141618", "0.61384475", "0.6134594", "0.61293626", "0.6084374", "0.60809153", "0.60635954", "0.603723", "0.602994", "0.6021159", "0.6016161", "0.59732413", "0.5971451", "0.59500206", "0.59497434", "0.594176", "0.5902805", "0.58963645", "0.58863133", "0.58481026", "0.58471453", "0.5839727", "0.5830667", "0.58234185", "0.5799579", "0.5794008", "0.5791868", "0.57840115", "0.578346", "0.5779517", "0.5768265", "0.5762548", "0.57578415", "0.57578415", "0.57578415", "0.5750542", "0.57457495", "0.5743331", "0.57407534", "0.5740627", "0.5732151", "0.5727658", "0.57243437", "0.57198864", "0.57198745", "0.57131076", "0.5713055", "0.57115406", "0.5709608", "0.5701575" ]
0.8336871
0
setMinPersediaan set the minPersediaan variable with value from text input
function setMinPersediaan(params) { minPersediaan = document.getElementById('newMinPersediaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMinPermintaan () {\n minPermintaan = document.getElementById('newMinPermintaan').value;\n }", "set min(value) {\n Helper.UpdateInputAttribute(this, 'min', value);\n }", "set _min(value) {\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function updateMinN(min) {\n reset();\n if (min < 1 || min > 100 || Math.round(min) != min) {\n alert(\"Minimum value of n must be an integer between 1 and 100\");\n document.getElementById(\"minInput\").value = minN;\n } else {\n minN = min;\n }\n}", "set min(value) {\n this.changeAttribute('min', value);\n }", "function setM(value) {\n document.getElementById(\"valueM\").innerHTML = value;\n mines = parseInt(value);\n}", "setMin(min) {\n self.datePicker.min = new Date(min);\n }", "function setMaxPersediaan() {\n maxPermintaan = document.getElementById('newMaxPersediaan').value;\n }", "function minPrice(element, value) {\n element.min = value;\n element.placeholder = value;\n }", "function setMaxPermintaan() {\n maxPermintaan = document.getElementById('newMaxPermintaan').value;\n }", "function getMinimum () {\n if ((document.getElementById('entMin').value)===\"\") {\n return 1;\n }\n else {\n return Number(document.getElementById('entMin').value)}\n}", "function getInputMin(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"mins>data\");\r\n\tif (result == null || result.text()==null) {return -100;}\r\n\telse return parseFloat(extract(result.text()));\r\n}", "function setMinCustomDie(){\r\n minCustomDie = inMinCustomDie.value;\r\n}", "set min(value) {\n Helper.UpdateInputAttribute(this, 'minlength', value);\n }", "setValueDiffMin (valueDiffMin) {\n this._valueDiffMin = valueDiffMin\n }", "set minIndex(_val) {\n (typeof _val === \"number\") && this.setAttribute(\"min\", _val);\n }", "_add_MinPSM_InputField__OnChange_Processing({ $project_page__ann_cutoff_defaults_project_level_psms_min }) {\n\n const project_page__ann_cutoff_defaults_project_level_psms_min_DOM = $project_page__ann_cutoff_defaults_project_level_psms_min[ 0 ];\n\n project_page__ann_cutoff_defaults_project_level_psms_min_DOM.addEventListener('input', ( eventObject ) => {\n try {\n eventObject.preventDefault();\n // console.log(\"'input' fired\");\n const eventTarget = eventObject.target;\n // const inputBoxValue = eventTarget.value;\n // console.log(\"'input' fired. inputBoxValue: \" + inputBoxValue );\n const $eventTarget = $( eventTarget );\n const $selector_invalid_entry = $(\"#project_page__ann_cutoff_defaults_project_level_psms_min_invalid_entry\");\n var fieldValue = $eventTarget.val();\n if ( ! this._isFieldValueValidMinimumPSMValue({ fieldValue }) ) {\n $selector_invalid_entry.show();\n\n if ( this._minPSMs_Entry_Valid ) {\n this._minPSMs_Entry_Valid = false;\n\n // Value changed so update dependent items\n this._update_enable_disable_SaveButton();\n }\n } else {\n $selector_invalid_entry.hide();\n\n if ( ! this._minPSMs_Entry_Valid ) {\n this._minPSMs_Entry_Valid = true;\n\n // Value changed so update dependent items\n this._update_enable_disable_SaveButton();\n }\n }\n return false;\n } catch( e ) {\n reportWebErrorToServer.reportErrorObjectToServer( { errorException : e } );\n throw e;\n }\n });\n }", "function resetMinMax() {\n minPermintaan = 1000;\n maxPermintaan = 5000;\n minPersediaan = 100;\n maxPersediaan = 600;\n }", "get min() {\n return this.args.min || 0;\n }", "function minValidator(min) {\n return control => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n\n const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n\n return !isNaN(value) && value < min ? {\n 'min': {\n 'min': min,\n 'actual': control.value\n }\n } : null;\n };\n}", "function habilitarSegundaFecha() {\n eval(\"debugger;\");\n var fchDesde = document.getElementById('inputInicioCursado').value;\n var fchHoy = document.getElementById('todayDate').value;\n \n if(fchDesde < fchHoy){\n document.getElementById('inputFinCursado').value = fchHoy;\n document.getElementById('inputFinCursado').min = fchHoy; \n }else{\n document.getElementById('inputFinCursado').value = fchDesde;\n document.getElementById('inputFinCursado').min = fchDesde; \n }\n \n \n document.getElementById('inputFinCursado').disabled = false;\n document.getElementById('inputFinCursado').readonly = false;\n\n}", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function minValidator(min) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;\n };\n}", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "function setRange(min, max) {\n if(min > max) {\n alert(\"Please enter the lowest number in the left field\");\n } else {\n minNum = min;\n maxNum = max;\n }\n}", "get minValue() {\n return this.options.minValue || null;\n }", "function adicionaMinutos() {\n\n\n if(minutos === 5){\n setMinutos(10);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 15){\n setMinutos(20);\n setSegundos(0);\n }\n\n if(minutos === 20){\n setMinutos(25);\n setSegundos(0);\n }\n\n if(minutos === 25){\n setMinutos(30);\n setSegundos(0);\n }\n\n if(minutos === 30){\n setMinutos(35);\n setSegundos(0);\n }\n\n if(minutos === 35){\n setMinutos(40);\n setSegundos(0);\n }\n\n if(minutos === 40){\n setMinutos(5);\n setSegundos(0);\n }\n}", "set _minTermLength(value) {\n this.__minTermLength = value;\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "get min() {\n\t\treturn this.nativeElement ? this.nativeElement.min : undefined;\n\t}", "get min() {\n\t\treturn this.nativeElement ? this.nativeElement.min : undefined;\n\t}", "get min() {\r\n return this._min\r\n }", "function fieldMin(doc, field, value) {\n // Requires(doc !== undefined)\n // Requires(field !== undefined)\n // Requires(value !== undefined)\n\n fieldSet(doc, field, value, function (oldValue) {\n if (oldValue === undefined)\n return value;\n return compare(value, oldValue) < 0 ? value : oldValue;\n });\n }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "function findTheMinimumValueOfChemin(chemin) {\n var minimum = chemin[1].value;\n for(var i=1; i < chemin.length; i++) {\n if(chemin[i].value == \"E\" && chemin[i].marque == '-') {\n minimum = chemin[i].value;\n }\n if(chemin[i].value != \"E\" && chemin[i].value < minimum && chemin[i].marque == '-') minimum = chemin[i].value;\n }\n return minimum;\n }", "function CheckMinPTValue(arrDDL,arrPDDL,arrMin,errHolder)\r\n{\t\t\r\n\tfor(var i=0;i<arrDDL.length;i++)\r\n\t{\t\t\r\n\t\tvar totalPT= isNumeric(arrDDL[i]) + isNumeric(arrPDDL[i]);\r\n\t\tvar minVal=isNumeric(arrMin[i]);\r\n\t\tif(totalPT<minVal)\r\n\t\t{\r\n\t\t\tvar msg=errMsgMinPT + minVal;\r\n\t\t\tShowError(msg,errHolder);\r\n\t\t\t$(arrDDL[i]).focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function inputMinSliderLeft(){//slider update inputs\n inputMin.value=sliderLeft.value;\n}", "get minimumValue() {\r\n return this.i.minimumValue;\r\n }", "function evaluateMin(min) {\r\n if (min == 1) {\r\n minutes = ' minute';\r\n } else {\r\n minutes = ' minutes';\r\n }\r\n return minutes;\r\n}", "function validaMinimo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock minimo invalido\");\n document.getElementById(\"minimo\").value=\"0\"; \n document.getElementById(\"minimo\").focus();\n }\n }", "get min() {\n return this._min;\n }", "get minNumber() {\n return 0\n }", "function OptionMin(option){\n option = YearArray(option, selectedyear1, selectedyear2);\n var min = d3.min(option,function(d) {\n return parseFloat(d);\n });\n return min;\n}", "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n mines = parseInt(maxMines);\n }\n}", "function sliderLeftInput(){//input udate slider left\n sliderLeft.value=inputMin.value;\n}", "function YLightSensor_set_lowestValue(newval)\n { var rest_val;\n rest_val = String(Math.round(newval*65536.0));\n return this._setAttr('lowestValue',rest_val);\n }", "function setMinBarValueText (performanceBar) {\n var $performanceBar = $('#' + performanceBar._element.id);\n $performanceBar.attr('data-minValue', performanceBar._minValue);\n }", "minimum(min) {\n this.min = min;\n return this;\n }", "function setL(value) {\n document.getElementById(\"valueL\").innerHTML = value;\n lines = parseInt(value);\n adjustMines();\n}", "getMin() {\n return this.min;\n }", "get min() {\n\t\treturn this.__min;\n\t}", "function setMin (response) {\n curMin1 = 9999;\n for(var i = 0; i < 8; i++) {\n var tempMin1 = response.list[i].main.temp_min;\n //console.log(tempMin1);\n\n if (tempMin1 < curMin1) {\n curMin1 = Math.round(response.list[i].main.temp_min);\n }\n else if (curMin1 > curTemp) {\n curMin1 = Math.round(curTemp);\n }\n }\n}", "minVoltageForPlonkPreset(preset) {\n return (preset / (this.plonkPresetsCount - 1)) * plonkVoltageMax;\n }", "function min() {\n memory = document.getElementById(\"display\").value;\n document.getElementById(\"display\").value = \"\";\n teken = \"-\";\n}", "min(min) {\n this.checkSearchType();\n if (!this.options.block) {\n this.options.block = {};\n }\n this.options.block.min = min;\n return this;\n }", "function f_Qtd_String_Minima(obj, Qtd, Campo)\n{\n if(obj.value != \"\")\n {\n var TamanhoNome = obj.value;\n var Tamanho = TamanhoNome.length;\n\n if(Tamanho <= Qtd)\n {\n bootbox.alert({\n message: \"Este campo \" + Campo + \", precisa ter no mínimo \"+Qtd+\" caracteres!\",\n callback: function ()\n {\n obj.focus();\n }\n });\n Valor = false;\n }\n else\n {\n Valor = true;\n } \n }\n else\n {\n Valor = true;\n }\n}", "minamp(val) {\n this._minamp = val;\n return this;\n }", "function generateMin() {\n if (getInputData() > 0 && getInputData() < 5) {\n removeBoardPaint();\n generateHeightDivs(5);\n generateWidthDivs(5);\n addWhiteToBoard();\n window.alert('mínimo: 5 | máximo: 50')\n }\n}", "function toggleMin() {\r\n var minInput = document.getElementById('rangeTextMin');\r\n minInput.disabled = !minInput.disabled;\r\n}", "function resetQuestionValueToMin(questionValue) {\n if (questionValue < 0) {\n questionValue = 0;\n }\n return questionValue;\n}", "setMinWidth(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MinWidth\")),t!==this.__minWidth&&(this.__minWidth=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MinWidth\"}),this.__processMinWidth())}", "function minimum() {\r\nvar mini = Math.min.apply(null, numbers);\r\nconsole.log(\"minimum cherez matem funchii-\",mini);\r\n}", "isMin(value, limit) {\n return parseFloat(value) >= limit;\n }", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "function minFunc() {\n let minNum = Math.min(num1, num2, num3);\n console.log(\"MIN: \" + minNum);\n results[1].textContent = \"Min: \" + minNum;\n}", "set minimumWidth(value) { }", "function setMinDate(startDate, endDate) {\n startDate.setAttribute(\"min\", currentDateString);\n startDate.addEventListener(\"change\", () => {\n endDate.setAttribute(\"min\", startDate.value);\n })\n}", "get minIndex() {\n return Number(this.getAttribute(\"min\"));\n }", "function showOrHiddenMin(operator,low){\n\tvar pct_operator = abRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.getFieldElement(operator);\n\tif(pct_operator.value!=\"Range\"){\n\t\tabRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.showField(low, false);\n\t}else{\n\t\tabRiskMsdsDefPropController.abRiskMsdsDefMsdsPhysicalForm.showField(low, true);\n\t}\n}", "function onUpdateMin()\n\t{\n\t\t// store current min \n\t\tvar pxmin = xslider.min;\n\t\tvar pymin = yslider.min;\n\n\t\t// store current values\n\t\tvar xcurr = xslider.value;\n\t\tvar ycurr = yslider.value;\n\n\t\t// set new min. slider will internally try to update current value to ensure it's within its range. e.g. if curr = 20, new min = 25, curr = 25\n\t\t// this is why we store original values before we do this. we use original values to calculate new values\n\t\txslider.min = w - (yslider.hide? 0 : t);\n\t\tyslider.min = h - (xslider.hide? 0 : t);\n\n\t\t// calculate the change in min and use it to update current values. e.g. old.min = 20, old.val = 24, new.min = 15, new.val = 19\n\t\t// we always keep the delta between min and value. if value end up >max, slider will handle it.\n\t\txcurr -= (pxmin - xslider.min);\n\t\tycurr -= (pymin - yslider.min);\n\n\t\t// finally, update values\n\t\txslider.value = xcurr;\n\t\tyslider.value = ycurr;\n\t}", "function setN1Range() {\n minValue1 = Number(document.getElementById('low1').value);\n maxValue1 = Number(document.getElementById('high1').value);\n}", "function centangStatus2(x,p){\n\t\tvar poinx; \n\t\tif(x=='anggota'){ // anggota \n\t\t\t$('#jumlahTB').val(1);\n\t\t\tvar n = $('#jumlahTB').val();\n\t\t\t$('#jumlahTB').attr('style','display:visible').attr('required','required');\n\t\t\tpoinx = (40/100 * parseFloat(p))/n;\n\t\t}else{ // ketua\n\t\t\t$('#jumlahTB').attr('style','display:none').removeAttr('required').val('');\n\t\t\tpoinx = 60/100 * parseFloat(p);\n\t\t}\n\t\t$('#poinTB').val(poinx.toFixed(2));\n\t}", "function modelMin(newValue) {\n if(scope.getterSetter) {\n return arguments.length ? scope.modelMin(newValue) : scope.modelMin();\n } else {\n return arguments.length ? (scope.modelMin = newValue) : scope.modelMin;\n }\n }", "getMin() {\n return this.min;\n }", "setMinWidthUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MinWidthUnit\")),t!==this.__minWidthUnit&&(this.__minWidthUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MinWidthUnit\"}),this.__processMinWidthUnit())}", "function verificarNumero(value, min, id){\n let res = \"\";\n let val = value.split(\"\");\n for(let i = 0; i < val.length; i++){\n res += (NUMBERS.includes(val[i])) ? val[i] : \"\";\n }\n if(Number.parseInt(res) > 20) {\n res = (Number.parseInt(res) > 20) ? res.slice(0,-1) : res;\n }\n document.getElementById(id).value = res;\n return (Number.isInteger(Number.parseInt(value[value.length - 1])) && !(Number.parseInt(value) < min));\n}", "_getMinDate() {\n return this.datepickerInput && this.datepickerInput.min;\n }", "function passCorrectedValuesToSliderAndGetThem(textBox, isMin){\n newVal = $(textBox).val()\n theSlider = $(textBox).parent().parent().parent().find(\"div > .theSlider\")\n if(newVal){ //make sure the new value exists\n //create the range variables for each of the sliders\n low = (isMin) ? $(theSlider).slider(\"option\", \"min\") : $(theSlider).slider(\"values\", 0)\n high = (isMin) ? $(theSlider).slider(\"values\", 1) : high = $(theSlider).slider(\"option\", \"max\")\n \n //if we are not within range make ourselves within range\n if(newVal < low || high < newVal){\n if(newVal < low) newVal = low\n else newVal = high\n }\n } //set the slider value to its default\n else newVal = $(theSlider).slider(\"option\", (isMin) ? \"min\" : \"max\")\n\n //set the new value of the slider\n $(theSlider).slider(\"values\", (isMin) ? 0 : 1, newVal)\n\n //set the value for the textbox\n return newVal\n }", "function textBoxToSlider(textBox, isMin){\n $(textBox).on(\"change keyup paste\", function(){\n passCorrectedValuesToSliderAndGetThem(this, isMin)\n })\n }", "function setMinDateOnStartDate() {\n var todaysDate = ConvertDateFormat(new Date());\n //Sets the min date on the start date input to the current date.\n document.getElementById(\"MainContent_startDate\").setAttribute(\"min\", todaysDate);\n}", "min() {}", "function setMinDate() {\n let aus = new Date();\n aus.setDate = aus.getDate();\n aus.setFullYear(aus.getFullYear() - 8); //imposto come data di nascita massima 8 anni fa\n let data = aus.toISOString().split('T')[0];\n $(\"#dataNascitaModProfilo\").attr(\"max\", data);\n}", "function showMinTemp(i, id){\n min = `\n ${currentData[i].app_min_temp} ° de mínima\n `\n document.getElementById(id).innerHTML = min;\n}", "function min_t_sec(){\n const min = parseInt(document.getElementById(\"min\").value);\n const sec = min*60;\n document.getElementById(\"ans\").value = sec; \n}", "get minimumValue() {\r\n return this.i.bl;\r\n }", "function codificaTexto(){\n const texto = document.getElementById(\"InputTextoPlano\");\n const textoPlano = texto.value;\n const input = document.getElementById(\"InputN\");\n const value = Number(input.value);\n if(value <= 0 || value >= limit){\n alert(\"Debes ingresar n mayor que cero y menor que \"+limit)\n }else{\n //console.log(value)\n const res = codifica(String(textoPlano),value)\n resultado.value = res;\n }\n}", "min() {\n const { value, operation } = this.state;\n if (operation === 0) {\n this.setState({\n num1: Number(value),\n operation: 2,\n });\n this.clear();\n }\n }", "function rangeMinLimiter(zoomPanOptions, newMin) {\n\tif (zoomPanOptions.scaleAxes && zoomPanOptions.rangeMin &&\n\t\t\t!helpers.isNullOrUndef(zoomPanOptions.rangeMin[zoomPanOptions.scaleAxes])) {\n\t\tvar rangeMin = zoomPanOptions.rangeMin[zoomPanOptions.scaleAxes];\n\t\tif (newMin < rangeMin) {\n\t\t\tnewMin = rangeMin;\n\t\t}\n\t}\n\treturn newMin;\n}", "function checkNumberValue(el,min,max){\n\t\tel.addEventListener(\"change\",function(){\n\t\t\tif(el.value==\"\"){el.value = \"\";}\n\t\t\telse if(el.value<min){el.value = min;}\n\t\t\telse if(el.value>max){el.value =max;}\n\t\t});\n\t}", "get minimumValue() {\n return this.i.bl;\n }", "setMin() {\n this.setState({\n startIndex: 0\n })\n // check end index\n if (this.state.validEndIndex) {\n if (this.state.endIndex > 0+helpers.constants.SWEEP_MAX_INDEX) {\n this.setState({endIndex: 0+helpers.constants.SWEEP_MAX_INDEX})\n }\n }\n }", "get min() {\n return this.getMin();\n }", "minlength(input, minValue) {\n let inputLenght = input.value.length;\n let errorMessage = `O campo precisa ter pelo menos ${minValue} caracteres`\n if(inputLenght < minValue){\n this.printMessage(input, errorMessage)\n }\n\n }", "get xMin() {\n return this.xRange.min;\n }" ]
[ "0.7976153", "0.71554196", "0.7120069", "0.6942235", "0.6768394", "0.6699136", "0.66111183", "0.65619206", "0.6553356", "0.6510541", "0.6487791", "0.6330027", "0.63266677", "0.6298205", "0.6243311", "0.6142725", "0.610474", "0.60677993", "0.6027375", "0.60231453", "0.60153884", "0.5947914", "0.5947914", "0.5947914", "0.59395784", "0.5923918", "0.5898129", "0.58841443", "0.587173", "0.58436424", "0.57834345", "0.57834345", "0.57827795", "0.57659477", "0.57591224", "0.57591224", "0.57591224", "0.57591224", "0.57591224", "0.57591224", "0.57572085", "0.5755265", "0.57547766", "0.57387936", "0.573508", "0.57141966", "0.57088226", "0.56955266", "0.5690618", "0.56826967", "0.5669825", "0.56604105", "0.564317", "0.5633619", "0.5608803", "0.5588886", "0.55869853", "0.55860925", "0.55822873", "0.5581876", "0.55578595", "0.554893", "0.55405724", "0.5539216", "0.5534849", "0.55204916", "0.5514121", "0.5507651", "0.549893", "0.5494874", "0.54944235", "0.5493766", "0.54932916", "0.5486227", "0.54823697", "0.5476274", "0.546013", "0.54567826", "0.54508066", "0.54465353", "0.54444826", "0.5429", "0.5425183", "0.54231894", "0.54142493", "0.5409264", "0.5408915", "0.54044765", "0.5399259", "0.53861654", "0.5378659", "0.53780735", "0.53779435", "0.535552", "0.53463525", "0.5344873", "0.53438675", "0.53407216", "0.533941", "0.53115284" ]
0.810261
0
setMaxPersediaan set the maxPersediaan variable with value from text input
function setMaxPersediaan() { maxPermintaan = document.getElementById('newMaxPersediaan').value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMaxPermintaan() {\n maxPermintaan = document.getElementById('newMaxPermintaan').value;\n }", "function maxDecimales (){\n inputDecimales.value;\n}", "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "set _max(value) {\n Helper.UpdateInputAttribute(this, \"max\", value);\n }", "set max(value) {\n Helper.UpdateInputAttribute(this, 'max', value);\n }", "function setMaxVeganAndVegetarian() {\n if (Number(inputVegan.value) > Number(inputVegan.max)) {\n inputVegan.value = inputVegan.max;\n } else {\n }\n if (Number(inputVegetarian.value) > Number(inputVegetarian.max)) {\n inputVegetarian.value = inputVegetarian.max;\n } else {\n }\n inputVegan.max = 0;\n inputVegetarian.max = 0;\n inputVegan.max = inputPerson.max - inputVegetarian.value;\n inputVegetarian.max = inputPerson.max - inputVegan.value;\n}", "function getMaximum () {\n if ((document.getElementById('entMax').value)===\"\") {\n return 100;\n }\n else {\n return Number(document.getElementById('entMax').value) }\n }", "set max(value) {\n Helper.UpdateInputAttribute(this, 'maxlength', value);\n }", "function setMax() {\n var cd = curDay();\n var input = document.getElementById('date');\n input.setAttribute(\"max\", this.value);\n input.max = cd;\n input.setAttribute(\"value\", this.value);\n input.value = cd;\n}", "function count_and_redefine_max(e){\n\t try{\n\t // get the input and the maximum length\n\t var input = j( e.currentTarget || e )\n\t \n\t \n\t // cap at the maximum!\n\t //parseInt\n\t \n\t // Reformat the display\n\t if( input.siblings('.limit_input').length > 0 ){\n\t var max_val = input.siblings('.limit_input').text().match( /.*\\/(.*)/ )[1]\n\t input.siblings('.limit_input').text( input.val().length + \"/\" + max_val )\n\t }else{ // in case field has errors, it won't break stuff\n\t var limit_span = input.parent().prevAll('.limit_input:first')\n\t var max_val = limit_span.text().match( /.*\\/(.*)/ )[1]\n\t limit_span.text( input.val().length + \"/\" + max_val )\n\t }\n\t \n\t } catch(e){\n\t // if has no max, keep walking, JW\n\t }\n\t}", "function setMaxDisplay(){\n //document.value returns a string, we need to convert it to a number in order to compare later on if we reached max wining number\n max.textContent = setMax.value;\n winningScore = Number(setMax.value);\n reset();\n}", "maxlength(input, maxValue) {\n\n let inputLength = input.value.length;\n\n let mensagem_error = `O campo precisa ter menos que ${maxValue} caracteres`;\n\n if (inputLength > maxValue) {\n this.imprimirMensagem(input, mensagem_error);\n }\n }", "function setMaxScore( maxScoreValue ) {\n maxScoreInput.value = maxScoreValue;\n maxScoreDisplay.textContent = maxScoreValue.toString();\n}", "function setMaxCustomDie(){\r\n maxCustomDie = inMaxCustomDie.value;\r\n}", "function getMaxFromUser(){\n return $(\"#maxnum\").val();\n }", "set max(mL) {\n if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');\n this[MAX] = mL || Infinity;\n trim(this);\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity;\n trim(this);\n }", "function setElementProgressMax(id, max)\n{\n let target = document.getElementById(id)\n target.max = max;\n let toolTip = target.value + ' / ' + max;\n target.setAttribute('title', toolTip);\n}", "function setLimits() {\n var t, rx = /\\d+(\\.\\d+)?/g,\n s, d, res = {s:6, d:6},\n config = Celestial.settings();\n\n d = config.dsos.data;\n \n //test dso limit\n t = d.match(rx);\n if (t !== null) {\n res.d = parseFloat(t[t.length-1]);\n }\n\n if (res.d !== 6) {\n $form(\"dsos-limit\").max = res.d;\n $form(\"dsos-nameLimit\").max = res.d;\n }\n \n s = config.stars.data;\n \n //test star limit\n t = s.match(rx);\n if (t !== null) {\n res.s = parseFloat(t[t.length-1]);\n }\n\n if (res.s != 6) {\n $form(\"stars-limit\").max = res.s;\n $form(\"stars-designationLimit\").max = res.s;\n $form(\"stars-propernameLimit\").max = res.s;\n }\n\n return res;\n}", "function setMax(maxID) {\n MAX_ID = maxID;\n}", "maxlength(input, maxValue){\n let inputLenght = input.value.length;\n let errorMessage = `O campo não pode ter mais de ${maxValue} caracteres`\n if(inputLenght > maxValue){\n this.printMessage(input, errorMessage)\n }\n }", "function setMaxNumber() {\r\n var level = getLevel();\r\n switch (level) {\r\n case ('1'):\r\n gMaxNumber = 10;\r\n break;\r\n case ('2'):\r\n gMaxNumber = 20;\r\n break;\r\n case ('3'):\r\n gMaxNumber = 10;\r\n break;\r\n default:\r\n window.location = '../index.html';\r\n break;\r\n }\r\n}", "setMax(max) {\n self.datePicker.max = new Date(max);\n }", "function getInputMax(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"maxes>data\");\r\n\tif (result == null || result.text() == null) {return -100;}\r\n\telse return parseFloat(extract(result.text()));\r\n}", "set maxIndex(_val) {\n (typeof _val === \"number\") && this.setAttribute(\"max\", _val);\n }", "set max (mL) {\n\t if (typeof mL !== 'number' || mL < 0)\n\t throw new TypeError('max must be a non-negative number')\n\n\t this[MAX] = mL || Infinity;\n\t trim(this);\n\t }", "function maxLenght(){\n $('.max').maxlength({\n alwaysShow: true,\n warningClass: \"badge badge-success\",\n limitReachedClass: \"badge badge-danger\"\n });\n}", "function validaMaximo(elemento, numMax) {\n var numTxt = elemento.val().length; // Número de caracteres actuales en el input\n var numero_maximo = numMax - 1;\n\n if (numTxt > numero_maximo) {\n return false;\n } else {\n return true;\n }\n}", "maxlength(input, maxValue) {\n \n let inputLength = input.value.length\n\n let errorMessage = `O campo precisa ter menos que ${maxValue} caracteres`\n\n if(inputLength > maxValue) {\n this.printMessage(input, errorMessage)\n }\n\n }", "function fgetMaxValue(){\r\n\treturn 100;\r\n}", "function max(txarea,tot){ \n if (tot==\"\"){ var total = 255; } else { var total=tot; }\n var tam = txarea.value.length; \n var str=\"\"; \n var str=str+tam; \n //Digitado.innerHTML = str; \n Restante.innerHTML = total - str; \n if (tam > total){ \n aux = txarea.value; \n txarea.value = aux.substring(0,total); \n //Digitado.innerHTML = total \n Restante.innerHTML = 0 \n } \n}", "setValueDiffMax (valueDiffMax) {\n this._valueDiffMax = valueDiffMax\n }", "function setMaxValueOnJumpControl(search_paging_info){\n var maxPg;\n console.log(\"search paging info\");\n if (search_paging_info.max_page_available < \n search_paging_info.total_page_count){\n maxPg = search_paging_info.max_page_available;\n }else{\n maxPg = search_paging_info.total_page_count;\n }\n $(\"#user-page-number\").attr('max',maxPg );\n $(\"#max_pg_available\").text(maxPg);\n}", "maxlength(input, maxValue) {\n\n let inputLength = input.value.length;\n let errorMessage = `*O campo precisa ter menos que ${maxValue} caracteres`;\n\n if (inputLength > maxValue) {\n this.printMessage(input, errorMessage);\n\n }\n }", "function setMinPersediaan(params) {\n minPersediaan = document.getElementById('newMinPersediaan').value;\n }", "function findMax(){\n let maxVal = max(parseInt(document.getElementById(\"max1\").value), parseInt(document.getElementById(\"max2\").value));\n document.getElementById(\"resultMax\").innerHTML = maxVal;\n}", "function codificaTexto(){\n const texto = document.getElementById(\"InputTextoPlano\");\n const textoPlano = texto.value;\n const input = document.getElementById(\"InputN\");\n const value = Number(input.value);\n if(value <= 0 || value >= limit){\n alert(\"Debes ingresar n mayor que cero y menor que \"+limit)\n }else{\n //console.log(value)\n const res = codifica(String(textoPlano),value)\n resultado.value = res;\n }\n}", "function limitarCaracteres(campo, tamanhoMax)\r\n{\r\n if (campo.value.length > tamanhoMax)\r\n {\r\n campo.value = campo.value.substring(0, tamanhoMax);\r\n }\r\n}", "function salidaUno(ins){\n var tabla = $(ins).parent().parent();\n $(\"#idExiSal\").val(tabla.find(\"td\").eq(0).text()) ;\n $(\"#nomInsSal\").val(tabla.find(\"td\").eq(3).text());\n $(\"#coloInsSal\").val(tabla.find(\"td\").eq(4).text());\n $(\"#medInsSal\").val(tabla.find(\"td\").eq(5).text());\n $(\"#cantAct\").val(tabla.find(\"td\").eq(6).text());\n\n\n $(\"#cantSal\").attr(\"max\", tabla.find(\"td\").eq(6).text());\n $(\"#cantSal\").val(tabla.find(\"td\").eq(6).text());\n}", "function charactLimit(){\n\tbtn.disabled= false;\n\n\tvar tweet = document.getElementById(\"tweet\").value; // aca se almacena valor de cada tweet//\n\tvar parrafo = document.getElementById(\"inp\");// var define el contador//\n\tvar max = 140; // define cantidad max de caracteres.//\n\tparrafo.innerHTML= max-tweet.length; //Modificar el contador para que a 140 se le reste el largo del tweet\n}", "setValueMax_by_ValueMaxObject( valueMax ) {\n this.htmlProgress.value = valueMax.valuePercentage;\n this.htmlProgress.max = valueMax.maxPercentage;\n }", "setMaxLength(value, type) {\n if (value.length < SETTINGS.textLength[type]) return value\n return value.substring(0, SETTINGS.textLength[type] - 1) + '...'\n }", "function getMaxTrailResults() {\n var userIn = formMaxTrailResults.val();\n if (userIn === \"\" || userIn === undefined) {\n sessionStorage.setItem(\"maxTrailResults\", defaultMaxTrailResults);\n } else {\n userIn = parseInt(userIn);\n if (userIn < 0) {\n invalidInput(\n formMaxTrailResults,\n \"Invalid Input: Min Trail Length cannot be less than 0\"\n );\n } else if (userIn > maxValueMaxTrailResults) {\n console.log(\n \"Warning: Max Trail Results exceeded limit, set to max of \" +\n maxValueMaxTrailResults\n );\n sessionStorage.setItem(\"maxTrailResults\", maxValueMaxTrailResults);\n } else {\n sessionStorage.setItem(\"maxTrailResults\", userIn);\n }\n }\n}", "function validaDesbordamientoAbono (e, field, totalPagos, max_value)\n{ var maximo=0;\n if(max_value>totalPagos)\n { maximo=parseFloat(totalPagos);\n }\n else\n { maximo=parseFloat(max_value);\n }\n //var valor = field.value;\n var valor_actual = field.value+String.fromCharCode(e.which);\n var valor_actual_real = parseFloat(valor_actual)*10;\n if( parseFloat(valor_actual_real) > parseFloat( maximo ) )\n { $.growl.error({ title: \"Educalinks informa\", message: \"Valor excedido, ingreso un monto menor o igual a la deuda\" });\n field.value='';\n return false;\n }\n}", "function maxValidator(max) {\n return control => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n\n const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n\n return !isNaN(value) && value > max ? {\n 'max': {\n 'max': max,\n 'actual': control.value\n }\n } : null;\n };\n}", "limitInputTo(inp, limit) {\r\n inp.addEventListener(\"input\", () => {\r\n let inputVal = inp.value;\r\n inp.value = inputVal > limit ? limit : inputVal;\r\n }) \r\n }", "function rpManualEntry() {\n document.getElementById('reward-points-spent').oninput = function () {\n let max = parseFloat(this.max);\n if (this.value > max) {\n this.value = max;\n }\n }\n $('#reward-points-spent').on('change', function(){ document.getElementById('rp-payment').click();});\n}", "function textCounter( field, maxlimit )\r\n{\r\n if ( field.value.length > maxlimit )\r\n {\r\n field.value = field.value.substring( 0, maxlimit );\r\n alert( 'Textarea value can only be '+ maxlimit + ' characters in length.' );\r\n\r\n }\r\n }", "function maxNumLength() {\r\n\t$('input').on('keyup', function () {\r\n\t\tvar max = $(this).attr('maxlength'),\r\n\t\tval = $(this).val(),\r\n\t\ttrimmed;\r\n\t\tif (max && val) {\r\n\t\ttrimmed = val.substr(0, max);\r\n\t\t$(this).val(trimmed);\r\n\t\t}\r\n\t});\r\n\t}", "function inputStringMax (type, elementname, max) {\n var element = type + '[name=\"' + elementname + '\"]'\n var value = $(element).val()\n if (value.length > max) {\n inputwarning(element)\n return true\n } else {\n resetinput(element)\n return false\n }\n }", "function getMax() {\n var max = Math.max.apply(null, config.values);\n max += 10 - max % 10;\n return max;\n console.log(max);\n }", "function limitMaxText(limitField, limitNum) {\n if (limitField.value.length > limitNum) {\n limitField.value = limitField.value.substring(0, limitNum);\n }\n}", "function resetMinMax() {\n minPermintaan = 1000;\n maxPermintaan = 5000;\n minPersediaan = 100;\n maxPersediaan = 600;\n }", "get max() {\n return this.args.max || null;\n }", "function validaMaximo(elemento, numMax) {\n var numTxt = elemento.value.length; // Número de caracteres actuales en el textarea\n var numero_maximo = numMax - 1;\n\n if (numTxt > numero_maximo) {\n return false;\n } else {\n return true;\n }\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function maxValidator(max) {\n return (control) => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;\n };\n}", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "set maxHeight(value) {}", "function maxBasalLookup() {\n \n profile.max_basal =pumpsettings_data.maxBasal;\n}", "function getSystemMaxNumber() {\r\n\tvar t = document.getElementById('system_input').getAttribute('onkeyup').match(/\\d+/g);\r\n\r\n\treturn parseInt(t[1], 0);\r\n}", "function increaseMaxColorRange(amount){\n $('#maxPal').val( eval(parseFloat($('#maxPal').val()).toPrecision(4)) + parseFloat(amount));\n UpdatePalette(mappalette);\n}", "function parseLimit(str, max) {\n let limit = parseInt(str, 10);\n if (isNaN(limit) || limit > max || limit < 0) {\n limit = max;\n }\n return limit;\n}", "function setValue(html,id){\n customval = $(html).attr('name');\n val = $(html).val();\n var Int = '';\n // $('#'+id).val(val);\n if(val){\n var string = val.match(/[a-z]+|\\d+/ig);\n if(string.length == 1 ){\n if(isNaN(parseInt(string[0]))){\n Int = ((id == 'Plotbudget_min')) ? '1000000' : '200000000' ;\n }else{\n Int = string[0];\n }\n }\n else{\n if(string[1] == 'K' || string[1] == 'k') {;\n string[0] += '000'\n } else if(string[1] == 'L' || string[1] == 'l') {\n string[0] += '00000'\n } else if(string[1] == 'Cr' || string[1] == 'cr') {\n string[0] += '0000000'\n }\n Int = (isNaN(parseInt(string[0]))) ? '200000000' : string[0] ;\n }\n $('input[name='+ customval+']').val(currencyFormat(Int));\n $('#'+id).val(Int);\n }\n \n\n \n\n HideMax(html, Int)\n}", "max(max) {\n this.checkSearchType();\n if (!this.options.block) {\n this.options.block = {};\n }\n this.options.block.max = max;\n return this;\n }", "function setMinPermintaan () {\n minPermintaan = document.getElementById('newMinPermintaan').value;\n }", "getMax() {\n \n }", "get max() {\r\n return this._max\r\n }", "function textCounter(field, maxlimit) \n {\n var objField = eval(\"document.designateDEForm.\" + field);\n if (objField.value.length > maxlimit) // if too long...trim it!\n objField.value = objField.value.substring(0, maxlimit);\n }", "function getMagicMax() {\n\tvar spell = $(\"#spell option:selected\").text();\n\tif (spell.indexOf(\"Casted Spells\")) {\n\t\t$(\"#spellMax\").val(parseInt(spell.match(/([\\d]+)/)));\n\t}\n\t\n\tvar visible = parseInt($(\"#baseMagic\").val());\n\tvar potMagic = $(\"#potMagic option:selected\").text();\n\n\tif (potMagic.indexOf(\"No Potion\")) {\n\t\tvisible = calculateVisible(visible, potMagic);\n\t}\n\t\n\tvar a = $(\"#spell option:selected\").text();\n\tif (!a.indexOf(\"Magic dart\")) {\n\t\t$(\"#spellMax\").val(10 + Math.floor(visible / 10));\n\t}\n\n\tvar b = $(\"#wepSpell option:selected\").text();\n\tif (!b.indexOf(\"Trident\")) {\n\t\t$(\"#spellMax\").val(Math.floor(visible / 3) - 5);\n\t}\n\telse if (!b.indexOf(\"Swamp Trident\")) {\n\t\t$(\"#spellMax\").val(Math.floor(visible / 3) - 2);\n\t}\n\telse if (!b.indexOf(\"Black Salamander\")) {\n\t\t$(\"#spellMax\").val(Math.floor(0.5 + visible * (156/640)));\n\t}\n\t\n\tvar str = $(\"#total\").find(\".m\").val();\n\tvar bonus = 1 + (parseInt(str) / 100 || 0);\n\tvar hit = Math.floor($(\"#spellMax\").val() * bonus);\n\t\n\tif($(\"#checkSalve\").is(':checked')) {\n\t\thit = Math.floor(hit * 1.2);\n\t}\n\telse if($(\"#checkSlay\").is(':checked')) {\n\t\thit = Math.floor(hit * 1.15);\n\t}\n\t\n\treturn hit;\n}", "get maxValue() {\n return this.options.maxValue || null;\n }", "function setmaxNumberOfQuestions() { \n maxNumberOfQuestions = 60;\n}", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "function limit(){\n\tvar monthLength=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\tif ((year % 4 == 0) && !(year % 100 == 0)|| (year % 400 == 0)){ //checks feb for leap year\n\t\tmonthLength[2]=29;\n\t}\n\tvar cmonth=document.getElementById(\"month\").value; //cmonth= chosen month\n\tvar maxday=monthLength[cmonth-1];\n\tvar cday=document.getElementById(\"day\");\n\tcday.max=maxday;\n}", "function updateMinMaxFromJson(minMaxTxt){\n\towgis.interf.loadingatmap(false);\n\n var jsonMinMax = eval(\"(\"+minMaxTxt+\")\");\n $('#minPal').val(parseFloat(jsonMinMax[\"min\"]).toPrecision(4)); \n $('#maxPal').val(parseFloat(jsonMinMax[\"max\"]).toPrecision(4));\n UpdatePalette(mappalette);\n}", "function h_calculateMaxSell()\n{\t\n\tif(choosenDrug == \"Acid\")\n\t{\n\t\t// check what we have\n\t\tmaxPossibleSell = currentDrugs.acid\n\t\t\n\t\t$('#maxSell').html(\"(max: \"+maxPossibleSell+\")\");\t\t\t// update UI\n\t\t\n\t\t\n\t\tif(maxPossibleSell == 0)\n\t\t{\n\t\t\tdocument.getElementById(\"s_acid_tick\").disabled = true;\n\t\t}\n\t}\n\t\n\tif(choosenDrug == \"Coke\")\n\t{\n\t\t// check what we have\n\t\tmaxPossibleSell = currentDrugs.coke\n\t\t\n\t\t$('#maxSell').html(\"(max: \"+maxPossibleSell+\")\");\t\t\t// update UI\n\t\t\n\t\tif(maxPossibleSell == 0)\n\t\t{\n\t\t\tdocument.getElementById(\"s_coke_tick\").disabled = true;\n\t\t}\n\t}\n\t\n\t// insert max value into text field\n\t$('#sellDrugs').val(maxPossibleSell);\n}", "function validaMaximo(numero){ \n if (!/^([0-9])*$/.test(numero)||(numero === \"\")){\n alert(\"[ERROR] Stock Maximo invalido\");\n document.getElementById(\"maximo\").value= \"0\"; \n document.getElementById(\"maximo\").focus();\n }\n }", "validate() {\n if (this.maxLimit !== undefined && this.value > this.maxLimit)\n this._value = this.maxLimit;\n else if (this.minLimit !== undefined && this.value < this.minLimit)\n this._value = this.minLimit;\n }", "function maxVal(value, row){\n\n\n var max = options.scale.ticks.max;\n if ( value > max ){\n value = max;\n jQuery(row).find('.data-value').val(value);\n }\n return value;\n}" ]
[ "0.8009443", "0.7632048", "0.754425", "0.72252905", "0.7180746", "0.7062205", "0.6993835", "0.6927285", "0.6903482", "0.6804582", "0.6711847", "0.66559166", "0.65869105", "0.6552504", "0.65364695", "0.6512207", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.65094644", "0.6502311", "0.650149", "0.6473683", "0.6473408", "0.64370483", "0.6422681", "0.6405956", "0.6394922", "0.63733846", "0.6364246", "0.6358141", "0.6357183", "0.6330468", "0.63284326", "0.63204795", "0.63141406", "0.6303517", "0.6283814", "0.62552434", "0.6251818", "0.6222068", "0.6217429", "0.62102073", "0.6205028", "0.6199992", "0.61742324", "0.6122017", "0.61162937", "0.61125153", "0.609559", "0.60841143", "0.6072574", "0.6048495", "0.6048288", "0.6044979", "0.60370517", "0.60241526", "0.6023268", "0.60228616", "0.6015413", "0.6015413", "0.6015413", "0.60105574", "0.6007873", "0.5998134", "0.59931546", "0.5979948", "0.5948262", "0.5942711", "0.593849", "0.5921686", "0.5908014", "0.59075916", "0.59066665", "0.5906234", "0.5898466", "0.5893013", "0.5891505", "0.5891505", "0.5891505", "0.5891505", "0.5891505", "0.5891505", "0.58785874", "0.5870337", "0.5869029", "0.5866713", "0.58647317", "0.5863958" ]
0.81307983
0
set the min and max variables to it's initial value
function resetMinMax() { minPermintaan = 1000; maxPermintaan = 5000; minPersediaan = 100; maxPersediaan = 600; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueField.value);\n}", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "function setRangeValue(min, max) {\n minNumRange.value = min;\n maxNumRange.value = max;\n}", "function changeMaxAndMin(minRange, maxRange) {\n var minStorage = document.querySelector('#post-min-range');\n var maxStorage = document.querySelector('#post-max-range');\n if (minRange > 10) {\n minRange = minRange - 10;\n minStorage.innerText = minRange;\n maxRange = maxRange + 10;\n maxStorage.innerText = maxRange;\n } else {\n minStorage.innerText = minRange;\n maxRange = maxRange + 10;\n maxStorage.innerText = maxRange;\n }\n}", "function setMinAndMaxRange(e) {\n e.preventDefault();\n var minRangeValue = parseInt(minRangeInput.value);\n var maxRangeValue = parseInt(maxRangeInput.value);\n minNumber.innerText = minRangeValue;\n maxNumber.innerText = maxRangeValue;\n minNumber.style.fontWeight = 'bold';\n maxNumber.style.fontWeight = 'bold';\n console.log(minRangeValue);\n console.log(maxRangeValue);\n generateRandomNumber(minRangeValue, maxRangeValue);\n displayRangeError();\n}", "_minOrMaxChanged() {\n // var min, max;\n //check that min is less than max\n if(this.min === this.max) {\n this.set('_minMaxValid', 0);\n console.warn(\"Improper configuration: min and max are the same. Increasing max by step size.\");\n this.set('max', this.min + this.step);\n return;\n }\n\n if(this.min > this.max) {\n this.set('_minMaxValid', 0);\n console.warn(\"Improper configuration: min and max are reversed. Swapping them.\");\n var temp = this.min;\n this.set('min', this.max);\n this.set('max', temp);\n return;\n }\n this.setAttribute('aria-valuemin', this.min);\n this.setAttribute('aria-valuemax', this.max);\n\n // validation passes: trigger set domain\n // apparently, it is possible to run this before polymer property defaults can be applied, so check that _minMaxValid is defined\n this.set('_minMaxValid', (this._minMaxValid || 0) + 1);\n }", "function setRange(min, max) {\n if(min > max) {\n alert(\"Please enter the lowest number in the left field\");\n } else {\n minNum = min;\n maxNum = max;\n }\n}", "limits() {\n var keys = Object.keys(this.data);\n var min = parseInt(this.data[keys[0]]); // ignoring case of empty list for conciseness\n var max = parseInt(this.data[keys[0]]);\n var i;\n for (i = 1; i < keys.length; i++) {\n var value = parseInt(this.data[keys[i]]);\n if (value < min) min = value;\n if (value > max) max = value;\n }\n this.yMin =min - Math.round(min/4);\n if(this.yMin <= 0)\n this.yMin=0;\n this.yMax = max + Math.round(max/4);\n\n }", "setGlobalMinMax(min, max) {\n\n API.LMSSetValue(\"cmi.core.score.min\", String(min));\n API.LMSSetValue(\"cmi.core.score.max\", String(max));\n }", "function increaseMinMax() {\n min -= 10;\n max += 10;\n }", "validate() {\n if (this.maxLimit !== undefined && this.value > this.maxLimit)\n this._value = this.maxLimit;\n else if (this.minLimit !== undefined && this.value < this.minLimit)\n this._value = this.minLimit;\n }", "reset_extents(min, max) {\n const ds = this.jdiv.find('#time-slider')\n const vals = ds.dragslider('values')\n ds.dragslider('option', 'min', min)\n ds.dragslider('option', 'max', max)\n ds.dragslider('values', vals) // Restore values after setting min/max to fix slider location bug\n\n this.llabel.html(numberWithCommas(min))\n this.rlabel.html(numberWithCommas(max))\n }", "_setValueDiff () {\n this._valueDiffMax = Math.max(this.valueDiffMax, 0)\n this._valueDiffMin = Math.max(this.valueDiffMin, 0)\n }", "function setN1Range() {\n minValue1 = Number(document.getElementById('low1').value);\n maxValue1 = Number(document.getElementById('high1').value);\n}", "function xrangeset(min,max) {\n // Force the slider thumbs to adjust to the appropriate place\n $(\"#slider-range\").slider(\"option\", \"values\", [min,max]);\n }", "function setRange () {\n event.preventDefault();\n\n minInputValue = document.getElementById( 'minInput' ).value;\n maxInputValue = document.getElementById( 'maxInput' ).value;\n\n minInput = parseInt( minInputValue );\n maxInput = parseInt( maxInputValue );\n\n solution = generateRandomNumber( minInput, maxInput );\n}", "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n mines = parseInt(maxMines);\n }\n}", "function initialValues() {\n document.querySelector(\"#rangeRed\").value = 0;\n document.querySelector(\"#rangeGreen\").value = 0;\n document.querySelector(\"#rangeBlue\").value = 0;\n document.querySelector(\"#rangeHue\").value = 0;\n document.querySelector(\"#rangeSaturation\").value = 0;\n document.querySelector(\"#rangeLightness\").value = 0;\n}", "function setRange(wonNewMin, wonNewMax) {\n var newMinRange;\n var newMaxRange;\n\n // if parameters are undefined, we know we're using the basic set range feature\n // else we know the range was updated via a win\n\n if (typeof wonNewMin === 'undefined' || typeof wonNewMax === 'undefined') {\n newMinRange = txtMin.value;\n newMaxRange = txtMax.value;\n } else {\n newMinRange = wonNewMin - 10;\n newMaxRange = wonNewMax + 10;\n }\n\n //since isNaN(null) returns false, we check vanilla isNaN but also after trying to parse to int.\n //Just parsing to int doesn't work because 123abc parses to an integer\n if (isNaN(parseInt(newMinRange)) || isNaN(parseInt(newMaxRange)) || isNaN(newMinRange) || isNaN(newMaxRange)) {\n lblRangeValidator.innerHTML = \"Please enter a valid number\";\n } else if (parseInt(newMinRange) >= parseInt(newMaxRange)) {\n lblRangeValidator.innerHTML = \"Min Range must be less than Max Range\";\n } else {\n lblRangeValidator.innerHTML = \"&nbsp;\"\n\n // setting the range essentially resets the game, but then we need to set the range to custom values\n resetForm();\n lblLastGuess.innerText = newMinRange + \" to \" + newMaxRange;\n lblRangeStatement.innerText = \"Current Range: \" + newMinRange + \" to \" + newMaxRange\n currRandomNumber = genRandomNumber(parseInt(newMinRange), parseInt(newMaxRange));\n\n // resetting the form would normally disable the reset button. we want it enabled as the new range could be reset\n btnReset.disabled = false;\n //FOR DEBUGGING\n dbgRandom.innerText = \"| curr answer: \" + currRandomNumber.toString();\n }\n}", "function set_limits(){\n\t\t\t//max and min container movements\n\t\t\tvar max_move = $wrap.offset().top + $wrap.height() - $sidebar.height();\n\t\t\tvar min_move = $wrap.offset().top;\n\t\t\t//save them\n\t\t\t$sidebar.attr(\"data-min\", min_move).attr(\"data-max\",max_move);\n\t\t\t//window thresholds so the movement isn't called when its not needed!\n\t\t\t//you may wish to adjust the freshhold offset\n\t\t\twindow_min = min_move - threshold_offset;\n\t\t\twindow_max = max_move + threshold_offset;\n\t\t}", "function initInputValues() {\n hideMsgErr();\n $timeout(function () {\n ctrl.minMaxModel.minModel = '' + lastValues.input.min;\n ctrl.minMaxModel.maxModel = '' + lastValues.input.max;\n });\n\n //filterToApply = [lastValues.input.min, lastValues.input.max];\n }", "setRange(min, max) {\n self.datePicker.min = new Date(min);\n self.datePicker.max = new Date(max);\n }", "function setMinMaxYear() {\n year.min = Math.max(Math.max(Math.max(entityYearMin[guiAxes.X], entityYearMin[guiAxes.Y]), entityYearMin[guiAxes.COLOR]), entityYearMin[guiAxes.SIZE]);\n year.max = Math.min(Math.min(Math.min(entityYearMax[guiAxes.X], entityYearMax[guiAxes.Y]), entityYearMax[guiAxes.COLOR]), entityYearMax[guiAxes.SIZE]);\n}", "function setMinMaxValue(id, value) {\n\n var minId = jnid(id, 'min'),\n maxId = jnid(id, 'max'),\n min = storage.get(minId),\n max = storage.get(maxId)\n\n if (min == null || value < min) {\n setValue(minId, value)\n }\n\n if (max == null || value > max) {\n setValue(maxId, value)\n }\n }", "function initRange() {\n\tvar unit = getDepthUnitStorage();\n\tif (unit == 0)\n\t\tcurrentRangeValues = rangeMeter;\n\telse if (unit == 1)\n\t\tcurrentRangeValues = rangeFeet;\n\telse if (unit == 2)\n\t\tcurrentRangeValues = rangeFathoms;\n}", "function onUpdateMin()\n\t{\n\t\t// store current min \n\t\tvar pxmin = xslider.min;\n\t\tvar pymin = yslider.min;\n\n\t\t// store current values\n\t\tvar xcurr = xslider.value;\n\t\tvar ycurr = yslider.value;\n\n\t\t// set new min. slider will internally try to update current value to ensure it's within its range. e.g. if curr = 20, new min = 25, curr = 25\n\t\t// this is why we store original values before we do this. we use original values to calculate new values\n\t\txslider.min = w - (yslider.hide? 0 : t);\n\t\tyslider.min = h - (xslider.hide? 0 : t);\n\n\t\t// calculate the change in min and use it to update current values. e.g. old.min = 20, old.val = 24, new.min = 15, new.val = 19\n\t\t// we always keep the delta between min and value. if value end up >max, slider will handle it.\n\t\txcurr -= (pxmin - xslider.min);\n\t\tycurr -= (pymin - yslider.min);\n\n\t\t// finally, update values\n\t\txslider.value = xcurr;\n\t\tyslider.value = ycurr;\n\t}", "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n };\r\n }", "function setMinMaxResize() {\n opts['resizeMax'] = opts.max.substr(-1) === '%' ? ((win.parseInt(opts['max']) / 100) * opts.containerSize) : win.parseInt(opts['max']);\n opts['resizeMin'] = opts.min.substr(-1) === '%' ? ((win.parseInt(opts['min']) / 100) * opts.containerSize) : win.parseInt(opts['min']);\n\n var diff = parentContainerDiff();\n if (opts['panel-before'].prev().length > 0 && diff > 0) {\n opts.resizeMax += diff;\n opts.resizeMin += diff;\n }\n }", "function fixup({ min: maybeMin, max: maybeMax, value: unclampedValue, ...etc }) {\n const min = Math.min(maybeMin, maybeMax);\n const max = Math.max(maybeMin, maybeMax);\n const value = Math.min(max, Math.max(min, unclampedValue));\n\n return { min, max, value, ...etc };\n}", "function updateMinMax(min, max, coord) {\n if( min[0] < coord[0] ) min[0] = coord[0];\n if( min[1] > coord[1] ) min[1] = coord[1];\n\n if( max[0] > coord[0] ) max[0] = coord[0];\n if( max[1] < coord[1] ) max[1] = coord[1];\n}", "function Range() {\n\tthis._value = 0;\n\tthis._minimum = 0;\n\tthis._maximum = 100;\n\tthis._extent = 0;\n\t\n\tthis._isChanging = false;\n}", "function alterGamerRange(min, max) {\n if (min >= 10) {\n min -= 10;\n } else if (min < 10) {\n min = 0;\n }\n max += 10;\n }", "function setN2Range() {\n minValue2 = Number(document.getElementById('low2').value);\n maxValue2 = Number(document.getElementById('high2').value);\n}", "function setRubricMinScoreAgainstMax(max) {\r\n var min = viewModel.assessment.rubricMinScore;\r\n if (min > max) {\r\n viewModel.set('assessment.rubricMinScore', max);\r\n }\r\n }", "function setSpeedVariance(max, min) {\n speedRand = max - min;\n speedConst = min;\n}", "constructor (minElement, maxElement) {\n\t\tthis.minElement = minElement;\n\t\tthis.maxElement = maxElement;\n\t}", "function NumericRange(min, max) {\n if (max === void 0) { max = null; }\n if (typeof min == \"number\" && (!isNullOrUndefined(max))) {\n this.min = min;\n this.max = max;\n }\n else {\n var range = min;\n this.min = range.min;\n this.max = range.max;\n }\n }", "function initValues() {\n isRunning = false;\n\n repsInput.min = 5;\n workoutInput.min = 5;\n restInput.min = 5;\n setsInput.min = 1;\n\n repsInput.max = 25;\n workoutInput.max = 60;\n restInput.max = 30;\n setsInput.max = 10;\n\n repsInput.value = 0;\n workoutInput.value = 0;\n restInput.value = 0;\n setsInput.value = 0;\n\n repsSpan.innerHTML = repsInput.value;\n workoutSpan.innerHTML = workoutInput.value;\n restSpan.innerHTML = restInput.value;\n setsSpan.innerHTML = setsInput.value;\n\n timerArea.innerHTML = \"0\";\n setdone1Area.innerHTML = '0';\n setneed1Area.innerHTML = \"0\";\n}", "setValueDiffMin (valueDiffMin) {\n this._valueDiffMin = valueDiffMin\n }", "function setCoordLimitsM(limits) {\n x_min = limits[0];\n x_max = limits[1];\n y_min = limits[2];\n y_max = limits[3];\n }", "setValueRange(_value, _minValue, _maxValue) {\n this.minValue = _minValue;\n this.maxValue = _maxValue;\n if (this.isNumber(_value)) {\n _value = (_value < _minValue) ? _minValue : _value;\n _value = (_value > _maxValue) ? _maxValue : _value;\n this.setValue(_value);\n }\n return this;\n }", "function changeSlider() {\n var minInput = document.getElementById(\"min_price\");\n var maxInput = document.getElementById(\"max_price\");\n if(minInput.value < Number(minInput.getAttribute(\"min\"))) {\n console.log(minInput.value, minInput.getAttribute(\"min\"));\n minInput.value = minInput.getAttribute(\"min\");\n }\n else if(minInput.value >= Number(maxInput.getAttribute(\"max\"))) {\n minInput.value = Number(maxInput.getAttribute(\"max\")) - 1;\n }\n else {\n maxInput.setAttribute(\"min\", minInput.value);\n }\n if(maxInput.value > Number(maxInput.getAttribute(\"max\"))) {\n console.log(maxInput.value, maxInput.getAttribute(\"max\"));\n maxInput.value = maxInput.getAttribute(\"max\");\n }\n else if(maxInput.value <= Number(maxInput.getAttribute(\"min\"))) {\n maxInput.value = Number(maxInput.getAttribute(\"min\")) + 1;\n }\n else {\n maxInput.setAttribute(\"min\", minInput.value);\n }\n}", "_validateMinMax(which, referenceValue) {\n const that = this;\n let minChanged = false;\n\n if (which !== 'max') {\n that.min = JQX.Utilities.DateTime.validateDate(that.min, referenceValue || new JQX.Utilities.DateTime(1600, 1, 1), that.formatString);\n that.min = that.min.toTimeZone(that._outputTimeZone);\n minChanged = true;\n }\n\n if (which !== 'min') {\n that.max = JQX.Utilities.DateTime.validateDate(that.max, referenceValue || new JQX.Utilities.DateTime(3001, 1, 1), that.formatString);\n that.max = that.max.toTimeZone(that._outputTimeZone);\n\n that.max.calendar.days = that._localizedDays;\n that.max.calendar.months = that._localizedMonths;\n that.max.calendar.locale = that.locale;\n\n that.$.calendarDropDown.max = that.max.toDate();\n }\n\n if (that.min.compare(that.max) > 0) {\n that.min = that.max.clone();\n minChanged = true;\n }\n\n if (minChanged) {\n that.min.calendar.days = that._localizedDays;\n that.min.calendar.months = that._localizedMonths;\n that.min.calendar.locale = that.locale;\n\n that.$.calendarDropDown.min = that.min.toDate();\n }\n }", "function bound(value, opt_min, opt_max) {\n if (opt_min != null) value = Math.max(value, opt_min);\n if (opt_max != null) value = Math.min(value, opt_max);\n return value;\n}", "function bound(value, opt_min, opt_max) {\n if (opt_min != null) value = Math.max(value, opt_min);\n if (opt_max != null) value = Math.min(value, opt_max);\n return value;\n}", "function getDefaultValue(min, max) {\n return max < min ? min : min + (max - min) / 2;\n}", "setMinMaxYear(minYear, maxYear)\n {\n // Integrity check: really an integer?\n if ((!this._main.modules.helpers.checkIfInt(minYear)) ||\n (!this._main.modules.helpers.checkIfInt(maxYear)) )\n return console.error(\"The given years are not integers\");\n\n // Consistency check: minYear < maxYear?\n if (minYear > maxYear)\n [minYear, maxYear] = swapValues([minYear, maxYear]);\n\n // Set years\n this._minYear = minYear;\n this._maxYear = maxYear;\n\n // Adapt the period dates\n this._clipPeriod();\n\n // Tell everyone\n this._main.hub.onMinMaxYearChange(this._minYear, this._maxYear)\n\n }", "function setMinMax(dataSet) {\r\n $(\".slider.dataYear\").attr({\r\n \"min\": dataSet.minYear,\r\n \"max\": dataSet.maxYear\r\n });\r\n}", "function changeRange() {\n\t\t\t\t// var v = range.max - range.value;\n\t\t\t\tvar v = range.value;\n\t\t\t\tdispatcher.fire('update.scale', v);\n\t\t\t}", "function setDateRange(){\n\t\tviewGridFactory.getDateRange().success(function(data){\n\t\t\t$scope.datemin = data.min;\n\t\t\t$scope.datemax = data.max;\n\t\t});\n\t}", "setupInitialValues() {\n this.__xSpacingInput.value = \"1.0\";\n this.__ySpacingInput.value = \"1.0\";\n\n this.__xDimInput.value = 5;\n this.__yDimInput.value = 1;\n }", "function validateScale()\n{\n var fMin = parseFloat($('scaleMin').value);\n var fMax = parseFloat($('scaleMax').value);\n if (isNaN(fMin))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMin').value = scaleMinVal;\n }\n else if (isNaN(fMax))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMax').value = scaleMaxVal;\n }\n else if (fMin >= fMax)\n {\n alert('Minimum scale value must be less than the maximum');\n // Reset to the old values\n $('scaleMin').value = scaleMinVal;\n $('scaleMax').value = scaleMaxVal;\n }\n else \n {\n $('scaleMin').value = fMin;\n $('scaleMax').value = fMax;\n scaleMinVal = fMin;\n scaleMaxVal = fMax;\n updateMap();\n }\n}", "function validateScale()\n{\n var fMin = parseFloat($('scaleMin').value);\n var fMax = parseFloat($('scaleMax').value);\n if (isNaN(fMin))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMin').value = scaleMinVal;\n }\n else if (isNaN(fMax))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMax').value = scaleMaxVal;\n }\n else if (fMin >= fMax)\n {\n alert('Minimum scale value must be less than the maximum');\n // Reset to the old values\n $('scaleMin').value = scaleMinVal;\n $('scaleMax').value = scaleMaxVal;\n }\n else \n {\n $('scaleMin').value = fMin;\n $('scaleMax').value = fMax;\n scaleMinVal = fMin;\n scaleMaxVal = fMax;\n updateMap();\n }\n}", "function clampValue(item, min, max){\n if (max != null && item.value > max){\n item.value = max;\n }\n else if (min != null && item.value < min){\n item.value = min;\n }\n}", "function _calcMaxMin() {\n\t var i,j,k;\n\t\t\n\t\t_vMaxValuesAttr = d3.range (_vIndexMapAttr.length);\n\t\t_vMinValuesAttr = d3.range (_vIndexMapAttr.length);\n\t\t\n\t\tfor (i=0; i< _vMaxValuesAttr.length; i++) {\n\t\t\t_vMaxValuesAttr[i] = Number.MIN_VALUE;\n\t\t\t_vMinValuesAttr[i] = Number.MAX_VALUE;\n\t\t}\n\n\t\tfor (i=0; i< _data.matrix.length; i++)\t\n\t\t\tfor ( j=0; j< _data.matrix[i].length; j++)\n\t\t\t\tif (_data.matrix[i][j].exist) {\n\t\t\t\t\tfor (k=0; k< _vIndexMapAttr.length; k++) {\n\t\t\t\t\t\tif (_data.matrix[i][j].values[_vIndexMapAttr[k]] > _vMaxValuesAttr[k])\n\t\t\t\t\t\t\t_vMaxValuesAttr[k] = _data.matrix[i][j].values[_vIndexMapAttr[k]];\n\t\t\t\t\t\tif (_data.matrix[i][j].values[_vIndexMapAttr[k]] < _vMinValuesAttr[k])\n\t\t\t\t\t\t\t_vMinValuesAttr[k] = _data.matrix[i][j].values[_vIndexMapAttr[k]];\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t_maxValueAttr = d3.max(_vMaxValuesAttr);\n\t\t_minValueAttr = d3.min(_vMinValuesAttr);\n\t}", "_setRange(range) {\n const min2Scale = this._toPixelScale(range.min);\n const max2Scale = this._toPixelScale(range.max);\n const minBounds = this._toPixelScale(this.props.min);\n const maxBounds = this._toPixelScale(this.props.max);\n if (min2Scale > max2Scale) {\n throw new Error(`Minimum slider value: ${range.min} is greater than max value: ${range.max}`);\n }\n if (min2Scale < minBounds || min2Scale > maxBounds) {\n throw new Error(`Minimum slider value: ${range.min} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n if (max2Scale < minBounds || max2Scale > maxBounds) {\n throw new Error(`Maximum slider value: ${range.max} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n this._range = {\n min: min2Scale || 0,\n max: max2Scale || 0,\n };\n return this._range;\n }", "calculateLimits(){\n let { options } = this\n const { data } = this\n const { variables, xVariable, yVariable } = options\n\n options.xMax = d3.max(data, variables[xVariable].accessor)\n options.xMin = d3.min(data, variables[xVariable].accessor)\n options.yMax = d3.max(data, variables[yVariable].accessor)\n options.yMin = d3.min(data, variables[yVariable].accessor)\n }", "function setMinAndMaxDate() {\n let currentDate=new Date();\n let minDate=currentDate.getFullYear()+'-'+appendLeadingZeroes((currentDate.getMonth()+1))+'-'+appendLeadingZeroes(currentDate.getDate());\n let maxDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate()+15);\n maxDate=maxDate.getFullYear()+'-'+appendLeadingZeroes((maxDate.getMonth()+1))+'-'+appendLeadingZeroes(maxDate.getDate());\n document.getElementById('travelStartDate').setAttribute('min',minDate);\n document.getElementById('travelStartDate').setAttribute('max',maxDate);\n document.getElementById('travelEndDate').setAttribute('min',minDate);\n}", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }", "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "function setDefaults(){\n updateMortalitySlider(0, 250);\n updateIncidenceSlider(0, 1000);\n updateDeathPrecentSlider(0, 0.7);\n\n $('.year-slider').slider('value', 2000)\n $(\".year-rate-slider\").text(2000)\n\n year = 2000\n minMortality = 0\n maxMortality = 250\n minIncidents = 0\n maxIncidents = 1000\n minDeath = 0\n maxDeath = 0.70\n\n countries = []\n\n applyFilter()\n zoomMapToFull()\n}", "set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity;\n trim(this);\n }", "set max(mL) {\n if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');\n this[MAX] = mL || Infinity;\n trim(this);\n }", "function init_timeslider(data){\r\n\t\tconsole.log(\"init_timeslider\");\r\n\t\tvar minDatum = data[0][selectedOptions.dateField];\r\n\t\tvar maxDatum = data[data.length-1][selectedOptions.dateField];\r\n\t\tdocument.getElementById(\"time_slider\").setAttribute(\"max\", data.length-1);\r\n\t}", "_validateInitialPropertyValues() {\n const that = this,\n value = typeof (that.value) === String ? that.value.replace(/\\s/g, '') : that.value.toString().replace(/\\s/g, '');\n\n if (that.mode === 'numeric' && that._numericProcessor.regexScientificNotation.test(value)) {\n that.value = that._numericProcessor.scientificToDecimal(value);\n delete that._valueBeforeCoercion;\n }\n\n //Validates significantDigits\n that.significantDigits = (that.significantDigits !== null) ? Math.min(Math.max(that.significantDigits, 1), 21) : null;\n\n if (that.significantDigits === null && that.precisionDigits === null) {\n that.significantDigits = 8;\n }\n else if (that.significantDigits !== null && that.precisionDigits !== null) {\n that.error(that.localize('significantPrecisionDigits', { elementType: that.nodeName.toLowerCase() }));\n }\n\n //minMax validation\n that._validateMinMax('both', true);\n\n if (that.showTooltip && that.showThumbLabel) {\n that.showTooltip = false;\n }\n }", "set max (mL) {\n\t if (typeof mL !== 'number' || mL < 0)\n\t throw new TypeError('max must be a non-negative number')\n\n\t this[MAX] = mL || Infinity;\n\t trim(this);\n\t }", "function explicitRange(min, max) {\n return tr.b.math.Range.fromExplicitRange(min, max);\n }", "function clamp(val, min, max) {\n /* Random near-zero value used as \"zero\" to prevent two sequential updates from being\n exactly the same (which would cause them to be ignored) */\n if (val > max) {\n val = max - nearZero;\n } else if (val < min) {\n val = min + nearZero;\n }\n return val;\n }", "function changeValue(from, to){\n if(to != null){\n to.val(parseInt(from.val()))\n }\n if(from.val == 0){\n to.val(\"\")\n }\n\n if(from.val() < from.prop('min')){\n from.val(from.prop('min'))\n }\n if(from.val() > from.prop('max')){\n from.val(from.prop('max'))\n }\n}", "function checkMinMaxValues(that){\n //make the values move\n if(that._prvt.currentMax === that._prvt.currentMin){\n //make the items hidden\n that._prvt.maxLabel.hide();\n that._prvt.handleMin.hide();\n }else{\n that._prvt.maxLabel.show();\n that._prvt.handleMin.show();\n }\n }", "setCSSVariables() {\n const rangeInput = this.getRangeInput();\n const { min, max, value } = this;\n rangeInput.style.setProperty('--min', min.toString());\n rangeInput.style.setProperty('--max', max.toString());\n rangeInput.style.setProperty('--val', value.toString());\n }", "function clamp(val, min, max){\n\t return val < min? min : (val > max? max : val);\n\t }", "_validateMinMax(validatedProperty, initialValidation, oldValue) {\n const that = this;\n\n let validateMin = validatedProperty === 'min' || validatedProperty === 'both',\n validateMax = validatedProperty === 'max' || validatedProperty === 'both';\n\n if (typeof (initialValidation) === undefined) {\n initialValidation = false;\n }\n\n if (validatedProperty === 'both') {\n validator('min', oldValue);\n validator('max', oldValue);\n }\n else {\n validator(validatedProperty, oldValue);\n }\n\n function validator(param, oldValue) {\n that._numericProcessor.validateMinMax(param === 'min' || initialValidation, param === 'max' || initialValidation);\n const value = that['_' + param + 'Object'];\n let validateCondition = param === 'min' ? that._numericProcessor.compare(that.max, value, true) <= 0 :\n that._numericProcessor.compare(that.min, value, true) > 0;\n\n if (validateCondition) {\n if (oldValue) {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(oldValue);\n param === 'min' ? validateMin = false : validateMax = false;\n that[param] = oldValue;\n that['_' + param + 'Object'] = oldValue;\n }\n else {\n that.error(that.localize('invalidMinOrMax', { elementType: that.nodeName.toLowerCase(), property: param }));\n }\n }\n else {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(value);\n that[param] = that['_' + param + 'Object'];\n }\n }\n\n if (that.logarithmicScale) {\n that._validateOnLogarithmicScale(validateMin, validateMax, oldValue);\n }\n else {\n that._drawMin = that.min;\n that._drawMax = that.max;\n }\n\n that.min = that.min.toString();\n that.max = that.max.toString();\n\n that._minObject = that._numericProcessor.createDescriptor(that.min);\n that._maxObject = that._numericProcessor.createDescriptor(that.max);\n\n if (that.mode === 'date') {\n that._minDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.min);\n that._maxDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.max);\n }\n\n //Validates the Interval\n that._numericProcessor.validateInterval(that.interval);\n\n if (that.customInterval) {\n that._numericProcessor.validateCustomTicks();\n }\n }", "addDefaultRange() {\n this.addRange(this.defaultMin, this.defaultMax, this.defaultDups);\n }", "function clamp(value, min, max){\n if ( value < min ) return min;\n if ( value > max ) return max;\n return value;\n }", "constructor() {\n this.valS = []\n this.minS = []\n }", "_rangeValidation(initialDate) {\n const that = this;\n\n if (initialDate.compare(that.min) === -1) {\n return that.min.clone();\n }\n else if (initialDate.compare(that.max) === 1) {\n return that.max.clone();\n }\n else {\n return initialDate;\n }\n }", "function minMaxer(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}", "function clampValueBetween(value, min, max) {\n return Math.min(Math.max(value, min), max);\n }", "function calculate_minmax(data) {\n\n bound = [];\n bound.max = Math.max.apply(Math, data);\n bound.min = Math.min.apply(Math, data);\n return bound;\n\n}", "set index(_val) {\n (typeof _val === \"number\") && (this.maxIndex = _val, this.minIndex = _val);\n }", "function passCorrectedValuesToSliderAndGetThem(textBox, isMin){\n newVal = $(textBox).val()\n theSlider = $(textBox).parent().parent().parent().find(\"div > .theSlider\")\n if(newVal){ //make sure the new value exists\n //create the range variables for each of the sliders\n low = (isMin) ? $(theSlider).slider(\"option\", \"min\") : $(theSlider).slider(\"values\", 0)\n high = (isMin) ? $(theSlider).slider(\"values\", 1) : high = $(theSlider).slider(\"option\", \"max\")\n \n //if we are not within range make ourselves within range\n if(newVal < low || high < newVal){\n if(newVal < low) newVal = low\n else newVal = high\n }\n } //set the slider value to its default\n else newVal = $(theSlider).slider(\"option\", (isMin) ? \"min\" : \"max\")\n\n //set the new value of the slider\n $(theSlider).slider(\"values\", (isMin) ? 0 : 1, newVal)\n\n //set the value for the textbox\n return newVal\n }", "function range(input,min,max) {\n\t\tif(min > max) { var x = min; min = max; max = x;}\n\t\treturn Math.max(Math.min(input,max),min);\n\t}", "valueLimit(val, min=0, max=100) {\n return val < min ? min : (val > max ? max : val)\n }", "set _min(value) {\n Helper.UpdateInputAttribute(this, \"min\", value);\n }", "function __WFU_ApplyValidator_Range(object, min, max) {\r\n object[\"range\"] = [min, max];\r\n}" ]
[ "0.7926771", "0.789713", "0.7590515", "0.73252755", "0.730143", "0.7226012", "0.7106195", "0.7015695", "0.70142543", "0.69892055", "0.69873947", "0.69194937", "0.6833583", "0.68163675", "0.6810438", "0.67994595", "0.6763152", "0.6716786", "0.67108697", "0.670427", "0.66776705", "0.663699", "0.659545", "0.65761614", "0.65658957", "0.65621895", "0.65529907", "0.65046376", "0.64950234", "0.64538556", "0.64519787", "0.6439898", "0.6422967", "0.6419288", "0.63884926", "0.6379495", "0.6372303", "0.6370659", "0.63668454", "0.63421315", "0.6327531", "0.63256437", "0.6306565", "0.62699556", "0.62699556", "0.626782", "0.62647516", "0.6258096", "0.6251688", "0.6248544", "0.62354636", "0.62254894", "0.62254894", "0.6224734", "0.62195826", "0.6218038", "0.6204097", "0.6199626", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61891377", "0.61771595", "0.6157005", "0.615381", "0.61524695", "0.61378986", "0.61367655", "0.6128424", "0.61278385", "0.61275285", "0.61273354", "0.6118555", "0.61155266", "0.6114678", "0.6106384", "0.61039567", "0.6101626", "0.610153", "0.60979146", "0.60977846", "0.60919714", "0.6090069", "0.60784245", "0.6073668", "0.6063486", "0.6046688", "0.60462165", "0.60456824" ]
0.7715629
2
Bound Checker: check if the particle/ball is collide with other
function BoundChecker(particle) { this.objectCounter = objectCounter++; this.particle = particle; this.func = this.funcMap[particle.name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collideBroadPhase(other) {\n // By default assume all collisions will be checked.\n return true;\n }", "checkBound(i, current) {\n // get the current velocity with respect to deltaT\n let curVel = multiplyVector(current.vel, deltaT);\n\n // if given object does not react to bounding rectangle or if it is not moving,\n if (!current.bound) {return}\n\n let finalPos = current.pos.add( curVel );\n let curI, horT, verT;\n\n // check if colliding with horizontal (top or bottom side of bounding rectangle)\n if (finalPos.y - current.rad <= this._bound.top || finalPos.y + current.rad >= this._bound.bottom) {\n curI = this._record(i, current);\n horT = this._calculateBoundT(current, curVel, this._bound.horI);\n this._colObjects[curI].addPotential(this._bound.horI, horT);\n }\n\n // check if colliding with vertical (right or left side of bounding rectangle)\n if (finalPos.x - current.rad <= this._bound.left || finalPos.x + current.rad >= this._bound.right) {\n curI = this._record(i, current);\n verT = this._calculateBoundT(current, curVel, this._bound.verI);\n this._colObjects[curI].addPotential(this._bound.verI, verT);\n }\n\n //console.log(current.pos + \" vertical = (\" + verT + \") and horizontal = (\" + horT + \")\");\n }", "collide(other) {\n\t\tlet al = this.x + this.hitbox.x \n\t\tlet au = this.y + this.hitbox.y\n\t\tlet ar = al + this.hitbox.w\n\t\tlet ad = au + this.hitbox.h\n\t\tlet bl = other.x + other.hitbox.x \n\t\tlet bu = other.y + other.hitbox.y\n\t\tlet br = bl + other.hitbox.w\n\t\tlet bd = bu + other.hitbox.h\n\t\treturn ar > bl && al < br && ad > bu && au < bd\n\t}", "function collides(b, p) {\n\tif(b.x + ball.r >= p.x && b.x - ball.r <=p.x + p.w) {\n\t\tif(b.y >= (p.y - p.h) && p.y > 0){\n\t\t\tpaddleHit = 1;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse if(b.y <= p.h && p.y == 0) {\n\t\t\tpaddleHit = 2;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse return false;\n\t}\n}", "function collides(a, b) {\n return (\n a.x < b.x + pipeWidth &&\n a.x + a.width > b.x &&\n a.y < b.y + b.height &&\n a.y + a.height > b.y\n );\n}", "collide(oth) {\n return this.right > oth.left && this.left < oth.right && this.top < oth.bottom && this.bottom > oth.top\n }", "collidesWith(player) {\n //this function returns true if the the rectangles overlap\n // console.log('this.collidesWith')\n const _overlap = (platform, object) => {\n // console.log('_overlap')\n // check that they don't overlap in the x axis\n const objLeftOnPlat = object.left <= platform.right && object.left >= platform.left;\n const objRightOnPlat = object.right <= platform.right && object.right >= platform.left;\n const objBotOnPlatTop = Math.abs(platform.top - object.bottom) === 0;\n \n // console.log(\"OBJECT BOTTOM: \", object.bottom/);\n // console.log(\"PLATFORM TOP: \", platform.top);\n // console.log('objectBotOnPlat: ', !objBotOnPlatTop)\n // console.log('OBJECT RIGHT: ', object.right)\n // console.log('PLATFORM RIGHT: ', platform.right)\n // console.log(\"OBJECT LEFT: \", object.left);\n // console.log(\"PLATFORM LEFT: \", platform.left);\n // console.log('objectLeftOnPlat', !objLeftOnPlat);\n // console.log('objRightOnPlat', !objRightOnPlat);\n\n if (!objLeftOnPlat && !objRightOnPlat) {\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n // if (objBotOnPlatTop) return true;\n // return false;\n }\n \n if (objLeftOnPlat || objRightOnPlat) {\n // debugger\n // console.log('PLATFORM:::::', platform.top)\n // console.log('PLAYER:::::::', object.bottom)\n // console.log('objBotOnPlat:::::::::', objBotOnPlatTop)\n\n if (objBotOnPlatTop) {\n debugger\n }\n }\n //check that they don't overlap in the y axis\n const objTopAbovePlatBot = object.top > platform.bottom;\n if (!objBotOnPlatTop) {\n // console.log()\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n }\n\n return true;\n };\n\n let collision = false;\n this.eachPlatform(platform => {\n //check if the bird is overlapping (colliding) with either platform\n if (_overlap(platform, player.bounds())) {\n // console.log('WE ARE HERE IN THE OVERLAP')\n // console.log(platform)\n collision = true;\n // debugger\n // console.log(player)\n player.y = platform.top;\n // console.log('PLATFORM: ', platform)\n // console.log(collision)\n // player.movePlayer(\"up\")\n }\n // _overlap(platform.bottomPlatform, player)\n });\n\n // console.log('collision:')\n // console.log(collision)\n return collision;\n }", "collidesWith(bird) {\n //this function returns true if the the rectangles overlap\n const _overlap = (rect1, rect2) => {\n //check that they don't overlap in the x axis\n if (rect1.left > rect2.right || rect1.right < rect2.left) {\n return false;\n }\n //check that they don't overlap in the y axis\n if (rect1.top > rect2.bottom || rect1.bottom < rect2.top) {\n return false;\n }\n return true;\n };\n let collision = false;\n this.eachPipe((pipe) => {\n if ( \n //check if the bird is overlapping (colliding) with either pipe\n _overlap(pipe.topPipe, bird) || \n _overlap(pipe.bottomPipe, bird)\n ) { collision = true; }\n });\n return collision;\n }", "collision(ptl, pbr) {//player dimensions\n //add the x first\n if(this.taken){ return false;}\n if ((ptl.x <this.bottomRight.x && pbr.x > this.pos.x) &&( ptl.y < this.bottomRight.y && pbr.y > this.pos.y)) {\n this.taken = true;\n return true;\n }\n return false;\n }", "checkBounds() {\n /*\n if(this.host.velocity == new Vector(0, 0)) {\n return false;\n }*/\n const HALF_AHEAD = SteeringManager.AHEAD_DISTANCE / 2.0;\n\n var ahead = this.host.velocity.copy().scaleToMagnitude(SteeringManager.AHEAD_DISTANCE);\n var ahead2 = ahead.copy().divide(2.0);\n\n var facing = Math.atan2(ahead.y, ahead.x);\n var aheadLeft = new Vector(Math.cos(facing + SteeringManager.AHEAD_ANGLE), Math.sin(facing + SteeringManager.AHEAD_ANGLE)).scale(HALF_AHEAD);\n var aheadRight = new Vector(Math.cos(facing + SteeringManager.AHEAD_ANGLE), Math.sin(facing + SteeringManager.AHEAD_ANGLE)).scale(HALF_AHEAD);\n\n ahead.add(this.host.pos);\n ahead2.add(this.host.pos);\n aheadLeft.add(this.host.pos);\n aheadRight.add(this.host.pos);\n\n var center = new Vector(width / 2, height / 2);\n\n if(this.isValid(ahead)\n && this.isValid(ahead2)\n && this.isValid(aheadLeft)\n && this.isValid(aheadRight)) {\n if(this.isAvoiding) {\n this.isAvoiding = false;\n\n // reset wander angle so NPC does not try to run into walls again\n this.wanderAngle = Math.atan2(center.y - this.host.pos.y, center.x - this.host.pos.x);\n }\n return false;\n }\n\n this.isAvoiding = true;\n this.seek(center, 0);\n return true;\n }", "_checkWallCollision() {\n return this.position.y - this.width / 2 <= pong.topWallYPos || this.position.y + this.width / 2 >= pong.bottomWallYPos;\n }", "function collidesWith( a, b )\n{\n return a.bottom > b.top && a.top < b.bottom;\n}", "function collision(top_x, bottom_x, top_y, bottom_y) {\n\t\tfor (var i = 0; i < rows; i++) {\n\t\t\tfor (var j = 0; j < cols; j++) {\n\t\t\t\tvar b = bricks[j][i];\n\t\t\t\tif (b.exists == 1) {\n\t\t\t\t\tif (top_y < (b.y + block_height) && bottom_y > b.y && top_x < (b.x + block_width) && bottom_x > b.x) {\n\t\t\t\t\t\tb.exists = 0;\n\t\t\t\t\t\tball.y_speed = -ball.y_speed;\n\t\t\t\t\t\tplayer1Score += 1;\n\t\t\t\t\t\tbrickcount -= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "checkCollisions() {\n // check for collisions with window boundaries\n if (this.pos.x > width || this.pos.x < 0 ||\n this.pos.y > height || this.pos.y < 0) {\n this.collision = true;\n }\n\n // check for collisions with all obstacles\n for (let ob of obstacles) {\n if (this.pos.x > ob.x && this.pos.x < ob.x + ob.width &&\n this.pos.y > ob.y && this.pos.y < ob.y + ob.height) {\n this.collision = true;\n break;\n }\n }\n }", "function collides(b, p) {\n\n if (b.y + ball.r >= p.y && b.y - ball.r <= p.y + p.h) {\n if (b.x >= (p.x - p.w) && p.x > 0) {\n paddleHit = RIGHT;\n return true;\n }\n\n else if (b.x <= p.w && p.x == 0) {\n paddleHit = LEFT;\n return true;\n }\n\n else return false;\n\n }\n}", "function PlayerOneRebound(){\n if((ball.x - ball.radius <= playerOne.x)\n&&\n((playerOne.y + ((playerOne.height) / 2) + (canvas.height / 8) > ball.y)\n&&\n(playerOne.y - ((playerOne.height) / 2) + (canvas.height / 8) < ball.y)))\n\n {\n ball.xVel = ball.xVel * (-1);\n }\n}", "checkCollision(that) {\n\t\tif (that.state == \"LIVE\") {\n\t\t\tthat.parts.forEach( part => {\n\t\t\t\tconst dis = dist(part.x, part.y, this.x, this.y)\n\t\t\t\t// console.log(dis)\n\t\t\t\tif (dis < 20) {\n\t\t\t\t\tthis.state = 'DEAD'\n\t\t\t\t\treturn true\n\t\t\t\t} \n\t\t\t})\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\n\t\t\n\t}", "function withinBounds() {\n return ballY > 0 && ballX < canvas.width && ballY < canvas.height;\n}", "checkCollisionAt(x, y) {\n return this.gameEngine.checkCollisions(this.collider.createTheoriticalBoundingBox(x, y))\n }", "function checkPlayerHit(x, y){\n\tfor (var i = 0; i < balls.length; i++){\n\t\tif (Math.pow(x - balls[i].x, 2) + Math.pow(y - balls[i].y, 2)\n\t\t\t<= Math.pow(balls[i].radius, 2)){\n\t\t\tactive = false;\n\t\t\tgame = -1;\n\t\t}\n\t}\n}", "hitCheck(a, b){ // colision\n var ab = a._boundsRect;\n var bb = b._boundsRect;\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "function checkBoundaries() {\n let left = tabuleiroBounds.x,\n right = tabuleiroBounds.width,\n top = 0,\n bottom = tabuleiroBounds.height;\n\n disco.vy += gravity;\n disco.x += disco.vx;\n disco.y += disco.vy;\n if (disco.x + disco.radius > right) {\n disco.x = right - disco.radius;\n disco.vx *= bounce;\n } else if (disco.x - disco.radius < left) {\n disco.x = left + disco.radius;\n disco.vx *= bounce;\n }\n if (disco.y + disco.radius > bottom) {\n disco.y = bottom - disco.radius;\n disco.vy *= bounce;\n disco.vx = 0;\n } else if (disco.y - disco.radius < top) {\n disco.y = top + disco.radius;\n disco.vy *= bounce;\n }\n}", "collidesWith(rocket) {\n return _.some(rocket.getPoints(), (point) => {\n let px = point.x + rocket.x;\n let py = point.y + rocket.y;\n return distance(px, py, this.x, this.y) <= (this.size / 2);\n });\n }", "function collisionCheck(b, o) {\n // If the player goes hits the screen edges, it's game over.\n if (b.y < 0 || b.y + b.size > canvasHeight)\n gameOver();\n // If the player hits an obstacle, it's game over.\n if (b.x + b.size >= o.x && b.x <= o.x + o.width) {\n if (b.y <= o.gapStart || b.y + b.size >= o.gapEnd)\n gameOver();\n }\n // If the player passes an obstacle, player earns a point.\n else if (b.scored == false && b.x > o.x + o.width) {\n b.score++;\n b.scored = true;\n }\n}", "checkCollisions() {\n let xPos = Math.round(this.x);\n let yPos = Math.round(this.y);\n let approxXpos = xPos + 20;\n let approxYpos = yPos + 20;\n if ((player.x >= xPos && player.x <= approxXpos) && (player.y >= yPos && player.y <= approxYpos)) {\n player.x = 200;\n player.y = 420;\n player.lives--;\n player.livesText.textContent = player.lives;\n\n }\n }", "collision_BL(ball, wall) {\n return ball.area.isInside(wall.area.closestPointTo(ball.state.pos));\n }", "_detectCollision () {\n let doContinue = true\n app.needleSelection.getNeedles().each(d => {\n if (d.passed) return\n const mm = app.getMmByLevel(app.ctx.level)\n const fromY = d.y + constant.NEEDLE_HOLE_DY\n const toY = fromY + mm\n const thread = app.threadDS\n if (thread.cx >= d.x) {\n if (fromY <= thread.cy - thread.r && thread.cy + thread.r <= toY) { // Passed\n app.statusTextScore++\n app.ctx.level = this._calcLevelByScore(app.statusTextScore) // May Lv. Up\n d.passed = true\n } else { // Failed\n doContinue = false\n }\n }\n })\n return doContinue\n }", "collides(target) {\n const { x: xTarget, y: yTarget } = target;\n const { x, y } = this;\n if(dist(xTarget, yTarget, x, y) <= TARGET_SIZE / 2) {\n return true;\n }\n return false;\n }", "collision() {\n if (this.y === (player.y - 12) && this.x > player.x - 75 && this.x < player.x + 70) {\n player.collide();\n }\n }", "collides(obj) {\n const isColliding = super.collides(obj);\n if (isColliding === true) {\n // if it collides\n game.obstacleSound.play(); // play the sound\n }\n return isColliding;\n }", "collides(obj) {\n const isColliding = super.collides(obj);\n if (isColliding === true) {\n // if it collides\n game.obstacleSound.play(); // play the sound\n }\n return isColliding;\n }", "checkBrickCollision() {\n // Loop through all the bricks\n for (let c = 0; c < this.brickColumnCount; c++) {\n for (let r = 0; r < this.brickRowCount; r++) {\n // If all these are true then\n if (\n this.ball.X + this.ball.R > this.bricks[c][r].X &&\n this.ball.X - this.ball.R < this.bricks[c][r].X + this.brick.W &&\n this.ball.Y + this.ball.R > this.bricks[c][r].Y &&\n this.ball.Y - this.ball.R < this.bricks[c][r].Y + this.brick.H\n ) {\n // If the brick is visible then\n if (this.bricks[c][r].visible) {\n // Bounce off the ball and make the brick disappear\n this.ball.dy *= -1;\n this.bricks[c][r].visible = false;\n // Increase the score since the brick was hit\n this.score++;\n }\n }\n }\n }\n }", "function collisionSlider() {\n return (\n ballX >= 680 &&\n ballX <= canvas.width &&\n ballY >= rectY &&\n ballY <= rectY + 100\n );\n}", "collideWCBound(aXform, zone) {\r\n let bbox = new BoundingBox(aXform.getPosition(), aXform.getWidth(), aXform.getHeight());\r\n let w = zone * this.getWCWidth();\r\n let h = zone * this.getWCHeight();\r\n let cameraBound = new BoundingBox(this.getWCCenter(), w, h);\r\n return cameraBound.boundCollideStatus(bbox);\r\n }", "handleCollision(climber) {\n\n // distance\n //\n // to calculate the distance between the avalanche and climber\n let d = dist(this.x, this.y, climber.x, climber.y);\n\n // dist()\n //\n // To keep track of the avalanche and the avatar are in contact\n if (d < this.width / 2 + climber.width / 2) {\n // this is to push the climber down\n climber.vy += 2;\n\n }\n }", "function collision(b, p) {\r\n p.top = p.y;\r\n p.bottom = p.y + p.height;\r\n p.left = p.x;\r\n p.right = p.x + p.width;\r\n\r\n b.top = b.y - b.radius;\r\n b.bottom = b.y + b.radius;\r\n b.left = b.x - b.radius;\r\n b.right = b.x + b.radius;\r\n\r\n return (\r\n p.left < b.right && p.top < b.bottom && p.right > b.left && p.bottom > b.top\r\n );\r\n}", "collidesWith (OtherEntity) {\n if (this.x < OtherEntity.x + OtherEntity.width &&\n this.x + this.width > OtherEntity.x &&\n this.y < OtherEntity.y + OtherEntity.height &&\n this.y + this.height > OtherEntity.y) {\n // collision detected!\n return true\n }\n // no collision\n return false\n }", "collide(obstacles) {\n for (let obstacle of obstacles) {\n // Rectangle enlarged by this.radius for easier calculation of collision.\n const boundingBox = new RectangularObstacle(\n new Vec2D(obstacle.pos.x - this.radius, obstacle.pos.y - this.radius),\n new Vec2D(obstacle.dim.x + 2 * this.radius, obstacle.dim.y + 2 * this.radius)\n );\n\n // Needed for deciding in which direction to reflect.\n const boundingBoxCenter = boundingBox.pos.add(boundingBox.dim.divide(2));\n const ratio = boundingBox.dim.x / boundingBox.dim.y;\n const vecToCenter = this.pos.subtract(boundingBoxCenter);\n\n if (boundingBox.hasInside(this.pos)) {\n if (Math.abs(vecToCenter.x) > ratio * Math.abs(vecToCenter.y)) {\n this.vel.x *= -1;\n } else {\n this.vel.y *= -1;\n }\n while (boundingBox.hasInside(this.pos)) {\n this.pos = this.pos.add(this.vel);\n }\n }\n }\n }", "checkCollision() { \n return (player.x < this.x + 80 &&\n player.x + 80 > this.x &&\n player.y < this.y + 60 &&\n 60 + player.y > this.y)\n }", "function collides(a, b) {\n \treturn \ta.getx() < b.getx() + b.getwidth() &&\n \ta.getx() + a.getwidth() > b.getx() &&\n \ta.gety() < b.gety() + b.getheight() &&\n \ta.gety() + a.getheight() > b.gety();\n }", "function collisionWall() {\n return ballX <= 15;\n}", "collide() {\n this.life -= 1;\n lives.innerHTML = this.life;\n this.x = START_X;\n this.y = START_Y;\n obstacle.newObst = true;\n if (this.life === 0) {\n this.endGame();\n }\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "paddleCollision(paddle1, paddle2) {\n\n \n // if moving toward the right end ================================\n if (this.vx > 0) {\n let paddle = paddle2.coordinates(paddle2.x, paddle2.y, paddle2.width, paddle2.height);\n let [leftX, rightX, topY, bottomY] = paddle;\n // right edge of the ball is >= left edge of the paddle\n if(\n (this.x + this.radius >= leftX) && \n (this.x + this.radius <= rightX) &&\n (this.y >= topY && this.y <= bottomY)\n ){\n this.vx = -this.vx;\n this.ping.play();\n }\n }\n else {\n\n // if moving toward the right end ============================\n let paddle = paddle1.coordinates(paddle1.x, paddle1.y, paddle1.width, paddle1.height);\n let [leftX, rightX, topY, bottomY] = paddle;\n // right edge of the ball is <= left edge of the paddle\n if(\n (this.x - this.radius <= rightX) && \n (this.x - this.radius >= leftX) &&\n (this.y >= topY && this.y <= bottomY)\n ){\n this.vx = -this.vx;\n this.ping.play();\n }\n }\n \n }", "_checkrightPaddleCollision() {\n return (\n this.position.x + this.width / 2 >= rightPaddle.position.x - rightPaddle.width / 2 &&\n this.position.y >= rightPaddle.position.y - rightPaddle.height / 2 &&\n this.position.y <= rightPaddle.position.y + rightPaddle.height / 2\n );\n }", "isCollidingWith(m, bindInside) {\n const bI = bindInside || this.bindInside;\n if (this.circle && m.circle) {\n return this.pos.distance(m.pos) <= this.radius + m.radius;\n }\n\n let selfXOff = this.circle ? this.radius * 2 : this.width / 2;\n let selfYOff = this.circle ? this.radius * 2 : this.height / 2;\n\n selfXOff *= bI ? -1 : 1;\n selfYOff *= bI ? -1 : 1;\n\n const mXOff = m.circle ? m.radius * 2 : m.width / 2;\n const mYOff = m.circle ? m.radius * 2 : m.height / 2;\n\n // TODO: I think this is wrong\n return this.pos.x + selfXOff > m.pos.x - mXOff &&\n this.pos.x - selfXOff < m.pos.x + mXOff &&\n this.pos.y + selfYOff > m.pos.y - mYOff &&\n this.pos.y - selfYOff < m.pos.y + mYOff;\n }", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "function collisionDetection(body1, body2){\n if(body1.x+body1.width > body2.x-cameraX && body1.x < body2.x+body2.width-cameraX && \n body1.y+body1.height > body2.y-cameraY && body1.y < body2.y+body2.height-cameraY){\n return true;\n }else{\n return false;\n }\n}", "function jcBound(b, dt){\n var bPos = b.position;\n var bSize = { left: b.elem.width(),\n\t\t top: b.elem.height()};\n var parent = b.elem.parent();\n var pPos = parent.offset();\n var pSize = {left: parent.width(),\n\t\t top: parent.height()};\n\n if(bPos.left < pPos.left){\n\tvar mag = (-b.velocity.x*(1 + jcGlobals.wallDamp) - \n\t\t (bPos.left - pPos.left)/(2*dt))*\n\t b.mass/dt;\n\tvar fric = b.velocity.y*(jcGlobals.wallFriction - 1)*\n\t\t b.mass/dt;\n\tb.applyForce(new jcVec2(mag ,fric));\n }\n if(bPos.top < pPos.top){\n\tvar mag = (-b.velocity.y*\n\t\t (1 + jcGlobals.wallDamp) - \n\t\t (bPos.top- pPos.top)/(2*dt))*b.mass/dt;\n\tvar fric = b.velocity.x*(jcGlobals.wallFriction -1)*\n\t\t b.mass/dt;\n\tb.applyForce(new jcVec2(fric,mag ));\n }\n if(bPos.left + bSize.left > (pPos.left + pSize.left) ){\n\tvar mag = (-b.velocity.x*(1 + jcGlobals.wallDamp) - \n\t (bPos.left + bSize.left - (pPos.left + pSize.left))/(2*dt))*\n\t\tb.mass/dt;\n\tvar fric = b.velocity.y*(jcGlobals.wallFriction -1)*\n\t\t b.mass/dt;\n\tb.applyForce(new jcVec2(mag, fric));\n }\n if(bPos.top + bSize.top > (pPos.top + pSize.top)){\n\tvar mag = (-b.velocity.y*\n\t\t (1 + jcGlobals.wallDamp) -\n\t\t (bPos.top + bSize.top - \n\t\t (pPos.top + pSize.top))/(2*dt))*b.mass/dt;\n\tvar fric = b.velocity.x*(jcGlobals.wallFriction -1)*\n\t\t b.mass/dt;\n\tb.applyForce(new jcVec2(fric, mag));\n }\n}", "checkForCollision(x, y) {\n return (this.level.getTile(x, y) === \"wall\" ||\n !!this.level.getMarker(x, y));\n }", "meets (paddle) {\r\n if (this.pos.y < paddle.y &&\r\n this.pos.y > paddle.y - this.r &&\r\n this.pos.x > paddle.x - this.r &&\r\n this.pos.x < paddle.x + paddle.w + this.r) {\r\n this.pos.y -= this.r;\r\n playSound(\"wallHit\");\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "collide(obstacle) {\n for (let asteroid of obstacle) {\n if (Math.abs(this.x - asteroid.x) <= (GUN_SIZE / 2 + ASTEROID_SIZE) &&\n Math.abs(this.y - asteroid.y) <= (GUN_SIZE / 2 + ASTEROID_SIZE)) {\n explosionsound.play();\n this.setX(-10000);\n this.setY(-10000);\n asteroid.setX(Math.floor(Math.random() * canvas.width));\n asteroid.setY(-ASTEROID_SIZE*2);\n asteroid.setColor(getRandomColor());\n tiger.health += asteroid_HP;\n }\n }\n }", "function checkSpawnCollision(b){\n\tif (Math.sqrt(Math.pow(b.nextX - spawner.x, 2) + Math.pow(b.nextY - spawner.y, 2))\n\t\t<= b.radius + spawner.radius)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "isCollidingWith(gameObject) {\n return (\n p5.Vector.dist(this.position, gameObject.position) <\n this.collisionRadius + this.gameObject.collisionRadius\n );\n }", "checkCollision(){\n\n if(this.radius > 0){\n if(this.x + this.radius > game.getWidth() || this.x - this.radius < 0){\n this.xVel *= -1;\n }\n\n if(this.y + this.radius > game.getHeight() || this.y - this.radius < 0){\n this.yVel *= -1;\n }\n } \n \n }", "collide(p2, damp = 1) {\n // reference: http://codeflow.org/entries/2010/nov/29/verlet-collision-with-impulse-preservation\n // simultaneous collision not yet resolved. Possible solutions in this paper: https://www2.msm.ctw.utwente.nl/sluding/PAPERS/dem07.pdf \n let p1 = this;\n let dp = p1.$subtract(p2);\n let distSq = dp.magnitudeSq();\n let dr = p1.radius + p2.radius;\n if (distSq < dr * dr) {\n let c1 = p1.changed;\n let c2 = p2.changed;\n let dist = Math.sqrt(distSq);\n let d = dp.$multiply(((dist - dr) / dist) / 2);\n let np1 = p1.$subtract(d);\n let np2 = p2.$add(d);\n p1.to(np1);\n p2.to(np2);\n let f1 = damp * dp.dot(c1) / distSq;\n let f2 = damp * dp.dot(c2) / distSq;\n let dm1 = p1.mass / (p1.mass + p2.mass);\n let dm2 = p2.mass / (p1.mass + p2.mass);\n c1.add(new Pt_1.Pt(f2 * dp[0] - f1 * dp[0], f2 * dp[1] - f1 * dp[1]).$multiply(dm2));\n c2.add(new Pt_1.Pt(f1 * dp[0] - f2 * dp[0], f1 * dp[1] - f2 * dp[1]).$multiply(dm1));\n p1.previous = p1.$subtract(c1);\n p2.previous = p2.$subtract(c2);\n }\n }", "function isCollide(a, b) {\n //a=Pokemon b=white or red balls\n\n let aRect = a.getBoundingClientRect();\n let bRect = b.getBoundingClientRect();\n let pythag = getDistance(aRect.x, aRect.y, bRect.x, bRect.y);\n\n if (pythag < (aRect.height / 2 + bRect.height / 2)) {\n if (b.classList.value === \"whiteballs\") {\n b.style.opacity = \"0\";\n vanish(b);\n player.score += 1;\n scoreupdate();\n } else\n endGame();\n }\n}", "collide(obj) {\n if (this.x <= obj.x + obj.w &&\n obj.x <= this.x + this.w &&\n this.y <= obj.y + obj.h &&\n obj.y <= this.y + this.h\n ) {\n return true;\n }\n }", "function pipeCollisions(){\n\tfor(let i = 0; i < pipe.count; i++){\n\t\tif( (DOM_pipes_top[i].temp_x <= bird.width-10) && (DOM_pipes_top[i].temp_x >= -pipe.width+10) ){\n\t\t\tif(bird.y < (DOM_pipes_top[i].temp_y - pipe.gap/2 + bird.height/2)){\n\t\t\t\tif(!bird.immortal){\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bird.y > (DOM_pipes_top[i].temp_y + pipe.gap/2 - bird.height/2)){\n\t\t\t\tif(!bird.immortal){\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function checkCollision(){\n for(var j = 0; j < balls.length; j++)\n if (balls[i].loc.x > paddle.loc.x &&\n balls[i].loc.x < paddle.width &&\n balls[i].loc.y > paddle.loc.y &&\n balls[i].loc.y < paddle.height)\n balls[i].splice(i,1)\n\n }", "function CheckContactParticleObj(a_particle, b_obj, t)\n{\n // TODO: Object validity checks\n\n var b_br = b_obj.bound_r; // Bounding radius B\n var a_trl = a_particle.vel * t; // Translation vector A\n var b_trl = b_obj.vel * t; // Translation vector B\n var a_pos0 = a_particle.pos; // Initial Position A\n var b_pos0 = b_obj.pos; // Initial Position B\n var d0 = b_pos0 - a_pos0; // Initial distance/Separation from A to B\n\n\n // Check Bounding Circles\n if (b_br)\n {\n // Rough bounding circles check\n if (d0 > b_br + vec2.len(a_trl) + vec2.len(b_trl))\n {\n return;\n }\n\n // TODO: Swept bounding circles check\n\n }\n\n // Check Circle\n if (b_obj.circle)\n {\n CheckContactParticleCircle(a_particle, b_obj, t);\n return;\n }\n\n // OR\n\n // Check Box\n if (b_obj.box)\n {\n // TODO: CheckContactParticleBox(a_particle, b_obj, t);\n return;\n }\n\n // OR\n\n // Check Mesh\n if (b_obj.mesh)\n {\n // TODO: CheckContactParticleMesh(a_particle, b_obj, t);\n return;\n }\n\n}", "function collides(a, b) {\n\n\treturn a.x < b.x + b.width &&\n\t\t\t\t a.x + a.width > b.x &&\n\t\t\t\t a.y < b.y + b.height &&\n\t\t\t\t a.y + a.height > b.y;\n\n}", "function collide(A, B) {\n if ( A.x < B.x + CAR_WIDTH && A.x + CAR_WIDTH > B.x &&\n A.y < B.y + CAR_HEIGHT && A.y + CAR_HEIGHT > B.y ) {\n if ( DEBUG ) {\n console.log(\"Colision entre deux véhicules\");\n }\n return true;\n }\n return false;\n}", "function checkBoundry() {\n if (player.x <= backGround.x) {\n player.x = backGround.x;\n }\n if (player.x >= backGround.width - player.width) {\n player.x = backGround.width - player.width;\n }\n}", "function checkCollisions() {\n\n var d1 = dist(playerX, playerY, width / 2, height / 2);\n\n if (d1 > borderDiameter / 2) {\n\n showGameOver();\n noLoop();\n\n }\n\n var i = 0;\n\n for (i = 0; i < numberOfEnemies; i++) {\n var d2 = dist(playerX, playerY, enemyX[i], enemyY[i]);\n\n // Check if it's an overlap\n if (d2 < playerRadius + enemyRadius) {\n // Increase the player health\n showGameOver();\n noLoop();\n\n }\n\n }\n\n var d3 = dist(playerX, playerY, preyX, preyY);\n\n if (d3 < playerRadius + enemyRadius) {\n bark.play();\n setup();\n }\n\n\n}", "function collision(dim, i, delta) {\n \n var r = sParticles[i];\n var temp = pParticles[i][dim] + vParticles[i][dim] * delta;\n var bound = 1; \n \n var collide = false;\n if (temp > 0) {\n bound = bound - r;\n if (temp > bound) \n collide = true;\n } else {\n bound = -bound + r;\n if (temp < bound)\n collide = true;\n }\n //Floor collision\n if ( collide && (Math.abs(vParticles[i][dim]) > threshold[dim]) ) {\n \n //console.log(\"start\", pParticles[i][1], vParticles[i][1]);\n var tCollide = (bound - pParticles[i][dim])/ vParticles[i][dim];\n\n //console.log(\"delta, tCollide\", delta, tCollide);\n\n if (tCollide < 0) {\n tCollide = 0;\n console.log(\"bad tCollide\");\n }\n \n if (tCollide > delta) {\n tCollide = delta;\n console.log(\"bad delta\");\n }\n\n //at collision\n\n pParticles[i][dim] = bound;\n\n var vCollide = vParticles[i][dim] + g[dim] * tCollide;\n\n vParticles[i][dim] = -(vCollide * retainRatio);\n //onsole.log(\"at collision\", pParticles[i][dim], vParticles[i][dim]);\n\n\n //after collision to current time\n\n\n pParticles[i][dim] += vParticles[i][dim] * (delta - tCollide);\n \n vParticles[i][dim] = vParticles[i][dim] + g[dim] * (delta - tCollide);\n\n \n if ((Math.abs(pParticles[i][dim]-bound) < 0.05) && Math.abs(vParticles[i][dim]) < threshold[dim] && !(dim==1 && bound > 0)) {\n pParticles[i][dim] = bound;\n vParticles[i][dim] = 0;\n console.log(\"particle locked\");\n }\n } else {\n pParticles[i][dim] = temp;\n if ( (Math.abs(temp - bound) > 0.05) ||(Math.abs(vParticles[i][dim]) > threshold[dim]) || (dim==1 && bound > 0)) {\n \n vParticles[i][dim] = vParticles[i][dim] * Math.pow(drag, delta) + g[dim] * delta;\n\n if (Math.abs(vParticles[i][dim]) < threshold[dim] && dim != 1)\n vParticles[i][dim] = 0;\n\n } else {\n pParticles[i][dim] = bound;\n vParticles[i][dim] = 0;\n }\n }\n}", "function collides(a, b) {\n if(a.x == b.x && a.y == b.y) return true;\n return false;\n }", "function collisionDetection(first, second) {\n var firstBounds = first.getBounds();\n var secondBounds = second.getBounds();\n\n return firstBounds.x + firstBounds.width > secondBounds.x\n && firstBounds.x < secondBounds.x + secondBounds.width \n && firstBounds.y + firstBounds.height > secondBounds.y\n && firstBounds.y < secondBounds.y + secondBounds.height;\n}", "collision () {\n }", "check(i, current, j, other) {\n // stop calculating if one of the objects is non-collidable\n if (!current.collidable || !other.collidable) {\n return;\n }\n\n // find change in position for current frame (velocity * delta time)\n let curVel = multiplyVector(current.vel, deltaT);\n let othVel = multiplyVector(other.vel, deltaT);\n let dist = distance(other.pos, current.pos);\n let radSum = current.rad + other.rad;\n\n // if the objects are close enough to collide\n if (dist <= (radSum + curVel.mag + othVel.mag)) {\n // calculate time of intersection, which represents a percentage of current velocity\n let t = this._calculateT(current.pos, other.pos, curVel, othVel, radSum);\n\n // if intersection occurs within the current velocities, record both objects\n if (t <= 1) {\n let curI = this._record(i, current);\n let othI = this._record(j, other);\n this._colObjects[curI].addPotential(othI, t);\n this._colObjects[othI].addPotential(curI, t);\n\n //console.log(\"collided!\");\n }\n }\n }", "function collisionCheck() {\n for(var i=0; i<brickList.length; i++) {\n if (chopperX < (brickList[i].x + brickWidth) && (chopperX + chopperWidth) > brickList[i].x\n && chopperY < (brickList[i].y + brickHeight) && (chopperY + chopperHeight) > brickList[i].y ) {\n gameOver();\n }\n }\n}", "function checkCollision(a, b) {\n if (a !== undefined && b !== undefined) {\n var aRad = (a.a + a.b + a.c) / 3;\n var bRad = (b.a + b.b + b.c) / 3;\n var aPos = vec3.create();\n\n vec3.add(aPos, a.center, a.translation);\n var bPos = vec3.create();\n vec3.add(bPos, b.center, b.translation);\n var dist = vec3.distance(aPos, bPos);\n\n if (dist < aRad + bRad) {\n //spawn explosion and destroy asteroid, doesn't matter what asteroid collided with, always explodes\n generateExplosion(vec3.add(vec3.create(), vec3.fromValues(a.x, a.y, a.z),\n vec3.fromValues(a.translation[0], a.translation[1], a.translation[2])), false);\n deleteModel(a);\n //handle collision\n if (b.tag == 'shot') {\n // destroy asteroid and shot, give player points\n //test *******apocalypse = true;\n //test *******gameOver(b);\n deleteModel(b);\n score += 10;\n document.getElementById(\"score\").innerHTML = \"Score: \" + score;\n } else if (b.tag == 'station') {\n // destroy asteroid, damage station and destroy if life < 0 then weaken shield\n // if last station destroyed, destroy shield as wells\n b.health -= 5;\n if (b.css == 'station1') {\n document.getElementById(\"station1\").innerHTML = \"Station Alpha: \" + b.health;\n } else if (b.css == 'station2') {\n document.getElementById(\"station2\").innerHTML = \"Station Bravo: \" + b.health;\n } else {\n document.getElementById(\"station3\").innerHTML = \"Station Charlie: \" + b.health;\n }\n if (b.health == 0) {\n var change = false;\n base_limit--;\n // reduce shield alpha by one to signify weakening\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'shield') {\n inputEllipsoids[o].alpha -= 0.2;\n }\n }\n // if the destroyed center is highlighted, switch to next\n if (b.id == current_center) {\n for (var s in stations) {\n if (stations[s].id > b.id) {\n stations[s].id--;\n }\n }\n change = true;\n }\n // remove the destroyed station\n station_centers.splice(b.id, 1);\n deleteModel(b);\n // has to be after splice/delete or else will access out of date station_centers\n if (change) {\n current_center++;\n changeStation();\n }\n shield_level--;\n document.getElementById(\"shield\").innerHTML = \"Shield: \" + shield_level;\n // destroy shield if no more stations\n if (shield_level == 0) {\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'shield') {\n deleteModel(inputEllipsoids[o]);\n break;\n }\n }\n deleteModel(highlight);\n }\n if (b.css == 'station1') {\n document.getElementById(\"station1charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station1\").innerHTML = \"Station Alpha:\"\n } else if (b.css == 'station2') {\n document.getElementById(\"station2charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station2\").innerHTML = \"Station Bravo:\"\n } else {\n document.getElementById(\"station3charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station3\").innerHTML = \"Station Charlie:\"\n }\n }\n } else if (b.tag == 'shield') {\n // destroy asteroid, damage earth based on shield strength\n earth_health -= 15 / shield_level;\n document.getElementById(\"earth\").innerHTML = \"Earth: \" + earth_health;\n if (earth_health <= 0) {\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'earth') {\n // handle game over\n gameOver(inputEllipsoids[o]);\n break;\n }\n }\n }\n } else if (b.tag == 'earth') {\n // destroy asteroid, damage earth and destroy if life < 0\n earth_health -= 15;\n document.getElementById(\"earth\").innerHTML = \"Earth: \" + earth_health;\n if (earth_health <= 0) {\n // handle game over\n gameOver(b);\n }\n } else if (b.tag == 'moon') {\n b.health -= 5;\n if (b.health <= 0) {\n generateExplosion(vec3.add(vec3.create(), vec3.fromValues(b.x, b.y, b.z),\n vec3.fromValues(b.translation[0], b.translation[1], b.translation[2])), true);\n deleteModel(b);\n }\n }\n }\n }\n}", "checkCollisions(walls) {\n let leftWall;\n let rightWall;\n for (const wall of walls) {\n if (wall.tagName === \"leftWall\") leftWall = wall;\n else if (wall.tagName === \"rightWall\") rightWall = wall;\n }\n let leftBoundary = leftWall.x1;\n let rightBoundary = rightWall.x1;\n let paddleLeft = this.x - this.width / 2.0;\n let paddleRight = this.x + this.width / 2.0;\n \n // boundary check\n if (paddleLeft < leftBoundary) this.x += leftBoundary - paddleLeft;\n if (paddleRight > rightBoundary) this.x -= paddleRight - rightBoundary;\n }", "function handleCollision(){\n\n\t\tlet diff = dist(xPos, yPos, ballX, ballY);\n\n\t\t//if ball directly above paddle\n\t\tif(ballX+20>=xPos && ballX-20<= xPos+100){\n\n\t\t\t//if touching paddle\n\t\t\tif(ballY+20>=yPos){\n\n\t\t\t\tboingsound.play();\n\n\t\t\t\tYspeed *=-1;\n\t\t\t\tif(Yspeed<0){\n\t\t\t\t\tYspeed -= random(1, 2); \n\t\t\t\t}\n\t\t\t\tif(Yspeed==0){\n\t\t\t\t\tYspeed += random(.5, 1.5);\n\t\t\t\t}\n\n\t\t\t\t//if on left side\n\t\t\t\tif(ballX <= xPos+50){\n\t\t\t\t\tif(Xspeed>0)\n\t\t\t\t\t\tXspeed *=-1;\n\t\t\t\t}\n\n\t\t\t\t//if on right side\n\t\t\t\telse{\n\t\t\t\t\tif(Xspeed<0)\n\t\t\t\t\t\tXspeed *=-1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "function isGameOver(bird, context){\n var floorBound = context.canvas.height - floorHeight + 3 < (bird.aabb.y + bird.aabb.h);\n if(floorBound){\n return true;\n }\n for (var i = 0; i < activePipes.length; i++) {\n if (activePipes[i].aabb.intersect(bird.aabb)) {\n return true;\n }\n }\n\n return false;\n }", "onCollision(otherObjects) {}", "collides(other) {\n return (distSq(this.position, other.position) <\n this.collisionRadius * this.collisionRadius + other.collisionRadius * other.collisionRadius);\n }", "checkBallCollision() {\n // Top Wall Check\n if (this.ball.Y - this.ball.R === 1) {\n this.ball.dy = 2;\n }\n // Bottom Wall Check\n if (this.ball.Y - this.ball.R === 641) {\n this.ball.dy = -2;\n /* If the ball hits the bottom wall then the user loses hence\n we reset the score and bricks */\n this.score = 0;\n this.initBricks();\n this.drawBricks();\n }\n // Right Wall Check\n if (this.ball.X - this.ball.R === 1092) {\n this.ball.dx = -2;\n }\n // Left Wall Check\n if (this.ball.X - this.ball.R === 2) {\n this.ball.dx = 2;\n }\n // Ball and Paddle collision check\n if (this.ball.Y === 631) {\n // If the ball is in the area of the paddle\n if (\n this.ball.X > this.paddle.X &&\n this.ball.X < this.paddle.X + this.paddle.W\n ) {\n this.ball.dy = -2;\n }\n }\n }", "ballIsOutOfBounds(){\n //TODO check if ball is colliding with paddle and if so, reverse the x direction some how \n if(this.ballY >= 740 || this.ballY <= 10){\n this.ballVelocityY *= -1;\n } \n if(this.ballHittingPaddle()){\n this.ballX *= -1;\n }\n }", "function collision() {\r\n isObstacle_Clash_leftofWindow();\r\n isBullet_Clash_obstacle();\r\n isRocket_Clash_obstacle();\r\n if (lives <= 0) {\r\n endGame();\r\n }\r\n draw_Score_Lives();\r\n isRocket_Clash_Bomb();\r\n isBullet_Clash_Ship();\r\n }", "function detectCollision() {\n ballCollision();\n brickCollision();\n}", "function ballBrickCollision() {\n\n for (let r = 0; r < brick.row; r++) {\n\n for (let c = 0; c < brick.column; c++) {\n\n let b = bricks[r][c];\n\n if (b.status) {\n\n if (ball.x + ball.radius > b.x &&\n ball.x - ball.radius < b.x + brick.width &&\n ball.y + ball.radius > b.y &&\n ball.y - ball.radius < b.y + brick.height) {\n\n BRICK_HIT.play();\n\n ball.dy = -ball.dy;\n b.status = false;\n SCORE += SCORE_UNIT;\n }\n }\n }\n }\n}", "function ballPaddleCollision() {\n\n if (ball.x < paddle.x + paddle.width &&\n ball.x > paddle.x &&\n ball.y < paddle.y + paddle.height &&\n ball.y > paddle.y) {\n\n PADDLE_HIT.play();\n\n // check where the ball hits the paddle\n let collidePoint = ball.x - (paddle.x + paddle.width / 2);\n\n // normalise the value\n collidePoint = collidePoint / (paddle.width / 2);\n\n // calculate the angle of ball\n let angle = collidePoint * Math.PI / 3;\n\n ball.dx = ball.speed * Math.sin(angle);\n ball.dy = -ball.speed * Math.cos(angle);\n }\n}", "function checkbounce(ball,end) {\n if (ball.x + ball.rad > end) ball.vx *= -1;\n if (ball.x - ball.rad < 0) ball.vx *= -1;\n}", "function checkCollision(zombie) {\nif (zombie.getBoundingClientRect().top <= 0) {\nlives--;\nreturn true;\n}\nreturn false;\n}", "collision() {\n\t\tthis.vars.collision = true;\n\t}", "checkCollisions() {\n // Get actual player position\n let playerPosition = {\n x: player.x,\n y: player.y,\n width: box.width,\n height: box.height\n }\n // Get actual enemy position\n let enemyPosition = {\n x: this.x,\n y: this.y,\n width: box.width +10,\n height: box.height\n }\n // If collision happened:\n if (playerPosition.x < enemyPosition.x + enemyPosition.width && playerPosition.x + playerPosition.width > enemyPosition.x && playerPosition.y < enemyPosition.y + enemyPosition.height && playerPosition.y + playerPosition.height > enemyPosition.y) {\n audioFiles.collision.play();// Play sound\n player.resetPlayer();// Reset player initial position\n player.remainAlive--;// Decrese player lives\n lives.pop();// remove life object from lives array\n //If Player has less than 3 lives, display life key bonus\n (player.remainAlive < 3 && player.remainAlive >0) && keyLife.display();\n }\n\n }", "function checkCollision (obj1,obj2){\n return obj1.y + obj1.height - 10 >= obj2.y\n && obj1.y <= obj2.y + obj2.height\n && obj1.x + obj1.width - 10 >= obj2.x\n && obj1.x <= obj2.x + obj2.width\n }", "checkWallCollision() {\n if ((this.center.x + this.width / 4) >= this.wall.x &&\n ((this.center.x - this.width / 4)) <= this.wall.x + this.wall.width &&\n this.center.y >= GAME_CONFIG.GAME_HEIGHT - this.wall.height) {\n this.gameOver();\n }\n }", "function checkBallCollision(b1, b2){\n\tif (Math.sqrt(Math.pow(b1.nextX - b2.nextX, 2) + Math.pow(b1.nextY - b2.nextY, 2)) <= b1.radius + b2.radius)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function checkOverlap() {\n let d = dist(circle1.x, circle1.y, circle2.x, circle2.y);\n if (d < circle1.size/3 + circle2.size/3) {\n state = `love`;\n }\n }", "collisionPaddle(p){\n // 2D collision test\n if( this.x + this.r > p.x &&\n this.x - this.r < p.x + p.w &&\n this.y + this.r > p.y &&\n this.y - this.r < p.y + p.h\n )\n return true;\n return false;\n }", "function checkCollision(){\r\n\t//check se la macchina esce dalla pista\r\n\tif(center_carr[2]<-408)vz=0;\r\n\tif(center_carr[2]>109)vz=0;\r\n\t\r\n\tif(center_carr[0]<track_dimension[1])vz=0;\r\n\tif(center_carr[0]>track_dimension[0])vz=0;\r\n\t\r\n\t//check collisione con i booster\r\n\tif((center_carr[0]<2.3 && center_carr[0]>0) && (center_carr[2]>-10 && center_carr[2]<-6)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-35 && center_carr[2]<-31)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-48 && center_carr[2]<-44)) vz=vz*1.12;\r\n\tif((center_carr[0]<6 && center_carr[0]>4) && (center_carr[2]>-161 && center_carr[2]<-157)) vz=vz*1.12;\r\n\tif((center_carr[0]<3 && center_carr[0]>0.7) && (center_carr[2]>-184 && center_carr[2]<-180)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-240 && center_carr[2]<-236)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-251 && center_carr[2]<-247)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-257 && center_carr[2]<-253)) vz=vz*1.12;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-290 && center_carr[2]<-286)) vz=vz*1.12;\r\n\tif((center_carr[0]<6&& center_carr[0]>3.8) && (center_carr[2]>-310 && center_carr[2]<-306)) vz=vz*1.15;\r\n\tif((center_carr[0]<3.6&& center_carr[0]>1.3) && (center_carr[2]>-331 && center_carr[2]<-327)) vz=vz*1.12;\r\n\t\r\n\t//check collisione con i debooster\r\n\tif((center_carr[0]<1.15 && center_carr[0]>-0.8) && (center_carr[2]>-113 && center_carr[2]<-109)) vz=vz*0.9;\r\n\tif((center_carr[0]<6 && center_carr[0]>3.6) && (center_carr[2]>-144 && center_carr[2]<-140)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>0.85) && (center_carr[2]>-170 && center_carr[2]<-166)) vz=vz*0.9;\r\n\tif((center_carr[0]<6.66 && center_carr[0]>4.6) && (center_carr[2]>-203 && center_carr[2]<-199)) vz=vz*0.9;\r\n\tif((center_carr[0]<2.81 && center_carr[0]>0.93) && (center_carr[2]>-222 && center_carr[2]<-218)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>1) && (center_carr[2]>-277 && center_carr[2]<-281)) vz=vz*0.9;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-300 && center_carr[2]<-296)) vz=vz*0.9;\r\n\t\r\n}", "function ballBrickCollision(){\n for(let r= 0; r < brick.row; r++){\n for(let c= 0; c < brick.column; c++){\n let b = bricks[r][c]\n //if brick is not broken\n if(b.status){\n if (ball.x + ball.radius > b.x && ball.x - ball.radius < b.x + brick.width && ball.y + ball.radius > b.y && ball.y - ball.radius < b.y + brick.height){\n BRICK_HIT.play()\n ball.dy = - ball.dy\n b.status = false //brick is broken\n SCORE += SCORE_UNIT\n }\n \n }\n }\n }\n}", "collisionWithWalls(){\r\n\t\tif(this.position.x < 0 || this.position.x >= this.gameWidth ||\r\n\t\t\tthis.position.y < 0 || this.position.y >= this.gameHeight){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "didCollide() {\r\n // Check if their x line up\r\n let playerLeftIsAfterLeftSide = player.x - player.w / 2 >= this.x - this.w / 2;\r\n let playerLeftIsBeforeRightSide = player.x - player.w / 2 <= this.x + this.w / 2;\r\n let playerRightIsAfterLeftSide = player.x + player.w / 2 >= this.x - this.w / 2;\r\n let playerRightIsBeforeRightSide = player.x + player.w / 2 <= this.x + this.w / 2;\r\n\r\n if ((playerLeftIsAfterLeftSide && playerLeftIsBeforeRightSide) || \r\n (playerRightIsAfterLeftSide && playerRightIsBeforeRightSide)) {\r\n\r\n // Check if the enemy has collided with the player.\r\n if (this.y + this.h / 2 >= player.y - player.h / 2) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function checkCollision(gridX, gridY) {\n var xCenterDist = (gridX+0.5)-x, // distance between centers\n yCenterDist = (gridY+0.5)-y,\n xEdgeDist = Math.abs(xCenterDist)-(0.5+r), // distance between edges\n yEdgeDist = Math.abs(yCenterDist)-(0.5+r),\n vectFrac = 0, // fraction of delta vector traveled until contact\n centerness = 1, // accuracy of contact, less is closer to center\n bounce; // direction of bounce\n // Check that brick is reachable and delta is heading towards brick\n if (xEdgeDist < Math.abs(dx) && xCenterDist*dx > 0) {\n vectFrac = 1-Math.abs(xEdgeDist/dx);\n centerness = Math.abs(yCenterDist-dy*vectFrac);\n bounce = 'x';\n }\n if (yEdgeDist < Math.abs(dy) && yCenterDist*dy > 0) {\n var yVectFrac = 1-Math.abs(yEdgeDist/dy);\n // Contact occurs at greatest valid fraction of delta vector\n if (yVectFrac > vectFrac) {\n vectFrac = yVectFrac;\n centerness = Math.abs(xCenterDist-dx*vectFrac);\n bounce = 'y';\n }\n }\n if (debug)\n // Visualize grids checked by collision detection\n ctx.strokeRect(gridX*gU+3, gridY*gU+3, gU-6, gU-6);\n // Disqualify result if no contact occured\n return [vectFrac > 0 ? vectFrac : 1, centerness < 0.5+r ? centerness : 1, bounce];\n}", "checkPaddleCollision() {\n // Left wall check\n if (this.paddle1.X + this.paddle1.W > this.canvas.width) {\n this.paddle1.X = this.canvas.width - this.paddle1.W;\n } else if (this.paddle1.X < 0) {\n this.paddle1.X = 0;\n }\n\n // Right Wall Check\n if (this.paddle2.X + this.paddle2.W > this.canvas.width) {\n this.paddle2.X = this.canvas.width - this.paddle2.W;\n } else if (this.paddle2.X < 0) {\n this.paddle2.X = 0;\n }\n }", "function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}" ]
[ "0.73048663", "0.700014", "0.697474", "0.6893094", "0.6882723", "0.68703336", "0.6849041", "0.68466705", "0.6825712", "0.6798142", "0.6758802", "0.6757075", "0.67559093", "0.67529964", "0.6683891", "0.6671648", "0.66652703", "0.66529447", "0.66430485", "0.6620247", "0.6613209", "0.66044825", "0.660255", "0.6602517", "0.66011965", "0.65993845", "0.65782094", "0.6574943", "0.6559776", "0.652352", "0.652352", "0.65231013", "0.65164566", "0.6515309", "0.6510514", "0.65101326", "0.65049833", "0.6502158", "0.64916456", "0.64871454", "0.6481438", "0.64777887", "0.64735395", "0.64735395", "0.64703804", "0.6466749", "0.6464174", "0.6460828", "0.64606297", "0.64574355", "0.64548445", "0.64493793", "0.6442091", "0.64404666", "0.64183426", "0.6411069", "0.6406808", "0.64053416", "0.6384084", "0.6377658", "0.6376157", "0.63724804", "0.6368438", "0.6364767", "0.6347404", "0.63456815", "0.63388646", "0.6336858", "0.6334585", "0.6329938", "0.632877", "0.6326312", "0.6324661", "0.6324221", "0.63224965", "0.6321893", "0.6318313", "0.6318216", "0.6315762", "0.63114715", "0.6307467", "0.6301866", "0.6294696", "0.62934005", "0.62932485", "0.62883854", "0.62871337", "0.62854266", "0.62830716", "0.6281347", "0.62801313", "0.62773556", "0.6275608", "0.6269114", "0.62676716", "0.626765", "0.62664866", "0.62608254", "0.62481815", "0.6247707" ]
0.7364233
0
A Ball particle and related functions
function Ball(pos, r) { this.pos = pos; this.velocity = new Vector(0, 0); this.radius = r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Ball(x, y, velX, velY, color, size, nextphase,retention) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n this.nextphase=nextphase;\n this.retention=retention;\n\n\n}", "function end_Particle(x , y) // you will need to modify the parameters\n{\n // the data associated with a particle\n this.accelY = 0.05; //gravity\n this.velX = random(-1, 1);\n this.velY = random(.5, 1.3);\n\n // note this particle only can vary its blue color \n // - change this to include red and green\n if(col % 3 < 1){\n this.pcolorR=255\n this.pcolorG=166+random(-50,50)\n this.pcolorB=247+random(-50,50)\n }\n else if(col % 3 < 2){\n this.pcolorR=145+random(-50,50)\n this.pcolorG=255\n this.pcolorB=176+random(-50,50)\n }\n else if(col % 3 < 3){\n this.pcolorR=145+random(-50,50)\n this.pcolorG=255+random(-50,50)\n this.pcolorB=255\n }\n this.locX = x;\n this.locY = y;\n this.r = 8.0;\n this.life = 255;\n \n // a function to update the particle each frame\n this.updateP = function()\n {\n this.velY += this.accelY;\n this.locX += this.velX;\n this.locY += this.velY;\n this.life -= 2.5;\n };\n \n // function to draw a particle\n this.renderP = function() \n {\n noStroke();\n push();\n fill(this.pcolorR, this.pcolorG, this.pcolorB, this.life);\n translate(this.locX, this.locY);\n ellipse(0, 0, this.r, this.r);\n pop();\n };\n} //end of particle object definition", "processParticle(b) {\n let b1 = this;\n let b2 = b;\n let hit = Op_1.Polygon.hasIntersectCircle(b1, Op_1.Circle.fromCenter(b, b.radius));\n if (hit) {\n let cv = hit.normal.$multiply(hit.dist);\n let t;\n let eg = hit.edge;\n if (Math.abs(eg[0][0] - eg[1][0]) > Math.abs(eg[0][1] - eg[1][1])) {\n t = (hit.vertex[0] - cv[0] - eg[0][0]) / (eg[1][0] - eg[0][0]);\n }\n else {\n t = (hit.vertex[1] - cv[1] - eg[0][1]) / (eg[1][1] - eg[0][1]);\n }\n let lambda = 1 / (t * t + (1 - t) * (1 - t));\n let m0 = hit.vertex.mass || b2.mass || 1;\n let m1 = hit.edge[0].body.mass || 1;\n let mr0 = m0 / (m0 + m1);\n let mr1 = m1 / (m0 + m1);\n eg[0].subtract(cv.$multiply(mr0 * (1 - t) * lambda / 2));\n eg[1].subtract(cv.$multiply(mr0 * t * lambda / 2));\n let c1 = b.changed.add(cv.$multiply(mr1));\n b.previous = b.$subtract(c1);\n // let c2 = b2.changed.add( cv.$multiply(mr0) );\n // b2.previous = b2.$subtract( c2 );\n }\n }", "function addBall (e) {\n p[num] = new Pelota();\n\n\tif (e) {\n\t\tp[num].pos = [e.clientX, e.clientY];\n\t}\n\n\t// p[num].color = \"rgb(\" + parseInt(Math.random() * 255) + \", \"\n\t// \t+ parseInt(Math.random() * 255) + \", \" + parseInt(Math.random() * 255) + \")\";\n p[num].color = \"white\";\n\tp[num].velocity = [\n\t\tMath.random() * 20 - 10,\n\t\tMath.random() * 5 - 2.5\n\t];\n\tp[num].bounciness = Math.random() * 0.1 + 0.9;\n\tp[num].friction = Math.random() * 0.05 + 1;\n\tp[num].init();\n\tnum++;\n}", "function particle(posX, posY, sizeX, sizeY, hue) {\n \n //this.indx = inDx; // Array index for this particle.\n \n this.mySize = createVector(sizeX, sizeY);\n this.pos = createVector(posX, posY);\n \n this.origPos = createVector();\n \n this.prevPos = createVector(posX,posY);\n \n this.colour = hue;\n this.visible = true;\n \n this.mortal = false; // Default, an immortal.\n this.birthTime = millis(); // Birth time.\n this.longevity = 30000; // 30 seconds.\n // Below allows us to pass in string\n // to write custom functions\n // when particle's longevity met.\n // NB leave as \"\" for default call of 'setActive(false)';\n this.afterLife = \"\"; \n \n this.screenWrap = true;\n \n this.velocity = createVector(0,0);\n this.acceleration = createVector(0,0);\n this.maxV = 1; // Topspeed.\n //this.gravity = Math.random(0.8)+0.09;\n this.gravity = 0; // Gravity that pulls to bottom of window.\n this.gravityON = false; // Gravity that pulls to bottom of window.\n \n this.damp = 0.5;\n this.dampingON = true;\n \n this.frozen = false;\n this.solid = false;\n \n // Want to bounce when hit ground or walls?\n this.groundSolid = false;\n this.wallSolid = false;\n \n this.bounciness = Math.random(0.1,7); // The higher the bounciness.\n // NB highest value is 7. Must change this.bounce() below.\n \n this.flickable = false;\n \n this.flickStrength = 7.2;\n \n // Parameters = *what* is a string, allowing you to render\n // particle in chosen style.\n // *alphaVal* is a number, from 0 to 255, setting alpha.\n this.render = function(what, alphaVal){\n \n if (!this.visible) return;\n \n if (what===\"trail\"){\n \n var colourScale = 100;\n \n var Bc = colourScale * Math.abs(this.velocity.mag())*4;\n var Gc = colourScale * Math.abs(this.velocity.x);\n var Rc = colourScale * Math.abs(this.velocity.y);\n \n Rc = constrain(Rc, 120, 255);\n Gc = constrain(Gc, 120, 255);\n Bc = constrain(Bc, 120, 255);\n \n //stroke(Rc,Gc,Bc,alphaVal);\n fill(0,0,Bc, alphaVal); \n //strokeWeight(4);\n line(this.pos.x,this.pos.y,this.prevPos.x,this.prevPos.y);\n this.prevPos = this.pos;\n return null;\n }\n \n else if (what===\"earthquaking\"){\n \n \n var colourScale = 100;\n \n var Bc = colourScale * Math.abs(this.velocity.mag())*4;\n var Gc = colourScale * Math.abs(this.velocity.x);\n var Rc = colourScale * Math.abs(this.velocity.y);\n \n Rc = constrain(Rc, 200, 255);\n Gc = constrain(Gc, 200, 255);\n Bc = constrain(Bc, 200, 255);\n \n //stroke(Rc,Gc,Bc,alphaVal);\n fill(Rc,Gc,Bc, alphaVal); \n \n //stroke (255,255,255); \n //strokeWeight(3);\n if (!quantum) noStroke();\n else stroke (255,255);\n \n fill(Rc,Gc,Bc, alphaVal);\n //point(this.pos.x,this.pos.y);\n ellipse(this.pos.x,this.pos.y,16,16);\n //line(this.pos.x,this.pos.y,this.prevPos.x,this.prevPos.y);\n // this.prevPos = this.pos;\n return null;\n \n }\n else {\n // Last resort, draw a point.\n stroke (255,255,255,alphaVal); \n strokeWeight(8);\n point(this.pos.x,this.pos.y);\n }\n \n \n \n };\n \n // Flicks particle upwards.\n this.flick = function(whichWay){\n \n this.velocity.x = 0;\n \n this.acceleration.y = -this.flickStrength;\n \n if (whichWay===\"left\") {\n if (this.acceleration.x > 0) this.acceleration.x = 0; \n this.acceleration.x -= latF;}\n else if (whichWay===\"right\"){\n if (this.acceleration.x < 0) this.acceleration.x = 0;\n this.acceleration.x += latF;}\n //console.log(\"Flicked!\");\n };\n \n this.checkMouse = function(){\n if(mouseX > this.pos.x - (this.mySize.x/2) &&\n mouseX < this.pos.x + (this.mySize.x/2) &&\n mouseY > this.pos.y - (this.mySize.y/2) &&\n mouseY < this.pos.y + (this.mySize.y/2)){\n if (mouseX < this.pos.x) { this.flick(\"right\"); return null;}\n if (mouseX > this.pos.x) {this.flick(\"left\"); return null;}\n else this.flick(\"sweet\");\n }\n\n \n \n };\n \n \n \n // Bouncing on ground only!\n // See this.flick() for 'bouncing' on solid particles.\n this.bounce = function() {\n this.pos.y = height-(this.mySize.y/2)-0.01;\n this.velocity.y = 0;//-this.velocity.y/(10-this.bounciness);\n this.acceleration.y = -this.acceleration.y/(10-this.bounciness);\n };\n \n // Checks whether this particle has\n // collided with the passed-in particle.\n // NB only works with particles.\n this.checkCollision = function(whom)\n {\n \n // NB only returns true if both particles are solid.\n if(this.frozen === false && this.solid === true &&\n whom.solid === true &&\n whom.pos.x + whom.mySize.x/2 > this.pos.x - (this.mySize.x/2) &&\n whom.pos.x - whom.mySize.x/2 < this.pos.x + (this.mySize.x/2) &&\n whom.pos.y - whom.mySize.y/2 > this.pos.y - (this.mySize.y/2) &&\n whom.pos.y + whom.mySize.y/2 < this.pos.y + (this.mySize.y/2))\n {\n \n return true;\n \n } else return false;\n };\n \nthis.setActive = function(bool){\n // If no longer active...\n if (!bool) {\n this.visible = false;\n this.frozen = true;\n this.solid = false;\n //this.pos.y = -99999; // Orbitally offscreeeeen!\n }\n};\n \n// Example of a custom afterlife state (instead of setActive(false).) \nthis.custom_snowDrop = function(){ \n \n this.birthTime = millis(); // Reborn!\n this.longevity = 5000; // 10 more seconds life!\n this.mortal = true;\n this.solid = false;\n this.frozen = false;\n // Don't forget to set new afterLife condition!\n this.afterLife = \"\";\n };\n \n this.update = function(){\n \n // Only concerns the mortal...\n if (this.mortal) {\n if (millis() - this.birthTime > this.longevity)\n {\n if (this.afterLife === \"\") this.setActive(false);\n //if (this.afterLife === \"sd\") this.custom_snowDrop();\n }\n }\n \n if (this.frozen) return;\n \n \n \n // Gravity physics, as well as general damping.\n \n \n // this.velocity.x *= this.damp;\n //this.velocity.y *= this.damp;}\n \n // Gravity (towards bottom of window).\n if (this.gravityON){\n this.acceleration.y += this.gravity;}\n \n // Core of the physics engine.\n this.pos.add(this.velocity); \n this.velocity.add(this.acceleration);\n \n // Damping (like air resistance).\n if (this.dampingON){\n \n if (this.velocity.mag() > this.maxV) // Velocity cap.\n this.velocity.setMag(this.maxV);\n // this.velocity.setMag(this.velocity.mag()* this.damp);\n // Deceleration.\n this.acceleration.setMag(this.acceleration.mag()* this.damp);\n }\n \n // Have we hit the ground?\n if (this.groundSolid && this.pos.y + (this.mySize.y/2) > height)\n this.bounce();\n \n // Check for mouse contact (i.e. flickability).\n // We check in this method since it's a physics procedure.\n if (this.flickable) this.checkMouse();\n \n \n if (this.screenWrap) {\n if (this.pos.x < 0) this.pos.x = width;\n if (this.pos.x > width) this.pos.x = 0;\n if (this.pos.y < 0) this.pos.y = height;\n if (this.pos.y > height) this.pos.y = 0;\n }\n \n \n // If hitting walls (improved).\n // At the moment, doesn't matter whether frozen.\n if(this.wallSolid && this.pos.x - (this.mySize.x/2) < 0) {\n this.pos.x = 0 + (this.mySize.x/2);\n this.acceleration.x = Math.abs(this.acceleration.x) / 2;\n }\n if(this.wallSolid && this.pos.x + (this.mySize.x/2) > width - 20) {\n this.pos.x = width - (this.mySize.x/2) - 20; \n this.acceleration.x = Math.abs(this.acceleration.x) / -2;\n }\n \n };\n \n \n}", "function Ball(){\n fill(color(255, 255, 0));\n circle(xBall, yBall, diameter);\n}", "function createParticleBasic(v, v1, v2, vScale, vel, accel, friction, dir, id, depth, alphaFade, timer, img){\n\tvar particle = {\n\t\tisParticle: true,\n\t\tevents: {\n\t\t\t/*onDestroy: function(vars, rVars){\n\t\t\t\tvar objectListToAdd = [];\n\t\t\t\tvar particleListToAdd = [];\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Do on deestroy things and add particles etc.\n\t\t\t\t//\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i < particleListToAdd.length; i++){\n\t\t\t\t\trVars.particleList = addObject(particleListToAdd[i], rVars.particleList);\n\t\t\t\t}\n\t\t\t\tgsVars.rooms.currentRoom.roomVars = rVars;\n\t\t\t\treturn {gsVars: gsVars, objectListToAdd: objectListToAdd};\n\t\t\t},*/\n\t\t\tupdate: function(vars){\n\t\t\t\tvars.vel.x += vars.accel.x;\n\t\t\t\tvars.vel.y += vars.accel.y;\n\t\t\t\tif(vars.vel.x >= vars.friction*2 || vars.vel.x <= -vars.friction*2){\n\t\t\t\t\tvars.vel.x += -vars.vel.x * vars.friction;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tvars.vel.x = 0;\n\t\t\t\t}\n\t\t\t\tif(vars.vel.y >= vars.friction*2 || vars.vel.y <= -vars.friction*2){\n\t\t\t\t\tvars.vel.y += -vars.vel.y * vars.friction;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tvars.vel.y = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Update Animation if there is one\n\t\t\t\tif(vars.img.isImg === 1){\n\t\t\t\t\tif(vars.img.sprite.isAnimation === 1){\n\t\t\t\t\t\t/*console.log(\"Current blood frame: \" + vars.img.sprite.animation.currentFrame.index\n\t\t\t\t\t\t+ \", number of loops: \" + vars.img.sprite.animation.loops);*/\n\t\t\t\t\t\t//console.log(\" Static current frame: \" + particleDetailsList1[2].details.img.sprite.animation.currentFrame.index);\n\t\t\t\t\t\tconsole.log(\"Velocity: \" + vars.vel.y);\n\t\t\t\t\t\tif(vars.img.sprite.animation.loops < vars.img.sprite.animation.maxLoops || vars.img.sprite.animation.maxLoops === -1){\n\t\t\t\t\t\t\tvars.img.sprite.animation.frameTimer = updateTimer(vars.img.sprite.animation.frameTimer);\n\t\t\t\t\t\t\tif(vars.img.sprite.animation.frameTimer.done === 1){\n\t\t\t\t\t\t\t\tvars.img.sprite.animation = updateAnimation(vars.img.sprite.animation);\n\t\t\t\t\t\t\t\tvars.img.sprite.animation.frameTimer.done = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Alpha fade\n\t\t\t\tvars.img.alpha += vars.alphaFade;\n\t\t\t\tvars.v.x += vars.vel.x\n\t\t\t\tvars.v.y += vars.vel.y\n\t\t\t\tvars.timer = updateTimer(vars.timer);\n\t\t\t\tif(vars.timer.done === 1){\n\t\t\t\t\tvars.destroy = 1;\n\t\t\t\t}\n\t\t\t\treturn vars;\n\t\t\t},\n\t\t\trender: function(vars){\n\t\t\t\tctx.save();\n\t\t\t\tif(vars.img.isImg === 1){\n\t\t\t\t\tif(vars.img.sprite.isAnimation === 1){\n\t\t\t\t\t\tdrawImg(\n\t\t\t\t\t\t\t{x: vars.v.x + vars.img.sprite.animation.currentFrame.imgObj.v1.x, y: vars.v.y + vars.img.sprite.animation.currentFrame.imgObj.v1.y},\n\t\t\t\t\t\t\t{x: vars.img.sprite.animation.currentFrame.imgObj.vOffset.x, y: vars.img.sprite.animation.currentFrame.imgObj.vOffset.y},\n\t\t\t\t\t\t\t{x: vars.v2.x + vars.img.sprite.animation.currentFrame.imgObj.v2.x, y: vars.v2.y + vars.img.sprite.animation.currentFrame.imgObj.v2.y},\n\t\t\t\t\t\t\tvars.dir + vars.img.sprite.animation.currentFrame.imgObj.dir, vars.img.sprite.animation.currentFrame.imgObj.img, 1\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\tdrawImg(\n\t\t\t\t\t\t\t{x: vars.v.x + vars.img.sprite.imgObj.v1.x, y: vars.v.y + vars.img.sprite.imgObj.v1.y},\n\t\t\t\t\t\t\t{x: vars.img.sprite.imgObj.vOffset.x, y: vars.img.sprite.imgObj.vOffset.y},\n\t\t\t\t\t\t\t{x: vars.v2.x + vars.img.sprite.imgObj.v2.x, y: vars.v2.y + vars.img.sprite.imgObj.v2.y},\n\t\t\t\t\t\t\tvars.dir + vars.img.sprite.imgObj.dir, vars.img.sprite.imgObj.img, 1\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(vars.img.type === \"circle\"){\n\t\t\t\t\t\tif(vars.img.outline === 0){\n\t\t\t\t\t\t\tdrawCircleFilled(vars.v, vars.v1, vars.v2.x, vars.vScale, vars.dir, vars.img.colour, vars.img.alpha);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(vars.img.outline === 1){\n\t\t\t\t\t\t\tdrawCircleOutline(vars.v, vars.v1, vars.v2.x, vars.vScale, vars.dir, vars.img.outlineDetails.colour, vars.img.outlineDetails.thickness, vars.img.outlineDetails.alpha);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(vars.img.type === \"rect\"){\n\t\t\t\t\t\tif(vars.img.outline === 0){\n\t\t\t\t\t\t\tdrawRectFilled(vars.v, vars.v1, vars.v2, vars.dir, vars.img.colour, vars.img.alpha);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(vars.img.outline === 1){\n\t\t\t\t\t\t\tdrawRectOutline(vars.v, vars.v1, vars.v2, vars.dir, vars.img.outlineDetails.colour, vars.img.outlineDetails.thickness, vars.img.outlineDetails.alpha);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tctx.restore();\n\t\t\t}\n\t\t},\n\t\tvars: {\n\t\t\tdestroy: 0,\n\t\t\tv: v,\n\t\t\tv1: v1,\n\t\t\tv2: v2,\n\t\t\tvScale: vScale,\n\t\t\tvel: vel,\n\t\t\taccel: accel,\n\t\t\tfriction: friction,\n\t\t\tdir: dir,\n\t\t\tid: id,\n\t\t\tdepth: depth,\n\t\t\talphaFade: alphaFade,\n\t\t\ttimer: timer,\n\t\t\timg: img\n\t\t}\n\t};\n\treturn particle;\n}", "function SolidParticleSystem(name,scene,options){// public members\n/**\n * The SPS array of Solid Particle objects. Just access each particle as with any classic array.\n * Example : var p = SPS.particles[i];\n */this.particles=new Array();/**\n * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.\n */this.nbParticles=0;/**\n * If the particles must ever face the camera (default false). Useful for planar particles.\n */this.billboard=false;/**\n * Recompute normals when adding a shape\n */this.recomputeNormals=true;/**\n * This a counter ofr your own usage. It's not set by any SPS functions.\n */this.counter=0;/**\n * This empty object is intended to store some SPS specific or temporary values in order to lower the Garbage Collector activity.\n * Please read : http://doc.babylonjs.com/overviews/Solid_Particle_System#garbage-collector-concerns\n */this.vars={};this._positions=new Array();this._indices=new Array();this._normals=new Array();this._colors=new Array();this._uvs=new Array();this._index=0;// indices index\nthis._updatable=true;this._pickable=false;this._isVisibilityBoxLocked=false;this._alwaysVisible=false;this._shapeCounter=0;this._copy=new BABYLON.SolidParticle(null,null,null,null,null,null);this._color=new BABYLON.Color4(0,0,0,0);this._computeParticleColor=true;this._computeParticleTexture=true;this._computeParticleRotation=true;this._computeParticleVertex=false;this._computeBoundingBox=false;this._cam_axisZ=BABYLON.Vector3.Zero();this._cam_axisY=BABYLON.Vector3.Zero();this._cam_axisX=BABYLON.Vector3.Zero();this._axisX=BABYLON.Axis.X;this._axisY=BABYLON.Axis.Y;this._axisZ=BABYLON.Axis.Z;this._camDir=BABYLON.Vector3.Zero();this._rotMatrix=new BABYLON.Matrix();this._invertMatrix=new BABYLON.Matrix();this._rotated=BABYLON.Vector3.Zero();this._quaternion=new BABYLON.Quaternion();this._vertex=BABYLON.Vector3.Zero();this._normal=BABYLON.Vector3.Zero();this._yaw=0.0;this._pitch=0.0;this._roll=0.0;this._halfroll=0.0;this._halfpitch=0.0;this._halfyaw=0.0;this._sinRoll=0.0;this._cosRoll=0.0;this._sinPitch=0.0;this._cosPitch=0.0;this._sinYaw=0.0;this._cosYaw=0.0;this._w=0.0;this._mustUnrotateFixedNormals=false;this._minimum=BABYLON.Tmp.Vector3[0];this._maximum=BABYLON.Tmp.Vector3[1];this._scale=BABYLON.Tmp.Vector3[2];this._translation=BABYLON.Tmp.Vector3[3];this._minBbox=BABYLON.Tmp.Vector3[4];this._maxBbox=BABYLON.Tmp.Vector3[5];this._particlesIntersect=false;this._bSphereOnly=false;this._bSphereRadiusFactor=1.0;this.name=name;this._scene=scene||BABYLON.Engine.LastCreatedScene;this._camera=scene.activeCamera;this._pickable=options?options.isPickable:false;this._particlesIntersect=options?options.particleIntersection:false;this._bSphereOnly=options?options.boundingSphereOnly:false;this._bSphereRadiusFactor=options&&options.bSphereRadiusFactor?options.bSphereRadiusFactor:1.0;if(options&&options.updatable){this._updatable=options.updatable;}else{this._updatable=true;}if(this._pickable){this.pickedParticles=[];}}", "createParticle() {\n noStroke();\n // fill(13, 115, 79);\n fill(11, 122, 83);\n ellipse(this.x, this.y, this.r);\n }", "function Particle(x, y) {\n this.pos = createVector(x, y);\n this.vel = createVector(0, 0);\n this.acc = createVector(0, 0);\n this.a = 255;\n this.val = sin(frameCount*10)*random(10,30);\n this.rand = this.val*3 +1;\n\n this.addForce = function(force) {\n this.acc.add(force);\n }\n\n this.checkEdges = function() {\n\n // Left edge\n if (this.pos.x < 0){\n this.vel.x = Math.abs(this.vel.x);\n }\n\n // Bottom\n if (this.pos.y > height){\n this.vel.y = -Math.abs(this.vel.y);\n }\n\n // right edge\n if (this.pos.x > width){\n var normalisedY = this.pos.y / height;\n send(IP_VOISIN, { y: normalisedY});\n\n // enlever\n var index = particles.indexOf(this);\n particles.splice(index, 1);\n\n }\n\n }\n\n this.update = function() {\n this.vel = this.vel.add(this.acc);\n\n this.pos.add(this.vel);\n this.acc.mult(0);\n\n this.checkEdges();\n }\n\n this.createDot = function() {\n noStroke();\n fill(245, 65, 35, this.a);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n\n }\n\n this.createAura = function() {\n\n fill(0, 152, 216,this.a*.05);\n strokeWeight(.5);\n stroke(0, 152, 216,this.a);\n ellipse(this.pos.x, this.pos.y, this.val*10, this.val*10);\n\n }\n\n this.createCircles = function() {\n push();\n strokeWeight(.5);\n stroke(11, 53, 54,this.a);\n noFill();\n var rand = random(5,10);\n ellipse(this.pos.x, this.pos.y,rand*this.val,rand*this.val);\n }\n\n\n this.alpha = function () {\n\n this.a -= .1;\n }\n\n this.wiggle = function() {\n\n this.pos.x = random(this.pos.x-30, this.pos.x+30);\n this.pos.y = random(this.pos.y-this.rand, this.pos.y+this.rand);\n }\n\n\n this.isOut = function() {\n if (this.pos.x > width || this.pos.y > height){\n return true;\n }\n return false;\n }\n\n this.evolving = function() {\n\n var k = random(.7,1.3);\n\n this.val *=k;\n }\n\n}", "function SolidParticle(particleIndex,positionIndex,model,shapeId,idxInShape,sps,modelBoundingInfo){this.idx=0;// particle global index\nthis.color=new BABYLON.Color4(1.0,1.0,1.0,1.0);// color\nthis.position=BABYLON.Vector3.Zero();// position\nthis.rotation=BABYLON.Vector3.Zero();// rotation\nthis.scaling=new BABYLON.Vector3(1.0,1.0,1.0);// scaling\nthis.uvs=new BABYLON.Vector4(0.0,0.0,1.0,1.0);// uvs\nthis.velocity=BABYLON.Vector3.Zero();// velocity\nthis.alive=true;// alive\nthis.isVisible=true;// visibility\nthis._pos=0;// index of this particle in the global \"positions\" array\nthis.shapeId=0;// model shape id\nthis.idxInShape=0;// index of the particle in its shape id\nthis.idx=particleIndex;this._pos=positionIndex;this._model=model;this.shapeId=shapeId;this.idxInShape=idxInShape;this._sps=sps;if(modelBoundingInfo){this._modelBoundingInfo=modelBoundingInfo;this._boundingInfo=new BABYLON.BoundingInfo(modelBoundingInfo.minimum,modelBoundingInfo.maximum);}}", "createParticle() {\n noStroke();\n fill('rgba(200,169,169,1)');\n circle(this.x,this.y,this.r);\n }", "createParticle() {\n noStroke();\n fill('rgba(200,169,169,random(0,1)');\n circle(this.x, this.y, this.r);\n }", "createBall() {\n\n this.ball = this.ballsGroup.create(this.paddle.x, 500, 'ball').setCollideWorldBounds(true).setBounce(1);\n //this.ball = this.physics.add.image(this.paddle.x, 500, 'ball').setCollideWorldBounds(true).setBounce(1);\n this.ball.setData('onPaddle', true);\n\n this.physics.add.collider(this.ball, this.bricksGroup, this.hitBrick, null, this);\n this.physics.add.collider(this.ball, this.paddle, this.hitPaddle, null, this);\n }", "fillParticles() {\n for (let i = 0; i < this.bloodNumber; i++) {\n let bloodParticle = new Particle(this) // creates a new particle object\n bloodParticle.color = '#00ff1050'\n bloodParticle.vector = HelperFunctions.newVector(HelperFunctions.random(HelperFunctions.random(2, -2), HelperFunctions.random(3, -3)), HelperFunctions.random(HelperFunctions.random(3, -3), HelperFunctions.random(2, -2))) // creates a random vector for this specific particle (more randomness more aesthetics)\n this.particles.push(bloodParticle)\n }\n }", "function Ball(x, y, velX, velY, exists) {\n Shape.call(this, x, y, velX, velY, exists);\n\n this.color = 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')';\n this.size = random(10,20);\n}", "function Ball(x, y, velX, velY, exists, color, size) {\n Shape.call(this, x, y, velX, velY, exists);\n this.color = color;\n this.size = size;\n}", "function Ball() {\n // dimensões\n this.x = BALL_X;\n this.y = BALL_Y;\n this.h = BALL_SIDE;\n this.w = BALL_SIDE;\n\n // cor\n this.rgba = BALL_COLOR;\n\n // velocidades nos eixos x e y\n this.vx = 0.0;\n this.vy = 0.0;\n}", "function Ball(x, y, velX, velY, color, size) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n}", "function Ball(x, y, velX, velY, exists, color, size) {\r\n Shape.call(this, x, y, velX, velY, exists);\r\n\r\n this.color = color;\r\n this.size = size;\r\n}", "function Particle(x, y) {\n this.r = 8;\n\n // Define a body\n var bd = new box2d.b2BodyDef();\n bd.type = box2d.b2BodyType.b2_dynamicBody;\n bd.position = scaleToWorld(x,y);\n\n // Define a fixture\n var fd = new box2d.b2FixtureDef();\n // Fixture holds shape\n fd.shape = new box2d.b2CircleShape();\n fd.shape.m_radius = scaleToWorld(this.r);\n\n // Some physics\n fd.density = 1.0;\n fd.friction = 0.1;\n fd.restitution = 0.3;\n\n // Create the body\n this.body = world.CreateBody(bd);\n // Attach the fixture\n this.body.CreateFixture(fd);\n\n // Some additional stuff\n this.body.SetLinearVelocity(new box2d.b2Vec2(random(-5, 5), random(2, 5)));\n this.body.SetAngularVelocity(random(-5,5));\n\n // This function removes the particle from the box2d world\n this.killBody = function() {\n world.DestroyBody(this.body);\n };\n\n // Is the particle ready for deletion?\n this.done = function() {\n // Let's find the screen position of the particle\n var pos = scaleToPixels(this.body.GetPosition());\n // Is it off the bottom of the screen?\n if (pos.y > height+this.r*2) {\n this.killBody();\n return true;\n }\n return false;\n };\n\n // Drawing the box\n this.display = function() {\n // Get the body's position\n var pos = scaleToPixels(this.body.GetPosition());\n // Get its angle of rotation\n var a = this.body.GetAngleRadians();\n\n // Draw it!\n rectMode(CENTER);\n push();\n translate(pos.x,pos.y);\n rotate(a);\n fill(127);\n stroke(200);\n strokeWeight(2);\n ellipse(0,0,this.r*2,this.r*2);\n // Let's add a line so we can see the rotation\n line(0,0,this.r,0);\n pop();\n };\n}", "function Ball(position, btnPosition, mass, recPosition, recWidth, recHeight, sound, move) {\n this.position = position;\n this.btnPosition = btnPosition;\n // speedX = some number between -1 and 1\n // speedY = some number between -1 and 0\n this.velocity = createVector(random(-.5, 1), random(-1, 0));\n this.acceleration = createVector(0, 0.05);\n this.mass = mass; // totally made up, do whatever here\n this.recPosition = recPosition;\n this.recHeight = recHeight;\n this.recWidth = recWidth;\n this.sound = sound;\n // this.alpha = 255;\n this.move = move;\n}", "function Ball(tempX, tempY, tempW) {\n this.x = tempX;\n this.y = tempY;\n this.w = tempW;\n this.speed = 0;\n this.gravity = 0.1;\n this.life = 255;\n\n this.move = function () {\n // Add gravity to speed\n this.speed = this.speed + this.gravity;\n // Add speed to y location\n this.y = this.y + this.speed;\n // If square reaches the bottom\n // Reverse speed\n if (this.y > s.height) {\n // Dampening\n this.speed = this.speed * -0.8;\n this.y = s.height;\n }\n };\n\n this.finished = function () {\n // Balls fade out\n this.life--;\n if (this.life < 0) {\n return true;\n } else {\n return false;\n }\n };\n\n this.display = function () {\n // Display the circle\n s.fill(0, this.life);\n //stroke(0,life);\n s.ellipse(this.x, this.y, this.w, this.w);\n };\n }", "function createBall() {\n ball = Matter.Bodies.circle(WINDOWWIDTH / 2, WINDOWHEIGHT / 2, BALLRADIUS, {\n label: 'ball',\n density: BALLDENSITY,\n friction: BALLFRICTION,\n frictionAir: BALLAIRFRICTION,\n restitution: BALLBOUNCE,\n render: {\n fillStyle: BALLCOLOR,\n },\n bounds: {\n min: { x: WALLTHICKNESS, y: WALLTHICKNESS },\n max: { x: WINDOWWIDTH - WALLTHICKNESS, y: WINDOWHEIGHT - WALLTHICKNESS }\n }\n });\n Matter.World.add(world, ball);\n }", "function Ball (_x, _y, _diameter) {\n this.x = _x;\n this.y = _y;\n this.diameter = _diameter;\n this.color = 'gray';\n this.stroke = noStroke();\n\n this.display = function() {\n fill(this.color);\n ellipse(this.x,this.y,this.diameter);\n }\n\n this.rollover1 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y);\n if(d < this.diameter){\n this.color = '#FCB97D';\n }else{\n\n this.color = 'gray';\n }\n }\n\n\n this.rollover2 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y+50);\n if(d < this.diameter){\n this.color = '#A9CBB7';\n }else{\n this.color = 'gray';\n }\n }\n\n\n this.rollover3 = function(_px, _py) {\n var d = dist(_px,_py, this.x, this.y-50);\n if(d < this.diameter){\n this.color = '#F78571';\n }else{\n this.color = 'gray';\n }\n }\n\n var yDir = 1; //y direction\n var xDir = 1;\n\n this.move = function() {\n this.x += this.speed * xDir;\n this.y += this.speed * yDir;\n\n if (this.y > height || this.y < 0) {\n yDir = yDir * -1;\n }\n\n if (this.x > width || this.x < 0) {\n xDir = xDir * -1;\n }\n }\n}", "function gameBounce(state) {\r\n if (!state) {\r\n return;\r\n }\r\n\r\n for (let ball of state.balls) {\r\n var bax = ball.pos.x;\r\n var bay = ball.pos.y;\r\n var rad = ball.rad;\r\n\r\n // Rebonds sur les bords horizontaux\r\n if (bay + rad + ball.vel.y > BOARD_HEIGHT || bay - rad + ball.vel.y < 0) {\r\n ball.vel.y = -ball.vel.y;;\r\n }\r\n\r\n const paddleOne = state.paddles[0];\r\n const paddleTwo = state.paddles[1];\r\n\r\n // Rebond sur la raquette du joueur 1\r\n if (bax - rad + ball.vel.x <= paddleOne.size.w) {\r\n if (bay + rad >= paddleOne.pos.y && bay - rad <= paddleOne.pos.y + paddleOne.size.h) {\r\n // Calcul de l'angle de rebond\r\n let collidePoint = (bay - (paddleOne.pos.y + paddleOne.size.h/2)) / (paddleOne.size.h/2);\r\n let collideAngle = Math.PI/4 * collidePoint;\r\n let ballSpeed = Math.sqrt(ball.vel.x**2 + ball.vel.y**2);\r\n\r\n ball.vel.x = -ballSpeed*Math.abs(Math.cos(collideAngle)) * ball.vel.x/Math.abs(ball.vel.x)\r\n ball.vel.y = ballSpeed*Math.sin(collideAngle)\r\n }\r\n }\r\n\r\n // Rebond sur la raquette du joueur \r\n if (bax + rad + ball.vel.x >= BOARD_WIDTH - paddleTwo.size.w) {\r\n if (bay + rad >= paddleTwo.pos.y && bay - rad <= paddleTwo.pos.y + paddleTwo.size.h) {\r\n // Calcul de l'angle de rebond\r\n let collidePoint = (bay - (paddleOne.pos.y + paddleOne.size.h/2)) / (paddleOne.size.h/2);\r\n let collideAngle = Math.PI/4 * collidePoint;\r\n let ballSpeed = Math.sqrt(ball.vel.x**2 + ball.vel.y**2);\r\n\r\n ball.vel.x = -ballSpeed*Math.abs(Math.cos(collideAngle)) * ball.vel.x/Math.abs(ball.vel.x)\r\n ball.vel.y = ballSpeed*Math.sin(collideAngle)\r\n }\r\n }\r\n\r\n // Collisions avec les briques\r\n for (var c=0; c < state.bricks.colCount; c++) {\r\n for (var r=0; r < state.bricks.rowCount; r++) {\r\n var brick = state.bricks.list[c][r];\r\n if (brick.status == 1) {\r\n if (bax + rad >= brick.x && bax-rad <= brick.x + state.bricks.width\r\n && bay + rad >= brick.y && bay-rad <= brick.y + state.bricks.height) {\r\n // Calcul de l'angle de rebond\r\n let collidePoint = (bay - (brick.y + state.bricks.height/2)) / (state.bricks.height/2);\r\n let collideAngle = Math.PI/4 * collidePoint;\r\n let ballSpeed = Math.sqrt(ball.vel.x**2 + ball.vel.y**2);\r\n\r\n ball.vel.x = -ballSpeed*Math.abs(Math.cos(collideAngle)) * ball.vel.x/Math.abs(ball.vel.x)\r\n ball.vel.y = ballSpeed*Math.sin(collideAngle)\r\n\r\n // Calcul des bonus/malus\r\n brick.status = 0;\r\n if (brick.color == \"lightgreen\"){ // Grande taille\r\n ball.rad = 1.2*ball.rad;\r\n }\r\n else if(brick.color == \"yellow\"){ // Accélération\r\n ball.vel.x = 1.2*ball.vel.x;\r\n ball.vel.y = 1.2*ball.vel.y;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "function Ball(x,y,vx,vy,size,speed) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.size = size;\n this.speed = speed;\n}", "function Ball(x, y, mass, speedx, speedy, properties) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.speedx = speedx;\n\tthis.speedy = speedy;\n\tthis.mass = mass;\n this.trace = false;\n this.traceArray = [];\n this.i = 0;\n this.period = 2;\n this.properties = {};\n this.setProperties(properties);\n}", "function Particle(){\n\t//each gets a random start position\n\tthis.x = Math.random()*W;\n\tthis.y = Math.random()*H;\n\t//set up a random velocity for each particle\n\tthis.vx = Math.random()*20-10;\n\tthis.vy = Math.random()*20-10;\t\n\t//give each a random color\n\tvar r = Math.random()*255>>0;\n\tvar g = Math.random()*255>>0;\n\tvar b = Math.random()*255>>0;\n\tthis.color = \"rgba(\"+ r + \",\"+ g +\",\"+ b +\",0.5)\";\n\t//give each a random size\n\tthis.radius = Math.random()*20+20;\n}//closes function particle", "function Ball(paddle) {\n // en el caso que haya varios paddles this.paddle --> decouple ball from paddle\n this.paddle = new Paddle;\n this.size = 20;\n this.speed = 10;\n // 011 poison balls, less than 10 in 100 numbers\n this.bad = (random(0, 100) < 10);\n\n // método que inicializa la ball con RANDOM\n this.init = function() {\n this.y = random(-height,-20);\n this.x = random(20, width-20);\n }\n\n // método para que aparezca la ball\n this.render = function() {\n if (this.bad){\n fill(255, 0, 0);\n } else {\n fill(0,0,255);\n }\n\n // hacerlo totalmente relativo\n ellipse(this.x, this.y, this.size, this.size);\n noStroke();\n }\n\n // método update nos dice que cuando la ball llega llegue más bajo que la altura de la pantalla: generar una nueva ball\n this.update = function() {\n this.y += this.speed;\n\n // 007\n // function to test the paddle collision\n this.testPaddle();\n\n if (this.y - this.size > height){\n this.init();\n }\n }\n\n //008 implementamos el testPaddle fuera para mantener el this.update más concentrado\n this.testPaddle = function() {\n\n // inicial code\n // if (this.y + this.size/2 > this.paddle.y && this.y - this.size/2 < this.paddle.y + this.paddle.height)\n\n // this.y + this.size/2 > this.paddle.y\n // y position of ball + half size is greater than paddle y value (= top of paddle)\n // that means that the ball is in the range to strike the top of the paddle\n\n // this.y - this.size/2 < this.paddle.y + this.paddle.height\n // y position - size/2 = top of the ball is less than the bottom of the paddle\n\n // console.log(this.paddle);\n\n var top = (this.y + this.size/2 > this.paddle.y);\n var bottom = (this.y - this.size/2 < this.paddle.y + this.paddle.height);\n var left = (this.x + this.size/2 > this.paddle.x);\n var right = (this.x - this.size/2 < this.paddle.x + this.paddle.width);\n\n if (top && bottom && left && right){\n\n if(this.bad){\n this.paddle.hit();\n } else {\n this.paddle.score();\n }\n\n this.init();\n //this.speed = 0;\n }\n }\n\n// METHOD AT THE END: so that it gets defined before it is called\n this.init();\n}", "update() {\n if ((this.y + this.particleSize) > this.floor) {\n this.vy *= -this.bounce;\n this.vx *= this.bounce;\n this.y = this.floor - this.particleSize;\n }\n if ((this.x + this.particleSize) > this.width) {\n this.vy *= this.bounce;\n this.vx *= -this.bounce;\n this.x = this.width - this.particleSize;\n }\n if ((this.x) < 0) {\n this.vy *= this.bounce;\n this.vx *= -this.bounce;\n this.x = this.particleSize;\n }\n this.x += this.vx;\n this.y += this.vy;\n this.vy += this.gravity;\n this.particleSize -= (this.life * 0.002);\n this.life++;\n\n return {\n x: Math.round(this.x),\n y: Math.round(this.y),\n size: Math.round(this.particleSize),\n life: this.life,\n maxLife: this.maxLife\n };\n }", "function Ball(x, y, vx, vy, size, speed) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.size = size;\n this.speed = speed;\n this.fill = 100;\n}", "function update() {\n\t\n\t// Update scores\n\tupdateScore(); \n\t\n\t// Move the paddles on mouse move\n\tif(mouse.x && mouse.y) {\n\t\tfor(var i = 1; i < paddles.length; i++) {\n\t\t\tp = paddles[i];\n\t\t\tp.x = mouse.x - p.w/2;\n\t\t}\t\t\n\t}\n\t\n\t// Move the ball\n\tball.x += ball.vx;\n\tball.y += ball.vy;\n\t\n\t// Collision with paddles\n\tp1 = paddles[1];\n\tp2 = paddles[2];\n\t\n\t// If the ball strikes with paddles,\n\t// invert the y-velocity vector of ball,\n\t// increment the points, play the collision sound,\n\t// save collision's position so that sparks can be\n\t// emitted from that position, set the flag variable,\n\t// and change the multiplier\n\tif(collides(ball, p1)) {\n\t\tcollideAction(ball, p1);\n\t}\n\t\n\t\n\telse if(collides(ball, p2)) {\n\t\tcollideAction(ball, p2);\n\t} \n\t\n\telse {\n\t\t// Collide with walls, If the ball hits the top/bottom,\n\t\t// walls, run gameOver() function\n\t\tif(ball.y + ball.r > H) {\n\t\t\tball.y = H - ball.r;\n\t\t\tgameOver();\n\t\t} \n\t\t\n\t\telse if(ball.y < 0) {\n\t\t\tball.y = ball.r;\n\t\t\tgameOver();\n\t\t}\n\t\t\n\t\t// If ball strikes the vertical walls, invert the \n\t\t// x-velocity vector of ball\n\t\tif(ball.x + ball.r > W) {\n\t\t\tball.vx = -ball.vx;\n\t\t\tball.x = W - ball.r;\n\t\t}\n\t\t\n\t\telse if(ball.x -ball.r < 0) {\n\t\t\tball.vx = -ball.vx;\n\t\t\tball.x = ball.r;\n\t\t}\n\t}\n\t\n\t\n\t\n\t// If flag is set, push the particles\n\tif(flag == 1) { \n\t\tfor(var k = 0; k < particlesCount; k++) {\n\t\t\tparticles.push(new createParticles(particlePos.x, particlePos.y, multiplier));\n\t\t}\n\t}\t\n\t\n\t// Emit particles/sparks\n\temitParticles();\n\t\n\t// reset flag\n\tflag = 0;\n}", "createParticle() {\n noStroke();\n // strokeWeight(1);\n \n if(this.isSick) {\n fill(color(200,0,0));\n } else {\n if(this.daysImmune > 0) {\n fill(200);\n } else {\n fill(100);\n // stroke(255);\n // fill(255);\n }\n }\n circle(this.position.x,this.position.y,this.r);\n\n // show radius of influence\n if(showInfectionRadius && this.isSick) {\n strokeWeight(1);\n stroke(150,20,20);\n noFill();\n circle(this.position.x,this.position.y,neighborhoodSize);\n }\n }", "function collideAction(ball, p) {\n ball.vx = -ball.vx;\n\n if (paddleHit == LEFT) {\n ball.x = p.x + p.w;\n particlePos.x = ball.x + ball.r;\n multiplier = 1;\n }\n\n else if (paddleHit == RIGHT) {\n ball.x = p.x - p.w - ball.r;\n particlePos.x = ball.x - ball.r;\n multiplier = -1;\n }\n\n points++;\n increaseSpd();\n // shrinkPdl();\n\n if (collision) {\n if (points > 0)\n collision.pause();\n\n collision.currentTime = 0;\n //collision.play();\n }\n\n particlePos.x = ball.x;\n flag = 1;\n}", "function update() {\n\n // Update scores\n updateScore();\n\n // Move the paddles on mouse move\n if (mouse.x && mouse.y) {\n for (var i = 0; i < paddles.length; i++) {\n p = paddles[i];\n p.y = mouse.y - p.h / 2;\n }\n }\n\n // Move the ball\n ball.x += ball.vx;\n ball.y += ball.vy;\n\n // Collision with paddles\n p1 = paddles[0];\n p2 = paddles[1];\n\n // If the ball strikes with paddles,\n // invert the y-velocity vector of ball,\n // increment the points, play the collision sound,\n // save collision's position so that sparks can be\n // emitted from that position, set the flag variable,\n // and change the multiplier\n if (collides(ball, p1)) {\n collideAction(ball, p1);\n }\n else if (collides(ball, p2)) {\n collideAction(ball, p2);\n }\n else {\n // Collide with walls, If the ball hits the left/right,\n // walls, run gameOver() function\n if (ball.x > W) {\n ball.x = W - ball.r;\n gameOver();\n }\n else if (ball.x < 0) {\n ball.x = ball.r;\n gameOver();\n }\n\n // If ball strikes the horizontal walls, invert the\n // y-velocity vector of ball\n if (ball.y + ball.r > H) {\n ball.vy = -ball.vy;\n ball.y = H - ball.r;\n }\n else if (ball.y - ball.r < 0) {\n ball.vy = -ball.vy;\n ball.y = ball.r;\n }\n }\n\n // If flag is set, push the particles\n if (flag == 1) {\n for (var k = 0; k < particlesCount; k++) {\n particles.push(new createParticles(particlePos.x, particlePos.y, multiplier));\n }\n }\n\n // Emit particles/sparks\n emitParticles();\n\n // reset flag\n flag = 0;\n}", "function draw(){\n\n // Colouring the background\n background(\"rgb(100,200,255)\");\n\n // Updating the engine\n Engine.update(engine);\n \n // Displaying a text\n textSize(20);\n textFont(\"Algerian\");\n text(\"You can also click on the circles to drag them.\",120,100);\n\n // Displaying the paricles\n for(var j = 0; j < particles.length; j++) {\n particles[j].show();\n } \n\n // Drawing a line between the mouse and the particle which is clicked \n if(mConstraint.body) {\n var pos = mConstraint.body.position;\n var offset = mConstraint.constraint.pointB;\n var m = mConstraint.mouse.position;\n line(pos.x + offset.x,pos.y + offset.y,m.x,m.y)\n }\n\n // Displaying the ground\n ground.display();\n\n // Creating the coness\n cone1 = triangle(0,70,55,5,110,70);\n cone2 = triangle(690,70,745,5,800,70);\n // Fillng the colour red to the cone\n fill(\"red\");\n\n // Adding the cones to the world\n World.add(world,cone1);\n World.add(world,cone2);\n \n // Displaying the castle pillar\n castlepillar1.display();\n castlepillar2.display();\n\n // Displaying the wall\n wall.display();\n\n for(var x = 0; x < rectangle.length; x++) {\n rectangle[x].display();\n }\n\n for(var z = 0; z < part.length; z++) {\n part[z].display();\n }\n\n strokeWeight(2); \n\n // Creating different lines\n line1 = line(30,70,80,120);\n line2 = line(80,120,30,170);\n line3 = line(30,170,80,220);\n line4 = line(80,220,30,270);\n line5 = line(30,270,80,320);\n line6 = line(80,320,30,370);\n line7 = line(30,370,80,420);\n line8 = line(80,420,30,470);\n line9 = line(30,470,80,520);\n line10 = line(80,520,30,570);\n line11 = line(80,70,30,120);\n line12 = line(30,120,80,170);\n line13 = line(80,170,30,220);\n line14 = line(30,220,80,270);\n line15 = line(80,270,30,320);\n line16 = line(30,320,80,370);\n line17 = line(80,370,30,420);\n line18 = line(30,420,80,470);\n line19 = line(80,470,30,520);\n line20 = line(30,520,80,570);\n line21 = line(770,70,720,120);\n line22 = line(720,120,770,170);\n line23 = line(770,170,720,220);\n line24 = line(720,220,770,270);\n line25 = line(770,270,720,320);\n line26 = line(720,320,770,370);\n line27 = line(770,370,720,420);\n line28 = line(720,420,770,470);\n line29 = line(770,470,720,520);\n line30 = line(720,520,770,570);\n line31 = line(720,70,770,120);\n line32 = line(770,120,720,170);\n line33 = line(720,170,770,220);\n line34 = line(770,220,720,270);\n line35 = line(720,270,770,320);\n line36 = line(770,320,720,370);\n line37 = line(720,370,770,420);\n line38 = line(770,420,720,470);\n line39 = line(720,470,770,520);\n line40 = line(770,520,720,570);\n line41 = line(55,70,55,570);\n line42 = line(745,70,745,570);\n\n // Creating the wall lines\n wallline1 = line(120,220,120,570);\n wallline2 = line(160,220,160,570);\n wallline3 = line(200,220,200,570);\n wallline4 = line(240,220,240,570);\n wallline5 = line(280,220,280,570);\n wallline6 = line(320,220,320,570);\n wallline7 = line(360,220,360,570);\n wallline8 = line(400,220,400,570);\n wallline9 = line(440,220,440,570);\n wallline10 = line(480,220,480,570);\n wallline11 = line(520,220,520,570);\n wallline12 = line(560,220,560,570);\n wallline13 = line(600,220,600,570);\n wallline14 = line(640,220,640,570);\n wallline15 = line(680,220,680,570);\n wallline16 = line(80,260,720,260);\n wallline17 = line(80,300,720,300);\n wallline18 = line(80,340,720,340);\n wallline19 = line(80,380,720,380);\n wallline20 = line(80,420,720,420);\n wallline21 = line(80,460,720,460);\n wallline22 = line(80,500,720,500);\n wallline23 = line(80,540,720,540);\n\n // Displaying the gate\n gate1.display();\n gate2.display();\n\n // Creating the gate lines \n gateline1 = line(325,370,325,570);\n gateline2 = line(375,370,375,570);\n gateline3 = line(425,370,425,570);\n gateline4 = line(475,370,475,570);\n gateline5 = line(300,400,500,400);\n gateline6 = line(300,445,500,445);\n gateline7 = line(300,490,500,490);\n gateline8 = line(300,535,500,535);\n\n for(var y = 0; y < design.length; y++) {\n design[y].display();\n }\n}", "function Particle(x, y, xs, ys) {\n this.x=x;\n this.y=y;\n this.xs=xs;\n this.ys=ys;\n this.life=0;\n}", "powerUpBrickBreaker() {\r\n if (this.powerUps.isActive(BrickBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n\r\n this.ball.behaviors(this.bricks, this.blocks);\r\n }\r\n }", "function Ball(position_x_, position_y_) {\n\t\t\t/* Now, to properly interpolate an animation, you need to keep track of its current and last position. */\n\t\t\t/* the interesting thing about interpolation is that to do it propperly, you never actually render the most recent update. */\n\t\t\t/* You render the last update or the interpolated position of an object between its last position and current position. */\n\t\t\t/* You can't predict the future, so you draw between the last position you know and current position you are at. */\n\t\t\t/* The user is none the wiser and the interpolation makes up for the fixed time step game loop's sometimes choppy appearance. */\n\t\t\tthis.current_position = new Point(position_x_, position_y_);\n\t\t\tthis.last_position = new Point(position_x_, position_y_);\n\t\t\tthis.velocity = 2;\n\t\t}", "updateParticle(){\n //let distance from the center \n let distance = Math.sqrt(\n ((this.x - r1X) * (this.x - r1X)) \n + ((this.y - r1Y) * (this.y - r1Y))\n )\n if (distance > 150){\n this.color = particleColor\n }\n let distance2 = Math.sqrt(\n ((this.x - r2X) * (this.x - r2X))\n + ((this.y - r2Y) * (this.y - r2Y))\n )\n if(distance2 > 135 && distance >=150){\n this.color = particleColorAlfa\n this.x = 350\n this.y = 350\n }\n //move particle\n this.x += this.directionX \n this.y += this.directionY *2\n // draw particle\n this.draw();\n }", "function Ball(ballX, ballY, speedX, speedY, hueBall)\n{\n this.x = ballX;\n this.y = ballY;\n \n \n this.spX = speedX;\n this.spY = speedY;\n \n this.hBall = hueBall;\n \n \n \n//these are like putting functions in your functions\n this.drawBall1 = function() {\n Stroke();\n \n fill(this.hBall, 0, 89);\n \n ellipse(this.y,this.x,shade, 300,293); \n stroke(230,7);\n \n //head\n ellipse(this.y,67,this.y,32, 20); \n stroke(60,7);\n \n \n \n \n \nellipse(startY*25,startX/2,40,200);\n fill(256,9,9,9);\n \nellipse(startY*25,startX/3,20,700,9);\n fill(25,9);\n \n //horizontal circles\n stroke(230,79);\n \n fill(0,255,70);\nellipse(750,700,startX,startY,7,5);\n\n \n }\n \n \n//these are like putting functions in your functions\n this.drawBall = function() {\n noStroke();\n fill(this.hBall, 90, 89);\n \n line(this.y,this.x, 30,23); \n stroke(230,7);\n \n //head\n ellipse(this.y,this.x, 32, 20); \n stroke(20,7,98);\n \n rect(this.y,this.x, 7,this.x, 29); \n stroke(20,7,);\n fill(random,2,90);\n \n ellipse(this.y,this.x, 450, 100); \n stroke(2,7);\n \n fill(100,7,8);\n rect(this.y+5,this.x, 5, 100); \n stroke(23,9);\n \n ellipse(this.y+8,this.x,this.x, 45, 10); \n stroke(235,9);\n \n fill(random,0,98,9);\n ellipse(this.y+6,this.x,this.x, 45, 100); \n stroke(235);\n \n \n\n \n }\n //these are like putting functions in your functions\n this.drawBall1 = function() {\n \n noStroke();\n fill(this.hBall, 90, 8);\n \n rect(this.y, 30,60); \n stroke(random,890,0);\n \n //head\n ellipse(this.y,this.y,this.x, 39, 20); \n stroke(299,7);\n fill(20,9);\n \n ellipse(this.y,this.x, 7,this.x,this.drawball,29); \n stroke(10,7,);\n fill(random,20,18);\n \n ellipse(this.y,this.x, 45, 100); \n fill(245);\n //moon\n ellipse(this.y, 45, 88); \n fill(34,208,0);\n ellipse(this.y*2, 4, 10); \n ellipse(this.y/2, 5, 10);\n \n ellipse(this.y/3, 65, 20);\n rect(this.y+4,4,10);\n stroke(2,9,3);\n \n fill(100,7,8);\n rect(this.y+5,this.x, 5, 10); \n stroke(23,9);\n \n fill(100,7,80);\n ellipse(this.y,this.x, 100, 10); \n stroke(23,9);\n \n fill(this.hBall, 9, 89);\n rotate(map(mouseX, 70, width, 0, PI));\n ellipse(this.y+8,this.x,this.x, 4, 10); \n stroke(255,9);\n \n \n \n ellipse(this.y+6,this.x,this.x, 45, 100); \n stroke(25);\n \n \n \n \n \n \n \n\n \n }\n \n this.moveBall = function() {\n this.x += this.spX;(78);\n this.y += this.spY;\n this.z += this.spZ; \n }\n \n this.bounceBall = function() {\n if (this.x < 70 || this.x > width - 50)\n this.spX = -this.spX;\n if (this.y < 50 || this.y > height - 50)\n this.spY = -this.spY;\n \n \n }\n \n \n \n \n \n this.isCollided = function(otherX, otherY){\n if(dist(this.x, this.y, otherX, otherY) <= 200)\n \n \n return true; \n \n \n }\n \n this.reset = function(){\n background(90);\n this.x = random(50, width-3);\n this.y = random(50, height-20);\n \n \n this.spX = random(1,1);\n this.spY = random(2,6);\n \n this.hBall = random(360);\n \n }\n \n}", "function collideAction(ball, p) {\n\tball.vy = -ball.vy;\n\t\n\tif(paddleHit == 1) {\n\t\tball.y = p.y - p.h;\n\t\tparticlePos.y = ball.y + ball.r;\n\t\tmultiplier = -1;\t\n\t}\n\t\n\telse if(paddleHit == 2) {\n\t\tball.y = p.h + ball.r;\n\t\tparticlePos.y = ball.y - ball.r;\n\t\tmultiplier = 1;\t\n\t}\n\t\n\tpoints++;\n\tincreaseSpd();\n\t\n\tif(collision) {\n\t\tif(points > 0) \n\t\t\tcollision.pause();\n\t\t\n\t\tcollision.currentTime = 0;\n\t\tcollision.play();\n\t}\n\t\n\tparticlePos.x = ball.x;\n\tflag = 1;\n}", "function shakaParticles() {\n jmParticleEngine.init('shred-the-gnar-canvas', window.innerWidth, window.innerHeight);\n\n function particleGenerator() {\n var size = jmParticleEngine.randomNumber(200, -64, true);\n\n return jmParticleEngine.generateParticle(\n // Start at the emitter's x co-ordinate.\n this.x ,\n // Start at the emitter's y co-ordinate.\n this.y ,\n // Width.\n size,\n // Height.\n size,\n // Rotation.\n jmParticleEngine.randomNumber(Math.PI * 2, 0, false),\n // xVelocity.\n jmParticleEngine.randomNumber(50, 30, false),\n // yVelocity.\n jmParticleEngine.randomNumber(50, 30, false),\n // Life.\n 180,\n // How will particle change size vs life.\n // 0 - no change, same size always.\n // 1 - smaller with age.\n // 2 - larger with age.\n 2,\n // Red.\n jmParticleEngine.randomNumber(32, 0, true),\n // Green.\n 0,\n // Blue.\n 0,\n // If we wish to use a preloaded image, specify index here.\n 0\n );\n }\n\n var emit1 = jmParticleEngine.generateEmitter(Math.ceil(window.innerWidth / 2),\n Math.ceil(window.innerHeight / 2), 200, particleGenerator);\n emit1.preloadImage(shakaIcon);\n\n jmParticleEngine.addEmitter(emit1, true);\n}", "setupBall() {\n // Add ball mesh to scene\n const edgeOffset = 30.0;\n const startingPositionX = this.terrain.terrainWidth / 2.0 - edgeOffset;\n const startingPositionZ = this.terrain.terrainHeight / 2.0 - edgeOffset;\n this.ball = new Ball(this, startingPositionX, startingPositionZ);\n this.add(this.ball);\n\n // Hacky way to push the ball up\n this.ball.position.set(0, this.ball.radius, 0);\n }", "constructor(game, pos, BallSize, mass, PitchBoundary)\n {\n super(game, pos, BallSize, new Phaser.Point(0, 0), -1, new Phaser.Point(0, 1), mass, new Phaser.Point(1, 1), 0, 0);\n\n this.m_PitchBoundary = PitchBoundary;\n }", "function draw() {\n background(20);\n\n // for-loop that goes through the balls array, calling Ball.js's methods for each one\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n}", "_serveBall() {\r\n\r\n }", "function Ball(x, y, radius, dx, dy, side, created) {\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d');\n this.radius = radius;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.side = side;\n this.created = created\n }", "function create_particle(){\n\t// random x, y position for each particle\n\tthis.x = Math.random()*500;\n\tthis.y = Math.random()*500;\n\t\n\t// random x, y velocity for each particle\n\t// subtracting 10 should make half of them get negative numbers (they'll move the opposite way)\n\tthis.vx = Math.random()*20-10;\n\tthis.vy = Math.random()*20-10;\n\t\n\t// random color for each particle\n\tvar r = Math.random()*255>>0;\n\tvar g = Math.random()*255>>0;\n\tvar b = Math.random()*255>>0;\n\t\n\tthis.color = \"rgba(\"+r+\",\"+g+\",\"+b+\",0.5)\";\n\t\n\t// random size radius between 20 and 40\n\tthis.radius = Math.random()*20+20;\n}", "function makeBall(xcoord, ycoord, color, velx = 0, vely = 0, fixed = 0) {\n let statObj = {x: xcoord, y: ycoord, velx: velx, vely: vely};\n ball = document.createElement(\"div\");\n ball.style.backgroundColor = color;\n ball.className = \"ball\";\n ball.style.height = ball.style.width = size;\n ball.style.top = ycoord;\n ball.style.left = xcoord;\n document.body.appendChild(ball);\n if (!fixed) {\n // only free balls will be updated\n balls.push([ball,statObj]);\n }\n}", "function displayBombs() {\n fill(ballColour);\n \n for (let b = 0; b < numberofbombs; b++) {\n circle(bombposX[b], bombposY[b], bombSize)\n \n hit = collidePointCircle(mouseX, mouseY - duck.height * duckScalar / 2, bombposX[b], bombposY[b], bombSize);\n \n if (hit) {\n endGame();\n }\n }\n}", "createParticle(img) {\n p.image(img, this.x, this.y, this.r, this.r);\n }", "function ArenaParticle(position, vector, size, type, lifespan, fadelength, colour)\r\n{\r\n this.position = position;\r\n this.vector = vector;\r\n this.size = size;\r\n this.type = type;\r\n this.lifespan = lifespan;\r\n this.fadelength = fadelength;\r\n this.colour = colour ? colour : Arena.Colours.PARTICLE; // default colour if none set\r\n \r\n // randomize rotation speed and angle for line particle\r\n if (type === 1)\r\n {\r\n this.rotate = Rnd() * TWOPI;\r\n this.rotationv = (Rnd() - 0.5) * 0.5;\r\n }\r\n this.effectStart = GameHandler.frameStart;\r\n \r\n this.effectValue = function effectValue(val)\r\n {\r\n var result = val - ((val / this.lifespan) * (GameHandler.frameStart - this.effectStart));\r\n if (result < 0) result = 0;\r\n else if (result > val) result = val;\r\n return result;\r\n };\r\n \r\n this.update = function()\r\n {\r\n this.position.add(this.vector);\r\n return (GameHandler.frameStart - this.effectStart < this.lifespan);\r\n };\r\n \r\n this.render = function(ctx)\r\n {\r\n ctx.globalAlpha = this.effectValue(1.0);\r\n switch (this.type)\r\n {\r\n case 0: // point\r\n // prerendered images for each enemy colour that support health > 1\r\n // lookup based on particle colour - \"points_rgb(x,y,z)\"\r\n ctx.globalCompositeOperation = \"lighter\";\r\n var offset = -(this.size + 4);\r\n ctx.drawImage(\r\n GameHandler.bitmaps.images[\"points_\" + this.colour][this.size], offset, offset);\r\n break;\r\n case 1: // line\r\n // prerendered images - fixed WxH of 8x32 - for each enemy and player colour\r\n // scaled vertically for line size against the fixed height - \"line_rgb(x,y,z)\"\r\n ctx.rotate(this.rotate);\r\n this.rotate += this.rotationv;\r\n ctx.drawImage(\r\n GameHandler.bitmaps.images[\"line_\" + this.colour][0], -4, -8, 8, ~~(32 * (this.size/10)));\r\n break;\r\n case 2: // smudge\r\n // prerendered images in a single fixed colour\r\n ctx.globalCompositeOperation = \"lighter\";\r\n var offset = -((this.size - 2) * 4 + 4);\r\n \t\t \tctx.drawImage(GameHandler.bitmaps.images[\"smudges\"][this.size-2], offset, offset);\r\n \t\t \tbreak;\r\n }\r\n };\r\n}", "makeParticles() {\n // Absorb particles\n gameState.particles = this.add.particles('spark');\n gameState.emitter = gameState.particles.createEmitter({ \t\n x: gameState.player.x,\n y: gameState.player.y,\n lifespan: 256,\n speedX: {min: -512, max: 512},\n speedY: {min: -512, max: 512},\n scale: {start: 4, end: 0},\n tint: [0xff00ff, 0x00ffff],\n quantity: 8,\n blendMode: 'ADD'\n }); \n gameState.emitter.explode(0, gameState.player.x, gameState.player.y); // prevent from showing\n // Lose Particles\n gameState.loseParticles = this.add.particles('fragment');\n gameState.loseEmitter = gameState.loseParticles.createEmitter({\n x: gameState.player.x,\n y: gameState.player.y,\n lifespan: 1024,\n speedX: {min: -128, max: 128},\n speedY: {min: -128, max: 128},\n scale: {start: 1.5, end: 0},\n quantity: 16,\n rotate: () => { return Math.random() * 360}, // random rotation\n onUpdate: (particle) => { return particle.angle + 1}, // spin the \"fragments\"\n blendMode: 'NORMAL'\n });\n gameState.loseEmitter.explode(0, gameState.player.x, gameState.player.y); // prevent from showing\n }", "function makeExplosion(xPos, yPos){\n console.log(\"makeExplosion at \", xPos,yPos);\n\n playSound(\"boom\");\n\n var size = 3;\n var width = 3 * 20;\n var offset = (width - 20) / 2;\n var x = xPos * 20 - offset;\n var y = yPos * 20 - offset;\n\n $(\".border, .leader\").addClass(\"shake\");\n $(\".border\").one(\"animationend\",function(){\n $(\".border, .leader\").removeClass(\"shake\");\n })\n\n var particle = {};\n particle.el = $(\"<div class='boom'><div class='shock'/><div class='body'/></div>\");\n particle.el.css(\"height\", width);\n particle.el.css(\"width\", width);\n particle.el.css(\"transform\",\"translate3d(\"+x+\"px,\"+y+\"px,0)\");\n\n setTimeout(function(el) {\n return function(){\n el.remove();\n };\n }(particle.el),500);\n\n //Move function\n $(\".board\").append(particle.el);\n\n // Make Bomb Puffs\n for(var i = 0; i < 8; i++){\n\n var options = {\n x : xPos * 20, // absolute non-relative position on gameboard\n y : yPos * 20, // absolute non-relative position on gameboard\n angle: getRandom(0,359), // just on the x,y plane, works with speed\n zR : getRandom(-15,15), // zRotation velocity\n oV : -.008, // opacity velocity\n width : getRandom(20,55), // size of the particle\n className : 'puff', // adds this class to the particle <div/>\n lifespan: 125, // how many frames it lives\n }\n\n // Need to put this offset code into the makeParticle function\n // You should pass it an x,y of 0\n\n var offset = (options.width - 20) / 2;\n options.x = options.x - offset;\n options.y = options.y - offset;\n options.height = options.width;\n options.speed = 1 + (2 * (1 - options.width / 50)); // The bigger the particle, the lower the speed\n\n makeParticle(options);\n }\n}", "function ball(x, y, velX, velY, color, size) {\n this.x = x;\n this.y = y;\n this.velX = velX;\n this.velY = velY;\n this.color = color;\n this.size = size;\n}", "function Particle()\n{\n this.x=100;\n this.y=99;\n}", "function particleMaker(){\n let that = {\n cx: 0,\n cy: 0,\n w: 0,\n h: 0,\n x: function(){\n return this.cx - this.w/2;\n },\n y: function(){\n return this.cy - this.h/2;\n },\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n alive: true,\n lifetime: 0, //ms\n xSpeed: 0,\n ySpeed: 0,\n rotation: 0,\n image: false\n };\n \n return that;\n }", "function makeAWall (startPos, endPos, num) {\n var dPos = subVectors(endPos, startPos);\n var dY = dPos[Y]/num;\n var dX = dPos[X]/num;\n var x = startPos[X];\n var y = startPos[Y];\n for (var i = 0; i < num; i++) {\n //pos v a m q r dynam color\n genParticle([x, y], [0,0], [0,0], 1, 500, 10, false, \"#F54836\");\n x += dX;\n y += dY;\n }\n}", "bounce(paddle) {\n //if (ball is within the left edge of the paddle and the right edge of the paddle) {bounce}\n if (this.x > paddle.x - paddle.width / 2 &&\n this.x < paddle.x + paddle.width / 2 &&\n this.y + this.size / 2 > paddle.y - paddle.height / 2 &&\n this.y - this.size / 2 < paddle.y + paddle.height / 2) {\n\n //bounce\n //the closer it is to the edge, the more velocity it is going to add (or subtract) from its original velocity\n // dx = difference in x axis\n let dx = this.x - paddle.x;\n this.vx += map(dx, -paddle.width / 2, paddle.width / 2, -2, 2)\n\n\n this.vy = -this.vy;\n this.ay = 0;\n }\n }", "function Ball() {\n\tctx.fillStyle = white;\n\tctx.beginPath();\n\tctx.arc(BallX, BallY, BallRadius, 0, Math.PI * 2, true);\n\tctx.fill();\n\tctx.closePath();\n\tBallX += BallDisplacementX;\n\tBallY += BallDisplacementY;\n}", "addParticles(count) {\n\n }", "function myParticle()\n{\n\t//Random position\n\tthis.x = Math.random()*W;\n\tthis.y = Math.random()*H;\n}", "hit(ball) {\n if (\n ball.x > this.x - this.width / 2 &&\n ball.x < this.x + this.width / 2 &&\n ball.y + ball.size / 2 > this.y - this.height / 2 &&\n ball.y - ball.size / 2 < this.y + this.height / 2\n ) {\n this.active = false;\n let dx = ball.x - this.x;\n ball.vx += map(dx, -this.width / 2, this.width / 2, -2, 2);\n\n ball.vy = -ball.vy;\n ball.ay = 0;\n brickCounter++;\n this.playNote();\n }\n }", "function Particle() {\n this.scale = 1.0;\n this.x = 25;\n this.y = 25;\n this.radius = 20;\n this.color = \"#000\";\n this.velocityX = 0;\n this.velocityY = 0;\n this.scaleSpeed = 0.8;\n this.idP = 0;\n\n\n this.update = function (ms) {\n // shrinking\n\n this.scale -= this.scaleSpeed * ms / 1000.0;\n \n if (this.scale <= 0) {\n // particle is dead, remove it\n removeFromArray(particles, this);\n\n }\n\n // moving away from explosion center\n this.x += this.velocityX * ms / 1000.0;\n this.y += this.velocityY * ms / 1000.0;\n\n // and then later come downwards when our\n // gravity is added to it. We should add parameters \n // for the values that fake the gravity\n\n };\n\n this.draw = function (ctx, angle,idP) {\n // translating the 2D context to the particle coordinates\n ctx.save();\n ctx.translate(this.x, this.y);\n ctx.scale(this.scale, this.scale);\n ctx.rotate(angle);\n ctx.rotate(Math.PI / -0.4455);\n ctx.translate(25, 25); //pour tourner sur lui même\n\n // drawing a filled circle in the particle's local space\n ctx.beginPath();\n ctx.arc(0, 0, this.radius, 0, Math.PI * 2, true);\n //ctx.closePath();\n\n /*ctx.fillStyle = this.color;\n ctx.fill();*/\n if(this.idP==0){\n ctx.strokeStyle = this.color\n ctx.stroke();\n }\n if(this.idP==1){\n ctx.fillStyle = this.color;\n ctx.fill();\n }\n\n\n ctx.restore();\n }\n}", "function init(){\n\tballs = []\n\tparticles = []\n\tuselessBalls = []\n\tgenerateBall = true\n\ttimeInterval = 2000\n\ttimer = 0\n\tvelocityOfBall = 2.5\n\tscore = 0\n\tfillColor = '#fff'\n\n\tblueBall = new Ball(\n\t\tcanvas, ctx,\n\t\tcanvasWidth/2, canvasHeight/2 - separation,\n\t\tglobalRadius, colors[1], particles, 0, 0, true\n\t)\n\tredBall = new Ball(\n\t\tcanvas, ctx,\n\t\tcanvasWidth/2, canvasHeight/2 + separation,\n\t\tglobalRadius, colors[0], particles, 0, 0, true\n\t)\n\tballs.push(redBall, blueBall)\n\n\trandPoints = [\n\t\t{\n\t\t\tx: canvas.width / 2,\n\t\t\ty: -50\n\t\t},\n\t\t{\n\t\t\tx: canvas.width / 2,\n\t\t\ty: canvas.height + 50\n\t\t}\n\t]\n}", "bouton_centrage_pos() {}", "addParticle(){\n this.particles.push(new Particle(this.origin.x, this.origin.y));\n }", "function BounceBall() {\n this.radius = Math.random() * 10 + 10;\n this.x = Math.random() * (canWidth - this.radius * 2) + this.radius;\n this.y = Math.random() * (canHeight - this.radius * 2) + this.radius;\n this.color = randomColor();\n this.dy = Math.random() * 2;\n this.dx = Math.round((Math.random() - 0.5) * 10);\n}", "function Bee() {\n \tthis.BEE_FLIGHT_RADIUS = 12;\n\tthis.BEE_FLIGHT_Y_MOVEMENT = 3;\n\n\tthis.MAX_WING_ANGLE = 45;\n\tthis.MAX_LEG_ANGLE = 30;\n\n\t// dimensions for head\n\tthis.HEAD_MATERIAL = new Material (vec4 (.2, 0, .6, 1), 1, 1, 1, 40); // default blue\n\tthis.HEAD_RADIUS = 1/2;\n\n\t// dimensions for thorax (rectangular prism)\n\tthis.THORAX_MATERIAL = new Material( vec4( .3, .3, .3, 1 ), 1, 1, .5, 20 ); // default grey\n\tthis.THORAX_X = 2;\n\tthis.THORAX_Y = 1;\n\tthis.THORAX_Z = 1;\n\n\t// dimensions for abdomen (ellipse sphere)\n\tthis.ABDOMEN_MATERIAL = new Material (vec4 (.5, .5, 0, 1), 1, 1, 1, 40); // default yellow\n\tthis.ABDOMEN_X = 2;\n\tthis.ABDOMEN_Y = 1;\n\tthis.ABDOMEN_Z = 1;\n\n\t// dimensions for leg segment (rectangular prism)\n\tthis.LEG_MATERIAL = new Material( vec4( .3, .3, .3, 1 ), 1, 1, .5, 20 ); // default grey\n\tthis.LEG_X = 0.2;\n\tthis.LEG_Y = 1;\n\tthis.LEG_Z = 0.2;\n\n\t// dimensions for the wing (rectangular prism)\n\tthis.WING_MATERIAL = new Material( vec4( .3, .3, .3, 1 ), 1, 1, .5, 20 ); // default grey\n\tthis.WING_X = 1;\n\tthis.WING_Y = 0.2;\n\tthis.WING_Z = 4;\n}", "function Ball() {\n this.x = 0;\n this.y = 0;\n this.width = 10;\n this.height = 10;\n}", "function updateParticles(particles) {\r\n for (let i = 0; i < particles.length; i++) {\r\n let curpart = particles[i];\r\n // particle collision detection\r\n for (let j = 0; j < particles.length; j++) {\r\n if (j === i) {continue;}\r\n let dist = getDistance(curpart.x, curpart.y, particles[j].x, particles[j].y);\r\n if (dist < (curpart.radius + particles[j].radius)) {\r\n particleBounce(curpart, particles[j]);\r\n }\r\n }\r\n // wall collision detection\r\n if (curpart.x <= curpart.radius || curpart.x >= canvas.width - curpart.radius) {\r\n curpart.velocity.x = -curpart.velocity.x;\r\n }\r\n if (curpart.y <= curpart.radius || curpart.y >= canvas.height - curpart.radius) {\r\n curpart.velocity.y = -curpart.velocity.y;\r\n }\r\n // mouse collision detection\r\n if (getDistance(mouse.x, mouse.y, curpart.x, curpart.y) <= 200 && curpart.opacity < 0.3) {\r\n curpart.opacity += 0.02;\r\n }\r\n else if (getDistance(mouse.x, mouse.y, curpart.x, curpart.y) > 200 && curpart.opacity > 0) {\r\n curpart.opacity = 0;\r\n }\r\n // update position from velocity\r\n curpart.x += curpart.velocity.x;\r\n curpart.y += curpart.velocity.y;\r\n // draw the particle\r\n curpart.draw();\r\n }\r\n}", "function Ball(x, y, radius, color) {\r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n this.color = color;\r\n this.dx = ballSpeed;\r\n this.dy = -ballSpeed;\r\n}", "function setup(){\n\n // Creating the canvas\n var canvas = createCanvas(800,600);\n\n // Creating the engine\n engine = Engine.create();\n\n // Adding world to the engine\n world = engine.world;\n\n // Creating a canvas mouse\n var canvasmouse = Mouse.create(canvas.elt);\n\n // Changing the pixel ratio according to the density of the screen\n canvasmouse.pixelRatio = pixelDensity();\n\n // Adding canvas mouse to the mouse constraint\n var op = {\n Mouse: canvasmouse\n }\n\n // Creating the mouse constraint\n mConstraint = MouseConstraint.create(engine, op);\n\n // Adding it to the world\n World.add(world,mConstraint);\n \n // Creating a ground\n ground = new Ground(400,585,800,30);\n fill(\"purple\");\n\n // Adding ground to the world\n World.add(world,ground);\n\n // Creating an object that will keep track of the previous particle\n var prev = null;\n\n // Creating a chain at the left side\n for(x = 15; x > -570; x -= 40) {\n\n // Creating a variable fixed\n var fixed = false;\n\n // Making the fixed true if there is no previous particle\n if(!prev) {\n fixed = true;\n }\n\n // Creating a particle\n p = new SideChain(x,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p);\n\n // Adding the particle to the world\n World.add(world,p);\n\n // Creating an invisible chain with the previous particle\n if(prev) {\n\n // Adding the properties to the chain with the help of a variable\n var options = {\n \n // Setting the chain start and end point\n bodyA: p.body,\n bodyB: prev.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constre = Constraint.create(options);\n\n // Adding the constraint to the world\n World.add(world,constre);\n }\n\n // Adding the particle to the previous\n prev = p;\n }\n\n // Creating another object that will keep track of the previous particle\n var prev1 = null;\n\n // Creating a chain on the right side\n for(i = 785; i < 1350; i = i + 40) {\n\n // Creating a fixed variable and giving it false value\n var fixed = false;\n\n // Giving fixed as true value when there is no previous particle\n if(!prev1) {\n fixed = true;\n }\n\n // Creating another particle\n p1 = new SideChain(i,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p1);\n\n // Adding the particle to the world\n World.add(world,p1);\n\n // Creating an invisible chain with the previous particle\n if(prev1) {\n\n // Adding the properties to the particles\n var option = {\n\n // Setting the start and end position of the chain\n bodyA: p1.body,\n bodyB: prev1.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constra = Constraint.create(option);\n\n // Adding the constraint to the world\n World.add(world,constra);\n }\n\n // Adding the particle to the previous\n prev1 = p1;\n }\n\n // Displaying the wall's design\n var X=100;\n var Y=240;\n var Z=20;\n for(var i=1;i<=144;i++){\n if(i%16 == 0){\n\n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= 100;\n Y = Y + 40;\n }else{ \n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= X+40;\n }\n \n }\n\n // Creating the castlepillars\n castlepillar1 = new Castlepillar(55,320,50,500);\n castlepillar2 = new Castlepillar(745,320,50,500);\n\n // Creating a wall\n wall = new Wall(400,395,640,350);\n\n // Creatiing the gates\n gate1 = new Gate(350,470,100,200);\n gate2 = new Gate(450,470,100,200);\n\n var A=325;\n var B=400;\n var C=20;\n for(var a=1;a<=16;a++){\n if(a%4 == 0){\n\n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= 325;\n B = B + 45;\n }else{ \n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= A+50;\n }\n \n }\n\n var D=100;\n var E=180;\n var F=40;\n var G = 80;\n for(var b=1;b<=16;b++){\n if(b%2 == 0){\n\n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E + 20;\n G = G - 40;\n }else{ \n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E - 20;\n G = G + 40;\n }\n \n }\n}", "function insertBall() {\n const ball = new Ball(\n 640 / 2, // x\n 480 / 2, // y\n 16, // width\n 16, // height\n ctx, // papper\n \"white\"// farg\n );\n gameObjects.push(ball); // tryck in i listan\n}", "function makeCrossBoom(entity) {\n\n bgBrightness += entity.maxsize / 3;\n\n particles.crosshairContainer[!entity.blue].removeChild(entity.sprite);\n entity.sprite = new PIXI.Sprite(\n PIXI.loader.resources[entity.blue ? \"assets/b-mainboom.png\" : \"assets/r-mainboom.png\"].texture\n );\n entity.sprite.blendMode = PIXI.BLEND_MODES.ADD;\n entity.size = 0;\n entity.growing = 0.03;\n entity.sprite.x = entity.position.x;\n entity.sprite.y = entity.position.y;\n entity.sprite.anchor.x = 0.5;\n entity.sprite.anchor.y = 0.5;\n entity.sprite.scale.x = globalScale * entity.size;\n entity.sprite.scale.y = globalScale * entity.size;\n entity.sprite.alpha = 0.75;\n particles.mainboomContainer[entity.blue].addChild(entity.sprite);\n\n entity.lineboom = new PIXI.Sprite(\n PIXI.loader.resources[\"assets/w-lineboom.png\"].texture\n );\n entity.lineboom.blendMode = PIXI.BLEND_MODES.ADD;\n entity.lineboom.x = entity.position.x;\n entity.lineboom.y = entity.position.y;\n entity.lineboom.anchor.x = 0.5;\n entity.lineboom.anchor.y = 0.5;\n entity.lineboom.scale.x = globalScale * entity.size;\n entity.lineboom.scale.y = globalScale * entity.size;\n entity.lineboom.alpha = 0.75;\n particles.lineboomContainer.addChild(entity.lineboom);\n}", "function particle() {\n for (var i=0; i<50; i++) {\n var dir = new THREE.Vector3(2*Math.random()-1, Math.random()*4, 2*Math.random()-1);\n dir.multiplyScalar(6/dir.length());\n var color = (Math.random() > 0.5) ? 0x333333 : 0x666666;\n var p = new Particle(obj.position, dir, color, 0.1);\n p.maxLife = 3;\n }\n\n /*\n j += 1;\n if (j < 5) {\n setTimeout(particle, 1);\n }\n */\n }", "function Particle( s ) {\n return function(x, y, mass) {\n this.position = s.createVector(x, y);\n this.velocity = s.createVector(0, 5);\n this.acceleration = s.createVector(0, 0);\n this.mass = mass;\n this.radius = massToRadius(mass);\n\n this.display = function() {\n s.noStroke();\n s.ellipse(this.position.x, this.position.y, this.radius, this.radius);\n this.position.add(this.velocity.add(this.acceleration));\n this.constrainToUniverse();\n this.acceleration.set(0,0);\n this.update();\n return this;\n }\n\n this.update = function() {\n var mousePosition = s.createVector(s.mouseX, s.mouseY);\n return this;\n }\n\n this.resetPosition = function() {\n this.position = s.createVector(width/2, height/2);\n }\n\n this.applyForce = function(force) {\n force = force.copy();\n force.div(mass);\n this.acceleration.add(force);\n }\n\n this.applyUniverse = function(constraints) {\n this.constraints = constraints;\n }\n\n this.constrainToUniverse = function() {\n var leftEdge = this.constraints.leftEdge + this.radius/2;\n var rightEdge = this.constraints.rightEdge - this.radius/2;\n var bottomEdge = this.constraints.bottomEdge - this.radius/2;\n var topEdge = this.constraints.topEdge + this.radius/2;\n\n if (this.position.x > rightEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = rightEdge;\n }\n\n if (this.position.x < leftEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = leftEdge;\n }\n\n if (this.position.y > bottomEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = bottomEdge; \n }\n\n if (this.position.y < topEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = topEdge; \n }\n }\n\n function massToRadius(mass) {\n // Volume of a circle: V = pi*r^3\n // let V = mass so we have a constant density \n // derives radius based on volume\n // Multiply by 50 so it looks reasonable in a browser\n return Math.cbrt(1/(((4/3)*Math.PI)/mass))*50;\n }\n\n function reverse(vector, axis) {\n vector[axis] *= -1;\n }\n };\n}", "decay(){\n let e = new Electron(this.x, this.y, this.z, this.v_x*0.5, this.v_y*0.5, this.v_z*0.5);\n let p = new Positron(this.x, this.y, this.z, this.v_x*0.5, this.v_y*0.5, this.v_z*0.5);\n ParticleTracks.activeParticles.push(e,p);\n this.v_x = 0;\n this.v_y = 0;\n }", "function addParticle() {\n numParticles += 1;\n \n var x = 1-2*Math.random();\n var y = 1-2*Math.random();\n var z = 1-2*Math.random();\n \n pParticles.push([x,y,z]);\n \n var vx = 3 - Math.random() * 6;\n var vy = 3 - Math.random() * 6;\n var vz = 3 - Math.random() * 6;\n vParticles.push([vx,vy,vz]);\n \n var s = 0.04 + Math.random() * 0.02;\n sParticles.push(s);\n \n //random material color\n var R = Math.random();\n var G = Math.random();\n var B = Math.random();\n cParticles.push([R,G,B]);\n \n console.log([x,y,z], s, 1-s);\n}", "function Ball () {\n this.x = canvas.width/2; \t//byrjunar x\n this.y = canvas.height-30;\t//byrjunar y\n this.ballRadius = 10;\t\t//stærð boltans\n this.status = 1; \t\t//status 1 visible, status 0 invisible and not in the game\n this.dx = 2; //hvað boltinn hreyfist í hverjum ramma\n this.dy = -2; //hvað boltinn hreyfist í hverjum ramma\n this.color = \"#000000\";\n this.restart = function() { //setja boltann inn aftur\n if (this.status==1){\n \tthis.x = canvas.width/2; \t//byrjunar x\n \tthis.y = canvas.height-30;\t//byrjunar y\n \tthis.ballRadius = 10;\t\t//stærð boltans\n }\n };\n this.draw = function() { //teikna boltann\n if (this.status==1){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.ballRadius, 0, Math.PI*2);\n ctx.fillStyle = \"#000000\";\n ctx.fill();\n ctx.closePath();\n }\n };\n}", "createBallPhysics(){\n\n //Create the rolling ball\n let ballRadius = 0.6;\n let posArray = [11, 0.6, 11];\n\n let sphereGeom = new THREE.SphereBufferGeometry(ballRadius, 20, 8);\n\n let diffuseTex = this.rc.getResource(\"ball_diffuse\");\n let normalTex = this.rc.getResource(\"ball_normal\");\n let specularTex = this.rc.getResource(\"ball_specular\");\n \n\n let ballMat = new THREE.MeshPhongMaterial({map: diffuseTex, normalMap: normalTex, specularMap: specularTex, shininess: 153});\n\n let ball = this.ball = new THREE.Mesh(sphereGeom, ballMat);\n\n ball.castShadow = true;\n\n this.scene.add(ball);\n ball.position.set(posArray[0], posArray[1], posArray[2]);\n\n\n return this.realityBridge.add({\n type: 'sphere',\n name: this.rollingBallPhysicsName,\n body: ball,\n size: [ballRadius, ballRadius, ballRadius],\n pos: posArray,\n mass: this.ballMass,\n friction: 0.5,\n linear: 0.5,\n rolling: 0.3\n });\n\n }", "drawParticle() {\n noStroke();\n fill('rgba(200,169,169,0.5)');\n circle(this.x, this.y, this.r);\n textSize(8);\n textAlign(CENTER, CENTER);\n fill('rgba(200,169,169,0.5)');\n text(this.label, this.x, this.y + 10);\n }", "function Fparticles() {\n var pJS = function (tag_id, params) {\n\n var canvas_el = document.querySelector('#' + tag_id + ' > .particles-js-canvas-el');\n\n /* particles.js variables with default values */\n this.pJS = {\n canvas: {\n el: canvas_el,\n w: canvas_el.offsetWidth,\n h: canvas_el.offsetHeight\n },\n particles: {\n number: {\n value: 400,\n density: {\n enable: true,\n value_area: 800\n }\n },\n color: {\n value: '#fff'\n },\n shape: {\n type: 'circle',\n stroke: {\n width: 0,\n color: '#ff0000'\n },\n polygon: {\n nb_sides: 5\n },\n image: {\n src: '',\n width: 100,\n height: 100\n }\n },\n opacity: {\n value: 1,\n random: false,\n anim: {\n enable: false,\n speed: 2,\n opacity_min: 0,\n sync: false\n }\n },\n size: {\n value: 20,\n random: false,\n anim: {\n enable: false,\n speed: 20,\n size_min: 0,\n sync: false\n }\n },\n line_linked: {\n enable: true,\n distance: 100,\n color: '#fff',\n opacity: 1,\n width: 1\n },\n move: {\n enable: true,\n speed: 2,\n direction: 'none',\n random: false,\n straight: false,\n out_mode: 'out',\n bounce: false,\n attract: {\n enable: false,\n rotateX: 3000,\n rotateY: 3000\n }\n },\n array: []\n },\n interactivity: {\n detect_on: 'canvas',\n events: {\n onhover: {\n enable: true,\n mode: 'grab'\n },\n onclick: {\n enable: true,\n mode: 'push'\n },\n resize: true\n },\n modes: {\n grab: {\n distance: 100,\n line_linked: {\n opacity: 1\n }\n },\n bubble: {\n distance: 200,\n size: 80,\n duration: 0.4\n },\n repulse: {\n distance: 200,\n duration: 0.4\n },\n push: {\n particles_nb: 4\n },\n remove: {\n particles_nb: 2\n }\n },\n mouse: {}\n },\n retina_detect: false,\n fn: {\n interact: {},\n modes: {},\n vendors: {}\n },\n tmp: {}\n };\n\n var pJS = this.pJS;\n\n /* params settings */\n if (params) {\n Object.deepExtend(pJS, params);\n }\n\n pJS.tmp.obj = {\n size_value: pJS.particles.size.value,\n size_anim_speed: pJS.particles.size.anim.speed,\n move_speed: pJS.particles.move.speed,\n line_linked_distance: pJS.particles.line_linked.distance,\n line_linked_width: pJS.particles.line_linked.width,\n mode_grab_distance: pJS.interactivity.modes.grab.distance,\n mode_bubble_distance: pJS.interactivity.modes.bubble.distance,\n mode_bubble_size: pJS.interactivity.modes.bubble.size,\n mode_repulse_distance: pJS.interactivity.modes.repulse.distance\n };\n\n\n pJS.fn.retinaInit = function () {\n\n if (pJS.retina_detect && window.devicePixelRatio > 1) {\n pJS.canvas.pxratio = window.devicePixelRatio;\n pJS.tmp.retina = true;\n }\n else {\n pJS.canvas.pxratio = 1;\n pJS.tmp.retina = false;\n }\n\n pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio;\n pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio;\n\n pJS.particles.size.value = pJS.tmp.obj.size_value * pJS.canvas.pxratio;\n pJS.particles.size.anim.speed = pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio;\n pJS.particles.move.speed = pJS.tmp.obj.move_speed * pJS.canvas.pxratio;\n pJS.particles.line_linked.distance = pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio;\n pJS.interactivity.modes.grab.distance = pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio;\n pJS.interactivity.modes.bubble.distance = pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio;\n pJS.particles.line_linked.width = pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio;\n pJS.interactivity.modes.bubble.size = pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio;\n pJS.interactivity.modes.repulse.distance = pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio;\n\n };\n\n\n\n /* ---------- pJS functions - canvas ------------ */\n\n pJS.fn.canvasInit = function () {\n pJS.canvas.ctx = pJS.canvas.el.getContext('2d');\n };\n\n pJS.fn.canvasSize = function () {\n\n pJS.canvas.el.width = pJS.canvas.w;\n pJS.canvas.el.height = pJS.canvas.h;\n\n if (pJS && pJS.interactivity.events.resize) {\n\n window.addEventListener('resize', function () {\n\n pJS.canvas.w = pJS.canvas.el.offsetWidth;\n pJS.canvas.h = pJS.canvas.el.offsetHeight;\n\n /* resize canvas */\n if (pJS.tmp.retina) {\n pJS.canvas.w *= pJS.canvas.pxratio;\n pJS.canvas.h *= pJS.canvas.pxratio;\n }\n\n pJS.canvas.el.width = pJS.canvas.w;\n pJS.canvas.el.height = pJS.canvas.h;\n\n /* repaint canvas on anim disabled */\n if (!pJS.particles.move.enable) {\n pJS.fn.particlesEmpty();\n pJS.fn.particlesCreate();\n pJS.fn.particlesDraw();\n pJS.fn.vendors.densityAutoParticles();\n }\n\n /* density particles enabled */\n pJS.fn.vendors.densityAutoParticles();\n\n });\n\n }\n\n };\n\n\n pJS.fn.canvasPaint = function () {\n pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h);\n };\n\n pJS.fn.canvasClear = function () {\n pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);\n };\n\n\n /* --------- pJS functions - particles ----------- */\n\n pJS.fn.particle = function (color, opacity, position) {\n\n /* size */\n this.radius = (pJS.particles.size.random ? Math.random() : 1) * pJS.particles.size.value;\n if (pJS.particles.size.anim.enable) {\n this.size_status = false;\n this.vs = pJS.particles.size.anim.speed / 100;\n if (!pJS.particles.size.anim.sync) {\n this.vs = this.vs * Math.random();\n }\n }\n\n /* position */\n this.x = position ? position.x : Math.random() * pJS.canvas.w;\n this.y = position ? position.y : Math.random() * pJS.canvas.h;\n\n /* check position - into the canvas */\n if (this.x > pJS.canvas.w - this.radius * 2) this.x = this.x - this.radius;\n else if (this.x < this.radius * 2) this.x = this.x + this.radius;\n if (this.y > pJS.canvas.h - this.radius * 2) this.y = this.y - this.radius;\n else if (this.y < this.radius * 2) this.y = this.y + this.radius;\n\n /* check position - avoid overlap */\n if (pJS.particles.move.bounce) {\n pJS.fn.vendors.checkOverlap(this, position);\n }\n\n /* color */\n this.color = {};\n if (typeof (color.value) == 'object') {\n\n if (color.value instanceof Array) {\n var color_selected = color.value[Math.floor(Math.random() * pJS.particles.color.value.length)];\n this.color.rgb = hexToRgb(color_selected);\n } else {\n if (color.value.r != undefined && color.value.g != undefined && color.value.b != undefined) {\n this.color.rgb = {\n r: color.value.r,\n g: color.value.g,\n b: color.value.b\n }\n }\n if (color.value.h != undefined && color.value.s != undefined && color.value.l != undefined) {\n this.color.hsl = {\n h: color.value.h,\n s: color.value.s,\n l: color.value.l\n }\n }\n }\n\n }\n else if (color.value == 'random') {\n this.color.rgb = {\n r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),\n g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),\n b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0)\n }\n }\n else if (typeof (color.value) == 'string') {\n this.color = color;\n this.color.rgb = hexToRgb(this.color.value);\n }\n\n /* opacity */\n this.opacity = (pJS.particles.opacity.random ? Math.random() : 1) * pJS.particles.opacity.value;\n if (pJS.particles.opacity.anim.enable) {\n this.opacity_status = false;\n this.vo = pJS.particles.opacity.anim.speed / 100;\n if (!pJS.particles.opacity.anim.sync) {\n this.vo = this.vo * Math.random();\n }\n }\n\n /* animation - velocity for speed */\n var velbase = {}\n switch (pJS.particles.move.direction) {\n case 'top':\n velbase = { x: 0, y: -1 };\n break;\n case 'top-right':\n velbase = { x: 0.5, y: -0.5 };\n break;\n case 'right':\n velbase = { x: 1, y: -0 };\n break;\n case 'bottom-right':\n velbase = { x: 0.5, y: 0.5 };\n break;\n case 'bottom':\n velbase = { x: 0, y: 1 };\n break;\n case 'bottom-left':\n velbase = { x: -0.5, y: 1 };\n break;\n case 'left':\n velbase = { x: -1, y: 0 };\n break;\n case 'top-left':\n velbase = { x: -0.5, y: -0.5 };\n break;\n default:\n velbase = { x: 0, y: 0 };\n break;\n }\n\n if (pJS.particles.move.straight) {\n this.vx = velbase.x;\n this.vy = velbase.y;\n if (pJS.particles.move.random) {\n this.vx = this.vx * (Math.random());\n this.vy = this.vy * (Math.random());\n }\n } else {\n this.vx = velbase.x + Math.random() - 0.5;\n this.vy = velbase.y + Math.random() - 0.5;\n }\n\n // var theta = 2.0 * Math.PI * Math.random();\n // this.vx = Math.cos(theta);\n // this.vy = Math.sin(theta);\n\n this.vx_i = this.vx;\n this.vy_i = this.vy;\n\n\n\n /* if shape is image */\n\n var shape_type = pJS.particles.shape.type;\n if (typeof (shape_type) == 'object') {\n if (shape_type instanceof Array) {\n var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)];\n this.shape = shape_selected;\n }\n } else {\n this.shape = shape_type;\n }\n\n if (this.shape == 'image') {\n var sh = pJS.particles.shape;\n this.img = {\n src: sh.image.src,\n ratio: sh.image.width / sh.image.height\n }\n if (!this.img.ratio) this.img.ratio = 1;\n if (pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg != undefined) {\n pJS.fn.vendors.createSvgImg(this);\n if (pJS.tmp.pushing) {\n this.img.loaded = false;\n }\n }\n }\n\n\n\n };\n\n\n pJS.fn.particle.prototype.draw = function () {\n\n var p = this;\n\n if (p.radius_bubble != undefined) {\n var radius = p.radius_bubble;\n } else {\n var radius = p.radius;\n }\n\n if (p.opacity_bubble != undefined) {\n var opacity = p.opacity_bubble;\n } else {\n var opacity = p.opacity;\n }\n\n if (p.color.rgb) {\n var color_value = 'rgba(' + p.color.rgb.r + ',' + p.color.rgb.g + ',' + p.color.rgb.b + ',' + opacity + ')';\n } else {\n var color_value = 'hsla(' + p.color.hsl.h + ',' + p.color.hsl.s + '%,' + p.color.hsl.l + '%,' + opacity + ')';\n }\n\n pJS.canvas.ctx.fillStyle = color_value;\n pJS.canvas.ctx.beginPath();\n\n switch (p.shape) {\n\n case 'circle':\n pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);\n break;\n\n case 'edge':\n pJS.canvas.ctx.rect(p.x - radius, p.y - radius, radius * 2, radius * 2);\n break;\n\n case 'triangle':\n pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x - radius, p.y + radius / 1.66, radius * 2, 3, 2);\n break;\n\n case 'polygon':\n pJS.fn.vendors.drawShape(\n pJS.canvas.ctx,\n p.x - radius / (pJS.particles.shape.polygon.nb_sides / 3.5), // startX\n p.y - radius / (2.66 / 3.5), // startY\n radius * 2.66 / (pJS.particles.shape.polygon.nb_sides / 3), // sideLength\n pJS.particles.shape.polygon.nb_sides, // sideCountNumerator\n 1 // sideCountDenominator\n );\n break;\n\n case 'star':\n pJS.fn.vendors.drawShape(\n pJS.canvas.ctx,\n p.x - radius * 2 / (pJS.particles.shape.polygon.nb_sides / 4), // startX\n p.y - radius / (2 * 2.66 / 3.5), // startY\n radius * 2 * 2.66 / (pJS.particles.shape.polygon.nb_sides / 3), // sideLength\n pJS.particles.shape.polygon.nb_sides, // sideCountNumerator\n 2 // sideCountDenominator\n );\n break;\n\n case 'image':\n\n function draw() {\n pJS.canvas.ctx.drawImage(\n img_obj,\n p.x - radius,\n p.y - radius,\n radius * 2,\n radius * 2 / p.img.ratio\n );\n }\n\n if (pJS.tmp.img_type == 'svg') {\n var img_obj = p.img.obj;\n } else {\n var img_obj = pJS.tmp.img_obj;\n }\n\n if (img_obj) {\n draw();\n }\n\n break;\n\n }\n\n pJS.canvas.ctx.closePath();\n\n if (pJS.particles.shape.stroke.width > 0) {\n pJS.canvas.ctx.strokeStyle = pJS.particles.shape.stroke.color;\n pJS.canvas.ctx.lineWidth = pJS.particles.shape.stroke.width;\n pJS.canvas.ctx.stroke();\n }\n\n pJS.canvas.ctx.fill();\n\n };\n\n\n pJS.fn.particlesCreate = function () {\n for (var i = 0; i < pJS.particles.number.value; i++) {\n pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value));\n }\n };\n\n pJS.fn.particlesUpdate = function () {\n\n for (var i = 0; i < pJS.particles.array.length; i++) {\n\n /* the particle */\n var p = pJS.particles.array[i];\n\n // var d = ( dx = pJS.interactivity.mouse.click_pos_x - p.x ) * dx + ( dy = pJS.interactivity.mouse.click_pos_y - p.y ) * dy;\n // var f = -BANG_SIZE / d;\n // if ( d < BANG_SIZE ) {\n // var t = Math.atan2( dy, dx );\n // p.vx = f * Math.cos(t);\n // p.vy = f * Math.sin(t);\n // }\n\n /* move the particle */\n if (pJS.particles.move.enable) {\n var ms = pJS.particles.move.speed / 2;\n p.x += p.vx * ms;\n p.y += p.vy * ms;\n }\n\n /* change opacity status */\n if (pJS.particles.opacity.anim.enable) {\n if (p.opacity_status == true) {\n if (p.opacity >= pJS.particles.opacity.value) p.opacity_status = false;\n p.opacity += p.vo;\n } else {\n if (p.opacity <= pJS.particles.opacity.anim.opacity_min) p.opacity_status = true;\n p.opacity -= p.vo;\n }\n if (p.opacity < 0) p.opacity = 0;\n }\n\n /* change size */\n if (pJS.particles.size.anim.enable) {\n if (p.size_status == true) {\n if (p.radius >= pJS.particles.size.value) p.size_status = false;\n p.radius += p.vs;\n } else {\n if (p.radius <= pJS.particles.size.anim.size_min) p.size_status = true;\n p.radius -= p.vs;\n }\n if (p.radius < 0) p.radius = 0;\n }\n\n /* change particle position if it is out of canvas */\n if (pJS.particles.move.out_mode == 'bounce') {\n var new_pos = {\n x_left: p.radius,\n x_right: pJS.canvas.w,\n y_top: p.radius,\n y_bottom: pJS.canvas.h\n }\n } else {\n var new_pos = {\n x_left: -p.radius,\n x_right: pJS.canvas.w + p.radius,\n y_top: -p.radius,\n y_bottom: pJS.canvas.h + p.radius\n }\n }\n\n if (p.x - p.radius > pJS.canvas.w) {\n p.x = new_pos.x_left;\n p.y = Math.random() * pJS.canvas.h;\n }\n else if (p.x + p.radius < 0) {\n p.x = new_pos.x_right;\n p.y = Math.random() * pJS.canvas.h;\n }\n if (p.y - p.radius > pJS.canvas.h) {\n p.y = new_pos.y_top;\n p.x = Math.random() * pJS.canvas.w;\n }\n else if (p.y + p.radius < 0) {\n p.y = new_pos.y_bottom;\n p.x = Math.random() * pJS.canvas.w;\n }\n\n /* out of canvas modes */\n switch (pJS.particles.move.out_mode) {\n case 'bounce':\n if (p.x + p.radius > pJS.canvas.w) p.vx = -p.vx;\n else if (p.x - p.radius < 0) p.vx = -p.vx;\n if (p.y + p.radius > pJS.canvas.h) p.vy = -p.vy;\n else if (p.y - p.radius < 0) p.vy = -p.vy;\n break;\n }\n\n /* events */\n if (isInArray('grab', pJS.interactivity.events.onhover.mode)) {\n pJS.fn.modes.grabParticle(p);\n }\n\n if (isInArray('bubble', pJS.interactivity.events.onhover.mode) || isInArray('bubble', pJS.interactivity.events.onclick.mode)) {\n pJS.fn.modes.bubbleParticle(p);\n }\n\n if (isInArray('repulse', pJS.interactivity.events.onhover.mode) || isInArray('repulse', pJS.interactivity.events.onclick.mode)) {\n pJS.fn.modes.repulseParticle(p);\n }\n\n /* interaction auto between particles */\n if (pJS.particles.line_linked.enable || pJS.particles.move.attract.enable) {\n for (var j = i + 1; j < pJS.particles.array.length; j++) {\n var p2 = pJS.particles.array[j];\n\n /* link particles */\n if (pJS.particles.line_linked.enable) {\n pJS.fn.interact.linkParticles(p, p2);\n }\n\n /* attract particles */\n if (pJS.particles.move.attract.enable) {\n pJS.fn.interact.attractParticles(p, p2);\n }\n\n /* bounce particles */\n if (pJS.particles.move.bounce) {\n pJS.fn.interact.bounceParticles(p, p2);\n }\n\n }\n }\n\n\n }\n\n };\n\n pJS.fn.particlesDraw = function () {\n\n /* clear canvas */\n pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);\n\n /* update each particles param */\n pJS.fn.particlesUpdate();\n\n /* draw each particle */\n for (var i = 0; i < pJS.particles.array.length; i++) {\n var p = pJS.particles.array[i];\n p.draw();\n }\n\n };\n\n pJS.fn.particlesEmpty = function () {\n pJS.particles.array = [];\n };\n\n pJS.fn.particlesRefresh = function () {\n\n /* init all */\n cancelRequestAnimFrame(pJS.fn.checkAnimFrame);\n cancelRequestAnimFrame(pJS.fn.drawAnimFrame);\n pJS.tmp.source_svg = undefined;\n pJS.tmp.img_obj = undefined;\n pJS.tmp.count_svg = 0;\n pJS.fn.particlesEmpty();\n pJS.fn.canvasClear();\n\n /* restart */\n pJS.fn.vendors.start();\n\n };\n\n\n /* ---------- pJS functions - particles interaction ------------ */\n\n pJS.fn.interact.linkParticles = function (p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y,\n dist = Math.sqrt(dx * dx + dy * dy);\n\n /* draw a line between p1 and p2 if the distance between them is under the config distance */\n if (dist <= pJS.particles.line_linked.distance) {\n\n var opacity_line = pJS.particles.line_linked.opacity - (dist / (1 / pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance;\n\n if (opacity_line > 0) {\n\n /* style */\n var color_line = pJS.particles.line_linked.color_rgb_line;\n pJS.canvas.ctx.strokeStyle = 'rgba(' + color_line.r + ',' + color_line.g + ',' + color_line.b + ',' + opacity_line + ')';\n pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;\n //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */\n\n /* path */\n pJS.canvas.ctx.beginPath();\n pJS.canvas.ctx.moveTo(p1.x, p1.y);\n pJS.canvas.ctx.lineTo(p2.x, p2.y);\n pJS.canvas.ctx.stroke();\n pJS.canvas.ctx.closePath();\n\n }\n\n }\n\n };\n\n\n pJS.fn.interact.attractParticles = function (p1, p2) {\n\n /* condensed particles */\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y,\n dist = Math.sqrt(dx * dx + dy * dy);\n\n if (dist <= pJS.particles.line_linked.distance) {\n\n var ax = dx / (pJS.particles.move.attract.rotateX * 1000),\n ay = dy / (pJS.particles.move.attract.rotateY * 1000);\n\n p1.vx -= ax;\n p1.vy -= ay;\n\n p2.vx += ax;\n p2.vy += ay;\n\n }\n\n\n }\n\n\n pJS.fn.interact.bounceParticles = function (p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y,\n dist = Math.sqrt(dx * dx + dy * dy),\n dist_p = p1.radius + p2.radius;\n\n if (dist <= dist_p) {\n p1.vx = -p1.vx;\n p1.vy = -p1.vy;\n\n p2.vx = -p2.vx;\n p2.vy = -p2.vy;\n }\n\n }\n\n\n /* ---------- pJS functions - modes events ------------ */\n\n pJS.fn.modes.pushParticles = function (nb, pos) {\n\n pJS.tmp.pushing = true;\n\n for (var i = 0; i < nb; i++) {\n pJS.particles.array.push(\n new pJS.fn.particle(\n pJS.particles.color,\n pJS.particles.opacity.value,\n {\n 'x': pos ? pos.pos_x : Math.random() * pJS.canvas.w,\n 'y': pos ? pos.pos_y : Math.random() * pJS.canvas.h\n }\n )\n )\n if (i == nb - 1) {\n if (!pJS.particles.move.enable) {\n pJS.fn.particlesDraw();\n }\n pJS.tmp.pushing = false;\n }\n }\n\n };\n\n\n pJS.fn.modes.removeParticles = function (nb) {\n\n pJS.particles.array.splice(0, nb);\n if (!pJS.particles.move.enable) {\n pJS.fn.particlesDraw();\n }\n\n };\n\n\n pJS.fn.modes.bubbleParticle = function (p) {\n\n /* on hover event */\n if (pJS.interactivity.events.onhover.enable && isInArray('bubble', pJS.interactivity.events.onhover.mode)) {\n\n var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,\n dy_mouse = p.y - pJS.interactivity.mouse.pos_y,\n dist_mouse = Math.sqrt(dx_mouse * dx_mouse + dy_mouse * dy_mouse),\n ratio = 1 - dist_mouse / pJS.interactivity.modes.bubble.distance;\n\n function init() {\n p.opacity_bubble = p.opacity;\n p.radius_bubble = p.radius;\n }\n\n /* mousemove - check ratio */\n if (dist_mouse <= pJS.interactivity.modes.bubble.distance) {\n\n if (ratio >= 0 && pJS.interactivity.status == 'mousemove') {\n\n /* size */\n if (pJS.interactivity.modes.bubble.size != pJS.particles.size.value) {\n\n if (pJS.interactivity.modes.bubble.size > pJS.particles.size.value) {\n var size = p.radius + (pJS.interactivity.modes.bubble.size * ratio);\n if (size >= 0) {\n p.radius_bubble = size;\n }\n } else {\n var dif = p.radius - pJS.interactivity.modes.bubble.size,\n size = p.radius - (dif * ratio);\n if (size > 0) {\n p.radius_bubble = size;\n } else {\n p.radius_bubble = 0;\n }\n }\n\n }\n\n /* opacity */\n if (pJS.interactivity.modes.bubble.opacity != pJS.particles.opacity.value) {\n\n if (pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value) {\n var opacity = pJS.interactivity.modes.bubble.opacity * ratio;\n if (opacity > p.opacity && opacity <= pJS.interactivity.modes.bubble.opacity) {\n p.opacity_bubble = opacity;\n }\n } else {\n var opacity = p.opacity - (pJS.particles.opacity.value - pJS.interactivity.modes.bubble.opacity) * ratio;\n if (opacity < p.opacity && opacity >= pJS.interactivity.modes.bubble.opacity) {\n p.opacity_bubble = opacity;\n }\n }\n\n }\n\n }\n\n } else {\n init();\n }\n\n\n /* mouseleave */\n if (pJS.interactivity.status == 'mouseleave') {\n init();\n }\n\n }\n\n /* on click event */\n else if (pJS.interactivity.events.onclick.enable && isInArray('bubble', pJS.interactivity.events.onclick.mode)) {\n\n\n if (pJS.tmp.bubble_clicking) {\n var dx_mouse = p.x - pJS.interactivity.mouse.click_pos_x,\n dy_mouse = p.y - pJS.interactivity.mouse.click_pos_y,\n dist_mouse = Math.sqrt(dx_mouse * dx_mouse + dy_mouse * dy_mouse),\n time_spent = (new Date().getTime() - pJS.interactivity.mouse.click_time) / 1000;\n\n if (time_spent > pJS.interactivity.modes.bubble.duration) {\n pJS.tmp.bubble_duration_end = true;\n }\n\n if (time_spent > pJS.interactivity.modes.bubble.duration * 2) {\n pJS.tmp.bubble_clicking = false;\n pJS.tmp.bubble_duration_end = false;\n }\n }\n\n\n function process(bubble_param, particles_param, p_obj_bubble, p_obj, id) {\n\n if (bubble_param != particles_param) {\n\n if (!pJS.tmp.bubble_duration_end) {\n if (dist_mouse <= pJS.interactivity.modes.bubble.distance) {\n if (p_obj_bubble != undefined) var obj = p_obj_bubble;\n else var obj = p_obj;\n if (obj != bubble_param) {\n var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration);\n if (id == 'size') p.radius_bubble = value;\n if (id == 'opacity') p.opacity_bubble = value;\n }\n } else {\n if (id == 'size') p.radius_bubble = undefined;\n if (id == 'opacity') p.opacity_bubble = undefined;\n }\n } else {\n if (p_obj_bubble != undefined) {\n var value_tmp = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration),\n dif = bubble_param - value_tmp;\n value = bubble_param + dif;\n if (id == 'size') p.radius_bubble = value;\n if (id == 'opacity') p.opacity_bubble = value;\n }\n }\n\n }\n\n }\n\n if (pJS.tmp.bubble_clicking) {\n /* size */\n process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size');\n /* opacity */\n process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity');\n }\n\n }\n\n };\n\n\n pJS.fn.modes.repulseParticle = function (p) {\n\n if (pJS.interactivity.events.onhover.enable && isInArray('repulse', pJS.interactivity.events.onhover.mode) && pJS.interactivity.status == 'mousemove') {\n\n var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,\n dy_mouse = p.y - pJS.interactivity.mouse.pos_y,\n dist_mouse = Math.sqrt(dx_mouse * dx_mouse + dy_mouse * dy_mouse);\n\n var normVec = { x: dx_mouse / dist_mouse, y: dy_mouse / dist_mouse },\n repulseRadius = pJS.interactivity.modes.repulse.distance,\n velocity = 100,\n repulseFactor = clamp((1 / repulseRadius) * (-1 * Math.pow(dist_mouse / repulseRadius, 2) + 1) * repulseRadius * velocity, 0, 50);\n\n var pos = {\n x: p.x + normVec.x * repulseFactor,\n y: p.y + normVec.y * repulseFactor\n }\n\n if (pJS.particles.move.out_mode == 'bounce') {\n if (pos.x - p.radius > 0 && pos.x + p.radius < pJS.canvas.w) p.x = pos.x;\n if (pos.y - p.radius > 0 && pos.y + p.radius < pJS.canvas.h) p.y = pos.y;\n } else {\n p.x = pos.x;\n p.y = pos.y;\n }\n\n }\n\n\n else if (pJS.interactivity.events.onclick.enable && isInArray('repulse', pJS.interactivity.events.onclick.mode)) {\n\n if (!pJS.tmp.repulse_finish) {\n pJS.tmp.repulse_count++;\n if (pJS.tmp.repulse_count == pJS.particles.array.length) {\n pJS.tmp.repulse_finish = true;\n }\n }\n\n if (pJS.tmp.repulse_clicking) {\n\n var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance / 6, 3);\n\n var dx = pJS.interactivity.mouse.click_pos_x - p.x,\n dy = pJS.interactivity.mouse.click_pos_y - p.y,\n d = dx * dx + dy * dy;\n\n var force = -repulseRadius / d * 1;\n\n function process() {\n\n var f = Math.atan2(dy, dx);\n p.vx = force * Math.cos(f);\n p.vy = force * Math.sin(f);\n\n if (pJS.particles.move.out_mode == 'bounce') {\n var pos = {\n x: p.x + p.vx,\n y: p.y + p.vy\n }\n if (pos.x + p.radius > pJS.canvas.w) p.vx = -p.vx;\n else if (pos.x - p.radius < 0) p.vx = -p.vx;\n if (pos.y + p.radius > pJS.canvas.h) p.vy = -p.vy;\n else if (pos.y - p.radius < 0) p.vy = -p.vy;\n }\n\n }\n\n // default\n if (d <= repulseRadius) {\n process();\n }\n\n // bang - slow motion mode\n // if(!pJS.tmp.repulse_finish){\n // if(d <= repulseRadius){\n // process();\n // }\n // }else{\n // process();\n // }\n\n\n } else {\n\n if (pJS.tmp.repulse_clicking == false) {\n\n p.vx = p.vx_i;\n p.vy = p.vy_i;\n\n }\n\n }\n\n }\n\n }\n\n\n pJS.fn.modes.grabParticle = function (p) {\n\n if (pJS.interactivity.events.onhover.enable && pJS.interactivity.status == 'mousemove') {\n\n var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,\n dy_mouse = p.y - pJS.interactivity.mouse.pos_y,\n dist_mouse = Math.sqrt(dx_mouse * dx_mouse + dy_mouse * dy_mouse);\n\n /* draw a line between the cursor and the particle if the distance between them is under the config distance */\n if (dist_mouse <= pJS.interactivity.modes.grab.distance) {\n\n var opacity_line = pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1 / pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance;\n\n if (opacity_line > 0) {\n\n /* style */\n var color_line = pJS.particles.line_linked.color_rgb_line;\n pJS.canvas.ctx.strokeStyle = 'rgba(' + color_line.r + ',' + color_line.g + ',' + color_line.b + ',' + opacity_line + ')';\n pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;\n //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */\n\n /* path */\n pJS.canvas.ctx.beginPath();\n pJS.canvas.ctx.moveTo(p.x, p.y);\n pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y);\n pJS.canvas.ctx.stroke();\n pJS.canvas.ctx.closePath();\n\n }\n\n }\n\n }\n\n };\n\n\n\n /* ---------- pJS functions - vendors ------------ */\n\n pJS.fn.vendors.eventsListeners = function () {\n\n /* events target element */\n if (pJS.interactivity.detect_on == 'window') {\n pJS.interactivity.el = window;\n } else {\n pJS.interactivity.el = pJS.canvas.el;\n }\n\n\n /* detect mouse pos - on hover / click event */\n if (pJS.interactivity.events.onhover.enable || pJS.interactivity.events.onclick.enable) {\n\n /* el on mousemove */\n pJS.interactivity.el.addEventListener('mousemove', function (e) {\n\n if (pJS.interactivity.el == window) {\n var pos_x = e.clientX,\n pos_y = e.clientY;\n }\n else {\n var pos_x = e.offsetX || e.clientX,\n pos_y = e.offsetY || e.clientY;\n }\n\n pJS.interactivity.mouse.pos_x = pos_x;\n pJS.interactivity.mouse.pos_y = pos_y;\n\n if (pJS.tmp.retina) {\n pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio;\n pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio;\n }\n\n pJS.interactivity.status = 'mousemove';\n\n });\n\n /* el on onmouseleave */\n pJS.interactivity.el.addEventListener('mouseleave', function (e) {\n\n pJS.interactivity.mouse.pos_x = null;\n pJS.interactivity.mouse.pos_y = null;\n pJS.interactivity.status = 'mouseleave';\n\n });\n\n }\n\n /* on click event */\n if (pJS.interactivity.events.onclick.enable) {\n\n pJS.interactivity.el.addEventListener('click', function () {\n\n pJS.interactivity.mouse.click_pos_x = pJS.interactivity.mouse.pos_x;\n pJS.interactivity.mouse.click_pos_y = pJS.interactivity.mouse.pos_y;\n pJS.interactivity.mouse.click_time = new Date().getTime();\n\n if (pJS.interactivity.events.onclick.enable) {\n\n switch (pJS.interactivity.events.onclick.mode) {\n\n case 'push':\n if (pJS.particles.move.enable) {\n pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);\n } else {\n if (pJS.interactivity.modes.push.particles_nb == 1) {\n pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);\n }\n else if (pJS.interactivity.modes.push.particles_nb > 1) {\n pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb);\n }\n }\n break;\n\n case 'remove':\n pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb);\n break;\n\n case 'bubble':\n pJS.tmp.bubble_clicking = true;\n break;\n\n case 'repulse':\n pJS.tmp.repulse_clicking = true;\n pJS.tmp.repulse_count = 0;\n pJS.tmp.repulse_finish = false;\n setTimeout(function () {\n pJS.tmp.repulse_clicking = false;\n }, pJS.interactivity.modes.repulse.duration * 1000)\n break;\n\n }\n\n }\n\n });\n\n }\n\n\n };\n\n pJS.fn.vendors.densityAutoParticles = function () {\n\n if (pJS.particles.number.density.enable) {\n\n /* calc area */\n var area = pJS.canvas.el.width * pJS.canvas.el.height / 1000;\n if (pJS.tmp.retina) {\n area = area / (pJS.canvas.pxratio * 2);\n }\n\n /* calc number of particles based on density area */\n var nb_particles = area * pJS.particles.number.value / pJS.particles.number.density.value_area;\n\n /* add or remove X particles */\n var missing_particles = pJS.particles.array.length - nb_particles;\n if (missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles));\n else pJS.fn.modes.removeParticles(missing_particles);\n\n }\n\n };\n\n\n pJS.fn.vendors.checkOverlap = function (p1, position) {\n for (var i = 0; i < pJS.particles.array.length; i++) {\n var p2 = pJS.particles.array[i];\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y,\n dist = Math.sqrt(dx * dx + dy * dy);\n\n if (dist <= p1.radius + p2.radius) {\n p1.x = position ? position.x : Math.random() * pJS.canvas.w;\n p1.y = position ? position.y : Math.random() * pJS.canvas.h;\n pJS.fn.vendors.checkOverlap(p1);\n }\n }\n };\n\n\n pJS.fn.vendors.createSvgImg = function (p) {\n\n /* set color to svg element */\n var svgXml = pJS.tmp.source_svg,\n rgbHex = /#([0-9A-F]{3,6})/gi,\n coloredSvgXml = svgXml.replace(rgbHex, function (m, r, g, b) {\n if (p.color.rgb) {\n var color_value = 'rgba(' + p.color.rgb.r + ',' + p.color.rgb.g + ',' + p.color.rgb.b + ',' + p.opacity + ')';\n } else {\n var color_value = 'hsla(' + p.color.hsl.h + ',' + p.color.hsl.s + '%,' + p.color.hsl.l + '%,' + p.opacity + ')';\n }\n return color_value;\n });\n\n /* prepare to create img with colored svg */\n var svg = new Blob([coloredSvgXml], { type: 'image/svg+xml;charset=utf-8' }),\n DOMURL = window.URL || window.webkitURL || window,\n url = DOMURL.createObjectURL(svg);\n\n /* create particle img obj */\n var img = new Image();\n img.addEventListener('load', function () {\n p.img.obj = img;\n p.img.loaded = true;\n DOMURL.revokeObjectURL(url);\n pJS.tmp.count_svg++;\n });\n img.src = url;\n\n };\n\n\n pJS.fn.vendors.destroypJS = function () {\n cancelAnimationFrame(pJS.fn.drawAnimFrame);\n canvas_el.remove();\n pJSDom = null;\n };\n\n\n pJS.fn.vendors.drawShape = function (c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator) {\n\n // By Programming Thomas - https://programmingthomas.wordpress.com/2013/04/03/n-sided-shapes/\n var sideCount = sideCountNumerator * sideCountDenominator;\n var decimalSides = sideCountNumerator / sideCountDenominator;\n var interiorAngleDegrees = (180 * (decimalSides - 2)) / decimalSides;\n var interiorAngle = Math.PI - Math.PI * interiorAngleDegrees / 180; // convert to radians\n c.save();\n c.beginPath();\n c.translate(startX, startY);\n c.moveTo(0, 0);\n for (var i = 0; i < sideCount; i++) {\n c.lineTo(sideLength, 0);\n c.translate(sideLength, 0);\n c.rotate(interiorAngle);\n }\n //c.stroke();\n c.fill();\n c.restore();\n\n };\n\n pJS.fn.vendors.exportImg = function () {\n window.open(pJS.canvas.el.toDataURL('image/png'), '_blank');\n };\n\n\n pJS.fn.vendors.loadImg = function (type) {\n\n pJS.tmp.img_error = undefined;\n\n if (pJS.particles.shape.image.src != '') {\n\n if (type == 'svg') {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', pJS.particles.shape.image.src);\n xhr.onreadystatechange = function (data) {\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n pJS.tmp.source_svg = data.currentTarget.response;\n pJS.fn.vendors.checkBeforeDraw();\n } else {\n console.log('Error pJS - Image not found');\n pJS.tmp.img_error = true;\n }\n }\n }\n xhr.send();\n\n } else {\n\n var img = new Image();\n img.addEventListener('load', function () {\n pJS.tmp.img_obj = img;\n pJS.fn.vendors.checkBeforeDraw();\n });\n img.src = pJS.particles.shape.image.src;\n\n }\n\n } else {\n console.log('Error pJS - No image.src');\n pJS.tmp.img_error = true;\n }\n\n };\n\n\n pJS.fn.vendors.draw = function () {\n\n if (pJS.particles.shape.type == 'image') {\n\n if (pJS.tmp.img_type == 'svg') {\n\n if (pJS.tmp.count_svg >= pJS.particles.number.value) {\n pJS.fn.particlesDraw();\n if (!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);\n else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);\n } else {\n //console.log('still loading...');\n if (!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);\n }\n\n } else {\n\n if (pJS.tmp.img_obj != undefined) {\n pJS.fn.particlesDraw();\n if (!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);\n else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);\n } else {\n if (!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);\n }\n\n }\n\n } else {\n pJS.fn.particlesDraw();\n if (!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);\n else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);\n }\n\n };\n\n\n pJS.fn.vendors.checkBeforeDraw = function () {\n\n // if shape is image\n if (pJS.particles.shape.type == 'image') {\n\n if (pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg == undefined) {\n pJS.tmp.checkAnimFrame = requestAnimFrame(check);\n } else {\n //console.log('images loaded! cancel check');\n cancelRequestAnimFrame(pJS.tmp.checkAnimFrame);\n if (!pJS.tmp.img_error) {\n pJS.fn.vendors.init();\n pJS.fn.vendors.draw();\n }\n\n }\n\n } else {\n pJS.fn.vendors.init();\n pJS.fn.vendors.draw();\n }\n\n };\n\n\n pJS.fn.vendors.init = function () {\n\n /* init canvas + particles */\n pJS.fn.retinaInit();\n pJS.fn.canvasInit();\n pJS.fn.canvasSize();\n pJS.fn.canvasPaint();\n pJS.fn.particlesCreate();\n pJS.fn.vendors.densityAutoParticles();\n\n /* particles.line_linked - convert hex colors to rgb */\n pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color);\n\n };\n\n\n pJS.fn.vendors.start = function () {\n\n if (isInArray('image', pJS.particles.shape.type)) {\n pJS.tmp.img_type = pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3);\n pJS.fn.vendors.loadImg(pJS.tmp.img_type);\n } else {\n pJS.fn.vendors.checkBeforeDraw();\n }\n\n };\n\n\n\n\n /* ---------- pJS - start ------------ */\n\n\n pJS.fn.vendors.eventsListeners();\n\n pJS.fn.vendors.start();\n\n\n\n };\n\n /* ---------- global functions - vendors ------------ */\n\n Object.deepExtend = function (destination, source) {\n for (var property in source) {\n if (source[property] && source[property].constructor &&\n source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n arguments.callee(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n };\n\n window.requestAnimFrame = (function () {\n return window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (callback) {\n window.setTimeout(callback, 1000 / 60);\n };\n })();\n\n window.cancelRequestAnimFrame = (function () {\n return window.cancelAnimationFrame ||\n window.webkitCancelRequestAnimationFrame ||\n window.mozCancelRequestAnimationFrame ||\n window.oCancelRequestAnimationFrame ||\n window.msCancelRequestAnimationFrame ||\n clearTimeout\n })();\n\n function hexToRgb(hex) {\n // By Tim Down - http://stackoverflow.com/a/5624139/3493650\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n };\n\n function clamp(number, min, max) {\n return Math.min(Math.max(number, min), max);\n };\n\n function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }\n\n\n /* ---------- particles.js functions - start ------------ */\n\n window.pJSDom = [];\n\n window.particlesJS = function (tag_id, params) {\n\n //console.log(params);\n\n /* no string id? so it's object params, and set the id with default id */\n if (typeof (tag_id) != 'string') {\n params = tag_id;\n tag_id = 'particles-js';\n }\n\n /* no id? set the id to default id */\n if (!tag_id) {\n tag_id = 'particles-js';\n }\n\n /* pJS elements */\n var pJS_tag = document.getElementById(tag_id),\n pJS_canvas_class = 'particles-js-canvas-el',\n exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class);\n\n /* remove canvas if exists into the pJS target tag */\n if (exist_canvas.length) {\n while (exist_canvas.length > 0) {\n pJS_tag.removeChild(exist_canvas[0]);\n }\n }\n\n /* create canvas element */\n var canvas_el = document.createElement('canvas');\n canvas_el.className = pJS_canvas_class;\n\n /* set size canvas */\n canvas_el.style.width = \"100%\";\n canvas_el.style.height = \"100%\";\n\n /* append canvas */\n var canvas = document.getElementById(tag_id).appendChild(canvas_el);\n\n /* launch particle.js */\n if (canvas != null) {\n pJSDom.push(new pJS(tag_id, params));\n }\n\n };\n\n window.particlesJS.load = function (tag_id, path_config_json, callback) {\n\n /* load json config */\n var xhr = new XMLHttpRequest();\n xhr.open('GET', path_config_json);\n xhr.onreadystatechange = function (data) {\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n var params = JSON.parse(data.currentTarget.response);\n window.particlesJS(tag_id, params);\n if (callback) callback();\n } else {\n console.log('Error pJS - XMLHttpRequest status: ' + xhr.status);\n console.log('Error pJS - File config not found');\n }\n }\n };\n xhr.send();\n\n };\n }", "function addParticle(){\n var x = Math.floor(Math.random() * cW)+1;\n var y = Math.floor(Math.random() * cH)+1;\n var size = Math.floor(Math.random() * 5)/particle.size+1;;\n particles.push({'x':x,'y':y,'size':size});\n }", "function setup() {\n //Create Size of Canvas\n createCanvas(400, 400);\n for(let i = 0; i < numberWalls; i++) {\n //Randomize Coordinate for part 1 of ray\n let x1 = random(width);\n let y1 = random(height);\n //Randomize Coordinate for part 2 of ray\n let x2 = random(width); \n let y2 = random(height); \n //Create the wall\n walls[i] = new Boundary(x1, y1, x2, y2);\n }\n //Add four additional walls for the border of the canvas\n walls.push(new Boundary(0, 0, width, 0));\n walls.push(new Boundary(width, 0, width, height));\n walls.push(new Boundary(width, height, 0, height));\n walls.push(new Boundary(0, height, 0, 0));\n\n //Create the Particle Object\n particle = new Particle();\n}", "function Particle(){\n this.x=100;\n this.y=99;\n // this.show=function(){\n // point=(this.x,this.y);\n // }\n}", "function update_particle() {\n\n //Loops through all of the particles in the array\n for (i = 0; i < particles.length; i++) {\n\n //Sets this variable to the current particle so we can refer to the particle easier.\n var p = particles[i];\n\n //If the particle's X and Y coordinates are within the bounds of the canvas...\n if (p.x >= 0 && p.x < canvas_width && p.y >= 0 && p.y < canvas_height) {\n\n /*\n These lines divide the X and Y values by the size of each cell. This number is\n then parsed to a whole number to determine which grid cell the particle is above.\n */\n var col = parseInt(p.x / resolution);\n var row = parseInt(p.y / resolution);\n\n //Same as above, store reference to cell\n var cell_data = vec_cells[col][row];\n \n /*\n These values are percentages. They represent the percentage of the distance across\n the cell (for each axis) that the particle is positioned. To give an example, if \n the particle is directly in the center of the cell, these values would both be \"0.5\"\n\n The modulus operator (%) is used to get the remainder from dividing the particle's \n coordinates by the resolution value. This number can only be smaller than the \n resolution, so we divide it by the resolution to get the percentage.\n */\n var ax = (p.x % resolution) / resolution;\n var ay = (p.y % resolution) / resolution;\n \n /*\n These lines subtract the decimal from 1 to reverse it (e.g. 100% - 75% = 25%), multiply \n that value by the cell's velocity, and then by 0.05 to greatly reduce the overall change in velocity \n per frame (this slows down the movement). Then they add that value to the particle's velocity\n in each axis. This is done so that the change in velocity is incrementally made as the\n particle reaches the end of it's path across the cell.\n */\n p.xv += (1 - ax) * cell_data.xv * 0.05;\n p.yv += (1 - ay) * cell_data.yv * 0.05;\n \n /*\n These next four lines are are pretty much the same, except the neighboring cell's \n velocities are being used to affect the particle's movement. If you were to comment\n them out, the particles would begin grouping at the boundary between cells because\n the neighboring cells wouldn't be able to pull the particle into their boundaries.\n */\n p.xv += ax * cell_data.right.xv * 0.05;\n p.yv += ax * cell_data.right.yv * 0.05;\n \n p.xv += ay * cell_data.down.xv * 0.05;\n p.yv += ay * cell_data.down.yv * 0.05;\n \n //This adds the calculated velocity to the position coordinates of the particle.\n p.x += p.xv;\n p.y += p.yv;\n \n //For each axis, this gets the distance between the old position of the particle and it's new position.\n var dx = p.px - p.x;\n var dy = p.py - p.y;\n\n //Using the Pythagorean theorum (A^2 + B^2 = C^2), this determines the distance the particle travelled.\n var dist = Math.sqrt(dx * dx + dy * dy);\n \n //This line generates a random value between 0 and 0.5\n var limit = Math.random() * 0.5;\n \n //If the distance the particle has travelled this frame is greater than the random value...\n if (dist > limit) {\n ctx.lineWidth = 1;\n ctx.beginPath(); //Begin a new path on the canvas\n ctx.moveTo(p.x, p.y); //Move the drawing cursor to the starting point\n ctx.lineTo(p.px, p.py); //Describe a line from the particle's old coordinates to the new ones\n ctx.stroke(); //Draw the path to the canvas\n }else{\n //If the particle hasn't moved further than the random limit...\n\n ctx.beginPath();\n ctx.moveTo(p.x, p.y);\n\n /*\n Describe a line from the particle's current coordinates to those same coordinates \n plus the random value. This is what creates the shimmering effect while the particles\n aren't moving.\n */\n ctx.lineTo(p.x + limit, p.y + limit);\n\n ctx.stroke();\n }\n \n //This updates the previous X and Y coordinates of the particle to the new ones for the next loop.\n p.px = p.x;\n p.py = p.y;\n }\n else {\n //If the particle's X and Y coordinates are outside the bounds of the canvas...\n\n //Place the particle at a random location on the canvas\n p.x = p.px = Math.random() * canvas_width;\n p.y = p.py = Math.random() * canvas_height;\n\n //Set the particles velocity to zero.\n p.xv = 0;\n p.yv = 0;\n }\n \n //These lines divide the particle's velocity in half everytime it loops, slowing them over time.\n // p.xv *= 0.02;\n\t\t\t// p.yv *= 0.02;\n\t\t\t\n\t\t\tp.xv *= 0.1;\n p.yv *= 0.1;\n }\n }", "function Ball(x,y,vx,vy,radius,color)\n{\n\tthis.x =x;\n\tthis.y =y;\n\tthis.vx = vx;\n\tthis.vy = vy;\n this.radius = radius;\n\tthis.color = color;\n\t\n this.norm = function () {\n var z = Math.sqrt(this.vx * this.vx + this.vy * this.vy );\n z = enemySpeed / z;\n this.vx *= z;\n\t this.vy *= z;\n };\n\t\n this.draw = function() {\n theContext.strokeStyle = \"#0000000\";\n theContext.fillStyle = this.color;\n theContext.beginPath();\n theContext.arc(this.x,this.y,this.radius,0,circ,true);\n theContext.moveTo(this.x,this.y);\n theContext.closePath();\n theContext.stroke();\n theContext.fill();\n };\n\t\n this.move = function() {\n\t\tthis.x += this.vx;\n\t\tthis.y += this.vy;\n\t\tif (this.x + this.radius > theCanvas.width) {\n\t\t\tif (this.vx > 0) {\n\t\t\t\tthis.vx = -this.vx;\n\t\t\t}\n\t\t}\n\t\tif (this.y + this.radius > theCanvas.height) {\n\t\t\tif (this.vy > 0) {\n\t\t\t\tthis.vy = -this.vy;\n\t\t\t}\n\t\t}\n\t\tif (this.x - this.radius < 0) {\n\t\t\tif (this.vx < 0) {\n\t\t\t\tthis.vx = -this.vx;\n\t\t\t}\n\t\t}\n\t\tif (this.y - this.radius < 0) {\n\t\t\tif (this.vy < 0) {\n\t\t\t\tthis.vy = -this.vy;\n\t\t\t}\n\t\t}\n };\n \n this.getX = function(){\n \treturn this.x;\n }\n \n this.getY = function(){\n \treturn this.y;\n }\n \n this.setVelocity = function(newVX, newVY) {\n \tthis.vx = newVX;\n \tthis.vy = newVY;\n \t//console.log(\"new velocity set to \" + x +\",\" + y);\n };\n}", "function Ball(x, y, r, v, ro) {\n this.x = x;\n this.y = y;\n this.r = r;\n this.v = v; // px/sec\n this.ro = ro; // rad - 0 is 3 o'clock - clockwise+\n this.paused = false; //msec\n this.speedBonus = 1; //msec\n this.strokeColor = 'white';\n this.fillColor = 'white';\n\n}", "update() {\n //check if particle is still within particle-js container\n if (this.x > particles.width || this.x < 0) {\n this.directionX = -this.directionX;\n }\n if (this.y > particles.height || this.y < 0) {\n this.directionY = -this.directionY;\n }\n //check collision detection - mouse position / particle position\n let dx = mouse.x - this.x;\n let dy = mouse.y - this.y;\n let distance = Math.sqrt(dx * dx + dy * dy);\n if (distance < mouse.radius + this.size) {\n if (mouse.x < this.x && this.x < particles.width - this.size * 10) {\n this.x += 10;\n }\n if (mouse.x > this.x && this.x > this.size * 10) {\n this.x -= 10;\n }\n if (mouse.y < this.y && this.y < particles.height - this.size * 10) {\n this.y += 10;\n }\n if (mouse.y > this.y && this.y > this.size * 10) {\n this.y -= 10;\n }\n }\n // move particle\n this.x += this.directionX;\n this.y += this.directionY;\n // draw particle\n this.draw();\n }", "function CommonBall() {\n this.Pointx = 0;\n this.Pointy = 0;\n this.vx = 0.3;\n this.vy = 0.3;\n}", "setup(maxParticlesCount, position, minSpeed, maxSpeed, direction, size, particleStartSize, particleEndSize, particleLifetime, startColor, endColor)\n {\n this.position = position;\n this.direction = direction.normalize();\n this.maxSpeed = maxSpeed;\n this.minSpeed = minSpeed;\n this.size = size;\n this.particlesCount = maxParticlesCount;\n //for particles\n this.startSize = particleStartSize;\n this.endSize = particleEndSize;\n\n this.particleLifetime = particleLifetime;\n\n this.startColor = startColor;\n this.endColor = endColor;\n\n for(var i = 0; i < this.particlesCount; ++i)\n {\n var item = new ParticleSystemItem();\n\n\n if (this.randomSize)\n {\n var newSize = createVector(0,0);\n newSize.x = random(this.startSize.x, this.endSize.x);\n newSize.y = newSize.x;\n\n item.startSize = newSize;\n item.endSize = newSize;\n }\n else {\n item.startSize = this.startSize;\n item.endSize = this.endSize;\n\n }\n\n item.lifeTime = this.particleLifetime;\n item.lifeTimer = 0.0;\n\n item.pos.x = this.position.x + random(-size.x, size.x);\n item.pos.y = this.position.y + random(-size.y, size.y);\n\n var newSpeed = createVector(0,0);\n\n if (!this.randomDirection)\n {\n p5.Vector.mult(this.direction, random(this.minSpeed, this.maxSpeed), newSpeed);\n }\n else\n {\n var newdir = createVector(0,0);\n newdir.x = random(-this.size.x, this.size.x);\n newdir.y = random(-this.size.y, this.size.y);\n newdir.normalize();\n\n p5.Vector.mult(newdir, random(this.minSpeed, this.maxSpeed), newSpeed);\n\n }\n\n item.speed = newSpeed;\n\n item.startColor = this.startColor;\n item.endColor = this.endColor;\n\n item.isActive = this.isActive;\n\n this.counter += 1;\n if(this.counter > this.particlesCount)\n {\n this.counter = 0;\n }\n item.delay = this.counter * random(0.0, item.lifeTime / this.particlesCount);\n\n this.particles.push(item);\n\n\n\n }\n }", "function Particle(){\n this.x = 100;\n this.y = 10;\n\n ////////////////////////\n this.show = function(){\n point(this.x, this.y);\n }\n ////////////////////////\n}", "function setupBall() {\n ball.x = width/2;\n ball.y = height/2;\n ball.vx = ball.speed;\n ball.vy = ball.speed;\n}", "function ballHitPaddle(ball, paddle) {\n ball.animations.play('wobble');\n ball.body.velocity.x = -1 * 5 * (paddle.x - ball.x)\n}", "function draw() {\n particles.forEach((p) => {\n p.draw();\n });\n}", "function deplacement_balle(balle)\r\n{\r\n\tif(balle.aimant==false || (estdans_paddle(balle.x+balle.r,balle.y+balle.r)==false && balle.aimant==true))\r\n\t{\r\n\t balle.x+=balle.dx;\r\n\t balle.y+=balle.dy;\r\n\t}\r\n\t//On gère le rebond sur les bords GAUCHE et DROIT\r\n\tif(balle.x + balle.dx> canvas.width-balle.r || balle.x + balle.dx< balle.r)\r\n \t balle.dx= -balle.dx;\r\n\r\n\r\n/*On gère le bord en BAS :\r\n\tSi la balle depasse ce bord, la balle est ré-envoyé dans le cadre du jeu et on perd une vie\r\n*/\r\n\tif(balle.y + balle.dy> canvas.height-balle.r)\r\n\t{\t\r\n\t\tballe.aimant=true;\r\n\t\tp.aimant=true;\r\n\t balle.y = 600-p.larg;\r\n\t balle.dx=0;\r\n\t balle.dy=0;\r\n\t balle.x=p.x+40;\r\n\t vies=vies-1;\r\n\t if(muet==1)\r\n \t{\r\n\t \tson('images/relance.wav');\r\n\t\t}\r\n\t}\r\n\r\n\t//On gère le bord du HAUT\r\n\tif(balle.y + balle.dy< balle.r)\r\n\t balle.dy= -balle.dy;\r\n/*\r\n\tCOLLISIONZ AVEC LE PADDLE\r\n\tSi la balle touche le paddle est qu'on a le bonus aimant (balle.aimant===true)\r\n\talors on fige la balle pendant 3 secondes\r\n\tAussi non on la renvoie avec l'angle donné\r\n*/\r\n\tif(estdans_paddle(balle.x+balle.r,balle.y+balle.r)==true)\r\n\t{\r\n\t\tconsole.log(\"dx : \"+balle.dx+\" dy : \"+balle.dy);\r\n\t\tvar intervalle=balle.x-p.x;\r\n\t\tconsole.log(intervalle);\r\n\r\n\t\tif((intervalle>0 && intervalle<=20) && (balle.dx<0))\r\n\t\t{\r\n\t\t\tballe.dx=-10;\r\n\t\t\tballe.dy=2;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>20 && intervalle<=40) && (balle.dx<0))\r\n\t\t{\r\n\t\t\tballe.dx=-8;\r\n\t\t\tballe.dy=4;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>40 && intervalle<=60) && (balle.dx<0))\r\n\t\t{\r\n\t\t\tballe.dx=-6;\r\n\t\t\tballe.dy=6;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>60 && intervalle<=80) && (balle.dx<0))\r\n\t\t{\r\n\t\t\tballe.dx=-4;\r\n\t\t\tballe.dy=8;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\r\n\t\tif((intervalle>0 && intervalle<=20) && (balle.dx>0))\r\n\t\t{\r\n\t\t\tballe.dx=4;\r\n\t\t\tballe.dy=8;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>20 && intervalle<=40) && (balle.dx>0))\r\n\t\t{\r\n\t\t\tballe.dx=6;\r\n\t\t\tballe.dy=6;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>40 && intervalle<=60) && (balle.dx>0))\r\n\t\t{\r\n\t\t\tballe.dx=8;\r\n\t\t\tballe.dy=4;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\t\tif((intervalle>60 && intervalle<=80) && (balle.dx>0))\r\n\t\t{\r\n\t\t\tballe.dx=10;\r\n\t\t\tballe.dy=2;\r\n\t\t\tballe.dy=-balle.dy;\r\n\t\t}\r\n\r\n\r\n\t\tif(balle.aimant===true)\r\n\t\t{\r\n\t\t\tp.aimant=true;\r\n\t\t\tballe.time=2;\r\n\t\t\tif(p.aimant!=true)\r\n\t\t\t{\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tballe.aimant=false;\r\n\t\t\t\t\tballe.time=1;\r\n\t\t\t\t\tballe.dy= -balle.dy;\r\n\t\t\t\t\t\r\n\t\t\t\t}, 3000);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(muet==1)\r\n\t\t\t{\r\n\t\t\t\tson('images/touche_paddle.wav');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//COLLISIONS AVEC LES BRIQUES\r\n\tfor(i=1;i<tableau.length;i++)\r\n {\r\n if((balle.x>tableau[i].x) && (balle.x<(tableau[i].x+tableau[i].long)) && (balle.y>tableau[i].y-10) && (balle.y<(tableau[i].y+tableau[i].larg+10)))\r\n\t \t\t{\r\n\t \t\t\tif(muet==1)\r\n\t \t\t\t{\r\n\t \t\t\t\tson('images/touche.wav');\r\n\t \t\t\t}\r\n\r\n\t\t\t\t\t\t/*On gère les briques cassables, chaque brique a un nombre de vies, c'est-à-dire le nombre de coups\r\n\t\t\t\t\t\t\tqu'il faut pour la détruire. Quand une brique est touchée on lui enlève une vie.\r\n\t\t\t\t\t\t\tSi elle n'a plus de vie, alors on la supprime.\r\n\t\t\t\t\t\t*/\r\n\t \t\t if(tableau[i].incassable==false)\r\n\t \t\t {\r\n\t\t \t\t tableau[i].vie-=1;\r\n\t\t \t\t if(tableau[i].vie==2)\r\n\t\t {\r\n\t\t \t\ttableau[i].couleur=\"orange\";\r\n\t\t }\r\n\t\t \t\t if(tableau[i].vie==1)\r\n\t\t {\r\n\t\t \t\ttableau[i].couleur=\"red\";\r\n\t\t }\r\n\t\t balle.dy= -balle.dy;\r\n\t\t if(tableau[i].vie==0)\r\n\t\t {\r\n\t\t \tenlever_brique(i);\r\n\t\t }\r\n\t }\r\n else\r\n {\r\n \t\tballe.dy= -balle.dy;\r\n }\r\n\t }\r\n }\r\n}", "function addBall() {\n\tvar rows = gBoard.length;\n\tvar colls = gBoard[0].length;\n\tvar i = getRandomIntInclusive(0, rows - 1);\n\tvar j = getRandomIntInclusive(0, colls - 1);\n\n\tvar randomCell = gBoard[i][j];\n\tif (randomCell.type === WALL) return;\n\telse if (randomCell.gameElement !== null) return;\n\telse if (gIsGameOn) {\n\t\tgBoard[i][j].gameElement = BALL\n\t\tgBallsToCollect++;\n\t}\n\n\trenderCell({ i, j }, BALL_IMG);\n}" ]
[ "0.71184534", "0.69016254", "0.688879", "0.68635935", "0.6822931", "0.6577163", "0.6545521", "0.65444607", "0.6502456", "0.6496114", "0.64847225", "0.64781713", "0.647718", "0.6471997", "0.646383", "0.6460675", "0.6446303", "0.6439485", "0.6422377", "0.6419649", "0.6411926", "0.639807", "0.63920844", "0.63753784", "0.63692397", "0.63678306", "0.6348322", "0.63394415", "0.6332283", "0.62929577", "0.6292352", "0.62878907", "0.6283478", "0.6272171", "0.6256862", "0.6248725", "0.62305635", "0.6216604", "0.6210777", "0.6204227", "0.61961967", "0.61725205", "0.61540633", "0.612902", "0.61114365", "0.61104304", "0.6108418", "0.60900295", "0.6072344", "0.606857", "0.6066306", "0.60572815", "0.605236", "0.605178", "0.60513717", "0.60459733", "0.6045571", "0.6045107", "0.6042738", "0.6039512", "0.6036461", "0.6036043", "0.60264623", "0.60221726", "0.6008515", "0.6008151", "0.5999812", "0.59801817", "0.59726495", "0.59718865", "0.59662116", "0.5965464", "0.5965454", "0.5963894", "0.5953404", "0.59486353", "0.59482443", "0.5947963", "0.5947014", "0.5944285", "0.5940249", "0.59378177", "0.5937629", "0.5934886", "0.5933997", "0.5927933", "0.59210014", "0.59199405", "0.59170705", "0.5914958", "0.5909186", "0.5907056", "0.590616", "0.59006405", "0.5894732", "0.5893785", "0.58876675", "0.58859116", "0.5880043", "0.5877476" ]
0.63703877
24
Instantiates a new component.
constructor(props: Props) { super(props); this.state = { lobbyEnabled: props._lobbyEnabled }; this._onToggleLobby = this._onToggleLobby.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create(options) {\n return new component_Component(options);\n}", "function Component() { }", "function ComponentInstance() {\r\n _super.call(this);\r\n }", "createComponent(obj){\n\t\t\tvar comp = new Component(obj.selector, obj.template, obj.ctrlFunc);\n\t\t\tthis[componentSymbol].push({\n\t\t\t\tname: obj.name,\n\t\t\t\tcomponent: comp\n\t\t\t});\n\t\t\treturn comp;\n\t\t}", "function Component() {\n _classCallCheck(this, Component);\n\n Component.initialize(this);\n }", "constructor(props) {\n this.component = props;\n }", "constructor(props) {\n this.component = props;\n }", "constructor() {\n super(); // loading the parent component methods and properties\n return this.buildComponenent(); // this function should always be called, it returns the object to render\n }", "static async create() {\n let comp = Reflect.construct(this, arguments);\n // build default required components\n await Promise.all(resolveRequiredComponents(comp)\n .map(c => comp.addComponent(c)));\n return comp;\n }", "function createInstance(element, componentName, component, options) {\n component.prototype._name = componentName;\n var instance = new component(element, options);\n\n if (_config2.default.get('log')) {\n console.info('Created instance of component \"' + componentName + '\".');\n }\n return instance;\n}", "new( name ){\r\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\t\tlet idx = this.names.get( name );\r\n\t\tif( idx == undefined ){ console.error( \"Component name unknown : %s\", name ); return null; }\r\n\r\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\t\tlet c, com = this.items[ idx ];\r\n\r\n\t\tif( com.recycle.length > 0 ){\r\n\t\t\tc\t\t\t= com.instances[ com.recycle.pop() ];\r\n\t\t\tc._active\t= true;\r\n\t\t}else{\r\n\t\t\tc = new com.object();\r\n\t\t\tc._component_id = com.instances.length;\r\n\t\t\tcom.instances.push( c );\r\n\t\t}\r\n\r\n\t\treturn c;\r\n\t}", "constructor(components) {\r\n this.components = components;\r\n }", "createView() {\n const view = this.namespace().Views.ComponentView.new()\n\n view.assemble()\n\n return view\n }", "static async createAndInit() {\n let comp = Reflect.construct(this, arguments);\n // build default required components\n await Promise.all(resolveRequiredComponents(comp)\n .map(c => comp.addComponent(c)));\n await comp.init();\n return comp;\n }", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "create() {\n // add data to Component from dataObject\n this.initData()\n // add data to Component from computedObject\n this.initComputed()\n // add method before created\n this.initMethod()\n\n this.created()\n }", "constructor(){\n this.uiComponent = new UIComponent();\n}", "create() {\n const entity = internal(this).entity;\n entity.create(); // Make sure the entity exists.\n const model = entity.model();\n internal(model).components.add(this);\n return this;\n }", "addComponent(componentConfig) {\n const component = new resources_1.Component(Object.assign(Object.assign({}, componentConfig), { input: slash_1.default(componentConfig.input), outputFolder: slash_1.default(componentConfig.outputFolder) }));\n this.components.push(component);\n return component;\n }", "defineComponents() {\r\n this.components.forEach(Component => {\r\n this[Component.name] = new Component();\r\n });\r\n }", "constructor (el) {\n this.el = el;\n\n console.log('I am a sample component instantiated by using data-component=\"sample-component\" (which corresponds with the folder /js/components/sample-component) and I am instantiated on the following DOM node:');\n console.log(this.el);\n }", "function newComponent(module, name, type){\n\tconst obj = {};\n obj.module = module;\n obj.name = name;\n obj.type = type;\n obj.action = function(){\n \talert(\"I'm defined to do \"+type+\" actions\");\n };\n \n return obj;\n}", "static loadComponent() {\n return Component;\n }", "constructor()\n {\n this.type = ComponentType.Default;\n this.entity = undefined;\n }", "get Component() {\n return tesselComponentFactory.call(this);\n }", "static define() {\n Akili.component('component', Component);\n }", "function getComponentConstructor ( ractive, name ) {\n\t \tvar instance = findInstance( 'components', ractive, name );\n\t \tvar Component;\n\n\t \tif ( instance ) {\n\t \t\tComponent = instance.components[ name ];\n\n\t \t\t// best test we have for not Ractive.extend\n\t \t\tif ( !Component._Parent ) {\n\t \t\t\t// function option, execute and store for reset\n\t \t\t\tvar fn = Component.bind( instance );\n\t \t\t\tfn.isOwner = instance.components.hasOwnProperty( name );\n\t \t\t\tComponent = fn();\n\n\t \t\t\tif ( !Component ) {\n\t \t\t\t\twarnIfDebug( noRegistryFunctionReturn, name, 'component', 'component', { ractive: ractive });\n\t \t\t\t\treturn;\n\t \t\t\t}\n\n\t \t\t\tif ( typeof Component === 'string' ) {\n\t \t\t\t\t// allow string lookup\n\t \t\t\t\tComponent = getComponentConstructor( ractive, Component );\n\t \t\t\t}\n\n\t \t\t\tComponent._fn = fn;\n\t \t\t\tinstance.components[ name ] = Component;\n\t \t\t}\n\t \t}\n\n\t \treturn Component;\n\t }", "initializeComponent(element) {\n const childInjector = Injector.create({ providers: [], parent: this.injector });\n const projectableNodes = extractProjectableNodes(element, this.componentFactory.ngContentSelectors);\n this.componentRef = this.componentFactory.create(childInjector, projectableNodes, element);\n this.viewChangeDetectorRef = this.componentRef.injector.get(ChangeDetectorRef);\n this.implementsOnChanges = isFunction(this.componentRef.instance.ngOnChanges);\n this.initializeInputs();\n this.initializeOutputs(this.componentRef);\n this.detectChanges();\n const applicationRef = this.injector.get(ApplicationRef);\n applicationRef.attachView(this.componentRef.hostView);\n }", "constructor(node,component) {\n super();\n this._node = node;\n this._component = component;\n }", "function JAFTING_Component() { this.initialize(...arguments); }", "newNews () {\n new comp.div({className: \"newsForum\"},\n new comp.div({id: \"alert\"}),\n new comp.input({name: \"articleName\", placeholder: \"Article Name\", id: \"articleName\" }),\n new comp.input({name: \"articleUrl\", placeholder: \"Article Link\", id: \"articleLink\"}),\n new comp.input({name: \"articleImageUrl\", placeholder: \"Article Image Link\", id: \"articleImage\"}),\n new comp.input({name: \"articleDescription\", placeholder: \"Article Description\", id: \"articleDescription\"}),\n new comp.btn(\"Save New Article\")).render(\".new--news\")\n this.eventListener()\n }", "createDynamicComponent(component) {\n const factory = this.cfr.resolveComponentFactory(component);\n const childInjector = Injector.create({\n providers: [{ provide: McModalRef, useValue: this }],\n parent: this.viewContainer.injector\n });\n this.contentComponentRef = factory.create(childInjector);\n if (this.mcComponentParams) {\n Object.assign(this.contentComponentRef.instance, this.mcComponentParams);\n }\n // Do the first change detection immediately\n // (or we do detection at ngAfterViewInit, multi-changes error will be thrown)\n this.contentComponentRef.changeDetectorRef.detectChanges();\n }", "function DynamicComponentInstance(component) {\r\n _super.call(this);\r\n this.component = component;\r\n }", "function createComponent(comp, onChange) {\n let creator = function() {\n console.warn(\"Unknown component type: \" + comp.type);\n return <div hidden=\"true\" />\n }\n switch(comp.type) {\n case constants.DESCRIPTION: {\n creator = createDescription;\n break;\n }\n case constants.NOTIFICATION: {\n creator = createNotification;\n break;\n }\n case constants.DOCUMENT: {\n creator = createDocument;\n break;\n }\n case constants.TASK: {\n creator = createTask;\n break;\n }\n }\n return creator(comp, onChange);\n}", "function Component(_ref) {\n var owner = _ref.owner;\n\n _classCallCheck(this, Component);\n\n this.__id = _JSUtils.JSUtils.generateUUID();\n this.__enabled = true;\n this.__owner = owner;\n }", "generateComponent(scriptName) {\n if (!this._store[scriptName]) {\n return null;\n }\n\n let component = Object.create(this._store[scriptName].prototype);\n component._name = scriptName;\n\n // now we need to assign all the instance properties defined:\n let properties = this._store[scriptName].properties.getAll();\n let propertyNames = Object.keys(properties);\n\n if (propertyNames && propertyNames.length > 0) {\n propertyNames.forEach(function (propName) {\n // assign the default value if exists:\n component[propName] = properties[propName].default;\n });\n }\n\n return component;\n }", "function createComponentFactory(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors){return new ComponentFactory_(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors);}", "function createComponentContext (template = templates.simple) {\n document.body.innerHTML = template\n return new Component(document.body, definitions).refs.test\n}", "function ComponentType(){}", "function Component() {\n\t/**\n\t * If the component should be processed for containing entities.\n\t * @type {boolean}\n\t */\n\tthis.enabled = true;\n\n\t/**\n\t * The entity the component is added to.\n\t * @type {Entity|null}\n\t */\n\tthis.entity = null;\n\n\tthis.installedAPI = new Set();\n\n\t/**\n\t * Debug level for the component. Can be 'none', 'normal' or 'full'.\n\t * None will prevent the rendering of any debug meshes for the component.\n\t * @type {string}\n\t */\n\tthis.debugLevel = 'normal';\n}", "function createComponent(componentId, componentName, controller, context, parentScope, $scope, $element, $attrs, config) {\n\n // Create component class instance\n var _instance = new WilsonComponent(componentId, componentName, $scope);\n\n /***** Scope Decorations *****/\n\n $scope.component = _instance.component;\n $scope.state = { current: null }; // Default state\n\n // Forward WilsonComponent instance prototype methods onto the scope\n $scope.translate = _instance.translate.bind(_instance);\n $scope.defaultValue = _instance.defaultValue.bind(_instance);\n $scope.triggerDigest = _instance.triggerDigest.bind(_instance);\n $scope.bindToDigest = _instance.bindToDigest.bind(_instance);\n $scope.stateMachine = _instance.stateMachine.bind(_instance);\n\n // Forward WilsonComponent special object references onto the scope\n $scope.on = _instance.on;\n $scope.storage = _instance.storage;\n\n // Add convenience method for root broadcasting. All scopes inherit from angular's base\n // scope class, so bind the rootScope context into this referenced method.\n $scope.$broadcastRoot = $scope.$broadcast.bind($rootScope);\n\n\n // ___ _ _ _ _ _\n // |_ _|_ __ (_) |_(_) __ _| (_)_______\n // | || '_ \\| | __| |/ _` | | |_ / _ \\\n // | || | | | | |_| | (_| | | |/ / __/\n // |___|_| |_|_|\\__|_|\\__,_|_|_/___\\___|\n //\n // region initialize\n\n\n /***** Configure Pre-invocation functionality *****/\n\n // Parent interface forwarding\n _.forIn(config.inherit, function(construct, property) {\n if (!_.isUndefined(parentScope[property])) { $scope[construct] = parentScope[property]; }\n });\n\n\n /***** Invoke the controller with appropriate locals *****/\n\n $injector.invoke(controller, context, { $scope: $scope, $element: $element, $attrs: $attrs });\n\n\n /***** Post invocation processing/decoration *****/\n\n // ATTRIBUTE: expose - Used for exposing this components scope on the parent component\n var exposeName = $attrs ? $attrs.expose : false;\n if (exposeName && parentScope) {\n\n // If an exports definition exists, read it to create the publicly exported interface\n if (config.exports) {\n var exports = {};\n\n _.forIn(config.exports, function(construct, property) {\n if (_.isFunction($scope[construct])) {\n exports[property] = $scope[construct];\n } else {\n Object.defineProperty(exports, property, {\n get: function() { return $scope[construct]; }\n });\n }\n });\n\n parentScope[exposeName] = exports;\n\n } else {\n // DEPRECATED: Support old expose functionality temporarily\n parentScope[exposeName] = $scope;\n }\n }\n\n // Script Dependency Loading\n if (_.isArray(config.dependencies) && !_.isEmpty(config.dependencies)) {\n var relativePathRegex = /^\\/[^\\/]/;\n var preparedDependencies = _.map(config.dependencies, function(dependency) {\n if (relativePathRegex.test(dependency) && wilson.config.app.useVersionedAssets) {\n return dependency.replace(wilson.config.app.assetPath, wilson.config.app.versionedAssetPath);\n }\n\n return dependency;\n });\n\n ResourceLoaderService.loadResourceScripts(preparedDependencies).then(\n function() { if (_.isFunction($scope.onDependenciesReady)) { $scope.onDependenciesReady.apply($scope, []); } },\n function() { if (_.isFunction($scope.onDependenciesError)) { $scope.onDependenciesError.apply($scope, []); } }\n );\n }\n\n // endregion\n\n return $scope;\n }", "function Component() {\n\n /**\n * The associated game object. A component only be part of one game object at the same time.\n * @property object\n * @type gs.Object_Base\n * @default null\n */\n this.object = null;\n\n /**\n * Indicates if the component is disposed. A disposed component cannot be used anymore.\n * @property disposed\n * @type boolean\n * @default false\n */\n this.disposed = false;\n\n /**\n * An optional unique id. The component can be accessed through this ID using the gs.Object_Base.findComponentById method.\n * @property id\n * @type string\n * @default null\n */\n this.id = null;\n\n /**\n * An optional name. The component can be found through its name using the gs.Object_Base.findComponentsByName method. Multiple\n * components can have the same name. So the name can also be used to categorize components.\n * @property name\n * @type string\n * @default \"\"\n */\n this.name = \"\";\n\n /**\n * Indicates if the component is setup.\n * @property isSetup\n * @type boolean\n * @default no\n */\n this.isSetup = false;\n }", "function _constructComponents() {\r\n\t//having a set root element allows us to make queries\r\n\t//and resultant styling safe and much faster.\r\n\t//var elOuterParent = _rootDiv;\r\n\t//document.getElementById(_rootID);\r\n\tvar builder = new WidgetBuilder();\r\n\t_debugger.log(\"building html scaffolding.\"); //#\r\n\t_el = builder.construct(CSS_PREFIX, _manips);\r\n\t\r\n\t//todo: do we need to \"wait\" for these? Is there any initialization problem\r\n\t//that prevents them from being constructed to no effect?\r\n\t\r\n\t_debugger.log(\"building slideMotion.\"); //#\r\n\t_slideMotion = new SlideMotion();\r\n\tthis.slideMotion = _slideMotion; //# debugging only\r\n\t\r\n\t_debugger.log(\"building slideLogic.\"); //#\r\n\t_slideLogic = new SlideLogic(_slideMotion);\r\n\t_animator = _slideLogic;\r\n\t\r\n\t_debugger.log(\"building Event Manager.\"); //#\r\n\t_evtMgr = new EvtMgr(_behavior, _animator);\r\n\t_debugger.log(\"building Scaler.\"); //#\r\n\t_deviceWrangler = new DeviceWrangler();\r\n\t_scaler = new Scaler(_outerParent, _evtMgr, _animator);\r\n}", "createItem(id, props) {\n // Create a Section or a generic ComponentController?\n const Constructor = (props.type === \"Component\" ? ComponentController : Section);\n const item = new Constructor({\n id,\n projectId: project.projectId,\n account: project.account,\n ...props,\n });\n\n // Set generic ComponentControllers.parent dynamically.\n // This makes loading/etc work.\n if (Constructor === ComponentController) {\n Object.defineProperties(item, {\n parent: {\n get: () => project.account.getProject(project.projectId)\n }\n });\n }\n\n return item;\n }", "function Component() {\n /**\n * A signal emitted when the component is destroyed.\n *\n * @readonly\n */\n this.destroyed = new porcelain.Signal();\n this._parent = null;\n this._children = null;\n this._geometryCache = null;\n this._element = this.createElement();\n this.addClass(Component.Class);\n }", "constructor() {\n console.log(\"my-component \");\n }", "createComponent(componentTid, entityUid, entityRepository) {\n const thisClass = ComponentRepository;\n const componentClass = thisClass.__componentClasses.get(componentTid);\n if (componentClass != null) {\n let component_sid_count = this.__component_sid_count_map.get(componentTid);\n if (!_misc_IsUtil__WEBPACK_IMPORTED_MODULE_1__[\"default\"].exist(component_sid_count)) {\n this.__component_sid_count_map.set(componentTid, 0);\n component_sid_count = _Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"].invalidComponentSID;\n }\n this.__component_sid_count_map.set(componentTid, ++component_sid_count);\n const component = new componentClass(entityUid, component_sid_count, entityRepository);\n if (!this.__components.has(componentTid)) {\n this.__components.set(componentTid, []);\n }\n const array = this.__components.get(componentTid);\n if (array != null) {\n array[component.componentSID] = component;\n return component;\n }\n }\n return null;\n }", "function construct() { }", "createNewComponent(componentType) {\n if (!this._componentTypeOnNodeIndexCounter.has(componentType.id)) {\n this._componentTypeOnNodeIndexCounter.set(componentType.id, 0);\n }\n let componentTypeOnNodeIndex = this._componentTypeOnNodeIndexCounter.get(componentType.id) + 1;\n this._componentTypeOnNodeIndexCounter.set(componentType.id, componentTypeOnNodeIndex);\n let s = 'Creating component fork. Component type: ' + componentType.name + '. Component type on node index: ' + componentTypeOnNodeIndex + '.';\n let opts = new ForkOptions();\n opts.stdio = [\n 'pipe',\n 'pipe',\n 'pipe',\n 'ipc'\n ];\n if (this._targetComponentTypeToDebugList.indexOf(componentType) >= 0) {\n this._debugInspectorPortCounter++;\n // Recommended to not use debug/inspect args. Manually start the module to debug it.\n opts.execArgv = [\n /*'--inspect'/*,\n /*'--inspect=' + this._debugInspectorPortCounter/*,\n '--debug',\n '--debug-brk'*/\n ];\n s += 'Debug inspector port: ' + this._debugInspectorPortCounter + '.';\n }\n else {\n opts.execArgv = [];\n }\n this.getApp().getLog().info(s);\n let args = [\n componentType.name,\n String(componentTypeOnNodeIndex)\n ];\n let child = child_process.fork('./bin/main', args, opts);\n let forkObject = new ForkProcessChild_1.ForkProcessChild(this.getApp(), child, componentType, componentTypeOnNodeIndex);\n forkObject.create();\n this._componentProcessesList.push(forkObject);\n return true;\n }", "function Component() {\n return this; // this is needed in Edge !!!\n } // Component is lazily setup because it needs", "static get component() {\n return Component;\n }", "establish (...args) {\n if (!this.__ComponentJS_MVC_comp)\n this.__ComponentJS_MVC_comp = {}\n if (!(typeof args[0] === \"string\" && typeof args[1] === \"string\"))\n args.unshift(\"\")\n let [ anchor, tree, classes, autoincrease = true, autodecrease = false ] = args\n if (!(typeof classes === \"object\" && classes instanceof Array))\n classes = [ classes ]\n let objs = classes.map((Clz) =>\n typeof Clz === \"function\" ? new Clz() : Clz)\n let comp = (anchor !== \"\" ? MVC.ComponentJS(this, anchor) : MVC.ComponentJS(this))\n comp.create(tree, ...objs)\n objs.forEach((obj) => {\n let comp = MVC.ComponentJS(obj)\n let id = comp.name()\n this.__ComponentJS_MVC_comp[id] = obj\n comp.state_auto_increase(autoincrease)\n comp.state_auto_decrease(autodecrease)\n MVC.hook(\"establish:post-create\", \"none\", { id, comp, obj })\n })\n return this\n }", "function createComponentController(name, controller, config) {\n return ['ComponentFactoryService', 'WilsonUtils', '$scope', '$element', '$attrs',\n function(ComponentFactoryService, WilsonUtils, $scope, $element, $attrs) {\n var parent = _instance.getActiveComponent(_instance.findComponentId($element));\n var componentId = WilsonUtils.generateUUID();\n\n // Decorate componentId onto $element reference\n $element.data('wilsonComponentId', componentId);\n\n // Instantiate the new component and register the returned component $scope with the wilson instance\n _componentMap[componentId] = ComponentFactoryService.create(componentId, name, controller, this, parent, $scope, $element, $attrs, config);\n\n // Listen for component destroy to de-register\n $scope.on.event('$destroy', function() { delete _componentMap[componentId]; });\n }\n ];\n }", "compose() {\n this.id += 1\n this.componentName = this.createComponentName()\n this.createComponentFile()\n }", "function BaseLightningElementConstructor() {\n // This should be as performant as possible, while any initialization should be done lazily\n if (isNull(vmBeingConstructed)) {\n throw new ReferenceError('Illegal constructor');\n }\n\n {\n assert.invariant(vmBeingConstructed.elm instanceof HTMLElement, `Component creation requires a DOM element to be associated to ${vmBeingConstructed}.`);\n }\n\n const vm = vmBeingConstructed;\n const {\n elm,\n mode,\n def: {\n ctor\n }\n } = vm;\n const component = this;\n vm.component = component;\n vm.tro = getTemplateReactiveObserver(vm);\n vm.oar = create(null); // interaction hooks\n // We are intentionally hiding this argument from the formal API of LWCElement because\n // we don't want folks to know about it just yet.\n\n if (arguments.length === 1) {\n const {\n callHook,\n setHook,\n getHook\n } = arguments[0];\n vm.callHook = callHook;\n vm.setHook = setHook;\n vm.getHook = getHook;\n } // attaching the shadowRoot\n\n\n const shadowRootOptions = {\n mode,\n delegatesFocus: !!ctor.delegatesFocus,\n '$$lwc-synthetic-mode$$': true\n };\n const cmpRoot = elm.attachShadow(shadowRootOptions); // linking elm, shadow root and component with the VM\n\n associateVM(component, vm);\n associateVM(cmpRoot, vm);\n associateVM(elm, vm); // VM is now initialized\n\n vm.cmpRoot = cmpRoot;\n\n {\n patchCustomElementWithRestrictions(elm);\n patchComponentWithRestrictions(component);\n patchShadowRootWithRestrictions(cmpRoot);\n }\n\n return this;\n } // HTML Element - The Good Parts", "function ComponentContainer()\r\n{\r\n\t//this function never will be called (because only the methods are attached to other classes)\r\n\t//unless you instantiate this class directly, something that would be weird\r\n}", "onComponentConstructed() {}", "onComponentConstructed() {}", "constructor () {\n super()\n\n // Attach a shadow DOM tree to this element and\n // append the template to the shadow root.\n this.attachShadow({ mode: 'open' })\n .appendChild(template.content.cloneNode(true))\n\n // Selecting the application wrapper.\n this._applicationIconWrapper = this.shadowRoot.querySelector('#application-icon-wrapper')\n\n // The application icon name.\n this._name = ''\n\n // Binding this.\n this._createNewAppInstance = this._createNewAppInstance.bind(this)\n }", "function component() {\n var element = document.createElement('div');\n // Lodash(目前通过一个 script 脚本引入)对于执行这一行是必需的\n element.innerHTML = 'Hello';\n element.classList.add('hello');\n $('.box').append('--addd');\n return element;\n}", "function component(domElement) {\n this.domElement=domElement;\n this.initialize=function() {\n console.log('init');\n };\n this.render=function(){\n console.log('render');\n }\n}", "function SomeComponent() {}", "init() {\n // override init to make sure createEl is not triggered\n }", "function Component(type) {\n this.type = type;\n this.menu = $('select#' + type);\n this.button = $('button#add-' + type);\n this.elementWidth = 125;\n }", "function createInstance() {\n var api = extendApi(nouislider__WEBPACK_IMPORTED_MODULE_1___default.a.create(htmlElement, options));\n setCreatedWatcher(api);\n setOptionsWatcher(api);\n\n if (ngModel !== null) {\n bindNgModelControls(api);\n }\n } // Wait for ngModel to be initialized", "build() {\n const componentsRenderer =\n this.namespace().ComponentRenderer.new({ rootComponent: this })\n\n this.renderWith(componentsRenderer)\n }", "function BaseLightningElementConstructor$1() {\n // This should be as performant as possible, while any initialization should be done lazily\n if (isNull$1(vmBeingConstructed$1)) {\n throw new ReferenceError('Illegal constructor');\n }\n\n {\n assert$1.invariant(vmBeingConstructed$1.elm instanceof HTMLElement, `Component creation requires a DOM element to be associated to ${vmBeingConstructed$1}.`);\n }\n\n const vm = vmBeingConstructed$1;\n const {\n elm,\n mode,\n def: {\n ctor\n }\n } = vm;\n const component = this;\n vm.component = component;\n vm.tro = getTemplateReactiveObserver$1(vm);\n vm.oar = create$3(null); // interaction hooks\n // We are intentionally hiding this argument from the formal API of LWCElement because\n // we don't want folks to know about it just yet.\n\n if (arguments.length === 1) {\n const {\n callHook,\n setHook,\n getHook\n } = arguments[0];\n vm.callHook = callHook;\n vm.setHook = setHook;\n vm.getHook = getHook;\n } // attaching the shadowRoot\n\n\n const shadowRootOptions = {\n mode,\n delegatesFocus: !!ctor.delegatesFocus,\n '$$lwc-synthetic-mode$$': true\n };\n const cmpRoot = elm.attachShadow(shadowRootOptions); // linking elm, shadow root and component with the VM\n\n associateVM$1(component, vm);\n associateVM$1(cmpRoot, vm);\n associateVM$1(elm, vm); // VM is now initialized\n\n vm.cmpRoot = cmpRoot;\n\n {\n patchComponentWithRestrictions$1(component);\n patchShadowRootWithRestrictions$1(cmpRoot, EmptyObject$1);\n }\n\n return this;\n } // HTML Element - The Good Parts", "insertComponent(name) {\n // console.log('insert component into text', name);\n }", "_construct() {\r\n\tLog.info('Dtag: Enter Diagnostic Component ')\r\n }", "createContainer(){\n new comp.section({className:\"new--news\"},\n new comp.btn(\"New Article\"),\n ).render(\".container--inner\")\n new comp.section({className: \"news--title\"},\n new comp.title(\"h1\",\"News Articles\")).render(\".container--inner\")\n new comp.section({className: \"display--news\"}).render(\".container--inner\")\n\n }", "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n }", "static create () {}", "function createInstance (args)\r\n{\r\n\t__init (args); // init package identifier\r\n\r\n\treturn new StudioOneMacroPanel;\r\n}", "function component(componentName, data) {\n\t\t// Make sure that the component exists and has a domElement\n\t\tlet component = liquid.create(componentName, data);\n\t\tif (typeof(component.const.domElement) === 'undefined') {\n\t\t\tcomponent.renderAndUpdate();\n\t\t}\n\t\t\n\t\t// Setup child components (to be used when replacing placeholders)\n\t\tcurrentRenderComponent.const.subComponents[component.const.id] = component;\n\t\t\n\t\t// Return placeholder\n\t\treturn `<div component_id = ${ component.const.id }></div>`;\n\t}", "constructor() {\n\t\t// ...\n\t}", "mountComponent(/* instance, ... */) { }", "constructor(props) {\n super(props);\n //@TODO\n }", "constructor(props, context) {\n if (typeof context !== 'object') {\n throw new Error(`HyperloopContext instance is required to instantiate components`)\n }\n\n Object.defineProperties(this, {\n context: { value: context },\n initializing: { value: false, writable: true },\n node: { value: null, writable: true },\n props: { value: Object.assign({}, props) },\n wire: { value: null, writable: true },\n })\n\n if (this.defaultState) {\n this.setState(this.defaultState(this.props), false)\n }\n\n if (!context.initializing && this.oninit) {\n this.initializing = true\n if (this.isBrowser) {\n console.group(`${this.constructor.name}.oninit`)\n }\n Promise.resolve(this.oninit()).then((newState) => {\n this.initializing = false\n this.setState(newState)\n if (this.isBrowser) {\n console.debug('newState:', newState)\n console.groupEnd()\n }\n })\n }\n }", "function WebCom_ComponentLoader() {\n\n var components = [];\n \n /*public void*/function initComponent(name, version, className, data, onRenderComplete) {\n if(name) {\n //Add component to queue for init\n components.push({\n 'name': name, \n 'className': className,\n 'version': version, \n 'data': data,\n 'onRenderComplete': onRenderComplete\n });\n //Load the component JS file\n WebCom.ResourceLoader.loadLib(name, version, true);\n }\n };\n \n /*public void*/function flushQueue() {\n for(var i=0;i<components.length;i++) {\n startComponent(components[i].className, components[i].data, components[i].onRenderComplete);\n }\n components = [];\n }\n \n /*private void*/function startComponent(className, data, onRenderComplete) {\n var componentClass = eval(className);\n \n if (componentClass && typeof(componentClass.initInstances) == 'function') {\n componentClass.initInstances(data , {listeners: {'renderComplete' : {handler: function() { if(typeof(onRenderComplete) == 'function') { onRenderComplete();}} }}});\n }\n }\n \n this.initComponent = initComponent;\n this.flushQueue = flushQueue;\n \n return this;\n }", "function component() {\n let element = document.createElement('div');\n\n let btn = document.createElement('button');\n\n element.innerHTML = _.join(['Hello', 'webpack125' +\n ',,'\n ], ' ');\n\n btn.innerHTML = 'Click me and check the console!';\n btn.onclick = printMe;\n\n\n element.appendChild(btn);\n createArgumentsTest({ xqr: 1 }, 2, 3);\n\n // let lion = new Lion({name:'lion'});\n return element;\n}", "function ComponentType() {}", "function Component(options) {\n if (!(this instanceof Component)) return new Component(options);\n var inPorts = options.inPorts;\n var outPorts = options.outPorts;\n if (!(inPorts instanceof InPorts)) inPorts = new InPorts(inPorts);\n if (!(outPorts instanceof OutPorts)) outPorts = new OutPorts(OutPorts);\n inPorts.component = outPorts.component = this;\n this.inPorts = inPorts;\n this.outPorts = outPorts;\n this.metedata = Object.create(options.metedata || null);\n debug('Created a component: %s', this);\n}", "create(el, props) {\n const {width, height} = props;\n this.svg = d3.select(el).append('svg')\n .attr('class', 'd3')\n .attr('width', width)\n .attr('height', height)\n this.created = true;\n }", "function Component(module, name, type){\n\t\n this.import = {\n module: module,\n name: name\n };\n \n this.action = function(){\n \talert(\"I'm defined to do \"+type+\" actions\");\n };\n}", "function addComponent(ComponentID, componentjson)\n{\n var x;\n var y;\n\n var tmp = session.pm.pop();\n //now little bit of layout management\n var ln= session.pm[session.pm.length-1].modules.length;\n if (ln==0)\n {\n x=prex;\n y=prey;\n \n }\n else if (ln==1)\n {\n x=prex;\n y=prey;\n }\n \n else if(ln%2 == 0)\n {\n x=prex+450;\n y=prey;\n } \n else \n {\n x=prex-400;\n y=prey+200;\n }\n log(\"JSON Component Id is: \"+ComponentID);\n tmp.layout.push(JSON.parse('{\"id\": \\\"'+ComponentID+'\\\",\"xy\":['+x+','+y+']}'));\n prex=x;\n prey=y;\n log(\"prex, prey=============\"+prex+\",\"+prey);\n tmp.modules.push(componentjson);\n session.pm.push(tmp);\n session.lastComp = componentjson.type; \n return null;\n\n}", "_renderNewRootComponent(/* instance, ... */) { }", "constructor() {\n this.updateHash();\n componentManager.register(this);\n }", "function addComponent(component) {\n console.log(\"******************* Component data **************\");\n\n\t//if we dont know about the id yet, setup a new component.\n\tif (components[component.id] == null) {\n\t\t//create the component display object\t\t\n\t\t// pass in null for the children for the moment\n\t\tcomponents[component.id] = new goat.Component( surface, component.id, component.componentProperties, null, theme);\n\n\t\t//put it somewhere sensible.\n\t\tinitialLayout.placeComponent(components[component.id]);\n\t} else {\n\t\tconsole.log(\"Updating component \"+component.id);\n\t\t//otherwise, we knew about the component, so update it.\n\t\tcomponents[component.id].update(component.id, component.componentProperties);\t\t\t\n\t}\t\n\t//console.log(\"Done adding component\");\n}", "create () {\n // create helper's own UI\n // bind events\n // etc\n }", "constructor () {\r\n super()\r\n\r\n // Attach a shadow DOM tree to this element and\r\n // append the template to the shadow root.\r\n this.attachShadow({ mode: 'open' })\r\n .appendChild(template.content.cloneNode(true))\r\n }", "function CTOR() {\n this.name = 'Instance';\n}", "function createWrappedComponent() {\n\t\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node( 'div',\n\t\n\t // Create a picker wrapper node\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create a picker frame\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create a picker box node\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create the components nodes.\n\t P.component.nodes( STATE.open ),\n\t\n\t // The picker box class\n\t CLASSES.box\n\t ),\n\t\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\t\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\t\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t }", "constructor(props){\n //Call the constrictor of Super class i.e The Component\n super(props);\n }", "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n // Clase se destruye\n this.ancho = 200;\n this.cambioSueldo = new EventEmitter(); // evento\n this.mostrarResultados = new EventEmitter();\n this.suma = 0;\n this.resta = 0;\n this.multiplicacion = 0;\n this.division = 0;\n console.log('instanciando');\n }", "function CB_ComponentControl(params) {\r\n\tthis.TYPE = \"COMPONENT_CONTROL\";\r\n\tthis.container = null;\r\n\tthis.setting(params);\r\n\r\n\tthis.setContainer = function(container) {\r\n\t\tif ((typeof container==='undefined')||(container===null)) return;\r\n\t\tthis.container = container;\r\n\t};\r\n}", "function createClaireComponent() {\n var el = createElement('div',\n '<div class=\"filter-list\">' +\n ' <input type=\"text\" class=\"search\"' +\n ' placeholder=\"File...\" tabindex=0 />' +\n ' <ul></ul>' +\n '</div>',\n {id: 'claire'});\n\n return el;\n }" ]
[ "0.74001366", "0.71638787", "0.6990484", "0.69105464", "0.68156224", "0.6727543", "0.6727543", "0.6727109", "0.6665906", "0.66610533", "0.66211635", "0.65455705", "0.65051603", "0.64789724", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "0.64429253", "0.6437593", "0.6418785", "0.6410559", "0.6390615", "0.63561594", "0.63455516", "0.6297735", "0.6266539", "0.62438804", "0.6201298", "0.6174942", "0.61626", "0.61140585", "0.610902", "0.60693437", "0.6069169", "0.6050214", "0.603335", "0.60201126", "0.60052973", "0.59934545", "0.598767", "0.5983511", "0.5977504", "0.59602445", "0.5936258", "0.5934928", "0.59318686", "0.5919009", "0.59124994", "0.58968467", "0.5881525", "0.5875503", "0.58505285", "0.58475107", "0.58470017", "0.5825858", "0.5824369", "0.58152133", "0.58064306", "0.58054376", "0.5799971", "0.5799971", "0.5798254", "0.57867455", "0.57810163", "0.5780401", "0.577547", "0.57687426", "0.57507265", "0.5745552", "0.574072", "0.5715605", "0.5681636", "0.56764615", "0.566424", "0.56574935", "0.5650454", "0.5638698", "0.5632063", "0.5628729", "0.56286174", "0.5621777", "0.56201553", "0.56180686", "0.56125724", "0.56098455", "0.56082165", "0.5604871", "0.55979496", "0.5595072", "0.55899733", "0.55899334", "0.5585731", "0.558001", "0.55774474", "0.55771583", "0.5572881", "0.5570154", "0.55700433", "0.5567624" ]
0.0
-1
mount products from db
componentDidMount() { fetch('/products') .then(response => response.json()) .then(data => { this.setState({ products: data }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function productItems() {\n\tconnection.connect(function(err) {\n\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err\n\t\telse console.table(res , \"\\n\");\n\t\tproductId();\n\t\t});\n\t});\n}", "function getProducts(res, mysql, context, complete){\n \tmysql.pool.query(\"SELECT p_id, p_name, p_qty, p_mfg, price FROM Product\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.product = results;\n complete();\n });\n }", "function showProducts(){\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log('=================================================');\n\t\tconsole.log('=================Items in Store==================');\n\t\tconsole.log('=================================================');\n\n\t\tfor(i=0; i<res.length; i++){\n\t\t\tconsole.log('Item ID:' + res[i].item_id + ' Product Name: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')')\n\t\t}\n\t\tconsole.log('=================================================');\n\t\tstartOrder();\n\t\t})\n}", "@wire(getAvailableProducts, {recordId: '$recordId', offset: '$offset', rowLimit: '$rowLimit'})\n getProducts({ data, error }) {\n if(data){\n let loadedProducts = JSON.parse(data);\n this.products = this.products.concat(loadedProducts);\n this.allProductsLoaded = loadedProducts.length > 0 ? false : true;\n this.isLoaded = true;\n } else if(error){\n this.productsExist = false;\n this.infoMessage = error.body.message;\n this.isLoaded = true;\n }\n }", "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function dbData() {\n //will remove data \n Product.remove({}, function(err) {\n if (err) {\n console.log(err);\n }\n //then add products\n data.forEach(function(product) {\n Product.create(product, function(err, product) {\n if (err) {\n console.log(err);\n }\n });\n });\n });\n}", "function loadProducts() {\n $.ajax({\n \turl: productUrl\n }).done(function(response){\n \t\t insertContent(response.products)\n \t }).fail(function(error) {\n console.log(error)\n })\n }", "function viewProducts() {\n\tconnection.query('SELECT * FROM Products', function(err, result) {\n\t\tcreateTable(result);\n\t})\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM bamazon.products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\")\n for (let i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" ---- Product: \" + res[i].product_name + \" ---- Price: $\" + res[i].price + \" ---- Quantity: \" + res[i].stock_quantity)\n }\n })\n start();\n}", "function loadProducts(){\n productService.products().then(function(data){\n all_products = data;\n setOptions();\n setupListeners();\n })\n}", "function products(){\n connection.query(\"SELECT * FROM products\", (err,result) =>{\n if (err) throw err;\n\n console.table(result);\n start();\n })\n}", "function loadProductToCart() {\n let vProduct = JSON.parse(localStorage.getItem('products'));\n let vOrderDetail = JSON.parse(localStorage.getItem('orderDetail'));\n if (vProduct) {\n vProduct.forEach((productId, index) => {\n $.ajax({\n url: `${G_BASE_URL}/products/${productId}`,\n method: 'get',\n dataType: 'json',\n success: (product) => {\n renderProductToCart(product, index, vOrderDetail[index]);\n },\n error: (e) => alert(e.responseText),\n });\n });\n }\n }", "function loadProducts() {\n productAPI\n .getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "function productItems() \n{\n connection.connect(function(err) \n {\n connection.query(\"SELECT * FROM products\", function(err, res) \n {\n\tif (err) throw err\n\telse console.table(res , \"\\n\");\n\tproductId();\n\t});\n});\n}", "function viewProducts() {\n database.query(\"SELECT * FROM products\", function (err, itemData) {\n if (err) throw err;\n for (var i = 0; i < itemData.length; i++) {\n console.log(`\n----------------------------------------------------\nID: ${itemData[i].id} | Product: ${itemData[i].product_name} | Price: $${itemData[i].price} | Stock: ${itemData[i].stock_quantity}\n----------------------------------------------------\n`)\n }\n })\n return start();\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err; \n\t\tconsole.table(res);\n\t\tchooseAction(); \n\t})\n}", "function products() {\n var query = connection.query(\"SELECT item_id, department_name, product_name, price, stock_qty, product_sales FROM products ORDER BY item_id\", function(err, results, fields) {\n if(err) throw err;\n console.log(\"\\r\\n\" + \" - - - - - - - - - - - - - - - - - - - - - - - - \" + \"\\r\\n\");\n console.log(\"\\r\\n\" + chalk.yellow(\"-------- \" + chalk.magenta(\"BAMAZON PRODUCTS\") + \" ----------\") + \"\\r\\n\");\n var productsList = [];\n console.table(results);\n for(obj in results) {\n productsList.push(results[obj].products);\n }\n return managerDashboard(productsList);\n })\n}", "function loadProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price FROM products\", function (err, res) {\n if (err) throw err\n\n //display items in a table\n console.table(res);\n\n //then prompt the customer to choice of item\n promptCustomerOrder(res)\n });\n}", "function renderProductData () {\n fetch(`http://localhost:3001/api/products/allBySeller/${dt._id}`).then(res => {\n return res.json()\n }).then(data => {\n setProducts(data)\n })\n }", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"---------------------------------------\" + \n\t\t\t\"\\nItem Id: \" + res[i].item_id + \"\\nProduct: \" + \n\t\t\tres[i].product_name + \"\\nPrice: \" + res[i].price + \n\t\t\t\"\\nQuantity in Stock: \" + res[i].stock_quantity);\n\t\t}\n\t\tstartOver();\n\t});\n}", "function loadProducts(size) {\n\n let products = [\n { id: 111, name: 'Laptop', price: 19800, description: 'New Mac pro' },\n { id: 222, name: 'Mobile', price: 1800, description: 'New pro' }\n ];\n\n return { type: LOAD_PRODUCTS_SUCCESS, products } // sync action\n\n}", "loadMoreProduct(context, data) {\n\t\t\tcontext.commit('STORE_LOAD_MORE_PRODUCT', data);\n\n\t\t}", "async getAllProducts(req) {\n try {\n return await this.productsDbConnector.getAllProducts();\n } catch (err) {\n throw err;\n }\n }", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n displayTable(res);\n promptManager();\n });\n}", "function loadProductData(data) {\n _product = data[0];\n}", "function initializeProductCreation() {\n var productsStoredLocally = JSON.parse(localStorage.getItem('products'));\n if (productsStoredLocally) {\n console.log('PRODUCTS FROM LOCAL STORAGE');\n for (var i = 0; i < productsStoredLocally.length; i++) {\n var product = new Product (productsStoredLocally[i].filename, productsStoredLocally[i].votes, productsStoredLocally[i].displayed);\n products.push(product);\n }\n } else {\n console.log('PRODCUTS CREATED BY US');\n for(var j = 0; j < imgUrls.length; j++) {\n product = new Product(imgUrls[j]);\n products.push(product);\n }\n }\n\n}", "function viewProducts() {\n connection.query('SELECT * FROM products', function(err, results){ \n if (err) throw err;\n displayForManager(results);\n promptManager(); \n })\n}", "getProducts(guild, callback) {\n db.query(`SELECT * FROM ah_products WHERE server_id = '${guild.id}'`, function(err, result, fields) {\n if (err) throw err\n\n callback(result)\n })\n }", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "function viewProducts(){\n\n\t// Query: Read information from the products list\n\tconnection.query(\"SELECT * FROM products\", function(viewAllErr, viewAllRes){\n\t\tif (viewAllErr) throw viewAllErr;\n\n\t\tfor (var i = 0; i < viewAllRes.length; i++){\n\t\t\tconsole.log(\"Id: \" + viewAllRes[i].item_id + \" | Name: \" + viewAllRes[i].product_name +\n\t\t\t\t\t\t\" | Price: \" + viewAllRes[i].price + \" | Quantity: \" + viewAllRes[i].stock_quantity);\n\t\t\tconsole.log(\"-------------------------------------------------------------------\");\n\t\t}\n\n\t\t// Prompts user to return to Main Menu or end application\n\t\trestartMenu();\n\t});\n}", "index(_req, res) {\n Product.find({})\n .then(products => res.json(products))\n .catch(error => res.status(Http.InsufficientStorage).json(error));\n }", "function viewProducts () {\n con.query(\"SELECT * from vw_ProductsForSale\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price','Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right','right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n }", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "function getProducts() {\n\n\t\t\t// Request products data and pass result to inline handler\n\t\t\t$.getJSON('data/products.json', function(data) {\n\n\t\t\t\t// Pass each item in products collection to addItem()\n\t\t\t\t$.each(data, function(i, item) {\n\t\t\t\t\taddItem(item.product, item.price, item.image);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "async loadProducts() {\n const url = window.location.href;\n const prod_id = getParameterByName('id',url);\n const productsResponse = await fetch('/products');\n const products = (await productsResponse.json()).data;\n products.forEach(product => {\n if(product.id === prod_id){\n this.products[product.id] = product\n }\n });\n }", "async function fetchProducts() {\n let json = await LoadProductSetup();\n //* Set local storage. Even if json is empty it just sets up the key to be used later.\n localStorage.setItem(\"products\", JSON.stringify(json));\n //* If the list is empty, I set the 'direct' to 1, meaning the Navigator component will direct to the NoTeams component\n if (!json.length) {\n setDirect(1);\n } else {\n setDirect(3);\n }\n }", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function getProduct() {\n let availableProducts = localStorage.getItem(\"resultingProducts\");\n //checks if there are contents in availableProducts\n if (availableProducts) {\n let parseProduct = JSON.parse(availableProducts);\n console.log(parseProduct);\n for (let resultingProducts of parseProduct) {\n console.log(resultingProducts);\n let name = resultingProducts.name;\n let image = resultingProducts.image;\n let timesShown = resultingProducts.timesShown;\n let votes = resultingProducts.votes;\n new Product(name, image, timesShown, votes);\n }\n\n }\n}", "function products() {\n console.log(\"\\n----------WELCOME TO BAMAZON!!!----------\");\n \n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item ID: \" + res[i].item_id +\n \"\\nProduct Name: \" + res[i].product_name +\n \"\\nDepartment Name: \" + res[i].department_name +\n \"\\nPrice: \" + res[i].price +\n \"\\nStock Quantity: \" + res[i].stock_quantity +\n \"\\n------------------------------------------\"\n );\n }\n start();\n });\n}", "function getProducts(req, res){\n //Allocating received variables from params\n let userId = req.params.userId;\n\n Bag.find({user: userId}).populate('products').exec((err, bag) => {\n if(err)\n return res.status(500).send({message: 'Error while loading bag.'});\n \n return res.status(200).send({bag: bag});\n });\n}", "function ShowProducts(){ \r\n\tconnection.query('SELECT * FROM product_name', function(err, res){ \r\n\t\tif (err) throw err; \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('** Bamazon Mercantile **');\r\n\t\tconsole.log('** Product list **'); \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************'); \r\n\r\n\t\tfor(i=0;i<res.length;i++){ \r\n\t\t\tconsole.log('Product ID:' + res[i].item_id + ' Product: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')') \r\n\t\t} \r\n\t\tconsole.log('---------------------------------------------------------'); \r\n\t\tPlaceOrder(); \r\n\t\t}) \r\n}", "function listProducts() {\n\n con.query(\"SELECT * FROM products\", (err, result, fields) => {\n if (err) throw err;\n result.forEach(element => {\n table.push(\n [element.item_id, element.product_name, \"$\" + element.price, element.stock_quantity]\n )\n });\n console.log(chalk.green(table.toString()))\n // empty table to be able to push updated stock to it\n table.splice(0, table.length);\n\n startUp();\n })\n}", "function getProducts(){\n\n productsRef.get().then((querySnapshot) => {\n var objects = [];\n querySnapshot.forEach((doc) => {\n const obj = doc.data();\n obj.id= doc.id;\n objects.push(obj);\n console.log(`${doc.id} => ${doc.data()}`);\n });\n renderProducts(objects);\n // loader.classList.remove(\"loader--show\")\n });\n\n }", "function listProducts(){\r\n\r\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\r\n\t\tif (err) throw err;\r\n\r\n\t\tconsole.table(res);\r\n\r\n\t});\r\n}", "async insertProducts() {\n const user = sessionManager.get(\"username\");\n return await networkManager\n .doRequest(this.route + \"/insertProducts\", {session: user});\n }", "viewAllProducts(){\n \n return this.connection.queryAsync('SELECT * FROM products')\n .then(data => {\n\n data.forEach((product) =>{\n console.log(\n `${product.item_id} -- ${product.product_name} ---- ${product.price}`\n );\n })\n \n })\n .then(this.connection.end())\n .catch((err) => console.log(err));\n\n }", "readProducts(req, res) {\n Product.find({}).exec((err, products) => {\n //Always do a couple of console.logs just in case of errors.\n if (err) console.log(\"Get Product Mongoose Error------------------\", err);\n //Always log the data you are returning from the database to check if you are receiving the right data.\n //console.log(\"products-------------\", products);\n\n res.status(200).json(products);\n });\n }", "static async list(req, res) {\n try {\n const carts = await Cart.find({ deleted: false });\n\n return res.item_with_products(carts);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function getProducts(cb){\n con.query(\"SELECT * FROM products\", function (err, result) {\n if (err) throw err;\n products = result;\n getItems(result)\n });\n}", "function viewProducts(){\n console.log(\"\\nView Every Avalailable Product in format:\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"'ItemID-->Product Description-->Department Name-->Price-->Product Quantity'\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item# \" + res[i].item_id + \"-->\" + res[i].product_name \n + \"-->\" + res[i].department_name + \"-->\" + res[i].price \n + \"-->\" + res[i].stock_quantity);\n }\n // console.table(\"\\nProducts Available:\",[\n // res\n // ])\n })\n setTimeout(function() { startManager(); }, 200);\n}", "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "function upDateProductToStorage(products){\n localStorage.setItem(\"products\",JSON.stringify(products));\n}", "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "function readProducts() {\n\n connection.query(\"SELECT id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n //This is a npm addin to make a better looking table\n console.table(res);\n //Once the table is shown, the function startTransaction is called\n startTransaction();\n\n });\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "function loadProducts() {\n let productSection = document.querySelector(\".products\");\n\n for (let i = 0; i < window.productList.length; i++) {\n createProduct(productSection, window.productList[i]);\n }\n}", "static saveProduct(products){\n localStorage.setItem(\"products\", JSON.stringify(products));\n }", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "function storeFront() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item # \" + res[i].item_id + \n \" \" + res[i].product_name +\n \" Qty: \" + res[i].stock_quantity + \n \" Price: $\" + res[i].price \n );\n }\n purchaseReqeust();\n });\n}", "function loadProducts() {\n\t\tnewRecipe();\n RecipesService.getProducts().then(\n function(response) {\n $scope.products = response.data;\n\n $timeout(function() {\n $scope.loading = false;\n }, 100);\n },\n function(error) {\n \tconsole.warn(error);\n }\n );\n }", "function viewProducts() {\n connection.query(\"select * from products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(res);\n quit();\n });\n}", "function addProduct(req, res){\n //Allocating received variables from params\n let params = req.params;\n let userId = params.userId;\n let productId = params.productId;\n //Making a flag statement if the product whether the product is listed or not\n let isOnList = false;\n\n Bag.findOne({user: userId}).populate('products').exec((err, bag) => {\n if(err)\n return res.status(500).send({message: 'Error while loading bag.'});\n \n //Checking if bag exists, if not, it will be created\n if(!bag){\n let newBag = new Bag();\n newBag.user = userId;\n bag = newBag;\n }else{\n //Checking if product is on list\n bag.products.forEach(currentProduct => {\n if(currentProduct == productId){\n isOnList = true;\n }\n });\n }\n\n //If products is listed, then it won't be taken into account and a message will be returned\n if(isOnList)\n return res.status(200).send({message: 'Product is already on list.'});\n \n //Adding product as the last item of the list, afterwards the lis will be saved\n bag.products.unshift(productId);\n \n bag.save((err, bagUpdated) => {\n if(err)\n return res.status(500).send({message: 'Error while saving product.'});\n\n if(!bagUpdated)\n return res.status(404).send({message: 'Product could not be saved.'});\n \n return res.status(200).send({bag: bagUpdated});\n });\n });\n}", "function products() {\n connection.query('SELECT * FROM products', function(err, res) {\n console.table(res);\n console.log(chalk.yellow(\"***Enter 'Q' and press enter twice to exit store***\"));\n customerOrder();\n });\n}", "function addProduct() {\n var currentHttpParameterMap = request.httpParameterMap;\n\n\n\n var Product = null;\n\n if (Product === null) {\n if (currentHttpParameterMap.pid.stringValue !== null) {\n var ProductID = currentHttpParameterMap.pid.stringValue;\n\n var GetProductResult = new Pipelet('GetProduct').execute({\n ProductID: ProductID\n });\n if (GetProductResult.result === PIPELET_ERROR) {\n return {\n error: true\n };\n }\n Product = GetProductResult.Product;\n }\n }\n\n\n var GetProductListsResult = new Pipelet('GetProductLists').execute({\n Customer: customer,\n Type: ProductList.TYPE_GIFT_REGISTRY\n });\n var ProductLists = GetProductListsResult.ProductLists;\n\n //var ProductList = null;\n\n if (typeof(ProductLists) !== 'undefined' && ProductLists !== null && !ProductLists.isEmpty()) {\n if (ProductLists.size() === 1) {\n ProductList = ProductLists.iterator().next();\n } else {\n selectOne();\n return;\n }\n } else {\n createOne();\n return;\n }\n\n\n //var UpdateProductOptionSelectionsResult = new Pipelet('UpdateProductOptionSelections').execute({\n // Product: Product\n //});\n\n\n //var ProductOptionModel = UpdateProductOptionSelectionsResult.ProductOptionModel;\n\n\n // var AddProductToProductListResult = new Pipelet('AddProductToProductList', {\n // DisallowRepeats: true\n // }).execute({\n // Product: Product,\n // ProductList: ProductList,\n // Quantity: currentHttpParameterMap.Quantity.getIntValue(),\n // ProductOptionModel: ProductOptionModel,\n // Priority: 2\n // });\n\n\n showRegistry({\n ProductList: ProductList\n });\n return;\n}", "function storeProducts() {\n let stringProduct = JSON.stringify(Product.possibleProducts);\n localStorage.setItem(\"resultingProducts\", stringProduct);\n}", "function readProducts() {\n console.log(\"Products Available...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n else { \n // loop through id, product name, price and display \n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id);\n console.log(\"NAME: \" + res[i].product_name);\n console.log(\"PRICE: \" + res[i].price);\n console.log(\" \");\n }\n select();\n }\n }); \n }", "function hydratePage(produits){ \n produits.forEach((product) => {\n displayProduct(product)\n })\n}", "function Product(name, filepath) {\n this.name = name;\n this.filepath = filepath;\n this.votes = 0;\n this.views = 0;\n Product.allProducts.push(this);\n}", "function createProducts() {\n new Product('bag', './img/bag.jpg');\n new Product('banana', './img/banana.jpg');\n new Product('bathroom', './img/bathroom.jpg');\n new Product('boots', './img/boots.jpg');\n new Product('breakfast', './img/breakfast.jpg');\n new Product('bubblegum', './img/bubblegum.jpg');\n new Product('chair', './img/chair.jpg');\n new Product('cthulhu', './img/cthulhu.jpg');\n new Product('dog-duck', './img/dog-duck.jpg');\n new Product('dragon', './img/dragon.jpg');\n new Product('pen', './img/pen.jpg');\n new Product('pet-sweep', './img/pet-sweep.jpg');\n new Product('scissors', './img/scissors.jpg');\n new Product('shark', './img/shark.jpg');\n new Product('sweep', './img/sweep.png');\n new Product('tauntaun', './img/tauntaun.jpg');\n new Product('unicorn', './img/unicorn.jpg');\n new Product('water-can', './img/water-can.jpg');\n new Product('wine-glass', './img/wine-glass.jpg');\n}", "insertProduct(product) {\n return this.pool\n .request()\n .input(\"id\", sql.VarChar(255), product.id)\n .input(\"subtitle\", sql.NVarChar(255), product.subtitle)\n .input(\"title\", sql.NVarChar(255), product.title)\n .input(\"image\", sql.VarChar(255), product.image)\n .input(\"inAssortment\", sql.Bit, product.inAssortment)\n .input(\"isAvailable\", sql.Bit, product.isAvailable)\n .input(\"link\", sql.NVarChar(255), product.link)\n .input(\"status\", sql.NVarChar(255), product.status)\n .input(\"retailSet\", sql.Bit, product.retailSet)\n .input(\"brand\", sql.NVarChar(255), product.brand)\n .input(\"category\", sql.NVarChar(255), product.category)\n .input(\"prices\", sql.NVarChar(sql.MAX), JSON.stringify(product.prices))\n .input(\n \"quantityOptions\",\n sql.NVarChar(sql.MAX),\n JSON.stringify(product.quantityOptions)\n )\n .input(\n \"primaryBadge\",\n sql.NVarChar(sql.MAX),\n JSON.stringify(product.primaryBadge)\n )\n .input(\n \"secondaryBadges\",\n sql.NVarChar(sql.MAX),\n JSON.stringify(product.secondaryBadges)\n )\n .input(\n \"promotions\",\n sql.NVarChar(sql.MAX),\n JSON.stringify(product.promotions)\n ).query(`\n USE ${this.DB_NAME}\n UPDATE products \n SET \n subtitle = @subtitle,\n title = @title,\n image = @image,\n inAssortment = @inAssortment,\n isAvailable = @isAvailable,\n link = @link,\n status = @status,\n retailSet = @retailSet,\n brand = @brand,\n category = @category,\n prices = @prices,\n quantityOptions = @quantityOptions,\n primaryBadge = @primaryBadge,\n secondaryBadges = @secondaryBadges,\n promotions = @promotions\n WHERE id=@id\n IF @@ROWCOUNT = 0\n INSERT INTO ${this.TABLE_NAME} \n (\"id\",\"subtitle\",\"title\",\"image\", \"inAssortment\", \"isAvailable\",\"link\",\"status\",\"retailSet\",\"brand\",\"category\",\"prices\",\"quantityOptions\",\"primaryBadge\",\"secondaryBadges\",\"promotions\")\n VALUES \n (@id, @subtitle,@title,@image, @inAssortment, @isAvailable, @link, @status, @retailSet, @brand,@category, @prices,@quantityOptions, @primaryBadge, @secondaryBadges, @promotions);\n `);\n }", "componentDidMount() {\n this.fetchAllProducts()\n }", "getProducts() {}", "function addProducts(product) {\n // const endPoint = 'http://localhost:3000/products';\n // fetch(endPoint)\n // .then(res => res.json())\n // .then(json =>\n // json.forEach(product => {\n // const markup =\n // `\n // <div class='card'>\n // <h2>${product.name}</h2>\n // <img src=\"${product.url}\" height=240 width=240>\n // <p>${product.likes} Likes</p>\n // <button class=\"view\" id=\"view\">View More</button>\n // `\n // document.querySelector('#product-collection').innerHTML += markup;\n const newCard = document.createElement('div')\n newCard.className = \"card\"\n newCard.innerHTML =\n `\n <h2>${product.name}</h2>\n <img src=\"${product.url}\" height=240 width=240>\n <!-- <p>{product.likes} Likes</p> -->\n <button class=\"view\" id=\"view\">View More</button>\n <button class=\"delete\" id=\"delete\">Delete</button>\n `\n newCard.querySelector('button').addEventListener('click', () => renderSingleProduct(product))\n document.querySelector('#product-collection').append(newCard)\n // })\n\n // )\n\n const d = newCard.querySelector('.delete')\n d.addEventListener('click', (event) => {\n event.target.className == 'delete'\n deleteProduct(product)\n event.target.parentElement.remove()\n })\n\n\n }", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n\n // create an array to hold our formatted res data and loop through the res data\n var products = [];\n res.forEach(element => {\n products.push(\"ID#: \" + element.item_id + \" | Product Name: \" + element.product_name + \" | Price: $\" + element.price + \" | Quantity: \" + element.stock_quantity);\n }); // end .forEach\n\n // display the items\n console.log('\\n');\n console.log('《 ALL AVAILABLE PRODUCTS 》');\n console.log(\" -------------------------\" + '\\n');\n products.forEach(element => {\n console.log(element);\n }); // end .forEach\n console.log('\\n');\n start();\n }); // end .query\n} // end viewProductsFunction", "async function loadProducts() {\n await axios\n .get('https://vast-atoll-02815.herokuapp.com/api/product')\n .then((data) => setProducts(data.data))\n setLoading(false)\n }", "function table_products (product){\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n var sql = \"SELECT * FROM products WHERE order_id = \" + product.order + \";\";\n var results = db.exec(sql);\n var dataset = results[0];\n db.close();\n return dataset;\n}", "async store(req, res) {\r\n const product = await Product.create(req.body);\r\n\r\n // return the data in JSON\r\n return res.json(product);\r\n }", "function loadProduct(id) {\n $( \"#view_product_content\" ).empty(); \n $.ajax({\n url: \"api/product/\" + id,\n dataType: \"json\",\n async: false,\n success: function(data, textStatus, jqXHR) {\n //Create The New Rows From Template\n addProduct(data);\n $( \"#product_template\" ).tmpl( data ).appendTo( \"#view_product_content\" );\n $('#view_product_content').trigger('create');\n },\n error: ajaxError\n });\n}", "store(product) {\n this.products.push(product);\n }", "async fetchProducts(context){\n const response=await axios.get(\"/api/product\");\n console.log(response.data);\n context.commit(\"setProducts\",response.data);\n \n }", "function insert_products(data){\n var number = data['name'];\n var num = \"\"; \n for (var i = 0; i < number.length ; i++) {\n if (i > 5){\n num += number[i];\n }\n }\n\n var products = get_products(data);\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n sqlstr = \"INSERT INTO products (name_product, quantity, price, order_id) VALUES (:name_product, :quantity, :price, :order_id);\";\n\n for (var j in products){\n db.run(sqlstr, {':name_product': products[j]['orderlines['+j+'][product_name]'],\n ':quantity': products[j]['orderlines['+j+'][quantity]'],\n ':price': products[j]['orderlines['+j+'][price]'],\n ':order_id': num});\n }\n \n var data = db.export();\n var buffer = new Buffer(data);\n fs.writeFileSync(\"orders_tpv.db\", buffer);\n db.close();\n}", "componentDidMount() {\n this.props.orderStore.loadProducts(this.props.userStore.pflUser, this.props.userStore.pflPass);\n this.resetStore();\n }", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"\");\n console.table(res);\n connection.end();\n });\n}", "single_product(context, payload) {\n axios.get(\"/_public/product/\" + payload).then((resp) => {\n // console.log(resp);\n if (resp.data.status == \"SUCCESS\") {\n context.commit('single_product', resp.data.product)\n }\n });\n }", "static getProducts(id){\n let products = JSON.parse(localStorage.getItem('products'));\n return products.find(product => product.id === id);\n }", "function loadProductsFromBuffer() {\n //prevents scroll spamming\n if ($scope.isGettingProducts) {\n return;\n } \n \n unloadBuffer();\n \n if (!$scope.finished) {\n //loads more products into buffer\n loadProducts($scope.productsBuffer);\n }\n }", "function getProducts() {\n\treturn db.query(\"SELECT * FROM products\")\n\t\t.then(function(rows) {\n\t\t\treturn rows[0];\n\t\t})\n\t .catch(function(err) {\n\t console.log(err);\n\t });\n}", "function getProducts() {\n\tajax('GET', 'products', null, createProductList);\n}", "function viewProducts() {\n connection.connect();\n connection.query(\"SELECT * FROM products\", function (err, rows, fields) {\n if (err) throw err;\n console.log(rows)\n });\n connection.end();\n}", "oneProduct(_, args) {return queryOneProduct(args.id)}", "async function getProducts(req, res) {\n try {\n const products = await ProductModel.findAllData();\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.write(JSON.stringify(products));\n res.end();\n } catch (error) {\n console.log(error);\n }\n}", "componentDidMount() {\n\n base.bindToState(`products/${this.state.selectedProduct}`, {\n context: this,\n state: \"item\",\n asArray: false\n });\n\n base.bindToState('products/', {\n context: this,\n state: \"products\",\n asArray: true\n });\n\n model\n .getItem(this.state.selectedProduct)\n .then(result => {\n this.setState({\n status: \"LOADED\",\n item: result\n });\n })\n .catch(() => {\n this.setState({\n status: \"ERROR\"\n });\n });\n\n model\n .getAllItems()\n .then(items => model.returnRecentlyBought(items, this.state.selectedProduct))\n .then(result => {\n this.setState({\n recently_bought: result\n });\n })\n .catch(() => {\n this.setState({\n status: \"ERROR\"\n });\n });\n\n }", "function readProducts(callback) {\n connection.query(\"SELECT * from product_view\", function (err, res) {\n if (err) throw err;\n callback(res);\n });\n}", "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n console.log(\"Welcome to Bamazon Prime\".blue.bgWhite);\n console.log(\"-----------------------------------------------------------------------------\".blue);\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item ID: \".yellow +res[i].item_id + \" |Product: \".yellow + res[i].product_name + \" |Dept: \".yellow + res[i].department_name + \" |Price: \".yellow + res[i].price + \" |Qty: \".yellow + res[i].stock_quantity);\n console.log(\"-----------------------------------------------------------------------------\".blue);\n }\n if (err) throw err;\n\n connection.end();\n });\n}", "function viewProduct() {\n var query =\n 'SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity > 0';\n connection.query(query, function(err, res) {\n console.table(res);\n reset();\n });\n}", "async function fetchProduct() {\n const response = await fetch(\"http://myapi/product\" + productId);\n const json = await response.json();\n setProduct(json);\n }", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function makeProducts() {\n new Product('bag', 'img/bag.jpg', 0, 0);\n new Product('banana', 'img/banana.jpg', 0, 0);\n new Product('bathroom', 'img/bathroom.jpg', 0, 0);\n new Product('boots', 'img/boots.jpg', 0, 0);\n new Product('breakfast', 'img/breakfast.jpg', 0, 0);\n new Product('bubblegum', 'img/bubblegum.jpg', 0, 0);\n new Product('chair', 'img/chair.jpg', 0, 0);\n new Product('cthulhu', 'img/cthulhu.jpg', 0, 0);\n new Product('dog-duck', 'img/dog-duck.jpg', 0, 0);\n new Product('dragon', 'img/dragon.jpg', 0, 0);\n new Product('pen', 'img/pen.jpg', 0, 0);\n new Product('pet-sweep', 'img/pet-sweep.jpg', 0, 0);\n new Product('scissors', 'img/scissors.jpg', 0, 0);\n new Product('shark', 'img/shark.jpg', 0, 0);\n new Product('sweep', 'img/sweep.png', 0, 0);\n new Product('tauntaun', 'img/tauntaun.jpg', 0, 0);\n new Product('unicorn', 'img/unicorn.jpg', 0, 0);\n new Product('usb', 'img/usb.gif', 0, 0);\n new Product('water-can', 'img/water-can.jpg', 0, 0);\n new Product('wine-glass', 'img/wine-glass.jpg', 0, 0); \n //make to a string\n console.log(Product.allProducts);\n let stringifiedOrders = JSON.stringify(Product.allProducts);\n console.log(stringifiedOrders);\n //put the string of the array in storage\n localStorage.setItem('previousOrders', stringifiedOrders);\n}", "componentDidMount() {\n this.loadProducts();\n }", "function readProduct() {\n $.ajax({\n url: \"https://usman-recipes.herokuapp.com/api/products\",\n method: \"GET\",\n error: function(response){\n $('#products').html('Error : Products not found!')\n },\n success: function(response) {\n console.log(response);\n \n var products = $('#products');\n products.empty();\n\n for(var i=0 ; i<response.length ; i++) { //appending all the products to the div #products\n var p = response[i];\n products.append(\n `<div class=\"product\" data-id=\"${p._id}\"> <h2> ${p.name} </h2> <button class = \"btn btn-danger btn-sm float-right\" id=\"deleteBtn\">Delete</button><button class = \"btn btn-info btn-sm float-right\" data-toggle=\"modal\" data-target=\"#editModal\">Edit</button> <b>Price</b> : $ ${p.price} <br> <b>Color</b> : ${p.color} <br> <b>Department</b> : ${p.department} <br> <b>Description</b> : ${p.description} <br></div>`\n );\n }\n }\n });\n}" ]
[ "0.6670745", "0.6422243", "0.64205784", "0.6407651", "0.6333878", "0.6325375", "0.63012415", "0.6281852", "0.62682015", "0.6244326", "0.62443244", "0.6220509", "0.6216465", "0.6177422", "0.61530566", "0.6148213", "0.6145554", "0.61373985", "0.6136584", "0.61347616", "0.6134341", "0.6131903", "0.61287236", "0.6123101", "0.6102901", "0.60944533", "0.60830295", "0.6079489", "0.60784584", "0.6068819", "0.6057549", "0.605021", "0.6034885", "0.6024702", "0.60079926", "0.5986532", "0.5983552", "0.5978488", "0.59741426", "0.59662104", "0.59644026", "0.5956545", "0.5953812", "0.59511876", "0.5946451", "0.5942517", "0.59421", "0.5938405", "0.5935617", "0.59251106", "0.59227335", "0.5915739", "0.59132487", "0.5909371", "0.5902417", "0.5899198", "0.58881557", "0.58872294", "0.58847", "0.5884038", "0.588326", "0.58787656", "0.58756214", "0.58751905", "0.587509", "0.58693767", "0.5867964", "0.58614856", "0.58602697", "0.58584046", "0.5854065", "0.58517957", "0.5847216", "0.5840691", "0.5838962", "0.58354115", "0.58316815", "0.58293027", "0.5827436", "0.58270764", "0.5825082", "0.58215004", "0.58187085", "0.5817943", "0.5814729", "0.58089006", "0.5806979", "0.58068866", "0.58060426", "0.58025044", "0.58012843", "0.5795194", "0.57861054", "0.57831526", "0.5776507", "0.57711744", "0.5767448", "0.5766436", "0.5762081", "0.57581884", "0.57555705" ]
0.0
-1
This is done to register the method called with moment() without creating circular dependencies.
function setHookCallback (callback) { hookCallback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(moment) {\n this.moment = moment;\n }", "moment(date) {\n return moment(date);\n }", "viewDateMoment () {\n const m = moment(this.props.viewDate)\n return function () {\n return m.clone()\n }\n }", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function DateHelper() {}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n moment.updateOffset(this);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"===typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\n return null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\t\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function oldMomentFormat(mom,formatStr){return oldMomentProto.format.call(mom,formatStr);// oldMomentProto defined in moment-ext.js\n}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(\n\t name,\n\t 'moment().' +\n\t name +\n\t '(period, number) is deprecated. Please use moment().' +\n\t name +\n\t '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n\t );\n\t tmp = val;\n\t val = period;\n\t period = tmp;\n\t }\n\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "resetCalendarMoment(date =\"\"){\n if(date && /^([0-9]{4}-[0-9]{2}-[0-9]{2})/.test(date)){\n //if there is date string\n //and it is in date pattern\n //then create that moment\n this._moment = moment(date);\n }else{\n this._moment = moment();\n }\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "calcCurrentMoment() {\n return moment();\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\t\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = create__createDuration(val, period);\n\t add_subtract__addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = createDuration(val, period);\n\t addSubtract(this, dur, direction);\n\t return this;\n\t };\n\t}", "function makeShortcut(name, key) {\n moment.fn[name] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "function Sb(a, b) {\n return function (c, d) {\n var e, f;\n //invert the arguments, but complain about it\n return null === d || isNaN(+d) || (y(b, \"moment().\" + b + \"(period, number) is deprecated. Please use moment().\" + b + \"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"), f = c, c = d, d = f), c = \"string\" == typeof c ? +c : c, e = Ob(c, d), Tb(this, e, a), this\n }\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\treturn function (val, period) {\n\t\tvar dur, tmp;\n\t\t//invert the arguments, but complain about it\n\t\tif (period !== null && !isNaN(+period)) {\n\t\t\tdeprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n\t\t\t'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n\t\t\ttmp = val; val = period; period = tmp;\n\t\t}\n\n\t\tval = typeof val === 'string' ? +val : val;\n\t\tdur = createDuration(val, period);\n\t\taddSubtract(this, dur, direction);\n\t\treturn this;\n\t};\n}", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n\t tmp = val; val = period; period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = moment.duration(val, period);\n\t addOrSubtractDurationFromMoment(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n\t return function (val, period) {\n\t var dur, tmp;\n\t //invert the arguments, but complain about it\n\t if (period !== null && !isNaN(+period)) {\n\t deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n\t tmp = val;val = period;period = tmp;\n\t }\n\n\t val = typeof val === 'string' ? +val : val;\n\t dur = moment.duration(val, period);\n\t addOrSubtractDurationFromMoment(this, dur, direction);\n\t return this;\n\t };\n\t }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }" ]
[ "0.6808176", "0.61082673", "0.59246933", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5748391", "0.5740086", "0.5740086", "0.5740086", "0.5735562", "0.5735562", "0.5735562", "0.5735562", "0.5735562", "0.5725336", "0.56975675", "0.56674", "0.56674", "0.56674", "0.56674", "0.56674", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.5642981", "0.56427294", "0.56267935", "0.56143224", "0.5587938", "0.5575233", "0.55609953", "0.55609953", "0.5476486", "0.5476486", "0.5476486", "0.5476486", "0.5458085", "0.5458085", "0.5453357", "0.5435501", "0.543035", "0.543035", "0.5422996", "0.54126036", "0.54126036", "0.54126036", "0.54126036", "0.54126036", "0.5411312", "0.5411312", "0.5411312", "0.5411312", "0.5411312", "0.54086506", "0.53990215", "0.5375705", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.5370718", "0.53700495", "0.53632814", "0.5356188", "0.53330636", "0.5331728", "0.53299034", "0.5328133", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745", "0.53208745" ]
0.0
-1
compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function countDifferences(a, b) {\n let diffs = 0;\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n ++diffs;\n }\n }\n return diffs;\n}", "function howmany_diff(ary1, ary2){\n for (var i = 0; i < ary1.length; i++){\n var a = ary1[i]\n var b = ary2[i]\n if (a != b){\n diff++\n }\n }\n }", "function howmany_diff(ary1, ary2) {\n for (var i = 0; i < ary1.length; i++) {\n var a = ary1[i]\n var b = ary2[i]\n if (a != b) {\n diff++\n }\n }\n }", "function arrayDiff(a1, a2) {\n\tvar totalDiff = 0;\n\ta2.forEach((elem, index) => {\n\t\ttotalDiff += Math.abs(elem - a1[index]);\n\t});\n\treturn totalDiff;\n}", "function compatibility(arr1, arr2) {\n var totalDiff = 0;\n for (let i in arr1) {\n totalDiff = totalDiff + difference(arr1[i], arr2[i])\n }\n return totalDiff\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length);\n var lengthDiff = Math.abs(array1.length - array2.length);\n var diffs = 0;\n var i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i])\n || (!dontConvert && Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array1[i]) !== Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }" ]
[ "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.82791424", "0.79984933", "0.79866725", "0.79537725", "0.7922521", "0.77097225", "0.75572866", "0.75463253", "0.75318825", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.7503132", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.749946", "0.7497887", "0.7497887", "0.7497887", "0.74965256", "0.74871886" ]
0.0
-1
format date using native date object
function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "formatTheDate(date, format) {\n const [ year, month, day ] = (date.toISOString()).substr(0, 10).split('-');\n return dateFns.format(new Date(\n year,\n (month - 1),\n day,\n ), format);\n }", "function formatDate(obj) {\n const date = new Date(obj.date).toLocaleString(\"default\", {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n obj.date = date;\n return obj;\n}", "function formatDate(date) {\n return format(new Date(date), 'yyyy-MM-dd')\n}", "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "function formatDate(date) {\n var d = new Date(date);\n d = d.toLocaleString();\n return d;\n }", "function formatDate(d) {\n return `${d.year}-${d.month}-${d.day}`\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "function formatDate(date, format) {\n return format\n .replace(/yyyy/i, util_toString(date.getFullYear()))\n .replace(/MM/i, lpad(date.getMonth() + 1))\n .replace(/M/i, util_toString(date.getMonth()))\n .replace(/dd/i, lpad(date.getDate()))\n .replace(/d/i, util_toString(date.getDate()));\n}", "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth() + 1; //Months are zero based\n var year = date.getFullYear();\n var formattedDate = year + \"-\" + month + \"-\" + day;\n return formattedDate;\n }", "function formatDate(date) {\n\tif (date == null) {\n\t\treturn null;\n\t}\n\tvar d = date.getDate();\n\tvar m = date.getMonth() + 1;\n\tvar y = date.getFullYear();\n\treturn '' + (d <= 9 ? '0' + d : d) + '-' + (m <= 9 ? '0' + m : m) + '-' + y;\n}", "function formatDate(date) {\n let source = new Date(date);\n let day = source.getDate();\n let month = source.getMonth() + 1;\n let year = source.getFullYear();\n\n return `${day}/${month}/${year}`;\n }", "function formatDate(date) {\n\treturn new Date(date.split(' ').join('T'))\n}", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n }", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function formatDate(date) {\n \n var dd = date.getDate();\n if (dd < 10) {\n dd = '0' + dd;\n }\n \n var mm = date.getMonth() + 1;\n if (mm < 10) {\n mm = '0' + mm;\n }\n \n var yy = date.getFullYear();\n if (yy < 10) {\n yy = '0' + yy;\n }\n \n return mm + '/' + dd + '/' + yy;\n }", "function formatDate(date) {\r\n\r\n let dd = date.getDate();\r\n if (dd < 10) dd = '0' + dd;\r\n\r\n let mm = date.getMonth() + 1;\r\n if (mm < 10) mm = '0' + mm;\r\n\r\n let yy = date.getFullYear() % 100;\r\n if (yy < 10) yy = '0' + yy;\r\n\r\n return dd + '.' + mm + '.' + yy;\r\n}", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n}", "function formatDate(date){\n\t\tvar formatted = {\n\t\t\tdate:date,\n\t\t\tyear:date.getFullYear().toString().slice(2),\n\t\t\tmonth:s.months[date.getMonth()],\n\t\t\tmonthAbv:s.monthsAbv[date.getMonth()],\n\t\t\tmonthNum:date.getMonth() + 1,\n\t\t\tday:date.getDate(),\n\t\t\tslashDate:undefined,\n\t\t\ttime:formatTime(date)\n\t\t}\n\t\tformatted.slashDate = formatted.monthNum + '/' + formatted.day + '/' + formatted.year;\n\t\treturn formatted;\n\t}", "function formatDate(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear().toString().slice(-2);\n return day + month + year;\n}", "function formatDate(date,formatStr){return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString,date);}", "function formatDate(date)\n{\n g_date=date.getDate();\n if(g_date <=9)\n {\n g_date=\"0\"+g_date;\n }\n g_month=date.getMonth();\n g_year=date.getFullYear();\n if (g_year < 2000) g_year += 1900;\n return todaysMonthName(date)+\" \"+g_date+\", \"+g_year;\n}", "_stringify(date){\n date = date.toLocaleDateString();\n return date;\n }", "function getFormattedDate(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n return yy + '-' + mm + '-' + dd;\n }\n }", "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(date) {\n var day = date.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var month = date.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var year = date.getFullYear();\n\n return day + \".\" + month + \".\" + year;\n}", "function convertToFormat (dateObj, dateFormat) {\r\n var month = dateObj.getMonth() + 1;\r\n var date = dateObj.getDate();\r\n var year = dateObj.getFullYear();\r\n var dateString;\r\n switch (dateFormat) {\r\n case 'yyyy.m.d':\r\n dateString = year + '.' + month + '.' + date;\r\n break;\r\n case 'yyyy-m-d':\r\n dateString = year + '-' + month + '-' + date;\r\n break;\r\n case 'yyyy/m/d':\r\n dateString = year + '/' + month + '/' + date;\r\n break;\r\n case 'yyyy/mm/dd':\r\n dateString = year + '/' + _makeTwoDigits(month) + '/' + _makeTwoDigits(date);\r\n break;\r\n case 'dd/mm/yyyy':\r\n dateString = _makeTwoDigits(date) + '/' + _makeTwoDigits(month) + '/' + year;\r\n break;\r\n case 'dd-mm-yyyy':\r\n dateString = _makeTwoDigits(date) + '-' + _makeTwoDigits(month) + '-' + year;\r\n break;\r\n case 'd-m-yyyy':\r\n dateString = date + '-' + month + '-' + year;\r\n break;\r\n case 'd/m/yyyy':\r\n dateString = date + '/' + month + '/' + year;\r\n break;\r\n case 'd/mm/yyyy':\r\n dateString = date + '/' + _makeTwoDigits(month) + '/' + year;\r\n break;\r\n case 'dd.mm.yyyy':\r\n dateString = _makeTwoDigits(date) + '.' + _makeTwoDigits(month) + '.' + year;\r\n break;\r\n case 'm/d/yyyy':\r\n dateString = month + '/' + date + '/' + year;\r\n break;\r\n default:\r\n dateString = _makeTwoDigits(date) + '.' + _makeTwoDigits(month) + '.' + year;\r\n }\r\n return dateString;\r\n }", "function formatDate(){\n if (!Date.prototype.toISODate) {\n Date.prototype.toISODate = function() {\n return this.getFullYear() + '-' +\n ('0'+ (this.getMonth()+1)).slice(-2) + '-' +\n ('0'+ this.getDate()).slice(-2);\n }\n }\n }", "function formatDate(date) {\n const d = new Date(date);\n return d.getFullYear() + \"-\" + twoDigits(d.getMonth() + 1) + \"-\" + twoDigits(d.getDate());\n}", "function formattedDate(d) {\n let month = String(d.getMonth() + 1);\n let day = String(d.getDate());\n const year = String(d.getFullYear());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return `${year}-${month}-${day}`;\n }", "function formatDate(d) {\n if (d === undefined){\n d = (new Date()).toISOString()\n }\n let currDate = new Date(d);\n let year = currDate.getFullYear();\n let month = currDate.getMonth() + 1;\n let dt = currDate.getDate();\n let time = currDate.toLocaleTimeString('en-SG')\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n return dt + \"/\" + month + \"/\" + year + \" \" + time ;\n }", "function formattedDate(date) {\r\n\t\t\t\t\tvar d = new Date(date),\r\n\t\t\t\t\t\tmonth = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\tday = '' + d.getDate(),\r\n\t\t\t\t\t\tyear = d.getFullYear();\r\n\r\n\t\t\t\t\tif (month.length < 2) month = '0' + month;\r\n\t\t\t\t\tif (day.length < 2) day = '0' + day;\r\n\t\t\t\t\treturn [year, month, day].join('-');\r\n\t\t\t\t}", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function formatDate(date) {\r\n var d = date ? new Date(date) : new Date()\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n if (month.length < 2)\r\n month = '0' + month;\r\n if (day.length < 2)\r\n day = '0' + day;\r\n\r\n return `${day}${month}${year}`;\r\n}", "function _formatDate(date) {\n\t//remove timezone GMT otherwise move time\n\tvar offset = date.getTimezoneOffset() * 60000;\n\tvar dateFormatted = new Date(date - offset);\n dateFormatted = dateFormatted.toISOString();\n if (dateFormatted.indexOf(\"T\") > 0)\n dateFormatted = dateFormatted.split('T')[0];\n return dateFormatted;\n}", "function formatDate(date) {\n const month = date.getMonth() + 1;\n const day = date.getDate();\n const year = date.getFullYear();\n \n return `${month}/${day}/${year}`;\n }", "function formatDate(date) {\r\n return date.getFullYear().toString() + (date.getMonth() + 1).toString().padStart(2, '0') + date.getDate().toString() \r\n + date.getHours().toString().padStart(2, '0') + date.getMinutes().toString().padStart(2, '0');\r\n }", "function formatDate(date) {\n var dd = date.getDate()\n if (dd < 10) dd = '0' + dd;\n var mm = date.getMonth() + 1\n if (mm < 10) mm = '0' + mm;\n var yy = date.getFullYear();\n if (yy < 10) yy = '0' + yy;\n return dd + '.' + mm + '.' + yy;\n}", "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(date) {\n // date is a date object\n const options = { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' };\n return date.toLocaleDateString('en-US', options);\n}", "function formatDate(date) {\n // date is a date object\n const options = { year: 'numeric', month: 'short', day: 'numeric', timeZone: 'UTC' };\n return date.toLocaleString('en-US', options);\n}", "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n \n return [year, month, day].join('-');\n }", "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "function formatDate(date,format) {\n if (!format){\n format = \"yyyy-MM-dd\";\n }\n if (date === null){\n return null;\n }\n if (!(date instanceof Date)){\n date = new Date(date);\n }\n let day = date.getDate();\n let month = date.getMonth();\n let year = date.getFullYear();\n let hour = date.getHours();\n let min = date.getMinutes();\n let sec = date.getSeconds();\n\n let str = format.replace(\"yyyy\",year)\n .replace(\"MM\",fillString(month+1,2,-1,\"0\"))\n .replace(\"dd\",fillString(day,2,-1,\"0\"))\n .replace(\"HH\",fillString(hour,2,-1,\"0\"))\n .replace(\"mm\",fillString(min,2,-1,\"0\"))\n .replace(\"ss\",fillString(sec,2,-1,\"0\"))\n ;\n return str;\n }", "function prettyFormatDate(date) {\n return Utilities.formatDate(new Date(date), \"GMT-7\", \"MM/dd/yy\").toString();\n}", "function formatDate(date) {\n var newDate = new Date(date);\n var dd = newDate.getDate();\n var mm = newDate.getMonth() + 1; // January is 0!\n\n var yyyy = newDate.getFullYear();\n\n if (dd < 10) {\n dd = \"0\".concat(dd);\n }\n\n if (mm < 10) {\n mm = \"0\".concat(mm);\n }\n\n var formatedDate = \"\".concat(dd, \"/\").concat(mm, \"/\").concat(yyyy);\n return formatedDate;\n}", "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth();\n var year = date.getFullYear();\n month++;\n if (month < 10)\n month = '0' + month;\n if (day < 10)\n day = '0' + day;\n return [year, month, day].join('-').toString();\n}", "formatDate(date) {\n return date.toISOString().replaceAll(\"-\", \"\").substring(0, 8);\n }", "function formatDate(date) {\n\t\tvar day = date.getDate();\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(day / 10) == 0) {\n\t\t\tday = \"0\" + day;\n\t\t}\n\t\t\n\t\tvar month = date.getMonth() + 1; // months start at 0\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(month / 10) == 0) {\n\t\t\tmonth = \"0\" + month;\n\t\t}\n\t\t\n\t\tvar year = date.getFullYear();\n\t\t\n\t\treturn day + \"/\" + month + \"/\" + year;\n\t}", "function formatDate(date) {\n\t\treturn (date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + formatTime([date.getHours(), date.getMinutes()]));\n\t}", "_convertDateObjToString(obj) {\n\n let date = \"\";\n\n if (obj && obj.day && obj.month && obj.year) {\n let month = String(obj.month);\n let day = String(obj.day);\n let year = String(obj.year);\n\n if (month.length < 2) {\n month = \"0\" + month;\n }\n\n if (day.length < 2) {\n day = \"0\" + day;\n }\n\n if (year.length < 4) {\n var l = 4 - year.length;\n for (var i = 0; i < l; i++) {\n year = \"0\" + year;\n }\n }\n date = year + \"-\" + month + \"-\" + day;\n }\n\n return date;\n }", "function formatDate(date)\n{\n date = new Date(date * 1000);\n return '' + date.getFullYear() + '/' + lpad(date.getMonth(), 2, '0') + '/' + lpad(date.getDate(), 2, '0') + ' ' + lpad(date.getHours(), 2, '0') + ':' + lpad(date.getMinutes(), 2, '0');\n}", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n}", "formatDate(x) {\n let date = new Date(x)\n let _month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1\n let _date = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()\n let _hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()\n let _minute = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()\n let _second = date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()\n let dateStr = `${date.getFullYear()}-${_month}-${_date} ${_hour}:${_minute}:${_second}`\n return dateStr\n }", "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "function formatDate (date) {\n if (date) {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n const day = date.getDate()\n return year + '-' + month.toString().padStart(2, '0') + '-' + day.toString().padStart(2, '0')\n } else {\n return ''\n }\n}", "formatDateTime(date, format) {\n date = new Date(date);\n var result = format || 'y-m-d h:i:s';\n result = result.replace('y', date.getFullYear());\n result = result.replace('m', this.pad(date.getMonth() + 1, 2));\n result = result.replace('d', this.pad(date.getDate(), 2));\n result = result.replace('h', this.pad(date.getHours(), 2));\n result = result.replace('i', this.pad(date.getMinutes(), 2));\n result = result.replace('s', this.pad(date.getSeconds(), 2));\n return result;\n }", "function formatDate(date) {\n var date = new Date(date * 1000);\n return `${date.getMonth() + 1}/${date.getDate()}/${date.getUTCFullYear()}`;\n}", "static formatDate(date) {\n let formattedDate = '';\n\n formattedDate += date.getUTCFullYear();\n formattedDate += '-' + ('0' + (date.getUTCMonth() + 1)).substr(-2);\n formattedDate += '-' + ('0' + date.getUTCDate()).substr(-2);\n\n return formattedDate;\n }", "formatted_date() {\n return this.created_at.toLocaleDateString()\n }", "function formatDate(date) {\n var year = date.getFullYear()\n var month = (1 + date.getMonth()).toString()\n var day = date.getUTCDate()\n return month + \"/\" + day + \"/\" + year\n}", "function formatDate(date){\n var yr = date.getFullYear();\n var mnth = date.getMonth()+1;\n if(mnth < 10){\n mnth = `0${mnth}`;\n }\n var day = date.getDate()\n if(day < 10){\n day = `0${day}`;\n }\n return yr+\"-\"+mnth+\"-\"+day;\n}", "function formatDate(date){\n var dd = date.getDate(),\n mm = date.getMonth()+1, //January is 0!\n yyyy = date.getFullYear();\n\n if(dd<10) dd='0'+dd;\n if(mm<10) mm='0'+mm;\n\n return yyyy+'-'+mm+'-'+dd;\n}", "function dateformat(date) {\n \n // Main array that will be used to sort out the date.\n let dateArray = date.split('-');\n // Sorts days\n let dayArray = dateArray[2].split('T');\n let day = dayArray[0];\n // Sets up month and year months\n let month = dateArray[1];\n let year = dateArray[0];\n // Using the global standard or writing DOB\n let formatedDOB = [day, month, year].join('-');\n // Retuns the data from the formatted DOB.\n return formatedDOB;\n }", "function formatDate ( date ) {\n return date.getDate() + nth(date.getDate()) + \" \" +\n months[date.getMonth()] + \" \" +\n date.getFullYear();\n}", "function formatDate(date) {\n if (date) {\n var formattedDate = new Date(date);\n return formattedDate.toLocaleDateString();\n } else {\n return null;\n }\n}", "function formatDate(date) {\n return date.getFullYear() + '-' +\n (date.getMonth() < 9 ? '0' : '') + (date.getMonth()+1) + '-' +\n (date.getDate() < 10 ? '0' : '') + date.getDate();\n}", "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "function formatDate(date) {\n\t\t\t\treturn date.getDate() + \"-\" + (date.getMonth()+1) + \"-\" + date.getFullYear();\n\t\t\t}", "function pgFormatDate(date) {\n /* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */\n return String(date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()); \n}", "function setFormatoDate(data) {\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "prettyBirthday() {//Can be put in method\n return dayjs(this.person.dob.date)\n .format('DD MMMM YYYY')//change in assignment to different format not default\n }", "function dateFormatter(date){\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n return year + '-' + ('0' + month).slice(-2) + '-' + day; // the '0' and the slicing is for left padding\n}", "static formatDate (date, format) {\n let year = date.getFullYear(),\n month = Timer.zero(date.getMonth()+1),\n day = Timer.zero(date.getDate()),\n hours = Timer.zero(date.getHours()),\n minute = Timer.zero(date.getMinutes()),\n second = Timer.zero(date.getSeconds()),\n week = date.getDay();\n return format.replace(/yyyy/g, year)\n .replace(/MM/g, month)\n .replace(/dd/g, day)\n .replace(/hh/g, hours)\n .replace(/mm/g, minute)\n .replace(/ss/g, second)\n .replace(/ww/g, Timer.weekName(week));\n }", "function formatDate(date){\n var yyyy = date.getFullYear();\n var mm = date.getMonth() + 1;\n var dd = date.getDate();\n //console.log(\"This is dd\" + dd);\n if(dd<10){\n dd='0'+ dd;\n }\n if(mm<10){\n mm='0'+mm;\n } \n return ( mm + '/' + dd + '/' + yyyy);\n \n }", "dateFormate(d) {\n const date = new Date(d)\n const j = date.getDate()\n const m = (date.getUTCMonth() + 1)\n const a = date.getUTCFullYear()\n return (\"0\" + j).slice(-2) + '/' + (\"0\" + m).slice(-2) + '/' + a\n }", "function format(d) {\n const month = d.getMonth() >= 9 ? d.getMonth() + 1 : `0${d.getMonth() + 1}`;\n const day = d.getDate() >= 10 ? d.getDate() : `0${d.getDate()}`;\n const year = d.getFullYear();\n return `${month}/${day}/${year}`;\n}", "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(dateToConvert) {\n\treturn format(new Date(dateToConvert));\n}", "function formatDate(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n return [year, month, day].join('-');\n}", "formatDate(value, format) {\n format = format || '';\n if (value) {\n return window.moment(value)\n .format(format);\n }\n return \"n/a\";\n }", "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "formatDate(d) {\n return moment(d).format('DD/MM/YYYY')\n }", "function formattedDate(d = new Date()) {\n return [d.getDate(), d.getMonth() + 1, d.getFullYear()]\n .map((n) => (n < 10 ? `0${n}` : `${n}`))\n .join(\"/\")\n .concat(` at ${getTime(d)}`);\n }", "_formatDate(date, tzOffset) {\n let str = window.iotlg.dateFormat;\n let actualDate = new Date();\n actualDate.setTime(date.getTime() + this._getMilliseconds(tzOffset, UNIT_HOUR));\n let hours = (actualDate.getUTCHours());\n let day = (actualDate.getUTCDate());\n\n str = str.replace(\"yyyy\", actualDate.getUTCFullYear());\n str = str.replace(\"mm\", this._fillUp(actualDate.getUTCMonth() + 1, 2));\n str = str.replace(\"dd\", this._fillUp(day, 2));\n str = str.replace(\"hh\", this._fillUp(hours, 2));\n str = str.replace(\"MM\", this._fillUp(actualDate.getUTCMinutes(), 2));\n str = str.replace(\"ss\", this._fillUp(actualDate.getUTCSeconds(), 2));\n str = str.replace(\" \", \"\\n\");\n return str;\n }", "function formatDate(rawDate) {\n return rawDate.replace(/(\\d{4})[-/](\\d{2})[-/](\\d{2})/, '$3.$2.$1');\n}", "getDateFormated(date) {\n const formatDate = new Intl.DateTimeFormat('en-GB', {\n day: 'numeric',\n month: 'short',\n year: 'numeric'\n }).format;\n return formatDate(date);\n }", "function formatDate(val) {\n var d = new Date(val),\n day = d.getDate(),\n month = d.getMonth() + 1,\n year = d.getFullYear();\n\n if (day < 10) {\n day = \"0\" + day;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return month + \"/\" + day + \"/\" + year;\n}", "function formattedDate(d = new Date) {\n\treturn [d.getDate(), d.getMonth()+1, d.getFullYear()]\n\t\t.map(n => n < 10 ? `0${n}` : `${n}`).join('/');\n }", "function reFormatDate(date) {\n const d= new Date(Date.parse(date));\n let mm = d.getMonth() + 1;\n const yyyy = d.getFullYear();\n let dd = d.getDate();\n\n if (dd < 10) {\n dd = `0${dd}`;\n }\n if (mm < 10) {\n mm = `0${mm}`;\n }\n return `${yyyy}-${mm}-${dd}`;\n }" ]
[ "0.75320816", "0.7421278", "0.7386446", "0.7386206", "0.73497903", "0.7336332", "0.73048234", "0.7300858", "0.7292591", "0.7292591", "0.7292591", "0.7221218", "0.7213261", "0.7210653", "0.7188191", "0.71826464", "0.71783525", "0.71683335", "0.71673006", "0.71582985", "0.7136396", "0.71351296", "0.7116119", "0.7094242", "0.706227", "0.70609725", "0.704927", "0.7048684", "0.703367", "0.70264095", "0.7026313", "0.7015168", "0.7003348", "0.6994713", "0.6985144", "0.6984923", "0.69840693", "0.6977675", "0.6977675", "0.6977597", "0.69757605", "0.6975543", "0.6970286", "0.6963518", "0.6961424", "0.69570905", "0.69568783", "0.69550544", "0.694989", "0.6949591", "0.6942341", "0.6942232", "0.6940583", "0.69388914", "0.6935119", "0.6934607", "0.6933395", "0.69221574", "0.69161093", "0.6916095", "0.69148", "0.6909679", "0.68973136", "0.6889287", "0.68878007", "0.6875211", "0.68711346", "0.6871014", "0.68709546", "0.68678564", "0.68650454", "0.6862945", "0.6851623", "0.68475795", "0.684524", "0.68389064", "0.6835438", "0.6835073", "0.6827606", "0.6824828", "0.6824828", "0.6824828", "0.6824674", "0.6817718", "0.6815951", "0.681486", "0.68108004", "0.68101245", "0.68099517", "0.6809602", "0.68090725", "0.68019825", "0.6801209", "0.67929906", "0.6790544", "0.6789918", "0.67863476", "0.6785376", "0.67850566", "0.67833906", "0.67782235" ]
0.0
-1
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}" ]
[ "0.7080735", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70763034", "0.70724636" ]
0.0
-1
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
function getSetGlobalLocale (key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if ((typeof console !== 'undefined') && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn('Locale ' + key + ' not found. Did you forget to load it?'); } } } return globalLocale._abbr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined$1(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn User if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }" ]
[ "0.7327511", "0.72994685", "0.72960633", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7250679", "0.7242776", "0.7242776", "0.7231589", "0.72192186", "0.7215549", "0.72115666", "0.72115666", "0.72115666", "0.72115666", "0.72076297", "0.7207319", "0.72072697", "0.72072697", "0.72072697", "0.72072697", "0.72072697" ]
0.0
-1
Pick the first defined of two or three arguments.
function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pick() {\n\tvar args = arguments,\n\t\ti,\n\t\targ,\n\t\tlength = args.length;\n\tfor (i = 0; i < length; i++) {\n\t\targ = args[i];\n\t\tif (typeof arg !== 'undefined' && arg !== null) {\n\t\t\treturn arg;\n\t\t}\n\t}\n}", "function pick() {\n\t\tvar args = arguments,\n\t\t\ti,\n\t\t\targ,\n\t\t\tlength = args.length;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\targ = args[i];\n\t\t\tif (arg !== UNDEFINED && arg !== null) {\n\t\t\t\treturn arg;\n\t\t\t}\n\t\t}\n\t}", "function firstArg() {\n\treturn arguments != \"\" ? [...arguments].shift() : undefined;\n}", "function pick() {\n var args = arguments,\n i,\n arg,\n length = args.length;\n for (i = 0; i < length; i++) {\n arg = args[i];\n if (arg !== UNDEFINED && arg !== null) {\n return arg;\n }\n }\n }", "function getFirstDefined() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n for (var _i3 = 0, _args = args; _i3 < _args.length; _i3++) {\n var arg = _args[_i3];\n\n if (arg !== undefined) {\n return arg;\n }\n }\n\n return undefined;\n } // variable used to generate id", "function $pick() {\r\n\t\tfor (var i=0,l=arguments.length; i<l; i++) {\r\n\t\t\tif ($chk(arguments[i])) return arguments[i];\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function v1() {\r\n for (var args = arguments, i = 0, l = args.length; i < l && args[i] == undefined; i++);\r\n return has(args, i) ? args[i] : args[l - 1];\r\n }", "function or() {\r\n\t\t\tvar remain = _.without(arguments, undefined); \r\n\t\t\tif (remain.length === 0)\r\n\t\t\t\treturn undefined;\r\n\t\t\treturn remain[0];\r\n\t\t}", "function getFirstDefined(...args) {\n\t for (const arg of args) {\n\t if (arg !== undefined) {\n\t return arg;\n\t }\n\t }\n\t return undefined;\n\t}", "function f(x) {\n let firstArg = arguments[0];\n\n return firstArg;\n}", "function firstDefined() {\n var i = -1;\n while (++i < arguments.length) {\n if (arguments[i] !== undefined) {\n return arguments[i];\n }\n }\n return undefined;\n }", "function get_arg_2() { return arguments[2]; }", "function mrcPick(arg, def) {\n return (typeof arg !== \"undefined\" ? arg : def);\n}", "function firstString() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (typeof arg === \"string\") {\n return arg;\n }\n }\n}", "function firstString() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0; i < args.length; i++) {\r\n var arg = args[i];\r\n if (typeof arg === \"string\") {\r\n return arg;\r\n }\r\n }\r\n}", "function f(a, b, c, d, e, f) {\n let sixthArg = arguments[5];\n let thirdArg = arguments[2];\n\n return sixthArg;\n}", "function myOtherFunction (first_argument = second_argument, second_argument) {}", "function RandomArg()\n{\n\tvar r = Math.floor(Math.random()*arguments.length);\n\treturn arguments[r];\n}", "function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName];}else if(arguments.length===3){return aDefaultValue;}else{throw new Error('\"'+aName+'\" is a required argument.');}}", "function doWhat(first, second, third) {\n if (arguments.length != 3) {\n throw new Error(\"Excepts 3 arguments, but invoke with \" +\n arguments.length + \" arguments\");\n }\n}", "function randomChoice()\n{\n assert (\n arguments.length > 0,\n 'must supply at least one possible choice'\n );\n\n var idx = randomInt(0, arguments.length - 1);\n\n return arguments[idx];\n}", "function isTwoPassed(){\n var args = Array.prototype.slice.call(arguments);\n return args.indexOf(2) != -1;\n}", "function getArg(args, type, number) {\n var count = 1, number = (number || 1);\n for (var i = 0; i < args.length; i++) {\n //Check for type, If function then ensure \"callee\" is excluded\n if (typeof args[i] == type && !(type == \"function\" && args[i].name == \"callee\")) {\n if (number == 1) return args[i];\n else number++;\n }\n }\n }", "function abc(a,b) {\n var c = 6;\n return arguments[0] + b + c;\n}", "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName]\n } else if (arguments.length === 3) {\n return aDefaultValue\n } else {\n throw new Error('\"' + aName + '\" is a required argument.')\n }\n }", "function getFirstElement ([a, b]) {\n let getArray = [a, b] \n return getArray[0]\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function one(a,...rest){\n console.log(a,rest)\n}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t\t if (aName in aArgs) {\n\t\t return aArgs[aName];\n\t\t } else if (arguments.length === 3) {\n\t\t return aDefaultValue;\n\t\t } else {\n\t\t throw new Error('\"' + aName + '\" is a required argument.');\n\t\t }\n\t\t}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function sayArguments(first, second) {\n first = first || 'first';\n second = second || 'second'; // || Значение по умолчанию\n let args = '';\n\n for (let i = 0; i < arguments.length; i++) {\n args += arguments[i] + ' ';\n }\n console.log( 'Arguments: ' + args );\n}", "function smallestValue(){\n return Math.min(...arguments);\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n }\n throw new Error('\"' + aName + '\" is a required argument.');\n\n}", "function test() {\n return arguments.slice(arguments.length - 1)[0]; //ERROR, there is not slice method\n}", "function getThirdArgument() {\n\n // Stores all possible arguments in array\n argumentArray = process.argv;\n\n // Loops through words in node argument\n for (var i = 3; i < argumentArray.length; i++) {\n argument += argumentArray[i];\n }\n return argument;\n}", "function oneOf(args) { }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}" ]
[ "0.7629042", "0.75575334", "0.74523604", "0.7447829", "0.6875494", "0.6672635", "0.6649544", "0.66400206", "0.65779024", "0.6487554", "0.64760274", "0.64054173", "0.62996894", "0.62969613", "0.62835485", "0.61632556", "0.61517835", "0.5961853", "0.59598327", "0.5933788", "0.5932596", "0.5919368", "0.588653", "0.58661693", "0.5844922", "0.5843471", "0.5843471", "0.5843471", "0.5843471", "0.5819852", "0.5816442", "0.5788889", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5776305", "0.5775556", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.57646376", "0.5755687", "0.57524157", "0.5742633", "0.5736218", "0.572891", "0.57214624", "0.5666182", "0.5661547", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525", "0.565525" ]
0.0
-1
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { getParsingFlags(config).weekdayMismatch = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function datearray(num)\n{\n var ret = []\n var day = Math.floor(num/1000000)\n ret.push(day)\n num = num-(day*1000000)\n var month = Math.floor(num/10000)\n ret.push(month)\n num = num-(month*10000)\n var year = Math.floor(num)\n ret.push(year)\n return ret\n}", "function SP_CreateDateObject(arrDate)\n{\n\tvar oDate;\n\t\n\tif(arrDate.length == 3)\n\t{\n\t\t// Check First Element is either day or year\n\t\t\n\t\tif(arrDate[0].length == 4) //means year , passing array date is of format yyyy-mmm-dd\n\t\t{\n\t\t\toDate = new Date(arrDate[0], --arrDate[1], arrDate[2]);\n\t\t}\n\t\telse //means day, passing array date is of format dd-mmm-yyyy \n\t\t{\n\t\t\toDate = new Date(arrDate[2], SP_GetMonthNumber(arrDate[1]), arrDate[0]);\t\t\n\t\t}\n\t}\n\telse\n\t{\n\t\toDate = new Date();\n\t}\n\t\n\treturn oDate;\n}", "function formArray (array, oneRMArray) {\n var data = []\n for (var i = 0; i < array.length; i++) {\n var d;\n var monthString = array[i].month.toString();\n var dayString = array[i].day.toString();\n var yearString = array[i].year.toString();\n var d = new Date(monthString + \"-\" + dayString + \"-\" + yearString);\n var dParsed = Date.parse(d);\n\n data[i] = {\n x: dParsed,\n y: oneRMArray[i]\n } \n }\n return data\n }", "function formatDATADate(dateArr) {\r\n\r\n var val = [];\r\n\r\n for (date in dateArr) {\r\n val.push(new Date(formatDate(date)).getTime());\r\n }\r\n\r\n return val;\r\n}", "makeArray(d) {\n var da = new Date(d);\n return [da.getUTCFullYear(), da.getUTCMonth() + 1, da.getUTCDate(), 0, 0, 0, 0];\n }", "function fillDate(array) {\n var last = array.length - 1;\n var firstDate = array[0].datestamp;\n var lastDate = array[last].datestamp;\n\n var fullarray = betweenDate(firstDate, lastDate);\n\n return fullarray;\n }", "fromArray(a) {\n var d = [].concat(a);\n d[1]--;\n return Date.UTC.apply(null, d);\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function BuildDates(date){\r\n var array = new Array();\r\n array['day'] = (date.getDate() < 10) ?\r\n '0' + date.getDate().toString() :\r\n date.getDate().toString();\r\n \r\n array['month'] = (date.getMonth() < 9) ?\r\n '0' + (date.getMonth()+1).toString() :\r\n (date.getMonth()+1).toString();\r\n \r\n array['year'] = date.getFullYear().toString();\r\n return array;\r\n}", "function date() {\n return new Date(year, ...arguments)\n }", "function dateFromArray(config) {\n var i, date, input = [], currentDate;\n\n if (config._d) {\n return;\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n currentDate = currentDateArray(config);\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "function createDateArray( date ) {\r\n return date.split( '-' ).map(function( value ) { return +value })\r\n }", "function makeFriendlyDates(arr) {\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var start = arr[0].split('-'), startStr = '';\n var end = arr[1].split('-'), endStr = '';\n var result = [];\n function toNum(str) {\n return +str;\n }\n // convert to readable day formant\n function dayFormat(day) {\n switch (day) {\n case 1:\n case 21:\n return day + 'st';\n case 2:\n case 22:\n return day + 'nd';\n case 3:\n case 23:\n return day + 'rd';\n default:\n return day + 'th';\n }\n }\n start = start.map(toNum);\n end = end.map(toNum);\n var startYear = start[0], startMonth = start[1], startDay = start[2];\n var endYear = end[0], endMonth = end[1], endDay = end[2];\n // ending date equals to starting date\n if (arr[0] === arr[1]) {\n result.push(months[startMonth - 1] + ' ' + dayFormat(startDay) + ', ' + startYear);\n return result;\n }\n startStr += months[startMonth - 1] + ' ' + dayFormat(startDay);\n if (endYear === startYear) {\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n if (endMonth === startMonth ) {\n endStr += dayFormat(endDay); // two dates within a month, just output ending day\n } else {\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n }\n } else if (endYear - startYear === 1) {\n if (endMonth === startMonth && endDay < startDay || endMonth < startMonth) { // within one year\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n } else if (endMonth >= startMonth) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n } else if (endYear - startYear > 1) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n\n result.push(startStr, endStr);\n return result;\n}", "function makeDateArray(weatherData, array){\n weatherData.data.forEach((item, index) => {\n Object.keys(item).forEach(key => {\n if(key === \"datetime\") {\n array.push(dateFormat(weatherData.data[index][key]));\n return array;\n }\n });\n });\n}", "formatDateForArray(date, month, year) {\n //console.log('month-->'+month+'date-->'+date);\n if (month <= 9 ) \n month = '0' + (month+1);\n if (date <= 9) \n date = '0' + (date);\n\n return [year, month, date].join('-');\n }", "parseDate(arrayOfStrings)\n {\n let newStr=arrayOfStrings[3];\n newStr += '-';\n switch(arrayOfStrings[1])\n {\n case 'Jan':\n newStr+='01';\n break;\n case 'Feb':\n newStr+='02';\n break;\n case 'Mar':\n newStr+='03';\n break;\n case 'Apr':\n newStr+='04';\n break;\n case 'May':\n newStr+='05';\n break;\n case 'Jun':\n newStr+='06';\n break;\n case 'Jul':\n newStr+='07';\n break;\n case 'Aug':\n newStr+='08';\n break;\n case 'Sep':\n newStr+='09';\n break;\n case 'Oct':\n newStr+='10';\n break;\n case 'Nov':\n newStr+='11';\n break;\n case 'Dec':\n newStr+='12';\n break;\n default:\n break;\n }\n newStr+='-';\n newStr+=arrayOfStrings[2];\n\n return newStr;\n }", "function sortByYear\n(\n array\n) \n{\n return array.sort(function(a,b)\n {\n var x = parseInt(a.number.split('-')[1]);\n var y = parseInt(b.number.split('-')[1]);\n return ((x < y) ? -1 : ((x > y) ? 0 : 1));\n }).reverse();\n}", "function frmt_date(a,field) {\n for(var i=0; i < a.length; i++){\n if( ! a[i][field] ) { continue }\n var d = new Date(a[i][field] * 1000)\n a[i][field] = d.toISOString().substr(0,16).replace('T',' ')\n }\n return(a)\n}", "function date2arr(date)\r\n{\r\n\t//\tdate = yyyy-mm-dd\r\n\tif(date != null && date.length > 0 && date.toLowerCase() != \"null\")\r\n\t{\r\n\t\tvar tmp = date.split(\"-\");\r\n\t\tvar arr = new Array();\r\n\t\tarr[0] = tmp[2];\r\n\t\tarr[1] = tmp[1];\r\n\t\tarr[2] = Number(tmp[0]);\r\n\t\treturn arr;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n}", "function normalizeDate(year, month, day) {\n return [year.padStart(4, '2000'), month.padStart(2, '0'), day.padStart(2, '0')];\n }", "function transformSortDate(arr) {\n const sortedArray = arr.sort((a, b) => {\n return b.timestamp + a.timestamp;\n });\n return sortedArray;\n}", "function dateStringToObject(date){\n var splitString = date.split(\"-\");// gonna set up our YYYY-MM-DD format\n var dateObject = {}; // object variable we will push results to\n // date should have a year(1), month(2), day(3) array input\n dateObject.year = splitString[0];\n dateObject.month = splitString[1];\n dateObject.day = splitString[2];\n return dateObject;\n} //(OPTION 1)", "function textifyDates(myArr){\n \n \n for(var r=0; r < myArr.length; r++){\n for(var c=0; c < myArr[r].length; c++){\n if (Object.prototype.toString.call(myArr[r][c]) === '[object Date]'){\n try { \n //myArr[r] = myArr[r].toString();\n myArr[r] = Utilities.formatDate(myArr[r], \"GMT+08:00\", \"dd-MMM-yyyy\")\n } \n catch(err) { myArr[r][c] = err};\n }\n }\n }\n return myArr;\n}", "function dateToUnix(dateArr){\n var d = new Date(dateArr[2],months.indexOf(getMonth(dateArr)),dateArr[1].substr(0,dateArr[1].length-1),0,0,0,0);\n return d.valueOf() / 1000 -18000;\n}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function gregorianDateArrToStr([year, month, day]): string {\n return moment.utc([year, month - 1, day]).format('YYYY-MM-DD');\n}", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function toDate(value){if(isDate(value)){return value;}if(typeof value==='number'&&!isNaN(value)){return new Date(value);}if(typeof value==='string'){value=value.trim();var parsedNb=parseFloat(value);// any string that only contains numbers, like \"1234\" but not like \"1234hello\"\nif(!isNaN(value-parsedNb)){return new Date(parsedNb);}if(/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)){/* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */var _a=Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function(val){return+val;}),3),y=_a[0],m=_a[1],d=_a[2];return new Date(y,m-1,d);}var match=void 0;if(match=value.match(ISO8601_DATE_REGEX)){return isoStringToDate(match);}}var date=new Date(value);if(!isDate(date)){throw new Error(\"Unable to convert \\\"\"+value+\"\\\" into a date\");}return date;}", "function convertDates(d) {\n\tfor (var i = d.length; i--;)\n\t\tconvertDateObj(d[i]);\n\treturn d;\n}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray(config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function makeDateObjects(data){\r\n\t\tconsole.log(\"makeDateObjects\");\r\n\t\tfor (i = 0; i < data.length; i++){\r\n\t\t\tvar datestring = data[i][selectedOptions.dateField];\r\n\t\t\tvar thisYear = parseInt(datestring.substring(0,4));\r\n\t\t\tvar thisMonth = parseInt(datestring.substring(5,7));\r\n\t\t\tvar thisDay = parseInt(datestring.substring(8,10));\r\n\t\t\tvar thisDateComplete = new Date(thisYear, thisMonth-1, thisDay); // JS-Date Month begins at 0\r\n\t\t\tzaehlstellen_data[i][selectedOptions.dateField] = thisDateComplete;\r\n\t\t}\r\n\t}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }" ]
[ "0.7055596", "0.7055596", "0.69680774", "0.6847937", "0.66370344", "0.6459812", "0.6129757", "0.61271906", "0.60674685", "0.60150933", "0.60150933", "0.60150933", "0.60150933", "0.60150933", "0.59615904", "0.59615904", "0.59615904", "0.58991313", "0.5884828", "0.58760655", "0.5867428", "0.5799508", "0.57671404", "0.56808835", "0.56489825", "0.56166285", "0.561196", "0.5597092", "0.55579066", "0.5516527", "0.5500011", "0.5435978", "0.5384881", "0.5292293", "0.5288992", "0.5286061", "0.5286061", "0.5286061", "0.5286061", "0.52858543", "0.5270993", "0.5258974", "0.52587503", "0.52578247", "0.52578247", "0.52578247", "0.5255364", "0.5253715", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769", "0.5247769" ]
0.0
-1
date from iso format
function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date.getMonth() + 1;\n mm = (mm < 10) ? '0' + mm : mm;\n var dd = date.getDate();\n dd = (dd < 10) ? '0' + dd : dd;\n var yyyy = date.getFullYear();\n var finaldate = mm + '/' + dd + '/' + yyyy;\n return finaldate;\n }", "function parseIsoDate(dateStr) {\n \tif(dateStr.length <10) return null;\n \tvar d = dateStr.substring(0,10).split('-');\t\n \tfor(var i in d) { \n \t\td[i]=parseInt(d[i]);\n \t};\n \td[1] = d[1] -1;//month;\n \tvar t = dateStr.substring(11,19).split(':');\n \treturn new Date(d[0],d[1],d[2],t[0],t[1],t[2]);\n }", "function ISOdate(d) {\r\n\ttry {\r\n\t\treturn d.toISOString().slice(0,10);\r\n\t}catch(e){\r\n\t\treturn 'Invalid ';\r\n\t}\r\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSetter=match[8]?date.setUTCFullYear:date.setFullYear;var timeSetter=match[8]?date.setUTCHours:date.setHours;// if there is a timezone defined like \"+01:00\" or \"+0100\"\nif(match[9]){tzHour=Number(match[9]+match[10]);tzMin=Number(match[9]+match[11]);}dateSetter.call(date,Number(match[1]),Number(match[2])-1,Number(match[3]));var h=Number(match[4]||0)-tzHour;var m=Number(match[5]||0)-tzMin;var s=Number(match[6]||0);var ms=Math.round(parseFloat('0.'+(match[7]||0))*1000);timeSetter.call(date,h,m,s,ms);return date;}", "function datetoisostring() { // @return String:\r\n return uudate(this).ISO();\r\n}", "function parseISODate(str) {\n pieces = /(\\d{4})-(\\d{2})-(\\d{2})/g.exec(str);\n if (pieces === null)\n return null;\n var year = parseInt(pieces[1], 10),\n month = parseInt(pieces[2], 10),\n day = parseInt(pieces[3], 10);\n return new Date(year, month - 1, day); // In ISO, months are 1-12; in JavaScript, months are 0-11.\n }", "function toISODate(date) {\n return date.toISOString().split('T')[0];\n }", "convertISOToCalendarFormat(ISOdate) {\n const isoArray = ISOdate.toString().split(' ');\n let day = isoArray[2];\n const monthStr = isoArray[1];\n const year = isoArray[3];\n\n const month = convertMonthStringtoNumber(monthStr);\n\n day = day.length === 2 ? day : '0' + day;\n\n return year + '-' + month + '-' + day;\n }", "function dateFromIsoString(isoDateString) {\r\n return fastDateParse.apply(null, isoDateString.split(/\\D/));\r\n }", "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "function parseIsoToTimestamp(_date) {\n if ( _date !== null ) {\n var s = $.trim(_date);\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/:00.000/, \"\");\n s = s.replace(/T/, \" \").replace(/Z/, \" UTC\");\n s = s.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\n return Number(new Date(s));\n }\n return null;\n }", "function convertDate( date ){\n\tvar day;\n\tvar month;\n\tvar year;\n\n\t//Extract year, month and day\n\tmonth = date.substr(0,2);\n\tday = date.substr(3,2);\n\tyear = date.substr(6);\n\n\t//compile the ynab compatible format\n\tdate = (year + \"-\" + month + \"-\" + day);\n\t\n\treturn date;\n}", "function amzDate(date, short) {\n const result = date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '').substr(0, 17)\n if (short) {\n return result.substr(0, 8)\n }\n return result\n}", "function parseISOString(s) {\n var b = s.split(/\\D+/);\n return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], 0, 0));\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function convertDate(date) {\n let day = date.substr(8, 2);\n let month = date.substr(5, 2);\n let year = date.substr(0, 4);\n date = day + \"/\" + month + \"/\" + year;\n return date;\n }", "function parseDate(isoString) {\n // Parse isoDateTimeString to JavaScript date object\n isoString = isoString.split('.', 1);\n return new Date(isoString[0] + '+00:00');\n }", "function isoDateFormat(strDateView) {\n return moment(strDateView, \"DD/MM/YYYY HH:mm\").format(\"YYYY-MM-DD HH:mm\")\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function formatDateIso(date) {\n\tif (!date || date == null) {\n\t\treturn \"\";\n\t}\n\t\n\tvar jsDate = new Date(date);\n\t\n\t// get the calendar-date components of the iso date. \n\tvar YYYY = jsDate.getFullYear();\n\tvar MM = (jsDate.getMonth() + 1) < 10 ? '0' + (jsDate.getMonth() + 1) : (jsDate.getMonth() + 1); // month should be in the form 'MM'.\n\tvar DD = jsDate.getDate() < 10 ? '0' + jsDate.getDate() : jsDate.getDate(); // day should be in the form 'DD'.\n\t\n\t// get the clock-time components of the iso date.\n\tvar hh = jsDate.getHours() < 10 ? '0' + jsDate.getHours() : jsDate.getHours(); // hours should be in the form 'hh'.\n\tvar mm = jsDate.getMinutes() < 10 ? '0' + jsDate.getMinutes() : jsDate.getMinutes(); // minutes should be in the form 'mm'.\n\tvar ss = jsDate.getSeconds() < 10 ? '0' + jsDate.getSeconds() : jsDate.getSeconds(); // seconds should be in the form 'ss'.\n\tvar sss = '000'; //just hardcoded 000 for milliseconds...\n\t\n\t// assemble the iso date from the date and time components.\n\tvar isoDate = YYYY + '-' + MM + '-' + DD + 'T' + // add the date components.\n\t\thh + ':' + mm + ':' + ss + '.' + sss + 'Z'; // add the time components.\n\t\t\n\t// return the iso-formatted version of the date.\n\treturn isoDate;\n}", "function getDate(dateISO){ \n let appointmentDate = new Date(dateISO);\n const date = appointmentDate.getDate() +'/' + appointmentDate.getMonth() + '/'+ appointmentDate.getFullYear();\n return date;\n }", "static isoDateTime(date) {\n var pad;\n console.log('Util.isoDatetime()', date);\n console.log('Util.isoDatetime()', date.getUTCMonth().date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes, date.getUTCSeconds);\n pad = function(n) {\n if (n < 10) {\n return '0' + n;\n } else {\n return n;\n }\n };\n return date.getFullYear()(+'-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z');\n }", "makeDateRFC3339(date) {\n var ret = this.dateStrings(date)\n return ret.year + \"-\" + ret.month + \"-\" + ret.day\n }", "function dateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function formatDateToISO(date) {\n return date.toISOString().split('T')[0];\n}", "function ISODateString(a){function b(a){return a<10?\"0\"+a:a}return a.getUTCFullYear()+\"-\"+b(a.getUTCMonth()+1)+\"-\"+b(a.getUTCDate())+\"T\"+b(a.getUTCHours())+\":\"+b(a.getUTCMinutes())+\":\"+b(a.getUTCSeconds())+\"Z\"}", "function isoToFormattedDate(timestamp) {\n\tvar date = new Date(timestamp);\n\treturn (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n}", "isIsoFormat(value) {\n let dateRegex = RegExp('[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$');\n return dateRegex.test(value);\n }", "function parseDateFormat(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "function isoDateString(date, extended) {\n date = (date === undefined ? new Date() : date);\n var dash = (extended === 1 ? \"-\" : \"\");\n var yr = date.getFullYear();\n var dd = (\"0\" + date.getDate()).slice(-2);\n var mm = (\"0\" + (date.getMonth()+1)).slice(-2);\n \n return yr.toString() + dash +\n mm.toString() + dash +\n dd.toString();\n}", "function ISO_2022() {}", "function ISO_2022() {}", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function get_date(d) {\n var date1 = new Date(d.substr(0, 4), d.substr(5, 2) - 1, d.substr(8, 2), d.substr(11, 2), d.substr(14, 2), d.substr(17, 2));\n return date1;\n }", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function convertBritishToISO(date) {\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"/\"+m+\"/\"+d);\r\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n \n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function toISODate(date) { // yyyy-mm-dd\n \"use strict\";\n var yyyy, mm, dd;\n // JavaScript provides no simple way to format a date-only\n yyyy = \"\" + date.getFullYear();\n mm = date.getMonth() + 1; // Months go from 0 .. 11\n dd = date.getDate();\n // Need leading zeroes to form the yyyy-mm-dd pattern.\n if (mm < 10) {\n mm = \"0\" + mm; // This converts it to a string\n }\n if (dd < 10) {\n dd = \"0\" + dd; // This converts it to a string\n }\n return \"\" + yyyy + \"-\" + mm + \"-\" + dd;\n}", "function formatDate(isoDateStr) {\n var date = new Date(isoDateStr);\n var monthNames = [\n \"Jan\", \"Feb\", \"Mar\",\n \"Apr\", \"May\", \"Jun\", \"Jul\",\n \"Aug\", \"September\", \"Oct\",\n \"Nov\", \"Dec\"\n ];\n\n var day = date.getDate();\n var monthIndex = date.getMonth();\n var year = date.getFullYear();\n var yearStr = \"\";\n if (year != (new Date()).getFullYear()) {\n yearStr = \", \" + String(year);\n }\n\n return \" \" + monthNames[monthIndex] + \" \" + day + \" \" + yearStr;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function iso8601date() {\n var date = new Date();\n\n function pad(number) {\n return (number < 10 ? '0' : '') + number;\n }\n function pad3(number) {\n return (number < 10 ? '0' : (number < 100 ? '00' : '')) + number;\n }\n\n return date.getUTCFullYear() + '-' +\n pad(date.getUTCMonth() + 1) + '-' +\n pad(date.getUTCDay()) + ' ' +\n pad(date.getUTCHours()) + ':' +\n pad(date.getUTCMinutes()) + ':' +\n pad(date.getUTCSeconds()) + '.' +\n pad3(date.getUTCMilliseconds());\n}", "function toIsoDate(dateString) {\n var splitted = dateString.split(\"/\");\n return new Date(splitted[2], splitted[1] - 1, splitted[0]);\n}", "extractDateFormat() {\n const isoString = '2018-12-31T12:00:00.000Z' // example date\n\n const intlString = this.props.intl.formatDate(isoString) // generate a formatted date\n const dateParts = isoString.split('T')[0].split('-') // prepare to replace with pattern parts\n\n return intlString\n .replace(dateParts[2], 'dd')\n .replace(dateParts[1], 'MM')\n .replace(dateParts[0], 'yyyy')\n }", "makeDateObjectFromCompact(datestring) {\n if (datestring !== undefined && datestring.length === 8) {\n let year = parseInt(datestring.substring(0, 4))\n let month = parseInt(datestring.substring(4, 6)) - 1\n let day = parseInt(datestring.substring(6, 8))\n return new Date(year, month, day)\n } else {\n return \"\"\n }\n }", "function ISODateString(d){\n function pad(n){return n<10 ? '0'+n : n}\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'}", "getFormattedDate ({ date }) {\n if (typeof date === 'string') {\n return format(parseISO(date), \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }\n return format(date, \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function FormatDate(date) {\n return new Date( parseInt( date.substr(6) ) );\n}", "function convertDate(dateIn)\n{\n let dateYear = dateIn.charAt(0);\n dateYear += dateIn.charAt(1);\n dateYear += dateIn.charAt(2);\n dateYear += dateIn.charAt(3);\n\n let dateMonth = dateIn.charAt(5) + dateIn.charAt(6);\n let dateDay = dateIn.charAt(8) + dateIn.charAt(9);\n\n let dateOut = dateDay + '-' + dateMonth + '-' + dateYear;\n return dateOut;\n}", "function convertDate(date) {\n let day = date.substring(8);\n let month = date.substring(5, 7);\n let year = date.substring(2,4);\n let newDate = `${month} /${day} /${year}`;\n return newDate;\n}", "function to_date(x){\n return new Date(x.substring(0,4), x.substring(5,7)-1, x.substring(8,10), x.substring(11,13), x.substring(14,16), x.substring(17,19));\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }" ]
[ "0.7161587", "0.7084152", "0.69561076", "0.68181574", "0.66757625", "0.66372114", "0.6559707", "0.6525335", "0.6466161", "0.6465599", "0.644205", "0.64171946", "0.6406543", "0.6406543", "0.6406543", "0.6406543", "0.63656497", "0.63241196", "0.6322188", "0.62742394", "0.62635076", "0.62635076", "0.62635076", "0.62635076", "0.6256379", "0.62237656", "0.6219025", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6201553", "0.6187698", "0.6187633", "0.618634", "0.618634", "0.61794", "0.61792564", "0.6172095", "0.613812", "0.61320627", "0.6129032", "0.609373", "0.6090011", "0.6071324", "0.60647243", "0.6062863", "0.60613644", "0.60613644", "0.606091", "0.606091", "0.606091", "0.606091", "0.606091", "0.6034974", "0.6000997", "0.5995632", "0.5995632", "0.5995632", "0.5995632", "0.5985886", "0.59761006", "0.5967464", "0.5967464", "0.59647685", "0.59567374", "0.59377056", "0.5936541", "0.5930827", "0.5930827", "0.5930827", "0.5930827", "0.5930827", "0.5930065", "0.5928079", "0.59234697", "0.5912456", "0.5900138", "0.5890115", "0.5882479", "0.58786935", "0.58786935", "0.58709115", "0.58588386", "0.5855063", "0.585465", "0.58419347", "0.58419347", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354", "0.5841354" ]
0.0
-1
date and time from ref 2822 format
function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)); if (match) { var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDrupalDateFromPieces(date, hour, minute, marker) {\n //Build time\n var time = hour + ':' + minute + ' ' + marker;\n //Build full date\n var dateTime = moment(date + ' ' + time, 'YYYY-MM-DD hh:mm A');\n //Return date in 24-hour format\n return moment(dateTime);\n }", "function createdOnParser(data) {\n let str = data.split('T');\n let date = str[0];\n let time = str[1].split('.')[0];\n return `${ date } at ${ time }`;\n }", "function render_datetime(data){\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "function longForm(){\n return Date.parse(date.split(\",\")[1].match(/[a-zA-Z0-9 \\:]+/)[0].trim().replace(\" at \", \" \"));\n }", "function dl(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function formatDate(date, format) {\n format = format + \"\";\n var result = \"\";\n var i_format = 0;\n var c = \"\";\n var token = \"\";\n var y = date.getYear() + \"\";\n var M = date.getMonth() + 1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\n // Convert real date parts into formatted versions\n var value = new Object();\n if (y.length < 4) {\n y = \"\" + (y - 0 + 1900);\n }\n value[\"y\"] = \"\" + y;\n value[\"yyyy\"] = y;\n value[\"yy\"] = y.substring(2, 4);\n value[\"M\"] = M;\n value[\"MM\"] = LZ(M);\n value[\"MMM\"] = MONTH_NAMES[M - 1];\n value[\"NNN\"] = MONTH_NAMES[M + 11];\n value[\"d\"] = d;\n value[\"dd\"] = LZ(d);\n value[\"E\"] = DAY_NAMES[E + 7];\n value[\"EE\"] = DAY_NAMES[E];\n value[\"H\"] = H;\n value[\"HH\"] = LZ(H);\n if (H == 0) {\n value[\"h\"] = 12;\n } else if (H > 12) {\n value[\"h\"] = H - 12;\n } else {\n value[\"h\"] = H;\n }\n value[\"hh\"] = LZ(value[\"h\"]);\n if (H > 11) {\n value[\"K\"] = H - 12;\n } else {\n value[\"K\"] = H;\n }\n value[\"k\"] = H + 1;\n value[\"KK\"] = LZ(value[\"K\"]);\n value[\"kk\"] = LZ(value[\"k\"]);\n if (H > 11) {\n value[\"a\"] = \"PM\";\n } else {\n value[\"a\"] = \"AM\";\n }\n value[\"m\"] = m;\n value[\"mm\"] = LZ(m);\n value[\"s\"] = s;\n value[\"ss\"] = LZ(s);\n while (i_format < format.length) {\n c = format.charAt(i_format);\n token = \"\";\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\n token += format.charAt(i_format++);\n }\n if (value[token] != null) {\n result = result + value[token];\n } else {\n result = result + token;\n }\n }\n return result;\n}", "function transformDateAndTime(datetime) {\n\t//console.log(\"Date Initial: \" + datetime);\n\tdatetime = datetime.replace(/[^0-9]/g, '');\n\t//console.log(\"Date First: \" + datetime);\n\tdatetime = datetime.substring(4,8) + datetime.substring(2, 4) + datetime.substring(0, 2) + \"T\" \n\t\t\t\t+ datetime.substring(8,14) + \"Z\";\n\treturn datetime;\n}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "makeDateRFC3339(date) {\n var ret = this.dateStrings(date)\n return ret.year + \"-\" + ret.month + \"-\" + ret.day\n }", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function gh_time(str, format) {\r\n if (!str) {\r\n return 'invalid date';\r\n }\r\n return str.replace(/T.+/, '');\r\n //var d = new Date(str.replace(/T/, ' ').replace(/Z/, ''));\r\n //return this.date(d, format);\r\n}", "function t(e,t,r){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var o=\" \";return(e%100>=20||e>=100&&e%100==0)&&(o=\" de \"),e+o+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,a){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function readTime(){\n checkLen(8);\n var low = buf.readUInt32LE(pos);\n var high = buf.readUInt32LE(pos + 4) & 0x3FFFFFFF;\n var tz = (buf[pos + 7] & 0xc0) >> 6;\n pos += 8;\n return formDateString(high, low, tz);\n }", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Object();\r\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "function gexfDateString(date) {\n\tvar ye = '' + date.getFullYear();\n\tvar mo = '' + (date.getMonth() + 1);\n\tvar da = '' + date.getDate();\n\tvar ho = '' + date.getHours();\n\tvar mi = '' + date.getMinutes();\n\tvar se = '' + date.getSeconds();\n\twhile (mo.length < 2) mo = '0' + mo;\n\twhile (da.length < 2) da = '0' + da;\n\twhile (ho.length < 2) ho = '0' + ho;\n\twhile (mi.length < 2) mi = '0' + mi;\n\twhile (se.length < 2) se = '0' + se;\n\treturn [ye,'-',mo,'-',da,'T',ho,':',mi,':',se].join('');\n}", "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Array();\r\n\tif (y.length < 4) {\t\r\n\t\ty=\"\"+(y-0+1900);\r\n\t}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "function process_date(date) {\n var ts = date.split('-'), dpart=[], hpart=[];\n\n function t2s(t) {\n if (!t) { return '00'; }\n return ( +t < 10 ? '0' : '' ) + t;\n }\n\n for (i=0; i<3; i++) { //u\n dpart.push(t2s(ts[i]));\n }\n for (i=3; i<6; i++) {\n hpart.push(t2s(ts[i]));\n }\n\n return dpart.join('/') + ' ' + hpart.join(':');\n }", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,a){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var n=\" \";return(t%100>=20||t>=100&&t%100==0)&&(n=\" de \"),t+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function convertDate(time) {\n\tif (time == undefined || time.length != 19) {\n\t\tconsole.log(\"Time is not valid!\" + \" (1064)\");\n\t\treturn new Date();\n\t}\n\tvar d = new Date(time.substring(6,10), time.substring(3,5), time.substring(0,2), time.substring(11,13), time.substring(14,16), time.substring(17,19));\n\tconsole.log(\"Converted time from \" + time + \" to \" + d + \" (1065)\");\n\treturn d;\n}", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "function a(e,a,t){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[t]}", "static _extractDateParts(date){return{day:date.getDate(),month:date.getMonth(),year:date.getFullYear()}}", "function t(a,r,_){var l={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},h=\" \";return(a%100>=20||a>=100&&a%100==0)&&(h=\" de \"),a+h+l[_]}", "function dateFormat(datum){\n \t\t\tvar day = datum.getDay();\n \t\t\tvar date = datum.getDate();\n \t\t\tvar month = datum.getMonth();\n \t\t\tvar year = datum.getYear();\n \t\t\tvar hour = datum.getHours();\n \t\t\tvar minutes = datum.getMinutes();\n\t\t}", "toFinnishTime(date) {\n //var date = new Date();\n date.setHours(date.getHours()+2);\n return date.toJSON().replace(/T/, ' ').replace(/\\..+/, '');\n }", "parseOracleDate(buf, useLocalTime = true) {\n let fseconds = 0;\n if (buf.length >= 11) {\n fseconds = Math.floor(buf.readUInt32BE(7) / (1000 * 1000));\n }\n const year = (buf[0] - 100) * 100 + buf[1] - 100;\n return settings._makeDate(useLocalTime, year, buf[2], buf[3], buf[4] - 1,\n buf[5] - 1, buf[6] - 1, fseconds, 0);\n }", "getReadableDate (timestamp) {\n try {\n const _date = new Date(timestamp * 1000).toISOString().slice(0, 10)\n const _time = new Date(timestamp * 1000).toISOString().slice(11, 19)\n\n return `${_date} ${_time}`\n } catch (error) {\n console.error(error)\n }\n }", "function convertDate(date, time) {\n\tvar y = eval(date.substring(0, 4));\n\tvar m = eval(date.substring(5, 7));\n\tvar d = eval(date.substring(8, 10));\n\t\n\t// Assume toDateString() returns a string like 'Thu Jul 08 2010'\n\tvar str = new Date(y, m - 1, d).toDateString().substring(0, 10);\n\t\n\tif (time.indexOf(':') >= 0) {\n\t\tstr += ', ' + twentyFourHourToTwelveHour(time.substring(0, 5));\t\n\t}\n\treturn str;\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";if(e%100>=20||e>=100&&e%100===0){o=\" de \"}return e+o+r[n]}", "function datehashrfc() { // @return RFC1123DateString: \"Wed, 16 Sep 2009 16:18:14 GMT\"\r\n var rv = (new Date(this.time)).toUTCString();\r\n\r\n if (uu.ie && rv.indexOf(\"UTC\") > 0) {\r\n // http://d.hatena.ne.jp/uupaa/20080515\r\n\r\n rv = rv.replace(/UTC/, \"GMT\");\r\n (rv.length < 29) && (rv = rv.replace(/, /, \", 0\")); // [IE] fix format\r\n }\r\n return rv;\r\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "function filenameToReadableDate(filename) {\n var split = filename.split('T');\n var date = split[0].split('_')[2].split('-');\n var time = split[1].substr(0, 4);\n return date[2] + '/' + date[1] + '/' + date[0] + ' at ' + time.substr(0, 2) + ':' + time.substr(2, 4);\n }", "function ms(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function formatDateAndTime(datetime)\n{\n\treturn datetime.substring(9, 11)+\":\"+datetime.substring(11,13)+\":\"+datetime.substring(13,15)\n\t\t\t+\" \"+datetime.substring(6,8)+\"-\"+datetime.substring(4,6)+\"-\"+datetime.substring(0,4);\n}", "function getTime(time) {\n time = time.toString().split(' ');\n var month = new Date(Date.parse(time[1] +\" 1, 2000\")).getMonth()+1\n var hms = time[4].split(':');\n var new_time = time[3] + '-' + (\"00\" + month).slice(-2) + '-' + time[2] + 'T' + hms[0] + ':' + hms[1] + ':' + hms[2] + '.000Z';\n return new_time;\n }", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function parse_external_time(text, success) {\n var time = TIME_RE.exec(text);\n if (time != null) {\n time = new Date(time[1].trim()).getTime();\n success(time);\n }\n}", "function cut_date(register_date){\n let register_date_string = register_date.toISOString();\n let split_date = register_date_string.split(\"T\")[1];\n let split_time = split_date.split(\".\")[0];\n return split_time;\n}", "function e(e,t,n){return e+(20<=e%100||100<=e&&e%100==0?\" de \":\" \")+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}" ]
[ "0.653082", "0.63895303", "0.6154629", "0.6096161", "0.60804975", "0.605977", "0.60540193", "0.605324", "0.605324", "0.605324", "0.605324", "0.6040541", "0.6028883", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.60169667", "0.59945226", "0.59771127", "0.597495", "0.597495", "0.596328", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5950483", "0.5933974", "0.59314626", "0.5928641", "0.59284973", "0.59065413", "0.5901136", "0.58995897", "0.58995897", "0.58995897", "0.58995897", "0.58909506", "0.58909506", "0.58909506", "0.58909506", "0.5867927", "0.5867427", "0.5847704", "0.5847463", "0.58446264", "0.5814297", "0.58098656", "0.5782785", "0.5782785", "0.5782707", "0.5776116", "0.57668716", "0.57485163", "0.5724437", "0.5722063", "0.5720733", "0.5718697", "0.5715817", "0.5714077", "0.56996375", "0.56862354", "0.56841004", "0.56840295", "0.56804836", "0.5677643", "0.56740606", "0.567262", "0.5671365", "0.56699353" ]
0.0
-1
date from iso format or fallback
function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } // Final attempt, use Input Fallback hooks.createFromInputFallback(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSetter=match[8]?date.setUTCFullYear:date.setFullYear;var timeSetter=match[8]?date.setUTCHours:date.setHours;// if there is a timezone defined like \"+01:00\" or \"+0100\"\nif(match[9]){tzHour=Number(match[9]+match[10]);tzMin=Number(match[9]+match[11]);}dateSetter.call(date,Number(match[1]),Number(match[2])-1,Number(match[3]));var h=Number(match[4]||0)-tzHour;var m=Number(match[5]||0)-tzMin;var s=Number(match[6]||0);var ms=Math.round(parseFloat('0.'+(match[7]||0))*1000);timeSetter.call(date,h,m,s,ms);return date;}", "function parseIsoDate(dateStr) {\n \tif(dateStr.length <10) return null;\n \tvar d = dateStr.substring(0,10).split('-');\t\n \tfor(var i in d) { \n \t\td[i]=parseInt(d[i]);\n \t};\n \td[1] = d[1] -1;//month;\n \tvar t = dateStr.substring(11,19).split(':');\n \treturn new Date(d[0],d[1],d[2],t[0],t[1],t[2]);\n }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "function ISOdate(d) {\r\n\ttry {\r\n\t\treturn d.toISOString().slice(0,10);\r\n\t}catch(e){\r\n\t\treturn 'Invalid ';\r\n\t}\r\n}", "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "isIsoFormat(value) {\n let dateRegex = RegExp('[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$');\n return dateRegex.test(value);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n\t\tparseISO(config);\n\t\tif (config._isValid === false) {\n\t\t\tdelete config._isValid;\n\t\t\tmoment.createFromInputFallback(config);\n\t\t}\n\t}", "function parseISODate(str) {\n pieces = /(\\d{4})-(\\d{2})-(\\d{2})/g.exec(str);\n if (pieces === null)\n return null;\n var year = parseInt(pieces[1], 10),\n month = parseInt(pieces[2], 10),\n day = parseInt(pieces[3], 10);\n return new Date(year, month - 1, day); // In ISO, months are 1-12; in JavaScript, months are 0-11.\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date.getMonth() + 1;\n mm = (mm < 10) ? '0' + mm : mm;\n var dd = date.getDate();\n dd = (dd < 10) ? '0' + dd : dd;\n var yyyy = date.getFullYear();\n var finaldate = mm + '/' + dd + '/' + yyyy;\n return finaldate;\n }", "function validateDateFormat(sDateToBeProcressed) {\r\n \"use strict\";\r\n var oDates = new Date(sDateToBeProcressed);\r\n if (isNaN(oDates)) {\r\n var arrSplitedDate = sDateToBeProcressed.replace(/[-]/g, \"/\");\r\n arrSplitedDate = arrSplitedDate.split(\"/\");\r\n var sFormattedDate = arrSplitedDate[1] + \"-\" + arrSplitedDate[0] + \"-\" + arrSplitedDate[2];\r\n oDates = new Date(sFormattedDate);\r\n }\r\n return oDates.toISOString();\r\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function parseIsoToTimestamp(_date) {\n if ( _date !== null ) {\n var s = $.trim(_date);\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n s = s.replace(/:00.000/, \"\");\n s = s.replace(/T/, \" \").replace(/Z/, \" UTC\");\n s = s.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\n return Number(new Date(s));\n }\n return null;\n }", "function dateFromIsoString(isoDateString) {\r\n return fastDateParse.apply(null, isoDateString.split(/\\D/));\r\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "getFormattedDate ({ date }) {\n if (typeof date === 'string') {\n return format(parseISO(date), \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }\n return format(date, \"d 'de' MMMM', às' HH'h'mm\", {\n locale: ptBR\n })\n }", "function universal() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function getISOLocalDate(value) {\n if (!value) {\n return value;\n }\n\n var date = new Date(value);\n\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n\n var year = getYear(date);\n var month = \"0\".concat(getMonth(date)).slice(-2);\n var day = \"0\".concat(getDay(date)).slice(-2);\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "function configFromISO(config) {\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"b\" /* isString */])(config._i)) {\n return config;\n }\n var input = config._i;\n var match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n var allowTime;\n var dateFormat;\n var timeFormat;\n var tzFormat;\n if (!match) {\n config._isValid = false;\n return config;\n }\n // getParsingFlags(config).iso = true;\n var i;\n var l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return config;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return config;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return config;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n }\n else {\n config._isValid = false;\n return config;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from_string_and_format__[\"a\" /* configFromStringAndFormat */])(config);\n}", "function parseDateFormat(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "function configFromISO(config) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"i\" /* isString */])(config._i)) {\n return config;\n }\n var input = config._i;\n var match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n var allowTime;\n var dateFormat;\n var timeFormat;\n var tzFormat;\n if (!match) {\n config._isValid = false;\n return config;\n }\n // getParsingFlags(config).iso = true;\n var i;\n var l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return config;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return config;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return config;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n }\n else {\n config._isValid = false;\n return config;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n return Object(__WEBPACK_IMPORTED_MODULE_2__from_string_and_format__[\"a\" /* configFromStringAndFormat */])(config);\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "normalize(str) {\n if (str && !CommonUtils.isDate(str)) {\n var match = str.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/);\n if (match) {\n return new Date(match[3], match[2] - 1, match[1]);\n }\n match = str.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (match) {\n return new Date(match[1], match[2] - 1, match[3]);\n }\n }\n }", "function parseDate (date) {\n var d = '';\n var t = date.indexOf('T');\n let index = date.indexOf('-');\n \n if(index === -1 && t === 8){\n d += date.substring(0, 4) + '-';\n d += date.substring(4, 6) + '-';\n d += date.substring(6, 8) + date.substr(8);\n } else if (index > -1 && t === 10) {\n return date;\n } else {\n console.error('invalid date');\n return null;\n }\n return d;\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "convertDateToISOString(date) {\n if (date) return moment(date, defaultDateFormat).toISOString();\n return date;\n }", "function isoDateFormat(strDateView) {\n return moment(strDateView, \"DD/MM/YYYY HH:mm\").format(\"YYYY-MM-DD HH:mm\")\n}", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n \n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0; // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like \"+01:00\" or \"+0100\"\n\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n\n var ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\r\n\ttimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\r\n\ttimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "function ISO_2022() {}", "function ISO_2022() {}", "function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }", "function parseISO(config) {\n\t var i, l,\n\t string = config._i,\n\t match = isoRegex.exec(string);\n\n\t if (match) {\n\t config._pf.iso = true;\n\t for (i = 0, l = isoDates.length; i < l; i++) {\n\t if (isoDates[i][1].exec(string)) {\n\t // match[5] should be 'T' or undefined\n\t config._f = isoDates[i][0] + (match[6] || ' ');\n\t break;\n\t }\n\t }\n\t for (i = 0, l = isoTimes.length; i < l; i++) {\n\t if (isoTimes[i][1].exec(string)) {\n\t config._f += isoTimes[i][0];\n\t break;\n\t }\n\t }\n\t if (string.match(parseTokenTimezone)) {\n\t config._f += 'Z';\n\t }\n\t makeDateFromStringAndFormat(config);\n\t } else {\n\t config._isValid = false;\n\t }\n\t }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }" ]
[ "0.69151974", "0.66991687", "0.6643978", "0.65537083", "0.65537083", "0.6520427", "0.6492825", "0.64871174", "0.6448661", "0.64316744", "0.64316744", "0.64103484", "0.64103484", "0.6407205", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.64045346", "0.63858414", "0.6371779", "0.63675845", "0.63675845", "0.63675845", "0.63675845", "0.63675845", "0.6310807", "0.63043165", "0.6296922", "0.6296922", "0.6296922", "0.6296922", "0.62956905", "0.62956905", "0.62956905", "0.62956905", "0.62367827", "0.62285906", "0.62221026", "0.62221026", "0.62221026", "0.62183875", "0.61820984", "0.6167017", "0.6166754", "0.6166754", "0.6166754", "0.6166754", "0.6166754", "0.61617094", "0.61617094", "0.6147587", "0.61250347", "0.61188406", "0.611831", "0.6112176", "0.61092424", "0.6103642", "0.6103642", "0.6103642", "0.6103642", "0.6103642", "0.6071104", "0.60573643", "0.60538405", "0.60504943", "0.60102975", "0.60096854", "0.60056126", "0.60056126", "0.5989161", "0.5989161", "0.5979461", "0.5974252", "0.5971357", "0.5971357", "0.5971357", "0.5971161", "0.5971161", "0.5971161", "0.5971161", "0.5971161", "0.5971161" ]
0.0
-1
date from string and format string
function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); configFromArray(config); checkOverflow(config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n string = string.replace(getParseRegexForToken(tokens[i]), '');\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // handle timezone\n datePartArray[3] += config.tzh;\n datePartArray[4] += config.tzm;\n // return\n return config.isUTC ? new Date(Date.UTC.apply({}, datePartArray)) : dateFromArray(datePartArray);\n }", "function format_date(d_str) {\n return new Date(d_str.replace(/(\\d{2}).(\\d{2}).(\\d{4})/, \"$2/$1/$3\"))\n}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens);\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function get_date_from_string(date_str){\n var parts =date_str.split('-');\n if(parts[0].length == 6){\n // working with date format DDMMYY\n var date_list = parts[0].match(/.{1,2}/g);\n var result_date = new Date(date_list[2].padStart(4, '20'), date_list[1]-1, date_list[0])\n return result_date;\n }else if(parts[0].length == 2){\n var result_date = new Date(parts[2].padStart(4, '20'), parts[1]-1, parts[0]);\n return result_date;\n }else{\n // unknown format. Do nothing\n return\n }\n}", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function parseDate(str) {\n var m = str.match(/^(\\d{4})\\-(\\d{1,2})\\-(\\d{1,2})/);\n return (m) ? `${m[2]}/${m[3]}/${m[1]}` : null;\n}", "function convert_date(str){var tmp=str.split(\".\");return new Date(tmp[1]+\"/\"+tmp[0]+\"/\"+tmp[2])}", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function str2date(str) {\n\t\t\ttry {\n\t\t\t\tvar t = (str).split(/[- :]/);\n\t\t\t\treturn new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n\t\t\t} catch (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t}", "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n len = Math.min(inputParts.length, formatParts.length),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = (input || '').match(timezoneParseRegex);\n if (a && a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a && a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < len; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function dateParser(strDate, format){\nif(!checkValidDate(strDate))\nreturn new Date();\n\nvar slash1 = strDate.indexOf(\"/\");\nif (slash1 == -1) { slash1 = strDate.indexOf(\"-\"); }\n// if no slashes or dashes, invalid date\nif (slash1 == -1) { return false; }\nvar dateYear = strDate.substring(0, slash1);\nvar dateYearAndMonth = strDate.substring(slash1+1, strDate.length);\nvar slash2 = dateYearAndMonth.indexOf(\"/\");\nif (slash2 == -1) { slash2 = dateYearAndMonth.indexOf(\"-\"); }\n// if not a second slash or dash, invalid date\nif (slash2 == -1) { return false; }\nvar dateMonth = dateYearAndMonth.substring(0, slash2);\nvar dateDay = dateYearAndMonth.substring(slash2+1, dateYearAndMonth.length);\nvar retDate = new Date(dateYear,dateMonth-1,dateDay);\nreturn retDate;\n}", "function stringToDate(_date,_format,_delimiter)\r\n{\r\n var formatLowerCase=_format.toLowerCase();\r\n var formatItems=formatLowerCase.split(_delimiter);\r\n var dateItems=_date.split(_delimiter);\r\n var monthIndex=formatItems.indexOf(\"mm\");\r\n var dayIndex=formatItems.indexOf(\"dd\");\r\n var yearIndex=formatItems.indexOf(\"yyyy\");\r\n var month=parseInt(dateItems[monthIndex]);\r\n month-=1;\r\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\r\n return formatedDate;\r\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ? \n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "function stringToDate(_date,_format,_delimiter)\n{\n var formatLowerCase=_format.toLowerCase();\n var formatItems=formatLowerCase.split(_delimiter);\n var dateItems=_date.split(_delimiter);\n var monthIndex=formatItems.indexOf(\"mm\");\n var dayIndex=formatItems.indexOf(\"dd\");\n var yearIndex=formatItems.indexOf(\"yyyy\");\n var month=parseInt(dateItems[monthIndex]);\n month-=1;\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\n return formatedDate;\n}", "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function $dateFromString(obj, expr, options) {\n var args = core_1.computeValue(obj, expr, null, options);\n args.format = args.format || _internal_1.DATE_FORMAT;\n args.onNull = args.onNull || null;\n var dateString = args.dateString;\n if (util_1.isNil(dateString))\n return args.onNull;\n // collect all separators of the format string\n var separators = args.format.split(/%[YGmdHMSLuVzZ]/);\n separators.reverse();\n var matches = args.format.match(/(%%|%Y|%G|%m|%d|%H|%M|%S|%L|%u|%V|%z|%Z)/g);\n var dateParts = {};\n // holds the valid regex of parts that matches input date string\n var expectedPattern = \"\";\n for (var i = 0, len = matches.length; i < len; i++) {\n var formatSpecifier = matches[i];\n var props = _internal_1.DATE_SYM_TABLE[formatSpecifier];\n if (util_1.isObject(props)) {\n // get pattern and alias from table\n var m = props.re.exec(dateString);\n // get the next separtor\n var delimiter = separators.pop() || \"\";\n if (m !== null) {\n // store and cut out matched part\n dateParts[props.name] = /^\\d+$/.exec(m[0]) ? parseInt(m[0]) : m[0];\n dateString =\n dateString.substr(0, m.index) +\n dateString.substr(m.index + m[0].length);\n // construct expected pattern\n expectedPattern +=\n _internal_1.regexQuote(delimiter) + _internal_1.regexStrip(props.re.toString());\n }\n else {\n dateParts[props.name] = null;\n }\n }\n }\n // 1. validate all required date parts exists\n // 2. validate original dateString against expected pattern.\n if (util_1.isNil(dateParts.year) ||\n util_1.isNil(dateParts.month) ||\n util_1.isNil(dateParts.day) ||\n !new RegExp(\"^\" + expectedPattern + \"$\").exec(args.dateString))\n return args.onError;\n var tz = _internal_1.parseTimezone(args.timezone);\n // create the date. month is 0-based in Date\n var d = new Date(Date.UTC(dateParts.year, dateParts.month - 1, dateParts.day, 0, 0, 0));\n if (!util_1.isNil(dateParts.hour))\n d.setUTCHours(dateParts.hour);\n if (!util_1.isNil(dateParts.minute))\n d.setUTCMinutes(dateParts.minute);\n if (!util_1.isNil(dateParts.second))\n d.setUTCSeconds(dateParts.second);\n if (!util_1.isNil(dateParts.millisecond))\n d.setUTCMilliseconds(dateParts.millisecond);\n // The minute part is unused when converting string.\n // This was observed in the tests on MongoDB site but not officially stated anywhere\n tz.minute = 0;\n _internal_1.adjustDate(d, tz);\n return d;\n}", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "formatDate(str) {\n let string = str.slice(0, str.lastIndexOf('T'))\n let fields = string.split('-');\n let finalString = fields[2] + '-' + fields[1] + '-' + fields[0]\n return finalString\n }", "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "function format_date(date_string, data_source) {\n var date = new Date(date_string);\n return {v: date, f: date_string};\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n \n config._a = [];\n config._pf.empty = true;\n \n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n \n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n \n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n \n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n \n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function formatDate(date, formatStr) {\n return formatDateWithChunks(date, getFormatStringChunks(formatStr));\n }", "function formatDate(string){\n var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };\n return new Date(string).toLocaleDateString([],options);\n}", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "function getFormatDate(date) {\n\t\tvar arr = date.split('/');\n\t\treturn new Date(parseInt(arr[2]), parseInt(arr[1])-1, parseInt(arr[0]));\n\t}", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function makeDateFromStringAndFormat(config) {\n\t\tif (config._f === moment.ISO_8601) {\n\t\t\tparseISO(config);\n\t\t\treturn;\n\t\t}\n\n\t\tconfig._a = [];\n\t\tconfig._pf.empty = true;\n\n\t\t// This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t\tvar string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;\n\n\t\ttokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t\tfor (i = 0; i < tokens.length; i++) {\n\t\t\ttoken = tokens[i];\n\t\t\tparsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t\t\tif (parsedInput) {\n\t\t\t\tskipped = string.substr(0, string.indexOf(parsedInput));\n\t\t\t\tif (skipped.length > 0) {\n\t\t\t\t\tconfig._pf.unusedInput.push(skipped);\n\t\t\t\t}\n\t\t\t\tstring = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t\t\t\ttotalParsedInputLength += parsedInput.length;\n\t\t\t}\n\t\t\t// don't parse if it's not a known token\n\t\t\tif (formatTokenFunctions[token]) {\n\t\t\t\tif (parsedInput) {\n\t\t\t\t\tconfig._pf.empty = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t\t}\n\t\t\t\taddTimeToArrayFromToken(token, parsedInput, config);\n\t\t\t} else if (config._strict && !parsedInput) {\n\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t}\n\t\t}\n\n\t\t// add remaining unparsed input length to the string\n\t\tconfig._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t\tif (string.length > 0) {\n\t\t\tconfig._pf.unusedInput.push(string);\n\t\t}\n\n\t\t// clear _12h flag if hour is <= 12\n\t\tif (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t\t\tconfig._pf.bigHour = undefined;\n\t\t}\n\t\t// handle am pm\n\t\tif (config._isPm && config._a[HOUR] < 12) {\n\t\t\tconfig._a[HOUR] += 12;\n\t\t}\n\t\t// if is 12 am, change hours to 0\n\t\tif (config._isPm === false && config._a[HOUR] === 12) {\n\t\t\tconfig._a[HOUR] = 0;\n\t\t}\n\t\tdateFromConfig(config);\n\t\tcheckOverflow(config);\n\t}", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i,\n\t parsedInput,\n\t tokens,\n\t token,\n\t skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t } else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t } else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // clear _12h flag if hour is <= 12\n\t if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t config._pf.bigHour = undefined;\n\t }\n\t // handle meridiem\n\t config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function unformatDate(datestr) {\n var y = parseInt(datestr.slice(0, 4)),\n m = parseInt(datestr.slice(5, 7)) - 1,\n dy = parseInt(datestr.slice(8));\n\n return (new Date(y, m, dy));\n}", "function parseDate(str) {\n \t\t//var m = str.match(/^(\\d{1,2})-(\\d{1,2})-(\\d{4})$/);\n \t\tvar m = str.match(/^(0?[1-9]|[12][0-9]|3[01])[\\.\\-](0?[1-9]|1[012])[\\.\\-]\\d{4}$/);\n \t\treturn (m) ? new Date(m[3], m[2]-1, m[1]) : null;\n\t}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function getDateFromString(str)\n{\n var dateRE1 = /([0-9]{1,4})(?:\\-|\\/|\\.|\\u5e74|\\u6708|\\u65e5)([0-9]{1,2})(?:\\-|\\/|\\.|\\u5e74|\\u6708|\\u65e5)*([0-9]{1,4})*/i;\n var dateRE2 = /(on)?\\s*(([0-9]*)(?:st|th|rd|nd)*(?:\\s|of|\\-a|\\-|,|\\.)*(january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sept|sep|october|oct|november|nov|december|dec)(?:\\s|\\-|\\.)*([0-9]*))/i;\n var dateRE3 = /(on)?\\s*((january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sept|sep|october|oct|november|nov|december|dec)(?:\\s|,|\\.|\\-)*([0-9]+)(?:st|th|rd|nd)*(?:\\s|,|\\.|\\-a|\\-)*([0-9]*))/i;\n var dateRE4 = /(on)?\\s*((next)?\\s*(monday|mon|tuesday|tue|wednesday|wed|thursday|thu|friday|fri|saturday|sat|sunday|sun))/i;\n var dateRE5 = /(in)?\\s*(one|two|three|four|five|six|seven|eight|nine|ten|[0-9]+)\\s*(years|year|yrs|yr|months|month|mons|mon|weeks|week|wks|wk|days|day)/i;\n var dateRE6 = /end\\s*of\\s*(?:the)*\\s*(week|w|month|m)/i;\n var dateRE7 =/(on)?\\s*([0-9]+)(?:st|th|rd|nd)/i;\n var dateRE8 = /\\s*(yesterday|tod|today|tom|tomorrow)/i;\n \n \n if (DEBUG) log(\"getDateFromString: Looking for date in '\" + str + \"'\");\n var dateRE1match = dateRE1.exec(str);\n var dateRE2match = dateRE2.exec(str);\n var dateRE3match = dateRE3.exec(str);\n var dateRE4match = dateRE4.exec(str);\n var dateRE5match = dateRE5.exec(str);\n var dateRE6match = dateRE6.exec(str);\n var dateRE7match = dateRE7.exec(str);\n var dateRE8match = dateRE8.exec(str);\n \n if (dateRE1match)\n {\n if (DEBUG) log(\"dateRE1 match for '\" + str + \"' = '\" + dateRE1match[0] + \"'\");\n return dateRE1match[0];\n }\n \n if (dateRE2match)\n {\n if (DEBUG) log(\"dateRE2 match for '\" + str + \"' = '\" + dateRE2match[0] + \"'\");\n return dateRE2match[0];\n }\n \n if (dateRE3match)\n {\n if (DEBUG) log(\"dateRE3 match for '\" + str + \"' = '\" + dateRE3match[0] + \"'\");\n return dateRE3match[0];\n }\n \n if (dateRE4match)\n {\n if (DEBUG) log(\"dateRE4 match for '\" + str + \"' = '\" + dateRE4match[0] + \"'\");\n return dateRE4match[0];\n }\n \n if (dateRE5match)\n {\n if (DEBUG) log(\"dateRE5 match for '\" + str + \"' = '\" + dateRE5match[0] + \"'\");\n return dateRE5match[0];\n }\n \n if (dateRE6match)\n {\n if (DEBUG) log(\"dateRE6 match for '\" + str + \"' = '\" + dateRE6match[0] + \"'\");\n return dateRE6match[0];\n }\n \n if (dateRE7match)\n {\n if (DEBUG) log(\"dateRE7 match for '\" + str + \"' = '\" + dateRE7match[0] + \"'\");\n return dateRE7match[0];\n }\n \n if (dateRE8match)\n {\n if (DEBUG) log(\"dateRE8 match for '\" + str + \"' = '\" + dateRE8match[0] + \"'\");\n return dateRE8match[0];\n }\n \n if (DEBUG) log(\"NO MATCH FOR DATE STRING '\" + str + \"'!!!!!\");\n return;\n}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function parseStringToDate(string) {\n if (string) {\n var parts = string.match(/(\\d+)/g);\n // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])\n return new Date(parts[0], parts[1] - 1, parts[2]); // months are 0-based\n }\n }", "function formatDate(string) {\n var date = new Date(string);\n let options = {\n day: \"numeric\",\n month: \"long\",\n };\n return date.toLocaleString(\"en-US\", options);\n }", "function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n return yy + '-' + mm + '-' + dd;\n }\n }", "function castStringToDate(str) {\n if (str !== undefined && str.length === 16) {\n let day = str.slice(0, 2);\n let month = str.slice(3, 5);\n let americanDateString = month + '-' + day + str.slice(5); // MM-DD-YYYY HH:MM\n return new Date(americanDateString);\n } else {\n console.error('Error casting ' + str + ' to date.')\n }\n return new Date()\n}", "normalize(str) {\n if (str && !CommonUtils.isDate(str)) {\n var match = str.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/);\n if (match) {\n return new Date(match[3], match[2] - 1, match[1]);\n }\n match = str.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/);\n if (match) {\n return new Date(match[1], match[2] - 1, match[3]);\n }\n }\n }", "function formatDate(date,formatStr){return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString,date);}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }" ]
[ "0.7544057", "0.7378126", "0.71777546", "0.71777546", "0.71777546", "0.71777546", "0.71671367", "0.7163808", "0.7163808", "0.7163808", "0.7163808", "0.7163808", "0.71498096", "0.71486294", "0.71486294", "0.71486294", "0.70893186", "0.7086403", "0.70293576", "0.70293576", "0.70195943", "0.70195943", "0.70195943", "0.70195943", "0.70195943", "0.7002717", "0.7002717", "0.69697803", "0.6963666", "0.69486713", "0.6941472", "0.6931618", "0.69212186", "0.68995607", "0.68969715", "0.68969715", "0.68969715", "0.68969715", "0.68969715", "0.6896638", "0.68942904", "0.68942904", "0.68848205", "0.6881519", "0.68802357", "0.68802357", "0.6860201", "0.68580484", "0.68580484", "0.68559957", "0.68525356", "0.68521965", "0.68521965", "0.68521965", "0.68521965", "0.68521965", "0.68521965", "0.68521965", "0.68521965", "0.6838409", "0.6838409", "0.6838409", "0.6838409", "0.6838409", "0.6829404", "0.6784215", "0.6758764", "0.6727878", "0.6727878", "0.6727878", "0.6726412", "0.6726379", "0.6726379", "0.6725158", "0.6717375", "0.6717375", "0.6717375", "0.6717375", "0.6717375", "0.6717375", "0.6695233", "0.66870695", "0.66870695", "0.6683349", "0.6683229", "0.6678988", "0.66708475", "0.66647357", "0.6660571", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495", "0.66551495" ]
0.0
-1
date from string and array of format strings
function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (!isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(parseMultipleFormatChunker) || [],\n formattedInputParts,\n scoreToBeat = 99,\n i,\n currentDate,\n currentScore;\n for (i = 0; i < formats.length; i++) {\n currentDate = makeDateFromStringAndFormat(string, formats[i]);\n formattedInputParts = formatMoment(new Moment(currentDate), formats[i]).match(parseMultipleFormatChunker) || [];\n currentScore = compareArrays(inputParts, formattedInputParts);\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n output = currentDate;\n }\n }\n return output;\n }", "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n string = string.replace(getParseRegexForToken(tokens[i]), '');\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // handle timezone\n datePartArray[3] += config.tzh;\n datePartArray[4] += config.tzm;\n // return\n return config.isUTC ? new Date(Date.UTC.apply({}, datePartArray)) : dateFromArray(datePartArray);\n }", "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(inputCharacters),\n scores = [],\n scoreToBeat = 99,\n i,\n curDate,\n curScore;\n for (i = 0; i < formats.length; i++) {\n curDate = makeDateFromStringAndFormat(string, formats[i]);\n curScore = compareArrays(inputParts, formatMoment(new Moment(curDate), formats[i]).match(inputCharacters));\n if (curScore < scoreToBeat) {\n scoreToBeat = curScore;\n output = curDate;\n }\n }\n return output;\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens);\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "parseDate(arrayOfStrings)\n {\n let newStr=arrayOfStrings[3];\n newStr += '-';\n switch(arrayOfStrings[1])\n {\n case 'Jan':\n newStr+='01';\n break;\n case 'Feb':\n newStr+='02';\n break;\n case 'Mar':\n newStr+='03';\n break;\n case 'Apr':\n newStr+='04';\n break;\n case 'May':\n newStr+='05';\n break;\n case 'Jun':\n newStr+='06';\n break;\n case 'Jul':\n newStr+='07';\n break;\n case 'Aug':\n newStr+='08';\n break;\n case 'Sep':\n newStr+='09';\n break;\n case 'Oct':\n newStr+='10';\n break;\n case 'Nov':\n newStr+='11';\n break;\n case 'Dec':\n newStr+='12';\n break;\n default:\n break;\n }\n newStr+='-';\n newStr+=arrayOfStrings[2];\n\n return newStr;\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function $dateFromString(obj, expr, options) {\n var args = core_1.computeValue(obj, expr, null, options);\n args.format = args.format || _internal_1.DATE_FORMAT;\n args.onNull = args.onNull || null;\n var dateString = args.dateString;\n if (util_1.isNil(dateString))\n return args.onNull;\n // collect all separators of the format string\n var separators = args.format.split(/%[YGmdHMSLuVzZ]/);\n separators.reverse();\n var matches = args.format.match(/(%%|%Y|%G|%m|%d|%H|%M|%S|%L|%u|%V|%z|%Z)/g);\n var dateParts = {};\n // holds the valid regex of parts that matches input date string\n var expectedPattern = \"\";\n for (var i = 0, len = matches.length; i < len; i++) {\n var formatSpecifier = matches[i];\n var props = _internal_1.DATE_SYM_TABLE[formatSpecifier];\n if (util_1.isObject(props)) {\n // get pattern and alias from table\n var m = props.re.exec(dateString);\n // get the next separtor\n var delimiter = separators.pop() || \"\";\n if (m !== null) {\n // store and cut out matched part\n dateParts[props.name] = /^\\d+$/.exec(m[0]) ? parseInt(m[0]) : m[0];\n dateString =\n dateString.substr(0, m.index) +\n dateString.substr(m.index + m[0].length);\n // construct expected pattern\n expectedPattern +=\n _internal_1.regexQuote(delimiter) + _internal_1.regexStrip(props.re.toString());\n }\n else {\n dateParts[props.name] = null;\n }\n }\n }\n // 1. validate all required date parts exists\n // 2. validate original dateString against expected pattern.\n if (util_1.isNil(dateParts.year) ||\n util_1.isNil(dateParts.month) ||\n util_1.isNil(dateParts.day) ||\n !new RegExp(\"^\" + expectedPattern + \"$\").exec(args.dateString))\n return args.onError;\n var tz = _internal_1.parseTimezone(args.timezone);\n // create the date. month is 0-based in Date\n var d = new Date(Date.UTC(dateParts.year, dateParts.month - 1, dateParts.day, 0, 0, 0));\n if (!util_1.isNil(dateParts.hour))\n d.setUTCHours(dateParts.hour);\n if (!util_1.isNil(dateParts.minute))\n d.setUTCMinutes(dateParts.minute);\n if (!util_1.isNil(dateParts.second))\n d.setUTCSeconds(dateParts.second);\n if (!util_1.isNil(dateParts.millisecond))\n d.setUTCMilliseconds(dateParts.millisecond);\n // The minute part is unused when converting string.\n // This was observed in the tests on MongoDB site but not officially stated anywhere\n tz.minute = 0;\n _internal_1.adjustDate(d, tz);\n return d;\n}", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n \n scoreToBeat,\n i,\n currentScore;\n \n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n \n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n \n if (!isValid(tempConfig)) {\n continue;\n }\n \n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n \n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n \n tempConfig._pf.score = currentScore;\n \n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n \n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n\t\tif (config._f === moment.ISO_8601) {\n\t\t\tparseISO(config);\n\t\t\treturn;\n\t\t}\n\n\t\tconfig._a = [];\n\t\tconfig._pf.empty = true;\n\n\t\t// This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t\tvar string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;\n\n\t\ttokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t\tfor (i = 0; i < tokens.length; i++) {\n\t\t\ttoken = tokens[i];\n\t\t\tparsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t\t\tif (parsedInput) {\n\t\t\t\tskipped = string.substr(0, string.indexOf(parsedInput));\n\t\t\t\tif (skipped.length > 0) {\n\t\t\t\t\tconfig._pf.unusedInput.push(skipped);\n\t\t\t\t}\n\t\t\t\tstring = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t\t\t\ttotalParsedInputLength += parsedInput.length;\n\t\t\t}\n\t\t\t// don't parse if it's not a known token\n\t\t\tif (formatTokenFunctions[token]) {\n\t\t\t\tif (parsedInput) {\n\t\t\t\t\tconfig._pf.empty = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t\t}\n\t\t\t\taddTimeToArrayFromToken(token, parsedInput, config);\n\t\t\t} else if (config._strict && !parsedInput) {\n\t\t\t\tconfig._pf.unusedTokens.push(token);\n\t\t\t}\n\t\t}\n\n\t\t// add remaining unparsed input length to the string\n\t\tconfig._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t\tif (string.length > 0) {\n\t\t\tconfig._pf.unusedInput.push(string);\n\t\t}\n\n\t\t// clear _12h flag if hour is <= 12\n\t\tif (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t\t\tconfig._pf.bigHour = undefined;\n\t\t}\n\t\t// handle am pm\n\t\tif (config._isPm && config._a[HOUR] < 12) {\n\t\t\tconfig._a[HOUR] += 12;\n\t\t}\n\t\t// if is 12 am, change hours to 0\n\t\tif (config._isPm === false && config._a[HOUR] === 12) {\n\t\t\tconfig._a[HOUR] = 0;\n\t\t}\n\t\tdateFromConfig(config);\n\t\tcheckOverflow(config);\n\t}", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t var tempConfig, bestMoment, scoreToBeat, i, currentScore;\n\n\t if (config._f.length === 0) {\n\t config._pf.invalidFormat = true;\n\t config._d = new Date(NaN);\n\t return;\n\t }\n\n\t for (i = 0; i < config._f.length; i++) {\n\t currentScore = 0;\n\t tempConfig = copyConfig({}, config);\n\t if (config._useUTC != null) {\n\t tempConfig._useUTC = config._useUTC;\n\t }\n\t tempConfig._pf = defaultParsingFlags();\n\t tempConfig._f = config._f[i];\n\t makeDateFromStringAndFormat(tempConfig);\n\n\t if (!_isValid(tempConfig)) {\n\t continue;\n\t }\n\n\t // if there is any input that was not parsed add a penalty for that format\n\t currentScore += tempConfig._pf.charsLeftOver;\n\n\t //or tokens\n\t currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t tempConfig._pf.score = currentScore;\n\n\t if (scoreToBeat == null || currentScore < scoreToBeat) {\n\t scoreToBeat = currentScore;\n\t bestMoment = tempConfig;\n\t }\n\t }\n\n\t extend(config, bestMoment || tempConfig);\n\t }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "parseDate(value, format) {\n if (format == null || value == null) {\n throw \"Invalid arguments\";\n }\n value = (typeof value === \"object\" ? value.toString() : value + \"\");\n if (value === \"\") {\n return null;\n }\n let iFormat, dim, extra, iValue = 0, shortYearCutoff = (typeof this.shortYearCutoff !== \"string\" ? this.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.shortYearCutoff, 10)), year = -1, month = -1, day = -1, doy = -1, literal = false, date, lookAhead = (match) => {\n let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n }, getNumber = (match) => {\n let isDoubled = lookAhead(match), size = (match === \"@\" ? 14 : (match === \"!\" ? 20 :\n (match === \"y\" && isDoubled ? 4 : (match === \"o\" ? 3 : 2)))), minSize = (match === \"y\" ? size : 1), digits = new RegExp(\"^\\\\d{\" + minSize + \",\" + size + \"}\"), num = value.substring(iValue).match(digits);\n if (!num) {\n throw \"Missing number at position \" + iValue;\n }\n iValue += num[0].length;\n return parseInt(num[0], 10);\n }, getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n for (let i = 0; i < arr.length; i++) {\n names.push([i, arr[i]]);\n }\n names.sort((a, b) => {\n return -(a[1].length - b[1].length);\n });\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n if (index !== -1) {\n return index + 1;\n }\n else {\n throw \"Unknown name at position \" + iValue;\n }\n }, checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw \"Unexpected literal at position \" + iValue;\n }\n iValue++;\n };\n if (this.view === 'month') {\n day = 1;\n }\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n }\n else {\n checkLiteral();\n }\n }\n else {\n switch (format.charAt(iFormat)) {\n case \"d\":\n day = getNumber(\"d\");\n break;\n case \"D\":\n getName(\"D\", this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].DAY_NAMES_SHORT), this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].DAY_NAMES));\n break;\n case \"o\":\n doy = getNumber(\"o\");\n break;\n case \"m\":\n month = getNumber(\"m\");\n break;\n case \"M\":\n month = getName(\"M\", this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].MONTH_NAMES_SHORT), this.getTranslation(primeng_api__WEBPACK_IMPORTED_MODULE_6__[\"TranslationKeys\"].MONTH_NAMES));\n break;\n case \"y\":\n year = getNumber(\"y\");\n break;\n case \"@\":\n date = new Date(getNumber(\"@\"));\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"!\":\n date = new Date((getNumber(\"!\") - this.ticksTo1970) / 10000);\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"'\":\n if (lookAhead(\"'\")) {\n checkLiteral();\n }\n else {\n literal = true;\n }\n break;\n default:\n checkLiteral();\n }\n }\n }\n if (iValue < value.length) {\n extra = value.substr(iValue);\n if (!/^\\s+/.test(extra)) {\n throw \"Extra/unparsed characters found in date: \" + extra;\n }\n }\n if (year === -1) {\n year = new Date().getFullYear();\n }\n else if (year < 100) {\n year += new Date().getFullYear() - new Date().getFullYear() % 100 +\n (year <= shortYearCutoff ? 0 : -100);\n }\n if (doy > -1) {\n month = 1;\n day = doy;\n do {\n dim = this.getDaysCountInMonth(year, month - 1);\n if (day <= dim) {\n break;\n }\n month++;\n day -= dim;\n } while (true);\n }\n date = this.daylightSavingAdjust(new Date(year, month - 1, day));\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw \"Invalid date\"; // E.g. 31/02/00\n }\n return date;\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t\tvar tempConfig, bestMoment,\n\n\t\tscoreToBeat, i, currentScore;\n\n\t\tif (config._f.length === 0) {\n\t\t\tconfig._pf.invalidFormat = true;\n\t\t\tconfig._d = new Date(NaN);\n\t\t\treturn;\n\t\t}\n\n\t\tfor (i = 0; i < config._f.length; i++) {\n\t\t\tcurrentScore = 0;\n\t\t\ttempConfig = copyConfig({}, config);\n\t\t\tif (config._useUTC != null) {\n\t\t\t\ttempConfig._useUTC = config._useUTC;\n\t\t\t}\n\t\t\ttempConfig._pf = defaultParsingFlags();\n\t\t\ttempConfig._f = config._f[i];\n\t\t\tmakeDateFromStringAndFormat(tempConfig);\n\n\t\t\tif (!isValid(tempConfig)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if there is any input that was not parsed add a penalty for that format\n\t\t\tcurrentScore += tempConfig._pf.charsLeftOver;\n\n\t\t\t//or tokens\n\t\t\tcurrentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t\t\ttempConfig._pf.score = currentScore;\n\n\t\t\tif (scoreToBeat == null || currentScore < scoreToBeat) {\n\t\t\t\tscoreToBeat = currentScore;\n\t\t\t\tbestMoment = tempConfig;\n\t\t\t}\n\t\t}\n\n\t\textend(config, bestMoment || tempConfig);\n\t}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "function makeDateFromStringAndArray(config) {\n\t var tempConfig,\n\t bestMoment,\n\n\t scoreToBeat,\n\t i,\n\t currentScore;\n\n\t if (config._f.length === 0) {\n\t config._pf.invalidFormat = true;\n\t config._d = new Date(NaN);\n\t return;\n\t }\n\n\t for (i = 0; i < config._f.length; i++) {\n\t currentScore = 0;\n\t tempConfig = copyConfig({}, config);\n\t if (config._useUTC != null) {\n\t tempConfig._useUTC = config._useUTC;\n\t }\n\t tempConfig._pf = defaultParsingFlags();\n\t tempConfig._f = config._f[i];\n\t makeDateFromStringAndFormat(tempConfig);\n\n\t if (!isValid(tempConfig)) {\n\t continue;\n\t }\n\n\t // if there is any input that was not parsed add a penalty for that format\n\t currentScore += tempConfig._pf.charsLeftOver;\n\n\t //or tokens\n\t currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t tempConfig._pf.score = currentScore;\n\n\t if (scoreToBeat == null || currentScore < scoreToBeat) {\n\t scoreToBeat = currentScore;\n\t bestMoment = tempConfig;\n\t }\n\t }\n\n\t extend(config, bestMoment || tempConfig);\n\t }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "function stringToDate(_date,_format,_delimiter)\r\n{\r\n var formatLowerCase=_format.toLowerCase();\r\n var formatItems=formatLowerCase.split(_delimiter);\r\n var dateItems=_date.split(_delimiter);\r\n var monthIndex=formatItems.indexOf(\"mm\");\r\n var dayIndex=formatItems.indexOf(\"dd\");\r\n var yearIndex=formatItems.indexOf(\"yyyy\");\r\n var month=parseInt(dateItems[monthIndex]);\r\n month-=1;\r\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\r\n return formatedDate;\r\n}", "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n \n config._a = [];\n config._pf.empty = true;\n \n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n \n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n \n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n \n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n \n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "function stringToDate(_date,_format,_delimiter)\n{\n var formatLowerCase=_format.toLowerCase();\n var formatItems=formatLowerCase.split(_delimiter);\n var dateItems=_date.split(_delimiter);\n var monthIndex=formatItems.indexOf(\"mm\");\n var dayIndex=formatItems.indexOf(\"dd\");\n var yearIndex=formatItems.indexOf(\"yyyy\");\n var month=parseInt(dateItems[monthIndex]);\n month-=1;\n var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);\n return formatedDate;\n}" ]
[ "0.6992324", "0.6912437", "0.6811143", "0.67375225", "0.67375225", "0.67375225", "0.67375225", "0.67375225", "0.67109895", "0.67109895", "0.67109895", "0.66975677", "0.65970886", "0.65863997", "0.65863997", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65736145", "0.65625644", "0.6480043", "0.64605933", "0.64605933", "0.64605933", "0.64605933", "0.64605933", "0.6419801", "0.6419801", "0.6419801", "0.6419801", "0.6419088", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.640779", "0.6400969", "0.6393603", "0.6393603", "0.6393603", "0.6392714", "0.6371693", "0.6371693", "0.6371693", "0.6371693", "0.6371693", "0.6371693", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6364184", "0.6356297", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6350513", "0.6349246", "0.6341507", "0.63415045", "0.63415045", "0.63415045", "0.6331202", "0.63261753", "0.63261753", "0.6323412", "0.6323412", "0.6299627", "0.6275333", "0.62741286" ]
0.0
-1
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "function pickBy(fn, moments) {\n\t\tvar res, i;\n\t\tif (moments.length === 1 && isArray(moments[0])) {\n\t\t\tmoments = moments[0];\n\t\t}\n\t\tif (!moments.length) {\n\t\t\treturn moment();\n\t\t}\n\t\tres = moments[0];\n\t\tfor (i = 1; i < moments.length; ++i) {\n\t\t\tif (moments[i][fn](res)) {\n\t\t\t\tres = moments[i];\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }" ]
[ "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.76116085", "0.7576051", "0.75522864", "0.7440175", "0.7440175", "0.72956324" ]
0.0
-1
TODO: Use [].sort instead?
function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort() {\n\t}", "sort() {\n\t}", "function Sort() {}", "sort(){\n\n }", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sort(theArray){\n\n}", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function alfa (arr){\n\tfor (var i = 0; i< arr.length;i++){\n\t\tarr[i].sort();\n\t}\n\treturn arr;\n}", "Sort() {\n\n }", "function Sort(arr)\n{\n\n}", "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }", "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }", "function sortFunction(val){\n return val.sort();\n}", "function dd(a){a=a.ob();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Lf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(ed);b.sort(ed);return[c,b]}", "function sort() {\n // // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // // .. do something with each element of args\n // // YOUR CODE HERE\n var sortedargs = args.sort(function(a, b) {\n return a > b ? 1 : -1\n })\n return sortedargs\n}", "function Zc(a){a=a.Xb();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Zg;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort($c);b.sort($c);return[c,b]}", "function yg(a){a=a.Zb();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].ah;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(zg);b.sort(zg);return[c,b]}", "function sortArr(a, b){\n return a - b ;\n }", "function sort(argument) {\r\n return argument.sort();\r\n}", "function copySorted(arr) {\n return arr.slice().sort();\n}", "function sortData(data)\n\t{\n\t\tfor (let i = 0; i < data.length; i++)\n \t{\n\t \tfor (let j = 0; j < data.length - i - 1; j++)\n\t \t{\n\t \t\tif (+data[j].subCount < +data[j + 1].subCount)\n\t \t\t{\n\t \t\t\tlet tmp = data[j];\n\t \t\t\tdata[j] = data[j + 1];\n\t \t\t\tdata[j + 1] = tmp;\n\t \t\t}\n\t \t}\n \t}\n \treturn data;\n\t}", "function sortMyList() {\n seanBeanMovies.forEach(function(movie) {\n newar.push(movie);\n });\n console.log(newar.sort());\n}", "function sortArray(arr) {\r\n var temp = 0;\r\n for (var i = 0; i < arr.length; ++i) {\r\n for (var j = 0; j < arr.length - 1; ++j) {\r\n if (arr[j].name.charCodeAt(0) < arr[j + 1].name.charCodeAt(0)) {\r\n temp = arr[j + 1];\r\n arr[j + 1] = arr[j];\r\n arr[j] = temp;\r\n }\r\n }\r\n }\r\n console.log(arr);\r\n}", "function sortFunction(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n return args.sort();\r\n}", "sortBy(arr, compare) {\n let sorted = [];\n sorted = arr.sort(compare);\n return sorted;\n }", "function sortedUUIDs(arr) {\n return arr.map(function (el) {\n return el.uuid;\n }).sort();\n}", "function sortNameUp(arr) {\n return arr.sort()\n }", "function subSort(arr) {\n // didnt get this one. try again\n}", "function mergeSort(array) {\n\n}", "getSortArray() {\n const sortable = []; // {\"1\": 10, \"49\": 5}\n for (const key in this.numberPool) \n sortable.push([Number(key), this.numberPool[key]]);\n \n sortable.sort((a, b) => b[1] - a[1]); // Descending\n return sortable;\n }", "__getArray (sort) {\n sort = sort || 'id'\n\n let items = []\n\n this.state.data.forEach((item) => items.push(item))\n\n items.sort((a, b) => {\n if (a[sort] > b[sort]) return -1\n if (a[sort] < b[sort]) return 1\n return 0\n })\n\n return items\n }", "sort(callback) {\r\n return this.array.sort(callback);\r\n }", "function sortArr2(arr) {\n console.table(arr.sort((a, b) => a - b)\n );\n}", "function mergeSort(arr) {\n\n}", "function show(a) {\n a.sort();\n a.map( e => console.log(e) );\n}", "function sortArray1(arr) {\n return arr.sort((a, b) => a-b)\n}", "sortSpecies() {\n //Sortira igrace po vrsti\n for (let s of this.species) {\n s.sortSpecies();\n }\n\n //Sortira vrste po fitnesu najboljeg igraca\n let temp = [];\n for (let i = 0; i < this.species.length; i++) {\n let max = 0;\n let maxIndex = 0;\n for (let j = 0; j < this.species.length; j++) {\n if (this.species[j].bestFitness > max) {\n max = this.species[j].bestFitness;\n maxIndex = j;\n }\n }\n temp.push(this.species[maxIndex]);\n this.species.splice(maxIndex, 1);\n i--;\n }\n this.species = [];\n arrayCopy(temp, this.species);\n }", "function Ob(){for(var a=J.vb(),b=[],c=[],d=0;d<a.length;d++){var e=a[d].Ak;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(Pb);b.sort(Pb);return[c,b]}", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "_sortBy(array, selectors) {\n return array.concat().sort((a, b) => {\n for (let selector of selectors) {\n let reverse = selector.order ? -1 : 1;\n\n a = selector.value ? JP.query(a, selector.value)[0] : JP.query(a,selector)[0];\n b = selector.value ? JP.query(b, selector.value)[0] : JP.query(b,selector)[0];\n\n if (a.toUpperCase() > b.toUpperCase()) {\n return reverse;\n }\n if (a.toUpperCase() < b.toUpperCase()) {\n return -1 * reverse;\n }\n }\n return 0;\n });\n }", "function sortData (data) {\n ...\n}", "function start()\n{\n var a = [ 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 ];\n\n outputArray( \"Data items in original order: \", a,\n document.getElementById( \"originalArray\" ) ); \n a.sort( compareIntegers ); // sort the array\n outputArray( \"Data items in ascending order: \", a,\n document.getElementById( \"sortedArray\" ) ); \n} // end function start", "sortedItems() {\n return this.childItems.slice().sort((i1, i2) => {\n return i1.index - i2.index;\n });\n }", "function sortJson() {\r\n\t \r\n}", "function myarrayresult(){\r\narray2.sort(function (a,b) {\r\n return a-b; //For assending order \r\n return b-a; //For descendening Order // Correct \r\n});\r\n}", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "function task14_16_10(){\n var scores =[320,230,480,120];\n document.write(\"Scores of Students : \"+scores + \"<br>\");\n scores.sort();\n document.write(\"Ordered Score of Students : \"+scores);\n}", "function baseSortBy(array, comparer) {\n var length = array.length;\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}", "function copySorted(arr){\n let a=arr.slice(0);\n return a.sort();\n}", "function sortKids(mmdKidsList) {\r\n\t\tvar sortedList = [];\r\n\t\tif (mmdKidsList && mmdKidsList instanceof Array) {\r\n\t\t\tfor (var i = 0; i < mmdKidsList.length; i++){\r\n\t\t\t\tif (mmdKidsList[i].scalar){\r\n\t\t\t\t\tsortedList.push(mmdKidsList[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var j = 0; j < mmdKidsList.length; j++){\r\n\t\t\t\tif (!mmdKidsList[j].scalar){\r\n\t\t\t\t\tsortedList.push(mmdKidsList[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sortedList;\r\n \t}", "function sortVersionArray(arr) {\n return arr.map( a => a.replace(/\\d+/g, n => +n+100000 ) ).sort()\n .map( a => a.replace(/\\d+/g, n => +n-100000 ) );\n}", "function sortArray() {\n\n //PRZYPISANIE WARTOSCI DO TABLICY\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //SORTOWANIE OD NAJMNIEJSZEJ DO NAJWIEKSZEJ\n points.sort(function (a, b) {\n //POROWNANIE DWOCH ELEM. TABLICY - MNIEJSZY STAWIA PO LEWEJ, WIEKSZY PO PRAWEJ\n return a - b;\n });\n\n //ZWROCENIE POSORTOWANEJ TABLICY\n return points;\n}", "function sort(unsortedArray) {\n // Your code here\n}", "function testSorts()\n{\n\n\tconsole.log(\"============= original googleResults =============\");\n\tconsole.log(googleResults);\n\t\n\tconsole.log(\"==== before sort array element index name rating ====\");\n\t\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\n\t\t// commented for testing\n\t\t//googleResults.sortByRatingAscending();\n\t\t\n\t\t// commented for testing\n\t\tgoogleResults.sortByRatingDescending();\n\t\t\n\t//===============================================================\t\n\n\tconsole.log(\"============= after sort =============\");\n\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\t\n}//END test", "function sort(arr) {\n return null; \n}", "nameSort() {\n orders.sort( \n function(a,b) {\n return (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0; \n }\n ); \n }", "function alphabeticalOrder(arr) {\n // Add your code below this line\n return arr.sort()\n\n // Add your code above this line\n}", "itemsToSort() {\n return [];\n }", "sort(){\n\t\tvar sortable = [];\n\t\tfor (var vehicle in this.primes) {\n\t\t sortable.push([vehicle, this.primes[vehicle]]);\n\t\t}\n\t\treturn sortable.sort(function(a, b) {\n\t\t return a[1] - b[1];\n\t\t});\n\t}", "function sortContacts(arr){\n arr.sort(function(a,b){\n if (a < b) return -1;\n else if (a > b) return 1;\n return 0;\n });\n return arr;\n }", "function sortMin(arr){\n arr = arr.sort(function(a, b){\n return a>b;\n });\n return arr; \n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function treatArray(raw_arr)\n{\n var arr;\narr=sortArray(raw_arr)\narr=filterArray(arr)\nreturn arr\n}", "function sortArray(arr)\n{\n var abc = 'abcdefghijklmnopqrstuvwxyz';\n var dummy = [];\n\n var assignPriority = function (e)\n {\n if (e === \"...\")\n return ((27 + 1) * 26);\n\n var content = e.split('');\n if (isNaN(content[1]))\n return (((abc.indexOf(content[0]) + 1) * 26) * 100);\n\n return (content[1] * 10) + abc.indexOf(content[0]);\n }\n\n arr.forEach(function (e)\n {\n dummy.push(e);\n dummy.sort(function (a, b)\n {\n return assignPriority(a) - assignPriority(b);\n })\n });\n\n arr.length = 0;\n dummy.forEach(function (e)\n {\n if (arr.indexOf(e) === -1)\n {\n arr.push(e);\n }\n });\n}", "function sortedArr(arr) {\n const sortedArray = arr.slice().sort((a, b) => a - b)\n return sortedArray\n}", "function sortArguments(...args) {\n return args.sort();\n}", "sort() {\n if(this.data.length >= 2){\n for (var i = 0; i < this.data.length - 1; i++){\n for (var j = i + 1; j < this.data.length; j++){\n if (this.data[i].users.length < this.data[j].users.length){\n let tmp = this.data[i];\n this.data[i] = this.data[j];\n this.data[j] = tmp;\n \n }\n }\n \n }\n }\n }", "function sortArray() {\n //Twoj komentarz ...\n //deklaracje tablicy z elemtami\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //Twoj komentarz ...\n points.sort(function(a, b) {\n //Twoj komentarz ...\n\n return a - b;\n });\n\n //Twoj komentarz ...\n //zwrócenie tablicy points\n return points;\n}", "function bc(){for(var a=B.Za(),b=[],c=[],d=0;d<a.length;d++){var e=a[d].Hf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(cc);b.sort(cc);return[c,b]}", "sorted(x) {\n super.sorted(0, x);\n }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "sortListItems() {\n let sortedItems = this.props.listItems.slice();\n return sortedItems.sort((a, b) => {\n if (a.value > b.value) {\n return -1;\n } else if (a.value < b.value) {\n return 1;\n }\n return 0;\n });\n }", "function alphabetSort(){\n const tilesArr = [\"Caribbean\", \"The Bahamans\", \"Mexico\", \"Europe\", \"Bermuda\", \"Alaska\", \"Canada & New England\", \"Hawaii\", \"Panama Canal\", \"Transatlantic\", \"Transpacific\", \"Australia\"];\n tilesArr.sort()\n console.log(tilesArr);\n}", "function sortPlaylist() {\n playlistArr = Object.entries(livePlaylist);\n\n if (playlistArr.length > 2) {\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (var i = 1; i < playlistArr.length - 1; i++) {\n if ((playlistArr[i][1].upvote < playlistArr[i + 1][1].upvote)) {\n sorted = false;\n var temp = playlistArr[i];\n playlistArr[i] = playlistArr[i + 1];\n playlistArr[i + 1] = temp;\n // })\n }\n // playlistArr[i][1].index = i;\n }\n }\n }\n return playlistArr;\n}", "function sort(compare, elements) {\n //let property = elements[property];\n \n if (Array.isArray(elements)) {\n if (elements.length <= 1) {\n return elements;\n }\n else {\n const middle = Math.floor(elements.length /2);\n \n const left = elements.slice(0, middle);\n const right = elements.slice(middle, elements.length);\n \n const leftSorted = sort(compare, left);\n const rightSorted = sort(compare, right);\n return merge(compare, leftSorted, rightSorted);\n }\n }\n return elements;\n}", "function _sort(array) {\n array.sort(function (a, b) {\n return b.length - a.length;\n });\n }", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "function byAge(arr){\n return arr.sort(function(a, b){\n return a.age - b.age;\n });\n}", "function sort() {\n renderContent(numArray.sort());\n}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "function ed(a){a=a.tc();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].cA;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(fd);b.sort(fd);return[c,b]}", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function ls (lista) {\nreturn lista.sort(function(x, y) {\n return y.length - x.length; \n })\n}", "function solution(nums){\n return Array.isArray(nums) ? nums.sort((a, b) => a - b) : [];\n}", "serialize() {\n //creates array with spread syntax, then sorts\n //not cross-compatible with some older versions of browsers like IE11\n const sorted = [...this.data];\n sorted.sort((a , b) => {\n return a.comparator - b.comparator;\n });\n return JSON.stringify(sorted);\n }", "serialize() {\n //creates array with spread syntax, then sorts\n //not cross-compatible with some older versions of browsers like IE11\n const sorted = [...this.data];\n sorted.sort((a , b) => {\n return a.comparator - b.comparator;\n });\n return JSON.stringify(sorted);\n }", "function qsort(l){\r\n return sortBy(compare, l);\r\n}", "function quickersort(a){\n var left = []\n , right = []\n , pivot = a[0]\n if(a.length == 0){\n return []\n }\n for(var i = 1; i < a.length; i++){\n a[i] < pivot ? left.push(a[i]) : right.push(a[i])\n }\n return quickersort(left).concat(pivot, quickersort(right))\n}", "function sort(a, b) {\n return a - b;\n}", "function urutAscending(array) {\r\n array.sort((a, b) => {\r\n return a - b\r\n })\r\nreturn array;\r\n}", "function sort(array) {\n var buf;\n\n for (var j = 0; j < array.length-1; j++)\n for (var i = 0; i < array.length-j; i++) {\n if (array[i] > array[i+1]) {\n buf = array[i];\n array[i] = array[i+1];\n array[i+1] = buf;\n }\n }\n\n return array;\n }", "function mSort (array) {\n if (array.length === 1) {\n return array // return once we hit an array with a single item\n }\n const middle = Math.floor(array.length / 2) // get the middle item of the array rounded down\n const left = array.slice(0, middle) // items on the left side\n const right = array.slice(middle) // items on the right side\n return merge(\n mSort(left),\n mSort(right)\n )\n }", "function sortAsc(a, b) {\n return a[1] - b[1];\n }", "function sortScores(){\n //basically this function will take the two arrays, sort the scores, and set the index of the other\n //To print the high score page in order\n var tempScores = highScoreScores.slice(0);\n var tempNames = highScoreNames.slice(0);\n\n highScoreScores.sort(function(a,b){return b-a});\n for(i=0;i<tempNames.length;i++){\n //Have to admit, the following line of code gave me a headache, but I got it to work\n highScoreNames[i] = tempNames[tempScores.indexOf(highScoreScores[i])];\n }\n}", "async function TopologicalSort(){}", "sorted(matches) {\n // sort on i primary, j secondary\n return matches.sort((m1, m2) => (m1.i - m2.i) || (m1.j - m2.j));\n }", "function asc(arr) {\n\t arr.sort(function (a, b) {\n\t return a - b;\n\t });\n\t return arr;\n\t }", "function sortArray(){\n\n /*Uses the built in sort -method that can accept a function that specifies\n how the array should be sorted. In this case we want the array to be sorted\n based on the object's price. Lower priced cars go first.*/\n function compare(a,b) {\n if (a.price < b.price) return -1;\n if (a.price > b.price) return 1;\n return 0;\n }\n listOfCars.sort(compare);\n console.table(listOfCars);\n\n }", "function sortUnique(a, aRef) {\n return a.filter(function (s, i) {\n return (s && a.indexOf(s) === i);\n }).sort((aRef instanceof Array) ? function (a, b) {\n // Sort by reference string array\n var nA = aRef.indexOf(a),\n nB = aRef.indexOf(b);\n if (nA > -1 && nB > -1)\n return nA - nB;\n else\n return ascendNumeric(a, b);\n } : ascendNumeric);\n}", "function sort(arr) {\n var aux = new Array(arr.length);\n mergeSort(arr, aux, 0, arr.length - 1);\n}" ]
[ "0.76898605", "0.76898605", "0.7431569", "0.73816824", "0.722597", "0.70467216", "0.70034754", "0.698132", "0.69408303", "0.6881676", "0.6873754", "0.6873754", "0.683487", "0.6828153", "0.6822689", "0.68005455", "0.678884", "0.6772283", "0.6722359", "0.6710714", "0.6707308", "0.6704686", "0.67010194", "0.66987246", "0.6691354", "0.66738635", "0.6654174", "0.6646408", "0.6622058", "0.6616808", "0.6606702", "0.6583682", "0.6576973", "0.6575858", "0.65742755", "0.65676975", "0.6566166", "0.6563232", "0.6547169", "0.65400237", "0.65333575", "0.6482559", "0.6478265", "0.64772296", "0.64685214", "0.64404494", "0.6421202", "0.64123255", "0.6408173", "0.6406096", "0.6393698", "0.6392959", "0.63847035", "0.6380037", "0.6365073", "0.63600487", "0.6359684", "0.6353272", "0.63527066", "0.63526255", "0.63494897", "0.63445157", "0.6337815", "0.6337578", "0.63344884", "0.63336337", "0.63305974", "0.6329591", "0.6318442", "0.63151276", "0.6312318", "0.6309623", "0.6307509", "0.6307412", "0.63063383", "0.6305984", "0.6304533", "0.6302472", "0.63021904", "0.62975085", "0.62970626", "0.6295027", "0.6295027", "0.6293797", "0.6287295", "0.6280555", "0.6280555", "0.6277756", "0.6276575", "0.62742436", "0.6270855", "0.62705874", "0.62660074", "0.6263973", "0.6247801", "0.62460333", "0.6244123", "0.6243041", "0.62424666", "0.62385195", "0.62372476" ]
0.0
-1
Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAs(input, model) {\n\t return model._isUTC ? moment(input).zone(model._offset || 0) :\n\t moment(input).local();\n\t }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n\t var res, diff;\n\t if (model._isUTC) {\n\t res = model.clone();\n\t diff = (moment.isMoment(input) || isDate(input) ? +input : +moment(input)) - +res;\n\t // Use low-level api, because this fn is low-level api.\n\t res._d.setTime(+res._d + diff);\n\t moment.updateOffset(res, false);\n\t return res;\n\t } else {\n\t return moment(input).local();\n\t }\n\t }", "function makeAs(input, model) {\n\t\tvar res, diff;\n\t\tif (model._isUTC) {\n\t\t\tres = model.clone();\n\t\t\tdiff = (moment.isMoment(input) || isDate(input) ? +input : +moment(input)) - (+res);\n\t\t\t// Use low-level api, because this fn is low-level api.\n\t\t\tres._d.setTime(+res._d + diff);\n\t\t\tmoment.updateOffset(res, false);\n\t\t\treturn res;\n\t\t} else {\n\t\t\treturn moment(input).local();\n\t\t}\n\t}", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "function momentify(source) {\r\n return moment.utc(source);\r\n}", "parse(value) {\n return +moment.utc(value);\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n var input = args[0];\n var isSingleString = args.length == 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n\n if (moment.isMoment(input)) {\n mom = moment.apply(null, args); // clone it\n transferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n }\n else if (isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args); // will be local\n }\n else { // \"parsing\" is required\n isAmbigTime = false;\n isAmbigZone = false;\n\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) { // let's record the inputted zone somehow\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n if (mom.utcOffset) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n else {\n mom.zone(input); // for moment-pre-2.9\n }\n }\n }\n }\n\n mom._fullCalendar = true; // flag for extended functionality\n\n return mom;\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n\t\tvar input = args[0];\n\t\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\t\tvar isAmbigTime;\n\t\tvar isAmbigZone;\n\t\tvar ambigMatch;\n\t\tvar mom;\n\n\t\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\t\telse { // \"parsing\" is required\n\t\t\tisAmbigTime = false;\n\t\t\tisAmbigZone = false;\n\n\t\t\tif (isSingleString) {\n\t\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\t\tinput += '-01';\n\t\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\t\tisAmbigTime = true;\n\t\t\t\t\tisAmbigZone = true;\n\t\t\t\t}\n\t\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\t\tisAmbigZone = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($.isArray(input)) {\n\t\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\t// otherwise, probably a string with a format\n\n\t\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\t\tmom = moment.utc.apply(moment, args);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmom = moment.apply(null, args);\n\t\t\t}\n\n\t\t\tif (isAmbigTime) {\n\t\t\t\tmom._ambigTime = true;\n\t\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t\t}\n\t\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\t\tif (isAmbigZone) {\n\t\t\t\t\tmom._ambigZone = true;\n\t\t\t\t}\n\t\t\t\telse if (isSingleString) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmom._fullCalendar = true; // flag for extended functionality\n\n\t\treturn mom;\n\t}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar output; // an object with fields for the new FCMoment object\n\n\tif (moment.isMoment(input)) {\n\t\toutput = moment.apply(null, args); // clone it\n\n\t\t// the ambig properties have not been preserved in the clone, so reassign them\n\t\tif (input._ambigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t}\n\t\tif (input._ambigZone) {\n\t\t\toutput._ambigZone = true;\n\t\t}\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\toutput = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC) {\n\t\t\toutput = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\toutput = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t\toutput._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\toutput._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\toutput.zone(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new FCMoment(output);\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar output; // an object with fields for the new FCMoment object\n\n\tif (moment.isMoment(input)) {\n\t\toutput = moment.apply(null, args); // clone it\n\n\t\t// the ambig properties have not been preserved in the clone, so reassign them\n\t\tif (input._ambigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t}\n\t\tif (input._ambigZone) {\n\t\t\toutput._ambigZone = true;\n\t\t}\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\toutput = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC) {\n\t\t\toutput = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\toutput = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t\toutput._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\toutput._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\toutput.zone(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new FCMoment(output);\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "function cloneWithOffset(input, model) {\n\tvar res, diff;\n\tif (model._isUTC) {\n\t\tres = model.clone();\n\t\tdiff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n\t\t// Use low-level api, because this fn is low-level api.\n\t\tres._d.setTime(res._d.valueOf() + diff);\n\t\thooks.updateOffset(res, false);\n\t\treturn res;\n\t} else {\n\t\treturn createLocal(input).local();\n\t}\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else { // \"parsing\" is required\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) { // let's record the inputted zone somehow\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (constructor_1.isMoment(input) || is_date_1.default(input) ? input.valueOf() : local_1.createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks_1.hooks.updateOffset(res, false);\n return res;\n }\n else {\n return local_1.createLocal(input).local();\n }\n}" ]
[ "0.8500792", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.84180975", "0.7952661", "0.79354805", "0.7898799", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7850577", "0.7113369", "0.6599144", "0.6559592", "0.65441686", "0.6515401", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.65118587", "0.64756083", "0.64756083", "0.64756083", "0.64756083", "0.64756083", "0.640383", "0.640383", "0.6384391", "0.6384391", "0.6384391", "0.637736", "0.6365682", "0.6364875", "0.6364875", "0.6345072", "0.6329096", "0.6329096", "0.6329096", "0.632356" ]
0.0
-1
MOMENTS keepLocalTime = true means only change the timezone, without affecting the local hour. So 5:31:26 +0300 [utcOffset(2, true)]> 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset +0200, so we adjust the time as needed, to be valid. Keeping the time actually adds/subtracts (one hour) from the actual represented time. That is why we call updateOffset a second time. In case it wants us to change the offset again _changeInProgress == true case, then we have to adjust, because there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract(this, createDuration(input - offset, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){add_subtract__addSubtract(this,create__createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;utils_hooks__hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){add_subtract__addSubtract(this,create__createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;utils_hooks__hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\r\n var offset = this._offset || 0,\r\n localAdjust;\r\n if (input != null) {\r\n if (typeof input === 'string') {\r\n input = offsetFromString(input);\r\n }\r\n if (Math.abs(input) < 16) {\r\n input = input * 60;\r\n }\r\n if (!this._isUTC && keepLocalTime) {\r\n localAdjust = getDateOffset(this);\r\n }\r\n this._offset = input;\r\n this._isUTC = true;\r\n if (localAdjust != null) {\r\n this.add(localAdjust, 'm');\r\n }\r\n if (offset !== input) {\r\n if (!keepLocalTime || this._changeInProgress) {\r\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\r\n } else if (!this._changeInProgress) {\r\n this._changeInProgress = true;\r\n utils_hooks__hooks.updateOffset(this, true);\r\n this._changeInProgress = null;\r\n }\r\n }\r\n return this;\r\n } else {\r\n return this._isUTC ? offset : getDateOffset(this);\r\n }\r\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(input);\n\t }\n\t if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(input);\n\t }\n\t if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset || 0,localAdjust;if(!this.isValid()){return input != null?this:NaN;}if(input != null){if(typeof input === 'string'){input = offsetFromString(matchShortOffset,input);if(input === null){return this;}}else if(Math.abs(input) < 16 && !keepMinutes){input = input * 60;}if(!this._isUTC && keepLocalTime){localAdjust = getDateOffset(this);}this._offset = input;this._isUTC = true;if(localAdjust != null){this.add(localAdjust,'m');}if(offset !== input){if(!keepLocalTime || this._changeInProgress){addSubtract(this,createDuration(input - offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress = true;hooks.updateOffset(this,true);this._changeInProgress = null;}}return this;}else {return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\r\n var offset = this._offset || 0,\r\n localAdjust;\r\n if (!this.isValid()) {\r\n return input != null ? this : NaN;\r\n }\r\n if (input != null) {\r\n if (typeof input === 'string') {\r\n input = offsetFromString(matchShortOffset, input);\r\n } else if (Math.abs(input) < 16) {\r\n input = input * 60;\r\n }\r\n if (!this._isUTC && keepLocalTime) {\r\n localAdjust = getDateOffset(this);\r\n }\r\n this._offset = input;\r\n this._isUTC = true;\r\n if (localAdjust != null) {\r\n this.add(localAdjust, 'm');\r\n }\r\n if (offset !== input) {\r\n if (!keepLocalTime || this._changeInProgress) {\r\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\r\n } else if (!this._changeInProgress) {\r\n this._changeInProgress = true;\r\n utils_hooks__hooks.updateOffset(this, true);\r\n this._changeInProgress = null;\r\n }\r\n }\r\n return this;\r\n } else {\r\n return this._isUTC ? offset : getDateOffset(this);\r\n }\r\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset(input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }", "function getSetOffset(input, keepLocalTime) {\n\t var offset = this._offset || 0,\n\t localAdjust;\n\t if (!this.isValid()) {\n\t return input != null ? this : NaN;\n\t }\n\t if (input != null) {\n\t if (typeof input === 'string') {\n\t input = offsetFromString(matchShortOffset, input);\n\t } else if (Math.abs(input) < 16) {\n\t input = input * 60;\n\t }\n\t if (!this._isUTC && keepLocalTime) {\n\t localAdjust = getDateOffset(this);\n\t }\n\t this._offset = input;\n\t this._isUTC = true;\n\t if (localAdjust != null) {\n\t this.add(localAdjust, 'm');\n\t }\n\t if (offset !== input) {\n\t if (!keepLocalTime || this._changeInProgress) {\n\t add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n\t } else if (!this._changeInProgress) {\n\t this._changeInProgress = true;\n\t utils_hooks__hooks.updateOffset(this, true);\n\t this._changeInProgress = null;\n\t }\n\t }\n\t return this;\n\t } else {\n\t return this._isUTC ? offset : getDateOffset(this);\n\t }\n\t }", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}", "function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}" ]
[ "0.66583717", "0.66583717", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.6618242", "0.65920013", "0.65912384", "0.65883785", "0.6546183", "0.6546183", "0.6536752", "0.6536752", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.64421296", "0.643809", "0.6433503", "0.6432342", "0.6425247", "0.64230525", "0.64230525", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.63884455", "0.6378639", "0.63607526", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165", "0.63539165" ]
0.0
-1
TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setName(name) { }", "constructor(name) {\n super(name);\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name) {\n this._name = name;\n }", "constructor(name){\n this._name = name;\n }", "setName( name ) {\n this.name = name;\n }", "getName(newName) {\n this.name = newName;\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "constructor(name){\n this.name = name\n }", "constructor(name){\n this.name = name;\n }", "setName(name) {\n this.name = name;\n }", "setName(name) {\n this._name = name;\n }", "set type(name) {\n console.warn(\"prototype.type = 'ModelName' is deprecated, use static __name__ instead\");\n this.constructor.__name__ = name;\n }", "set name(x) { this._name = x; }", "get name() {return this._name;}", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "setName(name){\n this.name = name;\n }", "set name(value) { this._name = value || \"unknown\"; }", "constructor({ name }) { // { name } is bringing in a object and deconstructing/ unpacking the object into the class \n this.name = name // name is the object you bring in, and this.name is this specific instance of the class is the name of it \n }", "getName() {}", "function getName() { return name; }", "get name() {\n return this.use().name;\n }", "function name(name) {\n return name;\n }", "setName(value){\n\t\tthis.name = value;\n\t}", "constructor(name='test') {\n this.name = name;\n }", "constructor() {\n super();\n this.name = 'none';\n }", "set setName(name){\n _name=name;\n }", "set name(newName) {\n this.setName(newName);\n }", "get name(): string { throw new Error(\"Member class not implemented\"); }", "set name(value) {\n\t\tthis._name = value;\n\t}", "name(name) {\n\t\tthis._name = name;\n\t\treturn this;\n\t}", "get name() {\r\n\t\treturn this._name;\r\n\t}", "name() { }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "getName() {\r\n return this.name;\r\n }", "name(str) {\n this._name = str;\n return this;\n }", "constructor(name) { // méthode constructor avec pour paramètre name\n super(name); // utiliser super pour appeler name\n this.name = \"Kuma\"; // le name devient Kuma\n }", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name () {\n console.warn(\n 'Deprecation warning: \"channel.name\" is deprecated, use channel.channelName instead'\n )\n return this.channelName\n }", "get name() {\n \treturn 'Stephanie';\n }", "get name() {\r\n return this._name;\r\n }", "get name() {\n\t return this._name;\n\t }", "function getName() {\n\treturn name;\n}", "setName(namePicked) {\n this.name = namePicked; //refer to the object itself using 'this'\n }", "set name(newName) {\n if (newName) {\n this._name = newName;\n }\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "set name(newName) {\n this.setName(newName);\n }", "get name() {\n\t\treturn this._name;\n\t}", "get name() {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "function getName(name) {\n return name\n}", "constructor(transport, name) {\n super(transport);\n this.name = name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "function ensureNameField(desc) {\n desc.name = '';\n }", "get getName() {\n return this._name;\n }", "get name () {\n return this._name;\n }", "['@_name']() {\n super['@_name']();\n if (this._value.name) return;\n\n this._value.name = this._node.declarations[0].id.name;\n }", "function name() {}", "set name(newName) {\n\t this.setName(newName);\n\t }", "constructor () {\n this._name = 'u1';\n }", "get name() {}", "get name() {}", "get name() {}", "get name() {}" ]
[ "0.67782986", "0.6759405", "0.67381084", "0.67381084", "0.67381084", "0.67381084", "0.6733258", "0.6733258", "0.67120683", "0.66484624", "0.6612438", "0.6540716", "0.65202653", "0.65195", "0.6489472", "0.6465985", "0.6462259", "0.6415414", "0.6381141", "0.6297654", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6276111", "0.6185439", "0.6112878", "0.60964316", "0.60552776", "0.6050006", "0.60477877", "0.60141873", "0.5992784", "0.5989703", "0.5979093", "0.5960276", "0.59392995", "0.5917421", "0.5909178", "0.5909035", "0.59078485", "0.59005576", "0.5888179", "0.5888179", "0.5888179", "0.5888179", "0.58705187", "0.58636767", "0.5862385", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.5862183", "0.58525527", "0.58471906", "0.5845746", "0.58370185", "0.58324045", "0.5831436", "0.5828061", "0.5827184", "0.5827184", "0.58205706", "0.5813581", "0.5813581", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5809684", "0.5802686", "0.58016807", "0.57931566", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.57724303", "0.5757861", "0.575781", "0.5756826", "0.5755341", "0.57532394", "0.5749995", "0.57188797", "0.5716756", "0.5716756", "0.5716756", "0.5716756" ]
0.0
-1
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same
function inspect () { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment'; var zone = ''; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } var prefix = '[' + func + '("]'; var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; var datetime = '-MM-DD[T]HH:mm:ss.SSS'; var suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function inspect(){if(!this.isValid()){return 'moment.invalid(/* ' + this._i + ' */)';}var func='moment';var zone='';if(!this.isLocal()){func = this.utcOffset() === 0?'moment.utc':'moment.parseZone';zone = 'Z';}var prefix='[' + func + '(\"]';var year=0 <= this.year() && this.year() <= 9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone + '[\")]';return this.format(prefix + year + datetime + suffix);}", "function inspect () {\n\tif (!this.isValid()) {\n\t\treturn 'moment.invalid(/* ' + this._i + ' */)';\n\t}\n\tvar func = 'moment';\n\tvar zone = '';\n\tif (!this.isLocal()) {\n\t\tfunc = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t\tzone = 'Z';\n\t}\n\tvar prefix = '[' + func + '(\"]';\n\tvar year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\tvar datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\tvar suffix = zone + '[\")]';\n\n\treturn this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}" ]
[ "0.7134383", "0.7134383", "0.71187127", "0.7092415", "0.70798695", "0.70798695", "0.70798695", "0.70798695", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.705595", "0.7052569", "0.7052569", "0.70486224", "0.70486224" ]
0.0
-1
If passed a locale key, it will set the locale for this instance. Otherwise, it will return the locale configuration variables for this instance.
function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key === undefined){return this._locale._abbr;}else {newLocaleData = getLocale(key);if(newLocaleData != null){this._locale = newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}", "function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}" ]
[ "0.728698", "0.728698", "0.7233657", "0.7206724", "0.7206724", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126", "0.7092126" ]
0.0
-1
() (5) (fmt, 5) (fmt) (true) (true, 5) (true, fmt, 5) (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } var i; var out = []; for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo5(a /* : number */, a2 /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + a2 + 1\n })\n}", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "function n$1(n,t){return n?t?4:3:t?3:2}", "function foo4(a /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + 1\n })\n}", "function te(){var e;return Y(\"(\"),e=ge(),Y(\")\"),e}", "function cb_true_2(num) {\n print(\"element \" + num); // B3 B6 B9 B15 B18 B21 B27 B30 B33\n return true; // B4 B7 B10 B16 B19 B22 B28 B31 B34\n} // B5 B8 B11 B17 B20 B23 B29 B32 B35", "function P(a,c){return b.fn.format.call(a,c)}", "function example2 () {\n\n let sum = (a, b) => a + b\n \n function strParse (strings, ...params) {\n console.log(strings);\n console.log(strings.raw);\n console.log(params);\n }\n\n let a = 'test'\n let b = 13\n\n let s = strParse`Some ${a}\n string with another param ${b}\n and sum of 5 and 4, that is ${sum(5,4)}`\n}", "function process(tpl,state) {\n\tconst t = tpl.t, v = tpl.v, r = state.r;\n\tconst d = state.depth;\n\t// reset WS every time\n\tconst ws = state.ws;\n\tconst hasTag = state.hasTag;\n\t//console.log(t,v,ws,hasTag);\n\tstate.ws = false;\n\tstate.hasTag = 0;\n\t//console.log(t,v,tpl.o);\n\tif(t == 1) {\n\t\tif(v == 1) {\n\t\t\tconst last = r.lastChild();\n\t\t\tif(last && last.t === 2 && last.v == 2) {\n\t\t\t\t// 1. mark call\n\t\t\t\tstate.call[d] = true;\n\t\t\t\t//console.log(\"opencall\",d,_strip(r.peek()));\n\t\t\t\t// nest entire tree\n\t\t\t\t// 2. push comma\n\t\t\t\t// TODO add original position to comma\n\t\t\t\tr.mark(\"call\"+d).push(comma());\n\t\t\t} else {\n\t\t\t\tconst cur = r.peek();\n\t\t\t\tif(v == 1 && cur.t !== 6 && cur.t !== 10 && !(cur.t == 4 && (cur.v < 300 || cur.v > 2000))) {\n\t\t\t\t\t//console.log(cur.t,cur.v,cur.o);\n\t\t\t\t\tr.push(seq());\n\t\t\t\t}\n\t\t\t\tr.open(tpl);\n\t\t\t}\n\t\t} else if(v == 3 && state.xml) {\n\t\t\tr.open(tpl);\n\t\t} else {\n\t\t\tr.open(tpl);\n\t\t}\n\t} else if(t == 2) {\n\t\t// FIXME treat all infix-ops in same depth, not just on close\n\t\tstate.r.push(tpl).close();\n\t\tconst cd = d - 1;\n\t\tif(state.call[cd]) {\n\t\t\t// $(x)(2) => call($(x),2)\n\t\t\tstate.call[cd] = false;\n\t\t\t//console.log(\"call\",r.peek());\n\t\t\tr.unmark(\"call\"+cd).insertBefore(openParen()).openBefore({t:6,v:\"call\"}).close();\n\t\t}\n\t\t/*\n\t\t* 1 * 2 + 3\n\t\t* mult(1,2) + 3\n\t\t* 1 + 2 * 3\n\t\t* add(1,2) * 3 => pre, so nest in last\n\t\t* add(1,2 * 3))\n\t\t* add(1,mult(2,3)) => pre, so next in last (we're in subs, so openBefore )\n\t\t */\n\t\tif(state.infix[d]) {\n\t\t\t//console.log(\"peek-close\",_strip(r.peek()));\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"close\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"close\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t == 4){\n\t\tif(v == 802 || v == 904 || v == 2005) {\n\t\t\tconst last = r.peek();\n\t\t\tconst test = last && (last.o || last.v);\n\t\t\tconst isEmpty = x => x && Triply.nextSibling(Triply.firstChild(x)) == Triply.lastChild(x);\n\t\t\tif(test && ((simpleTypes.includes(test) && isEmpty(last)) || complexTypes.includes(test) || kinds.includes(test))) {\n\t\t\t\ttpl.o = opMap[ v + 3000];\n\t\t\t\tstate.r.insertAfter(closeParen()).movePreviousSibling().insertBefore(openParen()).openBefore(tpl);\n\t\t\t\treturn state;\n\t\t\t} else if(last.t == 1 && last.v == 1) {\n\t\t\t\tconst prev = r.previous();\n\t\t\t\tconst test = prev && prev.o;\n\t\t\t\tif(test && complexTypes.includes(test)) {\n\t\t\t\t\tif(test == \"function\") {\n\t\t\t\t\t\t// convert function(*) to function((...),item()*)\n\t\t\t\t\t\tstate.r.push(seq()).open(openParen())\n\t\t\t\t\t\t\t.push({t:4,o:\"rest-params\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close().push(closeParen()).close()\n\t\t\t\t\t\t\t.push({t:4,o:\"any\"}).open(openParen()).push({t:4,o:\"item\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close();\n\t\t\t\t\t}\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(v == 505 && hasTag) {\n\t\t\t// TODO replace with tag and flag XML at depth\n\t\t\tr.pop();\n\t\t\tconst qname = state.qname;\n\t\t\tstate.qname = null;\n\t\t\tif(hasTag == 1) {\n\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\tstate.xml++;\n\t\t\t\tstate.attrs = [];\n\t\t\t} else if(hasTag == 3 || hasTag == 6) {\n\t\t\t\tr.push(closeTag(qname));//.close();\n\t\t\t}\n\t\t\tstate.infix[d]--;\n\t\t\treturn state;\n\t\t} else if(v == 1901) {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507) {\n\t\t\t\t// close tag\n\t\t\t\tif(hasTag) {\n\t\t\t\t\tconst qname = state.qname;\n\t\t\t\t\tr.pop();\n\t\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\t\tr.push(tpl);\n\t\t\t\t\tstate.attrs = [];\n\t\t\t\t}\n\t\t\t\tstate.hasTag = hasTag + 2;\n\t\t\t\treturn state;\n\t\t\t}\n\t\t} else if(v == 2600) {\n\t\t\tconst prev = r.previousSibling();\n\t\t\tif(prev && prev.t == 1 && prev.v == 3) {\n\t\t\t\tprev.v += 2000;\n\t\t\t}\n\t\t\tconst last = r.peek(1);\n\t\t\tr.pop();\n\t\t\ttpl.o = last.v;\n\t\t} else if(v == 509 && hasTag == 5) {\n\t\t\t// NOTE treat attrs as pairs\n\t\t\tstate.hasTag = hasTag + 1;\n\t\t\treturn state;\n\t\t}\n\t\tif(v == 119 || v == 2005) {\n\t\t\tif(opMap.hasOwnProperty(v)) tpl.o = opMap[v];\n\t\t\tr.push(tpl).open(openParen()).push(closeParen()).close();\n\t\t} else if(v >= 300 && v < 2000) {\n\t\t\t// NOTE always add prefix to distinguish between infix operators and equivalent functions\n\t\t\tconst last = r.peek();\n\t\t\tconst unaryOp = (v == 801 || v == 802) && (!last || !last.t || last.t == 1 || last.t == 4);\n\t\t\tconst v1 = unaryOp ? v + 900 : v;\n\t\t\ttpl.v = v1;\n\t\t\tconst mappedOp = opMap.hasOwnProperty(v1) ? opMap[v1] : \"n:\"+tpl.o;\n\t\t\ttpl.o = mappedOp;\n\t\t\tr.push(tpl);\n\t\t\tif(!state.infix[d]) state.infix[d] = 0;\n\t\t\tr.mark(d+\":\"+state.infix[d]++);\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t} else if(t == 6) {\n\t\tif(/^\\$/.test(v)) {\n\t\t\t// var\n\t\t\ttpl.v = v.replace(/^\\$/,\"\");\n\t\t\tif(/[0-9]/.test(tpl.v)) tpl.t = 8;\n\t\t\tr.push({t:10,v:\"$\",o:\"$\"}).open(openParen()).push(tpl).push(closeParen()).close();\n\t\t} else {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507 && !ws) {\n\t\t\t\tstate.qname = v;\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\treturn state;\n\t\t\t} else if(hasTag == 4) {\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\tif(!state.attrs) state.attrs = [];\n\t\t\t\tstate.attrs.push([v]);\n\t\t\t} else {\n\t\t\t\tr.push(tpl);\n\t\t\t}\n\t\t}\n\t} else if(t === 0) {\n\t\tr.push(tpl);\n\t\tif(state.infix[d]) {\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"EOS\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"EOS\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t === 17){\n\t\t// mark WS\n\t\tstate.ws = true;\n\t\tif(hasTag) state.hasTag = 4;\n\t} else {\n\t\tif(hasTag == 6) {\n\t\t\tstate.attrs.lastItem.push(v);\n\t\t\tstate.hasTag = 1;\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t}\n\tstate.depth = tpl.d;\n\treturn state;\n}", "function show() {\n return x => x + arguments[0];\n}", "function assert(count, name, test){\n if(!count || !Array.isArray(count) || count.length !== 2) {\n count = [0, '*'];\n } else {\n count[1]++;\n }\n\n var pass = 'false';\n try {\n if (test()) {\n pass = ' true';\n count[0]++;\n }\n } catch(e) {}\n console.log(' ' + (count[1] + ') ').slice(0,5) + pass + ' : ' + name);\n}", "function foo5(f) { f(1, 2, 3, 4); }", "function printer(value){\r\n return value; // => example of a function that can optionally take arguments \r\n}", "function tb(a, b) { var d, e; if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return sb(); for (d = b[0], e = 1; e < b.length; ++e) b[e].isValid() && !b[e][a](d) || (d = b[e]); return d }", "function assert(count, name, test){\n if(!count || !Array.isArray(count) || count.length !== 2) { \n count = [0, '*']; \n } else {\n count[1]++;\n }\n \n var pass = 'false';\n var errMsg = null;\n try {\n if (test()) { \n pass = ' true';\n count[0]++;\n } \n } catch(e) {\n errMsg = e;\n } \n console.log(' ' + (count[1] + ') ').slice(0,5) + pass + ' : ' + name);\n if (errMsg !== null) {\n console.log(' ' + errMsg + '\\n');\n }\n}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "function X(a){for(var b,c=[],d=/\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;b=d.exec(a);)b[1]?// a literal string inside [ ... ]\nc.push(b[1]):b[2]?// non-zero formatting inside ( ... )\nc.push({maybe:X(b[2])}):b[3]?// a formatting token\nc.push({token:b[3]}):b[5]&&// an unenclosed literal string\nc.push(b[5]);return c}", "function genTernaryExp(el){return el.once?genOnce(el):genElement(el);}", "function five(string){\n console.log(string);\n console.log(string);\n console.log(string);\n console.log(string);\n console.log(string);\n}", "prettyPrintCallback( cb ) {\n // get rid of \"function gen\" and start with parenthesis\n // const shortendCB = cb.toString().slice(9)\n const cbSplit = cb.toString().split('\\n')\n const cbTrim = cbSplit.slice( 3, -2 )\n const cbTabbed = cbTrim.map( v => ' ' + v ) \n \n return cbTabbed.join('\\n')\n }", "function\n// a\nf\n// b\n(\n// c\nx\n// d\n,\n// e\ny\n// f\n)\n// g\n{\n// h\n;\n// i\n;\n// j\n}", "function xt(t,e){return null===t||!1===t||void 0===t?S[e]:(\"number\"===typeof t&&(t=String(t)),t=i.format.from(t),t=T.toStepping(t),!1===t||isNaN(t)?S[e]:t)}", "function tF() {\n \n // 0\n let z = 0;\n let zVal = z ? 'is truthy': 'is falsey';\n console.log(`0 ${zVal} because 0 is a false value`);\n // \"zero\";\n let zS = \"zero\";\n let zSVal = zS ? 'is truthy': 'is falsey';\n console.log(`\"zero\" ${zSVal} because it is a filled string`);\n // const zero = 20;\n const zero = 20;\n let zeroVal = zero ? 'is truthy': 'is falsey';\n console.log(`20 ${zeroVal} because it is a number despite the variable name being zero`);\n // null\n let n = null;\n let nVal = n ? 'is truthy': 'is falsey';\n console.log(`null ${nVal} because it is lacks any value at all`);\n // \"0\"\n let zStrNum = \"0\";\n let zStrNumVal = zStrNum ? 'is truthy': 'is falsey';\n console.log(`\"0\" ${zStrNumVal} because it is a string that contains a character`);\n // !\"\"\n let excl = !\"\";\n let exclVal = excl? 'is truthy': 'is falsey';\n console.log(`!\"\" ${exclVal} because the \"!\" reverts the false value of the empty string to be true`);\n // {}\n let brack = {};\n let brackVal = brack? 'is truthy': 'is falsey';\n console.log(`{} ${brackVal} because JavaScript recognizes it as truthy (honestly i dont understand why it is this way, it seems it should be falsey since no value is contained)`);\n // () => {console.log(\"hello TEKcamp!\");\n let fun = () => {console.log(\"hello TEKcamp!\")};\n let funVal = fun? 'is truthy': 'is falsey';\n console.log(`() => {console.log(\"hello TEKcamp!\")} ${funVal} because the function contains contains a return (console)`);\n // 125\n let onetwofive = 125;\n let otfVal = onetwofive? 'is truthy': 'is falsey';\n console.log(`125 ${otfVal} because it is a number and numbers other than 0 are truthy`);\n // undefined\n let und = undefined;\n let undVal = und? 'is truthy': 'is falsey';\n console.log(`undefined ${undVal} because it doesnt recognize a value being assigned`);\n // \"\"\n let empt = \"\";\n let emptVal = empt? 'is truthy': 'is falsey';\n console.log(`\"\" ${emptVal} because it it is an empty string`);\n }", "function it(t, n) {\n return t + \" \" + n + (1 === t ? \"\" : \"s\");\n}", "function t$i(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "function t(e){if(e)return n(e)}", "function callString(f) {\n return '(' + f.toString() + ')()';\n}", "function n(n,t){return n?t?4:3:t?3:2}", "function parseExp5(state) {\n return lift(state)\n .then(parseExp6)\n .then(opt(alt([ parseExp5$times, parseExp5$div ])));\n}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "function foo4(f) { f(1, 2, 3); }", "function tagFunction(strings, ...values) {\n let name = values[0];\n let age = values[1];\n if (age > 80) {\n return `${strings[0]}${values[0]}`;\n }\n return `${strings[0]}${name}${strings[1]}${age}${strings[2]}`;\n}", "function test_one(x,y) {\n var sink = x;\n\n//CHECK-NEXT: %0 = BinaryOperatorInst '+', %x, 2 : number\n//CHECK-NEXT: %1 = CallInst %x, undefined : undefined, %0 : string|number\n sink(x + 2);\n\n//CHECK-NEXT: %2 = CallInst %x, undefined : undefined, 4 : number\n sink(2 + 2);\n\n//CHECK-NEXT: %3 = BinaryOperatorInst '*', %x, 2 : number\n//CHECK-NEXT: %4 = BinaryOperatorInst '*', %x, 2 : number\n//CHECK-NEXT: %5 = BinaryOperatorInst '+', %3 : number, %4 : number\n//CHECK-NEXT: %6 = CallInst %x, undefined : undefined, %5 : number\n sink(x * 2 + x * 2);\n\n//CHECK-NEXT: %7 = AsInt32Inst %x\n//CHECK-NEXT: %8 = AsInt32Inst %x\n//CHECK-NEXT: %9 = BinaryOperatorInst '+', %7 : number, %8 : number\n//CHECK-NEXT: %10 = CallInst %x, undefined : undefined, %9 : number\n sink((x|0) + (x|0));\n\n//CHECK-NEXT: %11 = CallInst %x, undefined : undefined, \"hibye\" : string\n sink(\"hi\" + \"bye\");\n\n//CHECK-NEXT: %12 = BinaryOperatorInst '+', %x, %y\n//CHECK-NEXT: %13 = CallInst %x, undefined : undefined, %12 : string|number\n sink(x + y);\n\n//CHECK-NEXT: %14 = BinaryOperatorInst '+', \"hi\" : string, %y\n//CHECK-NEXT: %15 = CallInst %x, undefined : undefined, %14 : string\n sink(\"hi\" + y);\n\n//CHECK-NEXT: %16 = CallInst %x, undefined : undefined, 0 : number\n sink(null + null);\n\n//CHECK-NEXT: %17 = AllocObjectInst 0 : number, empty\n//CHECK-NEXT: %18 = AllocObjectInst 0 : number, empty\n//CHECK-NEXT: %19 = BinaryOperatorInst '+', %17 : object, %18 : object\n//CHECK-NEXT: %20 = CallInst %x, undefined : undefined, %19 : string|number\n sink({} + {});\n\n//CHECK-NEXT: %21 = CallInst %x, undefined : undefined, NaN : number\n sink(undefined + undefined);\n//CHECK-NEXT: %22 = ReturnInst undefined : undefined\n}", "function one(a, onecb) {\n console.log(a);\n //Since it is a function\n onecb(a+1,(c,threecb)=>{\n console.log(c);\n threecb(c+1,(e)=>{\n console.log(e);\n console.log(a)\n console.log(c)\n });\n });\n}", "function TStylingTupleSummary() {}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "static fStr3(x) {\nreturn this.fStr(x, 3);\n}", "function Format() {}", "function Format() {}", "function f11(str) {\n const stack = [];\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '(') stack.push(str[i]);\n else if (str[i] === ')') stack.pop();\n }\n return !stack.length;\n}", "function testChaining(val) {\n if (val < 5) return \"Tiny\";\n else if (val < 10) return \"Small\";\n else if (val < 15) return \"Medium\";\n else if (val < 20) return \"Large\";\n else return \"Huge\";\n}", "function test (func, input, expected) { console.log(func.name, \"\\n got:\", applyMaybeCurriedArgs(func, input), \"\\n exp:\", expected) }", "function fifth() {}", "next(num, format) {\n return getOccurrences.call(this, num, format, \"next\")\n }", "function v17(v18,v19) {\n function v23(v24,v25) {\n const v26 = 13.37;\n // v26 = .float\n const v27 = 0;\n // v27 = .integer\n const v28 = 1;\n // v28 = .integer\n const v29 = 13.37;\n // v29 = .float\n const v30 = 0;\n // v30 = .integer\n const v31 = 1;\n // v31 = .integer\n }\n const v33 = [13.37,13.37,13.37,13.37];\n // v33 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v36 = [1337];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v37 = [v36,arguments,arguments,\"65535\",arguments,13.37,13.37,1337,v33,1337];\n // v37 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = v23(\"caller\",v37,...v37);\n // v40 = .unknown\n const v42 = [...v3,1337,-1.7976931348623157e+308];\n // v42 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n for (let v43 = 0; v43 < 1337; v43 = v43 + 1) {\n }\n}", "function i(e, t) {\n return e ? t ? 4 : 3 : t ? 3 : 2;\n }", "function logFive(sequence){\n\n for(var i =0;i<5;i++){\n if(!sequence.next()){\n break;\n \n }\n console.log(sequence.current());\n }\n\n}", "function TStylingTupleSummary(){}", "function TStylingTupleSummary() { }", "function be(t, n) {\n return t + \" \" + n + (1 === t ? \"\" : \"s\");\n}", "function isFive(input) {\n\n}", "function o0(o1,o2,o3)\n{\n try {\no4.o5(o39 === true + \" index:\" + o2 + \" Object:\" + o3);\n}catch(e){}\n try {\nreturn true;\n}catch(e){}\n}", "function a(n,t){0}", "function logFive(sequence) {\n for (var i = 0; i < 5; i++) {\n if (!sequence.next()) {\n break;\n } else {\n console.log(sequence.current());\n }\n }\n}", "function fourth() {}", "function f(n1,n2,n3)\n{\nif (n1>n2 && n1>n3)\n{\n \n if(n2>n3)\n {\n \t document.write(n1 +\",\"+n2 +\",\"+n3 );\n\n }\n else{\n document.write(n1+ \",\"+n3+ \",\"+n2 );\n }\n}\nelse if (n2>n1 && n2>n3)\n{\n\n if(n1>n3)\n {\n \t document.write(n2+ \",\"+n1 +\",\"+n3 );\n\n }\n else\n {\n document.write(n2 +\",\"+n3+ \",\"+n1);\n }\n \n}\nelse if (n3>n1 && n3>n2) \n{\n if(n2>n1)\n {\n \t document.write(n3 +\",\"+n2+ \",\"+n1);\n\n }\n else\n {\n document.write(n3+ \",\"+n1+ \",\"+n2);\n }\n}\n}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function n(e,t){0}", "function v19(v20,v21,v22) {\n for (let v25 = 0; v25 < 100; v25 = v25 + 3) {\n let v26 = 0;\n function v27(v28,v29,v30,v31,v32) {\n for (let v35 = v26; v35 < 100; v35 = v35 + 1100861557) {\n }\n }\n for (let v39 = 0; v39 < 100; v39 = v39 + 1) {\n const v43 = [NaN,-2987865916,\"flags\"];\n // v43 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v44 = v43.concat();\n // v44 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v45 = v27(v26,v27,v27,v26,v27);\n // v45 = .unknown\n }\n }\n}" ]
[ "0.54531336", "0.54146004", "0.5401874", "0.5301911", "0.5250483", "0.5142086", "0.51317817", "0.50911343", "0.49964577", "0.49964246", "0.4973575", "0.49658364", "0.49169186", "0.4916026", "0.4910392", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.49102533", "0.48776633", "0.4873498", "0.48734266", "0.48531207", "0.48360252", "0.48304975", "0.48275715", "0.48141962", "0.4812292", "0.4806003", "0.4800439", "0.47889534", "0.47782952", "0.47596496", "0.47596496", "0.475195", "0.47513244", "0.47512034", "0.47499305", "0.47456646", "0.47355217", "0.47355217", "0.47280613", "0.47280613", "0.47237694", "0.47153744", "0.47103298", "0.4692744", "0.46897343", "0.468762", "0.46778357", "0.46775275", "0.46698785", "0.46632603", "0.4654789", "0.46470693", "0.46429345", "0.46421435", "0.46365908", "0.46362975", "0.46358943", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46302965", "0.46181583" ]
0.0
-1
supports only 2.0style add(1, 's') or add(duration)
function add$1 (input, value) { return addSubtract$1(this, input, value, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Duration(time) {\n var d = document.createElement('span');\n d.classList.add('duration');\n d.innerText = time;\n return d;\n}", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function addTwoSeconds(time){\n // Transform time to milliseconds\n var timeInMilliseconds = formattedTimeToMilliseconds(time);\n if (timeInMilliseconds == 0 || isNaN(timeInMilliseconds)){\n return 'ERROR';\n }\n // Add 2000 milliseconds\n var twoSecondsAdded = timeInMilliseconds + 2000;\n // Transform time to formatted time\n return millisecondsToFullTime(twoSecondsAdded);\n}", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "handleDurationChange() {\n this.setState({taskDuration: this.state.taskDuration.add(1, 's')});\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "setDuration(dur) {\nreturn this.duration = dur;\n}", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function formatDuration(duration) {\n if (duration < 1000) {\n duration += 'ms';\n } else if (duration > 1000) {\n duration /= 1000;\n duration += 's';\n }\n return duration;\n}", "parseDurationProp(newValue) {\n this.innerDuration = newValue ? newValue : \"2000ms\";\n }", "function add() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n if (minutes >= 60) {\n minutes = 0;\n hours++;\n }\n }\n h2.textContent = (hours ? (hours > 9 ? hours : \"0\" + hours) : \"00\") + \":\" + (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") + \":\" + (seconds > 9 ? seconds : \"0\" + seconds);\n timer();\n}", "addAttoseconds(value, createNew) {\n return this.addFractionsOfSecond(value, createNew, '_attosecond', '_femtosecond', 'addFemtoseconds');\n }", "function add(a,b) {\n\treturn a + b + new Date().getSeconds();\n}", "function add() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n if (minutes >= 60) {\n minutes = 0;\n }\n }\n timer.textContent = (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") +\n \":\" + (seconds > 9 ? seconds : \"0\" + seconds);\n startTimer();\n}", "function duration(s) {\n if (typeof(s) == 'number') return s;\n var units = {\n days: { rx:/(\\d+)\\s*d/, mul:86400 },\n hours: { rx:/(\\d+)\\s*h/, mul:3600 },\n minutes: { rx:/(\\d+)\\s*m/, mul:60 },\n seconds: { rx:/(\\d+)\\s*s/, mul:1 }\n };\n var result = 0, unit, match;\n if (typeof(s) == 'string') for (var key in units) {\n unit = units[key];\n match = s.match(unit.rx);\n if (match) result += parseInt(match[1])*unit.mul;\n }\n return result*1000;\n}", "function addOneSec() {\n sec += 1;\n updateTimer();\n waitOneSec();\n}", "function duration_ms(durations) {\n\n durations = durations.toString();\n durations = durations.replace(/ms/g, \"\");\n\n // result\n var duration = 0;\n var ms;\n\n // Is multi durations?\n if (durations.indexOf(\",\") != -1) {\n\n var durationsArray = durations.split(\",\");\n\n for (var i = 0; i < durationsArray.length; i++) {\n\n var val = durationsArray[i];\n\n // Has dot?\n if (val.indexOf(\".\") != -1) {\n\n ms = parseFloat(val).toString().split(\".\")[1].length;\n val = val.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n val = val.replace(/s/g, \"0\");\n } else if (ms == 1) {\n val = val.replace(/s/g, \"00\");\n }\n\n } else {\n val = val.replace(/s/g, \"000\");\n }\n\n duration = parseFloat(duration) + parseFloat(val);\n\n }\n\n return duration;\n\n } else {\n\n // Has dot?\n if (durations.indexOf(\".\") != -1) {\n\n ms = parseFloat(durations).toString().split(\".\")[1].length;\n durations = durations.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n durations = durations.replace(/s/g, \"0\");\n } else if (ms == 1) {\n durations = durations.replace(/s/g, \"00\");\n }\n\n } else {\n durations = durations.replace(/s/g, \"000\");\n }\n\n return durations;\n\n }\n\n }", "function timeAdd(element, start,stop){\n if(typeof(start)!=='number' && typeof(stop)!=='number' || start === stop){\n return;\n }\n start++;\n element.text(start);\n setTimeout(function(){timeAdd(element, start,stop);}, 25);\n}", "function parseDuration(duration) {\n if (!duration) {\n return {second: 1};\n } else if (typeof(duration) == \"string\") {\n var start = 0;\n var isReciprocal = false;\n if (duration.charAt(0) == \"/\") {\n isReciprocal = true;\n start = 1;\n }\n function complete(value) {\n if (isReciprocal)\n value.reciprocal = true;\n return value;\n }\n var type = duration.charAt(duration.length - 1);\n if (/\\d/.test(type)) {\n return complete({milli: Number(type)});\n } else {\n var count;\n if (start == duration.length - 1) {\n count = 1;\n } else {\n count = Number(duration.slice(start, duration.length - 1));\n }\n switch (type) {\n case \"s\":\n return complete({second: count});\n case \"m\":\n return complete({minute: count});\n case \"h\":\n return complete({hour: count});\n default:\n throw new Error(\"Couldn't parse duration \" + duration);\n }\n }\n } else {\n return duration;\n }\n }", "function Seconds() {\r\n}", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "addTime(s){\n if (timer.minutes === 59 && (timer.secondes + s) >= 60){\n timer.hours++\n timer.minutes = 0\n timer.secondes = (timer.secondes + s) - 60\n } else if (timer.secondes + s >= 60){\n timer.minutes++\n timer.secondes = (timer.secondes + s) - 60 \n } else {\n timer.secondes = timer.secondes + s\n }\n }", "set time(value) {}" ]
[ "0.6432664", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.61080503", "0.60846037", "0.6060423", "0.6014779", "0.6014779", "0.60114676", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.5894277", "0.58879846", "0.58879846", "0.5886838", "0.5845349", "0.5845349", "0.5845349", "0.58169544", "0.57882875", "0.57668084", "0.5761387", "0.57315755", "0.5718313", "0.56508136", "0.564018", "0.56239116", "0.5618132", "0.5608143", "0.5591232", "0.5590047", "0.5559835", "0.54518354" ]
0.0
-1
supports only 2.0style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) { return addSubtract$1(this, input, value, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, -1);\r\n }", "function duration_add_subtract__subtract (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, -1);\r\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__subtract(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\r\n return duration_add_subtract__addSubtract(this, input, value, 1);\r\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }" ]
[ "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.74000996", "0.7380024", "0.7363161", "0.7363161", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.72736114", "0.7267859", "0.7267859", "0.7232886", "0.7232886", "0.7232886", "0.66826415", "0.66826415", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.66760856", "0.6612526", "0.66118926", "0.66118926", "0.6588727", "0.6588727" ]
0.0
-1
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function formatHuman(value) {\n var time = moment(value).fromNow();\n time = time === 'a few seconds ago' ? 'seconds ago' : time;\n return time;\n }", "labelFunction(date) {\n return moment(date).fromNow();\n }", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function humanizeDuration(duration) {\n const months = duration.months();\n const weeks = duration.weeks();\n let days = duration.days();\n const hours = duration.hours();\n const minutes = duration.minutes();\n const seconds = duration.seconds();\n\n // console.log(duration);\n\n const str = [];\n\n if (weeks > 0) {\n const weekTitle = pluralize('week', weeks);\n str.push(`${weeks} ${weekTitle}`);\n }\n\n if (days > 0) {\n if (weeks > 0) days -= 7 * weeks;\n\n const dayTitle = pluralize('day', days);\n str.push(`${days} ${dayTitle}`);\n }\n\n if (hours > 0 && (weeks < 1 && days < 2)) {\n const hourTitle = pluralize('hour', hours);\n str.push(`${hours} ${hourTitle}`);\n }\n\n if (minutes > 0 && (weeks < 1 && days < 1)) {\n const minuteTitle = pluralize('minute', minutes);\n str.push(`${minutes} ${minuteTitle}`);\n }\n\n if (seconds > 0 && (weeks < 1 && hours < 1)) {\n const secondTitle = pluralize('second', seconds);\n str.push(`${seconds} ${secondTitle}`);\n }\n\n return str.join(' ');\n}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "function T(a,b,c,d,e){var f;// works with moment-pre-2.8\n// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\"\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n// or non-zero areas in Moment's localized format strings.\nreturn a=Ia.moment.parseZone(a),b=Ia.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||\" - \",U(a,b,W(c),d,e)}// expose", "dateForHumans(item) {\n if (!item.date) return \"\";\n let startDate = DateTime.fromISO(item.date).toFormat(\"d LLLL yyyy\");\n if (!item.time && !item.enddate) return startDate;\n if (item.time) return `${startDate} at ${item.time}`;\n if (!item.enddate) return startDate;\n\n let endDate = DateTime.fromISO(item.enddate).toFormat(\"d LLLL yyyy\");\n return `${startDate} to ${endDate}`;\n }", "function humanizeStr(nd, s, en, o) {\n var r = Math.round,\n dir = en ? ' ago' : '前',\n pl = function(v, n) {\n return (s === undefined) ? n + (en ? ' ' : '') + v + (n > 1 && en ? 's' : '') + dir : n + v.substring(0, 1)\n },\n ts = Date.now() - new Date(nd).getTime(),\n ii;\n if( ts < 0 )\n {\n ts *= -1;\n dir = en ? ' from now' : '後';\n }\n for (var i in o) {\n if (r(ts) < o[i]) return pl(ii || 'm', r(ts / (o[ii] || 1)))\n ii = i;\n }\n return pl(i, r(ts / o[i]));\n}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function oldMomentFormat(mom,formatStr){return oldMomentProto.format.call(mom,formatStr);// oldMomentProto defined in moment-ext.js\n}", "function relativeTimeWithPlural(number,withoutSuffix,key){var format={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},separator=\" \";return(number%100>=20||number>=100&&number%100===0)&&(separator=\" de \"),number+separator+format[key]}", "function humanizeDate(date) {\n return moment(date).format('lll');\n}", "fromNow(date /* , locale*/) {\n if (typeof date !== 'object') date = new Date(date);\n return moment(date).fromNow();\n }", "changeTimeFormatByTime(time) {\n if(time > moment().subtract(1, 'minutes')) {\n return time.startOf('second').fromNow();\n } else if(time > moment().subtract(1, 'hours')) {\n return time.startOf('minute').fromNow();\n } else if(time > moment().subtract(1, 'days')) {\n return time.format('h:mm:ss a');\n } else if(time > moment().subtract(1, 'years')) {\n return time.format(\"MMM Do\");\n } else {\n return time.format(\"MMM Do YYYY\");\n }\n }", "createdAgo(date) { return moment(date).fromNow() }", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number || 1,!!withoutSuffix,string,isFuture);}", "function relativeTimeWithMutation(number,withoutSuffix,key){var format={'mm':'munutenn','MM':'miz','dd':'devezh'};return number + ' ' + mutation(format[key],number);}", "function relativeTimeWithPlural$2(number,withoutSuffix,key){var format={'ss':'secunde','mm':'minute','hh':'ore','dd':'zile','MM':'luni','yy':'ani'},separator=' ';if(number % 100 >= 20 || number >= 100 && number % 100 === 0){separator = ' de ';}return number + separator + format[key];}", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n\t var result = number + ' ';\n\t switch (key) {\n\t case 's':\n\t return withoutSuffix || isFuture\n\t ? 'nekaj sekund'\n\t : 'nekaj sekundami';\n\t case 'ss':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'sekundo' : 'sekundi';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n\t } else {\n\t result += 'sekund';\n\t }\n\t return result;\n\t case 'm':\n\t return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\t case 'mm':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'minuta' : 'minuto';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n\t }\n\t return result;\n\t case 'h':\n\t return withoutSuffix ? 'ena ura' : 'eno uro';\n\t case 'hh':\n\t if (number === 1) {\n\t result += withoutSuffix ? 'ura' : 'uro';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'uri' : 'urama';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'ure' : 'urami';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'ur' : 'urami';\n\t }\n\t return result;\n\t case 'd':\n\t return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\t case 'dd':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n\t }\n\t return result;\n\t case 'M':\n\t return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\t case 'MM':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n\t }\n\t return result;\n\t case 'y':\n\t return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\t case 'yy':\n\t if (number === 1) {\n\t result += withoutSuffix || isFuture ? 'leto' : 'letom';\n\t } else if (number === 2) {\n\t result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n\t } else if (number < 5) {\n\t result += withoutSuffix || isFuture ? 'leta' : 'leti';\n\t } else {\n\t result += withoutSuffix || isFuture ? 'let' : 'leti';\n\t }\n\t return result;\n\t }\n\t }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ?\n 'nekaj sekund' :\n 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;}\n\n }", "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentMilliseconds = m.milliseconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return meridiem ? meridiem(currentHours, currentMinutes, false) : (currentHours > 11 ? 'pm' : 'am');\n case 'A' :\n return meridiem ? meridiem(currentHours, currentMinutes, true) : (currentHours > 11 ? 'PM' : 'AM');\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // MILLISECONDS\n case 'S' :\n return ~~ (currentMilliseconds / 100);\n case 'SS' :\n return leftZeroFill(~~(currentMilliseconds / 10), 2);\n case 'SSS' :\n return leftZeroFill(currentMilliseconds, 3);\n // TIMEZONE\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(formattingTokens, replaceFunction);\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return withoutSuffix?format[key][0]:format[key][1]}", "function toAgo(time){\n var strings = {\n suffixAgo: \"ago\",\n suffixFromNow: \"from now\",\n seconds: \"less than a minute\",\n minute: \"about a minute\",\n minutes: \"%d minutes\",\n hour: \"about an hour\",\n hours: \"about %d hours\",\n day: \"a day\",\n days: \"%d days\",\n month: \"about a month\",\n months: \"%d months\",\n year: \"about a year\",\n years: \"%d years\"\n };\n var $l = strings;\n var prefix = $l.prefixAgo;\n var suffix = $l.suffixAgo;\n\n var distanceMillis = new Date().getTime() - time;\n\n var seconds = distanceMillis / 1000;\n var minutes = seconds / 60;\n var hours = minutes / 60;\n var days = hours / 24;\n var years = days / 365;\n\n function substitute(string, number) {\n var value = ($l.numbers && $l.numbers[number]) || number;\n return string.replace(/%d/i, value);\n }\n\n var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||\n seconds < 90 && substitute($l.minute, 1) ||\n minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||\n minutes < 90 && substitute($l.hour, 1) ||\n hours < 24 && substitute($l.hours, Math.round(hours)) ||\n hours < 48 && substitute($l.day, 1) ||\n days < 30 && substitute($l.days, Math.floor(days)) ||\n days < 60 && substitute($l.month, 1) ||\n days < 365 && substitute($l.months, Math.floor(days / 30)) ||\n years < 2 && substitute($l.year, 1) ||\n substitute($l.years, Math.floor(years));\n\n return [prefix, words, suffix].join(\" \").trim();\n}", "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "function durationFormat() {\n\n var args = [].slice.call(arguments);\n var settings = extend({}, this.format.defaults);\n\n // Keep a shadow copy of this moment for calculating remainders.\n // Perform all calculations on positive duration value, handle negative\n // sign at the very end.\n var asMilliseconds = this.asMilliseconds();\n var asMonths = this.asMonths();\n\n // Treat invalid durations as having a value of 0 milliseconds.\n if (typeof this.isValid === \"function\" && this.isValid() === false) {\n asMilliseconds = 0;\n asMonths = 0;\n }\n\n var isNegative = asMilliseconds < 0;\n\n // Two shadow copies are needed because of the way moment.js handles\n // duration arithmetic for years/months and for weeks/days/hours/minutes/seconds.\n var remainder = moment.duration(Math.abs(asMilliseconds), \"milliseconds\");\n var remainderMonths = moment.duration(Math.abs(asMonths), \"months\");\n\n // Parse arguments.\n each(args, function (arg) {\n if (typeof arg === \"string\" || typeof arg === \"function\") {\n settings.template = arg;\n return;\n }\n\n if (typeof arg === \"number\") {\n settings.precision = arg;\n return;\n }\n\n if (isObject(arg)) {\n extend(settings, arg);\n }\n });\n\n var momentTokens = {\n years: \"y\",\n months: \"M\",\n weeks: \"w\",\n days: \"d\",\n hours: \"h\",\n minutes: \"m\",\n seconds: \"s\",\n milliseconds: \"S\"\n };\n\n var tokenDefs = {\n escape: /\\[(.+?)\\]/,\n years: /\\*?[Yy]+/,\n months: /\\*?M+/,\n weeks: /\\*?[Ww]+/,\n days: /\\*?[Dd]+/,\n hours: /\\*?[Hh]+/,\n minutes: /\\*?m+/,\n seconds: /\\*?s+/,\n milliseconds: /\\*?S+/,\n general: /.+?/\n };\n\n // Types array is available in the template function.\n settings.types = types;\n\n var typeMap = function (token) {\n return find(types, function (type) {\n return tokenDefs[type].test(token);\n });\n };\n\n var tokenizer = new RegExp(map(types, function (type) {\n return tokenDefs[type].source;\n }).join(\"|\"), \"g\");\n\n // Current duration object is available in the template function.\n settings.duration = this;\n\n // Eval template function and cache template string.\n var template = typeof settings.template === \"function\" ? settings.template.apply(settings) : settings.template;\n\n // outputTypes and returnMomentTypes are settings to support durationsFormat().\n\n // outputTypes is an array of moment token types that determines\n // the tokens returned in formatted output. This option overrides\n // trim, largest, stopTrim, etc.\n var outputTypes = settings.outputTypes;\n\n // returnMomentTypes is a boolean that sets durationFormat to return\n // the processed momentTypes instead of formatted output.\n var returnMomentTypes = settings.returnMomentTypes;\n\n var largest = settings.largest;\n\n // Setup stopTrim array of token types.\n var stopTrim = [];\n\n if (!outputTypes) {\n if (isArray(settings.stopTrim)) {\n settings.stopTrim = settings.stopTrim.join(\"\");\n }\n\n // Parse stopTrim string to create token types array.\n if (settings.stopTrim) {\n each(settings.stopTrim.match(tokenizer), function (token) {\n var type = typeMap(token);\n\n if (type === \"escape\" || type === \"general\") {\n return;\n }\n\n stopTrim.push(type);\n });\n }\n }\n\n // Cache moment's locale data.\n var localeData = moment.localeData();\n\n if (!localeData) {\n localeData = {};\n }\n\n // Fall back to this plugin's `eng` extension.\n each(keys(engLocale), function (key) {\n if (typeof engLocale[key] === \"function\") {\n if (!localeData[key]) {\n localeData[key] = engLocale[key];\n }\n\n return;\n }\n\n if (!localeData[\"_\" + key]) {\n localeData[\"_\" + key] = engLocale[key];\n }\n });\n\n // Replace Duration Time Template strings.\n // For locale `eng`: `_HMS_`, `_HM_`, and `_MS_`.\n each(keys(localeData._durationTimeTemplates), function (item) {\n template = template.replace(\"_\" + item + \"_\", localeData._durationTimeTemplates[item]);\n });\n\n // Determine user's locale.\n var userLocale = settings.userLocale || moment.locale();\n\n var useLeftUnits = settings.useLeftUnits;\n var usePlural = settings.usePlural;\n var precision = settings.precision;\n var forceLength = settings.forceLength;\n var useGrouping = settings.useGrouping;\n var trunc = settings.trunc;\n\n // Use significant digits only when precision is greater than 0.\n var useSignificantDigits = settings.useSignificantDigits && precision > 0;\n var significantDigits = useSignificantDigits ? settings.precision : 0;\n var significantDigitsCache = significantDigits;\n\n var minValue = settings.minValue;\n var isMinValue = false;\n\n var maxValue = settings.maxValue;\n var isMaxValue = false;\n\n // formatNumber fallback options.\n var useToLocaleString = settings.useToLocaleString;\n var groupingSeparator = settings.groupingSeparator;\n var decimalSeparator = settings.decimalSeparator;\n var grouping = settings.grouping;\n\n useToLocaleString = useToLocaleString && (toLocaleStringWorks || intlNumberFormatWorks);\n\n // Trim options.\n var trim = settings.trim;\n\n if (isArray(trim)) {\n trim = trim.join(\" \");\n }\n\n if (trim === null && (largest || maxValue || useSignificantDigits)) {\n trim = \"all\";\n }\n\n if (trim === null || trim === true || trim === \"left\" || trim === \"right\") {\n trim = \"large\";\n }\n\n if (trim === false) {\n trim = \"\";\n }\n\n var trimIncludes = function (item) {\n return item.test(trim);\n };\n\n var rLarge = /large/;\n var rSmall = /small/;\n var rBoth = /both/;\n var rMid = /mid/;\n var rAll = /^all|[^sm]all/;\n var rFinal = /final/;\n\n var trimLarge = largest > 0 || any([rLarge, rBoth, rAll], trimIncludes);\n var trimSmall = any([rSmall, rBoth, rAll], trimIncludes);\n var trimMid = any([rMid, rAll], trimIncludes);\n var trimFinal = any([rFinal, rAll], trimIncludes);\n\n // Parse format string to create raw tokens array.\n var rawTokens = map(template.match(tokenizer), function (token, index) {\n var type = typeMap(token);\n\n if (token.slice(0, 1) === \"*\") {\n token = token.slice(1);\n\n if (type !== \"escape\" && type !== \"general\") {\n stopTrim.push(type);\n }\n }\n\n return {\n index: index,\n length: token.length,\n text: \"\",\n\n // Replace escaped tokens with the non-escaped token text.\n token: (type === \"escape\" ? token.replace(tokenDefs.escape, \"$1\") : token),\n\n // Ignore type on non-moment tokens.\n type: ((type === \"escape\" || type === \"general\") ? null : type)\n };\n });\n\n // Associate text tokens with moment tokens.\n var currentToken = {\n index: 0,\n length: 0,\n token: \"\",\n text: \"\",\n type: null\n };\n\n var tokens = [];\n\n if (useLeftUnits) {\n rawTokens.reverse();\n }\n\n each(rawTokens, function (token) {\n if (token.type) {\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n currentToken = token;\n\n return;\n }\n\n if (useLeftUnits) {\n currentToken.text = token.token + currentToken.text;\n } else {\n currentToken.text += token.token;\n }\n });\n\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n if (useLeftUnits) {\n tokens.reverse();\n }\n\n // Find unique moment token types in the template in order of\n // descending magnitude.\n var momentTypes = intersection(types, unique(compact(pluck(tokens, \"type\"))));\n\n // Exit early if there are no moment token types.\n if (!momentTypes.length) {\n return pluck(tokens, \"text\").join(\"\");\n }\n\n // Calculate values for each moment type in the template.\n // For processing the settings, values are associated with moment types.\n // Values will be assigned to tokens at the last step in order to\n // assume nothing about frequency or order of tokens in the template.\n momentTypes = map(momentTypes, function (momentType, index) {\n // Is this the least-magnitude moment token found?\n var isSmallest = ((index + 1) === momentTypes.length);\n\n // Is this the greatest-magnitude moment token found?\n var isLargest = (!index);\n\n // Get the raw value in the current units.\n var rawValue;\n\n if (momentType === \"years\" || momentType === \"months\") {\n rawValue = remainderMonths.as(momentType);\n } else {\n rawValue = remainder.as(momentType);\n }\n\n var wholeValue = Math.floor(rawValue);\n var decimalValue = rawValue - wholeValue;\n\n var token = find(tokens, function (token) {\n return momentType === token.type;\n });\n\n if (isLargest && maxValue && rawValue > maxValue) {\n isMaxValue = true;\n }\n\n if (isSmallest && minValue && Math.abs(settings.duration.as(momentType)) < minValue) {\n isMinValue = true;\n }\n\n // Note the length of the largest-magnitude moment token:\n // if it is greater than one and forceLength is not set,\n // then default forceLength to `true`.\n //\n // Rationale is this: If the template is \"h:mm:ss\" and the\n // moment value is 5 minutes, the user-friendly output is\n // \"5:00\", not \"05:00\". We shouldn't pad the `minutes` token\n // even though it has length of two if the template is \"h:mm:ss\";\n //\n // If the minutes output should always include the leading zero\n // even when the hour is trimmed then set `{ forceLength: true }`\n // to output \"05:00\". If the template is \"hh:mm:ss\", the user\n // clearly wanted everything padded so we should output \"05:00\";\n //\n // If the user wants the full padded output, they can use\n // template \"hh:mm:ss\" and set `{ trim: false }` to output\n // \"00:05:00\".\n if (isLargest && forceLength === null && token.length > 1) {\n forceLength = true;\n }\n\n // Update remainder.\n remainder.subtract(wholeValue, momentType);\n remainderMonths.subtract(wholeValue, momentType);\n\n return {\n rawValue: rawValue,\n wholeValue: wholeValue,\n // Decimal value is only retained for the least-magnitude\n // moment type in the format template.\n decimalValue: isSmallest ? decimalValue : 0,\n isSmallest: isSmallest,\n isLargest: isLargest,\n type: momentType,\n // Tokens can appear multiple times in a template string,\n // but all instances must share the same length.\n tokenLength: token.length\n };\n });\n\n var truncMethod = trunc ? Math.floor : Math.round;\n var truncate = function (value, places) {\n var factor = Math.pow(10, places);\n return truncMethod(value * factor) / factor;\n };\n\n var foundFirst = false;\n var bubbled = false;\n\n var formatValue = function (momentType, index) {\n var formatOptions = {\n useGrouping: useGrouping,\n groupingSeparator: groupingSeparator,\n decimalSeparator: decimalSeparator,\n grouping: grouping,\n useToLocaleString: useToLocaleString\n };\n\n if (useSignificantDigits) {\n if (significantDigits <= 0) {\n momentType.rawValue = 0;\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n } else {\n formatOptions.maximumSignificantDigits = significantDigits;\n momentType.significantDigits = significantDigits;\n }\n }\n\n if (isMaxValue && !bubbled) {\n if (momentType.isLargest) {\n momentType.wholeValue = maxValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (isMinValue && !bubbled) {\n if (momentType.isSmallest) {\n momentType.wholeValue = minValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (momentType.isSmallest || momentType.significantDigits && momentType.significantDigits - momentType.wholeValue.toString().length <= 0) {\n // Apply precision to least significant token value.\n if (precision < 0) {\n momentType.value = truncate(momentType.wholeValue, precision);\n } else if (precision === 0) {\n momentType.value = truncMethod(momentType.wholeValue + momentType.decimalValue);\n } else { // precision > 0\n if (useSignificantDigits) {\n if (trunc) {\n momentType.value = truncate(momentType.rawValue, significantDigits - momentType.wholeValue.toString().length);\n } else {\n momentType.value = momentType.rawValue;\n }\n\n if (momentType.wholeValue) {\n significantDigits -= momentType.wholeValue.toString().length;\n }\n } else {\n formatOptions.fractionDigits = precision;\n\n if (trunc) {\n momentType.value = momentType.wholeValue + truncate(momentType.decimalValue, precision);\n } else {\n momentType.value = momentType.wholeValue + momentType.decimalValue;\n }\n }\n }\n } else {\n if (useSignificantDigits && momentType.wholeValue) {\n // Outer Math.round required here to handle floating point errors.\n momentType.value = Math.round(truncate(momentType.wholeValue, momentType.significantDigits - momentType.wholeValue.toString().length));\n\n significantDigits -= momentType.wholeValue.toString().length;\n } else {\n momentType.value = momentType.wholeValue;\n }\n }\n\n if (momentType.tokenLength > 1 && (forceLength || foundFirst)) {\n formatOptions.minimumIntegerDigits = momentType.tokenLength;\n\n if (bubbled && formatOptions.maximumSignificantDigits < momentType.tokenLength) {\n delete formatOptions.maximumSignificantDigits;\n }\n }\n\n if (!foundFirst && (momentType.value > 0 || trim === \"\" /* trim: false */ || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n foundFirst = true;\n }\n\n momentType.formattedValue = formatNumber(momentType.value, formatOptions, userLocale);\n\n formatOptions.useGrouping = false;\n formatOptions.decimalSeparator = \".\";\n momentType.formattedValueEn = formatNumber(momentType.value, formatOptions, \"en\");\n\n if (momentType.tokenLength === 2 && momentType.type === \"milliseconds\") {\n momentType.formattedValueMS = formatNumber(momentType.value, {\n minimumIntegerDigits: 3,\n useGrouping: false\n }, \"en\").slice(0, 2);\n }\n\n return momentType;\n };\n\n // Calculate formatted values.\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n\n // Bubble rounded values.\n if (momentTypes.length > 1) {\n var findType = function (type) {\n return find(momentTypes, function (momentType) {\n return momentType.type === type;\n });\n };\n\n var bubbleTypes = function (bubble) {\n var bubbleMomentType = findType(bubble.type);\n\n if (!bubbleMomentType) {\n return;\n }\n\n each(bubble.targets, function (target) {\n var targetMomentType = findType(target.type);\n\n if (!targetMomentType) {\n return;\n }\n\n if (parseInt(bubbleMomentType.formattedValueEn, 10) === target.value) {\n bubbleMomentType.rawValue = 0;\n bubbleMomentType.wholeValue = 0;\n bubbleMomentType.decimalValue = 0;\n targetMomentType.rawValue += 1;\n targetMomentType.wholeValue += 1;\n targetMomentType.decimalValue = 0;\n targetMomentType.formattedValueEn = targetMomentType.wholeValue.toString();\n bubbled = true;\n }\n });\n };\n\n each(bubbles, bubbleTypes);\n }\n\n // Recalculate formatted values.\n if (bubbled) {\n foundFirst = false;\n significantDigits = significantDigitsCache;\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n }\n\n if (outputTypes && !(isMaxValue && !settings.trim)) {\n momentTypes = map(momentTypes, function (momentType) {\n if (find(outputTypes, function (outputType) {\n return momentType.type === outputType;\n })) {\n return momentType;\n }\n\n return null;\n });\n\n momentTypes = compact(momentTypes);\n } else {\n // Trim Large.\n if (trimLarge) {\n momentTypes = rest(momentTypes, function (momentType) {\n // Stop trimming on:\n // - the smallest moment type\n // - a type marked for stopTrim\n // - a type that has a whole value\n return !momentType.isSmallest && !momentType.wholeValue && !find(stopTrim, momentType.type);\n });\n }\n\n // Largest.\n if (largest && momentTypes.length) {\n momentTypes = momentTypes.slice(0, largest);\n }\n\n // Trim Small.\n if (trimSmall && momentTypes.length > 1) {\n momentTypes = initial(momentTypes, function (momentType) {\n // Stop trimming on:\n // - a type marked for stopTrim\n // - a type that has a whole value\n // - the largest momentType\n return !momentType.wholeValue && !find(stopTrim, momentType.type) && !momentType.isLargest;\n });\n }\n\n // Trim Mid.\n if (trimMid) {\n momentTypes = map(momentTypes, function (momentType, index) {\n if (index > 0 && index < momentTypes.length - 1 && !momentType.wholeValue) {\n return null;\n }\n\n return momentType;\n });\n\n momentTypes = compact(momentTypes);\n }\n\n // Trim Final.\n if (trimFinal && momentTypes.length === 1 && !momentTypes[0].wholeValue && !(!trunc && momentTypes[0].isSmallest && momentTypes[0].rawValue < minValue)) {\n momentTypes = [];\n }\n }\n\n if (returnMomentTypes) {\n return momentTypes;\n }\n\n // Localize and pluralize unit labels.\n each(tokens, function (token) {\n var key = momentTokens[token.type];\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!key || !momentType) {\n return;\n }\n\n var values = momentType.formattedValueEn.split(\".\");\n\n values[0] = parseInt(values[0], 10);\n\n if (values[1]) {\n values[1] = parseFloat(\"0.\" + values[1], 10);\n } else {\n values[1] = null;\n }\n\n var pluralKey = localeData.durationPluralKey(key, values[0], values[1]);\n\n var labels = durationGetLabels(key, localeData);\n\n var autoLocalized = false;\n\n var pluralizedLabels = {};\n\n // Auto-Localized unit labels.\n each(localeData._durationLabelTypes, function (labelType) {\n var label = find(labels, function (label) {\n return label.type === labelType.type && label.key === pluralKey;\n });\n\n if (label) {\n pluralizedLabels[label.type] = label.label;\n\n if (stringIncludes(token.text, labelType.string)) {\n token.text = token.text.replace(labelType.string, label.label);\n autoLocalized = true;\n }\n }\n });\n\n // Auto-pluralized unit labels.\n if (usePlural && !autoLocalized) {\n labels.sort(durationLabelCompare);\n\n each(labels, function (label) {\n if (pluralizedLabels[label.type] === label.label) {\n if (stringIncludes(token.text, label.label)) {\n // Stop checking this token if its label is already\n // correctly pluralized.\n return false;\n }\n\n // Skip this label if it is correct, but not present in\n // the token's text.\n return;\n }\n\n if (stringIncludes(token.text, label.label)) {\n // Replece this token's label and stop checking.\n token.text = token.text.replace(label.label, pluralizedLabels[label.type]);\n return false;\n }\n });\n }\n });\n\n // Build ouptut.\n tokens = map(tokens, function (token) {\n if (!token.type) {\n return token.text;\n }\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!momentType) {\n return \"\";\n }\n\n var out = \"\";\n\n if (useLeftUnits) {\n out += token.text;\n }\n\n if (isNegative && isMaxValue || !isNegative && isMinValue) {\n out += \"< \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && isMinValue || !isNegative && isMaxValue) {\n out += \"> \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && (momentType.value > 0 || trim === \"\" || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n out += \"-\";\n isNegative = false;\n }\n\n if (token.type === \"milliseconds\" && momentType.formattedValueMS) {\n out += momentType.formattedValueMS;\n } else {\n out += momentType.formattedValue;\n }\n\n if (!useLeftUnits) {\n out += token.text;\n }\n\n return out;\n });\n\n // Trim leading and trailing comma, space, colon, and dot.\n return tokens.join(\"\").replace(/(,| |:|\\.)*$/, \"\").replace(/^(,| |:|\\.)*/, \"\");\n }", "function millisecondsToStr(a){\"use strict\";function b(a){return a>1?\"s ago\":\" ago\"}var c=Math.floor(a/1e3),d=Math.floor(c/31536e3);if(d)return d+\" year\"+b(d);var e=Math.floor((c%=31536e3)/2592e3);if(e)return e+\" month\"+b(e);var f=Math.floor((c%=2592e3)/86400);if(f)return f+\" day\"+b(f);var g=Math.floor((c%=86400)/3600);if(g)return\"about \"+g+\" hour\"+b(g);var h=Math.floor((c%=3600)/60);if(h)return h+\" minute\"+b(h);var i=c%60;return i?i+\" second\"+b(i):\"just now\"}", "function processRelativeTime$5(number,withoutSuffix,key,isFuture){var format={'m':['eng Minutt','enger Minutt'],'h':['eng Stonn','enger Stonn'],'d':['een Dag','engem Dag'],'M':['ee Mount','engem Mount'],'y':['ee Joer','engem Joer']};return withoutSuffix?format[key][0]:format[key][1];}", "function relativeTimeWithMutation(number,withoutSuffix,key){var format={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return number+\" \"+mutation(format[key],number)}", "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],ss:[number+\"sekundi\",number+\"sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[number+\" minuti\",number+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[number+\" tunni\",number+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[number+\" kuu\",number+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[number+\" aasta\",number+\" aastat\"]};return withoutSuffix?format[key][2]?format[key][2]:format[key][1]:isFuture?format[key][0]:format[key][1]}", "function processRelativeTime$6(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += withoutSuffix || isFuture ? 'sekund' : 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "function humanizer(passedOptions) {\n\n var result = function humanizer(ms, humanizerOptions) {\n var options = extend({}, result, humanizerOptions || {});\n return doHumanization(ms, options);\n };\n\n return extend(result, {\n language: \"en\",\n delimiter: \", \",\n spacer: \" \",\n units: [\"year\", \"month\", \"week\", \"day\", \"hour\", \"minute\", \"second\"],\n languages: {},\n halfUnit: true,\n round: false\n }, passedOptions);\n\n }", "function momentify(value, options) {\n\t\tvar parser = options.parser;\n\t\tvar format = options.parser || options.format;\n\n\t\tif (typeof parser === 'function') {\n\t\t\treturn parser(value);\n\t\t}\n\n\t\tif (typeof value === 'string' && typeof format === 'string') {\n\t\t\treturn moment(value, format);\n\t\t}\n\n\t\tif (!(value instanceof moment)) {\n\t\t\tvalue = moment(value);\n\t\t}\n\n\t\tif (value.isValid()) {\n\t\t\treturn value;\n\t\t}\n\n\t\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t\t// The user might still use the deprecated `format` option to convert his inputs.\n\t\tif (typeof format === 'function') {\n\t\t\treturn format(value);\n\t\t}\n\n\t\treturn value;\n\t}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}" ]
[ "0.6559981", "0.6559981", "0.6559981", "0.6559981", "0.6475563", "0.63821334", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.63278216", "0.62139046", "0.612348", "0.612348", "0.6098201", "0.6098201", "0.6098201", "0.60875463", "0.60328555", "0.60198116", "0.6012802", "0.6012802", "0.6012802", "0.6012802", "0.6012802", "0.6008231", "0.5950521", "0.58952516", "0.5883185", "0.586499", "0.584067", "0.5815178", "0.5815178", "0.5815178", "0.5815178", "0.5812162", "0.57802594", "0.5767769", "0.5763571", "0.5732938", "0.57195485", "0.569662", "0.56890184", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.56825185", "0.5679873", "0.56472355", "0.56236345", "0.562296", "0.5607113", "0.5602118", "0.5575114", "0.5563278", "0.55371535", "0.5536005", "0.5523733", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383", "0.55220383" ]
0.0
-1
This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof(roundingFunction) === 'function') { round = roundingFunction; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof(roundingFunction) === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t}", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding(roundingFunction) {\n\t if (roundingFunction === undefined) {\n\t return round;\n\t }\n\t if (typeof roundingFunction === 'function') {\n\t round = roundingFunction;\n\t return true;\n\t }\n\t return false;\n\t }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n\tif (roundingFunction === undefined) {\n\t\treturn round;\n\t}\n\tif (typeof(roundingFunction) === 'function') {\n\t\tround = roundingFunction;\n\t\treturn true;\n\t}\n\treturn false;\n}", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\r\n if (roundingFunction === undefined) {\r\n return round;\r\n }\r\n if (typeof(roundingFunction) === 'function') {\r\n round = roundingFunction;\r\n return true;\r\n }\r\n return false;\r\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }" ]
[ "0.7260021", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.7238755", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70974416", "0.70294446", "0.69754446", "0.69754446", "0.69754446", "0.69754446", "0.69754446", "0.69754446", "0.695765", "0.69565535", "0.6945511", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.6907443", "0.68930817", "0.68930817", "0.68930817", "0.68862754", "0.68840426", "0.6864361", "0.685697", "0.68197435", "0.68197435" ]
0.0
-1
This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t}", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n return true;\n }", "function getSetRelativeTimeThreshold (threshold, limit) {\n\tif (thresholds[threshold] === undefined) {\n\t\treturn false;\n\t}\n\tif (limit === undefined) {\n\t\treturn thresholds[threshold];\n\t}\n\tthresholds[threshold] = limit;\n\tif (threshold === 's') {\n\t\tthresholds.ss = limit - 1;\n\t}\n\treturn true;\n}", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold(threshold, limit) {\n\t if (thresholds[threshold] === undefined) {\n\t return false;\n\t }\n\t if (limit === undefined) {\n\t return thresholds[threshold];\n\t }\n\t thresholds[threshold] = limit;\n\t if (threshold === 's') {\n\t thresholds.ss = limit - 1;\n\t }\n\t return true;\n\t }", "function getSetRelativeTimeThreshold (threshold, limit) {\r\n if (thresholds[threshold] === undefined) {\r\n return false;\r\n }\r\n if (limit === undefined) {\r\n return thresholds[threshold];\r\n }\r\n thresholds[threshold] = limit;\r\n if (threshold === 's') {\r\n thresholds.ss = limit - 1;\r\n }\r\n return true;\r\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }", "function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }" ]
[ "0.6977598", "0.69336283", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6906506", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6900698", "0.6894468", "0.6885829", "0.6872021", "0.68407196", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.68244886", "0.6819936", "0.6819936", "0.6819936", "0.68147737", "0.6811937", "0.68001795", "0.68001795" ]
0.0
-1
Pseudo code for demonstration purposes only.
async list({ page = 1, pageSize = 10, userId }) { const posts = await fetch(`https://jsonplaceholder.typicode.com/posts${userId ? `?userId=${userId}` : ''}`) .then(response => response.json()); const inRange = i => i < pageSize * page && i >= pageSize * page - pageSize; return { data: posts.filter((_, i) => inRange(i)), meta: { page, pageSize, pages: Math.ceil(posts.length / pageSize), total: posts.length, }, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "step() { }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "function dummy() {}", "function dummy() {}", "function dummy() {}", "protected internal function m252() {}", "static transient final private internal function m43() {}", "Next() {}", "run () {\n }", "step() {\n }", "static private protected public internal function m117() {}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.6285859", "0.6075171", "0.60083896", "0.5838226", "0.5838226", "0.5838226", "0.5755638", "0.56398547", "0.56264746", "0.56264746", "0.56264746", "0.5563839", "0.55582327", "0.55336064", "0.55327356", "0.54672194", "0.54441786", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284", "0.54238284" ]
0.0
-1
Scoped outside of the function main code Create a function that calculates the perimeter of a rectangle
function calcPeri() { var width = 10; //Scoped to the function calcPeri console.log("Inside of the function the value of width is " + width); var height = 20; var perimeter = width*2 + height*2; console.log("Inside of function the perimeter is " + perimeter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function perimeterrectangle(width, height) {\n console.log(2 * (5 + 8));\n}", "function recPerimeter(width, height) {\nreturn(width*height + \" is the perimeter of this rectangle.\");\n}", "function perimeterRec(w,h){\n //perimiter = 2*width+height\n var p =2*w + 2*h;\n return p;\n\n}", "function calcPeri(){\n var width= 10//Scoped to the function\n var height= 20;\n var perimeter=width*2+height*2\n console.log(\"Inside of function, the perimeter is \"+perimeter+\".\");\n}", "function Rectangle(height, width) {\n this.height = height;\n this.width = width;\n this.calcArea = function() {\n return this.height * this.width;\n };\n // put our perimeter function here!\n this.calcPerimeter = function(){\n return this.height*2+this.width*2;\n }\n}", "function periRect(wid, len){\n\n var perimeter = wid * 2 + len * 2;\n //var perimeter = (number) wid + (number) len;\n\n //Return the perimeter\n return perimeter;\n\n\n\n }", "function rectanglePerimeter() {\nreturn((5*9) + \" is the perimeter of this rectangle.\");\n}", "function calculatePerimeter(radius){\n var perimeter = 2*radius*PI;\n return perimeter;\n}//end of function calculatePerimeter", "function perimeterRectangle(length, height){\n return -1;\n }", "function perimeterRectangle(length,width){\n if(typeof length != \"number\" && typeof width != \"number\"){\n throw new Error(\"input should be number!\")\n }else\n {\n return (2*length)+(2*width);\n }\n }", "function getPerimeter(length, width) {\n let perimeter;\n // Write your code here\n \n return perimeter;\n}", "function computePerimeterOfARectangle(length, width) {\n return (length *2) + (width *2);\n}", "function getPerimeter(length, width) {\n // Write your code here\n return 2 * (length + width);\n}", "function findPerimeter(height, width) {\n return (height + width) * 2\n}", "function computePerimeterOfSquare( side ) {\n return multiply( side, 4 );\n}", "function perimeterOfRectangle(length, width) {\n return (length + length + width + width);\n}", "function calcPeri(){\n\n //create a variable called width inside the function\n //this is scoped to the function calcPeri\n var width =10;\n\n //create variable for height and perimeter\n var height = 20;\n var perimeter = width *2 + height*2;\n\n console.log(\"Inside of the function, the perimeter is \" + perimeter);\n\n //varaibles created inside of a function can not be accessed outside of the functioon\n //variables created outside the function can be accessed but usually will not be\n\n\n }", "function Rectangle(height, width) {\n this.height = height;\n this.width = width;\n this.calcArea = function() {\n return this.height * this.width;\n };\n this.height = height;\n this.width = width;\n this.calcPerimeter = function() {\n return 2 * (this.height +this.width);\n };\n\n}", "function calcPeri(){\n\n //Create a variable called width inside of the function\n //Scoped to the function calcPeri\n var width = 10;\n\n ///Create a variable for height and perimeter\n var height = 20;\n var perimeter = width*2 + height*2;\n\n console.log(\"Inside of the function, the perimeter is \"+perimeter+\".\");\n\n\n //Variables created inside of a function can not be accessed outside of the function.\n //variables created outside of the function can be but usually will not be.\n\n\n }", "function areaOfRectangle(a,b){\n return a*b;\n}", "function calcArea(w,l){//parameters go here.\n //var width=10;\n //var length=20;\n //var area=width*length;\n\n var area=w*l;\n console.log(\"area of rectangle is \"+area);\n\n}", "function computePerimeterOfACircle(radius) {\n // your code here\n return 2 * Math.PI * radius;\n}", "function computePerimeter( x1, y1, x2, y2, x3, y3, x4, y4 ) {\n let line1 = computeLineLength( x1, y1, x2, y2 );\n let line2 = computeLineLength( x2, y2, x3, y3 );\n let line3 = computeLineLength( x3, y3, x4, y4 );\n let line4 = computeLineLength( x4, y4, x1, y1 );\n return computePerimeterByLength( line1, line2, line3, line4 );\n}", "function computePerimeterOfATriangle(side1, side2, side3) {\n return side1 + side2 + side3;\n}", "function perimeterSquare(side){\n return -1;\n }", "function calcArea(){\n\n\n //create the variable\n\n var width = 20;\n var height = 30;\n var area= width*height;\n\n console.log(\"Your rectangle has an area of \"+area)\n\n }", "function calcArea (w,h){//parameters go here\n//hard coded values for width and height - not good\n\n //var width = 10;\n //var height = 20;\n //var area= width*height;\n\n var area = w*h;\n\n console.log(\"the area of your rectangle is \"+area)\n }", "function printRectangleAreaPerimeter([a, b]) {\n [a, b] = [a, b].map(Number);\n let area = a * b;\n let perimeter = 2 * (a + b);\n area = (area % 1 == 0) ? area : area.toFixed(2);\n perimeter = (perimeter % 1 == 0) ? perimeter : perimeter.toFixed(2);\n console.log(area);\n console.log(perimeter);\n}", "calcPerimeterInAnotherUniverse(r) {\n return 2 * PI_OF_ANOTHER_UNIVERSE * r;\n }", "function calcArea (){\n //Create variables for W,H,A\n\n var width=20;\n var height=30;\n var area=width*height;\n console.log(\"The area of the recatangle is \" + area + \"sq Feet\");\n}", "function Polygon(a) {\r\n this.perimeter = function() {\r\n let perimeterP = 0\r\n for (let i = 0; i < a.length; i++) {\r\n perimeterP = perimeterP + a[i]\r\n }\r\n return perimeterP\r\n }\r\n}", "function area(r) {\n \n return r*r\n}", "function areaOfCircle(radius) {\r\n\r\n function square() {\r\n return radius * radius;\r\n }\r\n console.log(3.14 * square())\r\n}", "function findPerimeter(length, width) {\n\tvar p = 2 * length + 2 * width\n return p\n}", "function getPerimeter(length, width) {\n let perimeter;\n var len = length + length;\n var wid = width + width;\n perimeter = len + wid;\n return perimeter;\n}", "function calcArea() {\n //create variables for the width, height and area\n var width =20\n var height=30\n var area= width*height\n console.log(\"The area is \"+area)\n}", "function calcArea() {\n //Creates variables for width, height and area\n var width = 20;\n var height= 30\n var area = width*height;\n console.log('The area is '+area);\n}", "function area(width,height){\r\n var rect_area=width*height;\r\n document.write(\"Area of rectangle is: \"+rect_area+\"<br>\");\r\n}", "function getPerimeter(width, length) {\n return (width * 2) + (length * 2);\n}", "function rectanglePerimeter(lenght, width) {\n let result = (Number(lenght) + Number(width)) * 2;\n paraRectangle.innerHTML = `<h1> ${result}</h1>`;\n}", "function calcArea () {\n\tvar width = 20;\n\tvar height = 30;\n\tvar area = width * height;\n console.log(area);\n}", "function getPerimeter(length, width) {\n let perimeter;\n perimeter = (length + width) * 2;\n \n return perimeter;\n}", "function rectangle(a,b){\n return a*b;\n}", "function computeArea(width, height) {\n // your code here\n return width * height;\n}", "function calcArea(){\n var width = 20;\n var height = 30;\n var area = width * height;\n console.log(area);\n}", "function findPerimeter(num1,num2) {\r\n\treturn 2*(num1+num2);\r\n}", "function calcArea(){\n //Create variables for width, height, and area.\n var width=20;\n var height=30;\n var area=width*height;\n console.log(\"The are is \"+area);\n}", "function areaOrPerimeter (l , w) {\n return l == w ? l * w: 2 * (l + w);\n}", "function getArea(rectangle) {\n return rectangle.width * rectangle.height;\n}", "function calcAreaP(width, height){\n //calculations\n var area = width * height;\n console.log(area);\n //it will not have a return\n}", "function area_rectangulo(base,altura){\n return base*altura\n}", "function computeTripledAreaOfARectangle(length, width) {\n // your code here\n var area = length * width\n return area * 3;\n}", "function calcAreaP(width, height) {\n \n //calculation\n var area=width*height\n console.log(area);\n //It will not have a return\n}", "function Rectangle(a, b) {\r\n this.length=a\r\n this.width=b\r\n this. perimeter=2*(a+b)\r\n this.area=a*b\r\n \r\n}", "function rectangle() {\n\n}", "function AreaOfSquareCircumscribedByCircle() {\n // Radius of a circle\n let r = 3;\n document.write(\" Area of square = \" + find_Area(r));\n\n // Function to find area of square\n function find_Area(r) {\n return (2 * r * r);\n }\n}", "function ellipsePerimeter(a, b) {\n return Math.PI * (3 * (a + b) - Math.sqrt((3 * a + b) * (a + 3 * b)));\n}", "function areaSquare(side) {\n// Returns the 2D Area of a Square\n return side ** 2;\n}", "function calcAreaP(width, height){\n //Calculation\n var area = width * height\n console.log(area);\n //it will not have a return\n \n}", "function circleArea(r){\n //calc area PI * r*r\n var area = Math.PI *r * r;\n //Return the value\n return area;\n\n}", "function areaAndPerimeter(a, b) {\n console.log(Math.round((a * b) * 100) / 100);\n console.log(Math.round((a * 2 + b * 2) * 100) / 100);\n}", "function calculatePerimeter(x, perimeter){\n var min = x - perimeter;\n var max = x + perimeter;\n if (min < 0){\n min = 0;\n }\n if(max > 10){\n max = 10;\n }\n return [min, max];\n }", "function findPerimeter(length, width) {\n return (length * 2) + (width * 2);\n}", "function calcArea(w,h){\n //var width = 10;\n //var height = 20;\n var area=w*h;\n console.log(\"The area is \"+ area);\n }", "function perimeterQuadrilateral(a,b,c,d){\n return a + b + c + d;\n}", "function calcArea(CircleRadius){\r\n\r\n\r\n\tvar CircArea = Math.PI * CircleRadius * CircleRadius;\r\n\talert(\"The area is \" + CircArea);\r\n\r\n}", "function calcArea(w,h) { // Parameters go here\n \n \n //var width = 10;\n //var height = 20;\n //var area = width * height;\n \n \n var area=w*h;\n \n console.log(\"The area is \"+area);\n \n\n}", "function calcAreaF(width, height){\n var area = width * height;\n return area;\n}", "function calcAreaF(width, height){\n var area = width * height;\n return area;\n}", "function areaOfRectangle(length,width){\n var area = length * width;\n return area ;\n}", "function areaOfRectangle(l, b) {\n return l * b;\n}", "area() {\n return 4 * (3.14) * (this.radius**2)\n }", "calcArea(){\n return this._width * this._height;\n }", "function periRect(length,breath){\n return(2*(length+breath));\n }", "function solveRect(l, w) { //A function we created to make use of the \"rect\" function. Pass in the values \"l\" and \"w\"\n console.log(`Solving for rectangle with dimensions: ${l}, ${w}`); //log the values of \"l\" and \"w\" to the console using template literals (backticks, not quote marks)\n\n //\"rect\" is now the function in the \"rectangle.js\" file. It requires 3 arguments: two positive numbers and a callback function. The two numbers will be taken from what is passed in to the \"solveRect\" function calls (and reassigned as \"x\" and \"y\" in \"rectangle.js\"). The callback function is written in-line in the parameter list using an arrow function (it's not executed in the parameter list, it's only being defined here) It's executed within the \"rectangle.js\" file.\n rect(l, w, (err, rectangle) => {\n if (err) { //check if the callback funciton is being called with an error object\n console.log('ERROR:', err.message); // if so, log the error message\n } else { //Console log the area and perimeter of the rectangle using the methods defined on the \"rect\" object (via \"rect.area\", \"rect.perimeter\") passing in the \"l\" and \"w\" arguments\n console.log(`Area of rectangle with dimensions ${l}, ${w} is: ${rectangle.area()}`); //Object that owns the \".area\" and \".perimeter\" methods is being passed into this callback function with the name \"rectangle\" as definedin the paramter list. Method calls have empty paramter lists because the deimensions are now defined in rectangle.js.\n console.log(`Perimeter of rectangle with dimensions ${l}, ${w} is: ${rectangle.perimeter()}`);\n }\n });\n console.log('This statement is logged after the call to rect()');\n}", "function calcArea(wid, len){\n\nvar area = wid*len;\n\n console.log(\"The area inside of function is \"+area);\n\n //Return the area variable to the main code\n return area;\n\n }", "function calcArea(w, h){\n //Create variables\n //width = 10;\n //height = 20;\n //Calculate the area\n var area = w * h;\n\n //Console log the area.\n console.log(\"The area of a rectangle with a width of \"+ w + \" and a height of \"+ h + \" is \" +area);\n}", "function calcAreaP(w,h){\n var area = w*h;\n\n //We do not return this value\n console.log(\"Inside the procedure the area is \"+area);\n}", "function circleArea(r){\n //calc area Pi * r * r\n var area = Math.PI * r * r;\n //Return the value\n return area;\n\n }", "function areaRectangulo(ancho, alto){\r\n let area = ancho*alto;\r\n alert(\"Area\" + area);\r\n}", "function calcArea(w,h){\n //calc area\n var area = w*h;\n console.log(\"Inside the function the area is \"+area);\n //Return the area to the main code\n return area;\n }", "function calcArea(w , h){\n\n //create var for height , width , and area\n\n //var width = 20;\n //var height = 10;\n //var are = height * width\n\n //create var area using parimeters\n var area = w*h;\n console.log(area)\n}", "function find_Area(r) {\n return (2 * r * r);\n }", "function computeAreaOfACircle(radius) {\n // your code here\n return Math.PI * radius**2;\n}", "function perimeterCircle(diameter){\n return -1;\n }", "function firsFunction(){\n var width = 80;\n var heigth = 2;\n var area = width * heigth;\n console.log(area);\n \n var wid = 1000;\n var area = wid - area;\n // var heigth = 160;\n \n return area;\n \n}", "function calcArea(width, height) {\n var area = width*height;\n return area; \n}", "function pizzaArea1(r){\n // radius of circle r*r*PI\n var area= Math.pow(r,2)*Math.PI;\n return area;\n}", "function calcArea(width, height) {\n var area=width*height\n return area;\n}", "findArea() {\n console.log(\"The area of this circle is: \" + this.pi * (this.rayon * this.rayon));\n }", "function computePerimeterByLength( side1, side2, side3, side4 ) {\n return add( side1, side2, side3, side4 );\n}", "function calcCirclePerimeter(radius){\n return (2*Math.PI*radius).toFixed(2);\n}", "function calcRectangleArea(w,h) {\n if (typeof w !== \"number\" || typeof h !== \"number\" ) {\n throw new Error(\"An error, is not number\")} ;\n let area1 = w*h/2; \n  return area1;\n console.log(area1);\n}", "static DistanceToRectangle() {}", "function calcArea(w, h){\n var area = w*h;\n //REturns a variable\n return area;\n}", "function calcArea(width, height){\n var area = width * height;\n return area;\n}", "function main() {\n // Write your code here. Read input using 'readLine()' and print output using 'console.log()'.\n const PI=Math.PI;\n let r=parseFloat(readLine());\n \n // Print the area of the circle:\n let area = PI * Math.pow(r,2);\n console.log(area);\n // Print the perimeter of the circle:\n let perimeter= 2* PI*r;\n console.log(perimeter);\n}", "function calcArea(width,height) {\n var area = width*height;\n return area;\n}", "function calcArea(w,h){\n //Calculate area\n var area = w*h\nconsole.log(\"Inside the function the area is \"+area);\n //return the area to the main code.\n return area;\n}", "function area(width, height) {\n return width * height;\n}" ]
[ "0.7927504", "0.77272373", "0.7715633", "0.76928955", "0.76766694", "0.7626446", "0.76262635", "0.7444603", "0.73960435", "0.7387288", "0.73542076", "0.7335779", "0.73195326", "0.7289485", "0.7232488", "0.7181726", "0.7180677", "0.71612847", "0.705846", "0.7031909", "0.70306194", "0.7027704", "0.7002855", "0.6980173", "0.6968202", "0.69142157", "0.686793", "0.68633384", "0.6807657", "0.6793309", "0.67843527", "0.678116", "0.67640156", "0.67562956", "0.6754815", "0.6737428", "0.66999996", "0.6679831", "0.6639402", "0.6638575", "0.6623062", "0.6619509", "0.65952337", "0.6587245", "0.6586475", "0.65773857", "0.65765053", "0.6570722", "0.65680623", "0.6558638", "0.6544006", "0.6532879", "0.6522315", "0.65211236", "0.65193224", "0.6501898", "0.6491841", "0.64881176", "0.64769185", "0.6467963", "0.6465703", "0.6465422", "0.6460105", "0.6460102", "0.64552003", "0.6449713", "0.64455026", "0.6433828", "0.6433828", "0.64289504", "0.64266235", "0.6419298", "0.64030886", "0.63918686", "0.6383759", "0.63800156", "0.63771254", "0.6374718", "0.6373358", "0.63699824", "0.6356849", "0.63437873", "0.63373816", "0.6328136", "0.6320658", "0.63156813", "0.6314639", "0.6304378", "0.6292022", "0.62718964", "0.6263787", "0.6263211", "0.6254777", "0.62468266", "0.6245516", "0.622946", "0.6228339", "0.622188", "0.6220978", "0.6220946" ]
0.7263793
14
three below functions are connected to buttons: small, medium, large
function resizeSmall (rows, columns) { container.style.gridTemplateRows = `repeat(${rows}, 25px`; container.style.gridTemplateColumns = `repeat(${columns}, 25px`; console.log(cSize); for(var i = 0; i < totalCells; i++) { var cell = document.createElement('div'); container.appendChild(cell).className = 'item'; console.log('Test1'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getButtonSize(isDesktop){\n if(isDesktop){\n return \"large\"\n }\n else{\n return \"small\"\n }\n }", "function WidthChangeSmall(mqsmall) {\n if (mqsmall.matches) {\n buttonsFieldRemoveBindings();\n buttonsFieldAssignSmall();\n midLayout();\n adaptSmallScreen();\n activateOneTextarea();\n screenSize = 0;\n\n if (commandsCodeSize !== \"\") {\n changeCodeSize(commandsCodeSize);\n } else {\n $(columnSizeBtnMid).click();\n }\n $(htmlSizePlus).click();\n if (cssonly || htmlonly || jsonly) {\n startCssOnly(0);\n }\n } else {\n activateAllTextareas();\n buttonsFieldRemoveBindings();\n buttonsFieldAssignBig();\n adaptBigScreen();\n\n if (commandsLayoutType !== \"\") {\n changeLayoutType(commandsLayoutType);\n }\n\n if (commandsCodeSize !== \"\") {\n changeCodeSize(commandsCodeSize);\n }\n\n if (nocss || nohtml || nojs) {\n removeStartEditor();\n }\n\n if (cssonly || htmlonly || jsonly) {\n startCssOnly(1);\n }\n\n if (startLayout) {\n if (commandsLayoutType === \"\") {\n layoutLeft();\n }\n if (commandsCodeSize === \"\") {\n $(columnSizeBtnMin).click();\n }\n startLayout = false;\n } else if (commandsLayoutType === \"\") {\n layoutTop();\n }\n screenSize = 1;\n }\n\n}", "function buttonsFieldAssignSmall() {\n\n $(htmlRemoveBtn).on(\"click\", function() {\n $(htmlSizePlus).click();\n });\n\n $(cssRemoveBtn).on(\"click\", function() {\n $(cssSizePlus).click();\n });\n\n $(jsRemoveBtn).on(\"click\", function() {\n $(jsSizePlus).click();\n });\n\n\n $(htmlSizePlus).on(\"click\", function() {\n $(htmlCMSection).css(\"display\", \"flex\");\n $(cssCMSection).css(\"display\", \"none\");\n $(jsCMSection).css(\"display\", \"none\");\n\n $(htmlSizePlus).addClass(\"active-btn\");\n $(cssSizePlus).removeClass(\"active-btn\");\n $(jsSizePlus).removeClass(\"active-btn\");\n\n $(htmlRemoveBtn).addClass(\"active-btn\");\n $(cssRemoveBtn).removeClass(\"active-btn\");\n $(jsRemoveBtn).removeClass(\"active-btn\");\n\n });\n\n $(cssSizePlus).on(\"click\", function() {\n $(cssCMSection).css(\"display\", \"flex\");\n $(htmlCMSection).css(\"display\", \"none\");\n $(jsCMSection).css(\"display\", \"none\");\n\n $(cssSizePlus).addClass(\"active-btn\");\n $(htmlSizePlus).removeClass(\"active-btn\");\n $(jsSizePlus).removeClass(\"active-btn\");\n\n $(cssRemoveBtn).addClass(\"active-btn\");\n $(htmlRemoveBtn).removeClass(\"active-btn\");\n $(jsRemoveBtn).removeClass(\"active-btn\");\n });\n\n $(jsSizePlus).on(\"click\", function() {\n $(jsCMSection).css(\"display\", \"flex\");\n $(cssCMSection).css(\"display\", \"none\");\n $(htmlCMSection).css(\"display\", \"none\");\n\n\n $(jsSizePlus).addClass(\"active-btn\");\n $(htmlSizePlus).removeClass(\"active-btn\");\n $(cssSizePlus).removeClass(\"active-btn\");\n\n $(jsRemoveBtn).addClass(\"active-btn\");\n $(cssRemoveBtn).removeClass(\"active-btn\");\n $(htmlRemoveBtn).removeClass(\"active-btn\");\n });\n\n}", "function changeToSmall(e) {\n changeToSize(120);\n }", "function LargeButtonStandard(id){\n\tElemId(id).style.top = sHeight * 0.875 / 100.0 + \"px\";\n\tElemId(id).style.height = sHeight * 3.5 / 100.0 + \"px\";\n\tElemId(id).style.width = ElemId(id).style.height;\n}", "function setButtons(){\n\teasy.addEventListener(\"click\", function(){\n\t\teasy.classList.toggle(\"selected\");\n\t\thard.classList.toggle(\"selected\");\n\t\tsetColors(3);\n\t\tmode = \"easy\"\n\n\t});\n\thard.addEventListener(\"click\", function(){\n\t\teasy.classList.toggle(\"selected\");\n\t\thard.classList.toggle(\"selected\");\n\t\tsetColors(6);\n\t\tmode = \"hard\";\n\t});\n}", "function _doResize() {\n\t\tvar buttons = $( 'button[id^=\"genesis-mobile-\"]' ).attr( 'id' );\n\t\tif ( typeof buttons === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\t\t_maybeClose( buttons );\n\t\t_superfishToggle( buttons );\n\t\t_changeSkipLink( buttons );\n\t\t_combineMenus( buttons );\n\t}", "function _doResize() {\n\t\tvar buttons = $( 'button[id^=\"genesis-mobile-\"]' ).attr( 'id' );\n\t\tif ( typeof buttons === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\t\t_maybeClose( buttons );\n\t\t_superfishToggle( buttons );\n\t\t_changeSkipLink( buttons );\n\t\t_combineMenus( buttons );\n\t}", "function changeSizeButton(button, sizeButtons){\r\n\t\t\tfor (var i = 0; i<sizeButtons.length; i++){\r\n\t\t\t\tsizeButtons[i].style.color = \"#FF8D48\";\r\n\t\t\t\tsizeButtons[i].style.backgroundColor = \"white\";\r\n\t\t\t}\r\n\t\t\tbutton.style.color = \"white\";\r\n\t\t\tbutton.style.backgroundColor = \"#FF8D48\";\r\n\t\t\tcurrentSize = button.innerHTML;\r\n\r\n\t\t}", "function SetButtonsTypeHandler()\n{\n switch ($(this).text())\n {\n case cBUT.TITLES : if (GetState(\"media\") == \"movies\") \n {\n SetState(\"type\", \"titles\");\n ShowMediaTypePage(cBUT.SETS, true);\n }\n else {\n SetState(\"type\", \"tvtitles\");\n ShowMediaTypePage(cBUT.SERIES, false);\n }\n break;\n \n case cBUT.SETS : SetState(\"type\", \"sets\");\n ShowMediaTypePage(cBUT.TITLES, true);\n break;\n \n case cBUT.BACK + \n cBUT.SETS : BackToMedia(\"sets\");\n break;\n \n case cBUT.SERIES : SetState(\"type\", \"series\");\n ShowMediaTypePage(cBUT.TITLES, false);\n break; \n \n case cBUT.BACK +\n cBUT.SERIES : BackToMedia(\"series\");\n break;\n \n case cBUT.BACK +\n cBUT.SEASONS: BackToMedia(\"seasons\");\n break; \n \n case cBUT.ALBUMS : SetState(\"type\", \"albums\");\n ShowMediaTypePage(cBUT.SONGS, false);\n break; \n \n case cBUT.SONGS : SetState(\"type\", \"songs\");\n ShowMediaTypePage(cBUT.ALBUMS, false);\n break; \n \n case cBUT.BACK +\n cBUT.SONGS : BackToMedia(\"songs\");\n break; \n }\n}", "function setUI() {\n $('.menu_options__psize .w').val(defPixelWidth);\n $('.menu_options__psize .h').val(defPixelWidth);\n $('.menu_options__ssize .w').val(defSceneWidth);\n $('.menu_options__ssize .h').val(defSceneHeight);\n $('button.s').data('size',`${defSceneWidth},${defSceneHeight}`);\n $('button.m').data('size',`${defSceneWidth * 1.5},${defSceneHeight * 1.5}`);\n $('button.l').data('size',`${defSceneWidth * 2},${defSceneHeight * 2}`);\n $('button.xl').data('size',`${defSceneWidth * 2.5},${defSceneHeight * 2.5}`);\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 changeToMedium(e) {\n changeToSize(240);\n }", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function editor_tools_handle_small() {\n editor_tools_add_tags('[small]', '[/small]');\n editor_tools_focus_textarea();\n}", "function lightButton(btn) {\n if(boardSizeVal == 4)\n document.getElementById(\"btn\" + btn).classList.add(\"lit\");\n else{\n document.getElementById(\"btn\" + btn + \"_\").classList.add(\"lit\");\n }\n}", "function simpleOverallButton() {\n \"use strict\";\n var extra = simple_global.button_style;\n\n if ($('.wpcf7-form input[type=\"submit\"]').length > 0) {\n $('.wpcf7-form input[type=\"submit\"]').addClass('btn-bt').addClass(extra);\n }\n if ($('#respond input[type=\"submit\"]').length > 0) {\n $('#respond input[type=\"submit\"]').addClass('btn-bt').addClass(extra);\n }\n\n if ($('.woocommerce .button, #woocommerce .button').length > 0) {\n $('.woocommerce .button, #woocommerce .button').not('.wpb_content_element.button').addClass('btn-bt').addClass(extra);\n }\n\n if ($('.not_found .search_field').length > 0) {\n $('.not_found .search_field button').addClass('btn-bt').addClass(extra);\n }\n\n if ($('.post-password-form input[type=\"submit\"]').length > 0) {\n $('.post-password-form input[type=\"submit\"]').addClass('btn-bt').addClass(extra);\n }\n\n if ($('.mc_signup_submit input').length > 0) {\n $('.mc_signup_submit input').addClass('btn-bt').addClass(extra);\n }\n\n if ($('.mc4wp-form input[type=\"submit\"]').length > 0) {\n $('.mc4wp-form input[type=\"submit\"]').addClass('btn-bt').addClass(extra);\n }\n\n $(\"body\").bind(\"added_to_cart\", function() {\n $('.added_to_cart').addClass('btn-bt').addClass(extra);\n });\n if ($('#place_order.button').length > 0) {\n $('#place_order.button').addClass('btn-bt').addClass(extra);\n }\n }", "function changeLevels(elBtn) {\r\n switch (elBtn.innerText) {\r\n case 'Easy':\r\n gLevel.size = 4;\r\n gLevel.mines = 2;\r\n break;\r\n case 'Medium':\r\n gLevel.size = 8;\r\n gLevel.mines = 12;\r\n break;\r\n case 'Hard':\r\n gLevel.size = 12;\r\n gLevel.mines = 30;\r\n break;\r\n }\r\n initGame();\r\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 menuSmall() {\n\tvar x = document.getElementById(\"butOptions\");\n\tif (x.className === \"optionBar\") {\n\t\tx.className += \" responsive\";\n\t} else {\n\t\tx.className = \"optionBar\";\n\t}\n\t}", "function showbtn54() {\n a54.style.width = wh54 + \"px\";\n a54.style.height += wh54 + \"px\";\n a54.style.margin += \"10px\";\n a54.style.borderLeft += \"1px solid black\"\n a54.style.borderRight += \"1px solid black\"\n a54.style.borderBottom += \"1px solid black\"\n a54.style.overflow += \"hidden\"\n ratio54 = (wh54 / sqrt54x)\n font54 = ratio54 / 1.25\n\n for(i=0;i<gridchange54;i++){\n i54 = i+1\n btnid54 = 'btn54x' + i54;\n a54.innerHTML += \"<button id=\\'\" + btnid54 + \"\\'>\" + \"&nbsp;\" + \"</button>\"\n btnid54x2 = 'btn54click(' + btnid54 + ')'\n document.getElementById(btnid54).setAttribute('onclick',btnid54x2)\n }\n\n document.getElementById('styledit').innerHTML = \"<style>#main button{width: \" + ratio54 +\"px; height: \" + ratio54 + \"px; font-size: \" + font54 + \"px}</style>\"\n}", "_updateButtons() {\n const hideButton = action =>\n this.$header.querySelector(`.osjs-window-button[data-action=${action}]`)\n .style.display = 'none';\n\n const buttonmap = {\n maximizable: 'maximize',\n minimizable: 'minimize',\n closeable: 'close'\n };\n\n if (this.attributes.controls) {\n Object.keys(buttonmap)\n .forEach(key => {\n if (!this.attributes[key]) {\n hideButton(buttonmap[key]);\n }\n });\n } else {\n Array.from(this.$header.querySelectorAll('.osjs-window-button'))\n .forEach(el => el.style.display = 'none');\n }\n }", "function SetButtonsScreenHandler()\n{\n var screen, $control = $(\"#control_sub\");\n \n if ($(this).text() == cBUT.LIST) {\n screen = cBUT.THUMB;\n }\n else {\n screen = cBUT.LIST; \n } \n \n // Set state screen (list or thumbnail).\n gSTATE.SCREEN = screen;\n \n // Show media table.\n ShowMediaTable(gSTATE.PAGE, gSTATE.SORT); \n \n // Change sub control bar.\n $control.stop().slideUp(\"slow\", function() {\n $(\"#screen\").text(screen);\n $control.slideDown(\"slow\");\n }); \n}", "function sizeSwitcher (size) {\r\n switch(size) {\r\n case \"1\":\r\n return 0.25;\r\n case \"2\":\r\n return 0.3333;\r\n case \"3\":\r\n return 0.5;\r\n default:\r\n console.log(\"bug in sizeSwitcher\");\r\n }\r\n }", "function setSmall(){\n setCheckedA(true);\n setCheckedB(false);\n setCheckedC(false);\n }", "function largeTxtBtn(args) {\n if(largeTxt){\n if(darkMode){\n var text = args.object;\n text.text = \"Disabled\"\n largeTxt = false;\n application.setCssFileName(\"smallDark.css\");\n }\n else{\n var text = args.object;\n text.text = \"Disabled\"\n largeTxt = false;\n application.setCssFileName(\"smallLight.css\");\n }\n }\n else{\n if(darkMode){\n var text = args.object;\n text.text = \"Enabled\"\n largeTxt = true;\n application.setCssFileName(\"app.css\");\n }\n else{\n var text = args.object;\n text.text = \"Enabled\"\n largeTxt = true;\n application.setCssFileName(\"largeLight.css\");\n }\n }\n frameModule.topmost().navigate('settings/settings-page');\n}", "function modeBtnFunctionality () {\n\tfor (var i = 0; i < modeButton.length; i++) {\n\t\tmodeButton[i].addEventListener(\"click\", function () {\n\t\t\tmodeButton[0].classList.remove(\"selected\");\n\t\t\tmodeButton[1].classList.remove(\"selected\");\n\t\t\tthis.classList.add(\"selected\");\n\t\t\tthis.textContent === \"Easy\" ? colorsNum = 3: colorsNum = 6;\n\t\t\treset();\n\t\t});\n\t}\n}", "function setupButtons(){\n\tfor (let i = 0; i<modeButtons.length; i++){\n\t\tmodeButtons[i].addEventListener(\"click\",function(){\n\t\t\tfor(let j = 0; j<modeButtons.length; j++){\n\t\t\t\tmodeButtons[j].classList.remove(\"selected\");\n\t\t\t}\n\t\t\tthis.classList.add(\"selected\");\n\t\t\tthis.textContent === \"Easy\" ? numSquares = 3 : numSquares = 6;\n\t\t\treset();\n\t\t});\n\t}\n\t//add listener to the reset button\n\tresetButton.addEventListener(\"click\", function(){\n\t\treset();\n\t});\n}", "function customSize() {\n size.textContent = 'Grid Size';\n size.addEventListener('click', () => {\n let input = prompt('Please Enter a Grid Size');\n if (input === null || input < 1) {\n sizeSet();\n makeGrid(16, 16);\n makeGray();\n makeBlack();\n makeRGB();\n } else {\n sizeSet();\n makeGrid(input, input);\n makeGray();\n makeRGB();\n makeBlack();\n }\n })\n buttons.appendChild(size).classList.add('btn');\n}", "function fl_outToModern_btn ()\n\t\t{\n\t\t\t\tif(freez == \"false\"){// מבטיח שהמאוס אאוט יעבוד רק שהפריז בפולס\n\t\t\t\tconsole.log(\"hit\")\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function changeLevel() {\n easyClick();\n mediumClick();\n hardClick();\n if (isUnder) {\n startButton();\n }\n}", "function color_button(event) {\n selectors.forEach(reset_buttons);\n if (event.target.className == \"LinBtn\") {\n ShowPage(0);\n selectors[0].style.background = \"black\";\n selectors[0].style.color = \"#dce1d5\";\n };\n if (event.target.className == \"IrrBtn\") {\n ShowPage(1);\n selectors[4].style.background = \"black\";\n selectors[4].style.color = \"#dce1d5\";\n };\n if (event.target.className == \"ClvBtn\") {\n ShowPage(2);\n selectors[8].style.background = \"black\";\n selectors[8].style.color = \"#dce1d5\";\n };\n\n}", "function perspective2(whichBtn) {\n switch (whichBtn) {\n case 1: \n btn1.className = \"notSelected\";\n btn2.className = \"notSelected\";\n btn3.className = \"notSelected\";\n btn4.className = \"notSelected\";\n btn5.className = \"notSelected\";\n btn1.style.backgroundColor = \"#141414\";\n btn2.style.backgroundColor = \"#141414\"; \n btn3.style.backgroundColor = \"#141414\";\n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 0X\";\n break;\n case 2: \n btn2.className = \"notSelected\";\n btn3.className = \"notSelected\";\n btn4.className = \"notSelected\";\n btn5.className = \"notSelected\";\n btn2.style.backgroundColor = \"#141414\"; \n btn3.style.backgroundColor = \"#141414\";\n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 1X\";\n break;\n case 3: \n btn3.className = \"notSelected\";\n btn4.className = \"notSelected\";\n btn5.className = \"notSelected\";\n btn3.style.backgroundColor = \"#141414\";\n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\"; \n zoom.innerHTML = \"ZOOM 2X\"; \n break;\n case 4: \n btn4.className = \"notSelected\";\n btn5.className = \"notSelected\";\n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 3X\";\n break;\n case 5: \n btn5.className = \"notSelected\";\n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 4X\";\n break;\n }\n }", "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 adjustButtons() {\n var buttonCount = 0;\n $('button[id^=\"Button\"]').each(function(index) {\n buttonCount++;\n });\n if(buttonCount == 2) {\n $(\"#Button0\").removeClass(\"btn--expand\");\n $(\"#Button1\").removeClass(\"btn--expand\");\n $(\"#Button0\").addClass(\"btn--semiexpand\");\n $(\"#Button1\").addClass(\"btn--semiexpand\");\n $(\"#Button1\").addClass(\"btn--extra\");\n }\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}", "setActiveDifficulty() {\n let first = this.$difficulties.childNodes[0].childNodes[0];\n first.classList.add('active-big');\n \n // Toggle class for selected button\n let btns = document.querySelectorAll(\".btn-big\");\n Array.from(btns).forEach(item => {\n item.addEventListener(\"click\", () => {\n let selected = document.querySelectorAll(\".active-big\");\n selected[0].className = selected[0].classList.toggle(\"active-big\");\n item.classList.add('active-big');\n });\n });\n \n this.createSliderValue();\n }", "function showAllBtn (fntOn) {\n\t\t\tonBtn ('btnCopy');\n\t\t\tonBtn ('btnDel');\n\t\t\tonBtn ('btnUp');\n\t\t\tonBtn ('btnDn');\n\t\t\tonBtn ('btnFlipH');\n\t\t\tonBtn ('btnFlipV');\n\t\t\tonBtn ('btnLock');\n\t\t\tonBtn ('sectEdit');\n\t\t\tonBtn ('colorelement');\t\n\t\t\t//Show Font Button\n\t\t\t//if (fntOn) {\n\t\t\t\tonBtn ('btnBold');\n\t\t\t\tonBtn ('btnItalic');\n\t\t\t\tonBtn ('fntLeft');\n\t\t\t\tonBtn ('fntCenter');\n\t\t\t\tonBtn ('fntRight');\n\t\t\t\tonBtn ('fontFamily');\n\t\t\t\tonBtn ('btnEditT');\n\t\t\t//}\n\n\t\t}", "function myFunction(button) {\r\n\tvar x = button.id;\r\n\r\n\tswitch(x) {\r\n\t\tcase '1' :\r\n\t\t\tbtnSwitch(x);\r\n\t\t\tcontentSwitch(x);\r\n\t\tbreak;\t\r\n\t\tcase '2' :\r\n\t\t\tbtnSwitch(x);\r\n\t\t\tcontentSwitch(x);\r\n\t\tbreak;\r\n\t}\r\n}", "function changeToBig(e) {\n changeToSize(480);\n }", "function handleClick() {\n // retrieve the index of the button in the node list\n const index = [...buttons].findIndex(button => button === this);\n\n // color and rescale every button up to the selected one\n [...buttons].slice(rating, index + 1).forEach((button, i) => {\n // transition delay for the change in color and scale, on the button\n // animation delay inherited by the pseudo elements, to add a small detail\n // both based on the total number of stars\n const stars = (index + 1) - rating;\n button.style.transitionDelay = `${i * duration / stars}s`;\n button.style.animationDelay = `${i * duration / stars}s`;\n // class allowing to style the button and animate the pseudo elements\n button.classList.add('active');\n });\n\n // remove the class allowing the animation from every button after the selected one\n [...buttons].slice(index + 1, rating).forEach((button, i) => {\n // delay on the transition to have the buttons styled progressively and in the opposite order\n const stars = rating - (index + 1);\n button.style.transitionDelay = `${(stars - i - 1) * duration / stars}s`;\n button.classList.remove('active');\n });\n\n // update rating to refer to the new index\n rating = index + 1;\n}", "function ScaleButton(size : Vector2){\n\tcurrentButton.width=size.x;\n\tcurrentButton.height=size.y;\n\tcurrentButton.x=buttonPosition.x - (currentButton.width/2);\n\tcurrentButton.y=buttonPosition.y - (currentButton.height/2);\n}", "function updateButtons() {\n explainButtonElm.css('display', 'none');\n collapseButtonElm.css('display', 'none');\n if(step.containsExplanation() || step.containsSteps()) {\n if (explanationExpanded) {\n collapseButtonElm.css('display', 'block');\n } else explainButtonElm.css('display', 'block');\n }\n }", "function sizeSwitcher(size) {\n switch (size) {\n case '1':\n return 0.25;\n case '2':\n return 0.3333;\n case '3':\n return 0.5;\n default:\n console.log('bug in sizeSwitcher');\n }\n}", "function drawButtons() {\n if (!levelPicked) {\n easyButton.make();\n mediumButton.make();\n hardButton.make();\n }\n}", "function setButtonStates(){\n // console.log('running setButtonStates');\n $('.btnFilt, .btnSort').removeClass('button-on');\n switch(STORE.fMode){\n case 'ch':\n $('#btnFiltChkd').addClass('button-on');\n break;\n case 'unCh':\n $('#btnFiltUnChkd').addClass('button-on');\n break;\n case 'all':\n $('#noFilter').addClass('button-on');\n }\n\n switch(STORE.sMode){\n case 'hiLo':\n $('#btnSrtHiLo').addClass('button-on');\n break;\n case 'loHi':\n $('#btnSrtLoHi').addClass('button-on');\n break;\n case 'alpha':\n $('#btnSrtAsc').addClass('button-on');\n break;\n case 'revAlpha':\n $('#btnSrtDesc').addClass('button-on');\n break;\n case 'off':\n $('#btnSrtClear').addClass('button-on');\n }\n\n if(STORE.searchTxt!==null){\n $('#js-sect-search .btnSave').addClass('button-on');\n }\n else{\n $('#js-sect-search .btnSave').removeClass('button-on'); \n }\n\n}", "function changeColorSize (button, selectedButton, colorText) {\r\n\t\t\tfor (var i = 0; i < selectedButton.length; i++){\r\n\t\t\t\tselectedButton[i].setAttribute('class', 'colorButton');\r\n\t\t\t}\r\n\r\n \t\tbutton.setAttribute('class', 'colorButton_s');\r\n \t\tcolorText.innerHTML = button.id;\r\n \t\tcurrentColor = colorText.innerHTML;\r\n\r\n\r\n \t\tvar productImg = document.getElementById(\"productImg\");\r\n\r\n \t\tproductImg.src = \"images/\"+ button.id + \".png\"\r\n\r\n\r\n\t\t\t}", "function popularButtonClick(btnName){\n setPopularSectionSelected(btnName);\n setPopularSectionContent(btnName);\n}", "function changeMiniature(e) {\n ImgFirst.src = e.target.src;\n hide();\n switch (e.target.id) {\n case \"first\":\n changePhoto1.classList.remove(\"hide\");\n changePhoto1.classList.add(\"show\");\n counter.innerHTML = String(price[\"falcon9\"]) + \"€\";\n break;\n case \"second\":\n changePhoto2.classList.remove(\"hide\");\n changePhoto2.classList.add(\"show\");\n counter.innerHTML = String(price[\"heavy\"]) + \"€\";\n break;\n case \"thrid\":\n changePhoto3.classList.remove(\"hide\");\n changePhoto3.classList.add(\"show\");\n counter.innerHTML = String(price[\"dragon\"]) + \"€\";\n break;\n case \"fourth\":\n changePhoto4.classList.remove(\"hide\");\n changePhoto4.classList.add(\"show\");\n counter.innerHTML = String(price[\"bfr\"]) + \"€\";\n break;\n }\n}", "function setWideBtn() {\n\n\t\t\t\tvar $btn = _$header.find('#wide-btn');\n\n\t\t\t\t$btn.on('click',function() {\n\n\t\t\t\t\t$btn.toggleClass('on');\n\n\t\t\t\t\tif (!$btn.hasClass('on')) {\n\n\t\t\t\t\t\tvar marginTop = -(_$parent.height()/2)/2;\n\t\t\t\t\t\tvar marginLeft = -(_$parent.width()/2)/2;\n\n\t\t\t\t\t\t_$parent.animate({\n\t\t\t\t\t\t\ttop : 50 + '%',\n\t\t\t\t\t\t\tleft : 50 + '%',\n\t\t\t\t\t\t\twidth : 50 + \"%\",\n\t\t\t\t\t\t\theight : 50 + \"%\",\n\t\t\t\t\t\t\tmarginTop : marginTop,\n\t\t\t\t\t\t\tmarginLeft: marginLeft\n\t\t\t\t\t\t},200);\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_$parent.animate({\n\t\t\t\t\t\t\ttop : 0,\n\t\t\t\t\t\t\tleft : 0,\n\t\t\t\t\t\t\twidth : 100 + '%',\n\t\t\t\t\t\t\theight : 100 + '%',\n\t\t\t\t\t\t\tmarginTop : 0,\n\t\t\t\t\t\t\tmarginLeft: 0\n\t\t\t\t\t\t},200);\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn false;\n\t\t\t}", "function buttonUpdate() {\n //Storage button updater\n if (gameData.currentStorage != storageNums.length) {\n setBackgroundIf(\"upgradeStorage\", gameData.cash >= storageNums[gameData.currentStorage].cost, \"#05D36B\", \"#af4c4c\");\n }\n setBackgroundIf(\"eggCollector\", gameData.cash >= gameData.eggcollectorCost, \"#05D36B\", \"#af4c4c\");\n setBackgroundIf(\"eggRobotCollector\", gameData.cash >= gameData.roboteggcollectorCost, \"#05D36B\", \"#af4c4c\");\n setBackgroundIf(\"eggClickers\", gameData.cash >= gameData.click_increment_cost, \"#05D36B\", \"#af4c4c\");\n setBackgroundIf(\"upgradeEgg\", gameData.cash >= gameData.cost_increase_cost, \"#05D36B\", \"#af4c4c\");\n}", "function next_button(number){\r\n show(number);\r\n sound_color(setOf[number]);\r\n\r\n}", "function sizedButton(units) {\n return `sized-button sized-button--size_${units}`;\n}", "function switchButtons() {\n\t\t $darkThemeButton.toggleClass('hide');\n\t\t $lightThemeButton.toggleClass('hide');\n\t }", "function SetButtonsHandler()\n{ \n var $this = $(this);\n var buttons = \"\";\n var aList;\n var height_box;\n var $btns = $(\"#buttons_box .button\");\n var $scroll = $(\"#buttons_box .slimScrollDiv\");\n var media = GetState(\"media\");\n \n SetState(\"choice\", $this.text());\n\n if ($this.text() == \"Sort\"){ // By title\n aList = [cSORT.NAME, cSORT.YEAR, cSORT.ASC, cSORT.DESC, cSORT.NEW, cSORT.OLD];\n }\n else if ($this.text() == \"Manage\") {\n aList = [\"Information\", \"Hide/Show\", \"Import\", \"Refresh\", \"Remove\"]; \n }\n else\n {\n // Returns gSTATE.LIST\n GetFargoSortList($this.text(), media);\n aList = gSTATE.LIST;\n buttons = '<button type=\\\"button\\\" class=\\\"choice\\\">- Show All -</button>';\n }\n \n // Check if list exits (not empty)\n if (aList) \n { \n // SlimScroll fix.\n if ($scroll.length) \n {\n $scroll.css('height', '');\n $(\".ui-draggable\").css({'width':'0px', 'top':'0px'});\n $btns.css('height', '');\n }\n \n // Reset old buttons.\n $($btns).text(\"\");\n\n // Show buttons\n $.each(aList, function(i, value) \n {\n if (value != \"\") {\n buttons += '<button type=\\\"button\\\" class=\\\"choice\\\">' + value + '</button>';\n } \n });\n $($btns).append(buttons);\n \n height_box = $(\"#buttons_box\").css('height');\n if (parseInt(height_box) >= 500)\n { \n $($btns).slimScroll({\n height:478,\n color:'gray',\n alwaysVisible:true\n });\n \n // SlimScroll height fix.\n $scroll.css('height', '478px');\n $(\".ui-draggable\").css('width','7px');\n $btns.css('height', '478px');\n \n $($btns).children().last().css({\"margin-bottom\":\"20px\"});\n }\n \n // Change button box position.\n //$(\"#buttons_box\").css('top', '15%');\n \n ShowPopupBox(\"#buttons_box\", $this.text());\n SetState(\"page\", \"popup\");\n }\n}", "function initBtns(){\n okbtn = {\n x: (width - s_buttons.Ok.width)/2,\n y : height/1.8,\n width : s_buttons.Ok.width,\n height :s_buttons.Ok.height\n };\n \n startbtn = {\n x: (width - s_buttons.Score.width)/2,\n y : height/2.5,\n width : s_buttons.Score.width,\n height :s_buttons.Score.height\n };\n \n scorebtn = {\n x: (width - s_buttons.Score.width)/2,\n y : height/2,\n width : s_buttons.Score.width,\n height :s_buttons.Score.height\n };\n \n menubtn = {\n x:(width - 2*s_buttons.Menu.width),\n y : height/1.8,\n width : s_buttons.Menu.width,\n height :s_buttons.Menu.height\n };\n \n resetbtn = {\n x: (s_buttons.Reset.width),\n y : height/1.8,\n width : s_buttons.Reset.width,\n height :s_buttons.Reset.height\n };\n}", "function do_button_select(oldbtn, newbtn) {\n switch (oldbtn) {\n case \"div_button_home\":\n $(\"#div_content_home\").fadeOut(divsConfig.fadeSpeed);\n break;\n case \"div_button_map\":\n break;\n case \"div_button_data\": $(\"#div_content_data\").fadeOut(divsConfig.fadeSpeed);\n break;\n case \"div_button_upload\": \n window.open(htmllinks.upload, \"espupload\");\n break;\n case \"div_button_contact\": $(\"#div_content_contact\").fadeOut(divsConfig.fadeSpeed);\n break;\n case \"div_button_help\": $(\"#div_content_help\").fadeOut(divsConfig.fadeSpeed);\n break;\n }\n switch (newbtn) {\n case \"div_button_home\":\n $(\"#div_content_home\").fadeIn(divsConfig.fadeSpeed);\n break;\n case \"div_button_map\":\n break;\n case \"div_button_data\":\n $(\"#div_content_data\").fadeIn(divsConfig.fadeSpeed);\n break;\n case \"div_button_upload\": \n window.open(htmllinks.upload, \"espupload\");\n break;\n case \"div_button_contact\": $(\"#div_content_contact\").fadeIn(divsConfig.fadeSpeed);\n break;\n case \"div_button_help\": $(\"#div_content_help\").fadeIn(divsConfig.fadeSpeed);\n break;\n }\n}", "function setupModeButtons(){\n for(var i = 0; i < modeButtons.length; i++ ){\n modeButtons[i].addEventListener(\"click\", function(){\n modeButtons[0].classList.remove(\"selected\"); \n modeButtons[1].classList.remove(\"selected\");\n this.classList.add(\"selected\");\n this.textContent === \"Easy\" ? numSquare = 3: numSquare = 6;\n // calling the entire reset button\n reset(); \n });\n }\n}", "function minimizeMiniBox() {\n if (isMaximizedBool) {\n allBoxes[miniBoxOnNumber].style.animation = `${minimizeVars[miniBoxOnNumber]} 0.3s ease-out forwards`;\n unHideRest(allBoxes[miniBoxOnNumber]);\n isMaximizedBool = false;\n // turn on onclick for menu button\n\n document.getElementById('tray-button-div').style.animation = 'opacityFadeIn 0.25s ease-out forwards';\n document.getElementById('tray-button-div').style.animation = 'arrowPulseAnim 3s infinite ease-in-out';\n }\n}", "function minimizeMiniBox() {\n if (isMaximizedBool) {\n allBoxes[miniBoxOnNumber].style.animation = `${minimizeVars[miniBoxOnNumber]} 0.3s ease-out forwards`;\n unHideRest(allBoxes[miniBoxOnNumber]);\n isMaximizedBool = false;\n // turn on onclick for menu button\n\n document.getElementById('tray-button-div').style.animation = 'opacityFadeIn 0.25s ease-out forwards';\n document.getElementById('tray-button-div').style.animation = 'arrowPulseAnim 3s infinite ease-in-out';\n }\n}", "function perspective(whichBtn) {\n switch (whichBtn) {\n case 1: \n btn1.style.backgroundColor = \"#75E0F4\";\n btn2.style.backgroundColor = \"#141414\"; \n btn3.style.backgroundColor = \"#141414\";\n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 1X\";\n break;\n case 2: \n btn1.style.backgroundColor = \"#75E0F4\";\n btn2.style.backgroundColor = \"#75CDF4\"; \n btn3.style.backgroundColor = \"#141414\"; \n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 2X\"; \n break;\n case 3: \n btn1.style.backgroundColor = \"#75E0F4\";\n btn2.style.backgroundColor = \"#75CDF4\"; \n btn3.style.backgroundColor = \"#75B4F4\"; \n btn4.style.backgroundColor = \"#141414\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 3X\"; \n break;\n case 4: \n btn1.style.backgroundColor = \"#75E0F4\";\n btn2.style.backgroundColor = \"#75CDF4\"; \n btn3.style.backgroundColor = \"#75B4F4\"; \n btn4.style.backgroundColor = \"#75A1F4\"; \n btn5.style.backgroundColor = \"#141414\";\n zoom.innerHTML = \"ZOOM 4X\"; \n break;\n case 5: \n btn1.style.backgroundColor = \"#75E0F4\";\n btn2.style.backgroundColor = \"#75CDF4\"; \n btn3.style.backgroundColor = \"#75B4F4\"; \n btn4.style.backgroundColor = \"#75A1F4\"; \n btn5.style.backgroundColor = \"#7589F4\";\n zoom.innerHTML = \"ZOOM 5X\"; \n break;\n }\n }", "modeBtnAction() {\n console.log('Toggling scale mode/unit')\n this._unit = trickler.TricklerUnits.GRAINS === this._unit ? trickler.TricklerUnits.GRAMS : trickler.TricklerUnits.GRAINS\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 processBtn (event) {\n\n // event.target gives you the button that was clicked\n // <button data-type=\"num\">7</button>\n var button = event.target;\n\n // gives you the data type of each button element\n var type = button.dataset.type;\n\n // if statements direct each type of button to execute a specific function\n if (type === 'num') return processNum(button);\n if (type === 'opp') return processOpp(button);\n if (type === 'negative') return processNegative(button);\n if (type === 'equal') return processEqual(button);\n if (type === 'clear') return processClear(button);\n}", "function checkScreen(){\r\n\tif ($(window).width() < 420) {\r\n \t$(\"#singlebutton\").attr('class', 'btn-sm btn-info');\r\n }else{\r\n \t$(\"#singlebutton\").attr('class', 'btn-lg btn-info');\r\n }\r\n}", "function setButton(titleOfCurrentButtonSelection) {\n $('.pharoh-button').removeClass('selected');\n $('.pharoh-button[title=\"' + titleOfCurrentButtonSelection + '\"]').addClass('selected');\n var buttonPaneTitle = titleOfCurrentButtonSelection;\n\n //General use buttons don't need to change selectmenu\n if (buttonPaneTitle == 'Controls') buttonPaneTitle = 'Default';\n if (buttonPaneTitle == 'Manual') buttonPaneTitle = 'Default';\n if (buttonPaneTitle == 'Select') buttonPaneTitle = 'Default';\n\n //clears out and displays new button pane\n $('.button-pane img').hide();\n $('.button-pane img[title=\"' + buttonPaneTitle + '\"]').show();\n //Handles creation of new select options in selectmenu\n gameEngine.hoverEntity = null;\n switch (titleOfCurrentButtonSelection) {\n case \"Housing\":\n setSelectOptions(Constants.Buildings.Housing);\n break;\n case \"Food and Farm\":\n setSelectOptions(Constants.Buildings.FoodandFarm);\n break;\n case \"Utilities\":\n setSelectOptions(Constants.Buildings.Utilities);\n break;\n case \"Storage and Distribution\":\n setSelectOptions(Constants.Buildings.StorageandDistribution);\n break;\n case \"Industrial\":\n setSelectOptions(Constants.Buildings.Industrial);\n break;\n case \"Raw Materials\":\n setSelectOptions(Constants.Buildings.RawMaterials);\n break;\n case \"Municipal\":\n setSelectOptions(Constants.Buildings.Municipal);\n break;\n case \"Roads\":\n setSelectOptions(Constants.Buildings.Roads);\n canHover = false;\n break;\n case \"Controls\":\n setSelectOptions(Constants.Buildings.Controls);\n setControlsInfoBox();\n canHover = false;\n break;\n case \"Manual\":\n setSelectOptions(Constants.Buildings.Manual);\n setManualInfoBox();\n canHover = false;\n break;\n case \"Clear Land\":\n setSelectOptions(Constants.Buildings.ClearLand);\n canHover = false;\n break;\n case \"Select\":\n setSelectOptions(Constants.Buildings.Select);\n canHover = false;\n break;\n default:\n //console.log('nuthin2seahear');\n break\n };\n}", "function quantityPressed(){\r\n //if the ores button has been pressed and the runes button has been pressed then listState = 5\r\n if (listState == 2 && rBtPress == true){\r\n listState = 5;\r\n }\r\n //a case statement that displays the quantities at different locations on the canvas depending on which combinations of buttons have been pressed\r\n switch(listState){\r\n case 1:\r\n var oreCount = 0;\r\n for (var n = 11; n< 18; n++){\r\n drawQuantity(10,oreCount,itemQuantity[n]);\r\n oreCount++;\r\n }\r\n break;\r\n case 3:\r\n for (var i = 0; i < 11; i++){\r\n if (i<7){\r\n drawQuantity(0,i,itemQuantity[i]);\r\n } else {\r\n drawQuantity(400,i-7,itemQuantity[i]);\r\n }\r\n }\r\n break;\r\n case 4:\r\n for (var i = 0; i < 11; i++){\r\n if (i<7){\r\n drawQuantity(400,i,itemQuantity[i]);\r\n } else {\r\n drawQuantity(800,i-7,itemQuantity[i]);\r\n }\r\n }\r\n var oreCount = 0;\r\n for (var n = 11; n< 18; n++){\r\n drawQuantity(10,oreCount,itemQuantity[n]);\r\n oreCount++;\r\n }\r\n break;\r\n case 5:\r\n oreCount = 0;\r\n for (var n = 11; n< 18; n++){\r\n if (oreCount < 3) {\r\n drawQuantity(400,oreCount+4,itemQuantity[n]);\r\n oreCount++;\r\n } else {\r\n drawQuantity(800,oreCount-3,itemQuantity[n]);\r\n oreCount++;\r\n }\r\n }\r\n for (var i = 0; i < 11; i++){\r\n if (i<7){\r\n drawQuantity(0,i,itemQuantity[i]);\r\n } else {\r\n drawQuantity(400,i-7,itemQuantity[i]);\r\n }\r\n }\r\n break;\r\n }\r\n }", "function setupModeButtons(){\n\tfor (var i = 0; i < modeButtons.length; i++){\n\t\tmodeButtons[i].addEventListener(\"click\", function() {\n\t\t\tmodeButtons[0].classList.remove(\"selected\");\n\t\t\tmodeButtons[1].classList.remove(\"selected\");\n\t\t\tthis.classList.add(\"selected\");\n\t\t\tthis.textContent === \"Easy\" ? numCircles = 3 : numCircles = 6;\n\t\t\treset();\n\t\t});\n\t}\n}", "function showMore() {\r\n\t\tvar chooseOneSpace = document.getElementById(\"chooseOne\");\r\n\t\tvar chooseOne = document.createElement(\"p\");\r\n\t\tchooseOne.appendChild(document.createTextNode('Choose One:'));\r\n\t\tchooseOne.style.fontFamily = \"Tahoma\";\r\n\t\tchooseOne.style.fontSize = \"15px\";\r\n\t\tchooseOne.style.marginTop = \"30px\";\r\n\t\tchooseOneSpace.appendChild(chooseOne);\r\n\r\n\t\tvar smallButtons = new Array();\r\n\t\t\r\n\t\t//FIRST ROW\r\n\t\tvar firstRow = document.getElementById(\"firstRow\");\r\n\t\tsmallButtons[0] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[1] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[2] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[0].onclick = function() {\r\n\t\t\tstayLit(0);\r\n\t\t};\r\n\t\tsmallButtons[1].onclick = function() {\r\n\t\t\tstayLit(1);\r\n\t\t};\r\n\t\tsmallButtons[2].onclick = function() {\r\n\t\t\tstayLit(2);\r\n\t\t};\r\n\t\tfirstRow.appendChild(smallButtons[0]);\r\n\t\tfirstRow.appendChild(smallButtons[1]);\r\n\t\tfirstRow.appendChild(smallButtons[2]);\r\n\r\n\t\t//SECOND ROW\r\n\t\tvar secondRow = document.getElementById(\"secondRow\");\r\n\t\tsmallButtons[3] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[4] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[5] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[3].onclick = function() {\r\n\t\t\tstayLit(3);\r\n\t\t};\r\n\t\tsmallButtons[4].onclick = function() {\r\n\t\t\tstayLit(4);\r\n\t\t};\r\n\t\tsmallButtons[5].onclick = function() {\r\n\t\t\tstayLit(5);\r\n\t\t};\r\n\t\tsecondRow.appendChild(smallButtons[3]);\r\n\t\tsecondRow.appendChild(smallButtons[4]);\r\n\t\tsecondRow.appendChild(smallButtons[5]);\r\n\r\n\t\t//THIRD ROW\r\n\t\tvar thirdRow = document.getElementById(\"thirdRow\");\r\n\t\tsmallButtons[6] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[7] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[8] = document.createElement(\"BUTTON\");\r\n\t\tsmallButtons[6].onclick = function() {\r\n\t\t\tstayLit(6);\r\n\t\t};\r\n\t\tsmallButtons[7].onclick = function() {\r\n\t\t\tstayLit(7);\r\n\t\t};\r\n\t\tsmallButtons[8].onclick = function() {\r\n\t\t\tstayLit(8);\r\n\t\t};\r\n\t\tthirdRow.appendChild(smallButtons[6]);\r\n\t\tthirdRow.appendChild(smallButtons[7]);\r\n\t\tthirdRow.appendChild(smallButtons[8]);\r\n\r\n\t\t//Used to determine which button is blue\r\n\t\tvar buttonChoice = -1;\r\n\t\t\r\n\t\t//Keeps a Button blue after it has been clicked\r\n\t\tfunction stayLit(i) {\r\n\r\n\t\t\tfor (j = 0; j < smallButtons.length; j++) {\r\n\t\t\t\tif (j != i) {\r\n\t\t\t\t\tsmallButtons[j].style.backgroundImage = null;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsmallButtons[i].style.backgroundImage = \"url(blue.png)\";\r\n\t\t\t\t\tbuttonChoice = i;\r\n\t\t\t\t\treplace(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar replaceWith = document.createElement(\"p\");\r\n\r\n\t\t//Processes the replacement request by the user to change an image/link\r\n\t\tfunction replace(i) {\r\n\t\t\tvar replaceSpace = document.getElementById(\"replaceWrapper\");\r\n\t\t\tif (replaceSpace.hasChildNodes() === true) {\r\n\t\t\t\treplaceWith.innerHTML = '';\r\n\t\t\t\treplaceSpace.innerHTML = '';\r\n\t\t\t}\r\n\r\n\t\t\treplaceWith.appendChild(document.createTextNode('Replace With:'));\r\n\t\t\treplaceWith.setAttribute(\"id\", \"replaceWith\");\r\n\t\t\treplaceWith.style.fontFamily = \"Tahoma\";\r\n\t\t\treplaceWith.style.fontSize = \"15px\";\r\n\t\t\treplaceWith.style.marginTop = \"20px\";\r\n\t\t\treplaceSpace.appendChild(replaceWith);\r\n\r\n\t\t\tvar select = document.createElement(\"select\");\r\n\t\t\tselect.setAttribute(\"name\", \"selector\");\r\n\t\t\tselect.setAttribute(\"id\", \"selector\");\r\n\r\n\t\t\tvar selectValue = 0;\r\n\t\t\tselect.onchange = function() {\r\n\t\t\t\tselectValue = select.selectedIndex;\r\n\t\t\t};\r\n\r\n\t\t\tvar option;\r\n\t\t\t\r\n\t\t\t//Setup Options\r\n\t\t\tfor(var i = 0; i < websiteNameList.length; i++){\r\n\t\t\t\toption = document.createElement(\"option\");\r\n\t\t\t\toption.innerHTML = websiteNameList[i];\r\n\t\t\t\tselect.appendChild(option);\t\r\n\t\t\t}\r\n\r\n\t\t\treplaceSpace.appendChild(select);\r\n\r\n\t\t\t//Setup Replace Button\r\n\t\t\tvar okay = document.createElement(\"BUTTON\");\r\n\t\t\tokay.appendChild(document.createTextNode('Replace'));\r\n\t\t\tokay.style.fontFamily = \"Tahoma\";\r\n\t\t\tokay.style.fontSize = \"15px\";\r\n\t\t\tokay.style.marginTop = \"10px\";\r\n\t\t\tokay.setAttribute(\"class\", \"finalize\");\r\n\r\n\t\t\tokay.onclick = function() {\r\n\t\t\t\tbuttons[buttonChoice].style.backgroundImage = buttonPics[selectValue];\r\n\t\t\t\tsavedOrder[buttonChoice] = selectValue;\r\n\t\t\t\tlocalStorage.setItem(buttonChoice.toString(), JSON.stringify(selectValue));\r\n\t\t\t\tbuttons[buttonChoice].onclick = function() {\r\n\t\t\t\t\topenPage(selectValue);\r\n\t\t\t\t};\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t//Setup Cancel Button\r\n\t\t\tvar cancel = document.createElement(\"BUTTON\");\r\n\t\t\tcancel.appendChild(document.createTextNode('Cancel'));\r\n\t\t\tcancel.style.fontFamily = \"Tahoma\";\r\n\t\t\tcancel.style.fontSize = \"15px\";\r\n\t\t\tcancel.style.marginTop = \"10px\";\r\n\t\t\tcancel.setAttribute(\"class\", \"finalize\");\r\n\t\t\t\r\n\t\t\tcancel.onclick = function() {\r\n\t\t\t\tchooseOne.innerHTML = \"\";\r\n\t\t\t\tfirstRow.innerHTML = \"\";\r\n\t\t\t\tsecondRow.innerHTML = \"\";\r\n\t\t\t\tthirdRow.innerHTML = \"\";\r\n\t\t\t\treplaceSpace.innerHTML = \"\";\r\n\r\n\t\t\t\tcustomize.onclick = function() {\r\n\t\t\t\t\tshowMore();\r\n\t\t\t\t};\r\n\t\t\t};\r\n\r\n\t\t\t//Add them to the customize body\r\n\t\t\treplaceSpace.appendChild(okay);\r\n\t\t\treplaceSpace.appendChild(cancel);\r\n\r\n\t\t}\r\n\r\n\t}", "function productTableFun(e) {\r\n if (globalObj.closest(e.target, '.btn-plus')) {\r\n // Plus Button\r\n productPlusMinusBtn(globalObj.closest(e.target, '.btn-plus'), true);\r\n } else if (globalObj.closest(e.target, '.btn-minus')) {\r\n // Minus Button\r\n productPlusMinusBtn(globalObj.closest(e.target, '.btn-minus'), false);\r\n } else if (globalObj.closest(e.target, '.pic')) {\r\n // Zoom Product Image\r\n productZoomImg(globalObj.closest(e.target, '.pic'));\r\n } else if (globalObj.closest(e.target, '.len-btn')) {\r\n // More - Less description button\r\n productMoreLessBtn(globalObj.closest(e.target, '.len-btn'));\r\n } else if (globalObj.closest(e.target, '.btn-delete-icon')) {\r\n // Delete Item\r\n let rowItem = globalObj.closest(e.target, '.row-container');\r\n globalObj.status.prodcutDropDown = true;\r\n globalObj.status.currRowItem = rowItem;\r\n globalObj.status.currRowItemHeight = rowItem.offsetHeight;\r\n productDeleteDropList(globalObj.closest(e.target, '.btn-delete-icon'));\r\n } else if (globalObj.closest(e.target, '.btn-add')) {\r\n // Add Optional item button\r\n let rowItem = globalObj.closest(e.target, '.row-container'),\r\n rowLen = rowItem.parentElement.children.length,\r\n description = rowItem.querySelector('.description');\r\n // Check for last item in optional list then hide optional title with the item\r\n if (rowLen <= 1) {\r\n globalObj.status.hideRowTitle = true;\r\n }\r\n // check for item description if open close it first\r\n if (description.classList.contains('active')) {\r\n productMoreLessBtn(description.querySelector('.len-btn'));\r\n }\r\n // check for empty list then remove it\r\n if (globalObj.status.emptyList) {\r\n globalObj.status.emptyList = false;\r\n rowItem.parentElement.parentElement.querySelector('.empty-row').remove();\r\n // Approve button status\r\n approveBtnStatus();\r\n }\r\n globalObj.status.currRowItem = rowItem;\r\n globalObj.status.currRowItemHeight = rowItem.offsetHeight;\r\n productAddOptItem();\r\n }\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}", "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 }", "function changeDefaultModeButtons(type) {\n if (type === \"M\") {\n document.getElementById(\"btnActualizar\").style.display = \"inline\";\n document.getElementById(\"btnEliminar\").style.display = \"inline\";\n document.getElementById(\"btnBuscar\").style.display = \"inline\";\n document.getElementById(\"btnCancelar\").style.display = \"inline\";\n document.getElementById(\"btnGuardar\").style.display = \"inline\";\n // if (!isPrm) {\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n // }\n }\n else if (type === \"C\" || type === \"E\" || type === \"U\") {\n document.getElementById(\"btnActualizar\").style.display = \"none\";\n document.getElementById(\"btnEliminar\").style.display = \"none\";\n document.getElementById(\"btnBuscar\").style.display = \"inline\";\n document.getElementById(\"btnCancelar\").style.display = \"inline\";\n if (type === \"C\") {\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n } else {\n document.getElementById(\"btnGuardar\").style.display = \"inline\";\n }\n }\n}", "function changeMediumFn(scope) {\n\t/** Set all background image light alpha as 0 */\n\tfor ( var i=1; i<5; i++ ) {\n\t\tgetChild(\"side_view_bg\"+i, side_view_container).alpha = 0;\n\t}\n\tswitch(scope.medium){\n\t \t/** Selected medium is Air */\n\t\tcase \"1\": \n\t\t\tgetChild(\"side_view_bg1\", side_view_container).alpha = 1;\n\t\t\tbreak;\n\t\t/** Selected medium is Helium */\n\t\tcase \"1.000034\": \n\t\t\tgetChild(\"side_view_bg2\", side_view_container).alpha = 1;\n\t\t \tbreak;\n\t\t/** Selected medium is Hydrogen */ \n\t\tcase \"1.000138\": \n\t\t\tgetChild(\"side_view_bg3\", side_view_container).alpha = 1;\n\t\t \tbreak;\n\t\t/** Selected medium is Carbon Dioxide */\n\t\tcase \"1.000449\": \n\t\t\tgetChild(\"side_view_bg4\", side_view_container).alpha = 1;\n\t\t \tbreak;\t\n\t} \n\tcalculateBrewstersAngle(scope); /** Brewsters angle and current calculated in this function */\n\tbrewsters_stage.update();\n}", "function largeImg(e) {\r\n let size = \"w_400\";\r\n\r\n document.querySelector(\"#main\").style.display = \"none\";\r\n document.querySelector(\"#hidden\").style.display = \"grid\";\r\n\r\n let img = document.querySelector(\"#bigImg\");\r\n img.src = `https://res.cloudinary.com/funwebdev/image/upload/${size}/art/paintings/${e.target.value}`;\r\n\r\n let biggerImg = document.querySelector(\"#biggerImg\");\r\n img.addEventListener(\"click\", function () {\r\n let biggerSize = \"w_700\";\r\n document.querySelector(\"#hiddenDiv\").style.display = \"none\";\r\n document.querySelector(\"#bigImg\").style.display = \"none\";\r\n document.querySelector(\"#closeButton\").style.display = \"none\";\r\n document.querySelector(\"#hidden\").style.display = \"none\";\r\n biggerImg.style.margin = \"auto\";\r\n biggerImg.style.display = \"block\";\r\n biggerImg.src = `https://res.cloudinary.com/funwebdev/image/upload/${biggerSize}/art/paintings/${e.target.value}`\r\n });\r\n\r\n biggerImg.addEventListener(\"click\", function() {\r\n biggerImg.style.display = \"none\";\r\n document.querySelector(\"#hidden\").style.display = \"grid\";\r\n document.querySelector(\"#hiddenDiv\").style.display = \"inline\";\r\n document.querySelector(\"#bigImg\").style.display = \"inline\";\r\n document.querySelector(\"#closeButton\").style.display = \"inline\";\r\n\r\n });\r\n\r\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 InsertButtonsToToolBar()\n{\n//Strike-Out Button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\",\n \"speedTip\": \"Strike\",\n \"tagOpen\": \"<s>\",\n \"tagClose\": \"</s>\",\n \"sampleText\": \"Strike-through text\"}\n//Line break button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png\",\n \"speedTip\": \"Line break\",\n \"tagOpen\": \"<br />\",\n \"tagClose\": \"\",\n \"sampleText\": \"\"}\n//Superscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png\",\n \"speedTip\": \"Superscript\",\n \"tagOpen\": \"<sup>\",\n \"tagClose\": \"</sup>\",\n \"sampleText\": \"Superscript text\"}\n//Subscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png\",\n \"speedTip\": \"Subscript\",\n \"tagOpen\": \"<sub>\",\n \"tagClose\": \"</sub>\",\n \"sampleText\": \"Subscript text\"}\n//Small Text\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png\",\n \"speedTip\": \"Small\",\n \"tagOpen\": \"<small>\",\n \"tagClose\": \"</small>\",\n \"sampleText\": \"Small Text\"}\n//Comment\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png\",\n \"speedTip\": \"Insert hidden Comment\",\n \"tagOpen\": \"<!-- \",\n \"tagClose\": \" -->\",\n \"sampleText\": \"Comment\"}\n//Gallery\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png\",\n \"speedTip\": \"Insert a picture gallery\",\n \"tagOpen\": \"\\n<gallery>\\n\",\n \"tagClose\": \"\\n</gallery>\",\n \"sampleText\": \"Image:Example.jpg|Caption1\\nImage:Example.jpg|Caption2\"}\n//Block Quote\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png\",\n \"speedTip\": \"Insert block of quoted text\",\n \"tagOpen\": \"<blockquote>\\n\",\n \"tagClose\": \"\\n</blockquote>\",\n \"sampleText\": \"Block quote\"}\n// Table\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png\",\n \"speedTip\": \"Insert a table\",\n \"tagOpen\": '{| class=\"wikitable\"\\n|-\\n',\n \"tagClose\": \"\\n|}\",\n \"sampleText\": \"! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3\"}\n}", "function changeMode(md){\r\n\tif(md === 3){\r\n\t\tmode = md;\r\n\t\tresetColors();\r\n\r\n\t\t// hide squares if colors array isnt big enough\r\n\t\tfor(var i = 0; i < squares.length ; i++){\r\n\t\t\tif(colors[i]){\r\n\t\t\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsquares[i].style.display = \"none\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\teasyBtn.classList.add(\"modeSelected\");\r\n\t\thardBtn.classList.remove(\"modeSelected\");\r\n\t}\r\n\telse{\r\n\t\tmode = md;\r\n\t\tresetColors();\r\n\r\n\t\tfor(var i = 0; i < squares.length ; i++){\r\n\t\t\t\r\n\t\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t\t\tsquares[i].style.display = \"block\";\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\teasyBtn.classList.remove(\"modeSelected\");\r\n\t\thardBtn.classList.add(\"modeSelected\");\r\n\t}\r\n}", "function ButtonClick(event) {\n // store which button has been clicked in currentButton\n //let currentButton = event.currentTarget; <- one way of getting a ref to the button\n let currentButton = event.currentTarget;\n switch (currentButton.getAttribute(\"id\")) {\n case \"HideButton\":\n FirstProjectImage.style.display = \"none\";\n break;\n case \"HalfSizeButton\":\n FirstProjectImage.style.maxWidth = \"50%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ThreeQuarterSizeButton\":\n FirstProjectImage.style.maxWidth = \"75%\";\n FirstProjectImage.style.display = \"block\";\n break;\n case \"ShowButton\":\n FirstProjectImage.style.display = \"block\";\n FirstProjectImage.style.maxWidth = \"100%\";\n break;\n }\n }", "function setupButton() {\n for(var i = 0; i < diffButton.length; i++) {\n diffButton[i].classList.remove(\"selected\");\n }\n this.classList.add(\"selected\");\n this.textContent === \"Easy\" ? numberOfSquares = 3 : numberOfSquares = 6;\n gameReset();\n}", "function buttonsFontResize() {\n buttons = document.querySelectorAll(\".btn\");\n buttons.forEach(button => {\n if (\n (button.id != undefined) &\n (button.id.includes(\"login\") || button.id.includes(\"register\") || button.id.includes(\"demo\"))\n )\n button.style[\"font-size\"] =\n document.body.clientWidth * (75 / 1280) + \"px\";\n });\n }", "function setsize() {\n gsap.to(indexbtnitemcontainer, { duration: 0.9, ease: \"expo.out\", y: -(current_index * 65) });\n // gsap.to(indexbtn, { duration: 1.5, ease: \"expo.out\", height: \"65px\" });\n gsap.to(indexbtn, { duration: 0.9, ease: \"expo.out\", width: indexbtnitem[current_index].offsetWidth + \"px\" });\n // gsap.to(indexbtn, { duration: 1.5, ease: \"expo.out\", borderRadius: \"50px\" });\n\n}", "function storageCost(stroageType){\n // storage button call here \n const storagePrice = document.getElementById(stroageType);\n // Storage Button 256GB call here \n const storagePrice256gb = document.getElementById(\"storage-256gb\");\n // Storage Button 512GB call here \n const storagePrice512gb = document.getElementById(\"storage-512gb\");\n // Storage Button 1TB call here \n const storagePrice1tb = document.getElementById(\"storage-1tb\");\n // storage price showing place call here \n const storagePriceReset = document.getElementById(\"previous-storage-cost\");\n // for 256GB storage price is change here\n if(storagePrice==storagePrice256gb){\n storagePriceReset.innerText = 0;\n }\n // for 512GB storage price is change here\n else if(storagePrice==storagePrice512gb){\n storagePriceReset.innerText = 100;\n }\n // for 1TB storage price is change here\n else if(storagePrice==storagePrice1tb){\n storagePriceReset.innerText = 180;\n }\n // calculation total price function call here \n total();\n}", "function boxSizingProp(){\n //if borderBox is true/ btn press\n if(this.id == 'borderBox'){\n boxBoolean = true;\n bs = 'border-box';\n this.classList.add('selected');\n contentBoxBtn.classList.remove('selected');\n borderBoxCode.style.display = 'block';\n }else{\n //contentBox is true/ btn press\n boxBoolean = false;\n bs = 'content-box';\n this.classList.add('selected');\n borderBoxBtn.classList.remove('selected');\n borderBoxCode.style.display = 'none';\n } \n reset();\n}", "function visualshowStyle(){\n showStyle = true;\n showTransition = false; \n chooseMusic = false; \n chooseStyle = false; \n button9.hide();\n button4.hide();\n}", "handleButton() {}", "function addPopup(text,x,y,cutout,name=\"popup\") {\n interface.buttonArray.forEach(function (elem) {\n if (elem.name === \"animal_image\") {\n var currIndex = ui_values.animalAry.indexOf(ui_values.currentAnimal);\n var src = ui_values.animalStaticAry;\n elem.setSrc(src[currIndex], src[currIndex], false);\n }\n });\n\tvar button = new Button(function() {\n\t switch(true){\n\t case(dataObj.tutorialProgress == 0):\n\t addPopup(\"It's your first time here,\\nso I'm going to show\\nyou around the place!\",100, 40);\n\t interface.draw();\n\t break;\n\t case(dataObj.tutorialProgress == 1):\n\t addPopup(\"This is your Nature\\nJournal.\",150, 90);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 2):\n addPopup(\"Here on the left\\npage, you can\\ncall animals to explore\\nthe world.\",150, 90,[20,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 3):\n addPopup(\"On the right\\npage, you can\\nsee your animals as\\nthey explore.\",700, 90,[514,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 4):\n addPopup(\"Your Nature Journal\\nuses two currencies,\\nsteps and tracks.\",150, 90,[71,25,410,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 5):\n addPopup(\"These are your Steps.\\nYou get these by walking\\naround with your Fitbit\\nand are used to call animals.\",71, 90, [143,25,113,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 6):\n addPopup(\"These are your Tracks.\\nYour animals make these\\nas they explore. You will\\nuse tracks to upgrade\\nyour animals.\",240, 90, [282,27,175,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 7):\n addPopup(\"There are four different\\nanimal types you can\\ncall to travel the world.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 8):\n addPopup(\"Each has their own\\nstrengths and\\nweaknesses.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 9):\n addPopup(\"You can add an animal\\nby selecting its icon\\nabove, then clicking\\nthe button to the right.\",60, 250, [283,399,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 10):\n addPopup(\"Let's send out\\na new animal so we\\ncan continue!\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 11):\n addPopup(\"Choose wisely! This animal\\nwill be with you for your\\nentire nature walk.\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 13):\n addPopup(\"Your animals will face\\na number of harrowing\\nchallenges. Those events\\nwill be shown here.\",300, 200, [533,25,445,207]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 14):\n addPopup(\"Your animal has three\\nstatistics that it will\\nuse to overcome these\\nchallenges.\",260, 220,[72,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 15):\n addPopup(\"Speed, Evasion, and\\nStrength.\",260, 215,[73,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 16):\n addPopup(\"You can increase your \\nanimal's statistics with \\ntracks via the\\nupgrade button.\",250, 300, [63,400,124,50]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 17):\n addPopup(\"Failing these challenges \\ncould slow down, or even \\nkill your animals, so level\\nthem up when you can.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 18):\n addPopup(\"You can select your\\nanimals by clicking on \\ntheir icons down \\nhere.\",150, 300, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 19):\n addPopup(\"Try selecting your\\nfirst animal.\",250, 400, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 21):\n addPopup(\"You can upgrade animals\\nin two ways.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 22):\n addPopup(\"You can upgrade\\nindividual animals or the\\nbase level of animals.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 23):\n addPopup(\"Upgrading individuals\\nis cheaper, but if they\\nleave or die you will have\\nto level them up again\\nfrom the base.\",250, 300, [94,450,52,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 24):\n addPopup(\"Upgrading the base\\nlevel changes what level\\nyour animals start at,\\neven through death.\",250, 150,[84,114,71,71]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 25):\n addPopup(\"Keeping a healthy balance\\nof the two will keep your\\nanimals collecting as long\\nas possible.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n \n case(dataObj.tutorialProgress == 26):\n addPopup(\"Right now you can have\\na maximum of five\\nanimals, and each animal\\nwill only walk with you\\nfor 24 hours before leaving\",250, 300, [83,450,320,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 27):\n addPopup(\"But keep exploring and\\nyou will be able to\\nhave more than five!\",300, 250);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 28):\n addPopup(\"Speaking of exploring,\\nyour animals are walking\\nthrough what's called\\nan area.\",700, 300,[600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 29):\n addPopup(\"If you keep collecting \\nsteps with your Fitbit\\nyou'll unlock more areas.\",700, 300, [600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n //Here are 4000 more steps to get you there. You can call more animals with these. \n //When you get to a certain number of steps, this arrow will advance you to the next area. Click it!\n case(dataObj.tutorialProgress == 30):\n addPopup(\"We will give you\\n4000 more steps\\nto get you there.\",700, 300);\n dataObj.steps += 4000;\n stepCount += 4000\n dataObj.totalSteps += 4000;\n dataObj.priorSteps -= 4000;\n\n //dataObj.tutorialProgress++;\n areaNext.update();\n break;\n case(dataObj.tutorialProgress == 31):\n addPopup(\"When a new area is\\navailable, click this\\narrow to move there\\nwith your animals.\",700, 300, [843,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 33):\n addPopup(\"But never fear! If an\\narea proves too hard for\\nyour animals you can go\\nback to an easier one.\",700, 300, [618,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 34):\n addPopup(\"That's all you need\\nto know!\",500, 250);\n //dataObj.tutorialProgress++;\n break; \n case(dataObj.tutorialProgress == 35):\n addPopup(\"Now get out there,\\njournal in hand, and\\nget to nature walking!\",500, 250);\n //tutorialProgress++;\n //console.log(dataObj.tutorialProgress);\n break; \n }\n dataObj.tutorialProgress++;\n\t\tremovePopup(this);\n\t});\n\tbutton.setSrc(\"image_resources/Tooltip.png\");\n\tbutton.setSpriteAttributes(x,y,228,150, name)\n if (dataObj.tutorialProgress === 22) {\n button.setSpriteAttributes(x,y,228,170, name)\n }\n\tbutton.hasTextValue = true;\n\tbutton.fontSize = '20px';\n\tcharnum = text.length;\n //console.log(\"Button Created: \" + button.x + \" \" + button.onMouseUpImageSrc);\n\tbutton.setText([text], (button.width / 2) - (6.3 * charnum), 5);\n if (dataObj.tutorialProgress === 11) {\n console.log(\"Check Progress: \" + dataObj.tutorialProgress);\n button.updateText([text], ['red'])\n }\n button.cutout = function (ary) {\n //console.log(ary);\n ctx.globalAlpha = 0.3\n ctx.fillStyle=\"#f0c840\";\n ctx.fillRect(ary[0], ary[1], ary[2], ary[3]);\n ctx.globalAlpha = 1.0\n ctx.fillStyle=\"black\"\n }\n button.draw = function(){\n\t ctx.globalAlpha = 0.3;\n\t ctx.fillRect(0, 0, canvas.width, canvas.height, 'black');\n\t ctx.globalAlpha = 1.0;\n //console.log(this.cutoutParams);\n if (cutout) {\n this.cutout(cutout);\n }\n\t ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n\t if ((this.hovered && this.text !== undefined) || this.hasTextValue || this.hasTooltip){\n if (this.text === undefined) {\n //console.log(this.name);\n } else {\n var strArray = this.text[0].split(/\\n/);\n //var clrIndex = this.text[0].indexOf(/\\f/);\n //console.log(this.text[0].indexOf('*'));\n for(var s = 0; s < strArray.length; s++){\n //Highlighting code here.\n drawText([strArray[s]], this.x + 3, this.y + this.textOffsetY + (28*s), this.fontSize, this.color);\n }\n }\n if (this.tooltip != undefined && cursor.x != undefined && cursor.y != undefined && this.hovered) {\n drawText(this.tooltip,cursor.x+5,cursor.y+5)\n }\n }\n\t}\n\tpushPopup(button);\n}", "function setupUI(){\n //change theme based on the user click on button\n document.querySelector(\".magicTheme\").onclick = function(e){\n \n //checks to see if the magicMode is T or F and switches it\n if(magicTheme==true){\n //while magicMode is T,\n magicTheme=false;\n //change the inner html of the button\n document.querySelector(\".magicTheme\").innerHTML = \"Magic Girl Mode\";\n //switch music\n playStream(audioElement,'media/New Adventure Theme.mp3');\n //have music selected\n document.getElementById('New_Adventure_Theme').className = \"selected\"; \n \n //\"options\" return to its original colors by changing class\n document.getElementById('songList').className = \"options\";\n document.getElementById('mode').className = \"options\";\n \n //change the button looks\n document.querySelector(\".magicTheme\").className = \"magicTheme\";\n }\n else{\n magicTheme=true;\n \n //change the inner html of the button\n document.querySelector(\".magicTheme\").innerHTML = \"Boring Life Mode\";\n //switch music\n playStream(audioElement,'media/Precure Princess Engage.mp3');\n \n //remove selection off of last played song\n document.getElementById(selectedSong).className = \" \";\n \n //\"options\" change colors by adding another class\n document.getElementById('songList').className = \"options magicalColors\";\n document.getElementById('mode').className = \"options magicalColors\";\n \n //change how the button looks by adding another calss\n document.querySelector(\".magicTheme\").className = \"magicTheme changeTheme\";\n } \n };\n \n //change the song when song is clicked\n document.querySelector(\"#New_Adventure_Theme\").onclick = changeSong;\n document.querySelector(\"#Castle_In_The_Sky\").onclick = changeSong;\n document.querySelector(\"#Through_The_Danger\").onclick = changeSong; \n\n //checks to see what mode the user clicks and calls the changeMode method\n document.querySelector(\"#frequency\").onclick = changeMode;\n document.querySelector(\"#wave\").onclick = changeMode;\n }", "function button_style(temp) {\n\tswitch(temp){\n\t\tcase 'Point':\n\t\tcase 'MultiPoint':{\n\t\t\twhile(i == 1){\n\t\t\t\tvar buttonlayer = document.createElement('button');\n\t\t\t\t\tbuttonlayer.setAttribute('class', 'layers');\n\t\t\t\t\tbuttonlayer.innerHTML = 'Point';\n\t\t\t\t\t\n\t\t\t\t\t$(\"buttonlayer\").click(function() {\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tif ($this.hasClass(\"clicked-once\")) {\n\t\t\t\t\t\t\t// already been clicked once, hide it\n\t\t\t\t\t\t\t$this.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// first time this is clicked, mark it\n\t\t\t\t\t\t\t$this.addClass(\"clicked-once\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\tdiv.appendChild(buttonlayer);\n\t\t\t\t\tbuttonlayer.addEventListener(\"click\", function (){\n\t\t\t\t\t\tif (temp == 'Point' || temp == 'MultiPoint' )\n\t\t\t\t\t\t{\t$('#myPoint').css('display','block');\n\t\t\t\t\t\t $('#myLine').css('display','none');\n\t\t\t\t\t\t $('#myPolygon').css('display','none');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t//remove button and function\n\t\t\t\tvar remove = document.createElement('button');\n\t\t\t\t\tremove.setAttribute('class', 'remo');\n\t\t\t\t\tremove.innerHTML = 'X';\n\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\tdiv.appendChild(remove);\n\t\t\t\t\tremove.addEventListener(\"click\", function (){\n\t\t\t\t\t\tvar list=document.getElementsByClassName(\"remo\");\n\t\t\t\t\t\t\tlist = [].slice.call(list); \n\t\t\t\t\t\tvar a = list.indexOf(remove);\n\t\t\t\t\t\t\tconsole.log(a);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmap.removeLayer(map.getLayers().item(a+1));\n\t\t\t\t\t\t$( \".layers\" )[a].remove();\n\t\t\t\t\t\t$(\".remo\")[a].remove();\n\t\t\t\t\t\t$(\"#myPoint\").hide();\n\t\t\t });\n\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t};\n\t\tcase 'LineString':\n\t\tcase 'MultiLineString': {\n\t\t\twhile(i == 1){\n\t\t\t\tvar buttonlayer = document.createElement('button');\n\t\t\t\t\tbuttonlayer.setAttribute('class', 'layers');\n\t\t\t\t\tbuttonlayer.innerHTML = 'Line';\n\n\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\tdiv.appendChild(buttonlayer);\n\t\t\t\t\tbuttonlayer.addEventListener(\"click\", function (){\n\t\t\t\t\t\tif ( temp == 'LineString' || temp == 'MultiLineString')\n\t\t\t\t\t\t{ $('#myPoint').css('display','none');\n\t\t\t\t\t\t\t $('#myLine').css('display','block');\n\t\t\t\t\t\t\t $('#myPolygon').css('display','none');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t//remove button and function\t\n\t\t\t\tvar remove = document.createElement('button');\n\t\t\t\t\tremove.setAttribute('class', 'remo');\n\t\t\t\t\tremove.innerHTML = 'X';\n\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\tdiv.appendChild(remove);\n\t\t\t\t\tremove.addEventListener(\"click\", function (){\n\t\t\t\t\t\tvar list=document.getElementsByClassName(\"remo\");\n\t\t\t\t\t\t\tlist = [].slice.call(list); \n\t\t\t\t\t\tvar a = list.indexOf(remove);\n\t\t\t\t\t\t\tconsole.log(a);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmap.removeLayer(map.getLayers().item(a+1));\n\t\t\t\t\t\t$( \".layers\" )[a].remove();\n\t\t\t\t\t\t$(\".remo\")[a].remove();\n\t\t\t\t\t\t$(\"#myLine\").hide();\n\t\t\t\t\t});\n\n\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t};\n\t\tcase 'Polygon':\n\t\tcase 'MultiPolygon':{\n\t\t\twhile(i == 1){\n\t\t\t\tvar buttonlayer = document.createElement('button');\n\t\t\t\t\tbuttonlayer.setAttribute('class', 'layers');\n\t\t\t\t\tbuttonlayer.innerHTML = 'Polygon';\n\n\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\tdiv.appendChild(buttonlayer);\n\t\t\t\t\tbuttonlayer.addEventListener(\"click\", function (){\n\t\t\t\t\tif ( temp == 'MultiPolygon' || temp == 'Polygon' )\n\t\t\t\t\t{ $('#myPoint').css('display','none');\n\t\t\t\t\t\t\t $('#myLine').css('display','none');\n\t\t\t\t\t\t\t $('#myPolygon').css('display','block');\n\t\t\t\t }\n\t\t\t\t\telse\n\t\t\t\t\t\talert (\"add a GeoJSON or GML\");\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t//remove button and function\n\t\t\t\t\tvar remove = document.createElement('button');\n\t\t\t\t\t\tremove.setAttribute('class', 'remo');\n\t\t\t\t\t\tremove.innerHTML = 'X';\n\t\t\t\t\tvar div = document.getElementsByTagName('div')[0];\n\t\t\t\t\t\tdiv.appendChild(remove);\n\t\t\t\t\t\tremove.addEventListener(\"click\", function (){\n\t\t\t\t\t\tvar list=document.getElementsByClassName(\"remo\");\n\t\t\t\t\t\t\tlist = [].slice.call(list); \n\t\t\t\t\t\tvar a = list.indexOf(remove);\n\t\t\t\t\t\tconsole.log(a);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmap.removeLayer(map.getLayers().item(a+1));\n\t\t\t\t\t\t$( \".layers\" )[a].remove();\n\t\t\t\t\t\t$(\".remo\")[a].remove();\n\t\t\t\t\t\t$(\"#myPolygon\").hide();\n\t\t\t\t\t\t});\n\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t};\n\t\t}\n\n}", "function mobileBits() {\n\t\t\t\t\t\t $(\".mobile-button\").show();\n\t\t\t\t\t\t $(\".menu-primary\").hide(); \n\t\t\t\t\t\t}", "function buttonStyle() {\n var windowsize = $(window).width();\n var testnow = $('#pagestyle').attr('href') == 'css/css/style_now.css';\n var pageName = $('.active').attr('pageName');\n \n if (testnow == true) {\n if (windowsize > 575 && pageName == 'landing' || pageName == 'skills' ) {\n $('.swap-style').children().removeClass().attr('class', 'btn btn-danger');\n }\n else if ((windowsize < 575) || (windowsize < 575 && pageName == 'portfolio' || pageName == 'contact')) {\n $('.swap-style').children().removeClass().attr('class', 'btn btn-light');\n }\n else {\n $('swap-style').children().removeClass();\n } \n }\n }", "function setupModeButtons() {\n\t$(\".mode\").on(\"click\", function() {\n\t\t$(\".mode\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\t\t\t\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Easy\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else if($(this).text() === \"Medium\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}\n\t});\t\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 updatePrice(button){\r\n\tif (button == 1) {\r\n\t\tsize_cost = 0;\r\n\t}\r\n\tif (button == 2) {\r\n\t\tsize_cost = 4;\r\n\t}\r\n\tif (button == 3) {\r\n\t\tglazing_cost = 0;\r\n\t}\r\n\tif (button == 4) {\r\n\t\tglazing_cost = 0.5;\r\n\t}\r\n\tif (button == 5) {\r\n\t\tglazing_cost = 0.5;\r\n\t}\r\n\tif (button == 6) {\r\n\t\tglazing_cost = 1;\r\n\t}\r\n\tdisplayPrice();\r\n}", "function setupMortgageBtn() {\n if (current_prop.numHouses > 0 || current_prop.hotel === true) {\n $(\"#mortgagebtn\").addClass(\"unavailable\")\n .unbind();\n $(\"#mortgagebtn .btncaption\").html(\"Mortgage\");\n return;\n }\n if (current_prop.mortgaged === true) {\n $(\"#mortgagebtn .btncaption\").html(\"Unmortgage\");\n } else {\n $(\"#mortgagebtn .btncaption\").html(\"Mortgage\");\n }\n $(\"#mortgagebtn\").click(function() {\n mortgageHandler(current_prop);\n });\n}", "function page_update(status) {\n\n // Level, balance, tone info\n document.getElementById(\"levelInfo\").innerHTML = 'LEV: ' + status_decode(status, 'level');\n document.getElementById(\"bassInfo\").innerText = 'BASS: ' + status_decode(status, 'bass');\n document.getElementById(\"trebleInfo\").innerText = 'TREB: ' + status_decode(status, 'treble');\n\n // MONO, LOUDNESS\n // Highlights activated buttons and related indicators\n if ( status_decode(status, 'muted') == 'true' ) {\n document.getElementById(\"buttonMute\").style.background = \"rgb(185, 185, 185)\";\n document.getElementById(\"buttonMute\").style.color = \"white\";\n document.getElementById(\"buttonMute\").style.fontWeight = \"bolder\";\n document.getElementById(\"levelInfo\").style.color = \"rgb(150, 90, 90)\";\n } else {\n document.getElementById(\"buttonMute\").style.background = \"rgb(100, 100, 100)\";\n document.getElementById(\"buttonMute\").style.color = \"lightgray\";\n document.getElementById(\"buttonMute\").style.fontWeight = \"normal\";\n document.getElementById(\"levelInfo\").style.color = \"white\";\n }\n if ( status_decode(status, 'midside') == 'mid' ) {\n document.getElementById(\"buttonMono\").style.background = \"rgb(100, 0, 0)\";\n document.getElementById(\"buttonMono\").style.color = \"rgb(255, 200, 200)\";\n document.getElementById(\"buttonMono\").innerText = 'MO';\n } else if ( status_decode(status, 'midside') == 'side' ) {\n document.getElementById(\"buttonMono\").style.background = \"rgb(100, 0, 0)\";\n document.getElementById(\"buttonMono\").style.color = \"rgb(255, 200, 200)\";\n document.getElementById(\"buttonMono\").innerText = 'L-R';\n } else {\n document.getElementById(\"buttonMono\").style.background = \"rgb(0, 90, 0)\";\n document.getElementById(\"buttonMono\").style.color = \"white\";\n document.getElementById(\"buttonMono\").innerText = 'ST';\n }\n if ( status_decode(status, 'loudness_track') == 'true' ) {\n document.getElementById(\"buttonLoud\").style.background = \"rgb(0, 90, 0)\";\n document.getElementById(\"buttonLoud\").style.color = \"white\";\n document.getElementById(\"buttonLoud\").innerText = 'LD';\n } else {\n document.getElementById(\"buttonLoud\").style.background = \"rgb(100, 100, 100)\";\n document.getElementById(\"buttonLoud\").style.color = \"rgb(150, 150, 150)\";\n document.getElementById(\"buttonLoud\").innerText = 'LD';\n }\n\n // Loudspeaker name (can change in some systems)\n document.getElementById(\"main_center\").innerText = ':: ' + get_loudspeaker_name() + ' ::';\n\n}", "function setupCardChoices() { \r\n /*Setup Two choices*/\r\n backgroundImg.createNewButton(\"yesButton\", \"Yes\", 300, 360,\"bold 30px Arial\", \"black\", \"blue\");\r\n backgroundImg.createNewButton(\"noButton\", \"No\", 400, 360,\"bold 30px Arial\", \"black\", \"blue\");\r\n}", "function responsive_actions() {\n if ( win_width > 1000) {\n $('#small-ava').attr('src', $('#small-ava').data('src'));\n } else {\n if (lang == 'ru') {\n $('.section-about .section-title').text('Константин Наумов')\n }\n $('#large-ava').attr('src', $('#large-ava').data('src'));\n $('.about-contact').attr('href', '#contact');\n }\n }", "function customizelistener() {\r\n\tcustombg.visible = true;\r\n\r\n\tmainbutton.visible = true;\r\n\tpracticebutton.visible = false;\r\n\tstartbutton.visible = false;\r\n\thomebutton.visible = false;\r\n\r\n\tdispball.visible = true;\r\n\tdispchar.visible = true;\r\n}", "function setupTypeButtons() {\n\t$(\".type\").on(\"click\", function() {\n\t\t$(\".type\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Addition\") {\t\t\t\n\t\t\tsetUpGame(whatModeIsSelected(), \"+\");\n\t\t}else if($(this).text() === \"Subtraction\") {\n\t\t\tsetUpGame(whatModeIsSelected(), \"-\");\n\t\t}else{\n\t\t\tsetUpGame(whatModeIsSelected(), \"*\");\n\t\t}\t\t\n\t});\n}", "function gameButtonsLogic() {\n $(\"#bluegem\").click(function () {\n totalScore += bluegem;\n $(\"#butt1\").text(totalScore);\n gameLogic();\n \n });\n\n $(\"#glovegem\").on(\"click\", function () {\n totalScore += glovegem;\n $(\"#butt1\").text(totalScore);\n gameLogic();\n \n });\n\n $(\"#orangegem\").on(\"click\", function () {\n totalScore += orangegem;\n $(\"#butt1\").text(totalScore);\n gameLogic();\n \n });\n\n $(\"#guitargem\").on(\"click\", function () {\n totalScore += guitargem;\n $(\"#butt1\").text(totalScore);\n gameLogic();\n \n })}" ]
[ "0.67416584", "0.6682934", "0.656902", "0.6505533", "0.63801485", "0.6345863", "0.63231", "0.63231", "0.63057667", "0.6264855", "0.6252861", "0.6222661", "0.61947155", "0.61727214", "0.6169727", "0.61290115", "0.6122657", "0.6086204", "0.60833025", "0.60581416", "0.60555", "0.59919673", "0.59774786", "0.59637", "0.59507227", "0.5940465", "0.59240705", "0.59102756", "0.5909473", "0.58996624", "0.5897483", "0.5875957", "0.5873595", "0.5870396", "0.586526", "0.58647764", "0.5860715", "0.58536255", "0.5848745", "0.58426154", "0.5837876", "0.5832427", "0.5823778", "0.5799919", "0.579899", "0.57893515", "0.57841504", "0.5783234", "0.57750726", "0.57737255", "0.57699805", "0.57616335", "0.5760841", "0.5755441", "0.5751444", "0.5750594", "0.57490754", "0.574837", "0.5733644", "0.5733644", "0.57300335", "0.57294375", "0.5722088", "0.5720251", "0.57191306", "0.57191265", "0.571666", "0.5712915", "0.57122135", "0.5711959", "0.57092726", "0.57079595", "0.5706651", "0.5703398", "0.5703039", "0.5698045", "0.5697726", "0.5695432", "0.569346", "0.569155", "0.5690422", "0.5688432", "0.56839716", "0.5672055", "0.5670394", "0.5664954", "0.56635326", "0.56620616", "0.566029", "0.565499", "0.5653355", "0.56530887", "0.56498665", "0.5648694", "0.5647782", "0.5644273", "0.56365895", "0.5635759", "0.5630245", "0.5626429", "0.5622432" ]
0.0
-1
This function resets the number of hearts and bread slices there are at the beginning of the game. It automatically sets each to 5 (full health/hunger).
function onloadhandler() { document.getElementById("heart1").hidden = false; document.getElementById("heart2").hidden = false; document.getElementById("heart3").hidden = false; document.getElementById("heart4").hidden = false; document.getElementById("heart5").hidden = false; document.getElementById("bread1").hidden = false; document.getElementById("bread2").hidden = false; document.getElementById("bread3").hidden =false; document.getElementById("bread4").hidden = true; document.getElementById("bread5").hidden = true; document.getElementById("pocketknife").hidden = true; document.getElementById("sword1").hidden = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetFruitTally() {\n grapes = 0;\n watermalon = 0;\n oranges = 0;\n cherries = 0;\n crown = 0;\n seven = 0;\n dollor = 0;\n blank = 0;\n}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n }", "function reset() {\n currentMonsterHealth = chosenMaxLife;\n currentPlayerHealth = chosenMaxLife;\n resetGame(chosenMaxLife);\n}", "function resetFruitTally() {\n peaches = 0;\n bananas = 0;\n oranges = 0;\n plums = 0;\n bars = 0;\n lemons = 0;\n sevens = 0;\n watermelons = 0;\n}", "function resetGame() {\n remainingHearts = 0;\n while (lifes.childNodes.length > 0) {\n // loops over how many hearts there is to remove the remaining, so when it adds new set it won't add up\n lifes.removeChild(lifes.childNodes[0]);\n }\n for (let h = 3; h > remainingHearts; h--) { // Creates the hearts for the page.\n let list = document.createElement(\"LI\")\n let listImg = document.createElement(\"IMG\")\n listImg.setAttribute('src', 'images/Heart.png')\n list.appendChild(listImg)\n document.getElementById(\"lifes\").appendChild(listImg);\n }\n remainingHearts = 3; // resets counter\n level = 1; // resets level-counter\n document.getElementById('level').innerHTML = level;\n allEnemies = [];\n showEnemies();\n}", "function fullReset() {\n reset();\n score.DROITE = 0;\n score.GAUCHE = 0;\n }", "function reset() {\n target.moodScore = 0;\n target.healthScore = 100;\n target.hits = 0;\n modsTotal = 0\n target.healthHelps = [];\n foodCount = 0;\n waterCount = 0;\n coffeeCount = 0;\n scoreDraw();\n loseElement.classList.remove(\"end-game\");\n loseElement.textContent = `Stella has had just a little too much de-stressing. Time for her to sleep so she can start over.`;\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset() {\n baddies = 0;\n score = 0;\n time = 0;\n scoreBoard.firstElementChild.textContent = \"Score: \" + score;\n scoreBoard.lastElementChild.textContent = \"Time: \" + time.toFixed(2);\n \n index = 0;\n baddyArray = [];\n redMax = 4;\n redMin = 1;\n player.health = true;\n player.x = 0;\n player.y = 0;\n player.movXright = 0;\n player.movXleft = 0;\n player.movYup = 0;\n player.movYdown = 0;\n player.diameter = 50;\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n updateBet();\n updateCredits();\n updateJackpot();\n updatePayout();\n for (var index = 0; index < 3; index++) {\n reelContainers[index].removeAllChildren();\n }\n\n}", "function reset() {\n tickCount = 0;\n hearts = 3;\n multiplier = 1;\n streakCounter = 0;\n heart1x = 9;\n heart2x = 16;\n heart3x = 23;\n\n remove(noteArray, (n) => { //Delete all the old notes before the new game starts\n return true;\n });\n}", "function resetAll() {\n credits = 1000;\n winnerPaid = 0;\n jackpot = 5000;\n turn = 0;\n bet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n\n showPlayerStats();\n}", "resetData() {\n gameState.lives = 3;\n gameState.state = states.READY;\n gameState.level = 1;\n gameState.score = 0;\n gameState.toNextBonus = gameState.EVERY_EXTEND;\n gameState.minNumber = 1;\n gameState.maxNumber = 50;\n gameState.expressNum = 5;\n gameState.highScoreReached = false;\n gameState.highLevelReached = false;\n gameState.highComboReached = false;\n gameState.currentLevelType = levelType.MULTIPLE;\n gameState.expressionsMode = expressions.OFF;\n gameState.colorFlavorIndex = 0;\n gameState.modifierIndex = -1;\n gameState.comboTimer = 0;\n gameState.comboCount = 1;\n gameState.bestCombo = 1;\n }", "function resetGame () {\n resetBricks ();\n store.commit ('setScore', 0);\n store.commit ('setLives', 3);\n resetBoard ();\n draw ();\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 reset() {\n humanChoices = [];\n computerChoices = [];\n level = 0;\n gameOver = false;\n}", "reset() {\n this.life = 3;\n this.collected = 0;\n this.level = 0;\n this.score = 0;\n this.scoreWater = 0;\n this.collectedFly = 0;\n this.collectedDragonfly = 0;\n this.collectedButterfly = 0;\n levels.textContent = \"EGG\";\n lives.innerHTML = this.life;\n collectedItems.innerHTML = this.collected;\n collectedFlies.innerHTML = this.collectedFly;\n collectedDragonflies.innerHTML = this.collectedDragonfly;\n collectedButterflies.innerHTML = this.collectedButterfly;\n scoreboard.innerHTML = this.score;\n scoreboardWater.innerHTML = this.scoreWater;\n this.modalShow(startModal, startBtn);\n }", "function Reset() {\n pipes.splice(0, pipes.length);\n pipes.push(new Pipe());\n for (var bird of birds) {\n bird.reset();\n }\n score = 0;\n gameOver = false;\n ready = false;\n count = 0;\n}", "function reset() {\n\textraliv = 0;\n\tliv = maxliv;\n\tmissed = 0;\n\tscore = 0;\n\tfrugter = [];\n\tmodifiers = [];\n\ttimeToNextEnemy = Random(enemyInterval[0], enemyInterval[1]);\n\ttimeToNextModifier = Random(modifierInterval[0], modifierInterval[1]);\n\tspilIgang = true;\n\tspilWon = false;\n}", "function resetGame() {\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten >= 20) {\n tornado.reset();\n }\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten >= 30) {\n fire.reset();\n }\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten >= 40) {\n meteor.reset();\n }\n foodLeaves.reset();\n foodBerries.reset();\n foodPlant.reset();\n dinoStegosaurus.reset();\n dinoTriceratops.reset();\n gameOverScreen = false;\n titleScreen = true;\n instructionsScreen = false;\n gameWon = false;\n}", "function reset(){\n roy.health = roy.maxHealth;\n incineroar.health = incineroar.maxHealth;\n ridley.health = ridley.maxHealth;\n cloud.health = cloud.maxHealth;\n cloud.limit = 0;\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\"#pc-health\").html();\n $(\"#pc-attack\").html();\n $(\".fight-cpu\").hide();\n $(\".fight-pc\").hide();\n slotOneFull = false;\n slotTwoFull = false;\n playerKOs = 0;\n playerChar = \"\";\n computerChar = \"\";\n roy.inUse = false;\n roy.fight = true;\n ridley.inUse = false;\n ridley.fight = true;\n cloud.inUse = false;\n cloud.fight = true;\n incineroar.inUse = false;\n incineroar.fight = true;\n $(\".ridley-small\").removeClass('grayScale')\n $(\".cloud-small\").removeClass('grayScale')\n $(\".roy-small\").removeClass('grayScale')\n $(\".incineroar-small\").removeClass('grayScale')\n\n}", "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 resetEverything() {\n //Store a new Snake object into the snake variable\n snake = new Snake(17, 17, 'A', 5, 30, 2);\n\n //store a new Bait onject into the bait variable and the specialBait variable\n bait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 10); //this is the normal bait\n specialBait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 30); //this is the special bait with a bigger radius value\n\n //Reset the special Bait if it was on screen when the player lost\n specialBaitgo = false;\n counterToSpecialBait = 0;\n\n //Set up the new snake\n snake.updateSnake();\n\n //Store the current snakeHighScore value back into its respective highscore category\n if (snakeProperties.clearSkyMode == true) {\n snake.highScore[0] = snakeHighScore;\n } else if (snakeProperties.clearSkyMode == false) {\n snake.highScore[1] = snakeHighScore;\n }\n}", "function reset() {\n guessCount = 15;\n incorrectGuess = [];\n}", "reset() {\n this.health = 100;\n this.energy = 100;\n }", "function reset () {\n guessesLeft = 10;\n userGuesses = [];\n wordBlanks = [];\n startGame(); \n }", "function reset() {\r\n guessed = [];\r\n lives = 10;\r\n random = pick();\r\n}", "function resetGame(){\n\t\t\n\t\tguessesLeft = 10;\n\t\tguessesMade = [];\n\n\t}//END resetGame()", "function resetGame() {\n\tcurrentMap = 0;\n\tbrokenBricks = 0;\n\tmapComplete = false;\n\tgameOver = false;\n\tlivesRemaining = 5;\n\tresetBall();\n\tresetPaddle();\n\t// Reset all bricks\n\tfor (var i = 0; i < maps.length; i++) {\n\t\tfor (var j = 0; j < maps[i].bricks.length; j++) {\n\t\t\tmaps[i].bricks[j].hits = 0;\n\t\t}\n\t}\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 }", "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 resetHand(){\n card1 = undefined\n card2 = undefined\n cardsFlipped = 0\n attempt++\n}", "function reset() {\n for (let i = 1; i <= 15; i += 1) {\n const block = document.getElementsByClassName(`block-${i}`)[0];\n const position = findPositionClass(block.className.split(' '));\n block.classList.remove(position);\n block.classList.add(getXY(i));\n }\n document.getElementsByClassName('win-block')[0].classList.add('hidden');\n difficulty = null;\n setScore(0);\n}", "function gameReset () {\n defenderChosen = null;\n characterChosen = null;\n defenderExists = false;\n playerChoseChar = false;\n enemyCount = (characters.length - 1);\n jonSnow.healthPoints = 100;\n nightKing.healthPoints = 110;\n hound.healthPoints = 90;\n cersei.healthPoints = 80;\n for(i=0; i<characters.length; i++){\n $(characters[i].buttonId).fadeIn();\n $(characters[i].healthId).html(characters[i].healthPoints);\n $(characters[i].buttonId).css(\"background-color\", \"#F5F5F5\");\n $(characters[i].buttonId).css(\"color\", \"black\");\n };\n $(\".buttons\").appendTo(\".characters\");\n $(\".defender\").html(\" \");\n }", "function resetvalues() {\n lettersleft = 5;\n guessesleft = 10;\n lettersused = [];\n p0 = \"*\";\n p1 = \"*\";\n p2 = \"*\";\n p3 = \"*\";\n p4 = \"*\";\n}", "function scoreReset() {\n guessesRemaining = 9;\n guesses = [];\n}", "function reset() {\n resetGrid();\n resetLives();\n resetScore();\n generateRandomPath(width);\n}", "function resetGame() {\n phrase.innerHTML = \" \";\n missed = 0;\n array3 = [];\n correct = [];\n resetHearts();\n startGame();\n overlay.classList.remove(\"win\", \"lose\");\n\n}", "reset() {\n this.health = icon_width + 100;\n\n this.x_team_pos = 25;\n this.y_icon_pos = 25 + (icon_height*this.id) + (spacing*this.id);\n this.x_boss_pos = 1075;\n }", "function reset() {\n setPieces(round);\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 restartGame() {\n $('#restartButton').remove();\n $('#gameMessageText').text('');\n attackCount = 0;\n defeatedEnemyCount = 0;\n for (var i = 0; i < 4; i++) {\n starWarsChar[i].healthPoints = originalHealthPoints[i];\n }\n\n initialPageSetup();\n\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 ResetSwimmerCounts()\n{\n GetRaceFinisherCounts();\n UpdateRacersSwimming();\n UpdateRacersFinished();\n}", "function resetScores() {\n guessLeft = 10;\n guessSoFar = [];\n}", "function resetScores(){\n scores.redPieceCount = 12;\n scores.blackPieceCount = 12\n scores.blackPiecesTaken = 0;\n scores.redPiecesTaken = 0;\n scores.winner = null;\n}", "function setReset(set) {\r\n gameoverOn = 0;\r\n pause = 0;\r\n count = 0;\r\n countDog = 0;\r\n countDog2 = 0;\r\n countDog3 = 0;\r\n countDog4 = 0;\r\n difficulty = 1;\r\n pointsToReach = 10;\r\n temp = 10;\r\n level = 1;\r\n startGame = 0;\r\n resetGame = 0;\r\n points = 0;\r\n errors = 5;\r\n speed = 30;\r\n showedDucks = [];\r\n availableDucks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\r\n countElem = [];\r\n x_keyFramesDucks = [];\r\n y_keyFramesDucks = [];\r\n leftRemaining = leftRightDivider;\r\n rightRemaining = numDucks - leftRightDivider;\r\n if(set){\r\n audioon = 0;\r\n hit = Array(numDucks).fill(false);\r\n flying = Array(numDucks).fill(null);\r\n wingLeft = Array(numDucks).fill(null);\r\n wingRight = Array(numDucks).fill(null);\r\n leg = Array(numDucks).fill(null);\r\n birds = Array(numDucks).fill(null);\r\n clouds2 = Array(numClouds).fill(null);\r\n document.getElementById(\"boxMusic\").checked = false;\r\n document.getElementById(\"roundSlider\").style.display = \"\";\r\n }\r\n clearInterval(dog_exited);\r\n versoLeft = Array(numDucks).fill(1);\r\n versoRight = Array(numDucks).fill(0);\r\n incrementWingLeft = Array(numDucks).fill(0);\r\n incrementWingRight = Array(numDucks).fill(0);\r\n showedClouds = [0,1,2,3,4];\r\n}", "function resetGame() {\n counter = 0;\n }", "function reset() {\n guessesLeft = 10; \n userGuesses = [];\n}", "function reset()\n{\n for(var i = 20; i < 85; i++)\n {\n targetNumber = Math.floor(Math.random() * i) + 15;\n }\n counter = 0; \n wins = 0;\n loss = 0;\n console.log(counter);\n $(\"#numWins\").text(wins);\n $(\"#numLose\").text(loss);\n $(\"#counter-number\").text(counter);\n $(\"#number-to-guess\").text(targetNumber);\n $(\"#text2\").text(\"\");\n}", "_reset() {\n\n this.enemiesCurrentlyOnscreen = 0;\n this.enemiesLeftToSpawn = this.enemyList.total;\n this.spawnTimer = this.startWait;\n\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 }", "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 resetGame() {\n\t$(\"#gameOver\").fadeOut();\n\ttotal = 0;\n\tupdateTotal(0);\n\ttotalEmptyCells = 16;\n\tgrid = getGrid();\n\tgridSpans = getSpanGrid();\n\t$(gridSpans).each(function(i,r) { $(r).each(function(i,c) { $(c).parent().css(\"background-color\", \"#D1E3EB\"); $(c).text(\"\"); }); });\n\tsetRandCell(get2or4());\n\tsetRandCell(get2or4());\n}", "function resetGame() {\n score = 0;\n countdown = 500;\n questionSet = [...questions];\n count = 0;\n userName = '';\n}", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "function resetGame() {\n questionCounter = 0;\n correctTally = 0;\n incorrectTally = 0;\n unansweredTally = 0;\n counter = 5;\n generateHTML();\n timerWrapper();\n}", "function resetFunc() {\n for (let i = 0; diceContainer.children.length > i; i++) {\n diceContainer.children[i].children[0].style.backgroundColor = \"\";\n diceContainer.children[i].children[0].children[0].innerHTML = 1;\n }\n sum.children[0].children[0].innerHTML = 0;\n sumHeld.children[0].children[0].innerHTML = 0;\n rolls.children[0].children[0].innerHTML = 0;\n diceArray = [];\n}", "function reset(){\n //level is zero\n count=0;\n //remove the events about colors\n $('.colorblock').unbind();\n // adjust the font style in the click board\n $('#count').html('Level:'+count);\n $('#simon').text('Simon').css({\n fontSize: '7vw',\n textalign: 'center',\n position: 'absolute',\n left:'5vw',\n });\n $('#start').text('Start Game!').css({\n fontSize:'5vw',\n textalign: 'center',\n position: 'absolute',\n top:'15vw',\n left: '5vw',\n });\n getRand();\n flashArray(); \n }", "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "function awake_reset(){\n shuffleArray(actions);\n g.stage.putRight(actions[0], -1000, 600);\n g.stage.putRight(actions[1], -1000, 300);\n g.stage.putRight(actions[2], -1000, 900);\n g.stage.putRight(actions[3], -1900, 300);\n g.stage.putRight(actions[4], -1900, 600);\n g.stage.putRight(actions[5], -1900, 900);\n }", "function resetBoard() {\n\t\"use strict\";\n\t// Mark all cells as empty and give default background.\n\tfor (var i = 0; i < size; i++) {\n\t\tfor (var j = 0; j < size; j++) {\n\t\t\tvar cell = getCell(i, j);\n\t\t\tcell.style.backgroundColor = background;\n\t\t\tcell.occupied = false;\n\t\t\tcell.hasFood = false;\n\t\t}\n\t}\n\t// Reset snake head node.\n\tsnakeHead = null;\n\t// Reset curent direction.\n\tcurrDirection = right;\n\t// Reset direction lock.\n\tdirectionLock = false;\n\t// Reset difficulty level.\n\tmoveInterval = difficultyLevels[level];\n\t// Reset points and time.\n\tpoints = -10;\n\taddPoints();\n\ttime = 0;\n\t// Reset countdown label\n\t$(\"#countdown\").html(\"The force is strong with this one...\");\n}", "function reset() {\n for (var i = 0; i < 9; i++) {\n movers[i] = new Mover(random(0.5, 3), 40+i*70, 0);\n }\n}", "function reset() {\n chessboard = new Set();\n for(i = 0; i < 9; i++) {\n chessboard.add(i);\n place(i, \"\");\n }\n playerO = new Set();\n playerX = new Set();\n lock = false;\n setState(\"YOUR TURN\");\n}", "function resetGame() {\n\n gameOver = false;\n state = `menu`;\n\n scoreMoney = 0;\n score = 0;\n\n setup();\n\n // clearInterval of mouse \n if (minigame1) {\n clearInterval(mousePosInterval);\n }\n // Resets the fishies\n if (minigame2) {\n for (let i = 0; i < NUM_FISHIES; i++) {\n let fish = fishies[i];\n fish.reset();\n }\n }\n}", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "function resetBoard() {\n\tgame.score = 0;\n\tgame.dot.exists = false;\n\tworms = new Array();\n\n\tfor (var i = 0; i < game.players; i++) {\n\t\tworms.push(new Object());\n\t\tworms[i].direction = \"none\";\n\t\tworms[i].previousCells = new Array();\n\t\tworms[i].length = 1;\n\t\tworms[i].movedThisTurn = false; \n\t\tworms[i].cachedMove = 'none';\n\t\tworms[i].maxSize = 100;\n\n\t\tgame.dots = new Array();\n\t\tgame.foodOut = false;\n\t\t\n\t\tworms[i].position = new Object();\n\t\tworms[i].position.x = 1 + Math.floor(Math.random()*(game.grid.width/game.grid.size - 2));\n\t\tworms[i].position.y = 1 + Math.floor(Math.random()*(game.grid.height/game.grid.size - 2));\n\t}\t\n}", "reset() {\n this.x = 200;\n this.y = 485;\n this.score = 0;\n scoreIncrease.innerHTML = 0;\n this.lives = 3;\n livesTracker.innerHTML = 3;\n }", "function reset() {\n gemValues.gemSet();\n gemValues.startGoal();\n playerScore = 0;\n numGoal = Math.floor(Math.random()*121)+19;\n $(\"#scoreSet-text\").html(numGoal);\n $(\"#playerScore\").html(playerScore);\n}", "resetNumCards(cards) {\n this.numCards = cards;\n }", "resetResources()\n {\n this.slaps = 0;\n this.blocks = 0;\n }", "resetCastle(){\n this.health = this.maxHealth;\n }", "function setInitials() {\n counter = 0;\n time = 0;\n}", "function resetGame() {\n resetTimer();\n resetMoves();\n resetStars();\n shuffleDeck();\n resetCards();\n}", "reset() {\n this._age = 0\n this._height = 0\n this._fruits = []\n this._healthyStatus = true\n this._harvested = ''\n }", "function resetGame() {\n // Position of prey and player will reset\n setupPrey();\n setupPlayer();\n // movement and speed of prey will reset\n movePrey();\n // sound will replay\n nightSound.play();\n // Size and color of player will reset\n playerRadius = 20;\n firegreen = 0;\n // score will reset\n preyEaten = 0;\n // prey speed will reset\n preyMaxSpeed = 4\n // All of this when game is over\n gameOver = false;\n}", "resetGame() {\n this.initGrid();\n this.setDefaultSeeds();\n this.iteration = 0;\n }", "function resetGame(){\n startingLevel = 1;\n startingScore = 0;\n startingLives = 5;\n\n changeScore(startingLevel, startingScore);\n changeLevel(startingLevel);\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 reset () {\n targetScore = Math.floor(Math.random() * 102)+19;\n gemOne = Math.floor(Math.random()*12)+1;\n gemTwo = Math.floor(Math.random()*12)+1;\n gemThree = Math.floor(Math.random()*12)+1;\n gemFour = Math.floor(Math.random()*12)+1;\n \n $(\"#loss-count\").text(lossCount);\n $(\"#win-count\").text(winCount);\n yourScore = 0;\n $(\"#your-score\").text(yourScore);\n $(\"#target-score\").text(targetScore);\n }", "function resetSnoozes() {\n\n if (bgHigher(BGUrgentLow+1)) BGUrgentLowSnooze = 0;\n if (bgHigher(BGLow+1)) BGLowSnooze = 0;\n if (bgLower(BGUrgentHigh-1)) BGUrgentHighSnooze = 0;\n if (bgLower(BGHigh-1)) BGHighSnooze = 0;\n}", "function roundReset () {\n userSequence = [];\n count = 0;\n currentPlayerNum += 1;\n updatePlayer();\n }", "function reset() {\n paused = false;\n dead = false;\n \n score = 0;\n\n dy = 0;\n dx = 5;\n \n clearCanvas();\n createPickup();\n updateScore();\n\n snake = [\n {x: 150, y: 150},\n {x: 140, y: 150},\n {x: 130, y: 150},\n {x: 120, y: 150},\n {x: 110, y: 150}\n ];\n}", "function reset() {\n\t\ttotalScore = 0;\n\t\t$totalScore.html(totalScore);\n\t\trandomNumber = Math.floor(Math.random() * (120 - 19)) + 19;\n\t\t$(\"#random-number-section\").html(randomNumber);\n\t\tfirstCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tsecondCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tthirdCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tfourthCrystal = Math.floor(Math.random() * 12 + 1);\n\t}", "function reset() {\r\n guessesRemaining = 10;\r\n guesses = \"\";\r\n }", "function reset() {\n round = 0;\n global_nums = [];\n history = [];\n germanProvinces = [];\n britishProvinces = [];\n fleets = [];\n gold = 275;\n points = 0;\n goldPerTurn = 0;\n guessedNums=[];\n }", "function reset() {\n time = 120;\n gameRun = false;\n }", "function resetVariables () {\n lettersGuessed = [];\n guessesLeft = 10;\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 reset(){\n\t\n health1 = 5;\n health2 = 5;\n\n ply1.position.x = 1536*0.3333333333;\n ply1.position.y = 600;\n\n ply2.position.x = 1536*0.6666666666;\n ply2.position.y = 600;\n\n\n\tloop();\n\n\n}", "function brickReset() {\n bricksLeft = 0;\n\n for (let i = 0; i < 3 * BRICK_COLUMNS; i++) {\n brickArr[i] = false;\n }\n\n for (let i = 3 * BRICK_COLUMNS; i < BRICK_COLUMNS * BRICK_ROWS; i++) {\n brickArr[i] = true;\n bricksLeft++;\n }\n}", "function resetGame() {\n if (score > max) {\n max = score;\n }\n\n snake.x = 160;\n snake.y = 160;\n snake.cells = [];\n snake.maxCells = STARTING_LENGTH;\n snake.dx = SNAKE_MAX_SPEED;\n snake.dy = 0;\n\n score = 0;\n apple.x = getRandomInt(0, 25) * grid;\n apple.y = getRandomInt(0, 25) * grid;\n document.getElementById('high').innerHTML = max;\n document.getElementById('score').innerHTML = score;\n}", "function resetVars() {\n\n // Reset dealer and player to default values\n dealer.sum = 0;\n dealer.aces = 0;\n dealer.cards = 0;\n dealer.notbusted = true;\n\n player.sum = 0;\n player.aces = 0;\n player.cards = 0;\n player.notbusted = true;\n\n // Rest the results\n $(\".results\").html(\"\");\n\n // By default the deal button should be the only option available\n disableButtons();\n\n // Shuffle up the deck\n deck = shuffleDeck(deck);\n index = 0;\n\n // Remove any previously deal cards (beyond the starting two for each person)\n $(\".extraCard\").remove();\n\n}", "function resetGame() {\n for (let i = 0; i < kids.length; i++) {\n kids[i].reset();\n player.reset();\n isGameOver = false;\n }\n}", "function chestReset(){\n $(\".reward-card\").hide(0);\n setLife();\n console.log($(\".chestBackground\").css('background-image'));\n activateButtons();\n $(\".inputDigits span\").text(\"0\");\n generateQuestion();\n startTimeControl();\n if (tryCount >= 3){\n stopTimeControl()\n generateLoot();\n }\n}", "function playerReset(){\n\tfor (i=0; i<allplayers.length; i++){\n\t\tfor (hand in allplayers[i].hands){\n\t\t\tif (hand == 'HC') allplayers[i].hands[hand] = true;\n\t\t\telse allplayers[i].hands[hand] = false;\n\t\t}\n\t\tfor (suit in allplayers[i].suits){\n\t\t\tallplayers[i].suits[suit] = 0;\n\t\t}\n\t\tfor (rank in allplayers[i].ranks){\n\t\t\tallplayers[i].ranks[rank] = 0;\n\t\t}\n\t\tallplayers[i].hand = [];\n\t\tallplayers[i].pacounter = 0;\n\t\tallplayers[i].tkcounter = 0;\n\t\tallplayers[i].straight = [];\n\t\tallplayers[i].flush = \"\";\n\t}\n}", "function resetGame() {\n generateTarget();\n generateNumbers();\n distributeNumbers();\n}", "function resetGame() {\n\tresetClockAndTime();\n\tresetMoves();\n\tresetStars();\n\tshuffleDeck();\n\tresetCards();\n\tmatched = 0;\n\ttoggledCards = [];\n}" ]
[ "0.70941234", "0.70399004", "0.70399004", "0.7018411", "0.69952816", "0.6873096", "0.68539196", "0.68431634", "0.67876583", "0.674339", "0.6636134", "0.6634603", "0.66241455", "0.6594799", "0.6588156", "0.658633", "0.6575699", "0.6572473", "0.6531252", "0.6519453", "0.6487055", "0.6485676", "0.64828324", "0.6473515", "0.6464442", "0.6462545", "0.64609414", "0.64554137", "0.6433945", "0.6405128", "0.63974077", "0.63963825", "0.63873833", "0.6374536", "0.6373914", "0.637055", "0.6370104", "0.6369897", "0.63633573", "0.63596034", "0.63560766", "0.63532907", "0.63413274", "0.6338961", "0.6336272", "0.63320476", "0.63278294", "0.6326741", "0.63097405", "0.6294268", "0.6286253", "0.62829053", "0.6274864", "0.6267425", "0.6265337", "0.6259121", "0.6247632", "0.6243847", "0.62427616", "0.6241783", "0.62359244", "0.62340015", "0.62327766", "0.6228688", "0.62219703", "0.6221361", "0.62190306", "0.6217621", "0.62159574", "0.62151057", "0.62104315", "0.6208871", "0.6205779", "0.6201467", "0.61939806", "0.6193471", "0.619002", "0.61898845", "0.61897737", "0.61865693", "0.6185244", "0.61850744", "0.61829334", "0.6181898", "0.61782473", "0.6171062", "0.61623096", "0.6161668", "0.6158781", "0.61523426", "0.6150273", "0.61467034", "0.6144368", "0.61427057", "0.61425847", "0.6141858", "0.61383533", "0.613791", "0.6136626", "0.6134003", "0.61335623" ]
0.0
-1
This function controls the global variable for health. Throughout the game, we can set the health and the hearts will disappear.
function displayHearts() { document.getElementById("heart5").hidden = false; document.getElementById("heart4").hidden = false; document.getElementById("heart3").hidden = false; document.getElementById("heart2").hidden = false; document.getElementById("heart1").hidden = false; if( health === 4) { document.getElementById("heart5").hidden = true; } if( health === 3) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; } if( health === 2) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; } if( health === 1) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; document.getElementById("heart2").hidden = true; } if( health === 0) { document.getElementById("heart5").hidden = true; document.getElementById("heart4").hidden = true; document.getElementById("heart3").hidden = true; document.getElementById("heart2").hidden = true; document.getElementById("heart1").hidden = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "humanHealth() {\n if ( this.humanHealth < 0 ) {\n this.humanHealth = 0;\n alert( 'You Lost!' );\n this.gameStarted = false;\n } else if ( this.humanHealth > 100 ) {\n this.humanHealth = 100;\n }\n }", "loseHealth() {\n this.health--;\n this.tint = 0xff0000;\n //check if health is 0\n if(this.health === 0) {\n //remove time event before removing enemyobject\n this.timeEvent.destroy();\n //remove enemy\n this.destroy();\n } else {\n //if not 0, reset tint back to normal after a delay\n this.scene.time.addEvent({\n delay: 200, \n callback: () => {\n this.tint = 0xffffff;\n }\n });\n }\n }", "checkHealthAndFood() {\n\n\n if (this.currPlayerHealth <= 0 || this.playerFood <= 0) {\n this.gameOver();\n }\n\n if (this.currPlayerHealth <= 25) {\n //this.toggleBlink(\"healthElement\");\n this.lowHealth = true;\n }\n\n }", "loseHealth() {\n this.DB = store.get(GameConstants.DB.DBNAME);\n //delete extra lifes if exists\n if (this.health>5){ \n let currentExtraLifes = parseInt(this.DB.extralifes);\n if (this.DB.extralifes>0){\n this.DB.extralifes = currentExtraLifes - 1; \n store.set(GameConstants.DB.DBNAME, this.DB);\n }\n }\n this.health--;\n this.scene.textHealth.setText(this.scene.TG.tr('COMMONTEXT.LIVES') + this.health);\n if (this.health === 0) {\n //Turn alarm music off\n this.alarmON = false;\n this.healthAlarm.stop(); \n //gameOver\n this.scene.gameOverText('gameOver');\n this.gameOver = true;\n this.emit(GameConstants.Events.GAME_OVER);\n }else if (this.health == 1){\n //Turn alarm music on\n this.alarmON = true;\n if (this.DB.SFX) {\n this.healthAlarm.play();\n }\n }else{\n this.alarmON = false;\n this.healthAlarm.stop(); \n }\n\n }", "function setPHealth() {\n player.choice.health.currentHP -= computer.choice.damage;\n //display updated health information\n $(\".arena .player .data p span\").text(player.choice.health.currentHP);\n $(\".arena .player progress\").val(player.choice.health.currentHP);\n}", "function updateHealth() {\n // Reduce player health\n playerHealth = playerHealth - 0.5;\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n\n //When the shift button is pressed, player's health\n //will decrease faster, especially without the constrain\n if (keyIsDown(SHIFT)) {\n playerHealth = playerHealth - 2;\n }\n //When the sift button is released, the health\n //will decrease at it's normal rate\n else {\n playerHealth = playerHealth - 0.5;\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n }\n\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "function updateHealth() {\n // Reduce harry health, constrain to reasonable range\n harryHealth = constrain(harryHealth - 0.5,0,harryMaxHealth);\n // Check if the harry is dead\n if (harryHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "function Start () {\n\thealth = 60;\n\tcurrHealth = 60;\n\thealthRate = 7;\n}", "setHealth(health) {\n this.health = health;\n }", "function Awake ()\n{\n\n // Set the initial health of the player.\n currentHealth = startingHealth;\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}", "function updateHealth() {\n // Reduce player health, constrain to reasonable range\n playerHealth = constrain(playerHealth - 0.5,0,playerMaxHealth);\n // Check if the player is dead\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n gameOverSong.play();\n }\n}", "function resetHealth() {\n lukeSkywalker.healthPoints = 140;\n obiWan.healthPoints = 120;\n princessLeia.healthPoints = 115;\n hanSolo.healthPoints = 129;\n maceWindu.healthPoints = 140;\n yoda.healthPoints = 150;\n \n darthVader.healthPoints = 119;\n darthMaul.healthPoints = 110;\n tarkin.healthPoints = 90;\n palpatine.healthPoints = 130;\n kyloRen.healthPoints = 129;\n snoke.healthPoints = 145;\n console.log('user health: ' + userFighter.healthPoints);\n }", "function heroHit(enemy,hero){\n enemy.remove();\n heroDamage.play();\n hero.shapeColor = 'red';\n \n if (heroHealth <= 1){\n gameState = 'lose';\n loseMusic.loop();\n }\n heroHealth --;\n }", "function heavy (){\n \n \n dam = Math.ceil((Math.random() * 12) * 2); \n\n if (hero.defend === 1){\n hero.defend = 0;\n heroHealth -= (Math.floor(dam / 2));\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n else {\n heroHealth -= dam;\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n\n }", "use(player) {\n player.health -= 15;\n if (player.health < 0) player.health = 0;\n }", "function decreaseHealth() {\n let health = document.getElementById(\"health\");\n health.value -= 10;\n if (health.value === 0) {\n setTimeout(() => {\n document.querySelector(\"#gameScreen\").style.display = \"none\";\n document.querySelector(\"#loseScreen\").style.display = \"block\";\n document.querySelector(\"body\").style.backgroundColor = \"rgb(51, 83, 76)\";\n }, 1000);\n }\n}", "function check_health()\n{\n\tif(player['health'] <= 0){\n\t\tplayer['dead'] = true;\n\t}\n}", "decareaseHealth () {\r\n this.health--\r\n }", "function minusHealthOne () {\n compPlayer.health = compPlayer.health - playerOne.abilities.attackOne[1];\n loadHealth();\n}", "eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }", "function checkChangesToHUD() {\r\n if(menu){\r\n staminaSprite.visible = false;\r\n healthSprite.visible = false;\r\n staminaSprite2.visible = false;\r\n healthSprite2.visible = false;\r\n }\r\n else{\r\n staminaSprite.visible = true;\r\n healthSprite.visible = true;\r\n staminaSprite2.visible = true;\r\n healthSprite2.visible = true;\r\n }\r\n\r\n staminaSprite.scale.set((Math.abs(stamina) / 200) * spriteXScale, spriteYScale, 1);\r\n staminaSprite.position.x = (spriteXPosition) - (1 - (Math.abs(stamina)/200)) * spriteXScale / 2;\r\n\r\n // Damage effect\r\n if(damageWarning){\r\n if(damageFrames > 5){\r\n damageSprite.visible = false;\r\n damageWarning = false;\r\n }\r\n damageFrames += 1;\r\n }\r\n\r\n // If you have been hurt, we update the apperance of your health\r\n if (damaged) {\r\n \r\n // Update the size of the health bar according to your amount of health\r\n healthSprite.scale.set((Math.abs(health) / 100) * spriteXScale, spriteYScale, 1);\r\n healthSprite.position.x = (spriteXPosition) - (1 - (Math.abs(health)/100)) * spriteXScale / 2;\r\n\r\n // Color codes your health bar according to amount of health\r\n if (health > 80) {\r\n healthSprite.material.color.setHex(0x00ff00); // Green\r\n }\r\n if (health < 80) {\r\n healthSprite.material.color.setHex(0xffff00); // Yellow\r\n }\r\n if (health < 50) {\r\n healthSprite.material.color.setHex(0xff0000); // Red\r\n }\r\n\r\n // Set damaged to false to prevent taking further damage from the source\r\n damaged = false;\r\n }\r\n\r\n // Fading in the game over screen(s)\r\n if (gameOverScreen) {\r\n if (bloodSprite.material.opacity < 0.8) {\r\n bloodSprite.material.opacity += 0.01;\r\n gameOverSprite.material.opacity += 0.015;\r\n } else if (restartSprite.material.opacity < 0.5) {\r\n restartSprite.material.opacity += 0.02;\r\n }\r\n }\r\n \r\n // TODO: Comment\r\n if(level == 2 && !menu){\r\n var distance = new THREE.Vector3();\r\n distance.subVectors(charMesh.position, puzzle.position);\r\n if(distance.length() < 10){\r\n crossHairSprite.visible = true;\r\n }\r\n else{\r\n crossHairSprite.visible = false;\r\n }\r\n }\r\n}", "function reset() {\n currentMonsterHealth = chosenMaxLife;\n currentPlayerHealth = chosenMaxLife;\n resetGame(chosenMaxLife);\n}", "function updateHealth() {\n if (prefallenState) { // If we are in the prefallen state, we don't lose our vitality\n return;\n }\n // Reduce player health\n playerHealth = playerHealth - 0.5;\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "function SetHealth(health : int) {\n\tvar scalePercentage : float;\n\tif (health < maxHealth) { // Less health\n\t\tscalePercentage = 1.0 - ((maxHealth - health) / maxHealth);\n\t\tgreenGUITexture.pixelInset.width = redGUITexture.pixelInset.width * scalePercentage;\n\t} else if (health > maxHealth) { // More health\n\t\tscalePercentage = 1.0 + Mathf.Abs((maxHealth - health) / maxHealth);\n\t\tgreenGUITexture.pixelInset.width = redGUITexture.pixelInset.width * scalePercentage;\n\t} \n\tcurrentHealth = health;\n}", "function updateHealth() {\n // Reduce player health, constrain to reasonable range\n //playerHealth = constrain(playerHealth - 0.5,0,playerMaxHealth);\n // Check if the player is dead\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "function updateHealth(health) {\n health += 10;\n }", "function updateHealth() {\n // Reduce player health, constrain to reasonable range\n playerHealth = constrain(playerHealth - 0.8,0,playerMaxHealth);\n // Check if the player is dead\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "function healthBarReset() {\r\n oldHealth = maxHealth;\r\n healthDif = 0;\r\n if (intervalVar !== undefined) {\r\n clearInterval(intervalVar);\r\n }\r\n}", "function damageGlobalHealth(damage){\n globalHealth -= damage;\n baseHealthText.setText(globalHealth + \" / \" + maxGlobalHealth);\n \n if(globalHealth <= 0){\n globalHealth = 0;\n gameOver = true;\n //enemyManager.endGame();\n \n game.paused = true;\n \n //game over text\n gameOverText = game.add.text(game.world.centerX, game.world.centerY, \"Game Over\");\n gameOverText.font = 'Revalia';\n gameOverText.fontSize = 100;\n grd = gameOverText.context.createLinearGradient(0, 0, 0, gameOverText.canvas.height);\n grd.addColorStop(0, '#016dff'); \n grd.addColorStop(1, '#016dff');\n gameOverText.fill = grd;\n gameOverText.align = 'center';\n gameOverText.stroke = '#000000';\n gameOverText.strokeThickness = 4;\n gameOverText.setShadow(5, 5, 'rgba(0,0,0,0.5)', 5);\n gameOverText.inputEnabled = false;\n }\n else\n {\n if(globalHealth < (3/4) * maxGlobalHealth && globalHealth > (1/2) * maxGlobalHealth)\n {\n baseHealthText.fill = '#dade10';\n }\n else if(globalHealth < (1/2) * maxGlobalHealth && globalHealth > (1/4) * maxGlobalHealth)\n {\n baseHealthText.fill = '#de7b10';\n }\n else if(globalHealth < (1/4) * maxGlobalHealth)\n {\n baseHealthText.fill = '#de1410';\n }\n }\n }", "function updateHealth() {\n // Reduce player health based on width of the display\n playerHealth = playerHealth - width / 3000;\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, reset health, and update how many lives the player has left\n playerHealth = playerMaxHealth;\n updatePlayerLives();\n }\n}", "function reduceHealth() \n{\n if(healthBarScript.healthWidth > -8) \n {\n healthBarScript.healthWidth = healthBarScript.healthWidth - 1;\n } \n}", "reset() {\n this.health = 100;\n this.energy = 100;\n }", "function healthBarReset() {\n oldHealth = maxHealth;\n healthDif = 0;\n if (intervalVar !== undefined) {\n clearInterval(intervalVar);\n }\n}", "function h_reduceHealth()\n{\n\thealth = health - healthDamage;\n\n\t// fit color (green -> orange -> red -> death)\n\tswitch(health)\n\t{\n\t\tcase 70:\n\t\t\t$('#health').css('color', 'orange');\n\t\tbreak;\n\n\t\tcase 30:\n\t\t\t$('#health').css('color', 'red');\n\t\tbreak;\n\n\t\tcase 0:\n\t\t\tvar n = noty({text: 'You just died. RIP.'});\n\t\t\tgameEnded();\n\t\tbreak;\n\t} \n}", "function minusHealthThree () {\n compPlayer.health = compPlayer.health - playerOne.abilities.attackThree[1];\n loadHealth();\n}", "usePotion(){\n if(this.healingItem > 0){\n this.healingItem -= 1;\n this.hp += 10;\n }\n }", "function kick() {\n if (Player.health <= 0) {\n return;\n }\n Player.health -= 10 - (10 * Player.addMods());\n Player.damageMods();\n document.getElementById(\"armor-message\").innerText = \"\"\n //this is to keep the health bars current\n Player.hits++;\n update();\n}", "function playerHeal(tempHealth){\n currentHealth += tempHealth;\n if (currentHealth > maxHealth){\n currentHealth = maxHealth;\n }\n parseHealthBarAnimate();\n}", "resetCastle(){\n this.health = this.maxHealth;\n }", "grow() {\n if (this._health < 3)\n this._health ++;\n }", "function playerDamage(tempHealth) {\n if (!playerInvulnerability){\n playerInvulnerability = true; \n player.alpha = 0.3; \n setTimeout(playerInvulnerabilityStop, playerInvulnerabilityWait);\n currentHealth -= tempHealth;\n parseHealthBarAnimate();\n if (currentHealth <= 0) {\n gameOver(); \n }\n }\n}", "function healthCalc(){\n playerStats[\"maxhealth\"] = 4 * playerStats[\"endurance\"]\n}", "function healthCalc(){\n playerStats[\"maxhealth\"] = 4 * playerStats[\"endurance\"]\n}", "function setAttack() {\n $(\"#fight-outcome\").empty();\n\n arenaObj.enemy.health -= arenaObj.ally.attack;\n arenaObj.enemy.stats();\n\n killCharacter();\n\n $(\"#fight-outcome\").empty();\n\n arenaObj.ally.health -= arenaObj.enemy.counter;\n arenaObj.ally.stats();\n\n killCharacter();\n\n console.log(\"Your enemy HP is \" + arenaObj.enemy.health \n + \" and your HP is \" + arenaObj.ally.health);\n}", "function UseHealth(i)\n{\n var maxHealth = localStorage.getItem(\"PlayerMaxHealth\");\n var currentHealth = localStorage.getItem(\"PlayerHealth\");\n var heal = healthItemArray[i].heal;\n\n currentHealth = parseInt(currentHealth) + parseInt(heal);\n\n if (currentHealth > maxHealth){\n currentHealth = maxHealth;\n }\n\n var num = localStorage.getItem(\"HealthItem\"+i+\"InventNum\");\n num --;\n localStorage.setItem(\"HealthItem\"+i+\"InventNum\", num);\n\n if (num <= 0) {\n localStorage.setItem(\"HealthItem\"+i+\"Invent\", \"false\");\n localStorage.setItem(\"HealthItem\"+i+\"InventNum\", 0);\n }\n\n localStorage.setItem(\"PlayerHealth\", currentHealth);\n\n StatusLoad();\n}", "function increaseHealth() \n{\n if(healthBarScript.healthWidth < 199) \n\t {\n\t healthBarScript.healthWidth = healthBarScript.healthWidth + 1;\n\t }\n}", "decrementHealth() {\n this.health--;\n let that = this;\n that.showBurnedPlayer = true;\n\n if (this.id === this.game.id) {\n document.getElementById(\"amountLives\").innerText = this.health;\n } else {\n try {\n document.getElementById(this.id + 'HealthText').innerText = this.health;\n } catch (e) {\n console.log(e.message);\n }\n }\n\n setTimeout(() => {\n that.showBurnedPlayer = false;\n }, 1000);\n\n }", "function drawHealth() {\n push()\n fill(healthColor, 255, 100);\n noStroke();\n textSize(22);\n textAlign(RIGHT);\n text(\"HEALTH-->\", width / 1.1, height - 20)\n rect(width - 50, height, width - 50, -playerHealth);\n //if the players health is gettin glow, turn the recangle red, and play a ticking clock sound\n if (playerHealth < playerMaxHealth / 3) {\n healthColor = 0;\n tickTock.play();\n } else {\n healthColor = 120;\n tickTock.stop();\n }\n pop();\n}", "updateHealth(num) {\n this.health += num;\n if (this.health > 18) {\n this.health = 18;\n }\n if (this.health < 1) {\n this.health = 1;\n }\n }", "function healPlayer(val) {\n\tplayer.health.now += val;\n\tif(player.health.now > player.health.max) player.health.now = player.health.max;\n}", "player_got_hit()\n {\n const newAudio = this.sound.damage.cloneNode();\n newAudio.play();\n this.health--;\n if(this.health <=0)\n this.gameOver=true;\n this.tookDamage=true;\n\n }", "function minusHealthFour () {\n compPlayer.health = compPlayer.health - playerOne.abilities.attackFour[1];\n loadHealth();\n}", "function Start() \n{\n\t\n\tguiHealth = GameObject.Find(\"GameManager\");\n healthBarScript = guiHealth.GetComponent(GuiDisplayJava) as GuiDisplayJava;\n \n // Set initial value of the health...\n \n // Uncomment the line below and call reduceHealth() in the Update() method to watch health decrease\n healthBarScript.healthWidth = 199;\n \n // Uncomment the line below and call increaseHealth() in the Update() method to watch health increase\n // healthBarScript.healthWidth = -8;\n \n}", "function minusHealthTwo () {\n compPlayer.health = compPlayer.health - playerOne.abilities.attackTwo[1];\n loadHealth();\n}", "function Awake()\r\n{\r\n myTransform = transform;\r\n myCamera = Camera.main;\r\n health = 50; //arbritrarily chosen values to show that this script works\r\n maxHealth = 100;\r\n}", "get health(){ return this._health}", "monsterHealth(value) {\n if (value <= 0 && this.playerHealth <= 0) {\n // It is a draw\n this.winner = 'draw';\n } else if (value <= 0) {\n // player won\n this.winner = 'player';\n }\n }", "function firstInitHealthBar() {\r\n hbWidth = userIntThis.sys.game.config.width*0.20;\r\n hbHeight = userIntThis.sys.game.config.height*0.05;\r\n hbIncrement = hbWidth/maxHealth;\r\n hbReady = true;\r\n oldHealth = maxHealth;\r\n healthBar = userIntThis.add.graphics();\r\n healthBar.setDepth(500);\r\n}", "function strongAttackHandler(){\n attackMonster('STRONG_ATTACK');\n\n /*const damage = dealMonsterDamage(STRONG_ATTACK_VALUE);\n currentMonsterHealth -= damage;\n const playerDamage = dealPlayerDamage(MONSTER_ATTACK_VALUE);\n currentPlayerHealth -= playerDamage;\n\n //11\n if(currentMonsterHealth <=0 && currentPlayerHealth > 0){\n alert('You won!');\n\n }else if (currentPlayerHealth <=0 && currentMonsterHealth > 0){\n alert('You have Lost'); //Player loses if Monster Health is above 0.\n }\n else if (currentPlayerHealth <=0 && currentMonsterHealth <= 0 ){\n alert('You have a draw');\n }*/\n\n\n }", "lowerHealth(data) {\n\t\tif (data.id == socket.id) {\n\t\t\tplayer.HP -= data.dmg;\n\t\t\tif (player.HP <= 0) {\n\t\t\t\tmenu = 'dead';\n\t\t\t\tsocket.disconnect();\n\t\t\t}\n\t\t}\n\t}", "playerHealth(value) {\n if (value <= 0 && this.monsterHealth <= 0) {\n // It is draw\n this.winner = 'draw';\n } else if (value <= 0) {\n // The monster won\n this.winner = 'monster';\n }\n }", "takeDamage(damage) {\n this.health -= damage;\n if (this.health <= 0)\n {\n this.alive = false;\n }\n }", "hpCollision(player, HP){\n let HP_effect = this.add.sprite(HP.x, HP.y, 'HP_Effect').setOrigin(0, 0).setScale(2.5);\n HP.destroy();\n HP_effect.anims.play('HP_collect');\n this.sound.play('sfx_powerUp');\n HP_effect.on('animationcomplete', () => {\n HP_effect.destroy(true);\n })\n\n this.playerHealth += 1;\n this.healthDisplay.text = 'Hp:' + this.playerHealth;\n }", "function enemyAttack() {\n //depending on baddie type, deal different damage\n if (baddie.type === \"Ancient Dragon\") {\n var dmg = (Math.floor((Math.random() * 20)) + 30);\n } else if (baddie.type === \"Prowler\") {\n var dmg = (Math.floor((Math.random() * 20)) + 15);\n } else {\n var dmg = (Math.floor((Math.random() * 20)) + 5);\n }\n //subtract dmg from inventory.Health\n inventory.Health -= dmg;\n console.log(\"The \" + baddie.type + \" hits you for \" + dmg + \"! You now have \" + inventory.Health + \" health left!\")\n //player death logic\n if (inventory.Health > 0) {\n //if player is still alive, they can run or fight\n fightOrFlight();\n } else {\n die();\n }\n}", "function heal(){\n playerStats.health = playerStats.maxhealth ;\n localStorage.setItem('storedPlayerStats', JSON.stringify(playerStats));\n\n}", "function changeHealth(value){\n\tlet healthChanged = dieRoll(value);\n\treturn healthChanged;\n}", "function camp() {\n //refill health and magic:\n playerCurrentHealth = playerMaxHealth;\n playerMagic = 10;\n //update boxes:\n document.getElementById(\"playerHealthBox\").innerHTML = playerCurrentHealth + \"/\" + playerMaxHealth;\n document.getElementById(\"playerMagicBox\").innerHTML = playerMagic;\n}", "function player1() {\n if (flag1) {\n Player1_reduceHealth();\n flag1 = false;\n }\n}", "energyDown(){\n this.energy = this.energy - 0.05;//decrease player's energy\n if(player.energy > 0)//if player has energy then show bar\n {\n EnergyBar.x = (EnergyBar.x-0.05);//decrease energy bar\n EnergyBar.setScale((player.energy/player.maxEnergy),1);//scale energy Bar\n energy = player.getEnergy();\n }\n else if(player.energy == 0)//else destroy bar\n {\n EnergyBar.destroy();\n energy = player.getEnergy();\n }\n }", "function Update() {\n\t//Reduce fill amount over 30 seconds\n\tHunger.fillAmount -= .3f / waitTime * Time.deltaTime;\n\tSleep.fillAmount -= .2f / waitTime * Time.deltaTime;\n\t//Currency\n\tMonies.text = \"Cash: \" + PlayerPrefs.GetInt(\"Money\");\n\tSkillPoints.text = \"SP: \" + PlayerPrefs.GetInt(\"sp\");\n\tHome.text = \"House: \" + PlayerPrefs.GetString(\"House\");\n\tBed.text = \"Bed: \" + PlayerPrefs.GetString(\"Bed\");\n\tJob.text = \"Job: \" + PlayerPrefs.GetString(\"Job\");\n\t\n\ttime.text = \"Time: \" + timed + \" : \" + timeh + \" : \" + timem;\n\t\n\tif (Hunger.fillAmount == 0) {\n\t\tPlayerPrefs.SetString(\"Death\", \"true\");\n\t}\n\tif (Sleep.fillAmount == 0) {\n\t\tPlayerPrefs.SetString(\"Death\", \"true\");\n\t}\n\tif (PlayerPrefs.GetString(\"Death\") == \"true\") {\n\t\tNews2.text = News.text;\n\t\tNews.text = \"You died and all your stats have restarted\";\n\t\tDebug.Log(\"User Died\");\n\t\tPlayerPrefs.DeleteAll();\n\t\tHunger.fillAmount = 1;\n\t\tSleep.fillAmount = 1;\n\t}\n\t\n\t//Bars\n\tPlayerPrefs.SetFloat(\"HUNGER\", Hunger.fillAmount);\n\tPlayerPrefs.SetFloat(\"ENERGY\", Sleep.fillAmount);\n}", "function healthcheck() {\n if (target.healthScore <= 0) {\n drawLoser();\n }\n}", "function daDamageThing(damage, typeBonus, currentDragonHealth) {\r\n //secondEle.innerHTML=\"\"\r\n dragonHealth = currentDragonHealth - (damage + typeBonus)\r\n\r\n secondEle.innerHTML = \"Dragon Health:\" + dragonHealth\r\n if (dragonHealth<=0){\r\n secondEle.innerHTML=\"Dragon Health:\" + 0\r\n //dragonHealth=0\r\n thirdEle.innerHTML=\"AYO YOU DID IT YOU BEAT THIS DRAGON'S ASS, have a cookie!\"\r\n }\r\n}", "function changeHP (who, amount) {\n\t// validate 'who'. must be either 'char', or 'mob'. default to character\n\tsubject = (who == \"mob\") ? \"mob\" : \"char\";\n\t// amount needs to be a number\n\tamount = (isNaN (parseInt (amount, 10))) ? 0 : parseInt (amount, 10);\n\t\n\t// don't let the health drop below zero\n\tif (amount < 0) amount = 0;\n\t\n\tgame_state[subject]['hp'] = amount;\n\t$('.'+subject+'_health').html (amount);\n\t\n\t// what percent is amount of the full health?\n\tpercent_health = (game_state[subject]['hp']/game_state[subject]['max_hp']) * 100;\n\t\n\t$('.'+subject+'_health_bar').animate ({width: percent_health+\"px\"}).css('overflow', 'visible');\n}", "TakeDamage(dmg){\n this.currentHealth = this.currentHealth - dmg;\n }", "update(deltaTime){\n this.healthBar.scale.x = this.health / this.maxHealth;\n if(this.health <= 0){\n this.die();\n }\n \n if(this.health > this.maxHealth){\n this.health = this.maxHealth;\n }\n }", "damagePlayer(player) {\r\n player.health -= this.damage;\r\n player.damageTakenSound.play();\r\n }", "function subtractHealth() {\n fighterObj.health = fighterObj.health - enemyObj.counterAttack;\n enemyObj.health = enemyObj.health - fighterObj.attackNew;\n fighterObj.attackNew = fighterObj.attackNew + fighterObj.attack;\n\n\n\n\n\n if (fighterObj.health <= 0) {\n $(\".info-pop-up-text\").text(enemyObj.name + \" killed you!\");\n $(\"#resetLoose\").css(\"display\", \"block\");\n $(\".info-pop-up\").css(\"display\", \"flex\");\n\n\n }\n\n if (enemyObj.health <= 0) {\n $(\".enemy-display\").empty();\n $(\".info-pop-up-text\").text(enemyObj.name + \" is dead! Pick your next enemy!\");\n $(\".info-pop-up\").css(\"display\", \"flex\");\n $(\".resetWin\").css(\"display\", \"none\");\n setTimeout(function () {\n $(\".info-pop-up\").css(\"display\", \"none\");\n\n }, 2500);\n\n $(\".enemyDisplay\").empty();\n enemyChosen = false;\n defeatedFighters.push(enemyObj);\n }\n\n if (defeatedFighters.length == 3) {\n $(\".info-pop-up-text\").css(\"color\", \"red\");\n $(\".ultimate-win\").css(\"display\", \"flex\");\n $(\".info-pop-up\").css(\"display\", \"none\");\n $(\".ultimate-win-text\").text(\" You are the supreme winner\");\n $(\".resetWin\").css(\"display\", \"flex\");\n\n }\n }", "hurtBoss(projectiles, PianoBoss) {\n bossHealth -= playerDamage;\n projectiles.destroy();\n this.bossHPLabel.text = \"HP:\" + bossHealth + \"/\" + bossMaxHealth;\n if (bossHealth<= 0){\n score += bossMaxHealth;\n PianoBoss.destroy();\n this.scene.start('deadScene', {transferScore: score});\n }\n }", "function healthPotion() {\n // If player has any health potions\n if (Player.healthPotions > 0){\n //This conditional branch is so that it doesn't gain over max health\n var diff = Player.maxHealth - Player.health;\n \n if (diff >= 50){\n alert(\"You have used a health potion to gain 50 Health points!\");\n Player.health = Player.health + 50;\n Player.healthPotions--;\n document.getElementById(\"health\").innerHTML = Player.health + \" health / \" + Player.maxHealth + \" health\";\n document.getElementById(\"healthP\").innerHTML = Player.healthPotions + \" Health Potions\";\n \n // enemy turn \n turns++;\n document.getElementById(\"turn\").innerHTML= \"Turn \" + turns;\n eAttack(defendRating);\n turns++;\n document.getElementById(\"turn\").innerHTML= \"Turn \" + turns;\n\n }\n\n else {\n alert(\"You have used a health potion to gain \" + diff + \" Health points!\");\n Player.health = Player.health + diff;\n Player.healthPotions--;\n document.getElementById(\"health\").innerHTML = Player.health + \" health / \" + Player.maxHealth + \" health\";\n document.getElementById(\"healthP\").innerHTML = Player.healthPotions + \" Health Potions\";\n \n // enemy turn \n turns++;\n document.getElementById(\"turn\").innerHTML= \"Turn \" + turns;\n eAttack(defendRating);\n turns++;\n document.getElementById(\"turn\").innerHTML= \"Turn \" + turns;\n }\n }\n\n else {\n alert(\"You do not have enough health potions!\");\n }\n}", "function punch() {\n if (Player.health <= 0) {\n return;\n }\n Player.health -= 5 - (5 * Player.addMods());\n Player.damageMods();\n document.getElementById(\"armor-message\").innerText = \"\"\n //this is to keep the health bars current\n Player.hits++;\n update();\n}", "function player3() {\n if (flag3) {\n Player3_reduceHealth();\n flag1 = false;\n }\n}", "function decrease() {\r\n if (answer() === 1) {\r\n hunger--;\r\n } else if (answer() === 2) {\r\n health--;\r\n } else if (answer() === 3) {\r\n happiness--;\r\n }\r\n }", "function hpCheck (){ // tell me where to find health variables!\n\tHPBar();\n\tif (pPIdentifier.HP < 1){\n\t\tbattleMsg = \"You have been defeated.\"\n\t\tbattleMsgFunc();\n\t\tbattleState = false;\n\t\t//hideBattle(); // Define me! Because otherwise the battle is not ending! D:\n\t\t\n\t\t//endGame Msg;\n\t}else if ( currentBattle.HP < 1){\n\t\tbattleMsg = \"You have defeated \" + currentBattle.Identifier + \"!\";\n\t\tbattleMsgFunc();\n\t\tbattleState = false;\n\t\t//hideBattle(); // Define me!\n\t\t//continue story\n\t}else{ \n\t\t// Continue on your merry way :)\n\t};\n}", "function timePlay() {\r\n hg = hg;\r\n st += 2;\r\n status();\r\n Time = setTimeout(function(){timePlay()}, 5000);\r\n console.log(\"Time \" + Time + \" Hunger \" + hg + \" Health Point \" + hp);\r\n \r\n document.getElementById(\"healthbar\").innerHTML = hp;\r\n $(\"#healthbar\").css(\"width\", hp);\r\n document.getElementById(\"hungerbar\").innerHTML = hg;\r\n $(\"#hungerbar\").css(\"width\", hg);\r\n document.getElementById(\"staminabar\").innerHTML = st;\r\n $(\"#staminabar\").css(\"width\", st);\r\n\r\n\r\n hg = hg - 5;\r\n if(hg <= 0)\r\n {\r\n hg = 0;\r\n hp -= 5;\r\n }\r\n\r\n if (hp <= 20)\r\n {\r\n $(\"#healthbar\").switchClass(\"bg-success\",\"bg-danger\", hp ,\"easeInOutQuad\");\r\n }\r\n if (hp == 0){\r\n\r\n gameOver();\r\n }\r\n}", "function useHealthPotion() {\n var healAmount = 50;\n usePotion(new HealthPotion(healAmount));\n}", "function bosslevel() {\n myy.stop(); ///stop the mission failed music\n hakeem.play();\n\n level = 0;\n lives = 1;\n shapeNum = 100;\n invisibility = 20; //stay alive for 5 seconds, life is never fair\n shapeSpeed = 400;\n score = 0;\n ship = newShip();\n\n // get the high score from local storage\n var scoreStr = localStorage.getItem(SAVE_KEY_SCORE);\n if (scoreStr == null) {\n scoreHigh = 0;\n } else {\n scoreHigh = parseInt(scoreStr);\n }\n\n newLevel();\n }", "function slap() {\n if (Player.health <= 0) {\n return;\n }\n Player.health -= 1 - (1 * Player.addMods());\n Player.damageMods();\n document.getElementById(\"armor-message\").innerText = \"\"\n //this is to keep the health bars current\n Player.hits++;\n update();\n}", "fullyHealed(heal) {\n this.player.health += Number(heal);\n this.newLine();\n console.log(\"Fully healed!\");\n \n }", "drinkSake(){\n this.health += 10;\n }", "function Health(damage,turn,autoPlay)\n{\n\tif (turn == 0) {\n\t\tCHP -=damage;\n\t\tprintHtmlResult('display6',\"HP: \"+ CHP);\n\t\tif(autoPlay == false){\n\t \t\ttoggletoD12D20();\n\t \t}\n\t\tGameOver(PHP,CHP)\n\t}\n\telse{\n\t\tPHP -=damage;\n\t\tprintHtmlResult('display5',\"HP: \"+ PHP);\n\t \tGameOver(PHP,CHP)\n\t}\n}", "function healthCheck() {\n for (var i = 0; i < partyMemberArray.length; i++) {\n if (partyMemberArray[i].hp < 1) {\n partyMemberArray[i].KO = true;\n partyMemberArray[i].hp = 0;\n if (fighter.KO) {\n $(\"#playerCharacter1\").animate({\n opacity: '0.5',\n });\n }\n if (whiteMage.KO) {\n $(\"#playerCharacter2\").animate({\n opacity: '0.5',\n });\n }\n if (blackMage.KO) {\n $(\"#playerCharacter3\").animate({\n opacity: '0.5',\n });\n }\n }\n }\n}", "function MinusStat(stat,amount){\n\tStats[stat]-=amount;\n\tif (stat=\"HP\" && Stats.HP<=0){\n\t\t//print game over,restart game\n\t\tif ($('#layoutLeftgame').display==\"none\"){\n\t\t\tvar area = document.getElementById(\"layoutLeft\");\n\t\t\tarea.innerHTML=\"YOU DIED! Refresh your browser to start again!\";\n\t\t\tarea = document.getElementById(\"layoutLeftgame\");\n\t\t\tarea.innerHTML=\"YOU DIED! Refresh your browser to start again!\";\n\t\t}else{\n\t\t\t//I WAS AGAINST THIS COURSE SINCE YOU SHOULD BE DEAD AND ALWAYS\n\t\t\t//HAVE TO RESTART THE ENTIRE GAME!! but whatever, this restarts\n\t\t\t//the current battle instead of the entire game...\n\t\t\t$('#player-actions').html(\"You fall over in pain as you feel the \"+\n\t\t\tMonster.Name+\"'s attack hit its mark. Your world goes dark.\");\n\t\t\t$('#enemy-actions').html(\"You suddenly feel the world returning,\\\n\t\t\t\tbut it's flowing backwards. Time is reverting!\");\n\t\t\t$('#enemy-pic').removeClass();\n\t\t\t$('#background').css(\"background\",\"black\");\n\t\t\t$('#Heal').hide();\n\t\t\t$('#Attack').hide();\n\t\t\t$('#MagicMissile').hide();\n\t\t\t$('#Run').hide();\n\t\t\t$('#Restart').show();\n\t\t}\n\t}\n\tUpdateDisplay();\n}", "function updateHeroHP() {\n\theroStats.hp = (heroStats.hp - defenderStats.cap);\n\t$(`#${heroID}-hp`).html(heroStats.hp);\n}", "function setEnemyHealth(kills) {\n var base = 100;\n var mod = rollTwoDie(kills, 10) * 3;\n return base + mod;\n }", "function initTheGame() {\n activePlayer = 0\n isPlaying = true\n p1Health = 100\n p2Health = 100\n p1selectedHero = false\n p2selectedHero = false\n\n document.getElementById('modal-heroes').style.display = 'block'\n document.querySelector('.dice').style.display = 'none'\n\n document.getElementById('current-health-0').textContent = '100'\n document.getElementById('current-health-1').textContent = '100'\n}", "heal(otherHero) {\n // otherHero.health += this.power;\n otherHero.receiveHealth(this.power);\n console.log(`other hero has ${otherHero.health}`);\n }", "die(){\n if(this.direction == 1){\n this.healthBar.parent.sceneManager.gameOverScene.message.setText(\"You Lose!\");\n }\n else{\n this.healthBar.parent.sceneManager.gameOverScene.message.setText(\"You Win!\");\n \n //update local storage with max level\n if(this.healthBar.parent.sceneManager.maxLevel == this.healthBar.parent.sceneManager.currentLevel){\n this.healthBar.parent.sceneManager.maxLevel++;\n this.healthBar.parent.sceneManager.updateStorage();\n }\n }\n \n this.healthBar.parent.sceneManager.switchScene(\"GAMEOVER\");\n this.healthBar.parent.reset();\n }", "function power() {\n health += 11\n drawhealth()\n console.log(\"power\")\n}", "function takeDamage (damage : int){\n\n\t//here we play the sound that it got hurt\n\taudio.PlayOneShot(hurtSound);\n\t//here we change the color of the bat to give a visual indication that it was hit\n\trenderer.material.color.r = 1;\n\trenderer.material.color.g = 0; \n\trenderer.material.color.b = 0; \n\t//we set the color counter to zero so we can track how long we have the color indication going for.\n\tcolorCounter = 0.0;\n\t//we subtract health to track how much it has so it can die\n\thealth -= damage;\n\t//if the health hits zero or is somehow less than zero, we want to get the death stuff going\n\tif(health <= 0){\n\t\t//here we choose a random number to determine what he will drop\n\t\tvar randNum:int = Random.Range(1,4);\n\t\t//if the number is 2 we'll do a heart\n\t\tif(randNum == 2){\n\t\t\tInstantiate(heart, transform.position, Quaternion.Euler(-90,180,0));\n\t\t//if its any other number besides 2, we'll drop a gem instead\n\t\t}else{\n\t\t\tInstantiate(gem, transform.position, Quaternion.Euler(-90,180,0));\n\t\t}\n\t//before we destroy the bat we want to spawn the explosion animation so it looks pretty.\n\tInstantiate(explosion, transform.position, Quaternion.Euler(-90,180,0));\n\t//here we delete the bat. you won!\n\tDestroy(gameObject);\n}\n\n//if the bat got hurt, we set the velocity to zero before we choose which direction it will go\nrigidbody.velocity = Vector3(0,0,0);\n\n}" ]
[ "0.7733549", "0.7381738", "0.73797417", "0.7197034", "0.71393603", "0.7122758", "0.71154654", "0.7089154", "0.7088735", "0.70698965", "0.7054828", "0.7046016", "0.7043073", "0.70301557", "0.6978089", "0.69637847", "0.69288003", "0.6914784", "0.6894672", "0.6867419", "0.68639386", "0.68553907", "0.68507016", "0.68455946", "0.6841847", "0.6821985", "0.6788127", "0.67806864", "0.677747", "0.67738885", "0.67657566", "0.67242527", "0.667868", "0.66707677", "0.66664314", "0.6665689", "0.66497344", "0.66220856", "0.6620024", "0.66062325", "0.6571953", "0.65617704", "0.6556198", "0.6556198", "0.65489817", "0.65337014", "0.6519278", "0.65100265", "0.64997494", "0.6497842", "0.64837563", "0.6475527", "0.6468898", "0.6467253", "0.64455205", "0.6436041", "0.64325416", "0.6431406", "0.64258605", "0.6420032", "0.6406842", "0.6396576", "0.6390795", "0.6383872", "0.6375079", "0.637253", "0.6361836", "0.635854", "0.63580465", "0.63568014", "0.63553804", "0.63532114", "0.63399005", "0.63245064", "0.63164514", "0.63160247", "0.63156235", "0.6307258", "0.6304949", "0.63030714", "0.62951046", "0.6286883", "0.62838227", "0.6280757", "0.6279811", "0.6271451", "0.6269473", "0.626717", "0.62497294", "0.62496936", "0.6238987", "0.62371814", "0.6236303", "0.62356794", "0.62143207", "0.6213174", "0.6193457", "0.6191333", "0.6187146", "0.6184262" ]
0.6222529
94
This function controls the global variable for hunger. Throughout the game, we can set the hunger and the slices of bread will disappear.
function displayBreads() { document.getElementById("bread5").hidden = false; document.getElementById("bread4").hidden = false; document.getElementById("bread3").hidden = false; document.getElementById("bread2").hidden = false; document.getElementById("bread1").hidden = false; if( hunger === 4) { document.getElementById("bread5").hidden = true; } if( hunger === 3) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; } if( hunger === 2) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; } if( hunger === 1) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; document.getElementById("bread2").hidden = true; } if( hunger === 0) { document.getElementById("bread5").hidden = true; document.getElementById("bread4").hidden = true; document.getElementById("bread3").hidden = true; document.getElementById("bread2").hidden = true; document.getElementById("bread1").hidden = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hungerDrain () {\r\n if (hungerBar.w > 0) {\r\n hungerBar.w -= hungerBar.speed;\r\n } else if (hungerBar.w <= 0) {\r\n stopGame();\r\n }\r\n}", "function HLdown(){\n console.log(\"In hair l arrow clicked\");\n hair.destroy();\n hairindex--;\n if(hairindex<=0)\n {\n bh.destroy();\n hairindex = 0;\n hair = game.add.image(1015,55, images.hair[hairindex].name);\n hair.scale.setTo(0.4);\n bh = bb.create(500,55, images.hair[hairindex].name);\n bh.scale.setTo(0.4);\n }\n else if (hairindex >= images.hair.length)\n {\n bh.destroy();\n hairindex = images.hair.length -1;\n hair = game.add.image(1015,55, images.hair[hairindex].name);\n hair.scale.setTo(0.4);\n bh = bb.create(500,55, images.hair[hairindex].name);\n bh.scale.setTo(0.4);\n }\n else\n {\n bh.destroy();\n hair = game.add.image(1015,55, images.hair[hairindex].name);\n hair.scale.setTo(0.4);\n bh = bb.create(500,55, images.hair[hairindex].name);\n bh.scale.setTo(0.4);\n }\n player.appearance.head.hair = images.hair[hairindex].name;\n}", "gotKilled() {\n\n\n var scene = this.scene;\n //Delete the bounder\n this.bounder.dispose();\n\n //Dispose the hit bounding box as well.\n this.hitBoundingBox.dispose();\n\n this.tankParticleSystem.stop();\n this.cannonParticleSystem.stop();\n\n this.tankParticleSystem.emitter = new BABYLON.Vector3(0, -200, 0);\n\n this.cannonParticleSystem.emitter = new BABYLON.Vector3(0, -200, 0);\n\n this.tankParticleSystem.dispose();\n this.cannonParticleSystem.dispose();\n\n this.tankSphereEmitter = null;\n this.cannonSphereEmitter = null;\n\n\n /** \n * This block of code will be executed when a red team tank (for example the hero tank)\n * dies (tank.tankStatus.health == 0). \n */\n if (this.team == 'red') {\n if (!scene.redTanks) return;\n\n\n //This flag is set to avoid any call to the scene.redTanks array in the \"startRedTeamTanks\" function (to be implemented).\n managing_redTanksArray = true;\n\n\n\n //Refactoring completely the redTanks array. Create a new array without the dead tank.\n var newArray = [];\n for (var i = 0; i < scene.redTanks.length; ++i) {\n if (scene.redTanks[i] != this) {\n newArray.push(scene.redTanks[i]);\n }\n }\n\n\n //Clear the scene.redTanks array by setting its length to zero.\n scene.redTanks.length = 0;\n\n\n\n //\n scene.redTanks = newArray;\n\n this.root.dispose();\n\n //Set this variable back to false.\n managing_redTanksArray = false;\n\n\n\n /** \n * If the hero tank dies we need to do something more: display the death menu.\n */\n if (scene.heroTank && this == scene.heroTank) {\n\n //We kill the hero tank.\n scene.heroTank = null;\n //Special function that will render a death screen menu.\n this.gotKilledHeroTank();\n\n }\n }\n\n\n /** \n * This block of code will be executed when a blue team tank (one of the clone tanks)\n * dies (tank.tankStatus.health == 0). \n */\n else if (this.team == 'blue') {\n if (!scene.blueTanks) return;\n\n\n //This flag is set to avoid any call to the scene.blueTanks array in the \"startBlueTeamTanks\" function (to be implemented).\n managing_blueTanksArray = true;\n\n\n\n //Refactoring completely the blueTanks array.\n var newArray = [];\n for (var i = 0; i < scene.blueTanks.length; ++i) {\n if (scene.blueTanks[i] != this) {\n newArray.push(scene.blueTanks[i]);\n }\n }\n\n //Clear the array.\n scene.blueTanks.length = 0;\n\n\n scene.blueTanks = newArray;\n\n //Set the variable back to false.\n managing_blueTanksArray = false;\n\n this.root.dispose();\n }\n\n\n return;\n }", "dead(){\n if (this.y > 1.5*height){\n petals.splice(this,1);\n }\n }", "function clean_slate() {\n clear_gifts();\n hit = false;\n game_level_score = 0;\n game_level_timer = 45;\n clearInterval(timer_id);\n gift_timeouts = [];\n keys = {};\n unblast_balloon();\n //$(\"#balloon\").removeClass('blink');\n $(\"#balloon\").css('top', '70%');\n $(\"#balloon\").css('left', '50%');\n}", "function setHUD() {\n\tif (bMap) {\n\t\tvar horiz = map_range(camera.position.x, -horizBoundary, horizBoundary, -lightHUDSize/2, 256+lightHUDSize/2) - lightHUDSize/2;\n\t\tvar vert = map_range(camera.position.y, vertBoundary, -vertBoundary, 0, 160) - lightHUDSize/2;\n\n\t\tuserPosition.style.left = horiz + \"px\";\n\t \tuserPosition.style.top = vert + \"px\";\n \t}\n \telse {\n \t\tuserPosition.style.left = \"-9999px\";\n \t\tuserPosition.style.top = \"-9999px\";\n\n \t\tHUD.style.right = \"-9999px\";\n\t \tHUD.style.bottom = \"-9999px\";\n \t}\n}", "resetCastle(){\n this.health = this.maxHealth;\n }", "function C007_LunchBreak_Natalie_Ungag() {\r\n CurrentTime = CurrentTime + 60000;\r\n ActorRemoveInventory(\"TapeGag\");\r\n if (ActorHasInventory(\"Ballgag\")) {\r\n ActorRemoveInventory(\"Ballgag\");\r\n PlayerAddInventory(\"Ballgag\", 1);\r\n }\r\n if (ActorHasInventory(\"ClothGag\")) {\r\n ActorRemoveInventory(\"ClothGag\");\r\n PlayerAddInventory(\"ClothGag\", 1);\r\n }\r\n C007_LunchBreak_Natalie_IsGagged = false;\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "hurtBoss(projectiles, PianoBoss) {\n bossHealth -= playerDamage;\n projectiles.destroy();\n this.bossHPLabel.text = \"HP:\" + bossHealth + \"/\" + bossMaxHealth;\n if (bossHealth<= 0){\n score += bossMaxHealth;\n PianoBoss.destroy();\n this.scene.start('deadScene', {transferScore: score});\n }\n }", "function C010_Revenge_SidneyJennifer_Ungag() {\n\tOverridenIntroImage = \"\";\n\tActorUngag();\n\tCurrentTime = CurrentTime + 50000;\n\tC010_Revenge_SidneyJennifer_IsGagged = false;\n}", "damageGun( dam ) {\n\n this.screens.gun.standartNoise = 1.0 - this.car.health.gun / 20\n if ( this.car.health.gun < 5 && this.screens.ammo.obj.visible ) \n this.destroyBar( this.screens.ammo )\n }", "function resetCombatVariables()\r\n{\tfor(var i=0;i < currentBuffStatus.length;i++)\r\n\t{\tcurrentBuffStatus[i] = false;\r\n\t}\r\n\tweakenCount = 0;\r\n\tlastHP = 0;\r\n}", "function heavy (){\n \n \n dam = Math.ceil((Math.random() * 12) * 2); \n\n if (hero.defend === 1){\n hero.defend = 0;\n heroHealth -= (Math.floor(dam / 2));\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n else {\n heroHealth -= dam;\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n\n }", "function setBust(num) {\r\n if (typeof num === \"string\")\r\n num = getBustNumber(num);\r\n\r\n if (num == -1 || currentBust === getBustName(num)) return;\r\n\r\n scene.remove(loadedBusts[getBustNumber(currentBust)]);\r\n if (num < NUM_OF_BUSTS) {\r\n if (loadedBusts[num] === undefined) {\r\n document.getElementById(\"nameOfLight\").innerHTML = \"Loading . . .\";\r\n jsonLoad(getBustName(num));\r\n } else {\r\n scene.add(loadedBusts[num]);\r\n mesh = loadedBusts[num];\r\n currentBust = getBustName(num);\r\n }\r\n }\r\n}", "function creepyHut(){\n\tcurrentBG = hut;\n\tbackground(hut);\n}", "gotKilledHeroTank() {\n\n //Move completely to another scene.\n\n engine.stopRenderLoop();\n\n var scene = Game.scenes[Game.activeScene];\n\n Game.activeScene = END_MENU_SCENE_VALUE;\n //Stop playing the game music\n if (soundEnabled) {\n if (scene.assets) {\n if (scene.assets['gameMusic']) {\n scene.assets['gameMusic'].stop();\n }\n }\n }\n\n scene.dispose();\n\n\n //Free the user from the pointer lock\n document.exitPointerLock();\n\n\n\n\n\n //Render the death menu\n startDeathMenu();\n\n return;\n\n\n }", "function heroHit(enemy,hero){\n enemy.remove();\n heroDamage.play();\n hero.shapeColor = 'red';\n \n if (heroHealth <= 1){\n gameState = 'lose';\n loseMusic.loop();\n }\n heroHealth --;\n }", "function battUtility(){\n\t\t\troot.line_cover_3.visible = false;\n\t\t\troot.line_cover_4.visible = false;\n\t\t\troot.line_cover_5.visible = false;\n\t\t\troot.line_cover_9.visible = false;\n\t\t\troot.dot_path3_rev.visible = false;\n\t\t\troot.dot_path4_rev.visible = false;\n\t\t\troot.dot_path5_rev.visible = false;\n\t\t\tdischarging();\n\t\t\tlet dischargingChecker = setInterval(battDischarging,100);\n\t\t\tfunction battDischarging(){\n\t\t\t\tif (charge<10){\n\t\t\t\t\tresetLine();\n\t\t\t\t\tclearInterval(dischargingChecker);\n\t\t\t\t\treturn genSwitch = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "function checkChangesToHUD() {\r\n if(menu){\r\n staminaSprite.visible = false;\r\n healthSprite.visible = false;\r\n staminaSprite2.visible = false;\r\n healthSprite2.visible = false;\r\n }\r\n else{\r\n staminaSprite.visible = true;\r\n healthSprite.visible = true;\r\n staminaSprite2.visible = true;\r\n healthSprite2.visible = true;\r\n }\r\n\r\n staminaSprite.scale.set((Math.abs(stamina) / 200) * spriteXScale, spriteYScale, 1);\r\n staminaSprite.position.x = (spriteXPosition) - (1 - (Math.abs(stamina)/200)) * spriteXScale / 2;\r\n\r\n // Damage effect\r\n if(damageWarning){\r\n if(damageFrames > 5){\r\n damageSprite.visible = false;\r\n damageWarning = false;\r\n }\r\n damageFrames += 1;\r\n }\r\n\r\n // If you have been hurt, we update the apperance of your health\r\n if (damaged) {\r\n \r\n // Update the size of the health bar according to your amount of health\r\n healthSprite.scale.set((Math.abs(health) / 100) * spriteXScale, spriteYScale, 1);\r\n healthSprite.position.x = (spriteXPosition) - (1 - (Math.abs(health)/100)) * spriteXScale / 2;\r\n\r\n // Color codes your health bar according to amount of health\r\n if (health > 80) {\r\n healthSprite.material.color.setHex(0x00ff00); // Green\r\n }\r\n if (health < 80) {\r\n healthSprite.material.color.setHex(0xffff00); // Yellow\r\n }\r\n if (health < 50) {\r\n healthSprite.material.color.setHex(0xff0000); // Red\r\n }\r\n\r\n // Set damaged to false to prevent taking further damage from the source\r\n damaged = false;\r\n }\r\n\r\n // Fading in the game over screen(s)\r\n if (gameOverScreen) {\r\n if (bloodSprite.material.opacity < 0.8) {\r\n bloodSprite.material.opacity += 0.01;\r\n gameOverSprite.material.opacity += 0.015;\r\n } else if (restartSprite.material.opacity < 0.5) {\r\n restartSprite.material.opacity += 0.02;\r\n }\r\n }\r\n \r\n // TODO: Comment\r\n if(level == 2 && !menu){\r\n var distance = new THREE.Vector3();\r\n distance.subVectors(charMesh.position, puzzle.position);\r\n if(distance.length() < 10){\r\n crossHairSprite.visible = true;\r\n }\r\n else{\r\n crossHairSprite.visible = false;\r\n }\r\n }\r\n}", "function update_stress_hunger(stress_d, fullness_d, reset_ticks_n){\n stress += stress_d;\n if (stress < 0){ // overflow hack\n stress = 0;\n }\n fullness += fullness_d\n //ticks_since_last_action = reset_ticks_n\n if (stress >= 1){\n // burnout fail\n g.fadeOut(awakescene, 10);\n awakescene.visible = false;\n stress_fail_scene.visible = true;\n g.fadeIn(stress_fail_scene, 10);\n }\n else if (fullness < 0){\n // hunger fail\n fullness = 0.1; // prevent hunger bar overflow\n g.fadeOut(awakescene, 10);\n awakescene.visible = false;\n hunger_fail_scene.visible = true;\n g.fadeIn(hunger_fail_scene, 10);\n }\n else if (fullness > 1){\n g.fadeOut(awakescene, 10);\n awakescene.visible = false;\n winscene.visible = true;\n g.fadeIn(winscene, 10);\n }\n hunger_bar.inner.height = 2000*fullness;\n awakescene.alpha = 0.1 + (0.9 * (1-stress))\n // console.log(\"Stress at \"+stress+\", Fullness at \"+fullness)\n }", "display() {\n if (this.health > 0) {\n push();\n noStroke();\n fill(this.fillColor);\n this.radius = this.health;\n ellipse(this.x, this.y, this.radius * 2);\n image(this.image, this.x, this.y, this.radius, this.radius);\n pop();\n } else {\n var removed = hunterList.splice(this.index, 1);\n }\n }", "function resetHealth() {\n lukeSkywalker.healthPoints = 140;\n obiWan.healthPoints = 120;\n princessLeia.healthPoints = 115;\n hanSolo.healthPoints = 129;\n maceWindu.healthPoints = 140;\n yoda.healthPoints = 150;\n \n darthVader.healthPoints = 119;\n darthMaul.healthPoints = 110;\n tarkin.healthPoints = 90;\n palpatine.healthPoints = 130;\n kyloRen.healthPoints = 129;\n snoke.healthPoints = 145;\n console.log('user health: ' + userFighter.healthPoints);\n }", "function resetHUD() {\n score = gscore = tick = 0;\n tTime = 60;\n timeReturn = window.setInterval(mTime, 1000);\n clearMsgs();\n}", "destroyBar( b ) {\n\n if ( b.obj.visible ) { \n b.obj.visible = false\n b.screen.material = new THREE.MeshLambertMaterial( { map: b.screenNoiseMap } )\n b.screen.material.needsUpdate = true\n }\t\n }", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "function reduceHealth() \n{\n if(healthBarScript.healthWidth > -8) \n {\n healthBarScript.healthWidth = healthBarScript.healthWidth - 1;\n } \n}", "function initGameBoard() {\n waterLevel = water;\n var\n}", "deactivateHouse() {\r\n this.lightOn = false;\r\n this.light.visible = false;\r\n }", "function hideHud() {\n\t\t$(\".hud, .options\").removeClass('grow').addClass('hudScale').slideUp();\n\n\t\n\t}", "function SarahPlayerPunishGirls() {\n\tif (SarahShackled()) SarahUnlock();\n\tif (Amanda != null) Amanda.Stage = \"1000\";\n\tif (Sarah != null) Sarah.Stage = \"1000\";\n}", "static clearHUD()\n {\n Platform.ctx.clearRect(0, 0, RPM.CANVAS_WIDTH, RPM.CANVAS_HEIGHT);\n Platform.ctx.lineWidth = 1;\n Platform.ctx.webkitImageSmoothingEnabled = false;\n Platform.ctx.imageSmoothingEnabled = false;\n }", "removeColliders() {\r\n\t\t\tthis._collides = {};\r\n\t\t\tthis._colliding = {};\r\n\t\t\tthis._collided = {};\r\n\t\t\tthis._removeFixtures(false);\r\n\t\t}", "function revive() {\n hp = 100;\n alive = true;\n }", "setsInvisibility() {\n if (this.currentShip === 'Looking for a Rig' || this.position !== 'Defender') {\n return 'had no effect'\n } else if (this.position === 'Defender') {\n this.currentShip.cloaked = true\n }\n }", "function nut(){\r\n \tplay = false\r\n clearInterval(gameloop)\r\n document.getElementById('barcum').style.width = '2000px'\r\n }", "function Update() {\n\t//Reduce fill amount over 30 seconds\n\tHunger.fillAmount -= .3f / waitTime * Time.deltaTime;\n\tSleep.fillAmount -= .2f / waitTime * Time.deltaTime;\n\t//Currency\n\tMonies.text = \"Cash: \" + PlayerPrefs.GetInt(\"Money\");\n\tSkillPoints.text = \"SP: \" + PlayerPrefs.GetInt(\"sp\");\n\tHome.text = \"House: \" + PlayerPrefs.GetString(\"House\");\n\tBed.text = \"Bed: \" + PlayerPrefs.GetString(\"Bed\");\n\tJob.text = \"Job: \" + PlayerPrefs.GetString(\"Job\");\n\t\n\ttime.text = \"Time: \" + timed + \" : \" + timeh + \" : \" + timem;\n\t\n\tif (Hunger.fillAmount == 0) {\n\t\tPlayerPrefs.SetString(\"Death\", \"true\");\n\t}\n\tif (Sleep.fillAmount == 0) {\n\t\tPlayerPrefs.SetString(\"Death\", \"true\");\n\t}\n\tif (PlayerPrefs.GetString(\"Death\") == \"true\") {\n\t\tNews2.text = News.text;\n\t\tNews.text = \"You died and all your stats have restarted\";\n\t\tDebug.Log(\"User Died\");\n\t\tPlayerPrefs.DeleteAll();\n\t\tHunger.fillAmount = 1;\n\t\tSleep.fillAmount = 1;\n\t}\n\t\n\t//Bars\n\tPlayerPrefs.SetFloat(\"HUNGER\", Hunger.fillAmount);\n\tPlayerPrefs.SetFloat(\"ENERGY\", Sleep.fillAmount);\n}", "endFuryCooldown() {\r\n this.state.furyCooldown = false;\r\n document.getElementById(\"toolbar1\").style.border = \"3px solid #161616\";\r\n }", "restoreAllHealth() {\n this.hitpoints = this.maxHitpoints;\n }", "function healthBarReset() {\r\n oldHealth = maxHealth;\r\n healthDif = 0;\r\n if (intervalVar !== undefined) {\r\n clearInterval(intervalVar);\r\n }\r\n}", "removeLife() {\n heartNodes[this.missed].src = 'images/lostHeart.png';\n this.missed += 1;\n if (this.missed === heartNodes.length) {\n this.gameOver(false);\n }\n }", "reset() {\n this.health = 100;\n this.energy = 100;\n }", "function hideCurrGame() {\n var currGameType = activeArray[enlarged].type;\n enlarged = \"\";\n $('main > .module').show(250);\n $(\"#mini\").fadeOut(250, function() {\n $(this).css(\"display\", \"none\");\n });\n $('#inGame').hide(250);\n $('#backbutton').fadeOut(250);\n $('#' + currGameType).css(\"display\", \"none\");\n $('#mini .gauge-fill').attr(\"class\", \"gauge-fill\");\n $('#mini .gauge-fill').height(0);\n $('#mini .module').data(\"pos\", 0);\n}", "function resetEverything() {\n //Store a new Snake object into the snake variable\n snake = new Snake(17, 17, 'A', 5, 30, 2);\n\n //store a new Bait onject into the bait variable and the specialBait variable\n bait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 10); //this is the normal bait\n specialBait = new Bait(floor(random(2, 32)), floor(random(2, 32)), 'A', borderLength, 30); //this is the special bait with a bigger radius value\n\n //Reset the special Bait if it was on screen when the player lost\n specialBaitgo = false;\n counterToSpecialBait = 0;\n\n //Set up the new snake\n snake.updateSnake();\n\n //Store the current snakeHighScore value back into its respective highscore category\n if (snakeProperties.clearSkyMode == true) {\n snake.highScore[0] = snakeHighScore;\n } else if (snakeProperties.clearSkyMode == false) {\n snake.highScore[1] = snakeHighScore;\n }\n}", "hpChange (hp){\n if(this.hptrack <= 5) {\n this.hptrack = Math.min(this.hptrack + hp, 5);\n }\n if(this.hptrack <= 0){\n this.gameOver = true;\n }\n console.log(this.hptrack);\n if(this.hptrack > 1.02){\n this.hpNum2.setActive(false).setVisible(true);\n }\n if(this.hptrack > 2.02){\n this.hpNum3.setActive(false).setVisible(true);\n }\n if(this.hptrack > 3.02){\n this.hpNum4.setActive(false).setVisible(true);\n }\n if(this.hptrack > 4.02){\n this.hpNum5.setActive(false).setVisible(true);\n }\n if(this.hptrack <= 1.02){\n this.hpNum2.setActive(false).setVisible(false);\n }\n if(this.hptrack <= 2.02){\n this.hpNum3.setActive(false).setVisible(false);\n }\n if(this.hptrack <= 3.02){\n this.hpNum4.setActive(false).setVisible(false);\n }\n if(this.hptrack <= 4.02){\n this.hpNum5.setActive(false).setVisible(false);\n }\n }", "changeDimension(){\n if( this.overlap ){\n this.overlap = false;\n // Changer le fond (changement de dimension)\n player.switchColor();\n\n this.scene.event.compareColor();\n\n // Desactiver la mort avec les bordures\n this.scene.space.desactive()\n \n player.body.velocity.y = player.body.velocity.y/1.5;\n \n setTimeout(() => {\n this.scene.cameras.main.fadeOut( 1000 );\n }, 3000);\n\n // Lancer la scene apres le fade out\n this.scene.cameras.main.on('camerafadeoutcomplete', ()=>{ \n\n // Variable pour initialiser le main menu\n gameState = 0;\n boutonReady = 1;\n onInitBouton = true;\n\n // Faire un fade in lorsque le fade out est fini\n ui.cameras.main.fadeIn( 1000 );\n\n // Lancer le main Menu\n this.scene.scene.stop( curLevel )\n if( indexLvl == 0){\n indexLvl = 1;\n }\n curLevel = dataBase.level[ indexLvl ];\n this.scene.scene.launch( curLevel )\n }, this);\n }\n }", "function unScareGhosts() {\r\n // It just changes the isScared to false again:\r\n ghosts.forEach(ghost => ghost.isScared = false)\r\n}", "function pillWareoff(ghost) {\n ghost.bias = 1\n gridSquare[ghost.ghostIndex].classList.remove('ghostDead')\n gridSquare[ghost.ghostIndex].classList.remove('ghostFlee')\n for( let i=0; i<16; i++) {\n clearInterval(caughtIdOne)\n clearInterval(caughtIdTwo)\n clearInterval(caughtIdThree)\n clearInterval(caughtIdFour)\n }\n }", "function setReset(set) {\r\n gameoverOn = 0;\r\n pause = 0;\r\n count = 0;\r\n countDog = 0;\r\n countDog2 = 0;\r\n countDog3 = 0;\r\n countDog4 = 0;\r\n difficulty = 1;\r\n pointsToReach = 10;\r\n temp = 10;\r\n level = 1;\r\n startGame = 0;\r\n resetGame = 0;\r\n points = 0;\r\n errors = 5;\r\n speed = 30;\r\n showedDucks = [];\r\n availableDucks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\r\n countElem = [];\r\n x_keyFramesDucks = [];\r\n y_keyFramesDucks = [];\r\n leftRemaining = leftRightDivider;\r\n rightRemaining = numDucks - leftRightDivider;\r\n if(set){\r\n audioon = 0;\r\n hit = Array(numDucks).fill(false);\r\n flying = Array(numDucks).fill(null);\r\n wingLeft = Array(numDucks).fill(null);\r\n wingRight = Array(numDucks).fill(null);\r\n leg = Array(numDucks).fill(null);\r\n birds = Array(numDucks).fill(null);\r\n clouds2 = Array(numClouds).fill(null);\r\n document.getElementById(\"boxMusic\").checked = false;\r\n document.getElementById(\"roundSlider\").style.display = \"\";\r\n }\r\n clearInterval(dog_exited);\r\n versoLeft = Array(numDucks).fill(1);\r\n versoRight = Array(numDucks).fill(0);\r\n incrementWingLeft = Array(numDucks).fill(0);\r\n incrementWingRight = Array(numDucks).fill(0);\r\n showedClouds = [0,1,2,3,4];\r\n}", "function CoolDown ()\n{\t\n\tswitch (Mode) {\n\t\t\tcase (gunTypes.auto):\n\t\t\t\tif (!Input.GetButton(\"Fire1\") && !reloading)\n\t\t\t\t{\n\t\t\t\t\t//coildown = true;\n\t\t\t\t\tyield WaitForSeconds (.05);\n\t\t\t\t\tshooting = false;\n\t\t\t\t\tcoildown = true;\n\t\t\t\t}\n\t\t\tcase (gunTypes.single):\n\t\t\t\t//coildown =true;\n\t\t\t\tyield WaitForSeconds (.1);\n\t\t\t\tcoildown = true;\n\t\t\t\tshooting = false;\n\t\t\t\t\tif (nextfire !=0){ \n\t\t\t\t\t\tyield WaitForSeconds (srate);\n\t\t\t\t\t\tnextfire = 0;\n\t\t\t\t\t}\n\t\t\tcase (gunTypes.burst):\n\t\t\t\t\n\t\t\t\tyield WaitForSeconds (.1);\n\t\t\t\tcoildown = true;\n\t\t\t\tshooting = false;\n\t\t\t\t\tif (nextfire !=0){ \n\t\t\t\t\t\tyield WaitForSeconds (srate);\n\t\t\t\t\t\tnextfire = 0;\n\t\t\t\t\t}\n\t}\n\tyield WaitForSeconds (.2);\n\tcoildown =false;\n}", "function C012_AfterClass_Jennifer_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "function tick() {\n if (!hero.killed) {\n if ( hero.x > getWidth()*.5 ) {\n stage.x = -hero.x + getWidth()*.5;\n }\n\n if ( hero.y +stage.y > getHeight() * .4 && stage.y > getHeight()-getVisibleHeight()) {\n stage.y = Math.round(Number(-hero.y + getHeight()*.4).limit(getHeight()-getVisibleHeight(), (-hero.y + getHeight()*.4)));\n } else if ( hero.y +stage.y <= getHeight() * .4) {\n stage.y = -hero.y + getHeight()*.4;\n }\n }\n hud.x = -stage.x;\n hud.y = -stage.y;\n\n sky.x = -stage.x;\n sky.y = -stage.y;\n\n houses.x = -stage.x * 0.7;\n houses.y = -stage.y * 0.7;\n\n lessFarHouses.x = -stage.x * 0.85;\n lessFarHouses.y = -stage.y * 0.85;\n\n clouds.x = -stage.x * 0.9;\n clouds.y = -stage.y * 0.9;\n\n nearHouses.x = -stage.x * 0.4;\n nearHouses.y = -stage.y * 0.5 - 150;\n\n hero.tick();\n stage.update();\n}", "function Awake()\n{\n\tinfluences.Reset();\n}", "function C007_LunchBreak_Natalie_Unblind() {\r\n CurrentTime = CurrentTime + 60000;\r\n ActorRemoveInventory(\"Blindfold\");\r\n PlayerAddInventory(\"Blindfold\", 1);\r\n C007_LunchBreak_Natalie_IsBlindfolded = false;\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function takeDamage (damage : int){\n\n\t//here we play the sound that it got hurt\n\taudio.PlayOneShot(hurtSound);\n\t//here we change the color of the bat to give a visual indication that it was hit\n\trenderer.material.color.r = 1;\n\trenderer.material.color.g = 0; \n\trenderer.material.color.b = 0; \n\t//we set the color counter to zero so we can track how long we have the color indication going for.\n\tcolorCounter = 0.0;\n\t//we subtract health to track how much it has so it can die\n\thealth -= damage;\n\t//if the health hits zero or is somehow less than zero, we want to get the death stuff going\n\tif(health <= 0){\n\t\t//here we choose a random number to determine what he will drop\n\t\tvar randNum:int = Random.Range(1,4);\n\t\t//if the number is 2 we'll do a heart\n\t\tif(randNum == 2){\n\t\t\tInstantiate(heart, transform.position, Quaternion.Euler(-90,180,0));\n\t\t//if its any other number besides 2, we'll drop a gem instead\n\t\t}else{\n\t\t\tInstantiate(gem, transform.position, Quaternion.Euler(-90,180,0));\n\t\t}\n\t//before we destroy the bat we want to spawn the explosion animation so it looks pretty.\n\tInstantiate(explosion, transform.position, Quaternion.Euler(-90,180,0));\n\t//here we delete the bat. you won!\n\tDestroy(gameObject);\n}\n\n//if the bat got hurt, we set the velocity to zero before we choose which direction it will go\nrigidbody.velocity = Vector3(0,0,0);\n\n}", "function setAttack() {\n $(\"#fight-outcome\").empty();\n\n arenaObj.enemy.health -= arenaObj.ally.attack;\n arenaObj.enemy.stats();\n\n killCharacter();\n\n $(\"#fight-outcome\").empty();\n\n arenaObj.ally.health -= arenaObj.enemy.counter;\n arenaObj.ally.stats();\n\n killCharacter();\n\n console.log(\"Your enemy HP is \" + arenaObj.enemy.health \n + \" and your HP is \" + arenaObj.ally.health);\n}", "powerUpBlockBreaker() {\r\n if (this.powerUps.isActive(BlockBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n this.ball.destroyBlock(this.blocks);\r\n }\r\n }", "function raise(){\n clearTimeout(shield.coolDown);\n shield.dropped = false;\n}", "function unScareGhosts() {\n\tghosts.forEach((ghost) => (ghost.isScared = false))\n}", "function hud() {\n let missileCount = 5 - playerMissile.pCooldown;\n\n CONTEXT.fillStyle = \"yellow\";\n CONTEXT.font = \"20px Arial\";\n CONTEXT.textAlign = \"left\";\n CONTEXT.fillText(\"LEVEL \\\\\\\\ \" + level, 10, 20);\n CONTEXT.textAlign = \"center\";\n CONTEXT.fillText(\"LIVES \\\\\\\\ \" + playerLives, C_WIDTH / 2, 20);\n CONTEXT.textAlign = \"left\";\n CONTEXT.fillText(\"MISSLES \\\\\\\\ \" + missileCount, C_WIDTH - 130, 20);\n}", "hold() {\n if (!this.heldThisRound && !this.pc.isSmashing) {\n this.spawnTetri();\n\n if (this.heldTetris === \"\") {\n this.heldTetris = this.tetrimino;\n this.tetrimino = this.newTetri();\n } else {\n // Switch between held tetris and the current tetris\n let temp = this.tetrimino;\n this.tetrimino = this.heldTetris;\n this.heldTetris = temp;\n }\n this.heldThisRound = true;\n }\n }", "function brewBeer() {\n if (gameData.grain >= 1) {\n gameData.beer += gameData.beerPerClick\n gameData.grain = (gameData.grain - 1)\n showGameData();\n }\n}", "function initialize() {\n Manager.Stack.loadingDelay = 0;\n Manager.Stack.clearHUD();\n}", "function unScareGhosts() {\r\n ghosts.forEach(ghost => ghost.isScared = false)\r\n }", "function C012_AfterClass_Bed_Load() {\n\tLeaveIcon = \"Leave\";\n\tLeaveScreen = \"Dorm\";\n\tLoadInteractions();\n\tC012_AfterClass_Bed_CurrentStage = 0;\n\tC012_AfterClass_Bed_PleasureUp = 0;\n\tC012_AfterClass_Bed_PleasureDown = 0;\n\tif (PlayerHasLockedInventory(\"VibratingEgg\")) C012_AfterClass_Bed_MasturbationRequired = 2;\n\telse C012_AfterClass_Bed_MasturbationRequired = 3;\n}", "function kill() {\n var pl = $('#pacman').position().left;\n var pt = $('#pacman').position().top;\n\n var gl = $('#ghost').position().left;\n var gt = $('#ghost').position().top;\n\n var gl2 = $('#ghost2').position().left;\n var gt2 = $('#ghost2').position().top;\n\n var gl3 = $('#ghost3').position().left;\n var gt3 = $('#ghost3').position().top;\n\n\n var gl4 = $('#ghost4').position().left;\n var gt4 = $('#ghost4').position().top;\n\n\n if ((pl == gl)&&(pt==gt)) {\n $('#pacman').addClass('hidden');\n lives -=1;\n $('#lives').html(lives);\n } else if\n ((pl == gl2)&&(pt==gt2)) {\n $('#pacman').addClass('hidden');\n lives -=1;\n $('#lives').html(lives);\n } else if\n ((pl == gl3)&&(pt==gt3)) {\n $('#pacman').addClass('hidden');\n lives -=1;\n $('#lives').html(lives);\n } else if\n ((pl == gl4)&&(pt==gt4)) {\n $('#pacman').addClass('hidden');\n lives -=1;\n $('#lives').html(lives);\n }\n\n }", "function clean() {\n setPet({ ...pet, boredom: Math.min(100, pet.boredom + 5), hygiene: Math.min(100, pet.hygiene + 40), action: 'clean' })\n // change the number based on the number of miliseconds the animation takes\n setTimeout(() => setPet({...pet, action: undefined}), 5000)\n if (!game.mute){\n cleanSound.play()\n }\n }", "beber_cerveza(power_up){\n power_up.scene.alcohol.aumentar_ebriedad(15);\n power_up.destroy();\n }", "function homepageUnwaste() {\n getActivity();\n activityInfoAnimation();\n setTimeout(gifContainerAnimation, 300);\n toggleHide();\n toggleShow();\n alterUnwasteBtnAction();\n}", "function bosslevel() {\n myy.stop(); ///stop the mission failed music\n hakeem.play();\n\n level = 0;\n lives = 1;\n shapeNum = 100;\n invisibility = 20; //stay alive for 5 seconds, life is never fair\n shapeSpeed = 400;\n score = 0;\n ship = newShip();\n\n // get the high score from local storage\n var scoreStr = localStorage.getItem(SAVE_KEY_SCORE);\n if (scoreStr == null) {\n scoreHigh = 0;\n } else {\n scoreHigh = parseInt(scoreStr);\n }\n\n newLevel();\n }", "function healthBarReset() {\n oldHealth = maxHealth;\n healthDif = 0;\n if (intervalVar !== undefined) {\n clearInterval(intervalVar);\n }\n}", "function decrease() {\r\n if (answer() === 1) {\r\n hunger--;\r\n } else if (answer() === 2) {\r\n health--;\r\n } else if (answer() === 3) {\r\n happiness--;\r\n }\r\n }", "function gameplayHUD() {\n\n\t// send background animations to back layer, send HUD elements to front layer\n\tgame.world.sendToBack(game.bgGroup);\n\tgame.world.sendToBack(game.bgFlashGroup);\n\tgame.world.sendToBack(game.bgFill);\n\tgame.world.bringToTop(game.HUDgroup);\n\n\t// debug controls\n\tif (game.debugControls) {\n\t\tif (game.input.keyboard.justPressed(Phaser.Keyboard.D)) {\n\t\t\tgame.currentHearts++;\n\t\t}\n\t\tif (game.input.keyboard.justPressed(Phaser.Keyboard.A)) {\n\t\t\tgame.currentHearts--;\n\t\t}\n\n\t}\n\n\t// set scakeDest for LEVEL text\n\tif (game.hasStarted) {\n\t\tif (game.speedupTextScaleDown) {\n\t\t\tgame.speedupTextScaleDest = 0;\n\t\t\tif (Math.abs(game.speedupTextScale - game.speedupTextScaleDest) < 0.2) {\n\t\t\t\t// update level text\n\t\t\t\tgame.speedupText.text = 'LEVEL ' + game.level + ' ';\n\t\t\t\tgame.speedupText2.text = game.speedupText.text;\n\t\t\t\tgame.speedupTextScaleDown = false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgame.speedupTextScaleDest = 1;\n\t\t}\n\t}\n\telse {\n\t\t// update level text\n\t\tgame.speedupText.text = 'LEVEL ' + game.level + ' ';\n\t\tgame.speedupText2.text = game.speedupText.text;\n\t\tgame.speedupTextScaleDest = 0;\n\t}\n\n\t// set scaleDest for LEVEL text\n\tgame.speedupTextScale = approachSmooth(game.speedupTextScale, game.speedupTextScaleDest, 6);\n\tgame.speedupText.scale.setTo(game.speedupTextScale);\n\tgame.speedupText2.scale.setTo(game.speedupTextScale);\n\n\tupdateScoreText();\n\n\t// update score text and position for score multiplier's drop shadow\n\tfor (var i = 0; i < game.multiTextArrLength; i++) {\n\t\tgame.multiTextArr[i].x = game.multiPos + 80 - i;\n\t\tgame.multiTextArr[i].y = 65 - i;\n\t\tgame.multiTextArr[i].text = \"x \" + game.heartMulti + ' ';\n\t}\n\t\n\n\t// update stars text\n\tgame.starCountMenuText.text = game.starsColl + ' ';\n\n\tgame.currentHearts = Phaser.Math.clamp(game.currentHearts, 0, game.maxHearts);\n\n\n\t// update hearts HUD\n\tfor (var i = 0; i < game.maxHearts; i++) {\n\n\t\tif (game.heartSprite[i] != -1) {\n\t\t\tgame.heartSprite[i].destroy();\n\t\t\tgame.heartSprite[i] = -1;\n\t\t}\n\n\t\tif (game.currentHearts > i) {\n\t\t\tvar currentHeartX = 24 + (i * 58);\n\t\t\tvar currentHeartY = 30;\n\t\t\tgame.heartSprite[i] = game.add.sprite(currentHeartX, currentHeartY, 'heartHUD');\n\t\t\tgame.heartSprite[i].anchor.setTo(0.5);\n\t\t\tgame.heartSprite[i].scale.setTo(0.5);\n\t\t}\n\t}\n\n\t// allow player to cheat stars to unlock modes using CTRL+ALT+Q\n\t// (this is for grading purposes, if the grader does not want to unlock stars manually)\n\tif (game.input.keyboard.isDown(Phaser.Keyboard.CONTROL)\n\t&& game.input.keyboard.isDown(Phaser.Keyboard.ALT)\n\t&& game.input.keyboard.justPressed(Phaser.Keyboard.Q)) {\n\t\tgame.starsColl++;\n\t\tsaveStarsColl();\n\t}\n}", "function nom () {\n this.playerDeathSound.play();\n player.disableBody(true, true);\n playerState = 0;\n cultistBlinkNotReady.setVisible(false);\n cultistBlinkReady.setVisible(false);\n cultistDead.setVisible(true);\n }", "function reset() {\n currentMonsterHealth = chosenMaxLife;\n currentPlayerHealth = chosenMaxLife;\n resetGame(chosenMaxLife);\n}", "function startGame() {\n gridFix()\n blinks = \"0\";\n totalTider = [];\n updateView();\n blinkID = setInterval(randomOn, 2000); \n}", "minus1Life() {\n console.log(\"entered\")\n if (this.lifesGroup.getTotalUsed() == 0) {\n console.log(\"game over\")\n this.scene.scene.stop();\n this.scene.music.stop();\n console.log(this.scene.pontos)\n this.scene.scene.start(\"GameOver\",{points: this.scene.pontos})\n\n } else {\n console.log(\" a tirar vida\")\n let heartzito = this.lifesGroup.getFirstAlive();\n heartzito.active = false;\n heartzito.visible = false;\n //heartzito.killAndHide()\n console.log(this.lifesGroup.getTotalUsed())\n }\n\n }", "function resetRod(){\n //stops timed loops that reel in the line/fish\n stopTimedLoop(reelCaughtFish);\n stopTimedLoop(reelHook);\n hideElement(\"castFishingRod\");\n showElement(\"homeScreenRod\");\n //Checks that the hook and line already exist before deleting them\n if(isCast == true){\n deleteElement(\"hook\");\n deleteElement(\"line\"); \n }\n //resets conditions surrounding the fishing rod\n isCast=false;\n isReeling=false;\n isCaught = false;\n typeCaught = null;\n tension = false;\n lineCondition = \"intact\";\n}", "function changeDisplay() {\n if (deadEnemies >= numberOfEnemies){\n deadEnemies = 0;\n level ++;\n numberOfEnemies = level * 2;\n spawnTime -= 100;\n movementDelay -= 50;\n }\n}", "function init() {\r\n _lives = 5;\r\n _weapons = 10;\r\n }", "function gameOver() {\n playerAlive = false; \n\n //Reset health and the health bar.\n currentHealth = maxHealth;\n healthBarReset();\n\n //Clear skeleton interval if applicable. \n if (skeleInterval !== undefined) {\n clearInterval(skeleInterval);\n }\n\n //Kill all enemeis on the level to prevent bugs when resetting. \n for (i = 0; i < enemyCount; i++){\n enemies[i].alive = false; \n }\n\n //Reset inventory to a prior state (stored in resetInventory)\n for (j = 0; j < inventory.length; j++) {\n inventory[j] = (resetInventory[j]);\n }\n\n if (currentLevelID === 'colchisFields' && userIntThis.ritualItemText.alpha > 0) {\n userIntThis.ritualItemText.alpha = 0;\n } else if (userIntThis.ritualItemText.alpha > 0){\n userIntThis.updateRitualItemText();\n }\n\n //Restart the level. \n createThis.scene.restart(currentLevelID);\n}", "_resetBlocks(){\n if(MainGameScene.isInputActive) {\n this.physicsSpawner.removeAllSpawnables();\n }\n }", "fire(){\n\t\tif(this.heat<this.heatMax && this.hot ===false){\n\t\t\tif(keyIsDown(32)){\n\t\t\t\tthis.bullets.push(new CanonSquare(canon.loc));\n\n\t\t\t\tthis.bullets[this.bullets.length-1].applyForce(canon.fire(this.bullets[this.bullets.length-1]));\n\t\t\t\tthis.heat += 3;\n\t\t\t}\n\t\t}else if(this.heat>= this.heatMax){\n\t\t\tthis.tooHot();\n\t\t}\n\t}", "function reset(){\n roy.health = roy.maxHealth;\n incineroar.health = incineroar.maxHealth;\n ridley.health = ridley.maxHealth;\n cloud.health = cloud.maxHealth;\n cloud.limit = 0;\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\"#pc-health\").html();\n $(\"#pc-attack\").html();\n $(\".fight-cpu\").hide();\n $(\".fight-pc\").hide();\n slotOneFull = false;\n slotTwoFull = false;\n playerKOs = 0;\n playerChar = \"\";\n computerChar = \"\";\n roy.inUse = false;\n roy.fight = true;\n ridley.inUse = false;\n ridley.fight = true;\n cloud.inUse = false;\n cloud.fight = true;\n incineroar.inUse = false;\n incineroar.fight = true;\n $(\".ridley-small\").removeClass('grayScale')\n $(\".cloud-small\").removeClass('grayScale')\n $(\".roy-small\").removeClass('grayScale')\n $(\".incineroar-small\").removeClass('grayScale')\n\n}", "powerUpBrickBreaker() {\r\n if (this.powerUps.isActive(BrickBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n\r\n this.ball.behaviors(this.bricks, this.blocks);\r\n }\r\n }", "killWeak() {\n\t\tthis.chromosomes = this.chromosomes.slice(0, this.population);\n\t}", "function victory() {\r\n var gameOverCanvas = document.getElementById(\"gameOver\");\r\n var gameOverDisplay = \"You won the Game! Your Score is: \"+score;\r\n gameOverCanvas.innerHTML = gameOverDisplay;\r\n numberOfMissiles = 50;\r\n scene.remove(building);\r\n scene.remove(building1);\r\n scene.remove(building2);\r\n scene.remove(building3);\r\n scene.remove(building4);\r\n scene.remove(building5);\r\n scene.remove(launcher);\r\n\r\n}", "loseHealth() {\n this.DB = store.get(GameConstants.DB.DBNAME);\n //delete extra lifes if exists\n if (this.health>5){ \n let currentExtraLifes = parseInt(this.DB.extralifes);\n if (this.DB.extralifes>0){\n this.DB.extralifes = currentExtraLifes - 1; \n store.set(GameConstants.DB.DBNAME, this.DB);\n }\n }\n this.health--;\n this.scene.textHealth.setText(this.scene.TG.tr('COMMONTEXT.LIVES') + this.health);\n if (this.health === 0) {\n //Turn alarm music off\n this.alarmON = false;\n this.healthAlarm.stop(); \n //gameOver\n this.scene.gameOverText('gameOver');\n this.gameOver = true;\n this.emit(GameConstants.Events.GAME_OVER);\n }else if (this.health == 1){\n //Turn alarm music on\n this.alarmON = true;\n if (this.DB.SFX) {\n this.healthAlarm.play();\n }\n }else{\n this.alarmON = false;\n this.healthAlarm.stop(); \n }\n\n }", "function unHideComponents(){\r\n tank.style.visibility = \"visible\";\r\n missile.style.visibility = \"visible\";\r\n score.style.visibility = \"visible\";\r\n}", "function batt1(){\n\t\t\troot.line_cover_4.visible = false;\n\t\t\troot.line_cover_5.visible = false;\n\t\t\troot.dot_path4.visible = false;\n\t\t\troot.dot_path5.visible = false;\n\t\t\troot.batt_1.visible = true;\n\t\t}", "function playerHardDrop() {\n harddrop.play();\n while(!collide(arena, player)) {\n player.pos.y++;\n }\n player.pos.y--;\n merge(arena, player);\n playerReset();\n arenaSweep();\n updateScore();\n canhold = true;\n dropCounter = 0;\n}", "function medkitHit(ship, medkit){\r\n\tlives = lives + 1;\r\n\tmedkit.remove();\r\n}", "function cleanPoo(){\n pooSize = 1;\n foodSize = 1;\n}", "function levelUp(){\n let levelWon = false;\n let totalBricks = brick.rows * brick.columns;\n for (r=0; r<brick.rows; r++){\n for (c=0; c<brick.columns; c++){\n\n // let b1=bricks[0][c];\n // let b2=bricks[1][c];\n // let b3=bricks[2][c];\n let b=bricks[r][c];\n if (!b.unbroken) {\n totalBricks = totalBricks -1;\n }\n }\n }\n if (totalBricks === 0) {\n if (gameState=='playL1'||gameState=='playL2'||gameState=='playL3'||gameState=='playL4'){\n soundLevel1.pause();\n soundLevel2.pause();\n soundLevel3.pause();\n soundLevel4.pause();\n }\n levelWon = true;\n }\n //console.log(totalBricks);\n //levelWon=levelWon&&!b.unbroken; //THAT'S WHERE THE PROBLEM HAPPENS! if you try levelWon = !b.unbroken (\"seems\" logical..), PLAY AND LOOK what happens!!!\n\n if (levelWon&&gameState=='playL1'){\n soundLevelWon.play();\n setGameState('level2');\n displayLevel();\n createBricks();\n }\n if (levelWon&&gameState=='playL2'){\n soundLevelWon.play();\n setGameState('level3');\n displayLevel();\n createBricks();\n }\n if (levelWon&&gameState=='playL3'){\n soundLevelWon.play();\n setGameState('level4');\n displayLevel();\n createBricks();\n }\n if (levelWon&&gameState=='playL4'){\n soundLevelWon.play();\n setGameState('ending');\n soundEnding.play();\n displayLevel();\n }\n }", "function Start () {\n\n\tnukeUsed = false;\n\tisLightArmor = true;\n\t\n\tif(GameObject.Find(\"LevelEight\")){\n\tisLevel8 = true;\n\t}\n\telse{\n\tisLevel8 = false;\n\t}\n\t\n\t\n\n}", "cocktailHour() {\n this.cocktails.splice(this.index, 1);\n this.drinks += 1;\n if (this.drinks === 3) {\n this.secondsToSober = 5;\n this.drunk = true;\n drunkDrums.setVolume(0.6);\n drunkDrums.loop();\n setTimeout(() => {\n drunkDrums.stop();\n this.drunk = false;\n this.drinks = 0;\n }, 5000);\n }\n }", "function KinkyDungeonShrineInit() {\n\tKinkyDungeonShrineCosts = {};\n\tKinkyDungeonPoolUsesGrace = 2;\n\n\tKinkyDungeonInitReputation();\n\n}", "function fullLineRemoveRoutine() {\n drawPlayArea();\n if (animateFullLines() === true) {\n hideFullLines(playerLevelEnvironment.fullLines);\n\n // check if any block can fall down\n const isThereABlockThatCanBeMoved = checkIfAnyBlockCanFallDown();\n if (isThereABlockThatCanBeMoved === true) {\n playerLevelEnvironment.playAreaMode = 'gravityAnimation';\n } else {\n playerLevelEnvironment.playAreaMode = 'blockFallingAnimation';\n }\n }\n }", "update(){\n\t\tif(this.tick){\n\t\t\tthis.depleteBar(.00005);\n\t\t}\n\t}", "function unScareGhosts() {\n ghosts.forEach(ghost => ghost.isScared = false)\n}", "function unScareGhosts() {\n ghosts.forEach(ghost => ghost.isScared = false)\n}" ]
[ "0.6264154", "0.6066547", "0.5992308", "0.5913272", "0.5897634", "0.5886988", "0.5807684", "0.5765865", "0.5705917", "0.56791675", "0.5676864", "0.5664624", "0.56344634", "0.5626992", "0.56182355", "0.5616587", "0.5611646", "0.558643", "0.5585921", "0.5577688", "0.5549681", "0.5542499", "0.55358315", "0.5534589", "0.5527052", "0.55222034", "0.5521243", "0.5520606", "0.5517942", "0.5517441", "0.5511405", "0.5505037", "0.55049443", "0.5494494", "0.5492088", "0.5491361", "0.54907787", "0.54888636", "0.54866666", "0.5484505", "0.54843444", "0.546629", "0.54614824", "0.54589087", "0.5455865", "0.5449997", "0.5449729", "0.5447843", "0.54476976", "0.5446045", "0.5444404", "0.5438022", "0.5433148", "0.5430944", "0.54163015", "0.5401433", "0.5400359", "0.539848", "0.53974843", "0.5391849", "0.5384956", "0.5383871", "0.5380321", "0.53800213", "0.53775734", "0.5371615", "0.53715503", "0.53701335", "0.53675187", "0.53659624", "0.53657126", "0.5364862", "0.53629726", "0.5358846", "0.5357273", "0.5355493", "0.5354405", "0.5354293", "0.53513056", "0.5349461", "0.5348772", "0.5348123", "0.53466326", "0.5344232", "0.5343492", "0.5340336", "0.5334405", "0.5332445", "0.53318554", "0.53268176", "0.5324985", "0.53204274", "0.5318428", "0.53120834", "0.53105336", "0.53031796", "0.52998596", "0.52941865", "0.5293863", "0.5293863" ]
0.57011956
9
The story variable determines where the text will appear. In this case, that is the "story" div. The "btn" variables define the buttons in the game. For the majority of the storyline, only "btn1" and "btn2" are used. "btn3" and "btn4" are used for the enddefining choice.
function displayStory(choice) { var story = ""; var btn1 = ""; var btn2 = ""; var btn3 = ""; var btn4 = ""; switch(choice) { //The case "beginning" is used at the end of the game, when the player fails and must return to the start. (or when the GAME OVER alert comes up.) //Bread or Sword - This choice is arguably one of the most important in the game. It starts you off and affects your fate early in the game. case "beginning": case "bread/sword": story = "You wake up in a dark, dreary cave. You have no memory of your previous life, and the only thing in your mind is the echo of water dripping from the ceiling. You grab a backpack that sits in front of you on the cave floor. You have a pocket knife, some rope, dried fruit that won't last long, a water bottle half-full, and a jagged rock. You see two things in the cave: A sword and a package of bread. Which do you take? Only one will fit in your backpack."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('bread')"); btn1.innerHTML = ("Continue your journey..."); break; //This is the very first goal of the game. It informs the player what their current task is. alert("GOAL 001: Escape_cave"); //This is the very first checkpoint of the game. Its purpose is to return the player back to a certain point in the game when they die. This keeps them entertained, and they will not return to the beginning every time they die. case "Checkpoint1": //Whether the player chooses bread or sword, they will progress to the same choices. However, whether they chose to keep the bread or the sword will affect their fate later on. case "bread": case "sword": health = 5; displayHearts(); story = "You notice a long hallway leading out of the cave. When you reach the end of the hallway, you are met with two doors. One is bright green and earthy, surrounded by vines. A cool breeze wafts from the crack beneath it. The other is black as coal, and is strangled with dried, withering tree branches. Intense heat flames from it. Which door will you choose?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('door1')"); btn1.innerHTML = "Door 1"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('door2')"); btn2.innerHTML = "Door 2"; if(bread === true) { document.getElementById("bread3").hidden = false; document.getElementById("bread4").hidden = false; document.getElementById("bread5").hidden = false; } else { document.getElementById("sword1").hidden = false; } //image = ""; break; //door 1 - the first door, and whether the user chose bread or sword will affect which choices come up and how the NPCs (non-player characters) react to them. //The if statement determines which choices the player is given. Certain choices WILL lead to death. case "door1": if (bread) { story = "You turn the mahogany handle of the door. You emerge on a hill surrounded by rolling fields. Down the hill, peasants drenched in sweat and dressed in faded rags labor away, picking some kind of pale blue cotton. Cruel-faced supervisors pace behind them, watching their work and carrying sharp-looking batons. You walk down the hill, hoping that your own tattered clothes will blend in with theirs. You come to an area where no supervisors seem to be watching. You chose the BREAD. The people have hunger-hollowed cheeks, so you give them some of your bread. They immediately trust you, and allow you to work beside them and hide yourself. The few people near you now trust you, and they decide to help conceal you. The supervisor arrives to monitor your laboring progress and begins taunting those beside you. Will you stand up to the supervisor or make friends with him?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('makeFriends')"); btn1.innerHTML = "Make friends"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('standUpToSupervisor')"); btn2.innerHTML = "Stand up to the supervisor"; //image = ""; } if(sword) { story = "You turn the mahogany handle of the door. You emerge on a hill surrounded by rolling fields. Down the hill, peasants drenched in sweat and dressed in faded rags labor away, picking some kind of pale blue cotton. Cruel-faced supervisors pace behind them, watching their work and carrying sharp-looking batons. You walk down the hill, hoping that your own tattered clothes will blend in with theirs. You come to an area where no supervisors seem to be watching. You chose the SWORD. The people are alarmed by the glinting blade hidden under your shirt. You assure them that you will do nothing but protect them. The few people near you now trust you, and they decide to help conceal you. The supervisor arrives to monitor your laboring progress and begins taunting those beside you. Will you stand up to the supervisor or keep your head down and continue working?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepHeadDown')"); btn1.innerHTML = "Keep Head Down"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('standUp')"); btn2.innerHTML = "Stand up to the supervisor"; //image = ""; } break; //(bread) stand up/make friends - This is a minor choice, meaning it will either lead to death or the continue button. case "makeFriends": story = "You crack a funny joke at the supervisor. He looks at you blankly for a moment, but then his dark bearded face stretches into a smile. He pats your back and tells you that he will help you, sending you to a building in the distance. You find a knife on the ground and carefully pick it up."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: Clever move. Keep making friends like this and you'll escape soon enough."); document.getElementById("pocketknife").hidden = false; break; //ACHIEVEMENT: BUILDING //This is the first "death oppurtunity" in the game. It is also the reason why we placed checkpoints throughout the code. If the player chooses to stand up to the supervisor, they will die and be given the option to return to the last checkpoint. case "standUpToSupervisor": story = "The taunts that the supervisor shoots at the laborers anger you. You stand up and he narrows his eyes at you. For a brief moment, you glare at each other. Suddenly, all you can see is the glint of his sword in the sunlight and then....darkness. sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; //RETURN TO CHECKPOINT// //(sword) standUp/keep head down - another minor choice. case "keepHeadDown": story = "Though you stay well hidden among the group of laborers, you notice the supervisor is eyeing you strangely. You realize that he sees the sword hidden in your belt. You look back at him, hoping he will do nothing. Suddenly, he nocks an arrow in the bow on his back. Before you can react, he has released the bowstring. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; //RETURN TO CHECKPOINT case "standUp": story = "The taunts that the supervisor shoots at the laborers anger you. You stand up and he narrows his eyes at you. The supervisor flings his knife at you in anger. Quickly thinking, you dart to the side and catch it. You run to a building in the distance, and foolishly promise to come back for the other workers."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: Your reflexes will save you. But don't make promises you can't keep!"); document.getElementById("pocketknife").hidden = false; break; //Door 2 - the second door, and whether the user chose bread or sword will affect which choices come up and how the NPCs (non-player characters) react to them. case "door2": //door 2 (bread) if( bread ) { story ="You use the end of your shirt to turn the knob, as it is too hot. You enter a dark forest of fire-blackened trees. The sky is so full of smog that it has a grayish tinge and it is impossible to tell whether it is day or night. The only light in the vicinity comes from the dim glow of flames licking at the trees. The faint howling of wolves can be heard in the distance, miles away. After a moment you realize the howls are getting louder and louder. Suddenly, a gray blur leaps out of the shadowy trees. Several more gray blurs follow it. You try to feed the bread to the wolves but your are in vain. The wolves lunge and pin you to the ground. The last thing you hear before the darkness consumes you is their howls. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; } //door 2 (sword) else if (sword) { story ="You use the end of your shirt to turn the knob, as it is too hot. You enter a dark forest of fire-blackened trees. The sky is so full of smog that it has a grayish tinge and it is impossible to tell whether it is day or night. The only light in the vicinity comes from the dim glow of flames licking at the trees. The faint howling of wolves can be heard in the distance, miles away. After a moment you realize the howls are getting louder and louder. Suddenly, a gray blur leaps out of the shadowy trees. Several more gray blurs follow it."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runForDoor/climbTree')"); btn1.innerHTML = "Face the wolves"; } break; case "runForDoor/climbTree": story = "Since you chose the SWORD, you are able to fend off the wolves. However, there are too many of them. You desperately sprint off into the trees and see two options. You can either run for a rusty door covered in ivy, or climb a tree. You grab a rusty knife off the forest floor for additional protection."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('climbTree')"); btn1.innerHTML = "Climb the tree"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('runForDoor')"); btn2.innerHTML = "Run for the door"; document.getElementById("pocketknife").hidden = true; break; case "climbTree": story = "You attempt to scramble up the tree, and feel the wolves' hot breath on your heels. You grab at a branch, but it breaks in your hand. You fall to the ground and are winded as your back crashes into the leaves. The wolves growl and pounce at you. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint1')"); btn1.innerHTML = "Try again from the last CHECKPOINT"; break; case "runForDoor": story = "You sprint towards the door as fast as your feet can go and manage to lever the door open with your sword. You quickly close the door behind you and barely escape the razor sharp teeth of the wild-eyed wolves. You are now in a dark, empty-halled building."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue')"); btn1.innerHTML = "Continue..."; alert("ACHIEVEMENT 001: You're fast... but are you smart enough to make it out alive?"); break; alert("ACHIEVEMENT 002: So close, yet so far! You made it to the building!"); //All of the choices branch back to the building to make coding easier. Now, the player's destination is whatever lies beyond the building. //The next defining choice determines who the player's companion will be. This choice will greatly affect the next storyline and the user's fate. alert("GOAL 002: Escape_building"); case "Checkpoint2": case "continue": hunger = 5; displayBreads(); story = "As you sneak through the building, wondering if it is inhabited, you hear a chorus of thousands of footsteps. You begin to run, and come to a supply room with an opened door. You go inside and there is an exit on either side of you. A figure runs in from each side. One is a violet-eyed girl with a long sheet of dark hair. The other is a confident-looking, brown-haired youth. Both yell for you to come with them if you want to live. Who will be your companion? Choose wisely."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Alec')"); btn1.innerHTML = "The brown haired warrior"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('Violet')"); btn2.innerHTML = "The violet eyed girl"; break; alert("GOAL 003: Cooperate_to_Escape"); //The next checkpoint. Its purpose is to return the player back to the beginning of the Alec branch, so that they do not have to make the companion choice again. case "Checkpoint3": case "Alec": health = 5; displayHearts(); story="You run towards the brown haired boy, happy to be heading away from the increasingly loud footsteps. He introduces himself as Alec, and drags you to a door that you never would have noticed if you were on your own. it was a wise decision to choose him. As you slide through the door, you realize that the footsteps have become quieter. Alec stumbles over a pipe. As you help him up, you hear a large crash nearby. Do you choose to run after Alec, or do you you knock him out and leave him behind for whatever caused the sound?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runTogether')"); btn1.innerHTML = "Run after Alec"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('knockHimOut')"); btn2.innerHTML = "Knock Alec out"; break; case "knockHimOut": story="You slyly grab a broken piece of pipe from the ground and forcefully strike Alec in a swift blow to the head. He crumples to the ground and you make a dash for the closest out of the three doors in the room. As you turn to see if you are being followed, you trip backwards and realize you are falling through the air. Suddenly you hit something hot and the burning liquid you land in sears your skin before engulfing you. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint3')"); btn1.innerHTML = "Try again from the last checkpoint"; break; case "runTogether": story="You follow Alec through a maze of doorways and thank him when he grabs your arm to stop you from falling into a vat of boiling oil. You run for what seems like hours, and finally slow to a walk. It seems as though there is no way to escape the building. You hear a low, raspy voice say 'The Silver Arrow is near. Once it is found, we will at last have a purpose.' It is a man wearing a black hood speaking to another short man with scars covering his bald head. He appears to have a weapon. Do you stay to fight him, or do you hide?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('fightHood')"); btn1.innerHTML = "Fight"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('hideFromHood')"); btn2.innerHTML = "Hide"; break; case "fightHood": story="You and Alec circle around the figure. Suddenly, you feel an invisible force pressing on your neck. In a few minutes, your vision fades to black. Sorry, you're DEAD!"; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint3')"); btn1.innerHTML = "Try again from the last checkpoint"; break; //A new checkpoint makes sure that you won't be pulled all the way back to the beginning of the Alec storyline. case "Checkpoint4": health = 5; displayHearts(); hunger = 3; displayBreads(); case "hideFromHood": story = "You dive behind a thick pipe, and Alec follows quickly. The figure begins to whisper excitedly about someting and you feel compelled to stay hidden and listen in on the conversation. You learn about a mysterious phenomenon called the Silver Arrow and when the figures retreaat into the darkness, you question Alec about this discovery."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('threatenAlec')"); btn1.innerHTML = "Threaten Alec"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('convinceAlec')"); btn2.innerHTML = "Convince Alec"; break; case "threatenAlec": story = "You grab a knife from your belt and raise it threateningly. You demand that he explain about the silver arrow, but he sighs and relents."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; // ACHIEVEMENT KNOWLEDGE ACQUIRED break; case "convinceAlec": story = "You compel Alec to tell you about the Silver Arrow by bringing out your persuasive skills. You say, 'I deserve to know what's going on.' He stares at you for a while and then gives in."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; break; case "Violet": story = "The brown-haired boy flees from the room as the sound of footsteps gets louder. The girl cocks her head at you and says, 'Nice choice. I'm Violet.' She motions for you to follow her and goes into a room off to the side. As you hear low, raspy voices, Violet pushes you to the ground, knocking the wind out of you. She flattens you against the cool floor. Do you stay still and trust her or fight back in fear that you chose the wrong companion? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('stayStill')"); btn1.innerHTML = "Stay still"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('fightBack')"); btn2.innerHTML = "Fight Back"; break; case "fightBack": story = "You struggle, kicking and screaming. You pull yourself away and run out into the hallway. There, a squadron of soldiers awaits you. Sorry, you're DEAD."; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint2')"); btn1.innerHTML = "Try again from the last checkpoint"; break; case "stayStill": story = "You keep yourself still and try not to breathe. Violet is deadly silent, her eyes squeezed tightly shut. Once the thunderous footsteps and voices fade, Violet sighs. 'Thanks for trusting me. You would've died otherwise.'"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('setUpCamp')"); btn1.innerHTML = "Set up camp"; break; case "setUpCamp": hunger = 3; displayBreads(); story = "You and Violet follow a maze of hallways before stopping at a small corner isolated from the rest of the building. She opens her backpack and shares some of her supplies with you. Suddenly, you hear the sound of footsteps drawing near. Violet wraps her hand against your mouth to muffle your surprise. The footsteps stop closeby and the voices seem to be whispering about a mysterious object called the silver arrow. 'It is almost time. The silver arrow is near and once we have aqquired it, we will have a purpose at last.' The footsteps recede and you look at Violet questioningly. She sighs, looks at the ground. "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint5')"); btn1.innerHTML = "Acquire Information"; break; case "Checkpoint5": health = 5; displayHearts(); story = "'It's time I told you what I know'. What do you want to know first?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('howDidIGetHere')"); btn1.innerHTML = "How did I get here?"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('whatIsTheSilverArrow')"); btn2.innerHTML = "What is the Silver Arrow?"; break; case "howDidIGetHere": story = "'Your companion starts to explain. 'So this is basically a realm created by the leaders of a prominent buisness empire. It's pretty much a compilation of virtual reality and the perception of people in the real world. You probably came here after a queer business seminar like all of the other people in this world. Moral of the story: Don't drink the Kool-Aid. As for the Silver Arrow, It's more of a phenomenon than a tangible object. It's rumored to be some kind of EMP that fries the technology imprisoning your brain. We need it to get out of here. We should rest so we have a better chance of finding it.' "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('rest')"); btn1.innerHTML = "Rest and prepare for the journey to come"; break; case "whatIsTheSilverArrow": story = "'It's more of a phenomenon than a tangible object. Its rumored to be some kind of EMP that fries the technology imprisoning your brain. We need it to get out of here. We should rest so we have a better chance of finding it. And as for how you got here, this is basically a realm created by the leaders of a promindent buisness empire. It's pretty mcuh a compilation of virtual reality and the perception of people in the real world. You probably came here after a queer business seminar like all of the other people in this world. Moral of the story: Don't drink the Kool-Aid.' "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('rest')"); btn1.innerHTML = "Rest and prepare for the journey to come"; break; alert("GOAL: Find_Silver_Arrow") case "rest": displayHearts(); story = "You and you're companion rest in your secluded corner, discussing your game plan for the next day. You feel confident about the plan, but forget about that as the darkness of sleep envelops you."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continueAgain')"); btn1.innerHTML = "Continue"; break; case "Checkpoint6": case "continueAgain": health = 5; displayHearts(); story = "You wake up to the sound of your companion rifling through your supplies for the day. You start to pack as well, and decide that you will be heading out in a few moments. As you leave the building you are faced with a broken wooden fence and a white picket fence. Which will you choose?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('brokenFence')"); btn1.innerHTML = "Broken Fence"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('whitePicketFence')"); btn2.innerHTML = "White Picket Fence"; break; case "brokenFence": story = "You hop the fence lithely and with ease. Your companion is loaded with heavy bags and impales their leg on a splintered plank of wood. You stare at the wound in horror. Suddenly you see a strange glow at the edge of a cliff nearby. You grab your companion around the shoulders and make your way to the cliff."; health = 4; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepSearching')"); btn1.innerHTML = "Go to edge of the cliff"; break; case "whitePicketFence": story = "You unlatch the gate of the fence and continue on your way. You head towards the dark forest ahead and arrive at a clearing. On your right, a startlingly blue baby bird hops down a dirt path. On your left, a trail of lush plant life leads off into the trees. Which way do you go?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('babyBird')"); btn1.innerHTML = "Right, after the baby bird"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('plantLife')"); btn2.innerHTML = "Left, towards the plants"; break; case "babyBird": story = "You follow the baby bird into a more humid part of the forest, where brightly colored birds flock in the trees. A very large red bird locks its beady eyes on you. Suddenly, a whirlwind of birds attacks you. There is nothing you and your companion can do as you are overrun. You're DEAD. Try again from the last checkpoint. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint6')"); btn1.innerHTML = "Return to last CHECKPOINT"; break; case"plantLife": story = "You follow the trail of abundant plant life. It leads you to a cheerfully bubbling spring of water. You and your companion sit down to replenish your supplies. Do you continue to sit and rest or keep looking for the cliff on which the Silver Arrow is rumored to be located? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('sitRest')"); btn1.innerHTML = "Sit and rest"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('keepSearching')"); btn2.innerHTML = "Keep searching"; break; case "sitRest": hunger = 5; displayBreads(); story = "You and your companion blissfully relax at the edge of the pond into which the spring empties. Suddenly, you hear growls from the leafy foliage. A pack of furry creatures leaps out of the trees. There is no time to see what they are. Do you run away from them, or stay and fight?"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('runFromFuzzies')"); btn1.innerHTML = "Run from the creatures"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('fightFuzzies')"); btn2.innerHTML = "Fight the creatures"; break; case "runFromFuzzies": story = "You and your companion attempt to run from the furry creatures, but one of them drops out of a tree, right on to you. Sorry, you're DEAD. Try again from the last CHECKPOINT."; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('Checkpoint6')"); btn1.innerHTML = "Return to last CHECKPOINT"; break; case "fightFuzzies": story = "You and your companion draw your weapons, attempting to fight off the beasts. However, your companion is severely injured, while you have a large gash on your forehead. You grab onto a vine and snatch your partner with your other hand."; hunger = 3; displayBreads(); health = 2; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('keepSearching')"); btn1.innerHTML = "Continue to the cliff"; break; case "Checkpoint7": case "keepSearching": story = "You arrive at the cliff, where the Silver Arrow hovers over the ravine below. Your companion's health has deteriorated immensely. You are on your own."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('continue3')"); btn1.innerHTML = "Continue"; break; //This is where the other two buttons come in. Only one choice will leave the player alive. The other three will either send up a GAME OVER alert or start the player back at the beginning. case "continue3": story = "You tell your companion to wait on the ground. You scan your surroundings, searching for something to swing yourself high enough to reach the Silver Arrow. You find a tree branch extending over the edge, steady enough to lasso a rope around and hold your weight. It takes a few tries to loop your rope around it, but you manage to make it into a sturdy fork in the tree trunk. You realize that your companion is groaning in pain and has rolled over to the edge of the cliff. Do you attempt to lean over and grab the Silver Arrow, lasso it, help your friend and come back for the Silver Arrow, or run away and search for another way out? You consider that running away may be the smartest decision, but are not entirely sure. What will you decide? "; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('grabArrow')"); btn1.innerHTML = "Grab the Arrow"; btn2 = document.createElement("BUTTON"); btn2.setAttribute("onClick", "displayStory('lassoArrow')"); btn2.innerHTML = "Lasso the Arrow"; btn3 = document.createElement("BUTTON"); btn3.setAttribute("onClick", "displayStory('helpFriend')"); btn3.innerHTML = "Help your friend"; btn4 = document.createElement("BUTTON"); btn4.setAttribute("onClick", "displayStory('runAway')"); btn4.innerHTML = "Look for other escape options"; break; //This choice sends up the GAME OVER alert. case "grabArrow": story = "You lean over to grab the Silver Arrow, but a burning sensation rips through your body. You now realize that it is a plasma shield. You are DEAD. GAME OVER! Try again from the beginning when you are ready. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('gameOver')"); btn1.innerHTML = "GAME OVER"; break; //This choice sends up the GAME OVER alert. case "lassoArrow": story = "You attempt to lasso the arrow with your rope. You are genuinely surprised when the arrow is neatly surrounded by your rope. You pull it up and reach out to touch the Silver Arrow. Suddenly, your head is filled with a blinding pain. Sorry, the EMP fried your brain. GAME OVER! Try again from the beginning when you are ready. "; health = 0; displayHearts(); btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('gameOver')"); btn1.innerHTML = "GAME OVER"; break; //This choice leads to the player winning the game. case "helpFriend": story = "You shake your head at the Silver Arrow and drop back down to the ground next to your companion. As soon as you reach out to touch their arm, a swirl surrounds you and you return to an appartment in New York City. All your memories are returned and you are glad to be back where you belong. Congratulations! YOU WIN!"; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('youWin')"); btn1.innerHTML = "YOU WIN"; break; //This choice starts the character back at the beginning of the game. case "runAway": health = 5; displayHearts(); hunger = 5; displayBreads(); story = "You drop down to the ground and run past your injured companion. You head straight for the trees, but a swirl of darkness surrounds you. When you open your eyes, your worst nightmare has come true. You are back in the cave where you started."; btn1 = document.createElement("BUTTON"); btn1.setAttribute("onClick", "displayStory('beginning')"); btn1.innerHTML = "Return to the cave"; break; //This case sends out a GAME OVER alert. case "gameOver": alert("Sorry, you chose wrong. You will have to be wiser next time."); break; //This case sends out a YOU WIN alert. case"youWin": alert("Fantastic job! You won! You were honest, brave, and compassionate. You will make a great warrior someday."); break; } // end switch // change content on page document.getElementById("story").innerHTML = story; var buttons = document.getElementById("buttons"); while (buttons.firstChild) { buttons.removeChild(buttons.firstChild); } document.getElementById("buttons").appendChild(btn1); document.getElementById("buttons").appendChild(btn2); document.getElementById("buttons").appendChild(btn3); document.getElementById("buttons").appendChild(btn4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStory() {\n // In this example you need to initialise these in reverse order, so that\n // when you assign a target it already exists. I.e., start at the end!\n lunarEnd4B = new StorySection(\n \"The Escavator explodes, falling backwards into one of the many craters of the moon. It was a brief explosion but it brightened up the hull of your ship for a moment before leaving behind a fiery mess near the Lunar Base.\\n\\n Ending 4 - Sacrifice \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd4A = new StorySection(\n \"You follow West's idea. You asked the Colonel about the Escavator and left the backpack in a closet when no one was looking. You the Colonel you'll be in touch, as leave the station into a loose orbit around the moon. \\n\\n It doesn't take much longer when you see it happen. \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd3 = new StorySection(\n \"You end up telling the Colonel that if he doesn't shut down the drill, that you would report him to both the UN and his superiors about the situation. This holds up the US in its expansion plans, and inevitable helps the other nations catch up in technology and resources. The space race is still ongoing.\\n\\n Ending 3 - Morality\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // okay ending //blackmail the colonel into not selling the drill materials\n lunarEnd2B = new StorySection(\n \"You report Lt. Colonel West's dissapearance, and the rest of the situation to both your superiors and the Colonel. You were never able to figure out why the Colonel was actually so defensive about you being there, but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd2A = new StorySection(\n \"You report Lt. Colonel West to both your superiors and the Colonel about his plans. You were never able to figure out if the Colonel was actually privately earning money through this trade but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd1 = new StorySection(\n \"You leave the Lunar station with more questions than answers but ultimately decided it wasn't within your power to stop anything that was happening. You stay in orbit for about a week when you hear news about the Giant Moon Excavator being finished. The Colonel was right, the minerals they mined ended up being full of crucial elements. It propelled the US to being a space superpower and only furthered their ambitions in space. China was somehow able to acquire much of these rare materials and used to to further their stocks. \\n\\n Ending 1 - Idleness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // worst ending // do nothing after finding out everything\n //moon ending\n moonChoice3B = new StorySection(\n \"You ponder what's happened here so far. You've been threatened by the Colonel, and you saw a man with a backpack that was clearly plotting something. You can't find the Lt Colonel either. What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2B\n );\n moonChoice3A = new StorySection(\n \"Well this has escalated quickly. There's no way you're blowing up an escavator, corruption or not, that'll only give them international support. But if you tell Ramos about West's intentions, there won't be anyone to stop him in the future.\\\\What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2A\n );\n //final decision for the moon\n investigation9 = new StorySection(\n \"You head straight to the Colonel and tell him immediately of Colonel West's dissapearance, the man you saw in the cafeteria, and even the explosives you found in your ship. He tells you that he will handle it and everything will be fine. He sends you off and you end up not being able to do much else but spectate.\",\n \"(A) Next\",\n lunarEnd2B,\n \"\",\n investigation8\n );\n investigation8 = new StorySection(\n \"You get back to your ship and ponder who you saw in the cafeteria, when you get back to your ship and find a backpack. You open it, and see that it...contains C-4 explosives?! You immediately check if it is armed but it's just raw C-4. This is bad, what shoud you? \",\n \"(A) Tell the Colonel\",\n investigation9,\n \"(D) Put it in your ship and leave now\",\n lunarEnd1\n );\n investigation7 = new StorySection(\n \"You look in the cafeteria after a day of looking around and pondering, and its remarkably dark here. You stumble around to see if there is other rooms when you see one room with a light on. You open the door see a man with a large backpack, and make brief eyecontact before he bolts and runs through another door into the darkness of the cafeteria where you lose him.\",\n \"(A) Tell the Colonel\",\n investigation8,\n \"(D) Go back to your ship to think\",\n moonChoice3B\n ); // decision for your plan\n investigation6 = new StorySection(\n \"As he walks away, you look inside the bag, and check what he gave you. You immediately recognize it to be military grade C4 explosives. He...wants to blow up the excavator?! What can- what should you do?\",\n \"(A) Follow his plan\",\n lunarEnd4A,\n \"(D) Go back to your ship to think\",\n moonChoice3A\n );\n investigation5 = new StorySection(\n \"Good. Since you haven't ratted me out, that means you're on my side,''He hands you a backpack that was behind him. ''I've heard you're experienced, you should know how to use these. Tell the Colonel you want to see the the Excavator tonight before you leave, and leave this in there. I'll handle the rest.''\",\n \"(A) Take the bag\",\n investigation6,\n \"(D) Don't take the bag\",\n moonChoice3B\n ); // Lt. Colonel whistleblower\n investigation4B = new StorySection(\n \"You asked around to find the Lt. Colonel but he wasn't anywhere to be found. One of the base soldiers told you that he likes to hang around the cafeteria, so you head over there. \",\n \"(A) Next\",\n investigation7,\n \"\",\n investigation7\n ); // Lt Colonel has the metal tube\n investigation4AB = new StorySection(\n \"You walk forward not sure why he signalled and he points at the ceiling as you walk through a camera's field of view. That's when West takes out a small device and points it at the camera which immediately powers down.\\n\\n He looks even more dissapointed than he was earlier and says, ''You really can't take a hint can you?'' as rushes off behind you and into the hangar. \",\n \"(A) Next\",\n investigation5,\n \"(D) Continue\",\n investigation4AB\n ); //goes through camera\n investigation4AA = new StorySection(\n \"You stop as you look at him in confusion, and he points at the ceiling where a camera is panning left and right. He takes out a small device and points it at the camera which immediately powers down.\\n\\n He walks up to you and whispers, did you read it?\",\n \"(A) Yes\",\n investigation5,\n \"\",\n investigation5\n ); //doesn't go through camera\n investigation4A = new StorySection(\n \"It doesn't take long for you to find West. He was quite literally around the corner of the entrance of the hangar waiting for you. As you approach him, he puts his hand up to signal for you to stop.\",\n \"(A) Stop\",\n investigation4AA,\n \"(D) Continue\",\n investigation4AB\n ); // You have read the contents of the tube, looking for Lt Colonel West\n interrogation3 = new StorySection(\n \"''I don't have to tell you anything. Get off my station.'' he says as he gets up, clearly agitated about this coming to light. His guards walk in and escort you to your ship, where you're forced to leave the base.\",\n \"(A) Next\",\n lunarEnd1,\n \"\",\n lunarEnd1\n );\n interrogation2B = new StorySection(\n \"''You decide its better not to say. ''I can't say, but the allegations are pretty serious either way. Is that what you planned to do with the drill? The moon is international land, did the UN sanction your privatization of the moon?\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation2A = new StorySection(\n \"You decide to tell him, ''Your Lt. Colonel West did. He managed to hand me and I'm here to get your side of the story.''\\n\\n ''My 'side' of the story? The truth is that we are here as a nation to build the forward station to humanity. I have nothing to do wtih China,''\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation1A = new StorySection(\n \"You put the note on to Ramo's desk as he walks overs and picks it up. He looks at you obviously furious, but still attempt to put a facade of calmness. ''This is quite the allegation. Who may I ask, gave you this?''he says with a tinge of frustration.\",\n \"(A) Tell him\",\n interrogation2A,\n \"(D) Don't tell him\",\n interrogation2B\n ); //Lt Colonel West has the letter\n investigation3 = new StorySection(\n \"Colonel Ramos is sitting at his desk reading something on his desk screen when you walk in abruptly. ''Ah, to what do I owe the pleasure?'' Ramos says as he leans back on his chair and stares you down.\",\n \"(A) Show him the letter\",\n interrogation1A,\n \"(D) Accuse him without the letter\",\n interrogation2B\n );\n scroll2 = new StorySection(\n \"Well that explains the drill and the speed of them building everything up so fast. How long has it been, 3 months since the US came here, and they already have a drill almost fully built? Although, why would Lt Colonel West reveal this to you? What should you do?\",\n \"(A) Confront Colonel Ramos\",\n investigation3,\n \"(D) Confront Lt. Colonel West\",\n investigation4A\n );\n scroll1 = new StorySection(\n \"It reads, ''The US had the means, but China funded the way\\nRamos made private deal with China for minerals exports''\",\n \"(A) Next\",\n scroll2,\n \"\",\n scroll2\n );\n investigation2 = new StorySection(\n \"You look at the 2 inch metallic tube and see that there's a very thin line in the middle. Is this a container? You pulled as hard as you can and it pops open abruptly, revealing a scrolled piece of paper that drops onto the floor.\",\n \"(A) Read it\",\n scroll1,\n \"\",\n scroll1\n );\n investigation1B = new StorySection(\n \"You return to the hangar and sit near your ship. \\nYou take out the tube in your pocket. You wonder what this is?\",\n \"(A) Inspect the metal tube\",\n investigation2,\n \"\",\n investigation2\n ); // you have the letter\n investigation1A = new StorySection(\n \"You return to the hangar and sit near your ship. \\nWhat should you do?\",\n \"(A) Look around the base\",\n investigation7,\n \"(D) Talk to the Lt. Colonel\",\n investigation4B\n ); // you don't have the letter\n //unfinished section\n // investigation of the moon\n lunarLieutenant6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,''he lifts his hand and gestures to the door. ''You're free to go.'' You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1B,\n \"\",\n investigation1B\n );\n lunarLieutenant5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarLieutenant6,\n \"\",\n lunarLieutenant6\n );\n lunarLieutenant4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarLieutenant5,\n \"\",\n lunarLieutenant5\n );\n lunarLieutenant3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant3A = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant2 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarLieutenant3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarLieutenant3B\n ); //unique dialogue choice (edit later to differ from other dialogue)\n lunarLieutenant1 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou pick it up and put it in your pocket, as you catch back up to the officer. When you get to him, you find him standing next to a locked door as he waits for you. He whispers something to you under his breath that sounds like ''read it later'', he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarLieutenant2,\n \"\",\n lunarLieutenant2\n );\n //keeping it timeline ^\n lunarCommander6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,'' lifts his hand and gestures to the door. ''You're free to go.''. You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1A,\n \"\",\n investigation1A\n );\n lunarCommander5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarCommander6,\n \"\",\n lunarCommander6\n );\n lunarCommander4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarCommander5,\n \"\",\n lunarCommander5\n );\n lunarCommander3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander3A = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander2 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarCommander3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarCommander3B\n ); //unique dialogue choice\n lunarCommander1 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n You pick it up and catch up to the officer ahead of you. ''Excuse me sir, you dropped this,'' and hand it back to him. He looks at you profoundly surprised and quickly puts it back into his pocket. He shakes his head, seemingly dissapointed in you. You get a good look at his insignia and see that he is the Lieutenant Colonel here.\\n\\nBefore you can get a word in, he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarCommander2,\n \"\",\n lunarCommander2\n );\n\n //Giving it back timeline ^\n moonChoice1 = new StorySection(\n \"Day 1, 8:29 AM (Earth Time)\\n\\n You are greeted entering the station by an officer patiently waiting near the decompression chamber. He waits for you and shakes your hand and leads the way through the pristine hallways. \\n\\n Suddenly, he drops something on the floor as he walks ahead of you. He strangely didn't seem to notice. It seems to be a tiny metallic tube. What should you do?\",\n \"(A) Pick it up and keep it\",\n lunarLieutenant1,\n \"(D) Pick it up and give it back\",\n lunarCommander1\n );\n //moon dialogue\n moonIntro8B = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7B = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8B,\n \"\",\n moonIntro8B\n );\n moonIntro6B = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7B,\n \"\",\n moonIntro7B\n );\n moonIntro5B = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6B,\n \"\",\n moonIntro6B\n );\n moonIntro4B = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. Maybe you should've brought the photo.\",\n \"(A) Next\",\n moonIntro5B,\n \"\",\n moonIntro5B\n );\n moonIntro3B = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4B,\n \"\",\n moonIntro4B\n );\n moonIntro2B = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3B,\n \"\",\n moonIntro3B\n );\n moonIntro1B = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2B,\n \"\",\n moonIntro2B\n );\n //second branch - no photo timeline (B)\n moonIntro8A = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7A = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8A,\n \"\",\n moonIntro8A\n );\n moonIntro6A = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7A,\n \"\",\n moonIntro7A\n );\n moonIntro5A = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6A,\n \"\",\n moonIntro6A\n );\n moonIntro4A = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. You take out the photo from your spacesuit's pockets. You stare at it and it comforts you a bit.\",\n \"(A) Next\",\n moonIntro5A,\n \"\",\n moonIntro5A\n );\n moonIntro3A = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4A,\n \"\",\n moonIntro4A\n );\n moonIntro2A = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3A,\n \"\",\n moonIntro3A\n );\n moonIntro1A = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2A,\n \"\",\n moonIntro2A\n );\n //first branch - photo timeline (A)\n //moon story\n leaveThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou decide against it. You will be back, and it's probably better to leave it here than to lose it somewhere else. Especially Space.\",\n \"(A) Next\",\n moonIntro1B, //B = no photo\n \"\",\n moonIntro1B\n );\n keepThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou take the photo out of the frame, and put it in your pocket. There's no telling how long it will be out there, might as well keep something to remember them.\",\n \"(A) Next\",\n moonIntro1A, //A = with photo\n \"\",\n moonIntro1A\n );\n choice1 = new StorySection(\n \"Day 1, 4:00 AM\\n\\nYou wake up in your house for the last time, in a long time. You're about to leave when you realize you should check if you forgot anything you wanted to bring with you. You walk through your hallway and see a picture of you and your family, one taken a long time ago, before your peacekeeping days. It's been a long time since then.\\n\\nShould you keep it?\",\n \"(A) Keep the photo\", // text for option 1\n keepThePhoto, //object target option 1\n \"(D) Leave the photo\",\n leaveThePhoto\n );\n backstory2 = new StorySection(\n \"The United Nations has been working hard to send you and your force of 25 military spacejets to be the among the first to be sent into space. You have led multiple sucessful peacekeeping campaigns before, and the United Nations trust that you will influence the best decisions in this uncharted terrority.\",\n \"(A) Next\", //Text for option 1\n choice1, //Object target for option 1\n \"\",\n choice1\n );\n backstory1 = new StorySection(\n \"You have been selected to be in charge of the new and impossibly difficult task, to be a neutral force to observe the nation's actions and respond accordingly in space.\\n\\nA Space Peacekeeper.\",\n \"(A) Next\", //Text for option 1\n backstory2, //Object target option 1\n \"\",\n backstory2\n );\n //story start\n openingPassage3 = new StorySection(\n \"This caused the other nations to scramble and organize their own methods to reach the moon and stake a claim before all of it was gone and before international law would have a chance to stop it and regulate it. \\n\\nThe World's second Space Race had officially begun.\",\n \"(A) Next\", //Text for option 1\n backstory1, //Object target for option 1\n \"\",\n backstory1\n );\n openingPassage2 = new StorySection(\n \"Whether we wanted it or not, space colonization and travel is in full boom. The United States were the first to put make a Space Force that set the standard for United Nations. But before the United Nations could do much to regulate it, the United States had already established the Moon as the first extraterrestrial object to be used by their private industries.\",\n \"(A) Next\", //Text for option 1\n openingPassage3, //Object target for option 1\n \"\",\n openingPassage3\n );\n openingPassage1 = new StorySection(\n \"Humans are not like any other creature in the known universe. We have effectively conquered the Earth in ways animals could not even being to understand. To our current knowledge, we know that we are the only intelligent and sentient creatures that is in our system.\\n\\nIf no other creature claims the barren planets of our system, does it not belong to all of us?\", //Description for scene\n \"(A) Next\", //Text for option 1\n openingPassage2, //Object target for option 1\n \"\",\n openingPassage2\n );\n beginningQuote = new StorySection(\n \"''The cognizance of any creature increases by the amount of progression they make. The greater the cognizance, the larger the conscience.''\", //Beginnning quote by me\n \"(A) Next\", //Text for option 1\n openingPassage1, //Object target for option 1\n \"\",\n openingPassage1\n );\n title = new StorySection(\n \"The Golden Age\\n\\nThe Lunar Storm\\n\\n\\nControls are A and D on the keyboard.\",\n \"(A) Next\", //Text for option 1\n beginningQuote, //Object target for option 1\n \"by Melvin Mingoa\",\n beginningQuote\n );\n //introduction\n}", "function getStory() {\n\n // Initialize variables and get data from html\n let output = document.querySelector('.story')\n let customName = document.querySelector('#customname').value\n let ukButtonStatus = document.querySelector('#uk').checked\n let whoUser\n let valuesPhrase\n let temp = 91\n let weight = 300\n let measure\n let whoPhrase = getRandomWord(['Willy the Goblin','Big Daddy','Father Christmas'])\n let wherePhrase = getRandomWord(['the soup kitchen','Disneyland','the White House'])\n let whatPhrase = getRandomWord(['spontaneously combusted','melted into a puddle on the sidewalk','turned into a slug and crawled away'])\n\n // Checks if user entered a custom name\n if (customName !== \"\") {\n whoUser = customName\n } else {\n whoUser = 'Bob'\n }\n\n // Checks if which button is checked and assign values to variables\n if (ukButtonStatus === false) { \n measure = ['farenheit', 'pounds']\n } else {\n temp = convertToCentigrade(temp)\n weight = convertToStone(weight)\n measure = ['centigrade', 'stones']\n }\n\n valuesPhrase = [`${ temp } ${ measure[0] }`,`${ weight } ${ measure[1] }`]\n \n // Create output based on user input and default values\n output.textContent = `It was ${ valuesPhrase[0] } outside, so ${ whoPhrase } went for a walk. \n When they got to ${ wherePhrase }, they stared in horror for a few moments,\n then ${ whatPhrase }. ${ whoUser } saw the whole thing, but was not surprised\n — ${ whoPhrase } weighs ${ valuesPhrase[1] }, and it was a hot day.`\n\n // Change visibility\n output.style.visibility = 'visible'\n}", "function displayStory(arr) {\r\n\tget(\"continue-box\").style.display = \"none\";\r\n\tget(\"content-options\").style.display = \"none\";\r\n\tget(\"choice1Btn\").style.display = \"none\";\r\n\tget(\"choice2Btn\").style.display = \"none\";\r\n\tget(\"choice3Btn\").style.display = \"none\";\r\n\tget(\"loc-content\").style.display = \"none\";\r\n\tget(\"content-one\").innerHTML = arr.text;\r\n\tif(arr.contFlag == 1) { //if cont flag is true on object, display continue box on page.\r\n\t\tpopContBtn();\r\n\t}\r\n\telse if(arr.optFlag == 1) {\r\n\t\tpopChoiceBtn(arr.optNum); //number of choices is passed\r\n\t}\r\n}", "function storyTwo() {\n console.log(\"story two there\");\n $('#question').hide();\n\n// varible to make a random story\n var storyTwo = {\n \"start\": \"Everything was going #adjective# when suddenly Jack the #job# who loves to #hobby# came in running with a #object# in the room. Everybody who witnessed the scene started #verb# and decided to do #movement# to help the situation. But wait! said #name#, what is the noise I hear? This is when the #hero# of the situation came to the rescue. Berret the #qualitie# ran into the window on his #transport# and knocked down Jack. Everybody was #emotion# of how everything ended and went back home from the #place#. #name# the #animal# was so #emotion# that she went to see Berret to give him a #gift#. The end\",\n// the different variable that the player chose\n \"adjective\":[adjective],\n \"job\":[job],\n \"hobby\":[hobby],\n \"object\":[object],\n \"verb\":[verb],\n \"movement\":[movement],\n \"name\": [chosenName],\n \"hero\" : [hero],\n \"qualitie\": [qualitie],\n \"transport\": [transport],\n \"emotion\": [emotion],\n \"place\": [chosenPlace],\n \"animal\": [chosenAnimal],\n \"gift\":[gift]\n }\n\n var timer = 0;\n if (timer < 270) {\n for (var i=1; i<=200; i++) {\n $('#story').animate({\n height:[\"toggle\",\"easeOutBounce\"],\n opacity: \"toggle\",\n })\n }\n}\n\n// setting the background color to random\n window.setInterval(function(){\n\n var randomColor = '#'+ ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6);\n $('body').css({\n 'background-color' : randomColor,\n });\n }, 100);\n\n// variable to use tracery\n var grammar = tracery.createGrammar(storyTwo);\n var resultTwo = grammar.flatten(\"#start#\");\n console.log(storyTwo);\n $('#instructions').text('STORY PARTY!!!!');\n $('#story').show();\n $('#story').text(story);\n $('#story').text(resultTwo);\n responsiveVoice.speak(resultTwo, 'UK English Male',{rate:1.2,pitch:1});\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}", "function updateStory() {\n\t\t// create name of chapter using index\n\t\tvar chapter = 'chapter' + index\n\t\tvar title = 'title' + index\n\t\t// add text/html to story div from chapter variable in story.js\n\t\t$(\".story\").html(window[title] + window[chapter]);\n\t}", "function choice1() {\r\n\tplayerStoryCode += 1;\r\n\tloadStory(storyStorageArray, playerStoryCode);\r\n}", "function storyObject(code, text, contFlag, optionsFlag, optNum) {\r\n\tthis.code = code; //story code. used for searching array to load and create object. updates to playerStoryCode. \r\n\tthis.text = text; //display text w/ options if needed\r\n\tthis.contFlag = contFlag; //<-- default state = 0. if 1, then display continue button to trigger next story code.\r\n\tthis.optFlag = optionsFlag; //<-- default state = 0. if 1, then display options.\r\n\tthis.optNum = optNum;\r\n}", "function tellStory() {\n var pause = '\\\\pau=0\\\\';\n if (game.p == game.quiz.length - 1) pause = '\\\\pau=2500\\\\';\n if (game.quiz[game.p].story != '') speakOut(game.quiz[game.p].story + pause);\n}", "function displayInteractiveStory(stories, id) {\r\n if (id == 4) {\r\n getName();\r\n }\r\n\r\n if (id == 6) {\r\n evil(id);\r\n }\r\n\r\n if (id == 9) {\r\n secret(id);\r\n }\r\n\r\n var story = stories[id];\r\n\r\n var $story = $(getStoryHTML(story));\r\n\r\n $story.hide();\r\n $story.fadeIn(1000);\r\n\r\n $storyContainer.append($story);\r\n\r\n if (isEnded(story))\r\n $pathContainer.html(\r\n '<button class=\"path-btn\" data-target=\"replay\">Replay?</button>'\r\n );\r\n else $pathContainer.html(getPathHTML(story.paths));\r\n }", "function result() {\n let newStory = storyText;\n\n//calls the function and gets it to return one random string out of each respective array\n let xItem = randomValueFromArray(insertX);\n let yItem = randomValueFromArray(insertY);\n let zItem = randomValueFromArray(insertZ);\n\n //Whenever a newStory is called, it is made equal to itself but with substitutions made\n //so each time the button is pressed, these place holders are each replaced with a random silly string.\n newStory = newStory.replace(':insertx:',xItem);\n newStory = newStory.replace(':insertx:',xItem);\n newStory = newStory.replace(':inserty:',yItem);\n newStory = newStory.replace(':insertz:',zItem);\n \n\n//adds another string replacement method to replace the name \"bob\" with the name variable.\n if(customName.value !== '') {\n const name = customName.value;\n newStory = newStory.replace('Bob',name);\n\n }\n\n//Here we're checking to see if the radio button is checked between US or UK. If selected with UK,\n//it then does the math conversions for weight and temperature and converts them to Stone, and Centigrade\"\n if(document.getElementById(\"uk\").checked) {\n const weight = Math.round(300*0.0714286) + ' stone';\n const temperature = Math.round((94-32) * 5 / 9) + ' centigrade';\n newStory = newStory.replace('94 fahrenheit',temperature);\n newStory = newStory.replace('300 pounds',weight);\n\n }\n\n story.textContent = newStory;\n story.style.visibility = 'visible';\n}", "function theBeginning() {\n\n //Game Title track\n game_title.style.display = 'none'; //Remove title when the game begins\n\n //Button track\n intro_btn.style.display = 'none'; //Remove intro button when game begins\n progress_btn.style.visibility = 'visible'; //does not show when choices appear\n choice_A.style.visibility = 'hidden'; //does not show when storyline progresses\n choice_B.style.visibility = 'hidden'; //does not show when storyline progresses \n\n // BG track (Add introduction BG)\n BG.classList = '';\n BG.classList.add('background');\n BG.classList.add('grassPath');\n\n //StoryBox\n story_box.style.display = 'block'; //The box shows up here\n\n //Characters\n character_box.style.display = 'block'; //show the character\n character_box.src = './media/ChaGB1.png'; //for game restart\n character_box.classList.add('characters'); //all characters used will have the same setup\n\n narrator.innerText = 'Just testing mechanics and whatnot. Press \"Roll\" please.';\n progress_btn.innerText = 'Roll';\n\n //replaces the intro btn to progress with the story\n progress_btn.addEventListener('click', herostats);\n\n}", "function displayInteractiveStory(stories, id) {\n var story = stories[id];\n\n var $story = $(getStoryHTML(story));\n $story.hide();\n $story.fadeIn(1000);\n\n $storyContainer.append($story); \n if (isEnded(story))\n $pathContainer.html('<button class=\"path-btn\" data-target=\"replay\">Replay?</button>');\n else \n $pathContainer.html(getPathHTML(story.paths));\n }", "function changeStoryLanguage(story, questions) {\r\n document.querySelector(\".main-text\").innerText = story;\r\n document.querySelector(\".questions-text\").innerHTML = questions;\r\n}", "function getStoryHTML(story) {\r\n return '<p class=\"story-text\">' + story.text + \"</p>\";\r\n }", "function StoryPanel() {\n\n\tfunction openDialog() {\n\t\tdispatch(setShowEMail(true, true));\n\t}\n\n\tconst dispatch = useDispatch();\n\tconst story = useSelector(({ui: {output}}) => output);\n\n\tconst button = [\n\t\t{\n\t\t\tcontent: 'E-mail to a friend',\n\t\t\tdisabled: !story,\n\t\t\tonClick: openDialog\n\t\t}\n\t];\n\n\treturn story ? (\n\t\t<FormLayout scrolling={true} buttons={button}>\n\t\t\t<Text type='story' html={story}/>\n\t\t</FormLayout>\n\t) : null;\n}", "function titleScreen() {\n // var testHero = new Hero();\n flavor.style.visibility = 'visible';\n beginGame.style.visibility = 'hidden';\n startButton.style.visibility = 'visible';\n story.textContent = '';\n}", "function getStoryHTML(story) {\n return '<p class=\"story-text\">' + story.text + '</p>'\n }", "function buildTutorialScreen() {\n //creating tutorial welcome\n let x = width / 2;\n let y = 100 * progScale;\n let s = \"Welcome to the Tutorial!\";\n let title = new DisplayText(x, y, 0, 0, s);\n title.textSize = 70 * progScale;\n allObjects.push(title);\n\n //Explaining movement\n\n //sideways movement\n x = width / 2;\n y = 200 * progScale;\n s = \"Use these Keyboard Keys for Movement:\";\n let textMovement = new DisplayText(x, y, 0, 0, s);\n textMovement.textSize = 45 * progScale;\n allObjects.push(textMovement);\n\n //sideways movement 2\n x = width / 2;\n y = 275 * progScale;\n s = \"A and D OR <- and -> Arrow Keys\";\n let textAD = new DisplayText(x, y, 0, 0, s);\n textAD.textSize = 45 * progScale;\n textAD.textFont = fontBold;\n allObjects.push(textAD);\n\n //Jumping\n x = width / 4;\n y = 400 * progScale;\n s = \"To Jump, press the:\";\n let textjump = new DisplayText(x, y, 0, 0, s);\n textjump.textSize = 45 * progScale;\n allObjects.push(textjump);\n\n //Jumping 2\n x = width / 4;\n y = 475 * progScale;\n s = \"Spacebar\";\n let textSpace = new DisplayText(x, y, 0, 0, s);\n textSpace.textSize = 45 * progScale;\n textSpace.textFont = fontBold;\n allObjects.push(textSpace);\n\n //Wall Jumping\n x = width / 1.33;\n y = 400 * progScale;\n s = \"You can wall-jump\\nby pressing jump\\nwhile on a wall\";\n let textWallJump = new DisplayText(x, y, 0, 0, s);\n textWallJump.textSize = 30 * progScale;\n allObjects.push(textWallJump);\n \n //Pause message\n x = width / 1.33;\n y = 525 * progScale;\n s = \"Press ESC or ENTER\\nto Pause the game\";\n let pauseMessage = new DisplayText(x, y, 0, 0, s);\n pauseMessage.textSize = 25 * progScale;\n pauseMessage.textAlignH = CENTER;\n allObjects.push(pauseMessage);\n\n\n //Player and Blocks display\n //Block\n let w = 500 * progScale;\n let h = 50 * progScale;\n x = width / 2 - w / 2;\n y = 700 * progScale;\n\n let b = new Block(x, y, w, h);\n allObjects.push(b);\n allBlocks.push(b);\n b.setStrokeWeight(0);\n b.setStrokeColor(color(255, 255, 255)); //white stroke\n\n //Player\n w = h * (0.75);\n x = width / 2 - w / 2;\n y = y - w - ((w / 0.75) * 0.75 / 2);\n\n //adjusting x and y based on w being smaller\n //x += ((w / 0.75) - w) / 2;\n //y += ((w / 0.75) - w) / 2;\n\n let p = new Player(x, y, w, w);\n allObjects.push(p);\n p.fillColor = color(255, 190, 0); //Orange\n p.spawnStrokeColor = color(255, 190, 0); //Orange\n p.spawnFillColor = color(255, 190, 0, 0); //Orange with transparency\n p.setStrokeWeight(0);\n\n \n //Continue message\n x = width/2;\n y = 775 * progScale;\n s = \"Click this Button to continue\";\n let continueMessage = new DisplayText(x, y, 0, 0, s);\n continueMessage.textSize = 25 * progScale;\n continueMessage.textAlignH = CENTER;\n allObjects.push(continueMessage);\n \n //tutorial button\n w = 400 * progScale;\n h = 75 * progScale;\n x = (width / 2) - w / 2;\n y = 800 * progScale;\n let startTutorial = function() {\n clearGameObjects(); //clearing menu\n currentLevelSet = tutorialLevels; //setting set of levels to load\n currentLevel = 1; //for display\n currentLevelIndex = 0; //for level indexing\n numberOfDeaths = 0; //so practice deaths don't count\n gameTimer.reset(); //reseting current time on timer\n buildLevel(currentLevelIndex, currentLevelSet); //starting level\n };\n let btnTutorial = new Button(x, y, w, h, startTutorial);\n btnTutorial.displayText = \"Let's Try It!\";\n btnTutorial.strokeWeight = 0;\n btnTutorial.fillColor = color(0, 255, 255); //light blue\n btnTutorial.hoverColor = color(0, 255 / 2, 255 / 2); //darker\n btnTutorial.textSize = 45 * progScale;\n btnTutorial.textColor = color(0, 0, 0); //black\n btnTutorial.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnTutorial);\n\n //About Levels\n x = width / 2;\n y = 912 * progScale;\n s = \"The following levels will explain the rest...\";\n let textLevels = new DisplayText(x, y, 0, 0, s);\n textLevels.textSize = 30 * progScale;\n allObjects.push(textLevels);\n\n}", "function displayTutorial() {\n push();\n textSize(28);\n textAlign(LEFT);\n // if text is fading in\n if (!tutorialFadeAway) {\n tutorialFontAlpha = lerp(tutorialFontAlpha, 255, 0.05);\n // if text is fading out\n } else {\n tutorialFontAlpha = lerp(tutorialFontAlpha, 0, 0.1);\n }\n fill(255, tutorialFontAlpha);\n text(TEXT_LETTER, width / 12, height / 2);\n // do only once\n if (doOnce) {\n // create a next button\n var $button = $(\"<div class='button' id = 'tutorial-button'></div>\").text(\"next\").button().click(function() {\n tutorialFadeAway = true;\n $('#tutorial-button').remove();\n SOUND_HIGH_PIANO_KEY.play();\n }).hide().fadeIn(500);\n $body.append($button);\n doOnce = false;\n }\n // if the player clicks the next button and the opacity is less than 1\n // go to gameplay\n if (tutorialFadeAway && tutorialFontAlpha <= 1) {\n setTimeout(function() {\n state = \"PLAY\";\n doOnce = true; // reset doOnce\n gameBackground.fadeIn = true; // fade in the background\n showTriggers(); // show the object trigger buttons\n $directionIndicator.show(); // show the direction indicator\n }, 2000);\n }\n pop();\n}", "function draw() {\n\n if (currentSetting == \"home\") {\n background(\"purple\");\n image(couch, 140, 200);\n image(box, 130, 220);\n image(drben1, 230, 220);\n image(radio, 260, 350);\n } else if (currentSetting == \"office\") {\n background(\"gray\");\n image(drben2, 200, 200);\n } else if (currentSetting == \"lab\") {\n background(\"lightblue\");\n image(table, 200, 320);\n image(drben3, 300, 200);\n image(boozy, 180, 230);\n fill(\"#C0C0C0\");\n noStroke();\n rect(0, 600, width, 400);\n }\n\n textSize(40);\n textAlign(CENTER, CENTER);\n textFont(\"georgia\");\n text(story, 300, 100, width / 2);\n\n //instructions\n textSize(20);\n fill('white');\n text(\"Click mouse to continue story\", 50, 70, 100);\n}", "function NextStory(again) {\n if (again === false) {\n var nextstory = SelectedStory;\n }\n var nextstory = SelectedStory;\n nextstory++;\n console.log(nextstory);\n //SelectedStory does not need a ++ because it is the hman number(starting at 1) and not the machine number(starting at 0)\n if (chapters[SelectedStory] != undefined && chapters[SelectedStory].level == 1) {\n ChapSelect(nextstory)\n console.log(\"selecting! \" + nextstory);\n } else {\n NextStory(true);\n }\n}", "function drawBackstory() {\n console.log(\"backstory\");\n graphics.clearRect(0, 0, canvas.width, canvas.height);\n graphics.font = \"20px Ariel\";\n graphics.fillText(\"The year is 2050 and the human race has spread out across the stars.\", 10, 50);\n graphics.fillText(\"Human settlements, sometimes separated by several billion lightyears,\", 10, 70);\n graphics.fillText(\" rely on advanced space stations to communicate.\", 10, 90);\n graphics.fillText(\"Although humanity has made peace with most of the alien species it has\", 10, 110);\n graphics.fillText(\"encountered, a gang of rogue Crouser aliens has recently attacked\", 10, 130);\n graphics.fillText(\"these vital space stations. They have corrupted several vital snippets\", 10, 150);\n graphics.fillText(\"of code contained in the space station mainframes, completely disrupting\", 10, 170);\n graphics.fillText(\"humanity's ability to communicate. It is up to you, the Galactic Order's\", 10, 190);\n graphics.fillText(\"top coding expert, to fly to these space stations and fix the corrupted code.\", 10, 210);\n setTimeout(draw, 5000);\n }", "function continueStory(firstTime) {\n\n if(firstTime){\n var soundDiv = document.getElementById('backgroundMusic');\n soundDiv.src = backgroundMusicSrc;\n soundDiv.play();\n soundDiv.loop = true;\n }\n\n var paragraphIndex = 0;\n var delay = 0.0;\n\n // Don't over-scroll past new content\n// var previousBottomEdge = firstTime ? 0 : contentBottomEdgeY();\n\n // Generate story text - loop through available content\n while(story.canContinue) {\n var actualDelay = 200;\n\n // Get ink to generate the next paragraph\n var paragraphText = story.Continue();\n var tags = story.currentTags;\n // Any special tags included with this line\n var customClasses = [];\n for(var i=0; i<tags.length; i++) {\n var tag = tags[i];\n // Detect tags of the form \"X: Y\". Currently used for IMAGE and CLASS but could be\n // customised to be used for other things too.\n var splitTag = splitPropertyTag(tag);\n\n if( splitTag && splitTag.property == \"DELAY\") {\n delay += (splitTag.val * 1000) - 200;\n actualDelay = (splitTag.val * 1000) - 200;\n }\n\n if (splitTag && splitTag.property == \"SOUNDEFFECT\") {\n var soundSrc = document.getElementById('soundEffects');\n soundSrc.src = splitTag.val;\n console.log(`VOU TOCAR A MÚSICA ${soundSrc} com delay de ${actualDelay}`);\n \n setTimeout(() => {\n soundSrc.play()\n console.log(`TOQUEI A ${soundSrc}`)\n }, actualDelay);\n }\n // IMAGE: src\n if( splitTag && splitTag.property == \"IMAGE\" ) {\n var cena = document.getElementById('cena');\n //Pega sempre o indice do fundo, é único que tem essa classe.\n cena.style.backgroundImage = \"url('\"+splitTag.val+\"')\";\n }\n\n if( splitTag && splitTag.property == \"INPUT\"){\n var p = document.createElement('p');\n p.id = \"generico\";\n //Cria input\n var inputElement = document.createElement('input');\n inputElement.type = \"text\";\n inputElement.id = \"name\";\n inputElement.classList.add('input-text');\n p.appendChild(inputElement);\n timelineContainer.appendChild(p);\n }\n\n \n if( splitTag && splitTag.property == \"ANIMATION\"){\n debugger;\n if (splitTag.val == \"pira\") {\n var cena = document.getElementById('cena');\n cena.classList.add('bg-glitch');\n }\n if (splitTag.val == \"para\") {\n var cenas = document.getElementsByClassName('bg-glitch');\n for (let i = 0; i < cenas.length; i++) {\n cenas[i].classList.remove('bg-glitch');\n }\n }\n }\n\n // CLASS: className\n else if( splitTag && splitTag.property == \"CLASS\" ) {\n customClasses.push(splitTag.val);\n }\n\n // CLEAR - removes all existing content.\n // RESTART - clears everything and restarts the story from the beginning\n else if( tag == \"CLEAR\" || tag == \"RESTART\" ) {\n removeAll(\"p\");\n removeAll(\"a\");\n removeAll(\"img\");\n\n if( tag == \"RESTART\" ) {\n restart();\n return;\n }\n }\n }\n\n actualDelay = 200;\n // Create paragraph element (initially hidden)\n var paragraphElement = document.createElement('p');\n // Parse and replace\n\n console.log(paragraphText);\n paragraphElement.innerHTML = replaceInternalTags(paragraphText)\n timelineContainer.appendChild(paragraphElement);\n\n customClasses.push(\"texto-historia\");\n // Add any custom classes derived from ink tags\n for(var i=0; i<customClasses.length; i++)\n paragraphElement.classList.add(customClasses[i]);\n\n\n // Fade in paragraph after a short delay\n showAfter(delay, paragraphElement);\n delay += 200.0;\n }\n\n\n // Create HTML choices from ink choices\n story.currentChoices.forEach(function(choice) {\n\n // Create paragraph with choice text\n var paragraphInsideChoice = document.createElement('p');\n paragraphInsideChoice.innerHTML = `${choice.text}`;\n paragraphInsideChoice.classList.add(\"choice-p\");\n // Create paragraph with anchor element\n var choiceAnchorElement = document.createElement('a');\n choiceAnchorElement.innerText = ``\n choiceAnchorElement.classList.add(\"choice-a\");\n choiceAnchorElement.href = '#';\n\n choiceAnchorElement.innerHTML = paragraphInsideChoice.outerHTML;\n choicesContainer.appendChild(choiceAnchorElement);\n\n // Fade choice in after a short delay\n showAfter(delay, choiceAnchorElement);\n delay += 200.0;\n\n // Click on choice\n var choiceAnchorEl = choiceAnchorElement.querySelectorAll(\"p\")[0];\n choiceAnchorEl.addEventListener(\"click\", function(event) {\n setNome();\n\n // Don't follow <a> link\n event.preventDefault();\n\n // Remove all existing choices\n //Limpa texto após a escolha\n removeAll(\"p\");\n removeAll(\"a\");\n removeAll(\"p.choice\");\n\n // Tell the story where to go next\n story.ChooseChoiceIndex(choice.index);\n\n\n // Aaand loop\n continueStory();\n });\n });\n\n // Extend height to fit\n // We do this manually so that removing elements and creating new ones doesn't\n // cause the height (and therefore scroll) to jump backwards temporarily.\n// storyContainer.style.height = contentBottomEdgeY()+\"px\";\n\n// if( !firstTime )\n// scrollDown(previousBottomEdge);\n }", "function layerToggle(e) {\r\n var storytellerButtons = document.getElementsByClassName(\"storyteller-button\");\r\n var eID = e.id;\r\n var eType = eID.substring(0,(eID.length-1));\r\n var eNum = eID.substring((eID.length-1),(eID.length));\r\n var typeArray = arrayLayers[eType];\r\n var eArray = arrayLayers[eType][eNum];\r\n // Click Storytellers button on bottom\r\n if (eID == \"storyteller0\") {\r\n if (!(arrayLayers.storyteller[1].layer.getVisible())) {\r\n for (var key in typeArray) {\r\n if (key != 0) {\r\n typeArray[key].layer.setVisible(true);\r\n document.getElementById(eType + key).classList.remove(\"off\");\r\n document.getElementById(eType + key).classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n else {\r\n for (var key in typeArray) {\r\n if (key != 0) {\r\n typeArray[key].layer.setVisible(false);\r\n typeArray[key].layer.setZIndex(0);\r\n typeArray[key].status = \"initial\";\r\n document.getElementById(eType + key).classList.remove(\"active\");\r\n document.getElementById(eType + key).classList.add(\"off\");\r\n contentLoad(typeArray[0]);\r\n }\r\n }\r\n }\r\n for (var key in typeArray) {\r\n if (key != 0) typeArray[key].layer.getSource().changed();\r\n }\r\n }\r\n // Click any storyteller button on top-left\r\n else if (eType == \"storyteller\") {\r\n if (!(eArray.layer.getVisible())) {\r\n for (var key in typeArray) {\r\n if (key != 0) {\r\n typeArray[key].layer.setVisible(true);\r\n document.getElementById(eType + key).classList.remove(\"off\");\r\n document.getElementById(eType + key).classList.remove(\"active\");\r\n document.getElementById(\"storyteller0\").classList.add(\"active\");\r\n }\r\n }\r\n }\r\n if (!(eArray.status == \"highlight\")) {\r\n for (var key in typeArray) {\r\n if (key != 0) {\r\n typeArray[key].status = \"subdue\";\r\n typeArray[key].layer.setZIndex(0);\r\n }\r\n }\r\n for (var key in storytellerButtons) {\r\n if ((key != \"length\") && (key != \"item\") && (key != \"namedItem\")) storytellerButtons[key].classList.remove(\"active\");\r\n }\r\n eArray.status = \"highlight\";\r\n eArray.layer.setZIndex(1);\r\n contentLoad(eArray);\r\n }\r\n else {\r\n for (var key in typeArray) {\r\n if (key != 0) typeArray[key].status = \"initial\";\r\n }\r\n eArray.layer.setZIndex(0);\r\n contentLoad(typeArray[0]);\r\n }\r\n for (var key in typeArray) {\r\n if (key != 0) typeArray[key].layer.getSource().changed();\r\n }\r\n }\r\n // Click landmark layer button on bottom\r\n else if (eType == \"landmark\") {\r\n if (eNum == 5) {\r\n if (!(eArray.layer[0].getVisible())) {\r\n eArray.layer[0].setVisible(true);\r\n eArray.layer[1].setVisible(true);\r\n }\r\n else {\r\n eArray.layer[0].setVisible(false);\r\n eArray.layer[1].setVisible(false);\r\n }\r\n }\r\n else if (!(eArray.layer.getVisible())) {\r\n eArray.layer.setVisible(true);\r\n }\r\n else eArray.layer.setVisible(false);\r\n }\r\n // Click historical button on bottom\r\n else {\r\n if (eID == \"historical0\") {\r\n if (!(eArray.layer[0].getVisible())) {\r\n for (var key in eArray.layer) eArray.layer[key].setVisible(true);\r\n }\r\n else for (var key in eArray.layer) eArray.layer[key].setVisible(false);\r\n }\r\n else if (!(eArray.layer.getVisible())) {\r\n eArray.layer.setVisible(true);\r\n }\r\n else eArray.layer.setVisible(false);\r\n }\r\n e.classList.toggle(\"active\");\r\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}", "function storiesReceived() {\n let matches = JSON.parse(this.responseText);\n let list = document.getElementById(\"matches\");\n for (key in matches) {\n let match = matches[key];\n let button = document.createElement(\"button\");\n button.setAttribute('class', 'story');\n button.setAttribute('onclick', \"window.location.href='../pages/story.php?id=\" + match.id + \"'\");\n button.innerHTML = '<p> Story </p><h1>' + match.title + '</h1>';\n\n list.appendChild(button);\n }\n}", "function buttons() {\n fill(74, 77, 81);\n noStroke();\n rect(butX, butY, 220, 50, 10);\n rect(butX + 250, butY, 220, 50, 10);\n fill(255);\n textSize(20);\n textStyle(NORMAL);\n textAlign(LEFT);\n text(\"Yes, definitely!\", butX + 40, butY + 30);\n text(\"No, not feeling it\", butX + 285, butY + 30);\n}", "function startGame(){\n startPage = '<button class=\"btn startBtn btn-primary btn-lg\"id=\"start\">START</button>';\n $('.startDiv').html(startPage);\n openningText = '<div class=\"panel-default text-center\" id=\"questionArea\"><h2 id=\"title\"></h2><div class=\"row text-center\"><div class=\"col-xs-offset-1 col-xs-10\"><h3 id=\"questiontext\"></div>'\n $('.questionDiv').html(openningText);\n $('#title').text('Test your knowledge of the hit TV show!');\n $('#questiontext').text('Hit the start button below to get going');\n\n}", "function level1Morocco(){\n console.log(title);\n title.innerHTML = \"Morocco\";\n description.innerHTML = \"You choose to go to Morocco! How do you want to travel to Morocco?\";\n image.src = \"img/planeship.jpg\";\n button1.innerHTML = \"By ship\";\n button2.innerHTML = \"By plane\";\n button3.innerHTML = \"By car\";\n button1.setAttribute(\"onclick\", \"shipMar()\");\n button2.setAttribute(\"onclick\", \"planeMar()\");\n button3.setAttribute(\"onclick\", \"gameOver13()\");\n document.getElementById(\"button3\").style.display = \"inline\";\n}", "function Story(div, pop)\t\t\t\t\t\t\t\t\t\t\t\t// CONSTRUCTOR\n{\n\tvar _this=this;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Save context\n\tthis.div=\"#\"+div;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Current div selector\n\tthis.pop=pop;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Point at popup lib\n\tthis.storyMode=\"Scrolled\";\t\t\t\t\t\t\t\t\t\t\t\t// Story mode\n\tthis.curPage=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Current page\n\tthis.pages=[];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Holds page indices\n\n\t$(\"body\").keydown(function(e) {\t\t\t\t\t\t\t\t\t\t\t// KEY DOWN HANDLER\n\t\tif ((e.keyCode == 40) ||(e.keyCode == 34)) \t\t\t\t\t\t\t// Down arrow, pg-dn\n\t\t\t$(\"#nextPage\").trigger(\"click\");\t\t\t\t\t\t\t\t// Click next button\n\t\telse if ((e.keyCode == 38) || (e.keyCode == 33)) {\t\t\t\t\t// Up arrow, pg-up\n\t\t\tif (_this.curPage == 0) {\t\t\t\t\t\t\t\t\t\t// At end\n\t\t\t\tpop.Sound(\"delete\",curJson.muteSound);\t\t\t\t\t\t// Delete sound\n\t\t\t\treturn;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Quit\n\t\t\t\t}\n\t\t\t_this.curPage=Math.max(_this.curPage-1,0);\t\t\t\t\t\t// Dec\n\t\t\t$(\"#storyDiv\").html(_this.DrawStoryItem(_this.pages[_this.curPage]));\t// Set new page\n\t\t\t$(\"#pageSel\").prop(\"selectedIndex\",_this.curPage);\t\t\t\t// Change select\n\t\t\tpop.Sound(\"click\",curJson.muteSound);\t\t\t\t\t\t\t// Click sound\n\t\t\t}\n\t});\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 updateTutorial() {\n var space = document.getElementById('spaceImage');\n var enter = document.getElementById('enterImage');\n\n if (textIndex == 0) {\n document.getElementById('tutorialText').innerHTML = 'This game consists of two buttons at the bottom of the page';\n textIndex++;\n } else if (textIndex == 1) {\n document.getElementById('tutorialText').innerHTML = 'This button is used for the dots and can be accessed through the space button or by clicking here!';\n document.getElementById('dotButton').style.backgroundColor = \"yellow\";\n space.style.display = \"block\";\n textIndex++;\n } else if (textIndex == 2) {\n document.getElementById('dotButton').style.backgroundColor = document.getElementById('dashButton').style.backgroundColor;\n document.getElementById('tutorialText').innerHTML = 'This button is used for the dashes and can be accessed through the enter button or by clicking here!';\n document.getElementById('dashButton').style.backgroundColor = \"yellow\";\n space.style.display = \"none\";\n enter.style.display = \"block\";\n textIndex++;\n } else if (textIndex == 3) {\n document.getElementById('dashButton').style.backgroundColor = document.getElementById('dotButton').style.backgroundColor;\n document.getElementById('tutorialText').innerHTML = 'Enter the correct Morse Code shown here!';\n document.getElementById('sampleMorseCode').style.color = document.getElementById('dotButton').style.backgroundColor;\n enter.style.display = \"none\";\n textIndex++;\n } else if (textIndex == 4) {\n // change this in your tutorials to change the color of the divs\n document.getElementById('sampleMorseCode').style.color = document.getElementById('dotButton').style.color;\n document.getElementById('tutorialText').innerHTML = 'Enter the correct code and move onto the next number. Have Fun Learning Morse Numbers!';\n textIndex++;\n // change color back to regular\n } else if (textIndex == 5) {\n // changes smaple morse back to normal color\n document.getElementById('sampleMorse').style.color = document.getElementById('dashButton').style.backgroundColor;\n textIndex = 0;\n document.getElementById(\"tutorialMenu\").onMouseDown();\n }\n}", "function aboutGame(){\n\tvar temp=\"\";\n\tvar img=\"\";\n\tvar Title=\"\";\n\t/// if we clicked on about the game formate about game text \n\tif(this.id === 'abutBtn'){\n\t\ttemp =window.gameInformation['abutBtn'];\n\t\timg='\\rrecources\\\\AF005415_00.gif';\n\t\tTitle=\" Game General Information \";\n\n\t}////// if we clicked on about the game formate about auther text \n\telse if(this.id === 'abouMe'){\n\t\ttemp =window.gameInformation['abouMe'];\n\t\timg='\\rrecources\\\\viber_image_2019-09-26_23-29-08.jpg';\n\t\tTitle=\" About The Auther\";\n\t}// formatting Text For Instructions\n\telse if(this.id === 'Instructions')\n\t{\n\t\ttemp =window.gameInformation['Instructions'];\n\t\timg='\\rrecources\\\\keyboard-arrows-512.png';\n\t\tTitle=\" Instructions\";\n\t}\n\n\t// create the dialog for each button alone\n\tcreatDialog(Title , temp ,img,300 );\n\t\n}", "function EachStory (props) {\n const handleClick = () => {\n props.setCurrent(props.ctr);\n props.setModal(true);\n }\n return (\n <div className=\"entire\" onClick={handleClick}>\n <img src={props.storyImg} className=\"image\" alt=\"storyimage\" />\n <div className=\"author\">\n <img src={require(\"../images/user.png\").default} className=\"user\" alt=\"userimage\" />\n </div>\n <div className=\"author2\"><span><strong>{props.userPosted}</strong></span></div>\n </div>\n );\n}", "function concept() {\r\n let concept = $(\"#concepts\").val();\r\n let chapters = $(\"#chapters\").val();\r\n\r\n if(chapters == \"top\"){\r\n $(\"#text\").html(\" \");\r\n } else if(chapters == \"2\"){\r\n if (concept === \"1\") {\r\n $(\"#text\").html(\r\n \"Local Conditions: </br></br> Heating demand is given in heating degree-days. \" +\r\n \"The length of a Canadian heating season is the number of days below 18&#8451. Coldness is the difference between a\" +\r\n \" desired indoor temperature of 20&#8451 and the average outdoor temperature on those days </br></br>\" +\r\n \"Humidity and especially windiness of a location also add to heating demand but are discussed elsewhere.</br></br>\" +\r\n \"Warmer climates imply a cooling load: also a subject for other chapters.</br></br>\" +\r\n \"Please note that to reflect the Canadian experience, this App mixes units: Celsius for temperature, for example, but inches for dimensions\"\r\n );\r\n } else if (concept === \"2\") {\r\n $(\"#text\").html(\r\n \"Annual Energy Budget:</br></br>Envelope heat loss is only part of an energy budget. Lights, hot water appliances \" +\r\n \"and electronics also consume energy. In this chapter those other loads are fixed, on the assumption that use of the building remains \" +\r\n \"constant in all locations.</br></br>Envelope heat loss has at least two components: the effectively conductive losses that can be \" +\r\n \"reduced by insulation, and lossed due to ventilation and drafts. Both are proportional to heat demand. Looking at the Energy Budget\" +\r\n \" Graph, you will see that changing the insulation levels changes the conductive or insulation losses but not those due to air movement.\"\r\n );\r\n } else if (concept === \"3\") {\r\n $(\"#text\").html(\r\n \"Drafts and Ventilation:</br></br>Realistically, a larger window would admit more drafts, especially at the lower end of \" +\r\n \"the quality scale, but that effect is ignored in the insulation chapter.</br></br>The Drafts and Ventilation chapter explains how energy\" +\r\n \" losses due to infiltration are controlled by membranes, sealants, joint design, and meticulous quality control. It shows how\" +\r\n \" ventilation losses can be managed through heat exchange, flow controls, and careful use of operable windows and vents.\"\r\n );\r\n } else if (concept === \"4\") {\r\n $(\"#text\").html(\r\n \"Insulation and Heat Loss:</br></br>In North America, thermal resistance is measured in R-Values. The resistance\" +\r\n \" of a material barrier is a product of its resistivity, in R/inch, and the inches of thickness. The actual effectiveness of insulation \" +\r\n \"depends on other factors, but this app gives drywall an R/inch of 1, fiberglass and cellulose insulation an R/inch of 3, and urethane \" +\r\n \"spray foam an R/inch of 6.</br></br>In thin and poorly insulating assemblies, air films become significant. This is how painted sheet \" +\r\n \"steel ends up with a nominal R of 1. When assemblies are layered, R values can simply be totalled.\"\r\n );\r\n } else if (concept === \"5\") {\r\n $(\"#text\").html(\r\n \"Materials and Insulation</br></br>Heat flow is inversely related to thermal resistance. The conduction of heat through \" +\r\n \"a material is given as a U value, which is equal to 1/R. Add layers into a single R value before finding their U value.</br></br>\" +\r\n \"Heat loss is a product of thermal demand and conductive liability. Thermal demand consolidates temperature differemce and time, as \" +\r\n \"in degree days. Thermal liability is a product of surface area and conductance</br></br>The total thermal liability of an envelope \" +\r\n \"is a sum of the liability of its portions. Average conductance divides the total liability by the total area. The effective R-value \" +\r\n \"of an envelope is the inverse of average conductance.</br></br>Note that high R-value portions of an envelope have a smaller effect on \" +\r\n \"the effective R-value than might be supposed. Conversely, low-R-value portions of an envelope such as windows have a larger effect on over\" +\r\n \"all heat loss than their small area may suggest.\"\r\n );\r\n } else if (concept === \"6\") {\r\n $(\"#text\").html(\r\n \"Environmental Impact</br></br>The environmental impact of construction depends not only on the energy consumed in operating \" +\r\n \"a building, but in the energy consumed or 'embodied' in the material through sourcing, manufacture, transport, and assembly. Additionally, tox\" +\r\n \"ins and other ecological and social injuries need to be accounted for. The exact calculations are complicated and debatable, but that's no reas\" +\r\n \"on to ignore them. They are the subject of several other chapters.\"\r\n );\r\n }\r\n}\r\n}", "function TopicMenu(jsonData, gameObjects) {\n\tvar canvas = document.getElementById('main-canvas');\n\tvar ctx = canvas.getContext('2d');\n\tvar transition = -1;\n\tvar selectedIndex = -1;\n\t\n\t// Add button for each json file.\n\tvar buttons = [];\n\tctx.font = \"20px Arial\";\n\tfor(var i in jsonData) {\n\t\tbuttons.push(new Button(jsonData[i].category+\": \"+jsonData[i].datasetName, {x:canvas.width/2, y:30+(i*40)}, \n\t\t\t{w:ctx.measureText(jsonData[i].category+\": \"+jsonData[i].datasetName).width+140, h:30}, \n\t\t\t\"yellow\", \"black\", \"orange\", \"20px Airstrike\"));\n\t}\n\t\n\tvar lanes = [];\n\tfor(var i=0; i<4; i++)\n\t\tlanes.push(new Lane(i+1, {x:0, y:canvas.height-208+(i*52)}, {width:canvas.width, height:50}, \"\"));\n\t\t\n\tvar blackRects = gameObjects.blackRects;\n\tvar trees = gameObjects.trees;\n\tvar clouds = gameObjects.clouds;\n\tvar speed = 1;\n\t\t\n\tthis.getObjects = function() {\n\t\treturn {trees: trees, blackRects: blackRects, clouds: clouds};\n\t};\t\n\t\n\tvar selectedTopic = -1;\n\t\n\tvar keys = new KeyListener();\n\tvar keyCodes = {\n\t\tSPACE: 32,\n\t\tUP: 38,\n\t\tDOWN: 40\n\t};\n\tkeyBurns = {}; // key burnouts - (which key, how much longer)\n\t\n\t\n\t/* UPDATE */\n\n\tthis.update = function() {\n\t\t// Update menu selection if up/down is pressed.\n\t\thandleKeyInput();\n\t\t// Update scrolling elements.\n\t\tupdateAesthetics;\n\t};\n\t\t// Update menu selection if up/down is pressed.\n\t\tfunction handleKeyInput() {\n\t\t\tif(keys.isPressed(keyCodes.DOWN) && !(\"DOWN\" in keyBurns) && selectedTopic < jsonData.length-1)\n\t\t\t\thandleDown();\n\t\t\telse if(keys.isPressed(keyCodes.UP) && !(\"UP\" in keyBurns))\n\t\t\t\thandleUp();\n\t\t\tif(keys.isPressed(keyCodes.SPACE) && !(\"SPACE\" in keyBurns) && selectedTopic != -1)\n\t\t\t\thandleSpace();\n\t\t\tfor(var i in keyBurns) {\n\t\t\t\tkeyBurns[i]--;\n\t\t\t\tif(keyBurns[i] == 0)\n\t\t\t\t\tdelete keyBurns[i];\n\t\t\t}\n\t\t}\n\t\t\t// Select next topic.\n\t\t\tfunction handleDown() {\n\t\t\t\tselectedTopic++;\n\t\t\t\tfor(var i in buttons)\n\t\t\t\t\tbuttons[i].unhighlight();\n\t\t\t\tbuttons[selectedTopic].highlight();\n\t\t\t\tkeyBurns[\"DOWN\"] = 10;\n\t\t\t}\n\t\t\t// Select previous topic.\n\t\t\tfunction handleUp() {\n\t\t\t\tselectedTopic = Math.max(0, selectedTopic-1);\n\t\t\t\tfor(var i in buttons)\n\t\t\t\t\tbuttons[i].unhighlight();\n\t\t\t\tbuttons[selectedTopic].highlight();\n\t\t\t\tkeyBurns[\"UP\"] = 10;\n\t\t\t}\n\t\t\t// Start game.\n\t\t\tfunction handleSpace() {\n\t\t\t\ttransition = GO_TO_GAME;\n\t\t\t\tselectedIndex = selectedTopic;\n\t\t\t}\n\t\t\t\n\t\t// Update scrolling elements.\n\t\tfunction updateAesthetics() {\n\t\t\tfor(var i in blackRects)\n\t\t\t\tblackRects[i].update(speed*5);\n\t\t\tfor(var i in trees)\n\t\t\t\tif(trees[i].update(speed*5))\n\t\t\t\t\ttrees.sort(function(a,b){return a.pos().y-b.pos().y;});\n\t\t\tfor(var i in clouds)\n\t\t\t\tclouds[i].update(speed*.4);\n\t\t}\n\t\n\t\n\t/* DRAW */\n\t\n\tthis.draw = function() {\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\t// Draw world.\n\t\tdrawWorld();\n\t\t// Draw scrolling elements.\n\t\tdrawAesthetics();\n\t\t// Draw buttons.\n\t\tdrawUI();\n\t};\n\t\t// Draw world.\n\t\tfunction drawWorld() {\n\t\t\tctx.rect(0, 0, canvas.width, canvas.height/3);\n\t\t\tvar grdSky = ctx.createLinearGradient(canvas.width/2, 0, canvas.width/2, canvas.height/3);\n\t\t\tgrdSky.addColorStop(0, \"#0052cc\");\n\t\t\tgrdSky.addColorStop(1, \"#0099cc\");\n\t\t\tctx.fillStyle = grdSky;\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\n\t\t\t\n\t\t\tctx.rect(0, canvas.height/3, canvas.width, 2*canvas.height/3);\n\t\t\tvar grdGround = ctx.createLinearGradient(canvas.width/2, canvas.height/3, canvas.width/2, 2*canvas.height/3);\n\t\t\tgrdGround.addColorStop(0, \"green\");\n\t\t\tgrdGround.addColorStop(1, \"#003300\");\n\t\t\tctx.fillStyle = grdGround;\n\t\t\tctx.fillRect(0, canvas.height/3, canvas.width, canvas.height/3);\n\t\t}\n\t\t\n\t\t// Draw scrolling elements.\n\t\tfunction drawAesthetics() {\n\t\t\tctx.fillStyle = \"white\";\n\t\t\tctx.fillRect(0, canvas.height-210, canvas.width, 210);\n\t\t\tfor(var i in lanes)\n\t\t\t\tlanes[i].draw(ctx);\n\t\t\t\t\n\t\t\tfor(var i in blackRects)\n\t\t\t\tblackRects[i].draw(ctx);\n\t\t\t\t\n\t\t\tfor(var i in trees)\n\t\t\t\ttrees[i].draw(ctx);\n\t\t\t\t\n\t\t\tfor(var i in clouds)\n\t\t\t\tclouds[i].draw(ctx);\n\t\t}\n\t\t// Draw buttons.\n\t\tfunction drawUI() {\n\t\t\tfor(var i in buttons)\n\t\t\t\tbuttons[i].draw(ctx);\n\t\t}\n\t\n\t/* PUBLIC METHODS */\n\t\n\tthis.getTransition = function() {\n\t\treturn transition;\n\t};\n\t\n\tthis.getSelectedIndex = function() {\n\t\treturn selectedIndex;\n\t};\n\t\n\t/* MOUSE EVENT FUNCTIONS */\n\t\n\t// Returns mouse position, records click type.\n\tfunction getMousePos(evt) {\n \tvar rect = canvas.getBoundingClientRect();\n \t\n \treturn {\n \t\tx: Math.floor(evt.clientX - rect.left),\n \t\ty: Math.floor(evt.clientY - rect.top)\n \t};\n }\n \n // Handles checks/effects for mouse movement.\n function mouseMove(mousePos) {\n\t\tfor(var i in buttons) {\n\t\t\tif(buttons[i].pointWithin(mousePos))\n\t\t\t\tbuttons[i].highlight();\n\t\t\telse if(buttons[i].isHighlighted)\n\t\t\t\tbuttons[i].unhighlight();\n\t\t}\n }\n\t\n\t// Handles checks/effects of click down.\n\tfunction mouseDown(mousePos) {\n\t}\n\t\n\t// Handles checks/effects of click release.\n\tfunction mouseUp(mousePos) {\n\t\tfor(var i in buttons) {\n\t\t\tif(buttons[i].pointWithin(mousePos)) {\n\t\t\t\ttransition = GO_TO_GAME;\n\t\t\t\tselectedIndex = i;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Creates, adds mouse event handlers (above).\n\tfunction down(evt){mouseDown(getMousePos(evt));}\n\tfunction move(evt){mouseMove(getMousePos(evt));}\n\tfunction up(evt){mouseUp(getMousePos(evt));}\n canvas.addEventListener('mousedown', down, false);\n\tcanvas.addEventListener('mousemove', move, false);\n\tcanvas.addEventListener('mouseup', up, false);\n}", "function loadAllText() {\n\n scenarioRooms = adventureManager.states;\n resultsRooms = adventureManager.states;\n\n scenarioRooms[one].setText(\"Where to?\", \"You just lost the lease on your apartment. Where are you moving to?\");\n scenarioRooms[two].setText(\"Should you stay or should you go?\", \"You are looking for an apartment in Manhattan. However, since you do not already have OneWay installed into your body, the lifestyle is troublingly incompatible with your needs. You struggle to even submit a rental application without OneWay, let alone get in touch with real estate agents. What do you want to do?\");\n scenarioRooms[three].setText(\"Software update\", \"You bought OneWay and managed to secure a spot in Manhattan. BigInc has just released a software upgrade that cost nearly as much as the installation itself. This update will put you in deep debt, but is the only way to stay compatible with the technology in Manhattan. What do you do?\");\n resultsRooms[four].setText(\"Yikes\", \"You paid for the update in order to keep OneWay compatible. But, now you are very broke. You can’t even afford your current rent. You try to seek support from the government, but you do not qualify for any aid because having OneWay puts you in the highest bracket of income. You now have the most current technology, but are homeless.\");\n resultsRooms[five].setText(\"Congratulations\", \"You have left what is left of New York. You have escaped the pressure of Big Inc. For now that is…..\");\n scenarioRooms[six].setText(\"Should you stay or should you go?\", \"You are on Staten Island. In order to seek residency, you must commit to an anti-technology oath. The purists have banned all forms of smart devices and have reverted to pre-internet times of living in fear of the evolution of technology. Stay or go someplace else?\");\n scenarioRooms[seven].setText(\"Welcome to Staten Island\", \"You’ve decided to stay on Staten Island. You are having trouble getting accustomed to the tech-free lifestyle and you feel a lot of social pressure from the community on where you stand in response to BigInc taking over NYC. What do you do?\");\n resultsRooms[eight].setText(\"Yikes\", \"You have decided to commit the Purists, but have chosen the side of a losing battle. Your own community has started to lose faith in the cause, resulting in leadership taking unethical actions to keep the community pure. Naturally the community becomes corrupt and loses many members to BigInc.\");\n scenarioRooms[nine].setText(\"In or out?\", \"Big Inc just bought out abandoned buildings all over Brooklyn with plans to convert them to luxury apartments, OneWay compatible apartments with the hopes of inviting other wealthy communities to join their society. If you have OneWay installed, you’ll have the chance to be a part of the extended community and get in early at an up and coming area.\");\n scenarioRooms[ten].setText(\"Software update\",\"You bought OneWay and have been living in a poor quality building while waiting for your spot in the up and coming luxury apartments. BigInc has just released a software upgrade that cost nearly as much as the installation itself. This update will put you in deep debt, but is the only way to secure your spot on the waitlist. What do you do?\");\n resultsRooms[eleven].setText(\"Yikes\", \"The building you are currently living in just got bought out by BigInc. They are doing a complete remodel and kicking out all of the current residents. You can’t afford to live anywhere in Brooklyn anymore. You try to seek support from the government, but you do not qualify for any aid because having OneWay puts you in the highest bracket of income. You now have an outdated form of OneWay and are homeless.\");\n scenarioRooms[twelve].setText(\"In or out?\", \"The building you were living in just got bought out by BigInc. OneWay has taken over all of Brooklyn, displacing its current residents onto the streets. You feel like your only choices are to buy OneWay or leave NYC. What do you do?\");\n\n}", "function narrative(script, image, buttonName, buttonClick,heal=false,mandatory=false){\n\n var buttonClickFunction = \"\";\n\n //If the narrative includes a heal, add heal to the function the button will execute\n if(heal){\n buttonClickFunction = \"heal();\";\n };\n\n //Append the function this narrative performs to be added to the button\n buttonClickFunction = buttonClickFunction.concat(buttonClick);\n\n //Setup the image\n var elem = document.createElement(\"img\");\n elem.src = image; //Source equal to input\n elem.id = \"page-image\";\n\n //Add the image to page\n document.getElementById(\"game-div\").appendChild(elem);\n\n //Setup the narrative text\n var para = document.createElement(\"P\");\n var text = document.createTextNode(script);\n para.appendChild(text);\n\n //Add the text to page\n document.getElementById(\"game-div\").appendChild(para);\n\n //Setup the button\n var button = document.createElement(\"input\"); //Buttons are inputs\n button.type = \"button\" //Make it a button\n button.setAttribute('class', 'button'); //Add the class for button formatting\n button.setAttribute('value',buttonName); //Set the text in the button\n button.setAttribute('onClick', buttonClickFunction); //Set the code it runs\n\n //Add the button to page\n document.getElementById(\"game-div\").appendChild(button);\n\n //If this is a mandatory battle\n if(mandatory){\n //Load battle settings data\n battleSettings = JSON.parse(localStorage.getItem('battleSettings'));\n //Set battlesettings to mandatory\n battleSettings.mandatory = true\n localStorage.setItem('battleSettings', JSON.stringify(battleSettings));\n\n\n }\n}", "function createStory(randFunction) {\n\n let storyAdjective = returnRand(adjectives);\n let storyNoun1 = returnRand(noun1);\n let storyNoun2 = returnRand(noun2);\n let storyVerb = returnRand(verbs);\n\n randFunction(storyNoun1,storyNoun2, storyAdjective, storyVerb);\n}", "function theMan(){\n\tstory(\"You are wandering along a sidewalk at midnight in near pitch black with only streetlights illuminating the path that you have chosen. You have plenty of time that you would want to waste but out of the corner of your eye you see a shadow of a man leaning against a building asking you to go talk with him. What do you want to do?\");\n\tchoices = [\"Walk Away\", \"Walk to him\", \"Call the police\"];\n\tanswer = setOptions(choices);\n}", "function welcome() {\r\n var t = \"<div class='container'>\\\r\n\t\t\t\t<h1 class='spin'>The Oregon Trail!</h1>\\\r\n\t\t\t\t<div id='innerPage'>\\\r\n\t\t\t\t<button class='button button2' onclick='getOccupation()'><span>Travel the Trail</span></button><br>\\\r\n\t\t\t\t<button class='button button2' onclick ='getInfo()'><span>Learn About the Trail</span></button><br>\\\r\n\t\t\t\t<button class='button button2' onclick='displayScores()'><span>Top 10 Players</span></button><br>\\\r\n\t\t\t\t<button id='sound' class='button button2' onclick='toggleSound()'><span>Turn Off Sound</span></button><br>\\\r\n\t\t\t\t<button class='button button2' onclick='quit()'><span>Quit</span></button><br>\\\r\n\t\t\t\t</div>\\\r\n\t\t\t</div>\";\r\n document.getElementById(\"main\").innerHTML = t;\r\n}", "function policeShowUp(){\n\tstory(\"You chose to talk with the guy HOW WISE, you guys have a good 30 minute conversation about your favorite sports teams and the sports you like the best before the cops show up\");\n\tchoices = [\"Act like you know the guy\", \"Wake up from a dream\", \"Have a nightmare of the man\"];\n\tanswer = setOptions(choices);\n}", "function loadAllText() {\n // go through all states and setup text\n // ONLY call if these are ScenarioRoom\n \n// copy the array reference from adventure manager so that code is cleajer\n scenarioRooms = adventureManager.states;\n\n scenarioRooms[startScreen].setText(\"Who's the primary Market?\", \"This is a new device you created that is able to project a person’s thoughts as a visual interpretation to others. It offers a new way of communicating to others. You’re about to launch this new technology, but you must choose the primary market, who do you choose?\");\n scenarioRooms[governScreen].setText(\"Where to start?\", \"The local government wants to test out your product. They’re asking you which session \");\n scenarioRooms[secureScreen].setText(\"Good News\", \"The local government does a test run on the Thoughtfull and it does well in the trial run. Now they offer to expand out towards international government relations. They want to start using it as a device to help aid in meetings between nations inorder to propose new ideas. However; the team you're in contact with is concerned that there are flaws in the security protocol within your system. \");\n scenarioRooms[endOneScreen].setText(\"Ending One\", \"By ignoring the request, something goes wrong during the meeting. The head set gets hacked and you are seen as a potential threat to the country. The nations at the meeting are now on bad terms and the US has now lost trading relations with some countries.\");\n scenarioRooms[endTwoScreen].setText(\"Ending Two\", \"By hiring the team of security experts, you not only met the needs of their request, but you also protect against any possible means of sabotage that could occur during the meeting. You are well conpensated for your product and sell it to the government to use now\");\n scenarioRooms[eduScreen].setText(\"Pick an Age Group\",\"Which age group would you like to invest into?\");\n scenarioRooms[eduUpperScreen].setText(\"Extended Features\",\"Device is being mainly used and tested within a group dynamic. More students feel more encouraged to participate in group projects and feel more productive. However; they express how they would like for more features geared towards group related tasks to be included. For example, a way to download previous thought projections and save them to a local computer.\");\n scenarioRooms[eduLowerScreen].setText(\"Extended Features\", \"Device is being used within the classroom as a way to develop better understandings on certain topics discussed in class and as a way to stimulate creativity. The kids are enjoying it, but they express that the headset itself is a little bit restrictive and want the head set to be more free moving.\")\n scenarioRooms[eduLowerAddScreen].setText(\"Additional Extended Features\", \"Additionally primary schools are saying that the UI is a little bit hard for the younger kids to understand. They're asking for there to be a friendlier UI for the kids to interact with\");\n scenarioRooms[budgetScreen].setText(\"Budget Problems\", \"Sponsors are complaining that you’re not making enough money with the headset devices. They suggest to move over to a paid model service that limits functionality and uses curated user ads.\");\n scenarioRooms[sellScreen].setText(\"Ending Three\", \"You sell to a randomly selected company. Because there was no other features added to the base model, the unreliable company you chose uses it to perform illegal activities. When they eventually get caught they put all the fall on you.\");\n scenarioRooms[adScreen].setText(\"Ending Four\", \"Target market no longer can afford your device, now it’s marketed as a tech toy by the upper elite class that stops being relevant by the time another new gadget is introduced.\");\n scenarioRooms[keepScreen].setText(\"Keep the Current Model\", \"By leaving the current model as it is, the budget has become tighter than before. By not implementing a paid model you have to make budget cuts elsewhere.\");\n scenarioRooms[salaryScreen].setText(\"Ending Five\", \"Staff is starting to leave, unpaid interns are not motivated in putting countless hours into working for barely any benefits. As a result the quality of the code drops and version deployments are constantly delayed with bugs.\");\n scenarioRooms[productScreen].setText(\"Cut Production Costs\", \"You went with cutting production costs, as a result the device keeps breaking and becomes a potential hazard to wearers. Malfunctioning hardware is stirring up concern in the mothers anonymous forum especially. In the next week a rumor starts circulating that your company is intentionally causing harm to their children's brains. They demand you recall the product\");\n scenarioRooms[rumorScreen].setText(\"Ending Six\", \"You make a statement about the rumors and take full responsibility for the drop in performance. You personally start putting hours to fix the technology. You release the newer safer model under a different name and sell it to a respectable organization where it is a hit. You get no money compensation for the work and have to remain off the grid the rest of your life after your controversy.\");\n scenarioRooms[ignoreScreen].setText(\"Ending Seven\", \"You ignore the rumors and don’t address them. The mother’s association sues your product for potentially harming their children. You lose the case and are bared from ever working in the industry again.\");\n scenarioRooms[sellAltScreen].setText(\"Ending Eight\", \"You sell the device to another company, but because of the attention you added for the educational features, the technology is able to be reused in a similar area of impact. They get an award and you are credited for the base model, earning a small sum in prize money.\")\n}", "function loadMenuButtons(){\n texts = [];\n texts.push(new Text(WIDTH/2, HEIGHT/25, WIDTH/6, \"OCTE\", -WIDTH/10, false));\n //texts.push(new Text(WIDTH/2, HEIGHT*0.2, WIDTH/50, \"(overly complicated tennis experience)\", -WIDTH/10, false));\n buttons = [];\n buttons.push(new Button(WIDTH/2, HEIGHT/2 - HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"1player\", \"1 PLAYER\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"2player\", \"2 PLAYERS\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"options\", \"OPTIONS\", 0, {}));\n}", "function showAbout(button){\n\t\n\tremoveAllFromDiv(containerDiv);\n\t\n\tvar paragraph = document.createElement('p');\n\tparagraph.setAttribute(\"class\", \"infoParagraph\");\n\t\n\tcontainerDiv.appendChild(paragraph);\n\tcontainerDiv.className=\"startContainer\";\n\t\n\tif(button === \"start\"){\n\t\tresetWindow();\n\t}\n\telse if(button === \"work\"){\n\t\t// Stops focus on the \"Work\" button\n\t\tdocument.getElementById('header-workBtn').blur();\n\t\t\n\t\tparagraph.id = \"workParagraph\";\n\t\tparagraph.innerHTML = \"The goal of this project is to promote the pomodoro technique. The pomodoro technique is a work process that involves focusing on one task in intervals ranging from 15 to 30 minutes long while taking 5- or 10-minute breaks at the end of each work period. This time-boxed reward mechanism allows someone to work in small bursts and recharge or renew their focus in between.\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"<br/><br/>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"We have included a timer that allows users to work in 15 or 30 minute time intervals, as these have generally been accepted to be appropriate blocks. The user also has the option of taking a 5- or 10-minute break. At the end of the work block timer, the user will be presented with a couple of games that they may choose to play during their allotted break time.\";\n\t}\n\telse if(button === \"break\"){\n\t\t// Stops focus on the \"Break\" button\n\t\tdocument.getElementById('header-breakBtn').blur();\n\t\t\n\t\tparagraph.id = \"breakParagraph\";\n\t\tparagraph.innerHTML = \"<span id=\\\"tetrisHeader\\\" class=\\\"paraHeader\\\">Tetris</span>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"<br/>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"The objective of Tetris is to create a horizontal line of ten units without gaps by strategically rearranging falling tetriminos under a limited time. Once the horizontal line is created, it is eliminated and all other remnants above it fall down to the current height. As the games progresses, the tetriminos begin to fall faster and the game is finished when the stack of tetriminos reaches the top. Players use the directional arrow keys to rotate and move the tetriminos.\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"<br/><br/>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"<span id=\\\"snakeHeader\\\" class=\\\"paraHeader\\\">Snake</span>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"<br/>\"\n\t\t\t\t\t\t\t\t\t\t\t+ \"Snake is a game in which you control the constantly-moving snake to collect rats and grow with every bite! For every 10 rats, the snake will move faster across the field. Be careful though! Make sure not to run into yourself or hit any walls! \";\n\t}\n\telse\n\t{\n\t\talert(\"Error with showing: \" + button);\n\t}\n}", "function Story(options) {\n\toptions = options || {};\n\tthis.wiki = options.wiki || $tw.wiki;\n\tthis.storyTitle = options.storyTitle || \"$:/StoryList\";\n\tthis.historyTitle = options.historyTitle || \"$:/HistoryList\";\n}", "function myStory(text, numDiv){\n $('<p>'+text+'</p>').appendTo(numDiv);\n }", "function addPopup(text,x,y,cutout,name=\"popup\") {\n interface.buttonArray.forEach(function (elem) {\n if (elem.name === \"animal_image\") {\n var currIndex = ui_values.animalAry.indexOf(ui_values.currentAnimal);\n var src = ui_values.animalStaticAry;\n elem.setSrc(src[currIndex], src[currIndex], false);\n }\n });\n\tvar button = new Button(function() {\n\t switch(true){\n\t case(dataObj.tutorialProgress == 0):\n\t addPopup(\"It's your first time here,\\nso I'm going to show\\nyou around the place!\",100, 40);\n\t interface.draw();\n\t break;\n\t case(dataObj.tutorialProgress == 1):\n\t addPopup(\"This is your Nature\\nJournal.\",150, 90);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 2):\n addPopup(\"Here on the left\\npage, you can\\ncall animals to explore\\nthe world.\",150, 90,[20,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 3):\n addPopup(\"On the right\\npage, you can\\nsee your animals as\\nthey explore.\",700, 90,[514,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 4):\n addPopup(\"Your Nature Journal\\nuses two currencies,\\nsteps and tracks.\",150, 90,[71,25,410,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 5):\n addPopup(\"These are your Steps.\\nYou get these by walking\\naround with your Fitbit\\nand are used to call animals.\",71, 90, [143,25,113,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 6):\n addPopup(\"These are your Tracks.\\nYour animals make these\\nas they explore. You will\\nuse tracks to upgrade\\nyour animals.\",240, 90, [282,27,175,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 7):\n addPopup(\"There are four different\\nanimal types you can\\ncall to travel the world.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 8):\n addPopup(\"Each has their own\\nstrengths and\\nweaknesses.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 9):\n addPopup(\"You can add an animal\\nby selecting its icon\\nabove, then clicking\\nthe button to the right.\",60, 250, [283,399,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 10):\n addPopup(\"Let's send out\\na new animal so we\\ncan continue!\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 11):\n addPopup(\"Choose wisely! This animal\\nwill be with you for your\\nentire nature walk.\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 13):\n addPopup(\"Your animals will face\\na number of harrowing\\nchallenges. Those events\\nwill be shown here.\",300, 200, [533,25,445,207]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 14):\n addPopup(\"Your animal has three\\nstatistics that it will\\nuse to overcome these\\nchallenges.\",260, 220,[72,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 15):\n addPopup(\"Speed, Evasion, and\\nStrength.\",260, 215,[73,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 16):\n addPopup(\"You can increase your \\nanimal's statistics with \\ntracks via the\\nupgrade button.\",250, 300, [63,400,124,50]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 17):\n addPopup(\"Failing these challenges \\ncould slow down, or even \\nkill your animals, so level\\nthem up when you can.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 18):\n addPopup(\"You can select your\\nanimals by clicking on \\ntheir icons down \\nhere.\",150, 300, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 19):\n addPopup(\"Try selecting your\\nfirst animal.\",250, 400, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 21):\n addPopup(\"You can upgrade animals\\nin two ways.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 22):\n addPopup(\"You can upgrade\\nindividual animals or the\\nbase level of animals.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 23):\n addPopup(\"Upgrading individuals\\nis cheaper, but if they\\nleave or die you will have\\nto level them up again\\nfrom the base.\",250, 300, [94,450,52,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 24):\n addPopup(\"Upgrading the base\\nlevel changes what level\\nyour animals start at,\\neven through death.\",250, 150,[84,114,71,71]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 25):\n addPopup(\"Keeping a healthy balance\\nof the two will keep your\\nanimals collecting as long\\nas possible.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n \n case(dataObj.tutorialProgress == 26):\n addPopup(\"Right now you can have\\na maximum of five\\nanimals, and each animal\\nwill only walk with you\\nfor 24 hours before leaving\",250, 300, [83,450,320,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 27):\n addPopup(\"But keep exploring and\\nyou will be able to\\nhave more than five!\",300, 250);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 28):\n addPopup(\"Speaking of exploring,\\nyour animals are walking\\nthrough what's called\\nan area.\",700, 300,[600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 29):\n addPopup(\"If you keep collecting \\nsteps with your Fitbit\\nyou'll unlock more areas.\",700, 300, [600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n //Here are 4000 more steps to get you there. You can call more animals with these. \n //When you get to a certain number of steps, this arrow will advance you to the next area. Click it!\n case(dataObj.tutorialProgress == 30):\n addPopup(\"We will give you\\n4000 more steps\\nto get you there.\",700, 300);\n dataObj.steps += 4000;\n stepCount += 4000\n dataObj.totalSteps += 4000;\n dataObj.priorSteps -= 4000;\n\n //dataObj.tutorialProgress++;\n areaNext.update();\n break;\n case(dataObj.tutorialProgress == 31):\n addPopup(\"When a new area is\\navailable, click this\\narrow to move there\\nwith your animals.\",700, 300, [843,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 33):\n addPopup(\"But never fear! If an\\narea proves too hard for\\nyour animals you can go\\nback to an easier one.\",700, 300, [618,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 34):\n addPopup(\"That's all you need\\nto know!\",500, 250);\n //dataObj.tutorialProgress++;\n break; \n case(dataObj.tutorialProgress == 35):\n addPopup(\"Now get out there,\\njournal in hand, and\\nget to nature walking!\",500, 250);\n //tutorialProgress++;\n //console.log(dataObj.tutorialProgress);\n break; \n }\n dataObj.tutorialProgress++;\n\t\tremovePopup(this);\n\t});\n\tbutton.setSrc(\"image_resources/Tooltip.png\");\n\tbutton.setSpriteAttributes(x,y,228,150, name)\n if (dataObj.tutorialProgress === 22) {\n button.setSpriteAttributes(x,y,228,170, name)\n }\n\tbutton.hasTextValue = true;\n\tbutton.fontSize = '20px';\n\tcharnum = text.length;\n //console.log(\"Button Created: \" + button.x + \" \" + button.onMouseUpImageSrc);\n\tbutton.setText([text], (button.width / 2) - (6.3 * charnum), 5);\n if (dataObj.tutorialProgress === 11) {\n console.log(\"Check Progress: \" + dataObj.tutorialProgress);\n button.updateText([text], ['red'])\n }\n button.cutout = function (ary) {\n //console.log(ary);\n ctx.globalAlpha = 0.3\n ctx.fillStyle=\"#f0c840\";\n ctx.fillRect(ary[0], ary[1], ary[2], ary[3]);\n ctx.globalAlpha = 1.0\n ctx.fillStyle=\"black\"\n }\n button.draw = function(){\n\t ctx.globalAlpha = 0.3;\n\t ctx.fillRect(0, 0, canvas.width, canvas.height, 'black');\n\t ctx.globalAlpha = 1.0;\n //console.log(this.cutoutParams);\n if (cutout) {\n this.cutout(cutout);\n }\n\t ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n\t if ((this.hovered && this.text !== undefined) || this.hasTextValue || this.hasTooltip){\n if (this.text === undefined) {\n //console.log(this.name);\n } else {\n var strArray = this.text[0].split(/\\n/);\n //var clrIndex = this.text[0].indexOf(/\\f/);\n //console.log(this.text[0].indexOf('*'));\n for(var s = 0; s < strArray.length; s++){\n //Highlighting code here.\n drawText([strArray[s]], this.x + 3, this.y + this.textOffsetY + (28*s), this.fontSize, this.color);\n }\n }\n if (this.tooltip != undefined && cursor.x != undefined && cursor.y != undefined && this.hovered) {\n drawText(this.tooltip,cursor.x+5,cursor.y+5)\n }\n }\n\t}\n\tpushPopup(button);\n}", "function showMoveText(inversion: int) {\n\tvar tutorialObject = new GameObject();\n\tvar tutorialScript = tutorialObject.AddComponent(\"tutorial\");\n\ttutorialScript.transform.parent = tutorialFolder.transform;\n\ttutorialScript.name = \"tutorial\";\n\t\n\tif(inversion==1) {\n\t\tvar GreenButtons = Instantiate(Resources.Load(\"Prefabs/greenDirections\", GameObject)) as GameObject;\n\t\tGreenButtons.transform.parent = tutorialScript.gameObject.transform;\n\t\tGreenButtons.transform.position = Vector3(GreenChar.transform.position.x,GreenChar.transform.position.y,-.001);\n\t} else if(inversion==2) {\n\t\tvar PurpleButtons = Instantiate(Resources.Load(\"Prefabs/purpleDirections\", GameObject)) as GameObject;\n\t\tPurpleButtons.transform.parent = tutorialScript.gameObject.transform;\n\t\tPurpleButtons.transform.position = Vector3(PurpleChar.transform.position.x,PurpleChar.transform.position.y,-.001);\n\t}\n}", "function createStoryChoice(story_choice) {\n return {\n story_choice,\n };\n}", "function loadGame(){\r\n\t\t\t\t\tcountClick=0;\r\n\t\t\t \tdocument.getElementById(\"sr\").innerHTML = \"Game On !!\";\r\n\t\t\t \tdocument.getElementById(\"winner\").innerHTML = \"A Beautiful Mind\";\r\n\t\t \t\tvar buttonHtml = \"\";\r\n\t\t \t\tfor (i = 0; i <9; i++) { \r\n\t\t \t\t\tarr.length=0;// clear data of previous game\r\n\t\t\t\t\t\tif(i==2 || i==5)\r\n\t\t\t\t\t\t\tbuttonHtml=buttonHtml + \"<button class=\\\"button\\\" \"+\"id=\\\"\" +i+\"\\\" onclick=\\\"calcWinner(this.id)\\\" value=\\\"\\\"></button><br> \" ;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tbuttonHtml=buttonHtml + \"<button class=\\\"button\\\" \"+\"id=\\\"\" +i+\"\\\" onclick=\\\"calcWinner(this.id)\\\" value=\\\"\\\"></button> \" ;\r\n\t\t\t\t \t}//for;\r\n\t\t\t \tdocument.getElementById(\"b\").innerHTML = buttonHtml ;\r\n\t\t\t\t\tdocument.getElementById(\"b\").style.background = \"grey\";\r\n\r\n}// function loadGame", "function showPerson(){\n const item = story[currentItem];\n text.textContent = item.text;\n heading.textContent = item.heading;\n}", "function level1Bali(){\n console.log(title);\n title.innerHTML = \"Bali\";\n description.innerHTML = \"You choose to go to Bali! How do you want to travel to Bali?\";\n image.src = \"img/planeship.jpg\";\n button1.innerHTML = \"By plane\";\n button2.innerHTML = \"By ship\";\n button3.innerHTML = \"By foot\";\n button1.setAttribute(\"onclick\", \"plane()\");\n button2.setAttribute(\"onclick\", \"ship()\");\n button3.setAttribute(\"onclick\", \"gameOver()\");\n button3.style.display = \"inline\";\n\n}", "function menuClick(clickedButton){\n let informaatio;\n \n switch (clickedButton){\n case 'Seura':\n informaatio = '<p>Osu!</p>'+\n '<p>Seuramme on Jyväskylässä toimiva Kyukushin-karate seura. Seuramme on osa IKO Kyokushinkaikan organisaatiota (IKO Matsui), jonka pääpaikka Suomessa on'+\n ' Turku, ja päävalmentaja Rebwar Shekhi.</p><br>'+\n '<img id= \"logoMain\" src= \"images/kankun.jpg\">';\n break;\n case 'Kyokushin Karate':\ninformaatio = '<p class= \"infoText\">Kyokushin on korealaissyntyisen Sosai Masutatsu Oyaman vuonna 1964 kehittämä karaten tyylisuunta. Se on eräs maailman suurimmista karaten tyylisuunnista. Kyokushin-tyylin ominaispiirteitä ovat kova ja realistinen harjoittelu, sparraus, sekä täydellä kontaktilla käytävät knockdown-ottelut, joissa myös reisiin kohdistuvat alapotkut ovat sallittuja. Lajilla on harrastajia yli 12 miljoonaa yli sadassa maassa. Kyokushinkai tarkoittaa ’’Lopullisen totuuden koulukuntaa/järjestöä’’. Se kuuluu maailmalla viiden suosituimman karatetyylin joukkoon. Kyokushin-karateen kuuluvat erilaiset lyönnit, potkut, tartunnat ja kaadot sekä nivellukot. Kyokushin karate poikkeaa muista karaten tyylisuunnista ottelu- ja harjoitussovelluksiltaan, olemalla suoraviivaisempi, intensiivisempi ja kovempi harjoitusmenetelmiltään. Kyokushin-karate tunnetaankin maailmanlaajuisesti vahvimpana karatena kovien treenimetodien, vaativien vyökokeiden ja täyskontaktiotteluidensa ansiosta.</p>'+\n'<p class= \"infoText\">Kyokushin karatessa vaalitaan vahvasti karaten perinteitä. Kihonia (perustekniikkaa) ja kataa (muotoja) harjoitellaan paljon. Myös ottelu- sekä välineharjoittelu ovat tärkeässä osassa. Kyokushin karatessa pyrkimys on säilyttää alkuperäisen karaten kolme perusasiaa: kihon, kata ja kumite sekä näiden erilaiset sovellukset.</p>'+\n'<p class= \"infoText\">Tyypillinen Kyokushin-karateharjoitus alkaa perustekniikalla ja loppuu otteluharjoitukseen. Perustekniikka pidetään koko karaten perustana. Perustekniikkaa harjoitellaan niin kihon muodossa rivissä kuin kihon ido-geiko muodossa liikkuen ja suorittaen ennalta määrättyjä liikesarjoja. Perustekniikkaa tehdessä jokaisen harjoittelijan pitäisi aina ajatella jokainen lyönti, torjunta ja potku viimeisenä. Harrastajien ja lajin keskeisiä mottoja onkin ”Osu no seishin” – periksiantamattomuus paineen alla tai ”Älä koskaan luovuta”.</p><p><i>teksti: wikipedia</i></p>'\n break;\n case 'Ajankohtaista':\n console.log('clicked: ', clickedButton);\n break;\n case 'Treenit ja liity mukaan':\n informaatio = '<p>Treenaamme tällä hetkellä sekä sisällä että ulkona.'+\n' Treenien määrä järjestyy sen mukaan, miten porukalla on intoa, eli '+ \n'vaikkapa jokapäivä, tai kerran viikossa.</p>'+ /*\n'<p>Treeniaikamme Halssilan koululla: <br> Maanantaisin: 20:00 - 21:30<br>Keskiviikkoisin: 20:45 - 21:45<br> Torstaisin: 20:30 - 22:00<br><br>'+ */\n'<p>Päävastuullisena valmentajana Jyväskylässä toimii Sami Kinnunen. Turku Open Kyokushin Tournament 2019. Kumite (ottelu), sekä Kata (liikesarja) voittaja. EM-kisa 2019 kumiten hopeamitalisti.<br>'+\n'Samia avustavat myös muut ohjaajat. Vyökokeet järjestää ja vyöt myöntää päävalmentajamme Rebwar Sekhi, 4-dan Shihan. </p>'+\n'<p>Jos haluat mukaan, niin ota yhteyttä Samiin (p.040 962 1851 tai finjutsu(a)hotmail.com). Aikaisempaa kokemusta ei'+ \n' vaadita ja kaikki ovat tervetulleita.</p>'+\n'<a href=\"https://www.facebook.com/567391464/videos/10156368917901465/?id=567391464\" target=\"_blank\"</a>Valmentaja Samin EM-kisaottelu. Sami vasemmalla. (facebook video)'; \n //window.location = \"https://thenewgame.glitch.me/skirmish\"; \n break;\n case 'Ota yhteyttä':\n informaatio = `Polaris Kyokushinkaikan organization Jyväskylä <br><br>\n Valmentaja Sami Kinnunen, 0409621851 finjutsu(a)hotmail.com <br>\n Nettisivuvastaava Petri Räsänen, rasanen.petri(a)gmail.com<br><br>\n <a href= \"https://www.facebook.com/profile.php?id=100011536548315\" target=\"_blank\">Facebook sivustomme</a>`;\n break; \n case 'Dojo kun':\ninformaatio = '<p class= \"infoText\">Dojo kun, eli dojo vala on tiivistelmä mihin kyokushin pyrkii, kovan harjoittelun kautta. Dojo kunin on'+ ' kirjoittanut Sosai Oyama, Eiji Yoshikawan (Miyamoto Musashi kirjan kirjoittaja), avustuksella. <br><br>'+\n'Englanniksi:<br><br>'+\n\n'We will train our hearts and bodies<br>'+\n'for a firm unshaking spirit.<br><br>'+\n\n'We will pursue the true meaning of the Martial Way,<br>'+\n'so that in time our senses may be alert.<br><br>'+\n\n'With true vigour,<br>'+\n'we will seek to cultivate a spirit of self denial.<br><br>'+\n\n'We will observe the rules of courtesy,<br>'+\n'respect our superiors,<br>'+\n'and refrain from violence.<br><br>'+\n\n'We will follow our religious principles,<br>'+\n'and never forget the true virtue of humility.<br><br>'+\n\n'We will look upwards to wisdom and strength,<br>'+\n'not seeking other desires.<br><br>'+\n\n'All our lives, through discipline of karate,<br>'+\n'we will seek to fulfil the true meaning of the<br>'+\n'Kyokushin Way.<br><br>'+\n\n'Japaniksi:<br><br>'+\n\n'Hitotsu, ware ware wa, shinshin o renmashi kakko fubatsu no shingi o kiwameru koto.<br><br>'+\n\n'Hitotsu, ware ware wa,bu no shinzui o kiwame, ki ni hasshi, kan ni bin naru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shitsujitsu goken o mot-te, jiko no seishin o kanyo suru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, reisetsu o omonji, chojo o keishi, sobo no furumai o tsutsushimu koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shinbutsu o totobi, kenjo no bitoku o wasurezaru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, chisei to tairyoku to o kojo sase, koto ni nozonde ayamatazaru koto.<br><br>'+\n\n'Hitotsu, ware ware wa, shogai no shugyo o karate no michi ni tsuji, Kyokushin no michi o matto suru koto.<br><br></p>';\n break; \n case 'Vyökoe syllabus':\n informaatio = '<a href=\"IKO-Technical-Syllabus-2011_vyökoevaatimukset_Turku.rtf\" download>Lataa tästä vyökoevaatimukset. </a>';\n break; \n case 'Linkit':\n informaatio = `<p>\n<a href=\"http://www.kyokushinkaikan.org/en/index.html\" target=\"_blank\"</a>Virallinen liiton sivusto</p><p>\n<a href=\"http://www.kyokushinturku.fi/\" target=\"_blank\"</a>Kyokushin Turku</p>\n<p>`;\n break; \n default: console.log('menuClick: not found clickedButton', clickedButton); \n }\n info1.innerHTML = informaatio;\n}", "function updateStory(storyObj) {\n // story variables\n var title = storyObj['title'];\n var description = storyObj['description'];\n var cameraSettings = storyObj['flyTo1'];\n\n // Update the Storymode content.\n storyHeader.text(title);\n storyContent.text(description);\n\n // Update Camera.\n map.flyTo(cameraSettings);\n\n}", "function scene3() {\n var textX;\n var textY;\n var lox= 0;\n let bg2;\n let pika1;\n let falcon1;\n let apple1;\n let cupcake1;\n\nvar quotes = [\"Poyo!\", \"Hai!\", \"This grass feels funny, it feels like... pants.\"];\n\n\n// scene1.setup\n this.setup = function() {\n // melody.loop();\n bg2 = loadImage('images/bg3.jpg');\n pika1 = loadImage('images/pikaicon.png');\n falcon1 = loadImage('images/falconicon.png');\n apple1 = loadImage('images/appleicon.png');\n cupcake1 = loadImage('images/cupcakeicon.png');\n\n console.log(\"chat1\");\n hi.playMode('sustain');\n\n\n // do all stuff you want to initialize things,\n // as this it need to be called only once.\n click2 = new Clickable();\n click2.locate(150, 550);\n click2.resize(500, 200);\n\n click2.onOutside = function(){\n textSize(30);\n this.color = \"#FEC8D8\";\n this.textColor = \"#957DAD\";\n }\n\n // click1.onOutside = function(){\n // this.color = \"#FFFFFF\";\n // }\n click2.onPress = function(){\n hi.play();\n textSize(30);\n this.text = random(quotes);\n affection += 10;\n if (affection == 100)\n {\n\n mgr.showScene( scene4 );\n }\n\n }\n\n\n click4 = new Clickable();\n click4.locate(50, 200);\n click4.resize(100, 100);\n\n click4.onOutside = function(){\n textSize(30);\n }\n\n // click1.onOutside = function(){\n // this.color = \"#FFFFFF\";\n // }\n click4.onPress = function(){\n pika.play();\n textSize(30);\n click2.text = (\"I want my ketchup\");\n affection += 10;\n if (affection == 100)\n {\n\n mgr.showScene( scene4 );\n }\n\n }\n\n\n click5 = new Clickable();\n click5.locate(650, 200);\n click5.resize(100, 100);\n\n click5.onOutside = function(){\n textSize(30);\n }\n\n // click1.onOutside = function(){\n // this.color = \"#FFFFFF\";\n // }\n click5.onPress = function(){\n falcon.play();\n textSize(30);\n click2.text = (\"Falcon Punch!\");\n affection += 10;\n if (affection == 100)\n {\n\n mgr.showScene( scene4 );\n }\n\n }\n\n click6 = new Clickable();\n click6.locate(650, 400);\n click6.resize(100, 100);\n\n click6.onOutside = function(){\n textSize(30);\n }\n\n // click1.onOutside = function(){\n // this.color = \"#FFFFFF\";\n // }\n click6.onPress = function(){\n yup.play();\n textSize(30);\n click2.text = (\"GIMME!GIMME!GIMME! GIMME!GIMME!GIMME! GIMME!GIMME!GIMME!\");\n affection += 10;\n if (affection == 100)\n {\n\n mgr.showScene( scene4 );\n }\n\n }\n\n click7 = new Clickable();\n click7.locate(50, 400);\n click7.resize(100, 100);\n\n click7.onOutside = function(){\n textSize(30);\n }\n\n // click1.onOutside = function(){\n // this.color = \"#FFFFFF\";\n // }\n click7.onPress = function(){\n puto.play();\n textSize(30);\n click2.text = (\"bleeeeeeh\");\n affection -= 10;\n if (affection == 100)\n {\n\n mgr.showScene( scene4 );\n }\n\n }\n\n }\n\n // enter() will be called each time SceneManager switches\n // to this scene\n\n this.enter = function() {\n console.log(\"chat1\");\n textX = 10;\n textY = 0;\n background(\"grey\");\n textAlign(CENTER);\n\n\n console.log(\"home\");\n console.log(hell);\n ship.position.x = 300;\n ship.position.y = 500;\n ship.changeAnimation(\"normal\");\n\n // ship.onMouseOver = function() {\n //\n // hi.play();\n // console.log(\"over\");\n // this.changeAnimation(\"stand\");\n // // this.position.x++;\n // text(\"Poyo!\", 400, 500);\n //\n // }\n\n\n }\n\n\n this.draw = function()\n {\n // background(100);\n image(bg2, 0, 0);\n\n\n\n\n push();\n shoes();\n pop();\n\n push();\n leftArm();\n pop();\n\n push();\n rightArm();\n pop();\n\n push();\n body();\n pop();\n\n push();\n let x1 = map(mouseX, 0, width, -30, 40);\n let x2 = map(mouseY, 0, height, -30, 40);\n translate(x1, x2);\n eyes();\n pop();\n\n\n // text(\"Poyo\", 100,100);\n\n // leftArm.mousePressed = function() {\n // aa.play();\n // // text(\"This grass feels funny, it feels like... pants.\", 100, 300);\n // }\n //\n // rightArm.mousePressed = function() {\n // puto.play();\n // // text(\"This grass feels funny, it feels like... pants.\", 100, 300);\n // }\n // this.position.x++;\n\n // ship.onMouseOver = function() {\n //\n // hi.play();\n // console.log(\"over\");\n // this.changeAnimation(\"stand\");\n // // this.position.x++;\n // // textSize(29);\n // // click1.locate(300,500);\n // // this.text=\"Poyo\";\n //\n // }\n\n click2.draw();\n click4.draw();\n click5.draw();\n click6.draw();\n click7.draw();\n\n image(pika1, -80, -20);\n image(falcon1, 100, -20);\n image(apple1, -80, -80);\n image(cupcake1, 100,-80);\n\n chatbox();\n // Change color\n if (affection < 25)\n {\n fill(255, 153, 153);\n }\n else if (affection < 50)\n {\n fill(255, 102, 153);\n }\n else\n {\n fill(204, 51, 102);\n }\n\n // Draw bar\n noStroke();\n // Get fraction 0->1 and multiply it by width of bar\n var drawWidth = (affection / MAX_AFFECTION) * rectWidth;\n rect(550, 30, drawWidth, 50);\n\n // Outline\n stroke(0);\n scribble.scribbleRect(650,50, rectWidth, 50);\n\n\n\n }\n\n\n\n\n this.mousePressed = function()\n {\n\n\n }\n\n\n this.keyPressed = function()\n {\n this.sceneManager.showNextScene();\n }\n\n\n}", "function game3_button1(word,X,Y)\n{\n textAlign(CENTER);\n const button_width = width /4;\n const button_height = 225;\n \n const Play_button_left = X;\n const Play_button_top = Y;\n const mouse_is_within_x_range = mouseX >= Play_button_left && mouseX < button_width+X;\n const mouse_is_within_y_range = mouseY > Play_button_top && mouseY < Play_button_top + button_height;\n \n push();\n strokeWeight(10);\n stroke('#CC99FF');\n fill(255)\n if(mouse_is_within_x_range && mouse_is_within_y_range)\n {\n fill(230);\n }\n rect(Play_button_left, Play_button_top, \n button_width, button_height);\n pop();\n textSize(50);\n text(word, Play_button_left+button_width/2, Play_button_top+button_height/2 +15 );\n \n if (mouseIsPressed == true && mouseWasPressed == false)\n {\n if(mouse_is_within_x_range && mouse_is_within_y_range)\n {\n A_number = A_number-1\n B_number = B_number-1\n C_number = C_number-1\n D_number = D_number-1\n\n if(A_number == 3 && B_number==3 && C_number==3 && D_number == 3)\n {\n CurrentScreen = game_clear\n }\n }\n }\n}", "function C001_BeforeClass_Intro_Run() {\n\t\n\t// Draw the background and player\n\tif (TextPhase <= 2) DrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background1.jpg\", 0, 0);\n\telse DrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background2.jpg\", 0, 0);\n\tDrawPlayerTransition();\n\t\n\t// Introduce chapter 1 with each clicks\n\tDrawText(GetText(\"Intro1\"), 450, 50, \"White\");\n\tif (TextPhase >= 1) DrawText(GetText(\"Intro2\"), 450, 150, \"White\");\n\tif (TextPhase >= 2) DrawText(GetText(\"Intro3\"), 450, 250, \"White\");\n\tif (TextPhase >= 3) DrawText(GetText(\"Intro4\"), 450, 350, \"White\");\n\tif (TextPhase >= 4) DrawText(GetText(\"Intro5\"), 450, 450, \"White\");\n\tif (TextPhase >= 5) DrawText(GetText(\"Intro6\"), 450, 550, \"White\");\n\n}", "function rulesScenario() {\n $(\"#rules\").empty();\n $(\"#scenario\").empty();\n var h3 = $(\"<h3>\").text(\"Game Rules\");\n $(\"#rules\").append(h3);\n $(\"#rules\").append(br);\n $(\"#rules\").append(rules);\n $(\"#rules\").append(br);\n var hr = $(\"<hr width='100%' id='line'>\");\n $(\"#rules\").append(hr);\n var h3 = $(\"<h3>\").text(\"Scenario\");\n $(\"#scenario\").append(h3);\n $(\"#scenario\").append(br);\n $(\"#scenario\").append(scenario);\n //$(\"#scenario\").append(p);\n //**************************************************/\n // Add Next button to get to game from first \"view\" /\n //**************************************************/\n var h3 = $(\"<h3>\").text(\"\");\n $(\"#scenario\").append(h3);\n var nextBtn = $(\"<button id='next' style='float:right'>\").text(\"Interview\");\n $(\"#scenario\").append(nextBtn);\n\n\n //Add clues///\n $('#buttons').append(\"<img class='clues' id='clue1' src=\" + clue1image + \" />\");\n $('#buttons').append(\"<img class='clues' id='clue2' src=\" + clue2image + \" />\");\n $('#buttons').append(\"<img class='clues' id='clue3' src=\" + clue3image + \" />\");\n $('#buttons').append(\"<img class='clues' id='clue4' src=\" + detimage + \" />\");\n }", "function textHelp(){\n\n if(whiteTurn){\n document.getElementById('textMove').innerHTML = 'Light Move';\n document.getElementById('textArea').style.background = \"white\";\n document.getElementById('textMove').style.color = \"#333333\";\n\n }\n else{\n document.getElementById('textMove').innerHTML = 'Dark Move';\n document.getElementById('textArea').style.background = \"#4c4c4c\";\n document.getElementById('textMove').style.color= 'white';\n }\n if(lightMustTake || darkMustTake){\n document.getElementById('textMand').innerHTML = 'Mandatory Take';\n if(whiteTurn){\n \n document.getElementById('textMand').style.color = \"black\";\n }\n else{\n document.getElementById('textMand').style.color = \"white\";\n }\n }\n else{\n document.getElementById('textMand').innerHTML = '';\n }\n}", "function randNum() {\n\n scoreTarget = Math.floor((Math.random() * (120 - 19)) + 19);\n\n buttonTally = 0;\n\n// Need to link C1, C2, C3, C4 to generate buttonValues\n\n button1 = Math.floor((Math.random() * (12 - 1)) + 1);\n button2 = Math.floor((Math.random() * (12 - 1)) + 1);\n button3 = Math.floor((Math.random() * (12 - 1)) + 1);\n button4 = Math.floor((Math.random() * (12 - 1)) + 1);\n\n $(\"#scoreTarget\").html(\"Critical Star Heading: \"+scoreTarget);\n $(\"#buttonTally\").html(buttonTally);\t\n $(\"#wins\").html(\"Wins: \"+wins);\n $(\"#losses\").html(\"Losses: \"+losses);\n}", "function handleClick() {\r\n var button_pressed = this.innerHTML;//this gives us the tag which is pressed(<button class=\"w drum\">w</button>), we use inner html to get the letters inside the tags(w,a,s,d)\r\n \r\n// passing button_pressed to sound()\r\n sound(button_pressed); \r\n\r\n// animation\r\n buttonAnimation(button_pressed);\r\n\r\n}", "function gameStart() {\n middleText.innerText = 'This is a game of Rock, Paper, Scissors. Winner is the first to 5. Go!';\n}", "function appendVideoGames3(actionSolo) {\n let htmlTemplate = \"\";\n for (let videoGame of actionSolo) {\n htmlTemplate += `\n <article>\n <img src=\"${videoGame.img}\">\n <button onclick=\"diceFunction();appendBoardGames(_boardSs)\">${videoGame.name}</button>\n </div>\n </article>\n `;\n }\n document.querySelector('#strategySolo-container').style.display = \"flex\";\n document.querySelector('#strategySolo-container').innerHTML = htmlTemplate;\n}", "function generate_story(student, theme_name, difficulty, done) {\n\tvar difficulty_str = \"level_\" + difficulty; //difficulty are stored in the format level_1, etc. in theme.json\n\n\t//story object\n\tvar story = {\n\t\ttheme: theme_name,\n\t\tstudent: student, //email of student\n\t\tprogress: 0, //question # of current question\n\t\tphrases: [], //array of phrases (one for each puzzle)\n\t\twords: { //available words\n\t\t\tcharacter: null,\n\t\t\tsupporting: null,\n\t\t\tplaces: [],\n\t\t\tadjectives: [],\n\t\t\tanswers: []\n\t\t},\n\t\tpuzzles: [], //array of puzzle ids (must be in same order as phrases)\n\t\tstatistics: {}, //to store statistics such as # of wrong answers, etc.\n\t\tbackground: {}\n\t};\n\n\t// get the theme to populate the story object\n\ttheme.get(theme_name, function (err, theme_obj) {\n\t\tif (err) return done(err, undefined);\n\n\t\t// container to hold phrase objects\n\t\tvar temp_phrase = [];\n\t\t// get beginning phrase\n\t\ttemp_phrase.push(choose_list_items(1, theme_obj.phrases.beginning));\n\t\tstory.phrases.push(temp_phrase[0].phrase);\n\t\t// get middle phrases\n\t\tvar middles = choose_list_items(STORY_LENGTH, theme_obj.phrases.middle);\n\t\tif(typeof !Array.isArray(middles))\n\t\t\tmiddles = [middles];\n\t\tmiddles.forEach(function (phrase) {\n\t\t\ttemp_phrase.push(phrase);\n\t\t\tstory.phrases.push(phrase.phrase);\n\t\t});\n\n\t\t// get end phrase\n\t\ttemp_phrase.push(choose_list_items(1, theme_obj.phrases.end));\n\t\tstory.phrases.push(temp_phrase[temp_phrase.length - 1].phrase); // push the last item of temp_phrase to phrases\n\n\t\t//get character and supporting\n\t\tstory.words.character = choose_list_items(1, theme_obj.characters);\n\t\tstory.words.supporting = choose_list_items(1, theme_obj.supporting);\n\n\t\t//get places\n\t\ttheme_obj.places.forEach(function (place, i) { story.words.places.push(place) });\n\n\t\t//get adjectives\n\t\ttheme_obj.adjectives.forEach(function (adj, i) { story.words.adjectives.push(adj) });\n\n\t\t//get answers at the correct difficulty level\n\t\ttemp_phrase.forEach(function (phrase) { \n\t\t\tstory.words.answers.push(choose_list_items(1, phrase.answers[difficulty_str]));\n\t\t});\t\n\n\t\t//generate puzzle numbers\n\t\tvar puzzle_list = choose_list_items(story.phrases.length, puzzles); //one puzzle for each phrase\n\t\tpuzzle_list.forEach(function (puzzle_id, i) { story.puzzles.push(puzzle_id) });\n\n\t\t//generate placeholder statistics\n\t\tstory.phrases.forEach(function (phrase, i) {\n\t\t\tvar stat_key = \"question_\" + (i + 1);\n\t\t\tstory.statistics[stat_key] = { missed: 0};\n\t\t});\n\t\t\n\t\t// get background object\n\t\tstory.background = theme_obj.background;\n\n\t\tdone(undefined, story);\n\t});\n}", "function generateStoryHTML(story) {\n let hostName = getHostName(story.url);\n let favStatus = HEART_FALSE; // not favorited by default\n let delBut = \"\"; // create variable incase it's user's own story\n \n currentUser.favorites.map(fav => {\n if (fav.storyId == story.storyId){\n favStatus = HEART_TRUE; // set heart icon to favorited\n }\n })\n\n if (story.username == currentUser.username){ // if own story, add button\n delBut = '<button class=\"del-but\">Delete Story</button>';\n }\n\n // render story markup\n const storyMarkup = $(`\n <li id=\"${story.storyId}\">\n ${favStatus}\n <a class=\"article-link\" href=\"${story.url}\" target=\"a_blank\">\n <strong>${story.title}</strong>\n </a>\n <small class=\"article-author\">by ${story.author}</small>\n <small class=\"article-hostname ${hostName}\">(${hostName})</small>\n <small class=\"article-username\">posted by ${story.username}</small>\n ${delBut}\n </li>\n `);\n\n return storyMarkup;\n }", "function init() {\n\n\nconst p1Choice = document.querySelector('#p1choice')\nconst p2Choice = document.querySelector('#p2choice')\nconst rockButton = document.querySelector('#rock')\nconst paperButton = document.querySelector('#paper')\nconst scissorsButton = document.querySelector('#scissors')\nconst resetButton = document.querySelector('#reset')\nconst winnerText = document.querySelector('#winner')\n\n\n\nfunction handleChoiceClick(event){\n console.log('Player chose', event.target.textContent) // Sweetness #1 got it console logging the choice so now can take that data and give it to something else\n const playerChoice = event.target.textContent\n p1Choice.textContent = playerChoice // Sweetness #2 got the players choice to display on screen\n const randomNumber = (Math.floor(Math.random() * (3 - 1 + 1)) + 1)\n console.log(randomNumber)\n // Sweetness #4 got the random number to generate everytime rock, paper, or scissors is clicked\n // Now to make those numbers relate to the computers choice\n\n if(randomNumber == 1) {\n p2Choice.textContent = 'Rock';\n } else if(randomNumber == 2) {\n p2Choice.textContent = 'Paper';\n } else {\n p2Choice.textContent = 'Scissors';\n }\n // Sweetness #5 Got the computer picking a random choice, all thats left is to update the winner text which requires logic to see who wins\n \n if (p2Choice.textContent == 'Rock' && p1Choice.textContent == 'Rock') {\n console.log(`Rock & Rock, it's a draw`)\n winnerText.textContent = `Rock & Rock, it's a draw`\n } else if (p2Choice.textContent == 'Paper' && p1Choice.textContent == 'Paper'){\n console.log(`Paper & Paper, it's a draw`)\n winnerText.textContent = `Paper & Paper, it's a draw`\n } else if (p2Choice.textContent == 'Scissors' && p1Choice.textContent == 'Scissors') {\n console.log(`Scissors & Scissors, it's a draw`)\n winnerText.textContent = `Scissors & Scissors, it's a draw`\n // Choices for draws\n\n } else if (p2Choice.textContent == 'Scissors' && p1Choice.textContent == 'Paper'){\n console.log(`Computer wins, Scissors beats Paper`)\n winnerText.textContent = `Computer wins, Scissors beats Paper`\n } else if (p2Choice.textContent == 'Paper' && p1Choice.textContent == 'Scissors'){\n console.log(`Player wins, Scissors beats Paper`)\n winnerText.textContent = `Player wins, Scissors beats Paper`\n // Choices for scissors and paper\n\n } else if (p2Choice.textContent == 'Paper' && p1Choice.textContent == 'Rock'){\n console.log(`Computer wins, Paper beats Rock`)\n winnerText.textContent = `Computer wins, Paper beats Rock`\n } else if (p2Choice.textContent == 'Rock' && p1Choice.textContent == 'Paper'){\n console.log(`Player wins, Paper beats Rock`)\n winnerText.textContent = `Player wins, Paper beats Rock`\n // Choices for paper and rock\n\n } else if (p2Choice.textContent == 'Rock' && p1Choice.textContent == 'Scissors'){\n console.log(`Computer wins, Rock beats Scissors`)\n winnerText.textContent = `Computer wins, Rock beats Scissors`\n } else if (p2Choice.textContent == 'Scissors' && p1Choice.textContent == 'Rock'){\n winnerText.textContent = `Player wins, Rock beats Scissors`\n // Choices for rock and scissors\n }\n\n }\n\nfunction handleReset(click){ // Sweetness #3 got the reset button working\n console.log('Player has decided to rest the computer and player choice')\n p1Choice.textContent = ''\n p2Choice.textContent = ''\n winnerText.textContent = 'Click Below To Start'\n}\n\nrockButton.addEventListener('click', handleChoiceClick)\npaperButton.addEventListener('click', handleChoiceClick)\nscissorsButton.addEventListener('click', handleChoiceClick)\nresetButton.addEventListener('click', handleReset)\n\n\n}", "function setupButton() {\n for(var i = 0; i < diffButton.length; i++) {\n diffButton[i].classList.remove(\"selected\");\n }\n this.classList.add(\"selected\");\n this.textContent === \"Easy\" ? numberOfSquares = 3 : numberOfSquares = 6;\n gameReset();\n}", "function win(){\n console.log(title);\n title.innerHTML = \"You won!\";\n description.innerHTML = \"You used some medicine from the medicine-kit and felt better. You were on time at the gate for you flight and your holiday is about to start!\";\n image.src = \"img/youwon.jpg\";\n button1.innerHTML = \"Play again\";\n button1.setAttribute(\"onclick\", \"begin()\");\n document.getElementById(\"button2\").style.display = \"none\";\n document.getElementById(\"button3\").style.display = \"none\";\n document.getElementById(\"inventoryItem\").style.display = \"none\";\n document.getElementById(\"inventorytext\").style.display = \"none\";\n}", "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}", "addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text(\n game.world.centerX, 50, startingMessage,\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.turnStatusText.anchor.setTo(0.5, 0.5)\n game.turnStatusText.key = 'text'\n\n game.playerPieceText = game.add.text(\n game.world.centerX, 600-50, '',\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.playerPieceText .anchor.setTo(0.5, 0.5)\n game.playerPieceText.key = 'text'\n\n\n\n }", "displayText(combatStage, index) {\n let paragraph = this.state.paragraph; \n let lines = this.state.lines;\n lines++;\n this.howManylines++;\n let key = \"line\"+this.howManylines;\n let string = \"\";\n let verbAgreement = \"\";\n\n if (lines > 5) {\n // scrollText() or\n paragraph.shift();\n lines--;\n }\n paragraph.push(<p></p>)\n \n switch(combatStage) {\n case \"start\": \n let subject = this.state.playerPhase ? \"You\" : \"The bandit\";\n verbAgreement = this.state.playerPhase ? \"\" : \"s\";\n string = `${subject} attack${verbAgreement}!`;\n break;\n case \"damage\":\n let verb = this.state.playerPhase ? \"inflicted\" : \"received\";\n let damage = this.state.playerPhase ? \n (this.state.player.attack - map[this.state.bandits[index].map[0]-1][this.state.bandits[index].map[1]-1].defense) : \n (this.state.bandits[index].attack - map[this.state.playerMap[0]-1][this.state.playerMap[1]-1].defense);\n string = `You ${verb} ${damage} damage!`;\n if (this.targetVillager) { string = `She receives ${damage} damage!`}\n break;\n case \"dead\":\n let target = this.state.playerPhase ? \"The bandit\" : \"You\";\n verbAgreement = this.state.playerPhase ? \"has\" : \"have\";\n let gameOver = this.state.playerPhase ? \"\" : \" Game over.\"\n string = `${target} ${verbAgreement} been defeated.${gameOver}`;\n if (this.targetVillager) { string = \"The villager has been killed.\" }\n break;\n case \"exp\":\n string = \"You have gained 10 experience.\";\n break;\n case \"next\":\n let toNext = this.expForLevel.find((element) => element >= this.state.player.exp) - this.state.player.exp;\n if (toNext === 0) {\n string = \"You have advanced to the next level.\"\n } else {\n string = `You need ${toNext} experience to advance.`;\n }\n break;\n case \"heal\":\n string = \"Your HP are restored to maximum.\"\n break;\n default:\n string = \"Something went wrong.\"\n break;\n };\n\n let t = 0;\n let framesPerTick = 2;\n const letterRoll = (timestamp) => {\n if (t <= string.length * framesPerTick) {\n if (t % framesPerTick === 0) {\n paragraph[lines-1] = <p key={key}>{string.substring(0, t/framesPerTick)}</p>;\n this.setState({ lines: lines, paragraph: paragraph });\n }\n t++;\n requestAnimationFrame(letterRoll);\n } else {\n if (combatStage === \"start\") {\n this.displayText(\"damage\", index);\n } else if (combatStage === \"dead\" && this.state.playerPhase) {\n this.displayText(\"exp\", index);\n } else if (combatStage === \"exp\") {\n this.displayText(\"next\");\n }\n }\n };\n\n requestAnimationFrame(letterRoll);\n }", "function translateStory() {\n stop = true;\n let story = document.getElementById(\"story\");\n let text = document.getElementById(\"hiddenText\").innerHTML;\n story.innerHTML = text;\n document.getElementById(\"translateButton\").disabled = true;\n}", "function questionPage() {\n var question_container = document.getElementById(\"question_container\");\n var content_container = document.getElementById(\"content_container\");\n var button_container = document.getElementById(\"button_container\");\n\n h1 = document.createElement(\"h1\");\n p = document.createElement(\"p\");\n var agreeButton = document.getElementById(\"but1\");\n var doubtButton = document.getElementById(\"but2\");\n var disagreeButton = document.getElementById(\"but3\");\n var backButton = document.getElementById(\"but4\");\n var skipButton = document.getElementById(\"but5\");\n\n agreeButton.onclick = function() { buttonFunctionality('pro') }\n doubtButton.onclick = function() { buttonFunctionality('none') }\n disagreeButton.onclick = function() { buttonFunctionality('contra') }\n backButton.onclick = function() { buttonFunctionality('return') }\n skipButton.onclick = function() { buttonFunctionality('skipped') }\n \n content_container.appendChild(h1);\n content_container.appendChild(p);\n \n renderText();\n}", "function changePages(event)\n{\n if (i + 1 < storyParts.length && event.key == \"ArrowRight\"){\n storyParts[i].style.display = \"none\";\n i++;\n window.scrollTo(0, 0);\n storyParts[i].style.display = \"block\";\n if (i + 1 == storyParts.length)\n {\n nextButton.style.display = \"none\";\n }\n else\n {\n nextButton.style.display = \"block\";\n prevButton.style.display = \"block\";\n }\n }\n if (i >= 1 && event.key == \"ArrowLeft\"){\n storyParts[i].style.display = \"none\";\n i--;\n window.scrollTo(0, 0);\n storyParts[i].style.display = \"block\";\n if (i == 0)\n {\n prevButton.style.display = \"none\";\n }\n else\n {\n nextButton.style.display = \"block\";\n prevButton.style.display = \"block\";\n }\n }\n}", "function updateArticle(){\n\t\tswitch(article){\n\t\t\tcase 0:\n\t\t\t\theading.text = \" \";\n\t\t\t\ttext1.text = \" \";\n\t\t\t\t//heading.text = \"New record: University of Washington spun out 18 startups last year\";\n\t\t\t\t//text1.text = \"The school announced today that it helped launch 18 startups in fiscal 2013, breaking last year’s record of 17. A majority of the companies, which received support from the UW Center for Commercialization (C4C) and have signed patent-licensing agreements with the university, are health-care related with a few focused on software and robotics.\";\n\t\t\t\ttext1Back.backgroundImage = 'uw-blur-selected.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\theading.text = \" \";\n\t\t\t\ttext1.text = \" \";\n\t\t\t\t//heading.text = 'Ancient priests tomb painting discovered near Great Pyramid at Giza';\n\t\t\t\t//text1.text = \"A wall painting, dating back over 4,300 years, has been discovered in a tomb located just east of the Great Pyramid of Giza. The painting shows vivid scenes of life, including boats sailing south on the Nile River, a bird hunting trip in a marsh and a man named Perseneb who's shown with his wife and dog. While Giza is famous for its pyramids, the site also contains fields of tombs that sprawl to the east and west of the Great Pyramid.\";\n\t\t\t\ttext1Back.backgroundImage = 'london-selected.png';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\theading.text = \" \";\n\t\t\t\ttext1.text = \" \";\n\t\t\t\t//heading.text = \"Queen + Adam Lambert teach lesson in old school rock at Mohegan Sun Casino\";\n\t\t\t\t//text1.text = \"Queen + Adam Lambert: A Once in a Lifetime Experience brought the 2009 American Idol finalist and Queen guitarist Brian May and drummer Roger Taylor together before a sold-out crowd at the 10,000-seat Mohegan Sun Arena on Saturday night. (They return Friday for another performance). With fog, lasers, extended solos on top of extended solos, and, oh yeah, an impressive catalog of songs, it was – as Taylor aptly put it – a show with no dancers and real singers.\";\n\t\t\t\tfeedView.backgroundImage = 'rock-blur.jpg';\n\t\t}\n\t}", "function button_one_click() {\n var choice = document.getElementById(\"button_one\").innerHTML;\n game_end(correct, choice);\n}", "toggleStory(story) {\n const index = this.state.openedStory.indexOf(story.story);\n if (index > -1) {\n this.state.openedStory.splice(index, 1);\n } else {\n this.state.openedStory.push(story.story);\n }\n const sampleArr = this.$parent.sampleArr;\n const guidValue = this.$parent.guidValue;\n const result = sampleArr\n .filter(value => value.name === this.state.metric.metric &&\n guidValue\n .get(value.diagnostics.stories)[0] ===\n story.story);\n const allDiagnostic = [];\n result.map(val => allDiagnostic.push(Object.keys(val.diagnostics)));\n this.state.story = story;\n app.plotSingleMetricWithAllSubdiagnostics(this.state.metric.metric,\n this.state.story.story, this.state.diagnostic);\n this.empty();\n }", "function startGame() {\n setVars();\n clearInterval(wordAnimation); // Stop animations on how-to page\n getTopics();\n displayTopicChoice();\n $(\".try-again\").addClass(\"d-none\"); // Remove try again button\n $(\".menu1\").addClass(\"d-none\");\n $(\".menu2\").removeClass(\"d-none\");\n $(\".skip-question-btn\").css(\"background-color\", \"#054a91\"); // Reset Skip Button\n $(\"#message-icon\").text(\" \"); // Get rid of lives icon\n}", "function handleClick() {\n var pressedButton = this.innerHTML;\n buttonAnimation(pressedButton);\n switch (pressedButton) {\n case \"w\":\n tom1.play();\n break;\n case \"a\":\n tom2.play();\n break;\n case \"s\":\n tom3.play();\n break;\n case \"d\":\n tom4.play();\n break;\n case \"j\":\n snare.play();\n break;\n case \"k\":\n crash.play();\n break;\n case \"l\":\n kick.play();\n break;\n default:\n }\n}", "function play(){\n\tvar container = $(\"container\");\n\tvar levels = [\"Easy\",\"Medium\",\"Hard\",\"Back\"];\n\tvar button;\n\n\t//rimuovo tutti i bottoni\n\tremoveButtons();\n\n\t//aggiungo i bottoni per la scelta del livello difficoltà\n\tfor (var i = 0; i < levels.length; i++) {\n\t\tbutton=createButton(levels[i]);\n\t\tcontainer.appendChild(button);\n\t}\n\n\tbutton.onclick=back;\n}", "function trivia(quest, sele){\n\n var word = document.createElement(\"p\");\n word.textContent = quest;\n document.getElementById(\"every\").appendChild(word);\n\n for(var i = 0; i < sele.length; i++){\n var btn = $(\"<button>\");\n\n btn.text(sele[i]);\n\n btn.addClass(\"asking asking\" + i);\n\n btn.attr(\"value\", i);\n\n $(\"#every\").append(btn);\n }\n}", "function togglePiece(e) {\n\n if (this.id.indexOf('yeti') != -1) {\n \n //Set background image for the yeti\n this.setAttribute('style', 'background-image:url(\\'images/yeti.png\\');');\n\n //Audio trigger for yeti\n var yetiGrowl = new Audio('media/yeti.wav');\n yetiGrowl.play();\n\n //Open Game Over window\n gameoverMsg.textContent = 'Game Over!';\n gameoverMsg.setAttribute('style', 'color: red;');\n gameoverModal.style.display = 'block';\n }\n \n else if (this.id.indexOf('penguin1') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_1.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin2') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_2.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin3') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_3.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin4') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_4.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin5') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_5.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin6') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_6.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin7') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_7.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n else if (this.id.indexOf('penguin8') != -1) {\n \n this.setAttribute('style', 'background-image:url(\\'images/penguin_8.png\\');');\n \n //Audio trigger for penguin\n penguinSound.play();\n counter++;\n elScoreboard.value = counter.toString();\n }\n \n if ( counter == 8) {\n gameoverMsg.textContent = 'Hurray! You won';\n gameoverMsg.setAttribute('style', 'color: black;');\n gameoverModal.style.display = 'block';\n }\n }", "function newStory() {\n let reset = true;\n getData('currentNode').then((data) => {\n if (data?.id !== \"0\") { // if there's a story, ask first \n Alert.alert(\n \"Confirm\",\n \"Are you sure you want to start a new story? This will reset your previous progress\",\n [\n {\n text: \"Cancel\",\n onPress: () => reset = false,\n style: \"cancel\"\n },\n {\n text: \"OK\",\n onPress: () => {\n resetGame();\n props.navigation.navigate('New Story', {\n font: styles.cabinFont\n })\n }\n }\n ],\n { cancelable: false }\n )\n } else {\n props.navigation.navigate('New Story', {\n font: styles.cabinFont\n })\n }\n })\n }", "function beginStory()\n{\n // now all your titles will become individual objects\n // since we called the array imageStory, we will call each object something\n // different\n //var imageStory = new NicePlace(\"Knights Ferry, CA\"); changed from imageStory to new object name: mapPlace\n var mapPlace = new NicePlace(\"Knights Ferry\");\n var mapPlace1 = new NicePlace(\"Pinecrest, CA\");\n var mapPlace2 = new NicePlace(\"Modesto, CA\");\n var mapPlace3 = new NicePlace(\"Pacific Grove, CA\");\n var mapPlace4 = new NicePlace(\"Monterey, CA\");\n\n // all of these objects are created from the class NicePlace\n var Story = new NicePlace(\"Knights Ferry River Park <br> Family Park <br> Knights Ferry, CA <br> June 2020 <br> by: Casey Jay\"); // this is the Story object\n var Story1 = new NicePlace(\"Pinecrest Lake Trailhead <br> Family Lake <br> Pinecrest, CA <br> July 2019 <br> by: Casey Jay\"); // this is the Story1 object\n var Story2 = new NicePlace(\"Dry Creek Trail <br> Bike and Jogging Trail <br> Modesto, CA <br> January 2018 <br> by: Casey Jay\");\n var Story3 = new NicePlace(\"Asilomar State Beach <br> Trails and Tidepools <br> Pacific Grove, CA <br> February 2021 <br> by: Casey Jay\");\n var Story4 = new NicePlace(\"Old Fisherman's Wharf <br> Dining and Shopping <br> Monterey, CA <br> August 2017 <br> by: Casey Jay\");\n\n\n // now we can add each Story to the imageStory array\n imageStory.push(Story); \n imageStory.push(Story1);\n imageStory.push(Story2);\n imageStory.push(Story3);\n imageStory.push(Story4);\n\n}", "function storyChoice(planetName) {\n\tswitch (planetName) {\n\t\tcase \"mercury\":\n\t\t\tmercuryStory();\n\t\t\tbreak;\n\t\tcase \"venus\":\n\t\t\tvenusStory();\n\t\t\tbreak;\n\t\tcase \"mars\":\n\t\t\tmarsStory();\n\t\t\tbreak;\n\t\tcase \"jupiter\":\n\t\t\tjupiterStory();\n\t\t\tbreak;\n\t\tcase \"saturn\":\n\t\t\tsaturnStory();\n\t\t\tbreak;\n\t\tcase \"uranus\":\n\t\t\turanusStory();\n\t\t\tbreak;\n\t\tcase \"neptune\":\n\t\t\tneptuneStory();\n\t\t\tbreak;\n\t\tcase \"pluto\":\n\t\t\tplutoStory();\n\t\t\tbreak;\n\t}\n}", "function buildMainMenu() {\n //creating Title\n let x = width / 2;\n let y = 150 * progScale;\n let s = \"CUBE\";\n let title = new DisplayText(x, y, 0, 0, s);\n title.textSize = 200 * progScale;\n allObjects.push(title);\n\n let buffer = 50 * progScale;\n\n //tutorial button\n let w = 350 * progScale;\n let h = 75 * progScale;\n x = (width / 2) - w / 2;\n y = 300 * progScale;\n let startTutorial = function() {\n clearGameObjects(); //clearing menu\n buildTutorialScreen(); //showing Tutorial Instructions\n };\n let btnTutorial = new Button(x, y, w, h, startTutorial);\n btnTutorial.displayText = \"Play Tutorial\";\n btnTutorial.strokeWeight = 0;\n btnTutorial.fillColor = color(0, 255, 255); //light blue\n btnTutorial.hoverColor = color(0, 255 / 2, 255 / 2); //darker\n btnTutorial.textSize = 35 * progScale;\n btnTutorial.textColor = color(0, 0, 0); //black\n btnTutorial.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnTutorial);\n\n //general font size for all game buttons\n let fontSize = 35 * progScale;\n\n //Easy Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) - w - (buffer * progScale);\n y = 450 * progScale;\n let cEasy = color(0, 255, 0); //green\n let startEasyGame = function() {\n buildPreGameMenu(easyLevels, cEasy);\n };\n let btnEasy = new Button(x, y, w, h, startEasyGame);\n btnEasy.displayText = \"Start Easy Game\";\n btnEasy.strokeWeight = 0;\n btnEasy.fillColor = cEasy; //green\n btnEasy.hoverColor = color(0, 255 / 2, 0); //darker\n btnEasy.textSize = fontSize;\n btnEasy.textColor = color(0, 0, 0); //black\n btnEasy.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnEasy);\n btnEasy.isDisabled = false; //Disabled button, cannot be used\n\n //Normal Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) + (buffer * progScale);\n y = 450 * progScale;\n cNormal = color(255, 255, 0); //Yellow\n let startNormalGame = function() {\n buildPreGameMenu(normalLevels, cNormal);\n };\n let btnNormal = new Button(x, y, w, h, startNormalGame);\n btnNormal.displayText = \"Start Normal Game\";\n btnNormal.strokeWeight = 0;\n btnNormal.fillColor = cNormal; //Yellow\n btnNormal.hoverColor = color(255 / 2, 255 / 2, 0); //darker\n btnNormal.textSize = fontSize;\n btnNormal.textColor = color(0, 0, 0); //black\n btnNormal.textHoverColor = color(255, 255, 255); //White\n allObjects.push(btnNormal);\n\n //Hard Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) - w - (buffer * progScale);\n y = 600 * progScale;\n cHard = color(255, 100, 100); //Red\n let startHardGame = function() {\n buildPreGameMenu(hardLevels, cHard);\n };\n let btnHard = new Button(x, y, w, h, startHardGame);\n btnHard.displayText = \"Start Hard Game\";\n btnHard.strokeWeight = 0;\n btnHard.fillColor = cHard; //Red\n btnHard.hoverColor = color(255 / 2, 100 / 2, 100 / 2); //darker\n btnHard.textSize = fontSize;\n btnHard.textColor = color(0, 0, 0); //black\n btnHard.textHoverColor = color(255, 255, 255); //White\n allObjects.push(btnHard);\n btnHard.isDisabled = true; //Disabled button, cannot be used\n\n //Master Game button\n w = 475 * progScale;\n h = 100 * progScale;\n x = (width / 2) + (buffer * progScale);\n y = 600 * progScale;\n cMaster = color(255, 0, 255); //Purple\n let startMasterGame = function() {\n buildPreGameMenu(masterLevels, cMaster);\n };\n let btnMaster = new Button(x, y, w, h, startMasterGame);\n btnMaster.displayText = \"Start Master Game\";\n btnMaster.strokeWeight = 0;\n btnMaster.fillColor = cMaster; //Purple\n btnMaster.hoverColor = color(255 / 2, 0, 255 / 2); //darker\n btnMaster.textSize = fontSize;\n btnMaster.textColor = color(0, 0, 0); //black\n btnMaster.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnMaster);\n\n\n //Secret Test Levels Button\n w = 250 * progScale;\n h = 50 * progScale;\n x = 1000 * progScale;\n y = 875 * progScale;\n let startTestLevels = function() {\n clearGameObjects(); //clearing menu\n currentLevelSet = testLevels; //setting set of levels to load\n currentLevel = 1; //for display\n currentLevelIndex = 0; //for level indexing\n gameTimer.reset(); //reseting current time on timer\n buildLevel(currentLevelIndex, currentLevelSet); //starting level\n };\n let btnTest = new Button(x, y, w, h, startTestLevels);\n btnTest.displayText = \"Test Levels\";\n btnTest.strokeWeight = 0;\n btnTest.fillColor = color(0, 0, 0, 0); //transparent\n btnTest.hoverColor = color(255, 100, 100);\n btnTest.textSize = 30 * progScale;\n btnTest.textColor = color(0, 0, 0, 0); //transparent\n btnTest.textHoverColor = color(0, 0, 0);\n allObjects.push(btnTest);\n \n //Info/Options Button\n w = 260 * progScale;\n h = 50 * progScale;\n x = 25 * progScale;\n y = 875 * progScale;\n let setupinfo = function() {\n clearGameObjects(); //clearing menu\n buildInfoScreen(); //building info/options menu\n };\n let btnInfo = new Button(x, y, w, h, setupinfo);\n btnInfo.displayText = \"Info/Options\";\n btnInfo.strokeWeight = 0;\n btnInfo.fillColor = color(255); //White\n btnInfo.hoverColor = color(255/2); //Grey\n btnInfo.textSize = 30 * progScale;\n btnInfo.textColor = color(0); //Black\n btnInfo.textHoverColor = color(255);\n allObjects.push(btnInfo);\n \n //Created By message\n x = width / 2;\n y = 925 * progScale;\n s = \"Created and Programmed by Lee Thibodeau ©2021\";\n let createdBy = new DisplayText(x, y, 0, 0, s);\n createdBy.textSize = 20 * progScale;\n allObjects.push(createdBy);\n}", "function set() {\n if (this.innerHTML !== EMPTY) {\n return;\n }\n this.innerHTML = turn;\n moves += 1;\n score[turn] += this.identifier;\n if (win(this)) {\n player.style.display = \"inline\";\n button.style.display = \"inline\";\n\n player.innerHTML = \"Winner Player\" + turn;\n } else if (moves === N_SIZE * N_SIZE) {\n player.style.display = \"inline\";\n button.style.display = \"inline\";\n\n player.innerHTML = \"Draw\";\n } else {\n turn = turn === \"X\" ? \"O\" : \"X\";\n document.getElementById('turn').textContent = 'Player ' + turn;\n }\n}", "function gamePunctuation() {\n gameType = 3;\n lastKnownButtonId = undefined;\n lastKnownButtonNumber = undefined;\n wait = false;\n numbers = getRandom(punctuation, 8);\n shuffle(numbers);\n distributeNumbers(gameType);\n matches = 0;\n\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].innerHTML = getgPunctuationImage(0);\n buttons[i].style.backgroundColor = \"rgba(255, 255, 255, 0.7)\";\n\n document.querySelector(\".win-container\").style.display = \"none\";\n document.getElementById(\"6\").style.display = \"block\";\n document.getElementById(\"7\").style.display = \"block\";\n document.getElementById(\"10\").style.display = \"block\";\n document.getElementById(\"11\").style.display = \"block\";\n }\n}", "function C101_KinbakuClub_Discipline_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\t\t\t\n\t// Jump to lunch on phase 3\n\t//if (TextPhase >= 4) SaveMenu(\"C102_KinbakuDiscipline\", \"Intro\");\n\n}", "function clicked() {\r\n switch (this.innerHTML) {\r\n case \"w\":\r\n var audio = new Audio(\"sounds/crash.mp3\");\r\n audio.play();\r\n break;\r\n case \"a\":\r\n var audio = new Audio(\"sounds/kick-bass.mp3\");\r\n audio.play();\r\n break;\r\n case \"s\":\r\n var audio = new Audio(\"sounds/snare.mp3\");\r\n audio.play();\r\n break;\r\n case \"d\":\r\n var audio = new Audio(\"sounds/tom-1.mp3\");\r\n audio.play();\r\n break;\r\n case \"j\":\r\n var audio = new Audio(\"sounds/tom-2.mp3\");\r\n audio.play();\r\n break;\r\n case \"k\":\r\n var audio = new Audio(\"sounds/tom-3.mp3\");\r\n audio.play();\r\n break;\r\n case \"l\":\r\n var audio = new Audio(\"sounds/tom-4.mp3\");\r\n audio.play();\r\n break;\r\n default:console.log(this.innerHTML);\r\n }\r\n buttonAnimation(this.innerHTML);\r\n\r\n}", "function win(){\n displayNoneList()\n document.getElementById(\"text\").innerHTML = \"Congratulations, Player420.6969, you've escaped the infinite hangover death loop, you should feel proud of yourself! Would you like to play again? \";\n document.getElementById('buttonConfirm').style.display = \"none\";\n document.getElementById('choice').style.display = \"none\";\n document.getElementById(\"buttonRestart\").innerHTML = \"Play again\";\n}", "function showMore(quizN) { //more details about the selected quiz\n quizNumber = quizN;\n quizSelected = quizzes[quizN];\n nav();\n header.innerHTML = quizSelected.name;\n let htmlText = \"<div id='buttonsInDetails'>\";\n\n quizName = quizzes[quizN].name;/*this is necessary, otherwise -> if(quizName != quizzes[quizNumber].name)\n wont work, the same is assigned again in later, but it will be necessary for scenario 2*/\n\n if (session !== \"\") { // already running a quiz.\n\n htmlText+= \"<button id='resumeButton' onclick='nextQuestion()'>Resume previous hunt</button><br> \";\n\n footer.innerHTML = \"You have another running treasure hunt !\";\n }else { //no running quiz\n footer.innerHTML = \"Enter a name and <br><strong>START YOUR HUNT</strong> !\";\n htmlText+= \"<input id='nameInput' placeholder='Enter a name here'> <br>\" + //textfield for name\n \"<button class='button' id='startButton' onclick='getQuiz(\" + quizN + \")'>Start</button><br>\" ;\n //button to start\n }\n htmlText+=\"<button onclick='leaderboard(\" +quizN+\n \")' id='leaderButton'>Leaderboard</button><br><br></div>\";\n htmlText += \"<div id='tHDetailsDiv'>\" +\n \"<u>Description:</u> \" + quizzes[quizN].description+\"<br>\"; //description\n if (quizzes[quizN].maxDuration/1000/60> 0){\n htmlText += \"<u>Duration:</u>\" + (quizzes[quizN].maxDuration / 60 / 1000) + \" minutes<br>\"; //duration\n } else {\n htmlText +=\"<u>Duration:</u> Unlimited<br>\";\n }\n htmlText+=\n \"<u>Starts on:</u> \"+ (new Date(quizzes[quizN].startsOn).toUTCString())+\"<br>\"+ //start\n \"<u>Ends on:</u> \"+(new Date(quizzes[quizN].endsOn).toUTCString())+\"<br><br>\"; //end\n if (quizzes[quizN].hasPrize){\n htmlText+=\"With Prize<br>\"; //prize\n } else {\n htmlText+=\"Without Prize<br>\"; //or not\n }\n if (quizzes[quizN].shuffled){ //shuffling\n htmlText+=\"<br>The questions appear in random order<br>\";\n } else {\n htmlText+=\"<br>The questions appear in the same order<br>\";\n }\n htmlText += \"<br>by: \" + quizzes[quizN].ownerEmail + \"</div><br>\" ;\n console.log(session);\n\n addHtmlAndAppend(content, bigDivInContent, htmlText);\n}", "function gameLoad() {\n qDiv.html(\"<div class='d-flex justify-content-center text-align-center'>You will have 30 seconds to answer each question. There are 10 questions, and your score will be shown at the end.</div> <div class='d-flex justify-content-center mt-1'>Press the button below to play and have fun!</div>\")\n aDiv.html(\"<button class='btn btn-secondary btn-sm m-2 btn-block'>Play Now</button>\");\n}", "function showExample(img, btn) {\n 'use strict';\n console.log(\"clicked \" + btn + \" to show \" + img);\n \n var a, gif_class, btns_class;\n \n a = 0;\n gif_class = document.getElementsByClassName(img);\n btns_class = document.getElementsByTagName('button');\n \n \n //identify which button was pressed\n for (a; a < btns_class.length; a++) {\n \n //---SHARE BUTTON---\n if (btn === \"share-btn\") {\n console.log(\"share btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n //set attribute with prototype file\n gif_class[1].setAttribute(\"src\", \"share-gif02.gif\");\n \n //make visible\n document.getElementsByClassName(img)[1].style.visibility = \"visible\";\n \n return;\n \n //---HOME BUTTON---\n } else if (btn === \"home-btn\") {\n console.log(\"home btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---FEED BUTTON---\n } else if (btn === \"feed-btn\") {\n console.log(\"feed btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---UPLOAD BUTTON---\n } else if (btn === \"upload-btn\") {\n console.log(\"upload btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---EVENTS BUTTON---\n } else if (btn === \"events-btn\") {\n console.log(\"events btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---SETTINGS BUTTON---\n } else if (btn === \"settings-btn\") {\n console.log(\"settings btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n\n alert(\"prototype has not been created yet\");\n \n return;\n \n //---CONTACTS BUTTON---\n } else if (btn === \"contacts-btn\") {\n console.log(\"contacts btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n\n alert(\"prototype has not been created yet\");\n \n return;\n \n //---MESSAGING BUTTON---\n } else if (btn === \"messaging-btn\") {\n console.log(\"messaging btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---FEED:UPLOAD TRANSITION---\n } else if (btn === \"feed-upload\") {\n console.log(\"feed:upload btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n\n alert(\"prototype has not been created yet\");\n \n return;\n \n //---FEED:SETTINGS TRANSITION---\n } else if (btn === \"feed-settings\") {\n console.log(\"feed:settings btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n \n alert(\"prototype has not been created yet\");\n \n return;\n \n //---CONTACTS:MESSAGING---\n } else if (btn === \"contacts-msg\") {\n console.log(\"contacts:messaging btn clicked\");\n \n //make active\n activeClass(btn, btns_class);\n \n //check for visible imgs\n if (visibleCheck('storyboard')) {\n //hide if visible\n if (document.getElementsByTagName(\"img\").length > 0) {\n document.getElementsByClassName(img)[1].style.visibility = \"hidden\";\n }\n }\n\n alert(\"prototype has not been created yet\");\n \n return;\n }\n \n console.log(\"showExample() complete\");\n }\n}", "function addSceneCaptions() {\n push();\n fill(255);\n textSize(42);\n\n let theSnake;\n let caption;\n\n switch (currentScene) {\n case \"eden1\":\n theSnake = \"(You hear a hiss...) \\\"I imagine you don't get to do much all day,\\nstuck out like that.\\\"\";\n caption = \"(Get to the bottom by pressing shift to sprint.)\";\n break;\n case \"eden2\":\n theSnake = \"Ah, she came anyways?\\nWell, what can you do right?\\nI guess we can all still be friends.\\n\";\n break;\n case \"eden3\":\n theSnake = \"\\\"Did God really say,\\n\\`You must not eat from any tree in the garden\\'?\\\"\";\n break;\n default:\n break;\n }\n textFont(mountainsOfChristmasFont);\n text(theSnake, 50, height / 1.5);\n text(caption, width / 7, height / 1.2);\n pop();\n}", "function cards() {\n\tvar task = document.getElementById(\"choose\").value;\n\tdocument.getElementById(\"btn\").style.display = \"none\"; \n \tif (task === \"colors\"){\n \tsetVars(colors);\n \tcolor();\n \ttype = \"color\";\n }\n else if (task === \"shapes\"){\n \tsetVars(shapes);\n \timage();\n \ttype = \"image\";\n }\n \telse if (task === \"nums\"){\n \tsetVars(nums);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"capLet\"){\n \tsetVars(caps);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"lowLet\"){\n \tsetVars(low);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry1\"){\n \tsetVars(fry1);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry2\"){\n \tsetVars(fry2);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry3\"){\n \tsetVars(fry3);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry4\"){\n \tsetVars(fry4);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry5\"){\n \tsetVars(fry5);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry6\"){\n \tsetVars(fry6);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry7\"){\n \tsetVars(fry7);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry8\"){\n \tsetVars(fry8);\n \ttext();\n \ttype = \"text\";\n }\t\n \telse if (task === \"fry9\"){\n \tsetVars(fry9);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry10\"){\n \tsetVars(fry10);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"oneTOone10\"){\n \tsetVars(oneTOone10);\n \timage();\n \ttype = \"image\";\n }\n}", "function setUpTurn() {\n game.innerHTML = `<p class=\"center\">Roll the dice for ${gameData.players[gameData.index]}</p>`;\n actionArea.innerHTML = '<button id=\"roll\">Roll the Dice</button>';\n game.innerHTML += '<h3 class=\"piggy1-title\">Hamlet</h3>';\n game.innerHTML += '<h3 class=\"piggy2-title2\">Piglet</h3>';\n game.innerHTML += '<img class =\"img1\" src=\"images/pig.PNG\" alt=\"pig1\">'; \n game.innerHTML += '<img class =\"img2\" src=\"images/pig.PNG\" alt=\"pig2\">'; \n game.innerHTML += '<img class=\"center1\" src=\"images/1die.png\" alt=\"dice1\">'; \n game.innerHTML += '<img class=\"center2\" src=\"images/2die.png\" alt=\"dice2\">';\n showCurrentScore(); \n document.getElementById('roll').addEventListener(\"click\", function(){\n throwDice();\n rollsound.play(); \n });\n }", "function menuGame() {\n // Titles\n push();\n fill(`#54d6`);\n displayText(32, INSTRUCTION_TEXT[0], width / 2.1, height / 5.5);\n displayText(32, INSTRUCTION_TEXT[1], width / 2.1, height / 2.25)\n displayText(32, INSTRUCTION_TEXT[2], width / 2.1, height / 1.5)\n pop();\n\n // MINIGAME 1\n if (minigame1) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[0], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[3], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[4], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[5], width / 2.1, height / 1.35);\n pop();\n }\n // MINIGAME 2\n else if (minigame2) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[1], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[6], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[7], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[8], width / 2.1, height / 1.35);\n pop();\n }\n\n // CLICK TO PLAY\n push();\n fill(`#909eba`);\n displayText(24, INSTRUCTION_TEXT[9], width / 2.1, height / 1.1);\n pop();\n}" ]
[ "0.67953455", "0.67123556", "0.66923004", "0.65786326", "0.65327525", "0.63282275", "0.6197285", "0.6194669", "0.61112314", "0.5984539", "0.5967992", "0.5955947", "0.5896802", "0.5857841", "0.5819762", "0.5806267", "0.5752977", "0.57322645", "0.56742704", "0.5658183", "0.56457037", "0.5639694", "0.55958605", "0.5590425", "0.55837494", "0.55816406", "0.5577691", "0.55765676", "0.5556357", "0.5550814", "0.5542293", "0.5540109", "0.5537487", "0.5515462", "0.5514146", "0.5509206", "0.54977924", "0.5495676", "0.54874384", "0.54837537", "0.5475778", "0.54708564", "0.5464128", "0.5460077", "0.54565704", "0.5454846", "0.54322255", "0.54287547", "0.54217815", "0.5408994", "0.5401024", "0.53794676", "0.53709424", "0.5367429", "0.5366549", "0.53664726", "0.53656936", "0.5362405", "0.53618854", "0.5361193", "0.5342286", "0.5338284", "0.5332071", "0.5326027", "0.5325005", "0.53238225", "0.5317941", "0.5312048", "0.5306911", "0.5304176", "0.52991587", "0.52959156", "0.52890533", "0.528875", "0.5286425", "0.5284308", "0.5281022", "0.5280486", "0.52777475", "0.5266384", "0.5263368", "0.5258965", "0.5258896", "0.525487", "0.5253555", "0.5246512", "0.5243047", "0.52416635", "0.5241442", "0.5240203", "0.5239455", "0.52365667", "0.5233481", "0.5227038", "0.52246237", "0.5223403", "0.5217524", "0.52140445", "0.52094316", "0.5206985" ]
0.7388394
0
Event CALLBACK ; called on menu Click
onshowHideMenu(menuContainer, element, ev) { this.logger.warn('onshowHideMenu using @', element); const rectV = this.video.getBoundingClientRect(); const rect = element.getBoundingClientRect(); if (menuContainer.classList.contains('fj-hide')) { this.logger.warn('setting left @', (rect.right - ev.pageX)); this.logger.warn('setting left @', (rect.left - ev.pageX)); menuContainer.style.left = ev.pageX - rectV.left - rect.width; menuContainer.classList.remove('fj-hide'); } else { menuContainer.classList.add('fj-hide'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "menuButtonClicked() {}", "function ips_menu_events()\n{\n}", "function onOpen() {\n createMenu();\n}", "function OnClicked(param: String)\r\t{\r\t\tif (!ShowMenu(param, true))\r\t\t{\r\t\t\tgameObject.SendMessage(param, SendMessageOptions.DontRequireReceiver);\r\t\t\tShowMenu(\"\", false);\r\t\t\tActivateMenu(false);\r\t\t}\r\t}", "function onOpen() { CUSTOM_MENU.add(); }", "function menuEventListen() {\n var getter = document.getElementById(\"Scont\");\n getter.addEventListener('click', menuShower, false);\n}", "function showhidemenu(){\n\tTi.Analytics.featureEvent(\"openMenu\");\n\talert(\"Menu Button Clicked\");\n}", "function on_paint() {\r\n menu_dt()\r\n menu_idt()\r\n menu_tgt()\r\n menu_aa()\r\n menu_vis()\r\n menu_msc()\r\n handle_vis()\r\n handle_msc_two()\r\n}", "function menuhrres() {\r\n\r\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 handleMenuClick(event){\n if (event.target.id !== menu){\n \tclearWindow()\n callbacks[`${event.target.id}`]()\n // debugger\n }\n}", "viewWasClicked (view) {\n\t\tthis.parent.menuItemWasSelected(view.menuItem)\n\t}", "function onFleetButton( event ) {\r\n\topenWindowMenu(3);\r\n}", "function handleClick(e) {\n\tAlloy.Events.trigger('toggleLeft_Window');\n\n\tlet section = $.Left_elementsList.sections[e.sectionIndex];\n\t// Get the clicked item from that section\n\tlet item = section.getItemAt(e.itemIndex);\n\n\tif (item.label.text == \"Home\") {\n\n\t\tAlloy.Events.trigger('goToHome_fromDetailsWind');\n\t\tAlloy.Events.trigger('goToHome_frommenuListItemWin');\n\n\t} else {\n\n\n\t\t//let centerWin = require('appLevelVariable');\n\t\tlet menulistItemView = Alloy.createController('menuListItem').getView();\n\t\t// Get the section of the clicked item\n\n\t\trequire(\"loader_indica\").removeLoader();\n\t\trequire(\"loader_indica\").addLoader(menulistItemView, \"Loading Data..\");\n\n\t\tTi.API.info(\"Position\" + e.itemIndex);\n\t\t// Update the item's `title` property and set it's color to red:\n\t\tTi.API.info(item.label.text += \" (clicked)\");\n\t\t//Ti.API.info(centerWin_ios.getCenterwin());\n\t\t//centerWin.getCenterwin().add(menulistItemView);\n\t\tAlloy.Globals.centerWin.add(menulistItemView);\n\t\t//Ti.API.info(\"win\",centerWin_ios.getData());\n\t\trequire(\"animation\").rightToLeft(menulistItemView);\n\n\t}\n}", "function menuItemClick(thisMsg)\n{\n // So they selected something... cycle through the options and execute.\n // Game menu...\n if (thisMsg == \"Exit\")\t\t\n window.close()\n else if (thisMsg == \"New\")\n faceClick()\n else if ((thisMsg == \"Beginner\") || (thisMsg == \"Intermediate\") || (thisMsg == \"Expert\")) {\n\t initMines(thisMsg);\n }\n else if (thisMsg == \"Custom\") {\n \n }\n else if (thisMsg == \"Personal\") {\n }\n else if (thisMsg == \"World\") {\n }\n // Options menu\n else if (thisMsg == \"Marks\") {\n useQuestionMarks = ! useQuestionMarks;\n }\n else if (thisMsg == \"Area\") {\n useMacroOpen = ! useMacroOpen;\n }\n else if (thisMsg == \"First\") {\n useFirstClickUseful = ! useFirstClickUseful;\n\t }\n else if (thisMsg == \"Remaining\") {\n openRemaining = ! openRemaining;\n updateNumBombs();\n\t }\n // Help menu\n else if (thisMsg == \"About\") {\talertBox('Locate the hidden bombs in the mine field without stepping on them!'); }\n else if (thisMsg == \"Instructions\") {\talertBox('Click the tiles to reveal them. Numbers indicate the amount of bombs around. Right click the mines.'); }\n // Since we clicked, close the menu.\n closeAllMenus();\n // Always return a false to prevent the executing of the default href.\n // (this is a neat trick - we've already handled the event, so we bypass the default href link)\n return false; }", "function NavBar_Item_Click(event)\n{\n\t//get html\n\tvar html = Browser_GetEventSourceElement(event);\n\t//this a sub component?\n\tif (html.Style_Parent)\n\t{\n\t\t//use the parent\n\t\thtml = html.Style_Parent;\n\t}\n\t//valid?\n\tif (html && html.Action_Parent && !html.IsSelected || __DESIGNER_CONTROLLER)\n\t{\n\t\t//get the data\n\t\tvar data = [\"\" + html.Action_Index];\n\t\t//trigger the event\n\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(html.Action_Parent, __NEMESIS_EVENT_SELECT, data));\n\t\t//not blocking it?\n\t\tif (!result.Block)\n\t\t{\n\t\t\t//not an action?\n\t\t\tif (!result.AdvanceToStateId)\n\t\t\t{\n\t\t\t\t//notify that we have changed data\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: html.Action_Parent.GetDesignerName(), Data: data });\n\t\t\t}\n\t\t\t//update selection\n\t\t\thtml.Action_Parent.Properties[__NEMESIS_PROPERTY_SELECTION] = html.Action_Index;\n\t\t\t//and update its state\n\t\t\tNavBar_UpdateSelection(html.Action_Parent.HTML, html.Action_Parent);\n\t\t}\n\t}\n}", "function onItemActionClick(event){\r\n\t\t\t\t\r\n\t\t//var obj\r\n\t\tvar objButton = jQuery(this);\r\n\t\tvar objItem = objButton.parents(\"li\");\r\n\t\t\r\n\t\tg_objItems.selectSingleItem(objItem);\r\n\t\t\r\n\t\tvar action = objButton.data(\"action\");\r\n\t\t\r\n\t\tif(action == \"open_menu\")\r\n\t\t\treturn(true);\r\n\t\t\r\n\t\tt.runItemAction(action);\r\n\t\t\r\n\t}", "function onClickHandlerMainMenu(e) {\n\tif(e.target){\n\t\tvar navTo=false;\n\t\tvar navTarget;\n\n\t\tswitch(e.currentTarget.id)\n\t\t{\n\t\t\tcase \"menu_nav\":\n\t\t\t{\n\t\t\t\tnavTo=true;\n\t\t\t}\n\t\t\tcase \"menu_lang\":\n\t\t\t{\n\t\t\t\tif(e.target.nodeName == \"A\" || e.target.nodeName == \"IMG\" ) {\n\t\t\t\t\tif(e.target.parentNode.className != \"selected\") {\n\t\t\t\t\t\tif( e.target.parentNode.id ==\"timemachine\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twindow.open(\"http://www.loisjeans.com/thetimemachine\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// clear selected on other buttons... e.currentTarget is \"menu_nav\" || \"menu_lang\"\n\t\t\t\t\t\tclearSelecteds( e.currentTarget );\n\t\t\t\t\t\tclearSelecteds( document.querySelector(\"#menu_footer\") );\n\n\t\t\t\t\t\tvar isSub=false;\n\t\t\t\t\t\tif(e.target.parentNode.parentNode.className == \"submenu\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// set class selected on menu, if clicked is child of submenu...\n\t\t\t\t\t\t\te.target.parentNode.parentNode.parentNode.className=\"selected\";\n\t\t\t\t\t\t\tisSub=true;\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\t// if submenu clicked, set first children \"selected\"\n\t\t\t\t\t\t\tvar list = e.target.parentNode.getElementsByTagName(\"UL\");\n\t\t\t\t\t\t\tif(list[0]){\n\t\t\t\t\t\t\t\tlist.item(0).getElementsByTagName(\"LI\")[0].className = \"selected\";\n\t\t\t\t\t\t\t\tnavTarget=\"sec_\"+list.item(0).getElementsByTagName(\"LI\")[0].id;\n\t\t\t\t\t\t\t\t// TODO: move this to a function!\n\t\t\t\t\t\t\t\tvar tamano;\n\t\t\t\t\t\t\t\tvar a = list.item(0).getElementsByTagName(\"A\")[0];\n\t\t\t\t\t\t\t\tif($(this).css('text-align') == \"right\"){\n\t\t\t\t\t\t\t\t\ttamano=-400-$(a).innerWidth();\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\ttamano=$(a).innerWidth()-400;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t$(a).stop(true,true).animate({backgroundPosition:'('+tamano+'px 0px)'},(-350*(tamano/400)),\"easeInOutQuart\");\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t\t// set class selected on clicked element...\n\t\t\t\t\t\te.target.parentNode.className=\"selected\";\n\n\t\t\t\t\t\tif(!navTarget){\n\t\t\t\t\t\t\tnavTarget=\"sec_\"+e.target.parentNode.id;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// move spanBar into position\n\t\t\t\t\t\tif(!isSub){\n\t\t\t\t\t\t\t// if not submenu, move to <a>\n\t\t\t\t\t\t\tmoveBarTo(e.target.parentNode, true);\n\t\t\t\t\t\t}else if(e.currentTarget.id != \"menu_lang\") {\n\t\t\t\t\t\t\t// if submenu, move to parent <a>\n\t\t\t\t\t\t\tmoveBarTo(e.target.parentNode.parentNode.parentNode, true);\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tif(navTarget && navTo){\n\t\t\t\t\tif( $(\"#outer_container\").css('display') != \"none\" ){\n\t\t\t\t\t\tunPanIt();\n\t\t\t\t\t\t$(\"#outer_container\").fadeOut(300,function(){\n\t\t\t\t\t\t\t$('#outer_container #close').hide();\n\t\t\t\t\t\t\t$('#outer_container #pan_container').html('');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnavigateTo(navTarget);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tcase \"menu_footer\":\n\t\t\t{\n\t\t\t\tif(e.target.nodeName == \"A\" )\n\t\t\t\t{\n\t\t\t\t\tclearSelecteds( document.querySelector(\"#menu_nav\") );\n\t\t\t\t\tclearSelecteds( document.querySelector(\"#menu_footer\") );\n\t\t\t\t\te.target.parentNode.className=\"selected\";\n\t\t\t\t\t$(\"#main_nav>span\").css('width', '0px');\n\t\t\t\t\t$(\"#main_nav>span\").css('left', '0px');\n\t\t\t\t\tif( $(\"#outer_container\").css('display') != \"none\" ){\n\t\t\t\t\t\tunPanIt();\n\t\t\t\t\t\t$(\"#outer_container\").fadeOut(300,function(){\n\t\t\t\t\t\t\t$('#outer_container #pan_container').html('');\n\t\t\t\t\t\t\t$('#outer_container #close').hide();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnavigateTo(\"sec_\"+e.target.parentNode.id);\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t};\n\t};\n}", "domListener(){\n this.menuDisplay([\"file\",\"rotate\",\"brush\",\"outline\",\"fills\",\"size\"]);\n }", "function onContextMenu_Item(event, mEdit, mCopy, callbackEvent, callbackWindow, jaloPk, webroot) {\r\n\tvar element = getMenuHTMLElement();\r\n\tshowCMSMenu( element, event);\r\n\taddItemLinks(element, mEdit, mCopy, callbackEvent, callbackWindow, jaloPk, webroot);\r\n\tevent.cancelBubble=true;\r\n\treturn false;\r\n}", "function evtRoutine1( sender, parms )\n {\n var fld = this.FLD.D1_MAIN, ref = this.REF, rtn = Lansa.evtRoutine( this, COM_OWNER, \"#AppBar.IconClick\", 45 );\n\n //\n // EVTROUTINE Handling(#AppBar.IconClick)\n //\n rtn.Line( 45 );\n {\n\n //\n // #AppDrawer.ToggleDrawer\n //\n rtn.Line( 47 );\n ref.APPDRAWER.mthTOGGLEDRAWER();\n\n //\n // #std_textl := '1425'\n //\n rtn.Line( 48 );\n fld.STD_TEXTL.set( \"1425\" );\n\n }\n\n //\n // ENDROUTINE\n //\n rtn.Line( 50 );\n rtn.end();\n }", "function myLoadEvent(){\r\n\tvar startMenu = document.getElementById('start');//get the id of the element\r\n\tstartMenu.addEventListener('click', start);//\r\n\r\n}", "function burgerclick(evt) {\n $(this).toggleClass(\"change\");\n $(\"body\").toggleClass(\"translateMenu\");\n remouvEventMenuClick();\n }", "function onMenuItemClick(p_sType, p_aArgs, p_oValue) {\n if (p_oValue == \"startVM\") \t{ \n\t\tYAHOO.vnode.container.dialog1.show()\n\t\tYAHOO.vnode.container.dialog1.focus()\n }\n\telse if (p_oValue == \"terminateVM\") {\n\t\tYAHOO.vnode.container.dialog2.show()\n\t\tYAHOO.vnode.container.dialog2.focus()\n }\n else if (p_oValue == \"stateVM\") {\n YAHOO.vnode.container.dialog3.show()\n\t\tYAHOO.vnode.container.dialog3.focus()\n }\n else if (p_oValue == \"upTimeVM\") {\n YAHOO.vnode.container.dialog4.show()\n\t\tYAHOO.vnode.container.dialog4.focus()\n }\n else if (p_oValue == \"startVG\") {\n YAHOO.vnode.container.dialog5.show()\n\t\tYAHOO.vnode.container.dialog5.focus()\n }\n else if (p_oValue == \"stateVG\") {\n YAHOO.vnode.container.dialog6.show()\n\t\tYAHOO.vnode.container.dialog6.focus()\n }\n else if (p_oValue == \"terminateVG\") {\n YAHOO.vnode.container.dialog7.show()\n\t\tYAHOO.vnode.container.dialog7.focus()\n }\n else if (p_oValue == \"adminPanel\") {\n if (checkPermission()) {\n YAHOO.vnode.container.dialog8.show()\n\t \tYAHOO.vnode.container.dialog8.focus()\n }\n else {\n alert(\"User is not allowed\")\n }\n }\n}", "function markingMenuOnMouseDown() {\r\n\ttracker.startTimer();\r\n}", "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "on_PRELOAD_ENTER (e) {\n this.menu.hide();\n }", "function handleMenuClick(event) {\n setMenuOpen(event.currentTarget);\n }", "function onProductionButton( event ) {\r\n\topenWindowMenu(2);\r\n}", "function menuSelection(e){\n\tconst selectedScreen = `screen${e.target.id}`;\n\twindow[selectedScreen]();\n}", "function menuOpen(ev) {\n switch(ev.target.id) {\n case \"class-btn\":\n closeMenus(); \n document.getElementById(\"class-menu\").style.display = \"block\";\n break;\n case \"prof-btn\":\n closeMenus(); \n document.getElementById(\"prof-menu\").style.display = \"block\";\n break;\n case \"choose-schedule-btn\":\n closeMenus(); \n document.getElementById(\"choose-schedule-menu\").style.display = \"block\";\n break;\n case \"add-class-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add classes.\");\n return;\n }\n \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"class\");\n document.getElementById(\"add-class\").style.display = \"block\";\n break;\n case \"add-prof-alt\":\n document.getElementById(\"add-class\").className += \" blur-on\";\n case \"add-prof-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add professors.\");\n return;\n }\n\t \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"prof\");\n document.getElementById(\"add-prof\").style.display = \"block\";\n break;\n case \"add-schedule-btn\":\n _popUpCount++;\n document.getElementById(\"add-schedule\").style.display = \"block\";\n break;\n }\n }", "function onClick(event) {\n\t\t//console.log(event);\t\t\n\t\tvar target = event.target;\n\t\tif (target.classList.contains(\"ui-selector-indicator\")) {\n\t\t\t//console.log(\"Indicator clicked\");\n\t\t\tvar ItemClicked = event.srcElement.textContent;\n\t\t\tconsole.log(\"Item Clicked on home page was: \" + ItemClicked);\n\n\t\t\t//Handel home page click events\n\t\t\tif(ItemClicked == \"Switches\"){\n\t\t\t\ttau.changePage(\"switchesPage\");\n\t\t\t}else if(ItemClicked == \"Clear Database\"){\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t\t//This should be moved to it's own function.\n\t\t\t\tconsole.log(\"Clearing Database\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tAccess_Token = null;\n\t\t\t\tAccess_Url = null;\n\t\t\t\tswitches_DB = null;\n\t\t\t\talert(\"Database Cleared\");\n\t\t\t\t//Maybe we should exit here?\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t}else if(ItemClicked == \"Routines\"){\n\t\t\t\ttau.changePage(\"routinesPage\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "function navigasjonsmeny() {\n $('.trestripeknapp').click(function() {\n menyFram();\n })\n}", "function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}", "clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }", "function cbShown(menu_item){\n\t\t\tsettings.onShown.call($(menu_item).parent())\n\t\t}", "function cb_beforeClick(cb, pos) { }", "function clickListener() {\n document.addEventListener( \"click\", function(e) {\n var clickeElIsLink = clickInsideElement( e, contextMenuLinkClassName );\n\n if ( clickeElIsLink ) {\n e.preventDefault();\n menuItemListener( clickeElIsLink );\n } else {\n var button = e.which || e.button;\n if ( button === 1 ) {\n toggleMenuOff();\n }\n }\n });\n }", "function initMenuListener() {\n /*\n Left Panel\n */\n // Prevent default behavior and use ajax to load pages.\n $(\"#nav\").on(\"click\", \"a\", function (e) {\n e.preventDefault();\n var page = $(this).attr(\"href\");\n var title = $(this).html();\n // Dont load a href link from the closebutton in menu.\n if (page != '#closeleft') {\n loadPage(page, title);\n }\n });\n\n // Close left panel when clicking on menu item\n $(\"#nav-panel\").on(\"click\", \"li\", function () {\n $(\"#nav-panel\").panel(\"close\");\n });\n\n }", "function handleMenuClick(_event) {\n if(typeof _event.row.id !== \"undefined\") {\n // Open the corresponding controller\n if (Ti.App.user_role == \"admin\")\n openScreen(_event.row.id);\n else if (geofence.checkLocal()){\n openScreen(_event.row.id);\n }\n }\n}", "function menuOptions() {}", "function simulat_menu_infos() {\n display_menu_infos();\n}", "function menuHighlightClick(event) {\n // console.log('menuHighlightClick');\n\n event.preventDefault();\n\n SvgModule.Data.Highlighting = !SvgModule.Data.Highlighting;\n\n updateMenu();\n}", "on_desklet_clicked(event) {\n this.retrieveEvents();\n }", "handleToggleMenu(listId) {}", "function ContextMenuClickHandler() {\n $(settings.menuSelector)\n .off('click')\n .on('click', function(e) {\n $(this).hide();\n\n var $invokedOn = $(this).data(\"invokedOn\");\n var $selectedMenu = $(e.target);\n\n settings.menuSelected.call($(this), $invokedOn, $selectedMenu);\n });\n\n }", "function testMenuPostion( menu ){\n \n }", "function addListenerToMenu() {\n mainMenu.addEventListener('click', function (e) {\n const clickedButton = e.target.closest('.menu-btn');\n const buttonName = clickedButton.textContent;\n const buttonActive = document.querySelector('.btn-active');\n\n if (!clickedButton || clickedButton === buttonActive) {\n return;\n }\n\n if (buttonActive) {\n buttonActive.classList.remove('btn-active');\n }\n\n clickedButton.classList.add('btn-active');\n\n cars.forEach(function (obj) {\n if (obj.name === buttonName) {\n showContent(obj);\n hideBurgerMenu();\n }\n });\n\n });\n }", "function xcustom_onContextMenu(event) {\r\n console.log('there we are...');\r\n}", "function clickMenuItems(item, menuIndex){\n\titem.onclick = function(){\n\t\tpdx = idx;\n\t\tidx = menuIndex;\n\t\tchangeSlide();\n\t}\n}", "function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}", "function clickListener() {\n document.addEventListener(\"click\", function (e) {\n var clickeElIsLink = clickInsideElement(e, contextMenuLinkClassName);\n if (clickeElIsLink) {\n e.preventDefault();\n menuItemListener(clickeElIsLink);\n } else {\n var button = e.which || e.button;\n if (button === 1) {\n toggleMenuOff();\n }\n }\n });\n}", "function MenuCallback(key, option){ //menu invoke callback\n switch(key){\n case \"edit\":\n mp.trigger(\"editMenuCallback\", currentCellMenuSelected);\n break\n case \"drop\":\n RemoveItemFromCell(currentCellMenuSelected);\n mp.trigger(\"dropMenuCallback\", currentCellMenuSelected);\n break;\n case \"cut\":\n mp.trigger(\"cutMenuCallback\", currentCellMenuSelected);\n break;\n }\n\n currentCellMenuSelected = \"none\";\n}", "events() {\n\t\tthis.menuIcon.addEventListener(\"click\", () => this.toggleTheMenu());\n\t}", "function clickInBrowser(){\n if (! lastClickOnMenu) {\n closeMenu(\"divMenuHelp\");\n closeMenu(\"divMenuOpt\");\n closeMenu(\"divMenuGame\"); }\n lastClickOnMenu = false;}", "metodoClick(){\n console.log(\"diste click\")\n }", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSections(event);\n}", "clicked() {\n this.get('onOpen')();\n }", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "_itemsContainerMenuHandler(event) {\n const that = this,\n menu = that.$.menu,\n layoutRect = that.getBoundingClientRect(),\n menuButtonRect = event.detail.button.getBoundingClientRect();\n\n menu.open(menuButtonRect.left - layoutRect.left, menuButtonRect.top - layoutRect.top);\n that._menuOpenButton = event.detail.button;\n }", "function menuClickListeners() {\n $('#cogsci').on('click', function() {\n chosenQuiz = QUIZZES.cogsci;\n startGame();\n });\n $('#ibm').on('click', function() {\n chosenQuiz = QUIZZES.ibm;\n startGame();\n });\n $('#deutsch').on('click', function() {\n chosenQuiz = QUIZZES.deutsch;\n startGame();\n });\n $('#about').on('click', function() {\n chosenQuiz = QUIZZES.about;\n $('#menu').hide('slow');\n $('#about-me').show('slow');\n cStatus.about = true;\n });\n}", "onMouseClick(event) {\n const me = this,\n menuItem = event.target.closest('.b-menuitem');\n\n if (menuItem) {\n me.triggerElement(menuItem, event);\n\n // IE / Edge still triggers event listeners that were removed in a listener - prevent this\n event.stopImmediatePropagation();\n }\n }", "function leftMenuClick() {\r\n\t// 左边菜单添加click事件及样式\r\n\t$(\"#cntLeft .nav\").find(\"a\").bind('click', function() {\r\n\t\t$(\"#cntLeft .nav\").find(\"li\").removeClass(\"lon\");\r\n\t\t$(\"#cntLeft .nav\").find(\"a\").removeClass(\"on\");\r\n\t\t$(\"#cntLeft .nav\").find(\"i\").each(function() {\r\n\r\n\t\t\tvar i_class = $(this).attr(\"class\");\r\n\t\t\tvar i_on_class = \"on\" + $.trim(i_class).substring(\"i\");\r\n\t\t\t$(this).removeClass(i_on_class);\r\n\t\t});\r\n\t\t$(this).addClass(\"on\");\r\n\t\t$(this).parent().addClass(\"lon\");\r\n\t\tvar i_class = $(this).find(\"i\").attr(\"class\");\r\n\t\tvar i_on_num = $.trim(i_class).substring(1);\r\n\t\t$(this).find(\"i\").addClass(\"on\" + i_on_num);\r\n\t\t// 添加右边菜单\r\n\t\taddRightMenu(i_on_num);\r\n\t\t// 添加导航\r\n\t\tvar cntLeftText = $(this).text();\r\n\t\t$('#cTnav').html('<a href=\"javascript:void(0);\">' + cntLeftText + '</a>');\r\n\t\tcRTnavBindClick();\r\n\t});\r\n\tinitMenu();\r\n}", "function closeMenuEvent() {\n // Vars\n var firstLevelMenuItem = '#tablet-mobile-menu ul.menu li a';\n var page = jQuery(\"body, html\");\n\n jQuery('#menu-btn-toggle').removeClass('open');\n jQuery(firstLevelMenuItem).parent().removeClass('active-open');\n\n //TODO Change the skin position only when present\n jQuery(page).css(\"background-position\", \"center top\").css(\"position\", \"initial\");\n}", "function uiClick(e) {\n var clickedId = null;\n if ('target' in e) {\n clickedId = e.target.id;\n }\n if (clickedId === null) {\n return;\n }\n // Menu button.\n if (clickedId === 'menu-button') {\n menuShow();\n }\n // Search button.\n if (clickedId === 'search-button') {\n ui.searchContainer.toggleClass('open');\n if (ui.searchContainer.hasClass('open')) {\n $('.search-input').focus();\n } else {\n $('.search-input').blur();\n }\n }\n\n if (clickedId == 'location') {\n locationZoom();\n }\n if (clickedId == 'compass') {\n ui.mapContainer.toggleClass('hide');\n ui.infoBox.toggleClass('hide');\n if (ui.mapContainer.hasClass('hide')) {\n // Map is hidden, so compass should be revealed.\n compass.checkOperation();\n }\n }\n if (clickedId == 'nav_help') {\n menuHide();\n Help.start();\n }\n if (clickedId === 'nav_satellite') {\n // Change the map to/from satellite imagery.\n map.toggleImagery();\n menuHide();\n }\n if (clickedId === 'nav_language') {\n ui.mainMenuContainer.removeClass('open');\n ui.languageContainer.addClass('open');\n }\n if (clickedId.indexOf('lang_') == 0) {\n ui.languageContainer.removeClass('open');\n menuHide();\n // Change the language!\n var lang = clickedId.substr(5);\n if (messages.setLanguage(lang)) {\n loadText();\n if (displayedCode !== null) {\n displayCodeInformation();\n displayCodeMapCompass(displayedCode);\n }\n }\n }\n}", "function doOpen(e) {\n $.win.invalidateOptionsMenu();\n}", "function main() {\n\t$('.icon-menu').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': '0px'\n\t\t}, 600);\n\n// *********close-menu**********\n\t$('.icon-close').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': -285\n\t\t}, 600);\n\t});\n\n\t});\n}", "function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}", "ChangeMenu() {\n this.props.handleClick(this.props.title);\n }", "function mainMenuClick() {\n //load landing screen of the game\n loadHomeScreen();\n //play button audio sound\n playButtonAudio();\n}", "_menuEventColor() {\n\n this.colorData[\"type\"] = \"set-color\";\n this._menuEventHandler(this.colorData);\n this.colorData[\"type\"] = \"select-color\";\n }", "_handleClick(event) {\n if (this.triggersSubmenu()) {\n // Stop event propagation to avoid closing the parent menu.\n event.stopPropagation();\n this.openMenu();\n }\n else {\n this.toggleMenu();\n }\n }", "function addMeniuClickEvents() {\n var listItems = document.querySelectorAll('.list-group-item')\n listItems.forEach(function (el, i) {\n if (i !== 0) {\n el.addEventListener('click', function () {\n var itemNr = el.dataset.id\n addOrder(menuList[itemNr - 1])\n })\n }\n })\n }", "function mainMenu() {\n hideOverlay();\n showOverlay();\n getId('quitText').innerHTML = \"Go to the<br>MAIN MENU?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"Back\";\n}", "onMouseClick(event) {\n const me = this,\n menuItem = event.target.closest('.b-menuitem');\n\n if (menuItem) {\n me.triggerElement(menuItem, event); // IE / Edge still triggers event listeners that were removed in a listener - prevent this\n\n event.stopImmediatePropagation();\n }\n }", "function onOpen() {\n var ui = DocumentApp.getUi();\n ui.createMenu('Script menu')\n .addItem('Setup', 'setup')\n .addItem('Create Events First Time', 'createDocForEvents')\n .addToUi();\n}", "function selectClickOnLinkClick (e) {\n selectMenuItem('click-on-link-menu', 'click');\n e.preventDefault();\n}", "function navbarButtonListenerAction(){\r\n if (!(navButton_MQ.matches)) {\r\n $('.nav-button').attr('clicked','false');\r\n $('.nav-button').css('display','none');\r\n var links=$('.nav-dd .nav-link');\r\n $('.nav-dd').remove();\r\n $('.links-part').append(links);\r\n }else{\r\n $('.nav-button').css('display','inline-block');\r\n var links=$('.links-part .nav-link');\r\n links.remove()\r\n $('.ez-nav-bar').append('<div class=\"nav-dd\"></div>');\r\n $('.nav-dd').css('display','none');\r\n $('.nav-dd').append(links);\r\n var navBarHeight=$('.ez-nav-bar').css(\"height\");\r\n $('.nav-dd').css(\"top\",navBarHeight);\r\n }\r\n }", "beforeContextMenuShow() {}", "beforeContextMenuShow() {}", "function clickOnNav() {\n\t\t//click nav event\n\t\t$('.nav-icon, .left-menu').click(function(){\n\t\t\t//when menu is open\n\t\t\tif ($(this).hasClass('active')) {\n\t\t\t\tcloseSubNav();\n\t\t\t} else {\n\t\t\t//when menu is closed\n\t\t\t\topenSubNav($(this));\n\t\t\t}\n\t\t});\n\t}", "function burgerMenu(e) {\n $('.icon-one').click(function() {\n $('.sideSection nav ul li').toggle('show')\n })\n }", "function loadmenu() {\n console.log(\"clicked\");\n location.href=\"menu.html\";\n}", "function _attachMenuActions() {\n $('#toggleAnimation').click(function(){\n if($(this).text() == \"Pause\"){\n $(this).html(\"Start\");\n $(document).bgStretcher.pause();\n $('#previousImage').removeClass('disabled');\n $('#nextImage').removeClass('disabled');\n } else {\n $(this).html(\"Pause\");\n $(document).bgStretcher.play();\n $('#previousImage').addClass('disabled');\n $('#nextImage').addClass('disabled');\n }\n \t });\n\n $('#previousImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.previous();\n });\n\n $('#nextImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.next();\n });\n\n $('.album').click(function() {\n $(document).bgStretcher.changeAlbum($(this).text());\n });\n }", "function handleOpenMenu() {\n setOpenMenu(!openMenu);\n }", "function navMenuController() {\n attachEventListener([DOMelements.navMenu], 'click', [navMenuClickEvent]);\n}", "static onClick_() {\n if (MenuManager.isMenuOpen()) {\n ActionManager.exitCurrentMenu();\n } else {\n Navigator.byItem.exitGroupUnconditionally();\n }\n }", "function callbackTouchStart(e) {\n this.isMove = false;\n var control = this.getOwnerControl(/** @type {Node} */ (e.target));\n // Highlight the menu item.\n control.handleMouseDown(e);\n }", "handleMenuClick(e){\n this.toggleMenu();\n \n e.stopPropagation(); //parents not told of the click\n }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function HB_Element_Menu() {\n\t \t$( 'body.wr-desktop' ).on( 'click', '.hb-menu .menu-icon-action', function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.parents( '.hb-menu' );\n\n\t\t\t// Add class active for icon\n\t\t\t_this.find( '.wr-burger-scale' ).addClass( 'wr-acitve-burger' );\n\n\t\t\t/*******************************************************************\n\t\t\t * Render HTML for effect *\n\t\t\t ******************************************************************/\n\t\t\t var menu_content = parent.find( '.site-navigator-outer' )[ 0 ].outerHTML;\n\n\t\t\t// Render menu content\n\t\t\tif ( !$( 'body > .hb-menu-outer' ).length ) {\n\t\t\t\t$( 'body' ).append( '<div class=\"hb-menu-outer\"></div>' );\n\t\t\t}\n\t\t\t$( 'body > .hb-menu-outer' ).html( menu_content );\n\n\t\t\t// Render overlay\n\t\t\tif ( !$( 'body > .hd-overlay-menu' ).length ) {\n\t\t\t\t$( 'body' ).append( '<div class=\"hd-overlay-menu\"></div>' );\n\t\t\t}\n\n\t\t\t/*******************************************************************\n\t\t\t * Animation *\n\t\t\t ******************************************************************/\n\t\t\t var layout = _this.attr( 'data-layout' );\n\t\t\t var effect = _this.attr( 'data-effect' );\n\t\t\t var position = _this.attr( 'data-position' );\n\t\t\t var animation = _this.attr( 'data-animation' );\n\t\t\t var wrapper_animation = $( 'body > .wrapper-outer' );\n\t\t\t var sidebar_animation = $( 'body > .hb-menu-outer .sidebar-style' );\n\t\t\t var sidebar_animation_outer = $( 'body > .hb-menu-outer' );\n\t\t\t var sidebar_animation_inner = $( 'body > .hb-menu-outer ul.site-navigator' );\n\t\t\t var overlay = $( 'body > .hd-overlay-menu' );\n\n\t\t\t var fullscreen = $( 'body > .hb-menu-outer .fullscreen-style' )\n\n\t\t\t var width_sidebar = sidebar_animation.innerWidth();\n\t\t\t var height_sidebar = sidebar_animation.innerHeight();\n\n\t\t\t// Add attributes general\n\t\t\t$( 'html' ).addClass( 'no-scroll' );\n\n\t\t\tif ( layout == 'fullscreen' ) {\n\n\t\t\t\tswitch ( effect ) {\n\n\t\t\t\t\tcase 'none':\n\t\t\t\t\tfullscreen.show();\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fade':\n\t\t\t\t\tfullscreen.fadeIn( 100 );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'scale':\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\tfullscreen.addClass( 'scale-active' );\n\t\t\t\t\t}, 100 );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( layout == 'sidebar' ) {\n\n\t\t\t\t// Add attributes for overlay\n\t\t\t\toverlay.attr( 'data-position', position );\n\t\t\t\toverlay.attr( 'data-animation', animation );\n\n\t\t\t\toverlay.fadeIn();\n\n\t\t\t\tsidebar_animation.css( 'opacity', 1 );\n\n\t\t\t\tvar admin_bar = $( '#wpadminbar' );\n\t\t\t\tif ( admin_bar.length ) {\n\t\t\t\t\tsidebar_animation.css( 'top', admin_bar.height() + 'px' );\n\t\t\t\t} else {\n\t\t\t\t\tsidebar_animation.css( 'top', '0px' );\n\t\t\t\t}\n\n\t\t\t\tswitch ( position ) {\n\t\t\t\t\tcase 'left':\n\n\t\t\t\t\tsidebar_animation.css( {\n\t\t\t\t\t\t'visibility': 'visible',\n\t\t\t\t\t\t'left': '-' + width_sidebar + 'px'\n\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\t\twrapper_animation.css( {\n\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t'left': width_sidebar + 'px'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tswitch ( animation ) {\n\t\t\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'push':\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'right':\n\n\t\t\t\t\t\tsidebar_animation.css( {\n\t\t\t\t\t\t\t'visibility': 'visible',\n\t\t\t\t\t\t\t'right': '-' + width_sidebar + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\t\t\twrapper_animation.css( {\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t'right': width_sidebar + 'px'\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tswitch ( animation ) {\n\t\t\t\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'push':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\t\t\t\tsidebar_animation_inner.css( {\n\t\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\t\t'top': '0px'\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\n$( 'body' ).on( 'click', '.fullscreen-style .close', function() {\n\n\t\t\t// Remove class active for icon\n\t\t\t$( '.wr-burger-scale' ).removeClass( 'wr-acitve-burger' );\n\n\t\t\tvar _this = $( this );\n\n\t\t\tvar parent = _this.parents( '.hb-menu-outer' );\n\n\t\t\tvar effect = _this.attr( 'data-effect' );\n\n\t\t\tswitch ( effect ) {\n\n\t\t\t\tcase 'none':\n\t\t\t\tparent.remove();\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'fade':\n\t\t\t\tparent.find( '.site-navigator-outer' ).fadeOut( 300, function() {\n\t\t\t\t\tparent.remove();\n\t\t\t\t} );\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'scale':\n\t\t\t\tparent.find( '.site-navigator-outer' ).removeClass( 'scale-active' );\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tparent.remove();\n\t\t\t\t}, 300 );\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t\t$( 'body > .wrapper-outer' ).removeAttr( 'style' );\n\t\t} )\n\n$( 'body' ).on( 'click', '.hd-overlay-menu', function() {\n\n\t\t\t// Remove class active for icon\n\t\t\t$( '.wr-burger-scale' ).removeClass( 'wr-acitve-burger' );\n\n\t\t\tvar _this = $( this );\n\t\t\tvar position = _this.attr( 'data-position' );\n\t\t\tvar animation = _this.attr( 'data-animation' );\n\t\t\tvar wrapper_animation = $( 'body > .wrapper-outer' );\n\t\t\tvar sidebar_animation = $( 'body > .hb-menu-outer .sidebar-style' );\n\t\t\tvar sidebar_animation_inner = $( 'body > .hb-menu-outer ul.site-navigator' );\n\t\t\tvar width_sidebar = sidebar_animation.innerWidth();\n\t\t\tvar height_sidebar = sidebar_animation.innerHeight();\n\n\t\t\t_this.fadeOut();\n\n\t\t\t// Remove all style\n\t\t\tsetTimeout( function() {\n\t\t\t\t$( 'body > .hb-menu-outer' ).remove();\n\t\t\t\t_this.remove();\n\t\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t\t\t$( 'body > .wrapper-outer' ).removeAttr( 'style' );\n\t\t\t}, 500 );\n\n\t\t\tswitch ( position ) {\n\t\t\t\tcase 'left':\n\n\t\t\t\tsidebar_animation.animate( {\n\t\t\t\t\t'left': '-' + width_sidebar + 'px'\n\t\t\t\t} );\n\n\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\twrapper_animation.animate( {\n\t\t\t\t\t\t'left': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\tswitch ( animation ) {\n\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'push':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'right':\n\n\t\t\t\tsidebar_animation.animate( {\n\t\t\t\t\t'right': '-' + width_sidebar + 'px'\n\t\t\t\t} );\n\n\t\t\t\tif ( animation == 'push' || animation == 'fall-down' || animation == 'fall-up' )\n\t\t\t\t\twrapper_animation.animate( {\n\t\t\t\t\t\t'right': '0px'\n\t\t\t\t\t} );\n\n\t\t\t\tswitch ( animation ) {\n\t\t\t\t\tcase 'slide-in-on-top':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'push':\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-down':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '-300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'fall-up':\n\n\t\t\t\t\tsidebar_animation_inner.animate( {\n\t\t\t\t\t\t'top': '300px'\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t} );\n\n$( 'body' ).on( 'click', '.header .menu-more .icon-more', function( e ) {\n\tvar _this = $( this );\n\tvar parent = _this.closest( '.site-navigator-inner' );\n\tvar menu_more = _this.closest( '.menu-more' );\n\tvar nav = parent.find( '.site-navigator' );\n\tvar nav_more = parent.find( '.nav-more' );\n\tvar nav_item_hidden = parent.find( ' > .site-navigator .item-hidden' );\n\tvar index_current = $( '.header .menu-more' ).index( menu_more );\n\tvar element_item = _this.closest( '.element-item' );\n\n\t\t\t// Remove active element item more\n\t\t\t$( '.header .menu-more:not(:eq(' + index_current + '))' ).removeClass( 'active-more' );\n\n\t\t\tif ( menu_more.hasClass( 'active-more' ) ) {\n\t\t\t\tmenu_more.removeClass( 'active-more' );\n\t\t\t} else {\n\n\t\t\t\tWR_Click_Outside( _this, '.hb-menu', function( e ) {\n\t\t\t\t\tmenu_more.removeClass( 'active-more' );\n\t\t\t\t} );\n\n\t\t\t\t// Reset\n\t\t\t\tnav_more.html( '' );\n\t\t\t\tnav_more.removeAttr( 'style' );\n\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\tvar nav_info = nav_more[ 0 ].getBoundingClientRect();\n\n\t\t\t\t// Get offset\n\t\t\t\tvar offset_option = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t\t\t\t// Set left search form if hide broswer because small\n\t\t\t\tif ( width_content_broswer < ( nav_info.right + 5 ) ) {\n\t\t\t\t\tvar left_nav = ( nav_info.right + 5 + offset_option ) - width_content_broswer;\n\t\t\t\t\tnav_more.css( 'left', -left_nav + 'px' );\n\t\t\t\t} else if ( nav_info.left < ( 5 + offset_option ) ) {\n\t\t\t\t\tnav_more.css( 'left', '5px' );\n\t\t\t\t}\n\n\t\t\t\t// Remove margin top when stick or margin top empty\n\t\t\t\tvar margin_top = ( element_item.attr( 'data-margin-top' ) == 'empty' ) ? element_item.attr( 'data-margin-top' ) : parseInt( element_item.attr( 'data-margin-top' ) );\n\t\t\t\tvar menu_more_info = menu_more[ 0 ].getBoundingClientRect();\n\n\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar offset_bottom_current = menu_more_info.top + menu_more_info.height;\n\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\tvar offset_top = parseInt( padding_bottom + menu_more_info.height );\n\n\t\t\t\t\tnav_more.css( 'top', offset_top );\n\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\tnav_more.css( 'top', ( margin_top + menu_more_info.height ) );\n\t\t\t\t}\n\n\t\t\t\tif ( nav_item_hidden.length ) {\n\t\t\t\t\tvar nav_item_html = '';\n\t\t\t\t\t$.each( nav_item_hidden, function() {\n\t\t\t\t\t\tnav_item_html += $( this )[ 0 ].outerHTML;\n\t\t\t\t\t} );\n\t\t\t\t\tnav_more.html( '<ul class=\"animation-' + element_item.attr( 'data-animation' ) + ' ' + nav.attr( 'class' ) + '\">' + nav_item_html + '</ul>' );\n\t\t\t\t}\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tmenu_more.addClass( 'active-more' );\n\t\t\t\t}, 10 );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Hover normal animation\n\t\tif ( $.fn.hoverIntent ) {\n\t\t\t// For horizontal layout\n\t\t\t$( '.wr-desktop header.header.horizontal-layout' ).hoverIntent( {\n\t\t\t\tover: function() {\n\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\tvar style_animate = '';\n\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\tvar offset = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\t\t\t\t\tvar margin_top = ( _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) == 'empty' ) ? _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) : parseInt( _this.closest( '.hb-menu' ).attr( 'data-margin-top' ) );\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) { // For megamenu\n\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar parent_info = _this.closest( '.container' )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\t\tvar width_parent = parent_info.width;\n\t\t\t\t\t\tvar right_parent = parent_info.right;\n\t\t\t\t\t\tvar width_megamenu = 0;\n\t\t\t\t\t\tvar left_megamenu = 0;\n\t\t\t\t\t\tvar width_type = menu_animate.attr( 'data-width' );\n\n\t\t\t\t\t\t// Full container\n\t\t\t\t\t\tif ( width_type === 'full' ) {\n\t\t\t\t\t\t\twidth_megamenu = width_parent;\n\n\t\t\t\t\t\t\tif ( ( width_megamenu + 10 + offset * 2 ) >= width_content_broswer ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_parent - 10;\n\t\t\t\t\t\t\t\tright_parent -= 5;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Full container\n\t\t\t\t\t\t} else if ( width_type === 'full-width' ) {\n\t\t\t\t\t\t\twidth_megamenu = width_content_broswer - 10 - ( offset * 2 );\n\t\t\t\t\t\t\tright_parent = 5 + offset;\n\n\t\t\t\t\t\t\t// Fixed width\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twidth_megamenu = parseInt( width_type ) ? parseInt( width_type ) : width_parent;\n\n\t\t\t\t\t\t\tif ( ( width_megamenu + 10 + offset * 2 ) >= width_content_broswer ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_content_broswer - 10 - ( offset * 2 );\n\t\t\t\t\t\t\t\tright_parent -= 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\n\t\t\t\t\t\tvar megamenu_info = menu_animate[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\t/* Convert numbers positive to negative */\n\n\t\t\t\t\t\tif ( width_type == 'full-width' ) {\n\t\t\t\t\t\t\tleft_megamenu = -( megamenu_info.left - right_parent );\n\t\t\t\t\t\t} else if ( width_type == 'full' ) {\n\t\t\t\t\t\t\tleft_megamenu = ( ( megamenu_info.right - right_parent ) > 0 ) ? -( parseInt( megamenu_info.right - right_parent ) ) : 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tleft_megamenu = ( megamenu_info.right > ( width_content_broswer - 5 - ( offset * 2 ) ) ) ? ( -( megamenu_info.right - ( width_content_broswer - 5 - offset ) ) ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu,\n\t\t\t\t\t\t\twidth: width_megamenu\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t/** * Set offset top for submenu ** */\n\t\t\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\t\t\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar offset_bottom_current = current_info.top + current_info.height;\n\t\t\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\t\t\tvar offset_top = parseInt( padding_bottom + current_info.height );\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = offset_top\n\n\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + ( offset_top - current_info.height ) + 'px\"></span>' );\n\t\t\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = margin_top + current_info.height;\n\n\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + margin_top + 'px\"></span>' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Add class col last row */\n\t\t\t\t\t\tvar mm_container_width = menu_animate.find( '.mm-container' ).width();\n\t\t\t\t\t\tvar width_col = 0;\n\n\t\t\t\t\t\t$.each( menu_animate.find( '.mm-container > .mm-col' ), function() {\n\t\t\t\t\t\t\tvar _this_col = $( this );\n\t\t\t\t\t\t\tvar width_current = _this_col.outerWidth();\n\n\t\t\t\t\t\t\twidth_col += width_current;\n\n\t\t\t\t\t\t\t_this_col.removeClass( 'mm-last-row' );\n\n\t\t\t\t\t\t\tif ( width_col == mm_container_width ) {\n\t\t\t\t\t\t\t\t_this_col.addClass( 'mm-last-row' );\n\t\t\t\t\t\t\t\twidth_col = 0;\n\t\t\t\t\t\t\t} else if ( width_col > mm_container_width ) {\n\t\t\t\t\t\t\t\t_this_col.prev().addClass( 'mm-last-row' );\n\t\t\t\t\t\t\t\twidth_col = width_current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else { // For menu normal\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > ul.sub-menu' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tif ( menu_animate.length == 0 )\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tvar megamenu_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\t\tvar left_megamenu = Math.round( megamenu_info.right - width_content_broswer + offset );\n\n\t\t\t\t\t\tif ( _this.hasClass( 'menu-default' ) ) { // For top menu normal\n\n\t\t\t\t\t\t\t// Convert numbers positive to negative\n\t\t\t\t\t\t\tleft_megamenu = ( left_megamenu > 0 ) ? ( -left_megamenu - 5 ) : 0;\n\n\t\t\t\t\t\t\t/** * Set offset top for submenu in row sticky ** */\n\t\t\t\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\n\t\t\t\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tvar offset_bottom_current = current_info.top + current_info.height;\n\t\t\t\t\t\t\t\tvar offset_bottom_parent = parent_sticky_info.top + parent_sticky_info.height;\n\t\t\t\t\t\t\t\tvar padding_bottom = parseInt( offset_bottom_parent - offset_bottom_current );\n\t\t\t\t\t\t\t\tvar offset_top_menu_animate = parseInt( padding_bottom + current_info.height );\n\n\t\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + ( offset_top_menu_animate - current_info.height ) + 'px\"></span>' );\n\t\t\t\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\t\t\t\tvar offset_top_menu_animate = margin_top + current_info.height;\n\n\t\t\t\t\t\t\t\tif ( _this.children( '.hover-area' ).length == 0 )\n\t\t\t\t\t\t\t\t\t_this.append( '<span class=\"hover-area\" style=\"height:' + margin_top + 'px\"></span>' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else { // For sub menu normal\n\n\t\t\t\t\t\t\tvar submenu_parent = _this.closest( 'ul' );\n\n\t\t\t\t\t\t\t// Get left css current\n\t\t\t\t\t\t\tvar left = parseInt( submenu_parent.css( 'left' ) );\n\n\t\t\t\t\t\t\tif ( left < 0 ) { // Show all submenu to left\n\t\t\t\t\t\t\t\tvar submenu_parent_info = submenu_parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tleft_megamenu = ( megamenu_info.width < ( submenu_parent_info.left - offset ) ) ? -megamenu_info.width : megamenu_info.width;\n\t\t\t\t\t\t\t} else { // Show submenu normal\n\t\t\t\t\t\t\t\tleft_megamenu = ( left_megamenu > 0 ) ? -megamenu_info.width : megamenu_info.width;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/** * Set top when animate hide because broswer short ** */\n\t\t\t\t\t\t\tvar height_content_broswer = $( window ).height();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( megamenu_info.top + megamenu_info.height ) - offset;\n\t\t\t\t\t\t\tif ( megamenu_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( megamenu_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Set offset top for when animate hide because broswer short\n\t\t\t\t\t\tif ( typeof top_menu_animate !== 'undefined' )\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = top_menu_animate;\n\n\t\t\t\t\t\t// Set offset top for submenu in row sticky\n\t\t\t\t\t\tif ( typeof offset_top_menu_animate !== 'undefined' )\n\t\t\t\t\t\t\tstyle_animate[ 'top' ] = offset_top_menu_animate;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set style before run effect\n\t\t\t\t\tmenu_animate.css( style_animate );\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation = _this.closest( '.hb-menu' ).attr( 'data-animation' );\n\n\t\t\t\t\t switch ( animation ) {\n\t\t\t\t\t \tcase 'none':\n\t\t\t\t\t \tmenu_animate.css( {\n\t\t\t\t\t \t\topacity: '1'\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1'\n\t\t\t\t\t \t}, 150, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none',\n\t\t\t\t\t \t\tleft: ( left_megamenu - 50 ) + 'px'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t \tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t \t\tpointerEvents: 'none',\n\t\t\t\t\t \t\tleft: ( left_megamenu + 50 ) + 'px'\n\t\t\t\t\t \t} ).animate( {\n\t\t\t\t\t \t\topacity: '1',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t \t\tmenu_animate.css( style_animate );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ); // Get offset top menu_animate\n\t\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\t\ttop: ( top_megamenu + 30 ) + 'px'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\t\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\t\ttransform: 'scale(1)'\n\t\t\t\t\t\t\t}, 250, function() {\n\t\t\t\t\t\t\t\tstyle_animate[ 'pointerEvents' ] = '';\n\t\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_this.addClass( 'menu-hover' );\n\t\t\t\t\t},\n\t\t\t\t\tout: function() {\n\t\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\t\t_this.children( '.hover-area' ).remove();\n\t\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar menu_animate = _this.find( 'ul.sub-menu' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Remove style hover-area in row sticky\n\t\t\t\t\t_this.find( ' > .menu-item-link .hover-area' ).removeAttr( 'style' );\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation = _this.closest( '.hb-menu' ).attr( 'data-animation' );\n\n\t\t\t\t\t switch ( animation ) {\n\t\t\t\t\t \tcase 'none':\n\t\t\t\t\t \t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \tmenu_animate.removeAttr( 'style' );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0'\n\t\t\t\t\t \t}, 150, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) - 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) + 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\t\t\t\t\t\t\t// Get offset top menu_animate\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ) + 50;\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t}, 250, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttimeout: 0,\n\t\t\t\t\tsensitivity: 1,\n\t\t\t\t\tinterval: 0,\n\t\t\t\t\tselector: '.site-navigator li.menu-item'\n\t\t\t\t} );\n\n\t\t\t// For vertical layout\n\t\t\t$( 'body' ).hoverIntent( {\n\t\t\t\tover: function() {\n\n\t\t\t\t\tvar _this = $( this );\n\t\t\t\t\tvar style_animate = '';\n\t\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\t\tvar is_right_position = 0;\n\n\t\t\t\t\t// Check is right position for menu more\n\t\t\t\t\tif ( _this.closest( '.menu-more' ).length == 1 ) {\n\t\t\t\t\t\tvar menu_more = _this.closest( '.menu-more' );\n\t\t\t\t\t\tvar menu_more_info = menu_more[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar menu_more_right = width_content_broswer - menu_more_info.right;\n\n\t\t\t\t\t\tif ( menu_more_info.left > menu_more_right ) {\n\t\t\t\t\t\t\tis_right_position = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tis_right_position = _this.closest( '.vertical-layout.right-position-vertical' ).length || _this.closest( '.sidebar-style.right-position' ).length;\n\t\t\t\t\t}\n\t\t\t\t\tvar offset = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var height_content_broswer = $( window ).height();\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) { // For megamenu\n\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_megamenu = menu_animate.attr( 'data-width' );\n\n\t\t\t\t\t\tif ( is_right_position == 1 ) {\n\n\t\t\t\t\t\t\tvar width_content = current_info.left - offset;\n\n\t\t\t\t\t\t\t// Check setting full width\n\t\t\t\t\t\t\tif ( width_megamenu == 'full' || width_megamenu > width_content ) {\n\t\t\t\t\t\t\t\twidth_megamenu = width_content - 5;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\t\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\t\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\t\twidth: width_megamenu,\n\t\t\t\t\t\t\t\tleft: -width_megamenu,\n\t\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar width_content = width_content_broswer - current_info.right - offset;\n\n\t\t\t\t\t\t\t// Check setting full width\n\t\t\t\t\t\t\tif ( width_megamenu == 'full' || width_megamenu > width_content )\n\t\t\t\t\t\t\t\twidth_megamenu = width_content - 5;\n\n\t\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\t\tmenu_animate.width( width_megamenu );\n\t\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\n\t\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\t\twidth: width_megamenu,\n\t\t\t\t\t\t\t\tleft: parseInt( current_info.width ),\n\t\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // For menu normal\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > ul.sub-menu' );\n\n\t\t\t\t\t\tif ( !menu_animate.length ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Show menu animate for get attribute\n\t\t\t\t\t\tmenu_animate.attr( 'style', 'display:block' );\n\n\t\t\t\t\t\tvar menu_animate_info = menu_animate[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\tif ( _this.hasClass( 'menu-default' ) ) { // For top\n\t\t\t\t\t\t\t// menu\n\t\t\t\t\t\t\t// normal\n\t\t\t\t\t\t\tif ( is_right_position == 1 ) {\n\t\t\t\t\t\t\t\tvar left_megamenu = -parseInt( menu_animate_info.width );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\t\t\tvar left_megamenu = parseInt( current_info.width );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // For sub menu normal\n\t\t\t\t\t\t\tvar submenu_parent = _this.closest( 'ul' );\n\t\t\t\t\t\t\tvar submenu_parent_info = submenu_parent[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t\t\tvar left_megamenu = ( menu_animate_info.width > ( width_content_broswer - submenu_parent_info.right - offset - 5 ) ) ? -menu_animate_info.width : menu_animate_info.width;\n\n\t\t\t\t\t\t\t// Get left css current\n\t\t\t\t\t\t\tvar left = parseInt( submenu_parent.css( 'left' ) );\n\n\t\t\t\t\t\t\tif ( left < 0 ) { // Show all submenu to left\n\t\t\t\t\t\t\t\tvar left_megamenu = ( menu_animate_info.width < submenu_parent_info.left - 5 - offset ) ? -menu_animate_info.width : menu_animate_info.width;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/** * Set top when heigh animate greater broswer ** */\n\t\t\t\t\t\tvar height_wpadminbar = $( '#wpadminbar' ).length ? ( ( $( '#wpadminbar' ).css( 'position' ) == 'fixed' ) ? $( '#wpadminbar' ).height() : 0 ) : 0;\n\t\t\t\t\t\tvar top_menu_animate = height_content_broswer - ( menu_animate_info.top + menu_animate_info.height ) - offset;\n\n\t\t\t\t\t\tif ( menu_animate_info.height > ( height_content_broswer - 10 - height_wpadminbar - offset ) ) {\n\t\t\t\t\t\t\ttop_menu_animate = -( menu_animate_info.top - height_wpadminbar - 5 - offset );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttop_menu_animate = top_menu_animate < 5 ? ( top_menu_animate - 5 ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstyle_animate = {\n\t\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\t\tleft: left_megamenu,\n\t\t\t\t\t\t\ttop: top_menu_animate\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar animation_effect = ( _this.closest( '.menu-more' ).length == 1 ) ? _this.closest( '.element-item' ).attr( 'data-animation' ) : _this.closest( '.site-navigator-outer' ).attr( 'data-effect-vertical' );\n\n\t\t\t\t\t// Set style before run effect\n\t\t\t\t\tmenu_animate.css( style_animate );\n\n\t\t\t\t\tswitch ( animation_effect ) {\n\t\t\t\t\t\tcase 'none':\n\n\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\t\t\topacity: '1'\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'fade':\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\topacity: '1'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'left-to-right':\n\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: ( left_megamenu - 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\tleft: left_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'right-to-left':\n\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: ( left_megamenu + 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\tleft: left_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'bottom-to-top':\n\n\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) );\n\t\t\t\t\t\tvar left_megamenu = parseInt( menu_animate.css( 'left' ) );\n\n\t\t\t\t\t\tmenu_animate.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\ttop: ( top_megamenu + 50 ) + 'px'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\tmenu_animate.css( {\n\t\t\t\t\t\t\tleft: left_megamenu + 'px',\n\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\t\ttransform: 'scale(1)'\n\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\tmenu_animate.css( style_animate );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_this.addClass( 'menu-hover' );\n\t\t\t\t},\n\t\t\t\tout: function() {\n\t\t\t\t\tvar _this = $( this );\n\n\t\t\t\t\tif ( _this.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\tvar menu_animate = _this.find( ' > .mm-container-outer' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar menu_animate = _this.find( 'ul.sub-menu' );\n\t\t\t\t\t}\n\n\t\t\t\t\t/***********************************************************\n\t\t\t\t\t * Animation *\n\t\t\t\t\t **********************************************************/\n\n\t\t\t\t\t var animation_effect = ( _this.closest( '.menu-more' ).length == 1 ) ? _this.closest( '.element-item' ).attr( 'data-animation' ) : _this.closest( '.site-navigator-outer' ).attr( 'data-effect-vertical' );\n\n\t\t\t\t\t switch ( animation_effect ) {\n\t\t\t\t\t \tcase 'none':\n\n\t\t\t\t\t \t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \tmenu_animate.removeAttr( 'style' );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'fade':\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'left-to-right':\n\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) - 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'right-to-left':\n\n\t\t\t\t\t \tvar left_megamenu = parseInt( menu_animate.css( 'left' ) ) + 50;\n\n\t\t\t\t\t \tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t \t\topacity: '0',\n\t\t\t\t\t \t\tleft: left_megamenu + 'px'\n\t\t\t\t\t \t}, 300, function() {\n\t\t\t\t\t \t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t \t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t \t} );\n\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t \tcase 'bottom-to-top':\n\n\t\t\t\t\t\t\t// Get offset top menu_animate\n\t\t\t\t\t\t\tvar top_megamenu = parseInt( menu_animate.css( 'top' ) ) + 50;\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttop: top_megamenu + 'px'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\t\tmenu_animate.stop( true, true ).animate( {\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\ttransform: 'scale(0.8)'\n\t\t\t\t\t\t\t}, 300, function() {\n\t\t\t\t\t\t\t\t_this.removeClass( 'menu-hover' );\n\t\t\t\t\t\t\t\tmenu_animate.removeAttr( 'style' );\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t},\n\t\t\t\t\ttimeout: 1,\n\t\t\t\t\tsensitivity: 6,\n\t\t\t\t\tinterval: 0,\n\t\t\t\t\tselector: '.vertical-layout .text-layout .animation-vertical-normal .site-navigator li.menu-item, .hb-menu-outer .sidebar-style.animation-vertical-normal .site-navigator li.menu-item, .menu-more .nav-more .site-navigator li.menu-item'\n\t\t\t\t} );\n}\n\nvar element_breadcrumbs = {};\n\n\t\t// Slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.mm-container .mm-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_ul = _this.closest( 'ul' );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\t\t\tvar parent_col = _this.closest( '.mm-col' );\n\t\t\tvar siblings_ul = parent_li.find( ' > ul' );\n\n\t\t\tparent_ul.addClass( 'slide-hide' );\n\t\t\tsiblings_ul.addClass( 'slide-show' );\n\n\t\t\tif ( ! parent_col.find( '.prev-slide' ).length ) {\n\t\t\t\tparent_col.find( ' > li > ul.sub-menu' ).prepend( '<li class=\"prev-slide\"><i class=\"fa fa-angle-left\"></i></li>' );\n\t\t\t}\n\n\t\t\tvar siblings_ul_top = _this.closest( '.mm-col' ).find( ' > li > ul' );\n\n\t\t\tvar height_siblings_ul = siblings_ul.height();\n\t\t\tvar height_sprev_slide = siblings_ul_top.find( '.prev-slide' ).outerHeight();\n\t\t\tvar height_set = height_siblings_ul + height_sprev_slide;\n\n\t\t\tif( siblings_ul_top.height() < height_set ) {\n\t\t\t\tsiblings_ul_top.height( height_set );\n\t\t\t}\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.mm-container .prev-slide', function( e ) {\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_ul = _this.closest( '.mm-col' );\n\t\t\tvar container = _this.closest( '.mm-container' );\n\t\t\tvar show_last = parent_ul.find( '.slide-show:last' ).removeClass( 'slide-show' );\n\t\t\tvar hide_last = parent_ul.find( '.slide-hide:last' );\n\n\t\t\tif ( parent_ul.find( '.slide-hide' ).length == 1 ) {\n\t\t\t\t_this.closest( 'ul' ).css( 'height', '' );\n\t\t\t\t_this.remove();\n\t\t\t}\n\n\t\t\thide_last.removeClass( 'slide-hide' );\n\t\t} );\n\n\t\t// Slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .hb-menu .animation-vertical-slide .icon-has-children, .hb-menu-outer .animation-vertical-slide .icon-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_menu_elment = _this.closest( '.site-navigator-outer' );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\t\t\tvar children_sub = parent_li.find( ' > ul > li' );\n\t\t\tvar parent_ul = _this.closest( 'ul' );\n\t\t\tvar children_parent_ul = parent_ul.find( ' > li ' );\n\t\t\tvar menu_level = Object.keys( element_breadcrumbs ).length + 1;\n\t\t\tvar text_title = _this.closest( 'a' ).find( '.menu_title' ).text();\n\t\t\tvar menu_show = parent_li.find( ( parent_li.hasClass( 'wrmm-item' ) ? ' .mm-container-outer ' : ' > ul ' ) );\n\t\t\tvar height_menu_show = menu_show.height();\n\t\t\tvar menu_outer = parent_menu_elment.find( '.site-navigator' );\n\t\t\tvar height_menu_outer = menu_outer.height();\n\t\t\tvar list_breadcrumbs = '';\n\n\t\t\t// Set height for menu if content hide\n\t\t\tif ( height_menu_show > height_menu_outer ) {\n\t\t\t\tmenu_outer.attr( 'style', 'height:' + height_menu_show + 'px;' );\n\t\t\t}\n\n\t\t\tparent_li.addClass( 'active-slide' ).addClass( 'slide-level-' + menu_level );\n\n\t\t\t// Add class no padding icon if not children\n\t\t\tif ( !parent_li.find( ' > ul > li.menu-item-has-children' ).length )\n\t\t\t\tparent_li.find( ' > ul ' ).addClass( 'not-padding-icon' );\n\n\t\t\t// Hide menu\n\t\t\tif ( children_parent_ul.length ) {\n\t\t\t\tvar length_slide = children_parent_ul.length;\n\t\t\t\tchildren_parent_ul.each( function( key, val ) {\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t$( val ).addClass( 'slide-left' );\n\n\t\t\t\t\t\t// To last\n\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\t\t\t\t\t\t\t// Animation for megamenu\n\t\t\t\t\t\t\tif ( parent_li.hasClass( 'wrmm-item' ) ) {\n\t\t\t\t\t\t\t\tparent_li.addClass( 'slide-normal' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, 100 * key );\n\t\t\t\t} );\n\t\t\t}\n\t\t\t;\n\n\t\t\t// Show menu\n\t\t\tif ( children_sub.length && !parent_li.hasClass( 'wrmm-item' ) ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tchildren_sub.each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).addClass( 'slide-normal' );\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\t\t\t}\n\t\t\t;\n\n\t\t\t/** * Add breadcrumbs ** */\n\n\t\t\t// Add item to list breadcrumbs\n\t\t\telement_breadcrumbs[ menu_level ] = text_title;\n\n\t\t\t// Show breadcrumbs\n\t\t\tparent_menu_elment.find( '.menu-breadcrumbs-outer' ).addClass( 'show-breadcrumbs' );\n\n\t\t\t// Remove all item breadcrumbs old\n\t\t\tparent_menu_elment.find( '.item-breadcrumbs' ).remove();\n\n\t\t\tif ( Object.keys( element_breadcrumbs ).length ) {\n\t\t\t\t$.each( element_breadcrumbs, function( key, val ) {\n\t\t\t\t\tlist_breadcrumbs += '<div class=\"element-breadcrumbs item-breadcrumbs\"><i class=\"fa fa-long-arrow-right\"></i><span class=\"title-breadcrumbs\" data-level=\"' + key + '\">' + val + '</span></div>';\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Add all new item breadcrumbs\n\t\t\tparent_menu_elment.find( '.menu-breadcrumbs' ).append( list_breadcrumbs );\n\n\t\t\t// Set width breadcrumbs for fullscreen style\n\t\t\tif ( parent_menu_elment.hasClass( 'fullscreen-style' ) ) {\n\n\t\t\t\tvar navigator_inner_info = _this.closest( '.navigator-column-inner' )[ 0 ].getBoundingClientRect();\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\tvar width_breadcrumbs = width_content_broswer - navigator_inner_info.left;\n\n\t\t\t\tparent_menu_elment.find( '.menu-breadcrumbs-outer' ).css( 'width', parseInt( width_breadcrumbs ) );\n\t\t\t\t_this.closest( '.navigator-column-inner' ).width( navigator_inner_info.width );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Breadcrumbs slide animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .menu-breadcrumbs .element-breadcrumbs .title-breadcrumbs, .hb-menu-outer .animation-vertical-slide .menu-breadcrumbs .element-breadcrumbs .title-breadcrumbs', function() {\n\n\t\t\tvar _this = $( this );\n\t\t\tvar level = _this.attr( 'data-level' );\n\t\t\tvar parent_top = _this.closest( '.site-navigator-outer' );\n\t\t\tvar length_breadcrumbs = Object.keys( element_breadcrumbs ).length;\n\t\t\tvar parent_breadcrumbs = _this.closest( '.menu-breadcrumbs' );\n\n\t\t\t// Disable item breadcrumbs last\n\t\t\tif ( level == length_breadcrumbs ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( parent_top.find( '.slide-level-' + length_breadcrumbs + '.wrmm-item' ).length ) {\n\t\t\t\tparent_top.find( '.slide-level-' + length_breadcrumbs + '.wrmm-item' ).removeClass( 'slide-normal' );\n\t\t\t} else {\n\t\t\t\t// Remove animate last level\n\t\t\t\tparent_top.find( '.slide-level-' + length_breadcrumbs + '> ul > li' ).each( function( key, val ) {\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t$( val ).removeClass( 'slide-normal' );\n\t\t\t\t\t}, 100 * key );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( level == 'all' ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tvar length_slide = parent_top.find( '.site-navigator > li' ).length;\n\t\t\t\t\tparent_top.find( '.site-navigator > li' ).each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).removeClass( 'slide-left' );\n\n\t\t\t\t\t\t\t// To last\n\t\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\n\t\t\t\t\t\t\t\t// Conver to heigh menu normal\n\t\t\t\t\t\t\t\t$( val ).closest( '.site-navigator' ).removeAttr( 'style' );\n\n\t\t\t\t\t\t\t\t/** * Remove all class releated ** */\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-normal' ).removeClass( 'slide-normal' );\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-left' ).removeClass( 'slide-left' );\n\t\t\t\t\t\t\t\tfor ( var i = 1; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + i ).removeClass( 'slide-level-' + i );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\t\tparent_top.find( '.active-slide' ).removeClass( 'active-slide' );\n\n\t\t\t\t\t\t\t\t// Hide breadcrumbs\n\t\t\t\t\t\t\t\t_this.closest( '.menu-breadcrumbs-outer' ).removeClass( 'show-breadcrumbs' );\n\n\t\t\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t\t\t// Remove item breadcrumbs\n\t\t\t\t\t\t\t\t\telement_breadcrumbs = {};\n\t\t\t\t\t\t\t\t\tparent_breadcrumbs.find( '.item-breadcrumbs' ).remove();\n\t\t\t\t\t\t\t\t}, 300 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\n\t\t\t} else {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tvar length_slide = parent_top.find( '.slide-level-' + level + ' > ul > li' ).length;\n\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' > ul > li' ).each( function( key, val ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$( val ).removeClass( 'slide-left' );\n\n\t\t\t\t\t\t\t// To last\n\t\t\t\t\t\t\tif ( length_slide == ( key + 1 ) ) {\n\n\t\t\t\t\t\t\t\t// Remove class releated\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' ul ul .slide-normal' ).removeClass( 'slide-normal' );\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' ul ul .slide-left' ).removeClass( 'slide-left' );\n\t\t\t\t\t\t\t\tfor ( var i = level; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tif ( i != level ) {\n\t\t\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + i ).removeClass( 'slide-level-' + i );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tparent_top.find( '.slide-level-' + level + ' .active-slide' ).removeClass( 'active-slide' );\n\n\t\t\t\t\t\t\t\t// Remove item breadcrumbs\n\t\t\t\t\t\t\t\tfor ( var i = level; i <= length_breadcrumbs; i++ ) {\n\t\t\t\t\t\t\t\t\tif ( i != level ) {\n\t\t\t\t\t\t\t\t\t\tdelete element_breadcrumbs[ i ];\n\t\t\t\t\t\t\t\t\t\tparent_breadcrumbs.find( '.title-breadcrumbs[data-level=\"' + i + '\"]' ).parent().remove();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}, 100 * key );\n\t\t\t\t\t} );\n\t\t\t\t}, 100 );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Accordion animation of vertical layout\n\t\t$( 'body' ).on( 'click', '.vertical-layout .hb-menu .animation-vertical-accordion .icon-has-children, .hb-menu-outer .animation-vertical-accordion .icon-has-children', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tvar _this = $( this );\n\t\t\tvar parent_li = _this.closest( 'li' );\n\n\t\t\tif ( parent_li.hasClass( 'active-accordion' ) ) {\n\t\t\t\tparent_li.removeClass( 'active-accordion' );\n\t\t\t\tif ( parent_li.find( ' > .mm-container-outer' ).length ) {\n\t\t\t\t\tparent_li.find( ' > .mm-container-outer' ).stop( true, true ).slideUp( 300 );\n\t\t\t\t} else {\n\t\t\t\t\tparent_li.find( ' > .sub-menu' ).stop( true, true ).slideUp( 300 );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparent_li.addClass( 'active-accordion' );\n\t\t\t\tif ( parent_li.find( ' > .mm-container-outer' ).length ) {\n\t\t\t\t\tparent_li.find( ' > .mm-container-outer' ).stop( true, true ).slideDown( 300 );\n\t\t\t\t} else {\n\t\t\t\t\tparent_li.find( ' > .sub-menu' ).stop( true, true ).slideDown( 300 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tfunction get_width_menu_center( element ){\n\t\t\tvar width_all = 0;\n\n\t\t\t$.each( element, function(){\n\t\t\t\tvar _this = $(this);\n\t\t\t\tif( _this.hasClass( 'hb-menu' ) && _this.hasClass( 'text-layout' ) ) {\n\t\t\t\t\tvar width = ( _this.outerWidth( true ) - _this.find( '.site-navigator-outer' ).width() ) + 47;\n\t\t\t\t\twidth_all += width;\n\t\t\t\t} else {\n\t\t\t\t\tvar width = _this.outerWidth( true );\n\t\t\t\t\twidth_all += width;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn width_all;\n\t\t}\n\n\t\tfunction calc_element_center( el_prev, spacing_average, center_element ){\n\t\t\tvar width_all_el = 0;\n\t\t\tvar margin_left = 0;\n\n\t\t\t$.each( el_prev, function(){\n\t\t\t\tvar _this = $(this);\n\t\t\t\tvar width = _this.outerWidth( true );\n\t\t\t\twidth_all_el += width;\n\t\t\t} );\n\n\t\t\tif( width_all_el < spacing_average ) {\n\t\t\t\tmargin_left = spacing_average - width_all_el;\n\t\t\t}\n\n\t\t\tif( margin_left ) {\n\t\t\t\tvar lits_flex = center_element.prevAll( '.hb-flex' );\n\n\t\t\t\tif( lits_flex.length ) {\n\t\t\t\t\tvar width_flex = parseInt( margin_left/lits_flex.length )\n\t\t\t\t\tlits_flex.width( width_flex );\n\t\t\t\t\tlits_flex.addClass( 'not-flex' );\n\t\t\t\t} else {\n\t\t\t\t\tcenter_element.css( 'marginLeft', ( margin_left + parseInt( center_element.css( 'marginLeft' ) ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction resize_menu() {\n\t\t\t// Each rows\n\t\t\t$.each( $( '.wr-desktop .horizontal-layout .hb-section-outer' ), function() {\n\t\t\t\tvar row = $(this);\n\t\t\t\tvar menu_row = row.find( '.hb-menu.text-layout' );\n\t\t\t\tvar center_element = row.find( '.element-item.center-element' );\n\t\t\t\tvar list_flex = row.find( '.hb-flex' );\n\n\t\t\t\t// Set center element and menu more has menu element in row\n\t\t\t\tif ( menu_row.length ) {\n\n\t\t\t\t\t/* Reset */\n\t\t\t\t\tmenu_row.find( '.site-navigator > .menu-item' ).removeClass( 'item-hidden' );\n\t\t\t\t\tmenu_row.find( '.menu-more' ).remove();\n\t\t\t\t\trow.find( '.center-element' ).removeAttr( 'style' );\n\t\t\t\t\tlist_flex.removeAttr( 'style' );\n\t\t\t\t\tlist_flex.removeClass( 'not-flex' );\n\n\t\t\t\t\t// Menu element is center element\n\t\t\t\t\tif ( center_element.hasClass( 'hb-menu' ) && center_element.hasClass( 'text-layout' ) ) {\n\n\t\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\t\t\t\t\t\tvar next_menu = center_element.nextAll( ':not(\".hb-flex\")' );\n\t\t\t\t\t\tvar width_prev_menu = get_width_menu_center( prev_menu );\n\t\t\t\t\t\tvar width_next_menu = get_width_menu_center( next_menu );\n\t\t\t\t\t\tvar width_spacing_center = ( width_prev_menu > width_next_menu ) ? width_prev_menu : width_next_menu;\n\t\t\t\t\t\tvar width_menu_center = center_element.outerWidth( true );\n\t\t\t\t\t\tvar width_calc_center = width_parent - ( width_spacing_center * 2 );\n\n\t\t\t\t\t\tif( width_menu_center >= width_calc_center ) {\n\t\t\t\t\t\t\tresize_menu_list( center_element, width_calc_center );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\n\t\t\t\t\t\tresize_menu_list( prev_menu, spacing_average );\n\t\t\t\t\t\tresize_menu_list( next_menu, spacing_average );\n\n\t\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\n\t\t\t\t\t// Menu element isn't center element but has center element\n\t\t\t\t} else if ( center_element.length ) {\n\t\t\t\t\t/* Reset */\n\t\t\t\t\tcenter_element.removeAttr( 'style' );\n\n\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\t\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\t\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\t\t\t\t\tvar next_menu = center_element.nextAll( ':not(\".hb-flex\")' );\n\n\t\t\t\t\tresize_menu_list( prev_menu, spacing_average );\n\t\t\t\t\tresize_menu_list( next_menu, spacing_average );\n\n\t\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\n\t\t\t\t\t// Haven't center element\n\t\t\t\t} else {\n\t\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\t\tresize_menu_list( row.find( '.element-item:not(.hb-flex)' ), width_parent );\n\t\t\t\t}\n\n\t\t\t\t// Set center element not menu element in row\n\t\t\t} else if ( center_element.length ) {\n\t\t\t\t/* Reset */\n\t\t\t\trow.find( '.center-element' ).removeAttr( 'style' );\n\t\t\t\trow.find( '.hb-flex' ).removeAttr( 'style' );\n\t\t\t\tlist_flex.removeClass( 'not-flex' );\n\n\t\t\t\tvar parent = row.find( '.hb-section > .container' );\n\t\t\t\tvar parent_info = parent[ 0 ].getBoundingClientRect();\n\t\t\t\tvar width_parent = parent_info.width - ( parseInt( parent.css( 'borderLeftWidth' ) ) + parseInt( parent.css( 'borderRightWidth' ) ) + parseInt( parent.css( 'paddingLeft' ) ) + parseInt( parent.css( 'paddingRight' ) ) );\n\n\t\t\t\tvar spacing_average = parseInt( ( width_parent - center_element.outerWidth( true ) ) / 2 );\n\t\t\t\tvar prev_menu = center_element.prevAll( ':not(\".hb-flex\")' );\n\n\t\t\t\t\t// Set margin left for element center \n\t\t\t\t\tcalc_element_center( prev_menu, spacing_average, center_element );\n\t\t\t\t}\n\t\t\t} );\n}\n\nfunction resize_menu_list( list_element, width_parent ) {\n\tvar list_menu = [];\n\tvar el_not_menu_flex = [];\n\n\t$.each( list_element, function() {\n\t\tvar _this = $( this );\n\t\tif ( _this.hasClass( 'hb-menu' ) && _this.hasClass( 'text-layout' ) ) {\n\t\t\tlist_menu.push( _this );\n\t\t} else {\n\t\t\tel_not_menu_flex.push( _this );\n\t\t}\n\t} )\n\n\tvar count_menu = list_menu.length;\n\n\t$.each( el_not_menu_flex, function() {\n\t\twidth_parent -= $( this ).outerWidth( true );\n\t} );\n\n\tvar width_rest = parseInt( width_parent / count_menu );\n\tvar width_rest_long = 0;\n\tvar is_plus_rest_long = false;\n\tvar menus_more = [];\n\n\t\t\t// Plus for width rest if menu not exceeds\n\t\t\tvar i = 0;\n\t\t\t$.each( list_menu, function() {\n\t\t\t\tvar width_menu = $( this ).outerWidth( true );\n\t\t\t\tif ( width_menu < width_rest ) {\n\t\t\t\t\twidth_rest_long += width_rest - width_menu;\n\t\t\t\t} else {\n\t\t\t\t\tmenus_more.push( i );\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t} );\n\n\t\t\twidth_rest += parseInt( width_rest_long / menus_more.length );\n\n\t\t\t$.each( menus_more, function( key, val ) {\n\t\t\t\tvar _this = $( list_menu[ val ] );\n\t\t\t\tvar menu_items = _this.find( '.site-navigator > .menu-item' );\n\n\t\t\t\tif ( ! menu_items.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar width_this = _this.outerWidth( true );\n\t\t\t\tvar width_outer = _this.find( '.site-navigator-outer' ).width();\n\t\t\t\tvar width_rest_item = width_rest - ( ( width_this - width_outer ) + 52 );\n\t\t\t\tvar width_menu_items = 0;\n\t\t\t\tvar show_menu_more = false;\n\n\t\t\t\t$.each( menu_items, function( key, val ) {\n\t\t\t\t\twidth_menu_items += $( this ).outerWidth( true );\n\t\t\t\t\tif ( width_menu_items >= width_rest_item ) {\n\t\t\t\t\t\t$( this ).addClass( 'item-hidden' );\n\t\t\t\t\t\tshow_menu_more = true;\n\t\t\t\t\t}\n\t\t\t\t\t;\n\t\t\t\t} );\n\n\t\t\t\tif ( show_menu_more ) {\n\t\t\t\t\t_this.find( '.site-navigator-inner' ).append( '<div class=\"menu-more\"><div class=\"icon-more\"><span class=\"wr-burger-menu\"></span><i class=\"fa fa-caret-down\"></i></div><div class=\"nav-more\"></div></div>' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tresize_menu();\n\n\t\t$( window ).resize( _.debounce( function() {\n\t\t\tresize_menu();\n\t\t}, 300 ) );\n\t}", "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAllActive()) { //Si on est dans la validation du delete\n\t\tdelAll();\n\t}\n}", "function PageClick(event) {\n var el;\n if (activeButton == null) { return; }\n if (browser.isIE)\n el = window.event.srcElement;\n else\n el = (event.target.tagName ? event.target : event.target.parentNode);\n\n if (el == activeButton)\n return;\n if (getContainerWith(el, \"DIV\", \"kmaMenu\") == null) {\n resetButton(activeButton);\n activeButton = null;\n }\n}", "function ComboBox_Display_Menu(event)\n{\n\t//interactions blocked?\n\tif (__SIMULATOR.UserInteractionBlocked())\n\t{\n\t\t//do nothing\n\t}\n\telse\n\t{\n\t\t//get html element\n\t\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t\t//this an ultragrid?\n\t\tif (theHTML.InterpreterObject.UltraGrid)\n\t\t{\n\t\t\t//ignore everything and just forward to ultragrid\n\t\t\tUltraGrid_OnEvent(event);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//block the event\n\t\t\tBrowser_BlockEvent(event);\n\t\t\t//and open the menu\n\t\t\tComboBox_Display_Menu_OpenOnly(theHTML);\n\t\t}\n\t}\n}", "function app(){\n mainMenu();\n}", "handleClick( event ){ }", "function click_lyrMenu_확인(ui) {\n\n informResult({});\n\n }" ]
[ "0.7742164", "0.76287085", "0.7162202", "0.6919832", "0.689633", "0.6857095", "0.683963", "0.68111545", "0.6804773", "0.6801286", "0.67989427", "0.677226", "0.67076373", "0.6678382", "0.6666025", "0.6638033", "0.6581996", "0.6581729", "0.6569902", "0.6528707", "0.6526812", "0.6498239", "0.64974207", "0.64861673", "0.64836544", "0.64785296", "0.6473818", "0.6456649", "0.6454413", "0.6454336", "0.6450805", "0.6447739", "0.6439195", "0.6433214", "0.64124316", "0.640985", "0.6397356", "0.6395196", "0.6393625", "0.6393599", "0.63844246", "0.63812464", "0.6374385", "0.63698727", "0.6340051", "0.6333791", "0.6317492", "0.63130385", "0.6298292", "0.62923336", "0.62883943", "0.6286289", "0.6285317", "0.6282139", "0.6263193", "0.62366354", "0.62359875", "0.62182766", "0.6214461", "0.6209293", "0.62070626", "0.6201211", "0.61947685", "0.61868024", "0.61857283", "0.6183612", "0.6182601", "0.6172823", "0.6172616", "0.61611503", "0.6156903", "0.61569", "0.6155437", "0.61541235", "0.6147734", "0.61476916", "0.61448914", "0.61443806", "0.61442983", "0.61349845", "0.61344266", "0.61246324", "0.61246324", "0.6121926", "0.6115909", "0.61146605", "0.61143833", "0.60964847", "0.6087099", "0.6086255", "0.60824704", "0.60823876", "0.60683036", "0.60683036", "0.60653925", "0.606146", "0.60600984", "0.6058051", "0.6054471", "0.6054321", "0.6051574" ]
0.0
-1
Used to Hide menu
HideMenus() { this.HideMenuSubs(); this.HideMenusAuds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideMenu()\n{\n\t\t\n\t\t//set a timeout and then kill all the menu's\n\t\t//we will check in menuHandler() to see if some stay lit.\n\t\tmenuTimeout= setTimeout(\"killMenu('all');\",800);\n\t\t\n\t\tflagMenuSwitch=\"off\";\n\t\t\n}//end hideMenu() function", "function hideMenu($this){\n $this.css('display', '');\n $('#mobileMenu-'+$this.attr('id')).hide();\n }", "function hideMenu($this){\n $this.css('display', '');\n $('#mobileMenu_'+$this.attr('id')).hide();\n }", "function menuHide() {\n ui.languageContainer.removeClass('open');\n ui.appbarElement.removeClass('open');\n ui.mainMenuContainer.removeClass('open');\n ui.darkbgElement.removeClass('open');\n}", "function hideMenu(){\n $('.menu ul').hide();\n}", "function hidemenu(e){\n\tmenu.style.display = \"none\";\n}", "function hideSideMenu() {\n $('.menu').addClass('hidden');\n }", "function hideMenu(){\n file_menu.style.display = \"none\"\n menuActive = false\n}", "function hideEditMenu() {\n menu.style.display = 'none';\n removePageClickEvent();\n }", "function HideMobileMenu(){\n\t\n}", "function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}", "function hide()\r\n{\r\n if (isShowing) menuSelect.style.visibility = 'hidden';\r\n isShowing = false;\r\n}", "hide() {\n this.backButtonOpen_ = false;\n chrome.accessibilityPrivate.setSwitchAccessMenuState(\n false, SAConstants.EMPTY_LOCATION, 0);\n this.menuPanel_.setFocusRing(SAConstants.BACK_ID, false);\n }", "function menuHideAll() {\n\t$('#shop').hide();\n\t$('#highscore').hide();\n\t$('#milestones').hide();\n\t$('#options').hide();\n\t$('#chat').hide();\n}", "function hideSubmenu( obj ){ obj.css( 'opacity', '0' ).css( 'display', 'none' ); }", "function ocultarMenu(){\n\t\t$(\"#js-menu-recipe\").hide();\n}", "function hideMenu() {\n\t\t\tvar currentMenu = element.querySelector('.' + SETTINGS.open);\n\n\t\t\t// if there is a submenu opened, then close it\n\t\t\tif (currentMenu) {\n\t\t\t\tcurrentMenu.classList.remove(SETTINGS.open);\t\n\t\t\t}\n\t\t}", "function hideMenu() {\n startButton.style.visibility = \"hidden\";\n leaderBoardButton.style.visibility = \"hidden\";\n instructionsButton.style.visibility = \"hidden\";\n}", "function hideMenu() {\n if (showMenu === true) {\n menuBtn.classList.remove(\"close\");\n menu.classList.remove(\"show\");\n menuNav.classList.remove(\"show\");\n navItems.forEach(item => item.classList.remove(\"show\"));\n\n // set menu state\n showMenu = false;\n }\n}", "function hide() {\n\t if (contextMenu != null) {\n\t contextMenu.hide();\n\t }\n\t}", "function hide() {\n\t if (contextMenu != null) {\n\t contextMenu.hide();\n\t }\n\t}", "function closeMenu(selectedMenu){\n document.getElementById(selectedMenu).style.visibility=\"hidden\"; }", "function closemenu(){\n\t\t\tif ( $menu && timer ){\n\t\t\t\t$menu.children('a').removeClass( settings.parentMO ).siblings('ul')[ settings.hide ]();\n\t\t\t\ttimer = clearTimeout( timer );\n\t\t\t\t$menu = false;\n\t\t\t}\n\t\t}", "function hideOptionsMenu() {\n var menu = $(\".optionsMenu\");\n if(menu.css(\"display\") != \"none\") {\n menu.css(\"display\", \"none\");\n }\n}", "function hideLoginOptionsMenu() {\n\tdocument.getElementById(\"loginOptionsMenu\").style.display = \"none\";\n}", "function HideMenus() {\n document.getElementById('menu-1').classList.remove('show');\n document.getElementById('menu-2').classList.remove('show');\n document.getElementById('menu-3').classList.remove('show');\n }", "function hideMenu( index ) {\r\n\r\n index = (index == '[object Event]') ? openMenuName : index;\r\n\r\n var objMenu = objMenuArray.items[index];\r\n objMenu.hide();\r\n\r\n}", "function AbreExpande(menu){\n\tif (menu.style.visibility==\"hidden\"){\n\t\tmenu.style.visibility=\"visible\";\n\t\treturn true;\n\t} else {\n\t\tmenu.style.visibility=\"hidden\";\n\t\treturn false;\n\t}\n}", "function hideMenu(menu) {\r\n if (aplicationName === 'Netscape') {\r\n document.layers[menu].visiaplicationNameility = 'hide';\r\n } else {\r\n document.all[menu].style.visiaplicationNameility = 'hidden';\r\n }\r\n}", "function closeMenu() {\n\n //Hide the menu\n setVisibility(document.getElementById(\"menuPopup\"), false);\n}", "function setMenu() {\n var menu = gId('menu');\n var menu_elements = menu.children;\n for (var i = 0; i < menu_elements.length; i++) {\n if (menu_elements[i].textContent != \"my stories\") {\n menu_elements[i].style.display = 'none';\n }\n }\n}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "hideMenuList() {\n this.toggleMenuList(HIDE);\n this.validate();\n }", "closeMenu() {\n this._itemContainer.visible = false;\n this.accessible.expanded = false;\n this._label.accessible.expanded = false;\n }", "function unhide_navi(){\n document.querySelector('.navbar__menu').style.display = 'block';\n}", "function showHideMenu() {\n if (nav.style.display === \"none\") {\n nav.style.display = \"block\";\n menuBtn.style.transform = \"rotate(45deg)\";\n menuBtn.style.backgroundColor = \"midnightblue\";\n menuBtnIcon.style.transform = \"scale(1.5)\";\n } else {\n hideMenu();\n }\n}", "function hideMenu() {\n // Cache la div avec l'id \"infos\" (Cache le menu)\n $(\"#infos\").hide();\n // Enlève la class \"blur\" sur la div avec l'id \"game-grid\" (Défloute l'arrière plan)\n $(\"#game-grid\").removeClass(\"blur\");\n}", "function disableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" && typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"visible\";\r\n\treturn 0;\r\n}", "function hideDivMenu(thisObject) {\n\tthisObject.style.visibility='hidden';\n}", "hideQuickMenu() { $(`.${this.quickMenu}`).hide(); }", "function hideAllSubMenus_menuhdr() {\n\tfor ( x=0; x<totalButtons_menuhdr; x++) {\n\t\tmoveObjectTo_menuhdr(\"submenu\" + (x+1) + \"_menuhdr\",-500, -500 );\n\t}\n}", "hideQuickMenu() { $(`#${this.quickMenuId}`).hide(); }", "function hideSettingsMenu() {\n settingsMenu.style.display = 'none'; //Then hides the settingsMenu (display none).\n settingsClick = 0; //settingsClick to 0 to reset the loop. (now the menu can be opened again and so i created a loop on click).\n}", "function hideMenu() {\n if (isMobile()) {\n $('.menu-bar').toggleClass('menu-open');\n $('.menu').toggleClass('menu-list-open');\n }\n}", "collapseMenu() {\r\n\t}", "function hideNav() {\n if(isNavVisible === true) {\n noNav();\n\n } else {\n yesNav();\n }\n}", "function hide() {\n if (contextMenu != null) {\n contextMenu.hide();\n }\n}", "function hideNav() {\r\n if (isNavVisible === true) {\r\n noNav();\r\n\r\n } else {\r\n yesNav();\r\n }\r\n}", "function hideMenu() {\n document.getElementById(\"start\").style.display = 'none';\n}", "hideSubMenu_() {\n const items =\n this.querySelectorAll('cr-menu-item[sub-menu][sub-menu-shown]');\n items.forEach((menuItem) => {\n const subMenuId = menuItem.getAttribute('sub-menu');\n if (subMenuId) {\n const subMenu = /** @type {!Menu|null} */\n (document.querySelector(subMenuId));\n if (subMenu) {\n subMenu.hide();\n }\n menuItem.removeAttribute('sub-menu-shown');\n }\n });\n this.currentMenu = this;\n }", "function hideAllMenuAction() {\n $$('.third-toolbar').removeClass('show');\n $$('.floating-product-color ').removeClass('show');\n}", "function hideShowNavigationMenu() {\n\n if ($(\"#nav-list-items\").is(\":visible\")) {\n $(\"#expand-collapse-picture\").attr('src', \"images/expand.png\");\n $(\"#nav-list-items\").hide();\n } else {\n $(\"#expand-collapse-picture\").attr('src', \"images/collapse.png\");\n $(\"#nav-list-items\").show();\n }\n return false;\n }", "function openMenu() {\n\n //Set the menu to be visible\n setVisibility(document.getElementById(\"menuPopup\"), true);\n\n $(\"#graphContextMenu\").hide();\n}", "function hideMenu() {\n menuBtn.style.transform = \"rotate(0deg)\";\n menuBtn.style.backgroundColor = \"deepskyblue\";\n menuBtnIcon.style.transform = \"scale(1.0)\";\n nav.className += \" curtainReverse\";\n setTimeout(() => {\n nav.style.display = \"none\";\n nav.classList.remove(\"curtainReverse\");\n }, 400);\n}", "function closeMenu() {\n g_IsMenuOpen = false;\n}", "cleanMenu() {\n for (var i = 0; i < this.menuView.HTMLElementsMenu.length; i++) {\n this.menuView.HTMLElementsMenu[i].style.display = \"none\";\n }\n for (var i = 0; i < this.menuView.HTMLButtonsMenu.length; i++) {\n this.menuView.HTMLButtonsMenu[i].style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.HTMLButtonsMenu[i].style.zIndex = \"0\";\n }\n }", "function IdeA_avatarclearmenuhide(){\n\t$('#MenU_avatarclear').css('display','none');\t\t\n}", "function hidePropMenu() {\n propBoxLabel.hide();\n ipNameLabel.hide();\n colNameLabel.hide();\n labCaptLabel.hide();\n opNameLabel.hide();\n inputIsTopBox.hide();\n inputCaptionBox.hide();\n outputCaptionBox.hide();\n outputColorBox.hide();\n labelTextBox.hide();\n clockspeedLabel.hide();\n clockspeedSlider.hide();\n}", "function closeExcursionsMenu() {\n !!list.excursionMenu && list.excursionMenu.hide();\n }", "function showMenu() {\n document.getElementById('responsive-menu-click').classList.remove('hide-menu');\n document.getElementById('blackbendjava').classList.remove('d-none');\n}", "function closeMenu() {\n myLinks.style.display = \"none\";\n}", "function hideGoMenu() {\r\n var menu = document.getElementById(\"gameOverMenu\");\r\n menu.style.zIndex = -1;\r\n menu.style.visibility = \"hidden\";\r\n}", "function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }", "function xMenuShowHide(obj)\n{\n\n\tif(obj.style.display == 'none'){\n\t\tobj.style.display = 'block';\n\t}else{\n\t\tobj.style.display = 'none';\n\t}\n\n}", "function mobileMenuHide() {\r\n\t\tvar windowWidth = $(window).width();\r\n\t\tif (windowWidth < 1024) {\r\n\t\t\t$('#site_header').addClass('mobile-menu-hide');\r\n\t\t}\r\n\t}", "function hideOverlay() {\n $overlay.hide();\n menuVisible = false;\n }", "hideContextMenu(animate) {\n this.menu && this.menu.hide(animate);\n }", "hideContextMenu(animate) {\n this.menu && this.menu.hide(animate);\n }", "hideContextMenu(animate) {\n this.menu && this.menu.hide(animate);\n }", "hide() {\n this.navEl_.classList.remove('visible');\n this.navButton_.disabled = false;\n }", "function hide_navi(){\n document.querySelector('.navbar__menu').style.display = 'none';\n}", "function hidePopupMenu() {\n\t\tif (document.getElementById(this.id) != null) {\n\t\t\tdocument.getElementById(this.id).style.visibility = \"hidden\";\n\t\t}\n\t}", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function hideAllMenus() {\n\tdocument.getElementById(\"menu1\").style.display = \"none\";\n\tdocument.getElementById(\"menu2\").style.display = \"none\";\n\tdocument.getElementById(\"menu3\").style.display = \"none\";\n\tdocument.getElementById(\"tableXContainer\").style.display = \"none\";\n\tdocument.getElementById(\"map-canvas2\").style.display = \"none\";\n}", "function turnOffMenus() {\r\n\tif (edit_menu_visible) toggleMenu('edit-menu');\r\n\tif (element_menu_visible) toggleMenu('element-menu');\r\n\tif (pen_menu_visible) toggleMenu('pen-menu');\r\n\tif (shape_menu_visible) toggleMenu('shape-menu');\r\n\tif (text_menu_visible) toggleMenu('text-menu');\r\n\tif (profile_visible) toggleProfile();\r\n}", "function closeTopMenu() {\n //alert (\"close\".menuId);\n $(\"#\"+current_menu+\">ul\").hide();\n}", "function showMenu() {\n\tif(editorMenuHidden === true) {\n\t\t// Set the menu hidden to false\n\t\teditorMenuHidden = false;\n\n\t\tconsole.log(idk);\n\n\t\t//Adjust the height of the box\n\t\tdocument.getElementById(\"box\").style.height = 150 + \"px\";\n\n\t\t// Remove the hidden attribute from the menu options\n\t\tfor(i = 0; i < editorMenuOptions.length; i+= 1) {\n\t\t\tdocument.getElementById(editorMenuOptions[i]).removeAttribute(\"hidden\");\n\t\t}\n\n\t\tconsole.log(\"done\");\n\t} else {\n\t\teditorMenuHidden = true;\n\n\t\t//Add the attribute hidden\n\t\tfor(i = 1; i< editorMenuOptions.length; i+= 1) {\n\t\t\tdocument.getElementById(editorMenuOptions[i]).setAttribute(\"hidden\", true);\n\t\t}\n\t\tdocument.getElementById(\"box\").style.height = 30 + \"px\";\n\t}\n}", "function myFunction(mMenu) {\r\n var x = document.getElementById(\"mMenu\");\r\n if (x.style.display === \"block\") {\r\n x.style.display = \"none\";\r\n } else {\r\n x.style.display = \"block\";\r\n }\r\n }", "function mainMenu(page) {\n document.getElementById('menu').style.visibility=\"visible\";\n document.getElementById(page).style.visibility='hidden';\n}", "hideMenu () {\n try {\n const windowWidth = window.innerWidth\n // console.log(\"Window Width : \",windowWidth)\n if (windowWidth > MENU_HIDE_WIDTH) return\n\n // Veryfies if the sideba is open\n const sidebarEle = document.getElementsByClassName('main-sidebar')\n const style = window.getComputedStyle(sidebarEle[0])\n const transform = style.transform // get transform property\n\n // If the transform property has any\n // negative property, means that the menu\n // is not visible on the screen\n if (transform.match('-')) {\n // Returns if the menu is already hidden\n return\n }\n\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {\n // console.error(error)\n }\n }", "hideContextMenu(animate) {\n this.currentMenu && this.currentMenu.hide(animate);\n }", "hideContextMenu(animate) {\n this.currentMenu && this.currentMenu.hide(animate);\n }", "function hideMenu(){\r\n for(var i = 0; i < startUp.length; i++)\r\n {\r\n startUp[i].style.display = 'none';\r\n }\r\n document.querySelector('canvas').style.display = 'block'\r\n \r\n}", "function OperatE_avatarclearmenu(){\t\n\t\t/* custom the menucustom the menucustom the menucustom the menu\n\t\t * \n\t\t */\n\t\t/*\n\t\t *custom the menucustom the menucustom the menucustom the menu \n\t\t */\n\t\t \t\t\t\t\t \n\t\t/*hide the idea create menu*/\n\t\t$('#MenU_avatarclearback,#MenU_avatarclearcon_can_con').click(function(){\n\t\t\tIdeA_avatarclearmenuhide();\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\n}", "function showhidemenu(){\n\tTi.Analytics.featureEvent(\"openMenu\");\n\talert(\"Menu Button Clicked\");\n}", "function toggleHideMenu() {\n let menu = document.querySelector('#menu');\n menu.classList.toggle('hide');\n}", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function clearMenu () {\n let menuClosed = false;\n\n if (myRBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRBkmkMenuStyle.visibility = \"hidden\";\n\tmyRBkmkMenu_open = false;\n }\n else if (myRShowBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyRShowBkmkMenuStyle.visibility = \"hidden\";\n\tmyRShowBkmkMenu_open = false;\n }\n else if (myRFldrMenu_open) {\n\tmenuClosed = true;\n\tMyRFldrMenuStyle.visibility = \"hidden\";\n\tmyRFldrMenu_open = false;\n }\n else if (myRMultMenu_open) {\n\tmenuClosed = true;\n\tMyRMultMenuStyle.visibility = \"hidden\";\n\tmyRMultMenu_open = false;\n }\n else if (myBBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBBkmkMenuStyle.visibility = \"hidden\";\n\tmyBBkmkMenu_open = false;\n }\n else if (myBResBkmkMenu_open) {\n\tmenuClosed = true;\n\tMyBResBkmkMenuStyle.visibility = \"hidden\";\n\tmyBResBkmkMenu_open = false;\n }\n else if (myBFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBFldrMenuStyle.visibility = \"hidden\";\n\tmyBFldrMenu_open = false;\n }\n else if (myBResFldrMenu_open) {\n\tmenuClosed = true;\n\tMyBResFldrMenuStyle.visibility = \"hidden\";\n\tmyBResFldrMenu_open = false;\n }\n else if (myBSepMenu_open) {\n\tmenuClosed = true;\n\tMyBSepMenuStyle.visibility = \"hidden\";\n\tmyBSepMenu_open = false;\n }\n else if (myBMultMenu_open) {\n\tmenuClosed = true;\n\tMyBMultMenuStyle.visibility = \"hidden\";\n\tmyBMultMenu_open = false;\n }\n else if (myBProtMenu_open) {\n\tmenuClosed = true;\n\tMyBProtMenuStyle.visibility = \"hidden\";\n\tmyBProtMenu_open = false;\n }\n else if (myBProtFMenu_open) {\n\tmenuClosed = true;\n\tMyBProtFMenuStyle.visibility = \"hidden\";\n\tmyBProtFMenu_open = false;\n }\n else if (myMGlassMenu_open) {\n\tmenuClosed = true;\n\tMyMGlassMenuStyle.visibility = \"hidden\";\n\tmyMGlassMenu_open = false;\n }\n\n myMenu_open = isResultMenu = false;\n return(menuClosed);\n}", "function cbHidden(menu_item){\n\t\t\tsettings.onHidden.call($(menu_item).parent())\n\t\t}", "function hideSubMenu_menuhdr(subID) {\n\tif ( overSub_menuhdr == false ) {\n\t\tmoveObjectTo_menuhdr(subID,-500, -500);\n\t}\n}", "function toggleSiteMenu ( )\r\n{\r\n\tif ($('#menuControl').hasClass('menuVisible'))\r\n\t{\r\n\t\t$('#menuControl').removeClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','none');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$('#menuControl').addClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','block');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n}", "function hidemenu_source(){\t\t\t\t\t \n\t //hide\n\t $('#InfossMbacK,#InfossM').css('display','none');\n\t\t//hide the tip\n\t\t\n\t\t/*resetresetresetresetresetreset\n\t\t * \n\t\t ***********************************************/\n\t\t//reset the form\n\t\tvar form=document.getElementById('InfossM_form');\t\n\t\tform.reset(); \t \t\t\t\t\n\t}", "hide() {\n this.isVisible = false;\n }", "function showMallNav() {\n classie.remove(mallNav, 'mallnav--hidden');\n }", "function onHiddenContextMenuHandler () {\n myMenu_open = false; // This sidebar instance menu closed, do not interpret onClicked events anymore\n}", "menuClose(event) {\n var navItem = document.getElementsByTagName('nav')[0];\n if (navItem.style.display === 'block') {\n navItem.style.display = 'none';\n navItem.classList.remove('menuhidden');\n }\n }", "function hideMenuTable(){\r\n //hide menu table\r\n document.getElementById('menu_table').style.visibility = \"hidden\";\r\n \r\n}", "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "function removeMenuDisplay() {\n body.classList.remove(\"noScroll\");\n iconContainer.classList.remove(\"changeColor\");\n closeMenus();\n}" ]
[ "0.81721485", "0.79180944", "0.7890523", "0.78867286", "0.77528787", "0.76835996", "0.763952", "0.76345354", "0.7621206", "0.7535662", "0.75270855", "0.74567723", "0.74488103", "0.74456435", "0.7412652", "0.73228407", "0.731964", "0.7313505", "0.7298508", "0.72896236", "0.72896236", "0.7272137", "0.72685826", "0.7262849", "0.7246476", "0.7238426", "0.7202238", "0.7198315", "0.71975917", "0.71900505", "0.71628726", "0.71618867", "0.71618867", "0.71530867", "0.7130527", "0.71297824", "0.71286523", "0.7101654", "0.708845", "0.7074468", "0.70727587", "0.70663613", "0.7054543", "0.7049506", "0.70186", "0.7011283", "0.7008779", "0.69986826", "0.69960064", "0.6995872", "0.69940436", "0.699197", "0.6975769", "0.69605327", "0.69591755", "0.6956529", "0.6955401", "0.69544953", "0.69508046", "0.6933293", "0.6927014", "0.6925617", "0.69249266", "0.6906902", "0.6905997", "0.6904466", "0.68995756", "0.6892545", "0.6892545", "0.6892545", "0.68915504", "0.68907845", "0.687711", "0.6859738", "0.6849936", "0.68468046", "0.68464005", "0.6843973", "0.6830276", "0.6828426", "0.68252444", "0.6824386", "0.6824386", "0.6824368", "0.68069017", "0.6798792", "0.679405", "0.67799836", "0.67519516", "0.67427796", "0.67401195", "0.67385757", "0.67233986", "0.6720696", "0.67168796", "0.6716307", "0.6714681", "0.66954494", "0.6683502", "0.6682644" ]
0.8137771
1
Setting Auds menu and cbx
SetupAuds(playerMedia) { this.logger.info('Calling for setup Auds !!!'); let audsBtn = null; let i = 0; let item = null; this.mediaPlayer = playerMedia; const audioTracks = this.mediaPlayer.getAudioLanguages(); this.audsExist = false; this.logger.info(' Trying to setup menu Auds , text tracks length : ', audioTracks); // check if exist if ((!audioTracks) || (audioTracks.length <= 1)) { this.audsExist = false; this.logger.log(' Audio Menu not created !'); return false; } // Setting inner of btn div audsBtn = document.getElementById(this.audsBtnId); this.logger.info('Setting the btn ', audsBtn, ' from id ', this.audsBtnId); // this.video array this.audsList = document.getElementById(this.audsMenuListId); // clear old if (this.audsList !== null) { while (this.audsList.firstChild) { this.audsList.removeChild(this.audsList.firstChild); } } else { this.audsMenuDiv = document.createElement('div'); this.audsMenuDiv.classList.add('settingMenuDiv'); this.audsMenuDiv.classList.add('fj-hide'); this.audsMenuDiv.innerHTML = `${'<div class="fj-list-title"> Audios </div> ' + '<ul class="fj-list" id="'}${this.audsMenuListId}" >` + '</ul>'; this.menusDiv.appendChild(this.audsMenuDiv); // Add events for audios button audsBtn.addEventListener('click', (ev) => { this.onshowHideMenu(this.audsMenuDiv, this, ev); }); // audios list this.audsList = document.getElementById(this.audsMenuListId); } for (i = 0; i < audioTracks.length; i += 1) { item = document.createElement('li'); if (this.mediaPlayer.isAudioLangEnabled(i) === true) { item.classList.add('subtitles-menu-item-actif'); } else { item.classList.add('subtitles-menu-item'); } item.setAttribute('index', i); item.innerHTML = this.mediaPlayer.getAudioLangLabel(i); this.audsList.appendChild(item); item.addEventListener('click', () => { this.activate(this, false); }); } this.logger.debug(' Audio Menu created !', audioTracks.length, '! ', this.audsList); return this.audsExist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "domListener(){\n this.menuDisplay([\"file\",\"rotate\",\"brush\",\"outline\",\"fills\",\"size\"]);\n }", "function SetSkin(skn : GUISkin)\r\t{\r\t\tmenuSkin = skn;\r\t}", "function showMenu() {\r\n togMenu=true;\r\n togSet=false;\r\n ctx.fillStyle = \"black\";\r\n ctx.globalAlpha = 0.9; \r\n ctx.fillRect(120, 40, 950, 600);\r\n ctx.globalAlpha = 1.0; \r\n ctx.fillStyle = \"white\";\r\n ctx.textAlign = \"center\"; \r\n ctx.font = \"45px Arial\";\r\n ctx.fillText(\"Settings\", w, 100);\r\n ctx.font = \"35px Arial\";\r\n\r\n if (speechOn) {\r\n ctx.fillText(\"Speech: On - press O to change\", w, 210);\r\n if (keys[79]) { //o\r\n speechOn=false;\r\n }\r\n }\r\n\r\n if (!speechOn) {\r\n ctx.fillText(\"Speech: Off - press B to change\", w, 210);\r\n if (keys[66]) { //b\r\n speechOn=true;\r\n }\r\n }\r\n\r\n /*------------------------------------------------------ */\r\n\r\n \r\n if (musicOn) {\r\n ctx.fillText(\"Music: On - press M to change\", w, 310);\r\n if (keys[77]) { //m\r\n musicOn=false;\r\n }\r\n }\r\n\r\n if (!musicOn) {\r\n ctx.fillText(\"Music: Off - press U to change\", w, 310);\r\n if (keys[85]) { //u\r\n musicOn=true;\r\n }\r\n }\r\n\r\n /*------------------------------------------------------ */\r\n\r\n if (picOn) {\r\n ctx.fillText(\"Picture: On - press C to change\", w, 410);\r\n if (keys[67]) { //o\r\n picOn=false;\r\n }\r\n }\r\n\r\n if (!picOn) {\r\n ctx.fillText(\"Colour: On - press I to change\", w, 410);\r\n if (keys[73]) { //f\r\n picOn=true;\r\n }\r\n }\r\n\r\n ctx.font = \"30px Arial\";\r\n ctx.fillText(\"Return to Game\", w, 560);\r\n ctx.fillText(\"Press A\", w, 610);\r\n\r\n if (keys[65]) { //a\r\n togSet=true;\r\n togMenu=false;\r\n }\r\n}", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "function menuOptions() {}", "function setupMainMenu() {\n mainMenuFontHeight = height;\n mainMenuFontAlpha = 0;\n}", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function on_paint() {\r\n menu_dt()\r\n menu_idt()\r\n menu_tgt()\r\n menu_aa()\r\n menu_vis()\r\n menu_msc()\r\n handle_vis()\r\n handle_msc_two()\r\n}", "function __m_menuBtns_init(){\n\t\t__m_menuBtns_effect();\n\t\t__m_menuBtns_click();\n\n\t\t_m_prozor_init();\n\t}", "function installMenu() {\n wkof.Menu.insert_script_link({\n name: script_name,\n submenu: \"Settings\",\n title: script_name,\n on_click: openSettings,\n });\n }", "function OnGUI() {\n\tif (menuType == \"\" || menuType == null) {\n\t\tmenuType == \"main\";\n\t}\n\n\n\tif(PlayerPrefs.GetInt(\"mute\") == 0){\n\t\tSoundOn = true;\n\t}\n\telse{\n\t\tSoundOn = false;\n\t}\n\t\n\tresetPowerups();\n\n\tif(SoundOn){\n\t\tGUI.skin = SoundOnSkin;\n\t\tAudioListener.volume = 1;\n\t}\n\telse{\n\t\tGUI.skin = SoundOffSkin;\n\t\tAudioListener.volume = 0;\n\t}\n\t\n\tif(GUI.Button(new Rect(Screen.width*.02,Screen.height*0.01,Screen.width*0.1,Screen.width*0.1),\"\"))\n\t\t\t\t{\n\t\t\t\t\tif(SoundOn){\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"mute\", 1);\n\t\t\t\t\t\t//AudioListener.volume = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"mute\", 0);\n\t\t\t\t\t\t//AudioListener.volume = 1;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\n//\tGUILayout.BeginArea(new Rect(Screen.width*0.25, Screen.height*0.25, Screen.width*0.5, Screen.height*0.5), \"\");\n\tGUILayout.BeginArea(new Rect(Screen.width*0.1, Screen.height*0.02, Screen.width*0.8, Screen.height*0.2), \"\");\n\t\n\tGUI.skin = MyGUISkin2;\n\tGUILayout.Space(5);\n//\tGUI.skin.label.fontSize = Screen.height / 10; NO \n//\tGUI.skin.button.fontSize = Screen.height / 20; \n\t\n//\ttransform.guiText.fontSize = Screen.height / 12; //480 / 40 = 12\n\t\n\tvar titleText:String;\n//\tif (PlayerPrefs.GetString(\"debugText\") == \"\") {\n\t\ttitleText = \"CurveBall\";\n//\t}\n//\telse {\n//\t\ttitleText = PlayerPrefs.GetString(\"debugText\");\n//\t}\n\n\tGUILayout.Label(titleText);\n\t\n\tGUILayout.EndArea();\n\t\n\tGUILayout.BeginArea(new Rect(Screen.width*0.1, Screen.height*0.22, Screen.width*0.8, Screen.height*0.73), \"\");\n\t\n\tGUI.skin = MyGUISkin2;\n\t\n\t\n\tif(menuType == \"main\") {\n\t\tif(GUILayout.Button(\"Smash Bricks\")) {\n//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tApplication.LoadLevel(levelsBeforeBB);\n\t\t}\n\n\t\tif (TutorialEngine.phoneCheck() || TutorialEngine.editorCheck()) {\n\t\t\tif(GUILayout.Button(\"Multiplayer\")) {\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\tmenuType = \"matchmaking\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(GUILayout.Button(\"Endless Bricks\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\n\t\t\tApplication.LoadLevel(EndlessScene);\n\t\t}\n\t\t\n\t\tif(GUILayout.Button(\"VS Computer\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\n\t\t\tApplication.LoadLevel(PvAIScene);\n\t\t}\n\n\t\tif (TutorialEngine.phoneCheck() || TutorialEngine.editorCheck()) {\n\t\t\tif(GUILayout.Button(\"Achievements\")) {\n\t\t\t\t\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\n\t\t\t\tif(PlayerPrefs.GetInt(\"signedIn\") == 1){\n\t\t\t\t\tPlayerPrefs.SetInt(\"showAchievements\", 1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tmenuType = \"signInInstructions\";\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(GUILayout.Button(\"Options\")) {\n\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\t\t\tmenuType = \"options\";\n\t\t\tcontSliderValue = PlayerPrefs.GetFloat(\"contSliderValue\");\n\t\t\tcoolSliderValue = PlayerPrefs.GetFloat(\"coolSliderValue\");\n\t\t\tscoreSliderInt = PlayerPrefs.GetInt(\"scoreSliderValue\");\n\t\t\taiDifficulty = PlayerPrefs.GetInt(\"aiDifficulty\");\n\n\t\t} \t\n\t\t\n\t\t/*\n\t\tif(GUILayout.Button(\"Instructions\")) {\n\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\t\t\tmenuType = \"instructions\";\n\n\t\t}\n\t\t*/\n\n\t\tif(GUILayout.Button(\"Tutorial\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tApplication.LoadLevel(TutorialScene);\n\t\t}\n\t\t\n\t\tif(GUILayout.Button(\"About\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"about\";\n\t\t}\n\n\t\n\t\tGUI.skin = BackSkin;\n\t\t\n\t\tif(GUILayout.Button(\"Quit\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tApplication.Quit();\n\t\t}\n\t\t\n\t\tGUI.skin = MyGUISkin2;\n\t\t\n\t\t\n\t\t\n\t}\n\n\tif(menuType == \"signInInstructions\"){\n\t\tGUI.skin = MyGUISkin3;\n\t\tGUILayout.Label(\"Sign into Google+ to use this feature.\");\n\t\tGUI.skin = MyGUISkin2;\n\t\tif(GUILayout.Button(\"Okay\")){\n\t\t\tmenuType = \"main\";\n\t\t}\n\t}\n\t\n\tif(menuType == \"matchmaking\"){\n\t\t\tif(PlayerPrefs.GetInt(\"OnRoomSetupProgress\") == 0 && PlayerPrefs.GetInt(\"Connecting\") == 0){\n\t\t\t\tif(GUILayout.Button(\"Same Device\")) {\n\t\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t//\t\tif(GUI.Button(Rect (0, Screen.height*.1, Screen.height*.75, Screen.height*.1), \"Play\")) {\t\t\n\n\t\t\t\t\tApplication.LoadLevel(PvPScene);\n\t\t\t\t}\n\n\t\t\t\t//LastMultiType, Quick = 0 , Regular = 1\n\n\t\t\t\tif(GUILayout.Button(\"Quick Online Game\")) {\n\t\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\t\tPlayerPrefs.SetInt(\"LastMultiType\", 0);\n\t\t\t\t\tif(PlayerPrefs.GetInt(\"signedIn\") == 1){\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"showQuickGame\", 1);\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"Connecting\", 1);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tmenuType = \"signInInstructions\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\n\t\t\t\t}\n\n\t\t\t\tif(GUILayout.Button(\"Create MP Game\")) {\n\t\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\t\t\n\t\t\t\t\tPlayerPrefs.SetInt(\"LastMultiType\", 1);\n\t\t\t\t\tif(PlayerPrefs.GetInt(\"signedIn\") == 1){\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"showInviteScreen\", 1);\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"type\", 0);\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"Connecting\", 1);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tmenuType = \"signInInstructions\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(GUILayout.Button(\"Join MP Game\")) {\n\t\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\t\tPlayerPrefs.SetInt(\"LastMultiType\", 1);\n\t\t\t\t\tif(PlayerPrefs.GetInt(\"signedIn\") == 1){\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"joinMultiplayer\", 1);\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"type\", 1);\n\t\t\t\t\t\tPlayerPrefs.SetInt(\"Connecting\", 1);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tmenuType = \"signInInstructions\";\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(PlayerPrefs.GetInt(\"Connecting\") == 1){\n\t\t\t\tGUI.skin = MyGUISkin3;\n\t\t\t\tGUILayout.Label(\"Connecting to Google Play...\");\n\t\t\t}\n\n\t\t\tif(PlayerPrefs.GetInt(\"OnRoomSetupProgress\") == 1){\n\t\t\t\tPlayerPrefs.SetInt(\"Connecting\", 0);\n\t\t\t\tGUI.skin = MyGUISkin3;\n\t\t\t\tGUILayout.Label(\"Connecting to opponent...\");\n\t\t\t}\n\n\t\t\tGUI.skin = BackSkin;\n\t\t\tif(GUILayout.Button(\"Back\")) {\n\t\t\t\tPlayerPrefs.SetInt(\"Disconnect\", 1);\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\tPlayerPrefs.SetInt(\"type\", 0);\n\t\t\t\tmenuType = \"main\";\n\n\n\t\t\t}\n\n\t\t\tif(Input.GetKeyDown(\"escape\")){\n\t\t\t\tPlayerPrefs.SetInt(\"Disconnect\", 1);\n\t\t\t\tPlayerPrefs.SetInt(\"type\", 0);\n\t\t\t\tmenuType = \"main\";\n\t\t\t}\n\n\n\t\t\tGUI.skin = MyGUISkin2;\n\t}\n\n\tif(menuType == \"about\"){\n\t\t\tGUI.skin = SubHeadingSkin;\n\t\t\tGUILayout.Label(\"About\");\n\t\t\tGUI.skin = MyGUISkin3;\n\t\t\tGUILayout.Label(\"Developers: \\n Krish Masand & Mark Tai\");\n\t\t\tGUILayout.Label(\"Special Thanks: \\n Music - Markus Heichelbech \\n Test Devices - UIUC's ACM SIGMobile Chapter \\n Inspiration - Julie Rooney & Melissa Antonacci\");\n\n\t\t\tGUILayout.Space(30);\n\n\t\t\tGUI.skin = BackSkin;\n\t\t\tif(GUILayout.Button(\"Back\")) {\n\t\t\t\tmenuType = \"main\";\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t}\n\n\t\t\tif(Input.GetKeyDown(\"escape\")){\n\t\t\t\tmenuType = \"main\";\n\t\t\t}\n\n\t\t\tGUI.skin = MyGUISkin2;\n\t}\n\n\n\t//Options Menu\n\tif(menuType == \"options\") {\n\t\tGUILayout.BeginArea(new Rect(0, 0, Screen.width*0.8, Screen.height*0.7), \"\");\n\t\toptionScrollPosition = GUILayout.BeginScrollView (optionScrollPosition);\n\n\t\n\t\t\n\t\tfor (var touch : Touch in Input.touches) {\n\t\t if (touch.phase == TouchPhase.Moved) {\n\n\t\t optionScrollPosition.y += touch.deltaPosition.y;\n\t\t optionScrollPosition.x += touch.deltaPosition.x;\n\t\t }\n\t\t}\n\t\t\n\t\tGUI.skin = SubHeadingSkin;\n\t\tGUILayout.Label(\"Options\");\n\t\tGUI.skin = MyGUISkin3;\n\t\tGUILayout.Space(5);\n\n\t\tGUILayout.Label(\"Max VS Score: \" + scoreSliderInt.ToString());\n\t\tscoreSliderInt = GUILayout.HorizontalSlider(scoreSliderInt, 1.0, 30.0);\n\t\tPlayerPrefs.SetInt(\"scoreSliderValue\", scoreSliderInt);\n\n\t\tGUILayout.Label(\"VS Control Time: \" + (contSliderValue).ToString(\"F2\"));\n\t\tcontSliderValue = GUILayout.HorizontalSlider(contSliderValue, 0.0, 10.0);\n\t\tPlayerPrefs.SetFloat(\"contSliderValue\", contSliderValue);\n\n\t\tGUILayout.Label(\"VS Cooldown Time: \" + (coolSliderValue).ToString(\"F2\"));\n\t\tcoolSliderValue = GUILayout.HorizontalSlider(coolSliderValue, 0.0, 10.0);\n\t\tPlayerPrefs.SetFloat(\"coolSliderValue\", coolSliderValue);\n\n\t\tvar aiText:String = \"AI Difficulty: \";\n\t\tif (aiDifficulty == 0) aiText += \"Easy\";\n\t\telse if (aiDifficulty == 1) aiText += \"Medium\";\n\t\telse if (aiDifficulty == 2) aiText += \"Hard\";\n\t\telse if (aiDifficulty == 3) aiText += \"Insane\";\n\t\tGUILayout.Label(aiText);\n\t\taiDifficulty = GUILayout.HorizontalSlider(aiDifficulty, 0, 2);\n\t\tPlayerPrefs.SetInt(\"aiDifficulty\", aiDifficulty);\n\n\n\t\t// var adText:String;\n\n\t\t// if (PlayerPrefs.GetInt(\"adsEnabled\") == 1) {\n\t\t// \tadText = \"Turn Ads Off\";\n\t\t// \tGUI.skin = BackSkin;\n\t\t// }\n\n\t\t// else if (PlayerPrefs.GetInt(\"adsEnabled\") == 0) {\n\t\t// \tadText = \"Turn Ads On\";\n\t\t// \tGUI.skin = MyGUISkin2;\n\t\t// }\n\n\t\t// if (GUILayout.Button(adText)) {\n\t\t// \taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t// \tPlayerPrefs.SetInt(\"adsEnabled\", 1 - PlayerPrefs.GetInt(\"adsEnabled\")); //toggles between 1 and 0\n\t\t// }\n\n\t\tGUI.skin = MyGUISkin2;\n\t\tif (PlayerPrefs.GetInt(\"paid\") == 0) {\n\t\t\tif (GUILayout.Button(\"Donate+Remove Ads\")) {\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\tgameObject.SendMessage(\"buyCookie\");\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tif (GUILayout.Button(\"Enjoy the Cookie!\")) {\n\t\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\t\tthrowCookie();\n\t\t\t}\n\t\t}\n\n\t\tvar joystickText:String;\n\t\tif (PlayerPrefs.GetInt(\"restingJoystickEnabled\") == 0) {\n\t\t\tjoystickText = \"Rest Joystick is Off\";\n\t\t\tGUI.skin = MyGUISkin2;\n\t\t}\n\n\t\telse if (PlayerPrefs.GetInt(\"restingJoystickEnabled\") == 1) {\n\t\t\tjoystickText = \"Rest Joystick is On\";\n\t\t\tGUI.skin = BackSkin;\n\t\t}\n\n\t\tif (GUILayout.Button(joystickText)) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tPlayerPrefs.SetInt(\"restingJoystickEnabled\", 1 - PlayerPrefs.GetInt(\"restingJoystickEnabled\")); //toggles between 1 and 0\n\t\t}\n\n\t\tvar tiltText:String;\n\n\t\tif (PlayerPrefs.GetInt(\"tiltControlEnabled\") == 0) {\n\t\t\ttiltText = \"Tilt Control is Off\";\n\t\t\tGUI.skin = MyGUISkin2;\n\t\t}\n\n\t\telse if (PlayerPrefs.GetInt(\"tiltControlEnabled\") == 1) {\n\t\t\ttiltText = \"Tilt Control is On\";\n\t\t\tGUI.skin = BackSkin;\n\t\t}\n\n\t\tif (GUILayout.Button(tiltText)) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tPlayerPrefs.SetInt(\"tiltControlEnabled\", 1 - PlayerPrefs.GetInt(\"tiltControlEnabled\")); //toggles between 1 and 0\n\t\t}\n\n\t\tif (PlayerPrefs.GetFloat(\"contSliderValue\") <= .02 && PlayerPrefs.GetFloat(\"coolSliderValue\") >= 9.98 && PlayerPrefs.GetInt(\"scoreSliderValue\") == 23) { //Gives you everything\n\n\t\t\t\t// PlayerPrefs.SetInt(\"unlockedLevel\", 40);\n\t\t\t\t// PlayerPrefs.SetInt(\"extraBalls\", 500);\n\t\t\t\t// PlayerPrefs.SetInt(\"invincible\", 100);\n\t\t\t\t// PlayerPrefs.SetInt(\"moreConTime\", 100);\n\t\t\t\t// PlayerPrefs.SetInt(\"longerPaddle\", 100);\n\t\t\tif (!cheatCheck) {\n\t\t\t\tif (devBuild) {\n\t\t\t\t\ttogglePay = true;\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPlayerPrefs.SetInt(\"adsEnabled\", 0);\n\t\t\t\t\tPlayerPrefs.SetInt(\"redditor\", 1);\n\t\t\t\t}\n\t\t\t\tcheatCheck = true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tcheatCheck = false;\n\t\t}\n\n\n\t\tGUI.skin = MyGUISkin2;\n\t\t\n\t\tif(GUILayout.Button(\"Reset to Default\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tresetOptions();\n\t\t\tcontSliderValue = PlayerPrefs.GetFloat(\"contSliderValue\");\n\t\t\tcoolSliderValue = PlayerPrefs.GetFloat(\"coolSliderValue\");\n\t\t\tscoreSliderInt = PlayerPrefs.GetInt(\"scoreSliderValue\");\n\t\t\taiDifficulty = PlayerPrefs.GetInt(\"aiDifficulty\");\n\t\t}\n\t\t\n\t\tGUI.skin = BackSkin;\n\t\t\n\t\tif(GUILayout.Button(\"Reset Progress\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"reset\";\n\t\t\t\n\t\t}\t\t\n\n\t\tif(GUILayout.Button(\"Back\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"main\";\t\t\n\t\t}\t\n\t\t\n\t\tif(Input.GetKeyDown(\"escape\")){\n\t\t\tmenuType = \"main\";\n\t\t}\n\t\t\n\t\t\n\t\tGUI.skin = MyGUISkin2;\n\n\t\tGUILayout.EndScrollView ();\n\t\tGUILayout.EndArea();\n\t}\n\t\n\tif(menuType == \"reset\"){\n\t\n\t\tGUI.skin = MyGUISkin2;\n\t\tGUILayout.Label(\"Options\");\n\t\tGUI.skin = MyGUISkin3;\n\t\tGUILayout.Space(5);\n\t\tGUILayout.Label(\"Are you sure you want to reset your Smash Bricks progress?\");\n\t\t\n\t\tGUI.skin = BackSkin;\n\t\tif(GUILayout.Button(\"Yes\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"options\";\n\t\t\tresetProgress();\n\t\t\t\n\t\t}\n\n\t\tGUI.skin = MyGUISkin2;\n\t\tif(GUILayout.Button(\"No\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"options\";\n\t\t\t\n\t\t}\t\n\t\t//GUILayout.label\n\t\t\n\t\tif(Input.GetKeyDown(\"escape\")){\n\t\t\tmenuType = \"options\";\n\t\t}\n\t\t\n\t}\n\t\n\tif(menuType == \"instructions\") {\n\n\t\tGUI.skin = BackSkin;\n\t\tif(GUILayout.Button(\"Back\")) {\n\t\t\taudio.PlayOneShot(Resources.Load(\"audio/Click\"));\n\t\t\tmenuType = \"main\";\n\t\t}\n\t\t\n\t\tif(Input.GetKeyDown(\"escape\")){\n\t\t\tmenuType = \"main\";\n\t\t}\n\t\t\n\t\tGUI.skin = MyGUISkin;\n\t\tinstructionScrollPosition = GUILayout.BeginScrollView (instructionScrollPosition);\n\t\t\n\t\tfor (var touch : Touch in Input.touches) \n\t\t{\n\t\t if (touch.phase == TouchPhase.Moved)\n\t\t {\n\n\t instructionScrollPosition.y += touch.deltaPosition.y;\n\t instructionScrollPosition.x += touch.deltaPosition.x;\n\t\t }\n\t\t}\n\t\t\n\t\tGUILayout.Label(\"Instructions\");\n\t\tGUILayout.Space(1);\n\t\tGUILayout.Label(\"CurveBall is a pong variation with one major difference: ball control!\\nControls:\\nPaddle - Under the colored line, touch to the left and right of the paddle to move it. \\nBall - Between the white and colored line, touch and hold to move the ball in that direction. The ball control is limited, so use it wisely!\");\n\t\tGUILayout.Label(\"Notes:\");\n\t\tGUILayout.Label(\"The ball cannot be controlled when past the colored lines.\");\n\t\tGUILayout.Label(\"A colored number means you can control the ball. A white number means cooldown.\");\n\t\tGUILayout.Label(\"Tip: Try to control the ball here!\");\n\t\tGUILayout.EndScrollView ();\n\t\t\n\n\n\n\n\t}\n\n\n\tif (menuType == \"rate\") {\n\t\tGUI.skin = SubHeadingSkin;\n\t\tGUILayout.Label(\"We're glad that you're enjoying CurveBall! Would you like rate our app?\");\n\t\tGUI.skin = MyGUISkin2;\n\t\tif(GUILayout.Button(\"Yes\")){\n\n\t\t\tApplication.OpenURL(\"market://details?id=com.curveBall.curveBall\");\n\t\t\tPlayerPrefs.SetInt(\"timesToWait\", -2);\n\t\t\tmenuType = \"thanksRate\";\n\t\t}\n\n\t\tif (GUILayout.Button(\"Maybe Later\")) {\n\t\t\tPlayerPrefs.SetInt(\"timesToWait\", 7);\n\t\t\tmenuType = \"main\";\n\t\t}\n\n\t\tif(GUILayout.Button(\"I Already Have\")){\n\t\t\tPlayerPrefs.SetInt(\"timesToWait\", -2);\n\t\t\tmenuType = \"thanksRate\";\n\t\t}\n\n\t\tGUI.skin = BackSkin;\n\t \n\t\tif(GUILayout.Button(\"No\")){\n\t\t\tPlayerPrefs.SetInt(\"timesToWait\", -2);\n\t\t\tmenuType = \"main\";\n\t\t}\n\n\t\tGUI.skin = MyGUISkin;\n\t}\n\n\tif (menuType == \"thanksRate\"){\n\t\tGUI.skin = SubHeadingSkin;\n\t\tGUILayout.Label(\"Thanks for rating! We're working hard to make sure your experience is as awesome as possible!\");\n\t\tGUI.skin = BackSkin;\n\n\t\tif(GUILayout.Button(\"Main Menu\")){\n\t\t\tmenuType = \"main\";\n\t\t}\n\n\t}\n\n\t\n\t\n\tGUILayout.EndArea();\n\n\n\tGUILayout.BeginArea(new Rect(0 , 0, Screen.width, Screen.height), \"\");\n\tfor( var cookiePosition:Vector2 in cookiePositions) {\n\t\tif (cookiePosition.y + 338 >= 0 && cookiePosition.y <= Screen.height) { // COOKIE!\n\t\t\tvar aTexture:Texture = Resources.Load(\"Textures/Transparent Cookie\");\n\t\t\tGUI.DrawTexture(new Rect(cookiePosition.x, cookiePosition.y, 340, 338), aTexture);\n\t\t}\n\t}\n\tGUILayout.EndArea();\t\t\n\n//\tGUILayout.EndScrollView ();\n\n}", "setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }", "function menu(index) {\n\tvar locx = game.data.location_x[index] + 32;\n\tvar locy = game.data.location_y[index];\n\tif (game.data.location_x[index] >= 576) {\n\t locx = game.data.location_x[index] - 64;\n\t}\n\tif (game.data.location_y[index] >= 416) {\n\t locy = 416;\n\t}\n\tme.game.add((new atk_button(locx,locy)), 4);\n\tme.game.add((new wait_button(locx,locy+32)), 4);\n\tme.game.add((new back_button(locx,locy+64)), 4);\n}", "function showMenu() {\n rectMode(CENTER);\n fill(colorList[2]);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[5]);\n text(\"How to Play\", buttonX, buttonY);\n\n fill(colorList[3]);\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[4]);\n text(\"Dancing Block\", buttonX, secondButtonYpos);\n \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 }", "createMenu()\n {\n currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo');\n\n // The first button that will enable audio\n let firstBtn = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'FirstStart');\n\n firstBtn.setInteractive();\n firstBtn.on('pointerdown',function()\n {\n this.setScale(1.05);\n });\n firstBtn.on('pointerup',function()\n {\n firstBtn.disableInteractive();\n // We play the Button pressed SFX \n sfxManager.playSupahStar();\n firstBtn.destroy();\n });\n firstBtn.on('pointerup', () => this.startMainMenu());\n\n // We set the fonts according to the browser\n if(theGame.device.browser.firefox)\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n else\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n }", "function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function install_menu() {\n var config = {\n name: 'dashboard_level',\n submenu: 'Settings',\n title: 'Dashboard Level',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"becas.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"procesos.png\",31,22,\"reportes.png\",31,22,\"configuracion.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,90,82,0,1,2,1,0,1,n,n,100,0,0,90,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Becas\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Cargos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_cargo.php\",n,n,n,\"../tepuy_sno_d_cargo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tabulador\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_tabulador.php\",n,n,n,\"../tepuy_sno_d_tabulador.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Cargos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_asignacioncargo.php\",n,n,n,\"../tepuy_sno_d_asignacioncargo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,12,n);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Personal -&gt; Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_personalnomina.php\",n,n,n,\"../tepuy_sno_d_personalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constantes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_constantes.php\",n,n,n,\"../tepuy_sno_d_constantes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,15,n);\r\nit=s1.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_concepto.php\",n,n,n,\"../tepuy_sno_d_concepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,16,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constante por Persona\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_persxconst.php\",n,n,n,\"../tepuy_sno_d_persxconst.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,18,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto por Persona\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_persxconce.php\",n,n,n,\"../tepuy_sno_d_persxconce.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,19,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tipo de Prestamo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_tipoprestamo.php\",n,n,n,\"../tepuy_sno_d_tipoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,20,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto de Vacación\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_vacacionconcepto.php\",n,n,n,\"../tepuy_sno_d_vacacionconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,21,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto de Prima\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_primaconcepto.php\",n,n,n,\"../tepuy_sno_d_primaconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,22,n);\r\nit=s0.addItemWithImages(3,4,4,\"Procesos\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,11,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,17,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,188,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,10,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_calcularprenomina.php\",n,n,n,\"../tepuy_sno_p_calcularprenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,23,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cálculo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_calcularnomina.php\",n,n,n,\"../tepuy_sno_p_calcularnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,24,n);\r\nit=s2.addItemWithImages(6,7,7,\"Reverso\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_reversarnomina.php\",n,n,n,\"../tepuy_sno_p_reversarnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,25,n);\r\nit=s1.addItemWithImages(6,7,7,\"Manejo de Períodos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_manejoperiodo.php\",n,n,n,\"../tepuy_sno_p_manejoperiodo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,11,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Generar vacaciones Vencidas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_vacacionvencida.php\",n,n,n,\"../tepuy_sno_p_vacacionvencida.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,26,n);\r\nit=s2.addItemWithImages(6,7,7,\"Programar Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_vacacionprogramar.php\",n,n,n,\"../tepuy_sno_p_vacacionprogramar.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,76,n);\r\nit=s1.addItemWithImages(6,7,7,\"Préstamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_prestamo.php\",n,n,n,\"../tepuy_sno_p_prestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,28,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambiar Estatus de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_personalcambioestatus.php\",n,n,n,\"../tepuy_sno_p_personalcambioestatus.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,27,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aplicar Conceptos Lote\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_aplicarconcepto.php\",n,n,n,\"../tepuy_sno_p_aplicarconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,29,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ajustes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,189,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,76,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Sueldos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_ajustarsueldo.php\",n,n,n,\"../tepuy_sno_p_ajustarsueldo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,191,n);\r\nit=s2.addItemWithImages(6,7,7,\"Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_ajustaraporte.php\",n,n,n,\"../tepuy_sno_p_ajustaraporte.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,192,n);\r\nit=s1.addItemWithImages(6,7,7,\"Importar/Exportar Datos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_impexpdato.php\",n,n,n,\"../tepuy_sno_p_impexpdato.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s1.addItemWithImages(6,7,7,\"Importar Definiciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_importardefiniciones.php\",n,n,n,\"../tepuy_sno_p_importardefiniciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,77,n);\r\nit=s1.addItemWithImages(6,7,7,\"Movimiento entre Nóminas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_movimientonominas.php\",n,n,n,\"../tepuy_sno_p_movimientonominas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,78,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",7,7,7,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenomina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_prenomina.php\",n,n,n,\"../tepuy_sno_r_prenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_pagonomina.php\",n,n,n,\"../tepuy_sno_r_pagonomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de pago por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_pagonominaunidadadmin.php\",n,n,n,\"../tepuy_sno_r_pagonominaunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,40,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_recibopago.php\",n,n,n,\"../tepuy_sno_r_recibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s1.addItemWithImages(6,7,7,\"Listados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadoconcepto.php\",n,n,n,\"../tepuy_sno_r_listadoconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Cobro por Cheque\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadopersonalcheque.php\",n,n,n,\"../tepuy_sno_r_listadopersonalcheque.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadobanco.php\",n,n,n,\"../tepuy_sno_r_listadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Firmas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadofirmas.php\",n,n,n,\"../tepuy_sno_r_listadofirmas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Beneficiarios\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadobeneficiario.php\",n,n,n,\"../tepuy_sno_r_listadobeneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,79,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aporte Patronal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_aportepatronal.php\",n,n,n,\"../tepuy_sno_r_aportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nit=s1.addItemWithImages(6,7,7,\"Resumenes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_resumenconcepto.php\",n,n,n,\"../tepuy_sno_r_resumenconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto por Unidad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_resumenconceptounidad.php\",n,n,n,\"../tepuy_sno_r_resumenconceptounidad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_cuadrenomina.php\",n,n,n,\"../tepuy_sno_r_cuadrenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Conceptos y Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_cuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_contableconceptos.php\",n,n,n,\"../tepuy_sno_r_contableconceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_contableaportes.php\",n,n,n,\"../tepuy_sno_r_contableaportes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_relacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_relacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Programación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_programacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_programacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadoprestamo.php\",n,n,n,\"../tepuy_sno_r_listadoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Detalle de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_detalleprestamo.php\",n,n,n,\"../tepuy_sno_r_detalleprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s0.addItemWithImages(3,4,4,\"Configuración\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Parámetros de Reportes Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",9,9,9,3,3,3,n,n,n,\"\",n,n,n,\"../../tepuy_menu.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"historico_nomina.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"reportes.png\",31,22,\"mantenimiento.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,110,82,0,1,2,1,0,1,n,n,100,0,0,110,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Histórico de Nómina\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Personal -&gt; Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_hpersonalnomina.php\",n,n,n,\"../tepuy_sno_d_hpersonalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_hconcepto.php\",n,n,n,\"../tepuy_sno_d_hconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,16,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenomina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hprenomina.php\",n,n,n,\"../tepuy_sno_r_hprenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hpagonomina.php\",n,n,n,\"../tepuy_sno_r_hpagonomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pago de Nómina por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hpagonominaunidadadmin.php\",n,n,n,\"../tepuy_sno_r_hpagonominaunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,3,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hrecibopago.php\",n,n,n,\"../tepuy_sno_r_hrecibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s1.addItemWithImages(6,7,7,\"Listados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadoconcepto.php\",n,n,n,\"../tepuy_sno_r_hlistadoconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Cobro por Cheque\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadopersonalcheque.php\",n,n,n,\"../tepuy_sno_r_hlistadopersonalcheque.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadobanco.php\",n,n,n,\"../tepuy_sno_r_hlistadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Firmas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadofirmas.php\",n,n,n,\"../tepuy_sno_r_hlistadofirmas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aporte Patronal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_haportepatronal.php\",n,n,n,\"../tepuy_sno_r_haportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nit=s1.addItemWithImages(6,7,7,\"Resumenes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hresumenconcepto.php\",n,n,n,\"../tepuy_sno_r_hresumenconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto por Unidad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hresumenconceptounidad.php\",n,n,n,\"../tepuy_sno_r_hresumenconceptounidad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcuadrenomina.php\",n,n,n,\"../tepuy_sno_r_hcuadrenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Monto Ejecutado por Tipo de Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_hcuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Monto Ejecutado Pensionados, Jubilados y Sobreviviente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_hcuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcontableconceptos.php\",n,n,n,\"../tepuy_sno_r_hcontableconceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcontableaportes.php\",n,n,n,\"../tepuy_sno_r_hcontableaportes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hrelacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_hrelacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Vacaciones Programadas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hprogramacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_hprogramacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadoprestamo.php\",n,n,n,\"../tepuy_sno_r_hlistadoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Detalle de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hdetalleprestamo.php\",n,n,n,\"../tepuy_sno_r_hdetalleprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s0.addItemWithImages(3,4,4,\"Mantenimiento\",n,n,\"\",7,7,7,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarnomina.php\",n,n,n,\"../tepuy_sno_p_hmodificarnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hunidadadmin.php\",n,n,n,\"../tepuy_sno_p_hunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarpersonalnomina.php\",n,n,n,\"../tepuy_sno_p_hmodificarpersonalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarconcepto.php\",n,n,n,\"../tepuy_sno_p_hmodificarconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ajustar Contabilización\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hajustarcontabilizacion.php\",n,n,n,\"../tepuy_sno_p_hajustarcontabilizacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,\"../tepuywindow_blank.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function onOpen() { CUSTOM_MENU.add(); }", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "function onProductionButton( event ) {\r\n\topenWindowMenu(2);\r\n}", "function setMenu(menuBar){\n Menu.setApplicationMenu(Menu.buildFromTemplate(menuBar));\n}", "function init() {\n\n // Styles and other settings from the setup page.\n color = cb.settings.color\n background = cb.settings.background\n weight = cb.settings.weight\n rate_limit = parseInt(cb.settings.limit)\n verbose = cb.settings.verbose === 'yes'\n welcome = cb.settings.welcome === 'yes'\n command = cb.settings.command\n prefix = cb.settings.order == 'before'\n // The separator is the character to be displayed between items in the tip menu.\n separator = symbols[cb.settings.separator.toLowerCase()]\n if (separator == null) {\n notify(broadcaster, `PROGRAMMING ERROR: cb.settings.separator ${cb.settings.separator} is undefined. Please contact the developer.`)\n separator = symbols.Bar\n }\n\n // Build the TipMenus.\n for(let i = 0; i < NUM_MENUS; ++i) {\n cb.log(\"Builing menu \" + i)\n let menu = new TipMenu()\n for (let j = 0; j < ITEMS_PER_MENU; ++j) {\n let s = cb.settings[`item${i}${j}`]\n if (s != null && s.length > 0) {\n let space = s.indexOf(' ')\n if (space === -1) {\n notify(broadcaster, `Invalid tip menu ${i + 1} item #${j + 1}: ${s}`)\n }\n else {\n let price = s.substring(0, space).trim()\n let desc = s.substring(space + 1).trim()\n cb.log(`Menu item ${i} ${j}: ${price} ${desc}`)\n menu.add(price, desc)\n }\n }\n }\n // if (menu.size() === 0) {\n // cb.log(`Menu ${i+1} is empty and will not be included.`)\n // break\n // }\n menus.push(menu)\n let key = 'menu' + i\n if (cb.settings[key] == 'enable') {\n cb.log(`Enabled menu ${i}`)\n current.addMenu(menu)\n }\n else {\n cb.log(`Menu ${i} is not enabled.`)\n }\n }\n\n // The delay determines how frequently the tip menu will be displayed.\n // The default is once per minute.\n let m = parseInt(cb.settings.delay)\n if (isNaN(m)) {\n notify(broadcaster, 'Invalid tip menu delay specified. Defaulting to one minute.')\n delay = 60000\n }\n else {\n delay = m * 60000\n }\n\n // Start the periodic menu display.\n message_count = rate_limit\n scheduleDisplay()\n}", "function _attachMenuActions() {\n $('#toggleAnimation').click(function(){\n if($(this).text() == \"Pause\"){\n $(this).html(\"Start\");\n $(document).bgStretcher.pause();\n $('#previousImage').removeClass('disabled');\n $('#nextImage').removeClass('disabled');\n } else {\n $(this).html(\"Pause\");\n $(document).bgStretcher.play();\n $('#previousImage').addClass('disabled');\n $('#nextImage').addClass('disabled');\n }\n \t });\n\n $('#previousImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.previous();\n });\n\n $('#nextImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.next();\n });\n\n $('.album').click(function() {\n $(document).bgStretcher.changeAlbum($(this).text());\n });\n }", "function init() {\n\tapp.addSubMenu({\n\t\tcName: \"Redaction Tools\",\n\t\tcParent: \"Edit\",\n\t\tnPos: 0\n\t});\n\n\tapp.addMenuItem({\n\t\tcName: \"Auto Redaction\",\n\t\tcParent: \"Redaction Tools\",\n\t\tcPos: 1,\n\t\tcExec: \"redactionHelper()\"\n\t});\n}", "function gui()\n{\n\tui_clear();\t// clean up the User interface before drawing a new one.\n\t\n\tui_add_ch_selector(\"ch\", \"Channel to decode\", \"NMEA\");\n\tui_add_baud_selector(\"baud\", \"BAUD rate\", 9600);\n\n\tui_add_txt_combo(\"invert\",\"Inverted logic\");\n\t\tui_add_item_to_txt_combo(\"Non inverted logic\",true);\n\t\tui_add_item_to_txt_combo(\"Inverted logic\");\n\n}", "[SET_MENU_ACTIVE] (state, button) {\n\n var menu = state[button['menu_name']]\n if( menu != undefined ){\n menu[menu.indexOf(button) ].active = !menu[ menu.indexOf(button) ].active\n }else{\n var menu = state[ button['owner_type'] ]\n for(var btn in menu){\n if(menu[btn].id == button.menu_id){\n var subMenu = menu[btn].submenu \n menu[btn].active = true\n subMenu[ subMenu.indexOf(button) ].active = !subMenu[ subMenu.indexOf(button) ].active\n }\n } \n } \n }", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"nomina.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"procesos.png\",31,22,\"integrar.png\",31,22,\"reportes.png\",31,22,\"ivss.png\",31,22,\"configuracion.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,90,82,0,1,2,1,0,1,n,n,100,0,0,90,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Nómina\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nóminas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_nominas.php\",n,n,n,\"../tepuy_snorh_d_nominas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Profesiones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_profesion.php\",n,n,n,\"../tepuy_snorh_d_profesion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s1.addItemWithImages(6,7,7,\"Unidades Administrativos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_uni_ad.php\",n,n,n,\"../tepuy_snorh_d_uni_ad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,12,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ubicación Física\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_ubicacionfisica.php\",n,n,n,\"../tepuy_snorh_d_ubicacionfisica.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ficha del Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_personal.php\",n,n,n,\"../tepuy_snorh_d_personal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,15,n);\r\nit=s1.addItemWithImages(6,7,7,\"Feriados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_diaferiado.php\",n,n,n,\"../tepuy_snorh_d_diaferiado.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,16,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cesta Ticket\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_ct_met.php\",n,n,n,\"../tepuy_snorh_d_ct_met.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,18,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tabla de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_tablavacacion.php\",n,n,n,\"../tepuy_snorh_d_tablavacacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,19,n);\r\nit=s1.addItemWithImages(6,7,7,\"Método a Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_metodobanco.php\",n,n,n,\"../tepuy_snorh_d_metodobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,20,n);\r\nit=s1.addItemWithImages(6,7,7,\"Sueldo Mínimo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_sueldominimo.php\",n,n,n,\"../tepuy_snorh_d_sueldominimo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,21,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constacia de Trabajo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_constanciatrabajo.php\",n,n,n,\"../tepuy_snorh_d_constanciatrabajo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,22,n);\r\nit=s1.addItemWithImages(6,7,7,\"Archivos TXT\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_archivostxt.php\",n,n,n,\"../tepuy_snorh_d_archivostxt.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,23,n);\r\nit=s1.addItemWithImages(6,7,7,\"Dedicación\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_dedicacion.php\",n,n,n,\"../tepuy_snorh_d_dedicacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,24,n);\r\nit=s1.addItemWithImages(6,7,7,\"Escala Docente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_escaladocente.php\",n,n,n,\"../tepuy_snorh_d_escaladocente.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,25,n);\r\nit=s1.addItemWithImages(6,7,7,\"Clasificación de Obreros\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_clasificacionobreros.php\",n,n,n,\"../tepuy_snorh_d_clasificacionobreros.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,26,n);\r\nit=s0.addItemWithImages(3,4,4,\"Procesos\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,11,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,17,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Seleccionar Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../tepuy_snorh_p_seleccionarnomina.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=530,height=180,left=250,top=200,location=no,resizable=no');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,188,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestación de Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_fideicomiso.php\",n,n,n,\"../tepuy_snorh_p_fideicomiso.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s1.addItemWithImages(6,7,7,\"Histórico x Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../tepuy_snorh_p_seleccionarhnomina.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=530,height=180,left=250,top=200,location=no,resizable=no');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambiar Estatus de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_personalcambioestatus.php\",n,n,n,\"../tepuy_snorh_p_personalcambioestatus.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,27,n);\r\nit=s1.addItemWithImages(6,7,7,\"Programación de Reporte\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_programacionreporte.php\",n,n,n,\"../tepuy_snorh_p_programacionreporte.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,28,n);\r\nit=s1.addItemWithImages(6,7,7,\"Buscar Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_buscarpersonal.php\",n,n,n,\"../tepuy_snorh_p_buscarpersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,29,n);\r\nit=s1.addItemWithImages(6,7,7,\"Contabilizar Nómina\",n,n,\"\",7,7,7,1,1,1,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,189,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,76,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Contabilizar\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_mis_p_contabiliza_sno.php\",n,n,n,\"../tepuy_mis_p_contabiliza_sno.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,191,n);\r\nit=s2.addItemWithImages(6,7,7,\"Reversar Contabilización\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_mis_p_reverso_sno.php\",n,n,n,\"../tepuy_mis_p_reverso_sno.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,192,n);\r\nit=s1.addItemWithImages(6,7,7,\"Registrar Beneficiario\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_rpc_d_beneficiario.php\",n,n,n,\"../tepuy_rpc_d_beneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadopersonal.php\",n,n,n,\"../tepuy_snorh_r_listadopersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Contratado\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadopersonalcontratado.php\",n,n,n,\"../tepuy_snorh_r_listadopersonalcontratado.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_unidadadministrativa.php\",n,n,n,\"../tepuy_snorh_r_unidadadministrativa.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,40,n);\r\nit=s2.addItemWithImages(6,7,7,\"Ficha de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_fichapersonal.php\",n,n,n,\"../tepuy_snorh_r_fichapersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal al Seguro (HCM)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadoseguro.php\",n,n,n,\"../tepuy_snorh_r_listadoseguro.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,42,n);\r\nit=s2.addItemWithImages(6,7,7,\"Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_antiguedadpersonal.php\",n,n,n,\"../tepuy_snorh_r_antiguedadpersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,43,n);\r\nit=s2.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_vacaciones.php\",n,n,n,\"../tepuy_snorh_r_vacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,44,n);\r\nit=s2.addItemWithImages(6,7,7,\"Constancia de Trabajo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_constanciatrabajo.php\",n,n,n,\"../tepuy_snorh_r_constanciatrabajo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,45,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cumpleañeros\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadocumpleano.php\",n,n,n,\"../tepuy_snorh_r_listadocumpleano.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,46,n);\r\nit=s2.addItemWithImages(6,7,7,\"Familiares\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_familiar.php\",n,n,n,\"../tepuy_snorh_r_familiar.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,47,n);\r\nit=s2.addItemWithImages(6,7,7,\"Credenciales\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_credencialespersonal.php\",n,n,n,\"../tepuy_snorh_r_credencialespersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,48,n);\r\nit=s1.addItemWithImages(6,7,7,\"Instructivos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos (0406)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0406.php\",n,n,n,\"../tepuy_snorh_r_comparado0406.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos (0506)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0506.php\",n,n,n,\"../tepuy_snorh_r_comparado0506.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos Clasificados por Tipo de Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0711.php\",n,n,n,\"../tepuy_snorh_r_comparado0711.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Personal Jubilado, Pensionado y Asignación a Sobreviviente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0712.php\",n,n,n,\"../tepuy_snorh_r_comparado0712.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s1.addItemWithImages(6,7,7,\"Sane\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,4,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Ingreso (14-02)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_ingreso.php\",n,n,n,\"../tepuy_snorh_r_sane_ingreso.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,53,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Retiro (14-03)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_retiro.php\",n,n,n,\"../tepuy_snorh_r_sane_retiro.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,54,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Cambio de Salario (14-10)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_salario.php\",n,n,n,\"../tepuy_snorh_r_sane_salario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,55,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Reposos Médicos (14-10)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_reposos.php\",n,n,n,\"../tepuy_snorh_r_sane_reposos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,56,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Permisos No Remunerados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_permisos.php\",n,n,n,\"../tepuy_snorh_r_sane_permisos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,57,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Cambio de Centro Médico\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_centromedico.php\",n,n,n,\"../tepuy_snorh_r_sane_centromedico.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,58,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Modificación de Datos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_modificacion.php\",n,n,n,\"../tepuy_snorh_r_sane_modificacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,59,n);\r\nit=s1.addItemWithImages(6,7,7,\"Retenciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,33,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,5,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Retención (AR-C)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_arc.php\",n,n,n,\"../tepuy_snorh_r_retencion_arc.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,60,n);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Ingresos (AR-I)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_ari.php\",n,n,n,\"../tepuy_snorh_r_retencion_ari.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,61,n);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Retención (I.S.L.R.)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_islr.php\",n,n,n,\"../tepuy_snorh_r_retencion_islr.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,61,n);\r\nit=s1.addItemWithImages(6,7,7,\"Consolidados/Resumen\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_conceptos.php\",n,n,n,\"../tepuy_snorh_r_conceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Aportes Patronales\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_aportepatronal.php\",n,n,n,\"../tepuy_snorh_r_aportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadobanco.php\",n,n,n,\"../tepuy_snorh_r_listadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_recibopago.php\",n,n,n,\"../tepuy_snorh_r_recibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cesta Ticket\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_cestaticket.php\",n,n,n,\"../tepuy_snorh_r_cestaticket.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Depósitos al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_depositobanco.php\",n,n,n,\"../tepuy_snorh_r_depositobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pagos por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_pagosunidadadmin.php\",n,n,n,\"../tepuy_snorh_r_pagosunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,68,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestación de Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_prestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_prestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_cuadreprestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_cuadreprestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s2.addItemWithImages(6,7,7,\"Afectación Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_afectacionprestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_afectacionprestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,71,n);\r\nit=s1.addItemWithImages(6,7,7,\"I.V.S.S.\",n,n,\"\",9,n,n,1,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,36,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,8,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Constancia de Trabajo para el I.V.S.S. (14-100)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_constanciatrabajosegurosocial.php\",n,n,n,\"../tepuy_snorh_r_constanciatrabajosegurosocial.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,72,n);\r\nit=s1.addItemWithImages(6,7,7,\"Pensionados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Beneficiario del Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_personal_beneficiario.php\",n,n,n,\"../tepuy_snorh_r_personal_beneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pagos Autorizados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_personas_autorizadas.php\",n,n,n,\"../tepuy_snorh_r_personas_autorizadas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s2.addItemWithImages(6,7,7,\"Modos de Envío de Recibos de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_modos_enviosrec.php\",n,n,n,\"../tepuy_snorh_r_modos_enviosrec.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,75,n);\r\nit=s0.addItemWithImages(3,4,4,\"Configuración\",n,n,\"\",10,10,10,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Parámetros por Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_configuracion.php\",n,n,n,\"../tepuy_snorh_p_configuracion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s1.addItemWithImages(6,7,7,\"Fideicomiso\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_fideiconfigurable.php\",n,n,n,\"../tepuy_snorh_d_fideiconfigurable.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,3,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambio ID Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_personalcambioid.php\",n,n,n,\"../tepuy_snorh_p_personalcambioid.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,30,n);\r\nit=s1.addItemWithImages(6,7,7,\"Transferencia de Datos entre RAC\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_transferenciadatos.php\",n,n,n,\"../tepuy_snorh_p_transferenciadatos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,31,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",11,11,11,3,3,3,n,n,n,\"\",n,n,n,\"../../tepuy_menu.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function MENU_HEADER$static_(){ToolbarSkin.MENU_HEADER=( new ToolbarSkin(\"menu-header\"));}", "_updateHAXCEMenu() {\n this._ceMenu.ceButtons = [\n {\n icon: this.locked ? \"icons:lock\" : \"icons:lock-open\",\n callback: \"haxClickInlineLock\",\n label: \"Toggle Lock\",\n },\n {\n icon: this.published ? \"lrn:view\" : \"lrn:view-off\",\n callback: \"haxClickInlinePublished\",\n label: \"Toggle published\",\n },\n {\n icon: \"editor:format-indent-increase\",\n callback: \"haxIndentParent\",\n label: \"Move under parent page break\",\n disabled: !pageBreakManager.getParent(this, \"indent\"),\n },\n {\n icon: \"editor:format-indent-decrease\",\n callback: \"haxOutdentParent\",\n label: \"Move out of parent page break\",\n disabled: !pageBreakManager.getParent(this, \"outdent\"),\n },\n ];\n }", "function controlsMenu(g_ctx){\n main.GameState = 2;\n levelTransition.levelIndex = -1;\n}", "function gui() //graphical user interface\n{\n\tui_clear(); // clean up the User interface before drawing a new one.\n\tui_add_ch_selector( \"ch\", \"Channel to decode\", \"CAN\" );\n\tui_add_baud_selector( \"rate\", \"Bit rate\", 500000 );\n\tui_add_baud_selector( \"high_rate\", \"high bit rate:\", 2000000 );\n\tui_add_separator();\n\tui_add_info_label( \"<b>Hex view options:</b>\" );\n\tui_add_txt_combo( \"hex_opt\", \"Include in HEX view:\" );\n\t\tui_add_item_to_txt_combo( \"DATA fields only\", true );\n\t\tui_add_item_to_txt_combo( \"ID and DATA Fields\" );\n\t\tui_add_item_to_txt_combo( \"Everything\" );\n}", "function cdd_menu0(){//////////////////////////Start Menu Data/////////////////////////////////\n/**********************************************************************************************\n\n\tMenu 0 - General Settings and Menu Structure\n\n\t**See the menu_styles.css file for additional customization options**\n\n***********************************************************************************************/\n\n/*---------------------------------------------\nIcon Images\n---------------------------------------------*/\n\n//Define two types of unlimited icon images below, associate any image\n//with any item using both the 'icon_rel' and 'icon_abs' parameter in the\n//sub menu structure section (set to the index number of the icon image)\n\n\n //Relative positioned icon images (flow with main menu or sub item text)\n\n\tthis.rel_icon_image0 = \"menu/sample_images/bullet.gif\"\n\tthis.rel_icon_rollover0 = \"menu/sample_images/bullet_hl.gif\"\n\tthis.rel_icon_image_wh0 = \"13,8\"\n\t\n\n\n //Absolute positioned icon images (coordinate positioned - relative to \n //right top corner of the menu item displaying the icon.)\n\n\tthis.abs_icon_image0 = \"menu/sample_images/arrow.gif\"\n\tthis.abs_icon_rollover0 = \"menu/sample_images/arrow.gif\"\n\tthis.abs_icon_image_wh0 = \"13,10\"\n\tthis.abs_icon_image_xy0 = \"-15,4\"\n\n\n\n\n/*---------------------------------------------\nDivider Settings\n---------------------------------------------*/\n\n\n\tthis.use_divider_caps = false\t\t//cap the top and bottom of each menu group\n\tthis.divider_width = 3\t\t\t//space between entries on horizontal menus\n\tthis.divider_height = 0\t\t\t//border width between vertical submenu entries\n\n\n //available specific settings\n\n\tthis.use_divider_capsX = true\n\n\n\n/*---------------------------------------------\nMenu Orientation and Sizing\n---------------------------------------------*/\n\n\n\tthis.is_horizontal = false\t\t//false = vertical menus, true = horizontal menus\n\tthis.is_horizontal_main = true\n\n\t\n\tthis.menu_width = 200\t\t\t//applies to vertical menus\n\tthis.menu_width_items = 90\t\t//width of buttons in horizontal menu\n\t\n\t\n\n //available specific settings\n\t\n\n\tthis.is_horizontalX = true\n\t\n\tthis.menu_widthX = 200\n\n\tthis.menu_width_itemsX = 100\n\tthis.menu_width_itemX_X = 100\n\n\t\n\n\n/*---------------------------------------------\nOptional Style Sheet Class Name Association\n---------------------------------------------*/\n\n//Use the following section to optionally associate menu groups \n//and menu items with existing CSS classes from your site.\n\n\n\n //global class names\n\n\t//this.main_menu_class = \"myclassname\"\n\t//this.main_items_class = \"myclassname\"\n\t//this.main_items_rollover_class = \"myclassname\"\n\n\t//this.sub_menu_class = \"myclassname\"\n\t//this.sub_items_class = \"myclassname\"\n\t//this.sub_items_rollover_class = \"myclassname\"\n\n\n //specific menu items\n\n\t//this.item_classX_X = \"myclassname\"\n\t//this.item_rollover_classX_X = \"myclassname\"\n\n\n\n/*---------------------------------------------\nExposed Menu Events - Custom Script Attachment\n---------------------------------------------*/\n\n\n\tthis.show_menu = \"\";\n\tthis.hide_menu = \"\";\n\n\n //available specific settings\n\n\n\t//this.show_menuX = \"alert('show id')\";\n\t//this.hide_menuX = \"alert('hide id')\";\n\n\n\n/*------------------------------------------------\nMenu Width & Height Adjustments for DOM Browsers\n-------------------------------------------------*/\n\n /*Note: The following settings are optional and are made available\n for tweaking the menu to perfection on all browsers and platforms.\n The menu will function without error regardless of the settings below.\n\n Opera and other DOM browsers take different approaches\n to how they calculate widths and heights of items which have\n CSS padding and borders defined. With the settings below\n re-define the total left-right and top-bottom combined border \n and padding values. These values are used by DOM browsers\n (ns7, opera, Mozilla, etc.) to correct the menu dimensions.*/\n\n\n\n //Menu Width & Height Adjustments (padding + borders)\n\n\tthis.pb_width_main_menu = 12;\t\n\tthis.pb_width_sub_menus = 16;\n\n\tthis.pb_height_main_menu = 12;\n\tthis.pb_height_sub_menus = 16;\n\n\t\n\tthis.pb_width_menuX = 0;\n\tthis.pb_height_menuX = 0;\n\tthis.pb_width_main_itemsX = 0;\n\tthis.pb_width_sub_itemsX = 0;\n\n\n\n //Item Width Adjustments (padding + borders)\n\n\tthis.pb_width_main_items = 12;\n\tthis.pb_width_sub_items = 12;\n\n\n\n //Opera 5 & 6 - alternate HTML display (Opera 7 displays menu 100%)\n\n\tthis.opera_old_display_html = \"Please update your opera browser.\";\n\n\n\n/*---------------------------------------------\nMain Menu Group and Items\n---------------------------------------------*/\n\n\n //Main Menu Group 0\n\n\t\n\tthis.item0 = \"HISTORY\"\n\t//this.url0 = \"myurl.html\"\t\n\n\tthis.item1 = \"ISSUES\"\n\t//this.url1 = \"myurl.html\"\t\n\t\n\tthis.item2 = \"CREATORS\"\n\t//this.url2 = \"myurl.html\"\t\n\t\n\tthis.item3 = \"FANS\"\n\t//this.url3 = \"myurl.html\"\t\n\t\n\tthis.item4 = \"MERCH\"\n\t//this.url4 = \"myurl.html\"\t\n\t\n\tthis.item5 = \"MEDIA\"\n\t//this.url5 = \"myurl.html\"\t\n\t\n\tthis.item6 = \"ART\"\n\t//this.url6 = \"myurl.html\"\t\n\t\n\tthis.item7 = \"FUN/GAMES\"\n\t//this.url7 = \"myurl.html\"\t\n\t\n\n/*---------------------------------------------\nSub Menu Group and Items\n---------------------------------------------*/\n\n //Sub Menu 0\n\n\tthis.menu_xy0 = \"-82,17\"\n\tthis.menu_width0 = 150\n\n\tthis.item0_0 = \"DD's Origin & Powers\"\n\tthis.item0_1 = \"Daredevil's Costume\"\n this.item0_2 = \"Cast Bios\"\n\tthis.item0_3 = \"Plot Summary\"\n\tthis.item0_4 = \"Nelson & Murdock\"\n\tthis.item0_5 = \"Issue Chronology\"\n\tthis.item0_6 = \"Guest Checklist\"\n\tthis.item0_7 = \"First Meetings\"\n\tthis.item0_8 = \"DD & Spidey\"\n\tthis.item0_9 = \"Other Daredevils\"\n\tthis.item0_10 = \"Women of DD\"\n this.item0_11 = \"Sales\"\n\n\tthis.icon_abs0_4 = 0\n\tthis.icon_abs0_8 = 0\n\n\tthis.url0_0 = 'origin.htm'\n\tthis.url0_1 = 'costume.htm'\n\tthis.url0_2 = 'cast.htm'\n\tthis.url0_3 = 'plot.htm'\n\tthis.url0_4 = ''\n\tthis.url0_5 = 'chrono.htm'\n\tthis.url0_6 = 'guests.htm'\n\tthis.url0_7 = 'firstmeetings.htm'\n\tthis.url0_8 = ''\n\tthis.url0_9 = 'otherdds.htm'\n\tthis.url0_10= 'women.htm'\n\tthis.url0_11= 'spideysales.htm'\n\n //Sub Menu 0_4\n\n\tthis.menu_xy0_4 = \"-4,2\"\n\tthis.menu_width0_4 = 150\n\n\tthis.item0_4_0 = \"The Law Offices of...\"\n\tthis.item0_4_1 = \"Famous Clients\"\n\tthis.item0_4_2 = \"Nelson vs. Murdock\"\n\tthis.item0_4_3 = \"Legal Terms/Definitions\"\n\n\tthis.url0_4_0 = 'legalcareer.htm'\n\tthis.url0_4_1 = 'legalclients.htm'\n\tthis.url0_4_2 = 'legalversus.htm'\n\tthis.url0_4_3 = 'legalterms.htm'\n\n\n //Sub Menu 0_8\n\n\tthis.menu_xy0_8 = \"-4,2\"\n\tthis.menu_width0_8 = 150\n\n\tthis.item0_8_0 = \"Comparison\"\n\tthis.item0_8_1 = \"Significant Events\"\n\tthis.item0_8_2 = \"Appearances Together\"\n\tthis.item0_8_3 = \"Spider-Man vs. DD\"\n\tthis.item0_8_4 = \"Saving Each Other\"\n this.item0_8_5 = \"Sales\"\n\n\tthis.url0_8_0 = 'spideycompare.htm'\n\tthis.url0_8_1 = 'spideyevents.htm'\n\tthis.url0_8_2 = 'spideyappear.htm'\n\tthis.url0_8_3 = 'spideyvsdd.htm'\n\tthis.url0_8_4 = 'spideysaves.htm'\n\tthis.url0_8_5 = 'spideysales.htm'\n\n //Sub Menu 1\n\t\n\tthis.menu_xy1 = \"-82,17\"\n\tthis.menu_width1 = 150\n \n\tthis.item1_0 = \"Recommended Reading\"\n\tthis.item1_1 = \"Volume 1\"\n\tthis.item1_2 = \"Volume 2\"\n\tthis.item1_3 = \"Annuals\"\n\tthis.item1_4 = \"Specials/Mini-Series\"\t\n\tthis.item1_5 = \"Graphic Novels\"\n\tthis.item1_6 = \"Cross-Appearances\"\n\tthis.item1_7 = \"International Issues\"\n\tthis.item1_8 = \"Trade Paperbacks\"\n\tthis.item1_9 = \"Hardcovers\"\n\tthis.item1_10= \"Reprints\"\t\n\tthis.item1_11= \"Cybercomics\"\n\n\tthis.icon_abs1_6 = 0\n\tthis.icon_abs1_7 = 0\n\n\tthis.url1_0 = 'recommended.htm'\n\tthis.url1_1 = 'volume1.htm'\n\tthis.url1_2 = 'volume2.htm'\n\tthis.url1_3 = 'annuals.htm'\n\tthis.url1_4 = 'specials.htm'\n\tthis.url1_5 = 'graphic.htm'\n\tthis.url1_6 = ''\n\tthis.url1_7 = ''\n\tthis.url1_8 = 'tpbs.htm'\n\tthis.url1_9 = 'hardcovers.htm'\n\tthis.url1_10= 'reprints.htm'\n\tthis.url1_11= 'online.htm'\n\n //Sub Menu 1_6\n\n\tthis.menu_xy1_6 = \"-4,2\"\n\tthis.menu_width1_6 = 150\n\n\tthis.item1_6_0 = \"Appearance Checklist\"\n\tthis.item1_6_1 = \"Major Appearances\"\n\tthis.item1_6_2 = \"Minor Appearances\"\n\tthis.item1_6_3 = \"Cameo/Bit Appearances\"\n\tthis.item1_6_4 = \"Non-Appearances\"\n\tthis.item1_6_5 = \"Alternate Appearances\"\n\tthis.item1_6_6 = \"Honorable Mentions\"\n\tthis.item1_6_7 = \"Parodies/Spoofs\"\n\tthis.item1_6_8 = \"Pinups\"\n\n\tthis.url1_6_0 = 'appear.htm'\n\tthis.url1_6_1 = 'appmaj.htm'\n\tthis.url1_6_2 = 'appmin.htm'\n\tthis.url1_6_3 = 'appbit.htm'\n\tthis.url1_6_4 = 'appnon.htm'\n\tthis.url1_6_5 = 'appalt.htm'\n\tthis.url1_6_6 = 'mentions.htm'\n\tthis.url1_6_7 = 'parodies.htm'\n\tthis.url1_6_8 = 'artpinup.htm'\n\n //Sub Menu 1_7\n\n\tthis.menu_xy1_7 = \"-4,2\"\n\tthis.menu_width1_7 = 150\n\n\tthis.item1_7_0 = \"Brazil (Brasil)\"\n\tthis.item1_7_1 = \"Finland (Suomi)\"\n\tthis.item1_7_2 = \"France\"\n\tthis.item1_7_3 = \"Germany (Deutschland)\"\n\tthis.item1_7_4 = \"Italy (Italia)\"\n\tthis.item1_7_5 = \"Norway (Nörge)\"\n\tthis.item1_7_6 = \"Spain (Espańa)\"\n\tthis.item1_7_7 = \"Sweden (Sverige)\"\n\tthis.item1_7_8 = \"United Kingdom\"\n\tthis.item1_7_9 = \"Uruguay\"\n\n\tthis.url1_7_0 = 'intl_bra.htm'\n\tthis.url1_7_1 = 'intl_fin.htm'\n\tthis.url1_7_2 = 'intl_fra.htm'\n\tthis.url1_7_3 = 'intl_ger.htm'\n\tthis.url1_7_4 = 'intl_ita.htm'\n\tthis.url1_7_5 = 'intl_nor.htm'\n\tthis.url1_7_6 = 'intl_esp.htm'\n\tthis.url1_7_7 = 'intl_swe.htm'\n\tthis.url1_7_8 = 'intl_uk.htm'\n\tthis.url1_7_9 = 'intl_uru.htm'\n\n\n\n //Sub Menu 2\n\n\tthis.menu_xy2 = \"-82,17\"\n\tthis.menu_width2 = 125\n\t\n\tthis.item2_0 = \"Creator Checklist\"\n\tthis.item2_1 = \"Interviews\"\n\tthis.item2_2 = \"Creator Bios\"\n\tthis.item2_3 = \"Guestbook Entries\"\n\n\tthis.url2_0 = 'creators.htm'\n\tthis.url2_1 = 'interviews.htm'\n\tthis.url2_2 = 'creabios.htm'\n\tthis.url2_3 = 'halloffame.htm'\n\n\n\n //Sub Menu 3\n\n\tthis.menu_xy3 = \"-82,17\"\n\tthis.menu_width3 = 150\n\t\n\tthis.item3_0 = \"Fan Art\"\n\tthis.item3_1 = \"Fan Fiction\"\n\tthis.item3_2 = \"Custom Figures\"\n\tthis.item3_3 = \"Body Art (Tattoos)\"\n\tthis.item3_4 = \"Custom Trading Cards\"\n\tthis.item3_5 = \"Published Fan Letters\"\n\tthis.item3_6 = \"Fan Parodies\"\n\tthis.item3_7 = \"Misc. Fan Creations\"\n\tthis.item3_8 = \"Guestbook\"\n\n\tthis.url3_0 = 'artfan.htm'\n\tthis.url3_1 = 'fanfiction.htm'\n\tthis.url3_2 = 'fanfigs.htm'\n\tthis.url3_3 = 'artbody.htm'\n\tthis.url3_4 = 'fancards.htm'\n\tthis.url3_5 = 'fanletters.htm'\n\tthis.url3_6 = 'fanparodies.htm'\n\tthis.url3_7 = 'fanmisc.htm'\n\tthis.url3_8 = 'http://books.dreambook.com/kevinqhall/ddbook.html'\n\n\n\n //Sub Menu 4\n\n\tthis.menu_xy4 = \"-82,17\"\n\tthis.menu_width4 = 180\n\n\tthis.item4_0 = \"For Sale or Trade\"\n\tthis.item4_1 = \"Cards, Stickers, & Pogs\"\n\tthis.item4_2 = \"Toys, Games, & Puzzles\"\n\tthis.item4_3 = \"Action Figures\"\n\tthis.item4_4 = \"Diecast Vehicles\"\n\tthis.item4_5 = \"Pins & Patches\"\n\tthis.item4_6 = \"Stamps & Coins\"\n\tthis.item4_7 = \"Food & Candy\"\n\tthis.item4_8 = \"Clothes & Apparel\"\n\tthis.item4_9 = \"T-Shirts\"\n\tthis.item4_10= \"Costumes\"\n\tthis.item4_11= \"Calendars\"\n\tthis.item4_12= \"Household Items\"\n\tthis.item4_13= \"Stationery\"\n\tthis.item4_14= \"Wall Hangings/Window Clings\"\n\n\tthis.icon_abs4_1 = 0\n\n\tthis.url4_0 = 'mercwant.htm'\n\tthis.url4_1 = 'merccard.htm'\n\tthis.url4_2 = 'merctoys.htm'\n\tthis.url4_3 = 'mercfigs.htm'\n\tthis.url4_4 = 'diecast.htm'\n\tthis.url4_5 = 'mercpins.htm'\n\tthis.url4_6 = 'stamps.htm'\n\tthis.url4_7 = 'mercfood.htm'\n\tthis.url4_8 = 'mercclth.htm'\n\tthis.url4_9 = 'merctees.htm'\n\tthis.url4_10= 'merccost.htm'\n\tthis.url4_11= 'merccal.htm'\n\tthis.url4_12= 'merchous.htm'\n\tthis.url4_13= 'mercstat.htm'\n\tthis.url4_14= 'mercwall.htm'\n\t\n //Sub Menu 4_1\n\n\tthis.menu_xy4_1 = \"-4,2\"\n\tthis.menu_width4_1 = 160\n\n\tthis.item4_1_0 = \"Custom Trading Cards\"\n\tthis.item4_1_1 = \"Trading Cards: 1960s\"\n\tthis.item4_1_2 = \"Trading Cards: 1970s\"\n\tthis.item4_1_3 = \"Trading Cards: 1980s\"\n\tthis.item4_1_4 = \"Trading Cards: 1990-1992\"\n\tthis.item4_1_5 = \"Trading Cards: 1993-1995\"\n\tthis.item4_1_6 = \"Trading Cards: 1996-2000\"\n\tthis.item4_1_7 = \"Trading Cards: 2001-2003\"\n\tthis.item4_1_8 = \"Trading Cards: DD Movie\"\n\tthis.item4_1_9 = \"Phone Cards\"\n\tthis.item4_1_10= \"Promotional Cards\"\n\tthis.item4_1_11= \"Collectible Card Games\"\n\tthis.item4_1_12= \"Stickers\"\n\tthis.item4_1_13= \"Pogs\"\n\n\tthis.url4_1_0 = 'fancards.htm'\n\tthis.url4_1_1 = 'cards60s.htm'\n\tthis.url4_1_2 = 'cards70s.htm'\n\tthis.url4_1_3 = 'cards80s.htm'\n\tthis.url4_1_4 = 'cards90-92.htm'\n\tthis.url4_1_5 = 'cards93-95.htm'\n\tthis.url4_1_6 = 'cards96-00.htm'\n\tthis.url4_1_7 = 'cards01-03.htm'\n\tthis.url4_1_8 = 'cardsdd.htm'\n\tthis.url4_1_9 = 'cardsphone.htm'\n\tthis.url4_1_10= 'cardspromo.htm'\n\tthis.url4_1_11= 'cardsccg.htm'\n\tthis.url4_1_12= 'stickers.htm'\n\tthis.url4_1_13= 'pogs.htm'\n\n\n\n\n //Sub Menu 5\n\n\tthis.menu_xy5 = \"-82,17\"\n\tthis.menu_width5 = 165\n\n\tthis.item5_0 = \"Books\"\n\tthis.item5_1 = \"Movies\"\n\tthis.item5_2 = \"Television\"\n\tthis.item5_3 = \"Video Games/CyberComics\"\n\tthis.item5_4 = \"Fanzines\"\n\tthis.item5_5 = \"Feature Articles\"\n\tthis.item5_6 = \"Sightings\"\n\tthis.item5_7 = \"Music\"\n\tthis.item5_8 = \"Braille\"\n\tthis.item5_9 = \"Newspaper\"\n\n\tthis.icon_abs5_0 = 0\n\n\tthis.url5_0 = ''\n\tthis.url5_1 = 'movies.htm'\n\tthis.url5_2 = 'tv.htm'\n\tthis.url5_3 = 'online.htm'\n\tthis.url5_4 = 'fanzines.htm'\n\tthis.url5_5 = 'articles.htm'\n\tthis.url5_6 = 'sightings.htm'\n\tthis.url5_7 = 'music.htm'\n\tthis.url5_8 = 'braille.htm'\n\tthis.url5_9 = 'newspaper.htm'\n\n //Sub Menu 5_0\n\n\tthis.menu_xy5_0 = \"-4,2\"\n\tthis.menu_width5_0 = 145\n\n\tthis.item5_0_0 = \"Pocketbooks/Fiction\"\n\tthis.item5_0_1 = \"Graphic Novels\"\n\tthis.item5_0_2 = \"Trade Paperbacks\"\n\tthis.item5_0_3 = \"Hardcovers\"\n\tthis.item5_0_4 = \"Miscellaneous Books\"\n\tthis.item5_0_5 = \"Activity/Coloring Books\"\n\n\tthis.url5_0_0 = 'fiction.htm'\n\tthis.url5_0_1 = 'graphic.htm'\n\tthis.url5_0_2 = 'tpbs.htm'\n\tthis.url5_0_3 = 'hardcovers.htm'\n\tthis.url5_0_4 = 'miscbooks.htm'\n\tthis.url5_0_5 = 'coloring.htm'\n\n\n //Sub Menu 6\n\n\tthis.menu_xy6 = \"-82,17\"\n\tthis.menu_width6 = 150\n\n\tthis.item6_0 = \"Fan Art\"\n\tthis.item6_1 = \"Statues & Figures\"\n\tthis.item6_2 = \"Portfolios, Prints, & Lithographs\"\n\tthis.item6_3 = \"Posters\"\n\tthis.item6_4 = \"Sketchagraph Gallery\"\n\tthis.item6_5 = \"Splash Pages\"\n\tthis.item6_6 = \"Sketches/Drawings\"\n\tthis.item6_7 = \"Pinups\"\n\tthis.item6_8 = \"Authentix Cover Gallery\"\n\tthis.item6_9 = \"Body Art (Tattoos)\"\n\tthis.item6_10= \"Preview Art\"\n\tthis.item6_11= \"Licensed Images\"\n\n\tthis.url6_0 = 'artfan.htm'\n\tthis.url6_1 = 'artsculp.htm'\n\tthis.url6_2 = 'artpro.htm'\n\tthis.url6_3 = 'artpost.htm'\n\tthis.url6_4 = 'artsgrph.htm'\n\tthis.url6_5 = 'artsplsh.htm'\n\tthis.url6_6 = 'artsktch.htm'\n\tthis.url6_7 = 'artpinup.htm'\n\tthis.url6_8 = 'artauth.htm'\n\tthis.url6_9 = 'artbody.htm'\n\tthis.url6_10= 'artpreview.htm'\n\tthis.url6_11= 'artlic.htm'\n\n //Sub Menu 7\n\n\tthis.menu_xy7 = \"-142,17\"\n\tthis.menu_width7 = 160\n\n\tthis.item7_0 = \"Top Ten...\"\n\tthis.item7_1 = \"Quotes\"\n\tthis.item7_2 = \"Lawyer Jokes\"\n\tthis.item7_3 = \"Bloopers\"\n\tthis.item7_4 = \"Parodies/Spoofs\"\n\tthis.item7_5 = \"Trivia\"\n\tthis.item7_6 = \"Online Puzzles/Games\"\n\tthis.item7_7 = \"Printable Puzzles\"\n\n\tthis.icon_abs7_0 = 0\n\tthis.icon_abs7_6 = 0\n\tthis.icon_abs7_7 = 0\n\n\tthis.url7_0 = ''\n\tthis.url7_1 = 'quotes.htm'\n\tthis.url7_2 = 'shyster.htm'\n\tthis.url7_3 = 'bloopers.htm'\n\tthis.url7_4 = 'parodies.htm'\n\tthis.url7_5 = 'trivia.htm'\n\tthis.url7_6 = 'puzzles.htm'\n\tthis.url7_7 = ''\n\n //Sub Menu 7_0\n\n\tthis.menu_xy7_0 = \"-269,3\"\n\tthis.menu_width7_0 = 150\n\n\tthis.item7_0_0 = \"Ways to Defeat Stiltman\"\n\tthis.item7_0_1 = \"Favorite DD Stories\"\n\tthis.item7_0_2 = \"Toughest Foes\"\n\tthis.item7_0_3 = \"Favorite DD Story Arcs\"\n\tthis.item7_0_4 = \"Favorite DD Villains\"\n\tthis.item7_0_5 = \"Fav. DD Supporting Cast\"\n\tthis.item7_0_6 = \"Favorite DD Team-Ups\"\n\tthis.item7_0_7 = \"Underrated DD Creators\"\n\tthis.item7_0_8 = \"Aerial Moves\"\n\n\tthis.url7_0_0 = 'ttstilts.htm'\n\tthis.url7_0_1 = 'ttissues.htm'\n\tthis.url7_0_2 = 'tttough.htm'\n\tthis.url7_0_3 = 'ttarcs.htm'\n\tthis.url7_0_4 = 'ttbadguy.htm'\n\tthis.url7_0_5 = 'ttsuppor.htm'\n\tthis.url7_0_6 = 'ttteamup.htm'\n\tthis.url7_0_7 = 'ttunder.htm'\n\tthis.url7_0_8 = 'ttdaringmoves.htm'\n\n //Sub Menu 7_6\n\n\tthis.menu_xy7_6 = \"-299,3\"\n\tthis.menu_width7_6 = 180\n\n\tthis.item7_6_0 = \"Concentration: DD Covers\"\n\tthis.item7_6_1 = \"Concentration: Sketchagraphs\"\n\tthis.item7_6_2 = \"Word Search: DD Villains\"\n\tthis.item7_6_3 = \"Word Search: Women of DD\"\n\tthis.item7_6_4 = \"Word Search: DD Creators\"\n\n\tthis.url7_6_0 = 'puzconcentration1.htm'\n\tthis.url7_6_1 = 'puzconcentration2.htm'\n\tthis.url7_6_2 = 'puzsrch1online.htm'\n\tthis.url7_6_3 = 'puzsrch2online.htm'\n\tthis.url7_6_4 = 'puzsrch3online.htm'\n\n //Sub Menu 7_7\n\n\tthis.menu_xy7_7 = \"-299,3\"\n\tthis.menu_width7_7 = 180\n\n\tthis.item7_7_0 = \"Matching: Marvel Nemeses\"\n\tthis.item7_7_1 = \"Matching: Marvel Couples\"\n\tthis.item7_7_2 = \"Matching: Weapons of Choice\"\n\tthis.item7_7_3 = \"Word Search: DD Villains\"\n\tthis.item7_7_4 = \"Word Search: Women of DD\"\n\tthis.item7_7_5 = \"Word Search: DD Creators\"\n\n\tthis.url7_7_0 = 'puzmtch1.htm'\n\tthis.url7_7_1 = 'puzmtch2.htm'\n\tthis.url7_7_2 = 'puzmtch3.htm'\n\tthis.url7_7_3 = 'puzsrch1.htm'\n\tthis.url7_7_4 = 'puzsrch2.htm'\n\tthis.url7_7_5 = 'puzsrch3.htm'\n\n\n\n}///////////////////////// END Menu Data /////////////////////////////////////////", "function ApplyToolbarHandlers(){\n var buttons = document.getElementsByClassName(\"toolbar-button\");\n //Megaplay\n buttons[0].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"PlayActiveClipFromHTML\");\n });\n //Play/pause\n buttons[1].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"TogglePause\");\n });\n //Reset active curve\n buttons[2].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"ResetActiveCurve\");\n });\n //Reset active clip\n buttons[3].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"ResetActiveClip\");\n });\n}", "function initmenu(levels,height,width,delay,type)\r\n{\r\nif (populatemenuitems==\"true\")\r\n{\r\nfor (i=0;i<=levels-1;i++)\r\n{\r\nMENU_ITEMS[i] = ITEMS[i+1];\r\n}\r\n}\r\n\r\n//setting the height\r\nglobheight=height;\r\ngloblevel=levels;\r\nglobwidth=width;\r\nglobdelay=delay;\r\n\r\nif (populatemenuitems==\"false\")\r\n{\r\n if (type==\"horizontal\")\r\n {\r\n //Defaults for horizontal\r\n MENU_POS['block_left'] = [0, 0];\r\n MENU_POS['top'] = [0];\r\n MENU_POS['left'] = [globwidth];\r\n globtype=\"horizontal\";\r\n }\r\n else\r\n { \r\n //Defaults for vertical\r\n MENU_POS['block_left'] = [0, globwidth];\r\n MENU_POS['top'] = [0, 0];\r\n MENU_POS['left'] = [0, 0];\r\n globtype=\"vertical\";\r\n }\r\n}\r\n}", "function showBarMenu() {\n E.showMenu({\n '': {\n 'title': 'Bar',\n 'back': showMainMenu\n },\n 'Enable while locked': {\n value: config.bar.enabledLocked,\n onchange: value => {\n config.bar.enableLocked = value;\n saveSettings();\n }\n },\n 'Enable while unlocked': {\n value: config.bar.enabledUnlocked,\n onchange: value => {\n config.bar.enabledUnlocked = value;\n saveSettings();\n }\n },\n 'Mode': {\n value: BAR_MODE_OPTIONS.map(item => item.val).indexOf(config.bar.type),\n format: value => BAR_MODE_OPTIONS[value].name,\n onchange: value => {\n config.bar.type = BAR_MODE_OPTIONS[value].val;\n saveSettings();\n },\n min: 0,\n max: BAR_MODE_OPTIONS.length - 1,\n wrap: true\n },\n 'Day progress': () => {\n E.showMenu({\n '': {\n 'title': 'Day progress',\n 'back': showBarMenu\n },\n 'Color': {\n value: COLOR_OPTIONS.map(item => colorString(item.val)).indexOf(colorString(config.bar.dayProgress.color)),\n format: value => COLOR_OPTIONS[value].name,\n min: 0,\n max: COLOR_OPTIONS.length - 1,\n wrap: false,\n onchange: value => {\n config.bar.dayProgress.color = COLOR_OPTIONS[value].val;\n saveSettings();\n }\n },\n 'Start hour': {\n value: Math.floor(config.bar.dayProgress.start / 100),\n format: hourToString,\n min: 0,\n max: 23,\n wrap: true,\n onchange: hour => {\n minute = config.bar.dayProgress.start % 100;\n config.bar.dayProgress.start = (100 * hour) + minute;\n saveSettings();\n }\n },\n 'Start minute': {\n value: config.bar.dayProgress.start % 100,\n min: 0,\n max: 59,\n wrap: true,\n onchange: minute => {\n hour = Math.floor(config.bar.dayProgress.start / 100);\n config.bar.dayProgress.start = (100 * hour) + minute;\n saveSettings();\n }\n },\n 'End hour': {\n value: Math.floor(config.bar.dayProgress.end / 100),\n format: hourToString,\n min: 0,\n max: 23,\n wrap: true,\n onchange: hour => {\n minute = config.bar.dayProgress.end % 100;\n config.bar.dayProgress.end = (100 * hour) + minute;\n saveSettings();\n }\n },\n 'End minute': {\n value: config.bar.dayProgress.end % 100,\n min: 0,\n max: 59,\n wrap: true,\n onchange: minute => {\n hour = Math.floor(config.bar.dayProgress.end / 100);\n config.bar.dayProgress.end = (100 * hour) + minute;\n saveSettings();\n }\n },\n 'Reset hour': {\n value: Math.floor(config.bar.dayProgress.reset / 100),\n format: hourToString,\n min: 0,\n max: 23,\n wrap: true,\n onchange: hour => {\n minute = config.bar.dayProgress.reset % 100;\n config.bar.dayProgress.reset = (100 * hour) + minute;\n saveSettings();\n }\n },\n 'Reset minute': {\n value: config.bar.dayProgress.reset % 100,\n min: 0,\n max: 59,\n wrap: true,\n onchange: minute => {\n hour = Math.floor(config.bar.dayProgress.reset / 100);\n config.bar.dayProgress.reset = (100 * hour) + minute;\n saveSettings();\n }\n }\n });\n },\n 'Calendar bar': () => {\n E.showMenu({\n '': {\n 'title': 'Calendar bar',\n 'back': showBarMenu\n },\n 'Look ahead duration': {\n value: config.bar.calendar.duration,\n format: value => {\n let hours = value / 3600;\n let minutes = (value % 3600) / 60;\n let seconds = value % 60;\n\n let result = (hours == 0) ? '' : `${hours} hr`;\n if (minutes != 0) {\n if (result == '') result = `${minutes} min`;\n else result += `, ${minutes} min`;\n }\n if (seconds != 0) {\n if (result == '') result = `${seconds} sec`;\n else result += `, ${seconds} sec`;\n }\n return result;\n },\n onchange: value => {\n config.bar.calendar.duration = value;\n saveSettings();\n },\n min: 900,\n max: 86400,\n step: 900\n },\n 'Pipe color': {\n value: COLOR_OPTIONS.map(color => colorString(color.val)).indexOf(colorString(config.bar.calendar.pipeColor)),\n format: value => COLOR_OPTIONS[value].name,\n onchange: value => {\n config.bar.calendar.pipeColor = COLOR_OPTIONS[value].val;\n saveSettings();\n },\n min: 0,\n max: COLOR_OPTIONS.length - 1,\n wrap: true\n },\n 'Default color': {\n value: COLOR_OPTIONS.map(color => colorString(color.val)).indexOf(colorString(config.bar.calendar.defaultColor)),\n format: value => COLOR_OPTIONS[value].name,\n onchange: value => {\n config.bar.calendar.defaultColor = COLOR_OPTIONS[value].val;\n saveSettings();\n },\n min: 0,\n max: COLOR_OPTIONS.length - 1,\n wrap: true\n }\n });\n }\n });\n }", "function scene::BuildMenu(folder)\r\n{\r\n local idx = 0;\r\n local fb = FileBrowser();\r\n local files = fb.BroseDir(folder,\"*.gbt,*.ml\");\r\n local uiman = system.GetUIMan();\r\n local scrsz = SIZE();\r\n local xpos = 2;\r\n local menuYpos = uiman.GetScreenGridY(0)-16; // font index(0-3)\r\n local slot = 0;\r\n \r\n\tmaps.resize(0);\r\n menubar.resize(0);\r\n \r\n if(files)\r\n {\r\n maps.resize(files);\r\n menubar.resize(files+4); // for top and remote\r\n }\r\n \r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(0, xpos, menuYpos, xpos+70, menuYpos + 7);\r\n menubar[slot].SetFont(3);\r\n menubar[slot].SetText(\"Curent Folder: \" + folder, 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCCCC, 0xCCCCCC);\r\n slot++;\r\n menuYpos -= 4;\r\n\r\n// makes button for remote downloading\r\n menuYpos-=3;\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(100, xpos, menuYpos, xpos+40, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Remote Levels\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n \r\n // makes button for getting back to bspmaps\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(101, xpos+40, menuYpos, xpos+80, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Local levels\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n // makes button for getting back to bspmaps\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(102, xpos+80, menuYpos, xpos+120, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Master Server\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n menuYpos -= 4;\r\n\r\n \r\n for( idx=0; idx < files; idx+=1)\r\n {\r\n local lf = fb.GetAt(idx);\r\n if(lf == \"\") break;\r\n\r\n maps[idx] = folder+lf;\r\n\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(idx, xpos+(idx), menuYpos, xpos+(idx)+40, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(lf, 0);\r\n menubar[slot].SetImage(\"freebut.bmp\");\r\n menubar[slot].SetColor(0xCCCC44, 0xCCCCCC);\r\n\r\n menuYpos-=3;\r\n slot++;\r\n }\r\n}", "function showMenu(){\n // shows panel for piano\n rectMode(CENTER);\n fill(0, 100, 255);\n rect(width/2, height/2 - 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Piano', width/2, height/2 - 100);\n \n // shows panel for guitar\n rectMode(CENTER);\n fill(0, 240 , 250);\n rect(width/2, height/2 + 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Guitar', width/2, height/2 + 100);\n}", "helpMenu() {\n this.room2_help_menu.alpha = 1.0;\n this.room2_helpOpen = true;\n }", "registerAppCallback(menu, name, character, function_name){\n menu.submenu.push(\n {\n label:name,\n accelerator: process.platform == 'darwin' ? 'Command+'+character : 'Ctrl+'+character,\n app_dot:function_name\n }\n );\n }", "function install_menu() {\n var config = {\n name: 'lesson_lock',\n submenu: 'Settings',\n title: 'Lesson Lock',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function menu(){\n background(img,0);\n //retangulo para selecionar a tela\n fill(255, 204, 0)\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n fill(233,495,67);\n textSize(26);\n text('JOGAR ', 250, 100)\n //detalhes do texto abaixo\n fill(233,495,67);\n textSize(26);\n text('INSTRUÇÕES', 230, 200);\n text('CREDITOS', 230, 300);\n }", "volumeBarInit() {}", "function setApplicationMenu() {\n const template = [\n {\n label: 'Application',\n submenu: [\n {label: 'About Application', selector: 'orderFrontStandardAboutPanel:'},\n {type: 'separator'},\n {\n label: 'Quit',\n accelerator: 'Command+Q',\n click() {\n app.quit();\n }\n }\n ]\n },\n {\n label: 'Edit',\n submenu: [\n {label: 'Undo', accelerator: 'CmdOrCtrl+Z', selector: 'undo:'},\n {label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', selector: 'redo:'},\n {type: 'separator'},\n {label: 'Cut', accelerator: 'CmdOrCtrl+X', selector: 'cut:'},\n {label: 'Copy', accelerator: 'CmdOrCtrl+C', selector: 'copy:'},\n {label: 'Paste', accelerator: 'CmdOrCtrl+V', selector: 'paste:'},\n {label: 'Select All', accelerator: 'CmdOrCtrl+A', selector: 'selectAll:'}\n ]\n }\n ];\n\n Menu.setApplicationMenu(Menu.buildFromTemplate(template));\n}", "static addMenuOption(menuX, menuY, textContent, goto, context) {\n let textObj = context.add.text(menuX, menuY + 60 * context.menuSize,\n textContent, {fontSize: '32px', fill: '#fff'});\n context.menuSize++;\n textObj.setOrigin(0.5);\n textObj.setInteractive();\n textObj.on('pointerdown', function(pointer) {\n if (!context.lockControl) {\n context.lockControl = true;\n textObj.setColor('#737373');\n context.time.delayedCall(150, function (game) {\n game.scene.start(goto);\n }, [context], context);\n }\n }, context);\n textObj.on('pointerover', function(pointer) {\n if (!context.lockControl) {\n textObj.setColor('#C0C0C0');\n }\n }, context);\n textObj.on('pointerout', function(pointer) {\n if (!context.lockControl) {\n textObj.setColor('#fff');\n }\n }, context);\n }", "function OnClicked(param: String)\r\t{\r\t\tif (!ShowMenu(param, true))\r\t\t{\r\t\t\tgameObject.SendMessage(param, SendMessageOptions.DontRequireReceiver);\r\t\t\tShowMenu(\"\", false);\r\t\t\tActivateMenu(false);\r\t\t}\r\t}", "registerWindowCallback(menu, name, character, function_name){\n menu.submenu.push(\n {\n label:name,\n accelerator: process.platform == 'darwin' ? 'Command+'+character : 'Ctrl+'+character,\n mainWindow_dot:function_name\n }\n );\n }", "function showSensorTypeSettings() {\n setElementDisplay([sensorTypeSettingMenu], \"block\");\n}", "setupUI () {\n\t\t// Score Keeper\n\t\tthis.score = this.add.text(1150, 10, 'Score: 0', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFFFFF'\n\t\t});\n\n\t\tthis.score.alpha = 0;\n\n\t\t// Castle Health\n\t\tthis.hpBarTxt = this.add.text(395, 50, 'Health: 100', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.hpBarTxt.alpha = 0;\n\n\t\t// Health bar\n\t\tthis.healthBar = this.add.graphics();\n\t\tthis.healthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.healthBar.fillRect(395, 10, 490, 20);\n\t\tthis.healthBar.alpha = 0;\n\n\t\t// Health bar indicator\n\t\tthis.healthBarPercText = this.add.text(620, 12, '100%', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.healthBarPercText.alpha = 0;\n\n\t\t// Gold indicator\n\t\tthis.goldAmount = this.add.text(395, 80, 'Gold: 8', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.goldAmount.alpha = 0;\n\n\t\t// Wave Msg text\n\t\tthis.waveText = this.add.text(195, 160, 'Wave: 0 ', {\n\t\t\tfontSize: '48px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveText.alpha = 0;\n\n\t\t// Wave indicator\n\t\tthis.waveIndicator = this.add.text(755, 80, 'Wave: 0 ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveIndicator.alpha = 0;\n\n\t\t// Wave status\n\t\tthis.waveStatus1 = this.add.text(840, 50, 'OFF', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FF0000'\n\t\t});\n\t\tthis.waveStatus1.alpha = 0;\n\n\t\tthis.waveStatus2 = this.add.text(755, 50, 'Status: ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.waveStatus2.alpha = 0;\n\n\t\tthis.waveStatus3 = this.add.text(840, 50, 'ON', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#66ff00'\n\t\t});\n\t\tthis.waveStatus3.alpha = 0;\n\n\t\t// Boss health bar\n\t\tthis.bossHealthBar = this.add.graphics();\n\t\tthis.bossHealthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.bossHealthBar.fillRect(0, 0, 115, 5);\n\t\tthis.bossHealthBar.alpha = 0;\n\t}", "function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}", "function ac_showConfigPanel() {\n\tac_switchTool(\"cfg\");\n}", "function initialization(){\n try{\n statusBar('Inicializando...');\n \n setContextMenu();\n ChangedItens = new Hash();\n startChangedMonitor();\n\n }catch(E){\n raiseException(E);\n }finally{\n statusBar('');\n }\n\n}", "function openMenuBar() {\n setOpen(!open)\n }", "function ComboBox_Display_Menu(event)\n{\n\t//interactions blocked?\n\tif (__SIMULATOR.UserInteractionBlocked())\n\t{\n\t\t//do nothing\n\t}\n\telse\n\t{\n\t\t//get html element\n\t\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t\t//this an ultragrid?\n\t\tif (theHTML.InterpreterObject.UltraGrid)\n\t\t{\n\t\t\t//ignore everything and just forward to ultragrid\n\t\t\tUltraGrid_OnEvent(event);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//block the event\n\t\t\tBrowser_BlockEvent(event);\n\t\t\t//and open the menu\n\t\t\tComboBox_Display_Menu_OpenOnly(theHTML);\n\t\t}\n\t}\n}", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#inclusions').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#inclusions').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "function onPrefChange(prefName) {\n menu.items = createMenuItems();\n}", "start() {\n super.start(this.game.menuOptions);\n this.game.display.draw(0, 0, 'a');\n this.game.display.draw(0, 1, 'b');\n this.game.display.draw(0, 2, 'c');\n this.game.display.draw(0, 3, 'd');\n this.game.display.draw(0, 4, 'e');\n this.game.display.draw(0, 5, ['f', '➧']);\n this.game.display.draw(0, 6, 'g');\n this.game.display.draw(0, 7, 'h');\n this.game.display.draw(0, 8, 'i');\n this.game.display.draw(1, 0, 'j');\n this.game.display.draw(1, 1, 'k');\n this.game.display.draw(1, 2, 'l');\n this.game.display.draw(1, 3, 'm');\n this.game.display.draw(1, 4, 'n');\n this.game.display.draw(1, 5, 'o');\n this.game.display.draw(1, 6, 'p');\n this.game.display.draw(1, 7, 'q');\n this.game.display.draw(1, 8, this.game.music.muted ? ['r', '♩'] : 'r');\n this.selected = 0;\n }", "createPandaTopMenu() {\n let topMenu = $(`<div class='btn-group pcm-btnGroup' role='group'></div>`).appendTo($(`.${this.topMenuRow1}:first`));\n let vol = MyOptions.theVolume(), volumeHoriz = MyOptions.theVolDir();\n $(`<span class='pcm-myWarning' style='font-size:11px; margin-left:13px;'></span>`).appendTo($(`.${this.topMenuRow1}:first`));\n let volumeSlider = $(`<span class='pcm-volumeHorizGroup'>Vol: </span>`).css('display',(volumeHoriz) ? 'block' : 'none').appendTo(topMenu);\n inputRange(volumeSlider, 0, 100, vol, 'vol', (value) => { MyAlarms.setVolume(value); }, false);\n this.addSubMenu(topMenu, 'Vol: ', 'pcm-btn-dropDown', 'pcm-volumeVertGroup', '', [\n {'type':'rangeMax', 'label':'100'},\n {'type':'slider', id:'pcm-volumeVertical', 'min':0, 'max':100, 'value':vol, 'step':5, 'slideFunc': (_s, ui) => { $(ui.handle).text(ui.value); MyAlarms.setVolume(ui.value); }, 'createFunc': (e) => { $(e.target).find('.ui-slider-handle').text(vol).css({'left': '-0.6em', 'width': '25px', 'fontSize':'12px', 'lineHeight':'1', 'height':'18px', 'paddingTop':'2px'}); }},\n {'type':'rangeMin', 'label':'0'}\n ], 'Change the global volume level for alarms.', 'pcm-volumeDropDownBtn', 'pcm-dropdownVolume', true, () => {});\n topMenu.find('.pcm-volumeVertGroup').css('display',(volumeHoriz) ? 'none' : 'flex')\n this.addMenu(topMenu, 'Jobs', () => { MyPandaUI.showJobsModal(); }, 'List all Panda Jobs Added', 'pcm-btn-menu', 'pcm-bListJobs');\n this.addSubMenu(topMenu, '', 'pcm-btn-dropDown', '', '', [\n {'type':'item', 'label':'Add', 'menuFunc': () => { MyPandaUI.showJobAddModal(); }, 'tooltip':'Add a new Panda or Search Job'},\n {'type':'item', 'label':'Stop All', 'menuFunc': () => { MyPanda.stopAll(); }, 'tooltip':'Stop All Collecting Panda or Search Jobs'},\n {'type':'item', 'label':'Search Jobs', 'menuFunc': () => { MyPandaUI.showJobsModal(); }, 'tooltip':'Search the Panda Jobs Added'},\n // {'type':'item', 'label':'Search Mturk'},\n {'type':'divider'},\n {'type':'item', 'label':'Export', 'menuFunc': () => { new EximClass().exportModal(); }, 'tooltip':'Export jobs, options, groupings, triggers and alarms to a file.'},\n {'type':'item', 'label':'Import', 'menuFunc': () => { new EximClass().importModal(); }, 'tooltip':'Import jobs, options, groupings, triggers and alarms from an exported file.'}\n ]);\n this.addMenu(topMenu, 'Display', () => { MyPandaUI.cards.changeDisplay(2) }, 'Change how information is displayed on the jobs to Normal.', 'pcm-btn-menu', 'pcm-bCardsDisplay');\n this.addSubMenu(topMenu, ' ', 'pcm-btn-dropDown', '', '', [\n {'type':'item', 'label':'Normal', 'menuFunc': () => { MyPandaUI.cards.changeDisplay(2) }, 'tooltip':'Change how information is displayed on the jobs to Normal.'},\n {'type':'item', 'label':'Minimal Info', 'menuFunc': () => { MyPandaUI.cards.changeDisplay(1) }, 'tooltip':'Change how information is displayed on the jobs to minimal 3 lines.'},\n {'type':'item', 'label':'One Line Info', 'menuFunc': () => { MyPandaUI.cards.changeDisplay(0) }, 'tooltip':'Change how information is displayed on the jobs to only one line.'}\n ]);\n this.addMenu(topMenu, 'Groupings', () => { MyGroupings.showGroupingsModal(); }, 'Start, stop or edit groupings you have added', 'pcm-btn-menu', 'pcm-bPandaGroupings');\n this.addSubMenu(topMenu, ' ', 'pcm-btn-dropDown', '', '', [\n {'type':'item', 'label':'Start/Stop', 'menuFunc': () => { MyGroupings.showGroupingsModal(); }, 'tooltip':'Start, stop or edit groupings you have added'},\n {'type':'item', 'label':'Create by Selection', 'menuFunc': () => { MyGroupings.createInstant(true); }, 'tooltip':'Create a grouping by selecting the jobs you want to start at same time.'},\n {'type':'item', 'label':'Create Instantly', 'menuFunc': () => { MyGroupings.createInstant(); }, 'tooltip':'Create a grouping with any jobs running now with default name and description'},\n {'type':'item', 'label':'Edit', 'menuFunc': () => { MyGroupings.showGroupingsModal(); }, 'tooltip':'Start, stop or edit groupings you have added'}\n ]);\n this.addMenu(topMenu, '1', e => { this.changeTheTimer(e, MyOptions.useTimer1()); }, 'Change timer to the Main Timer', 'pcm-btn-menu pcm-timerButton pcm-buttonOn mainTimer');\n this.addMenu(topMenu, '2', e => { this.changeTheTimer(e, MyOptions.useTimer2()); }, 'Change timer to the Second Timer', 'pcm-btn-menu pcm-timerButton secondTimer');\n this.addMenu(topMenu, '3', e => { this.changeTheTimer(e, MyOptions.useTimer3()); }, 'Change timer to the Third Timer', 'pcm-btn-menu pcm-timerButton thirdTimer');\n this.addSubMenu(topMenu, '', 'pcm-btn-dropDown', '', '', [\n {'type':'item', 'label':'Edit Timers', 'menuFunc': () => { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showTimerOptions(); }, 'tooltip':'Change options for the timers'},\n {'type':'item', 'menuFunc': () => { this.timerChange(null, MyOptions.getTimerIncrease()); }, 'label':`Increase Timer By ${MyOptions.getTimerIncrease()}ms`, class:'pcm-timerIncrease', 'tooltip':`Increase the current timer by ${MyOptions.getTimerIncrease()}ms`},\n {'type':'item', 'menuFunc': () => { this.timerChange(null, 0, MyOptions.getTimerDecrease()); }, 'label':`Decrease Timer By ${MyOptions.getTimerDecrease()}ms`, class:'pcm-timerDecrease', 'tooltip':`Decrease the current timer by ${MyOptions.getTimerDecrease()}ms`},\n {'type':'item', 'menuFunc': () => { this.timerChange(null, MyOptions.getTimerAddMore()); }, 'label':`Add ${MyOptions.getTimerAddMore()}ms to Timer`, class:'pcm-timerAddMore', 'tooltip':`Add ${MyOptions.getTimerAddMore()}ms to the current timer`},\n {'type':'item', 'menuFunc': () => { let currentTimer = MyOptions.timerUsed; $(`.pcm-timerButton.${currentTimer}:first`).click(); }, 'label':'Reset Timer', 'tooltip':'Reset the current timer to the original time.'}\n ]);\n this.addMenu(topMenu, 'Options', () => { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showGeneralOptions( () => this.modalOptions = null ); }, 'Change the general options', 'pcm-btn-menu', 'pcm-bPandaOptions');\n this.addSubMenu(topMenu, ' ', 'pcm-btn-dropDown', '', '', [\n {'type':'item', 'label':'General', 'menuFunc':() => { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showGeneralOptions( () => this.modalOptions = null ); }, 'tooltip':'Change the general options'},\n {'type':'item', 'label':'Edit Timers', 'menuFunc':function() { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showTimerOptions( () => this.modalOptions = null ); }, 'tooltip':'Change options for the timers'},\n {'type':'item', 'label':'Edit Alarms', 'menuFunc':() => { if (!this.modalAlarms) this.modalAlarms = new ModalAlarmClass(); this.modalAlarms.showAlarmsModal( () => this.modalAlarms = null ); }, 'tooltip':'Change the options and sounds for the alarms'},\n {'type':'item', 'label':'Edit Search', 'menuFunc':() => { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showSearchOptions( () => this.modalOptions = null ); }, 'tooltip':'Change the options for search jobs and search triggers on the search page.'},\n {'type':'item', 'label':'Change Themes', 'menuFunc':() => { MyThemes.showThemeModal(); }, 'tooltip':'Change the Themes CSS to use'},\n {'type':'item', 'label':'Advanced Options', 'menuFunc':() => { if (!this.modalOptions) this.modalOptions = new ModalOptionsClass(); this.modalOptions.showAdvancedOptions( () => this.modalOptions = null ); }, 'tooltip':'Change the advanced options'},\n ]);\n topMenu = null; volumeSlider = null;\n }", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#cancellationPolicy').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#cancellationPolicy').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "function _swdoc_lcf_setup_toolbar_buttons(oJsonFormOptions)\r\n{\r\n\tvar bAllowLog =(oJsonFormOptions.allowLog!=\"true\")?false:true;\r\n\tvar bAllowLogAssign =(oJsonFormOptions.allowLogAssign!=\"true\")?false:true;\r\n\tvar bAllowLogAccept =(oJsonFormOptions.allowLogAccept!=\"true\")?false:true;\r\n\tvar bAllowLogClose =(oJsonFormOptions.allowLogClose!=\"true\")?false:true;\r\n\tvar bAllowLogAcceptTake =(oJsonFormOptions.allowLogAcceptTake!=\"true\")?false:true;\r\n\tvar bAllowAttachments =(oJsonFormOptions.showFileAttachments!=\"true\")?false:true;\r\n\r\n\tapp.toolbar_item_dore(\"lcf\", \"calllog\" , bAllowLog, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callassign\" , bAllowLogAssign, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callaccept\" ,bAllowLogAcceptTake , document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"calltake\" , bAllowLogAccept, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callresolve\" , bAllowLogClose, document);\r\n\r\n\t//-- file attach\r\n\tapp.toolbar_item_sorh(\"lcf\", \"attach\" , bAllowAttachments, document);\r\n\tapp.toolbar_item_sorh(\"lcf\", \"unattach\" , bAllowAttachments, document);\r\n\t\r\n}", "function fnc_child_set_menu()\n{\n\tfnc_SET_variables_de_menu('2311');\n}", "function setup_menu() {\n $('div[data-role=\"arrayitem\"]').contextMenu('context-menu1', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n $('div[data-role=\"prop\"]').contextMenu('context-menu2', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n }", "function customizeWiki() {\n addCharSubsetMenu();\n addHelpToolsMenu();\n addDigg();\n}", "function OnStart() {\n // status bar. icon\n gl.StatusBar(1,1);\n gl.TopIcon(1,20,'[fa-bars]',go_icon);\n \n // top status bar\n gl.MakeBtn('t','on','btnid',go_btnMenu,'MENU');\n gl.MakeBtn('t',true,'screen',go_black,'SCRN OFF');\n gl.MakeBtn('t',true,'screen',go_test,'TEST');\n \n // bottom status bar\n gl.MakeBtn('b',true,'',go_midtxt,'MID TXT');\n gl.MakeBtn('bot',1,'btnid',go_exit,'EXIT');\n \n // make the app screen\n gl.MakeLay(' FuncLib',go_apname);\n\n // add text element on screen \n s2=gl.GetMidLay();\n s3=gl.GetMidLay();\n txt = app.CreateText( htxt,-1,-1,\"multiline\" );\n txt.SetTextSize( 20 );\n s2.AddChild( txt );\n\n} // OnStart()", "function initializeMenu() {\n robotMenu = Menus.addMenu(\"Robot\", \"robot\", Menus.BEFORE, Menus.AppMenuBar.HELP_MENU);\n\n CommandManager.register(\"Select current statement\", SELECT_STATEMENT_ID, \n robot.select_current_statement);\n CommandManager.register(\"Show keyword search window\", TOGGLE_KEYWORDS_ID, \n search_keywords.toggleKeywordSearch);\n CommandManager.register(\"Show runner window\", TOGGLE_RUNNER_ID, \n runner.toggleRunner);\n CommandManager.register(\"Run test suite\", RUN_ID,\n runner.runSuite)\n robotMenu.addMenuItem(SELECT_STATEMENT_ID, \n [{key: \"Ctrl-\\\\\"}, \n {key: \"Ctrl-\\\\\", platform: \"mac\"}]);\n \n robotMenu.addMenuDivider();\n\n robotMenu.addMenuItem(RUN_ID,\n [{key: \"Ctrl-R\"},\n {key: \"Ctrl-R\", platform: \"mac\"},\n ]);\n\n robotMenu.addMenuDivider();\n\n robotMenu.addMenuItem(TOGGLE_KEYWORDS_ID, \n [{key: \"Ctrl-Alt-\\\\\"}, \n {key: \"Ctrl-Alt-\\\\\", platform: \"mac\" }]);\n robotMenu.addMenuItem(TOGGLE_RUNNER_ID,\n [{key: \"Alt-R\"},\n {key: \"Alt-R\", platform: \"mac\"},\n ]);\n }", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#remarks').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#remarks').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "function mainMenu() {\n hideOverlay();\n showOverlay();\n getId('quitText').innerHTML = \"Go to the<br>MAIN MENU?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"Back\";\n}", "function initforSetting() {\n // set default value\n setConditionClear();\n\n // search driver data\n getVendorData();\n\n // set vendor's default value\n setVendorClear();\n\n // show / hide for setting menu \n if (group != 'operation') {\n $('#basic').attr('style', 'visibility:visible;');\n $('#vendor').attr('style', 'visibility:hidden;');\n\n $('#btnbasicsetting').addClass('active');\n $('#btnvendorsetting').removeClass('active');\n }\n else {\n $('#basic').attr('style', 'visibility:hidden;');\n $('#vendor').attr('style', 'visibility:visible;');\n\n $('#btnbasicsetting').removeClass('active');\n $('#btnvendorsetting').addClass('active');\n }\n}", "_overriddenMenuHandler() { }", "function onOpen(){\n var ui=SpreadsheetApp.getUi();\n var menu = ui.createMenu(\"FMV Tracker\");\n \n var labSubMenu = ui.createMenu(\"Labelers\");\n labSubMenu.addItem(\"Attempt\", \"showFormAttempt\");\n labSubMenu.addItem(\"R0\", \"showFormR0\");\n labSubMenu.addItem(\"R1\", \"showFormR1\");\n labSubMenu.addItem(\"R10\", \"showFormR10\");\n menu.addSubMenu(labSubMenu);\n\n var qaSubMenu = ui.createMenu(\"QA\");\n qaSubMenu.addItem(\"Tools\",\"showQAForm\");\n menu.addSubMenu(qaSubMenu);\n\n labSubMenu.addSeparator();\n menu.addSeparator();\n menu.addItem(\"Metrics\",\"viewMets\");\n menu.addSeparator();\n menu.addToUi();\n}", "function menuSetup() {\n\t\t\tmenu.classList.remove(\"no-js\");\n\n\t\t\tmenu.querySelectorAll(\"ul\").forEach((submenu) => {\n\t\t\t\tconst menuItem = submenu.parentElement;\n\n\t\t\t\tif (\"undefined\" !== typeof submenu) {\n\t\t\t\t\tlet button = convertLinkToButton(menuItem);\n\n\t\t\t\t\tsetUpAria(submenu, button);\n\n\t\t\t\t\t// bind event listener to button\n\t\t\t\t\tbutton.addEventListener(\"click\", toggleOnMenuClick);\n\t\t\t\t\tmenu.addEventListener(\"keyup\", closeOnEscKey);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function onOpen() {\n FormApp.getUi().createMenu('TSFormBot')\n .addItem('🕜 Enable Bot', 'TSFormBot.enableBot')\n .addToUi();\n}", "function adjustCxtMenu(event) {\n var currentCxtMenuPosition = getScratchProp('cxtMenuPosition');\n var cyPos = event.position || event.cyPosition;\n\n if( currentCxtMenuPosition != cyPos ) {\n hideMenuItemComponents();\n setScratchProp('anyVisibleChild', false);// we hide all children there is no visible child remaining\n setScratchProp('cxtMenuPosition', cyPos);\n\n var containerPos = $(cy.container()).offset();\n var renderedPos = event.renderedPosition || event.cyRenderedPosition;\n\n var borderThickness = parseInt($(cy.container()).css(\"border-width\").replace(\"px\",\"\"));\n if(borderThickness > 0){\n containerPos.top += borderThickness;\n containerPos.left += borderThickness;\n }\n \n // var left = containerPos.left + renderedPos.x;\n // var top = containerPos.top + renderedPos.y;\n //$cxtMenu.css('left', left);\n //$cxtMenu.css('top', top);\n\n\n var containerHeight = $(cy.container()).innerHeight();\n var containerWidth = $(cy.container()).innerWidth(); \n\n var horizontalSplit = containerHeight/2 ;\n var verticalSplit = containerWidth/2 ;\n var windowHeight = $(window).height();\n var windowWidth = $(window).width(); \n \n \n //When user click on bottom-left part of window\n if(renderedPos.y > horizontalSplit && renderedPos.x <= verticalSplit) {\n $cxtMenu.css(\"left\", renderedPos.x + containerPos.left);\n $cxtMenu.css(\"bottom\", windowHeight - (containerPos.top + renderedPos.y));\n $cxtMenu.css(\"right\", \"auto\");\n $cxtMenu.css(\"top\", \"auto\");\n } else if(renderedPos.y > horizontalSplit && renderedPos.x > verticalSplit) {\n //When user click on bottom-right part of window\n $cxtMenu.css(\"right\", windowWidth - (containerPos.left+ renderedPos.x));\n $cxtMenu.css(\"bottom\", windowHeight - (containerPos.top + renderedPos.y));\n $cxtMenu.css(\"left\", \"auto\");\n $cxtMenu.css(\"top\", \"auto\");\n } else if(renderedPos.y <= horizontalSplit && renderedPos.x <= verticalSplit) {\n //When user click on top-left part of window\n $cxtMenu.css(\"left\", renderedPos.x + containerPos.left);\n $cxtMenu.css(\"top\", renderedPos.y + containerPos.top);\n $cxtMenu.css(\"right\", \"auto\");\n $cxtMenu.css(\"bottom\", \"auto\");\n } else {\n //When user click on top-right part of window\n $cxtMenu.css(\"right\", windowWidth - (renderedPos.x + containerPos.left));\n $cxtMenu.css(\"top\", renderedPos.y + containerPos.top);\n $cxtMenu.css(\"left\", \"auto\");\n $cxtMenu.css(\"bottom\", \"auto\");\n }\n }\n }", "onLoad(evt) {\n show(evt, option);\n }", "function contextMenuOn() {\n if (statusMenu) build_menu.style.display = \"block\";\n else {\n document.getElementById(settings.element).appendChild(build_menu);\n statusMenu = true;\n }\n }", "function main() {\n MenuItem.init();\n sizeUI();\n }", "function ymb_toggleYieldmoMenuOn() {\n if (document.getElementById('ymb_header-menu-bars')) {\n var menu = document.getElementById('ymb_header-menu-bars');\n menu.className = menu.className.replace('initial', 'active');\n }\n if (document.getElementById('ymb_header-bar')) {\n var header = document.getElementById('ymb_header-bar');\n header.className = header.className.replace('initial', 'active');\n }\n if (document.getElementById('ymb_sidenav')) {\n var sideNav = document.getElementById('ymb_sidenav');\n sideNav.className = sideNav.className.replace('initial', 'active');\n }\n if (document.getElementById('ymb_header-logo')) {\n var logo = document.getElementById('ymb_header-logo');\n logo.className = logo.className + ' ymb_header-logo-active';\n }\n if (document.getElementById('ymb_header-application-name')) {\n var appName = document.getElementById('ymb_header-application-name');\n appName.className = appName.className + ' ymb_header-application-name-active';\n }\n var links = document.getElementsByClassName('ymb_header-topnav-link');\n for (var i = 0; i < links.length; i++) {\n links[i].style.opacity = '0.0';\n }\n }", "function OnOptions()\n{\n\t// show options \n\tshowOptions = true;\n}", "function on_event_select_add_entry_to_logick_menu(e)\n{\n /*removes old Logick*/\n delete_custom_logick_of_element();\n \n /*sets the new custom elements*/\n logick_elements.custom_logick_elements = e.param1.custom_logick_menu;\n\n /*applays the custom logick to the logick menu*/\n apply_custom_logick_onselect();\n \n}", "function onOpen() {\n createMenu();\n}", "function AddCustomMenuItems(menu) {\n menu.AddItem(strMenuItemLoop, \n (doLoop == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n menu.AddItem(strMenuItemShuffle, \n (doShuffle == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n}", "start() {\n super.start();\n this.selected = 0;\n this.game.display.drawText(36, 1, 'ROTBASE');\n this.game.display.drawText(1, 4, '➧Start');\n this.game.display.drawText(2, 6, 'Help');\n this.game.display.drawText(2, 8, 'Credits');\n }", "function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}", "function on_paint()\n{\n var scoped = entity_get_prop(entity_get_local_player(), \"CCSPlayer\", \"m_bIsScoped\");\n\n if (ui_is_menu_open() || !entity_is_alive(entity_get_local_player()) || !entity_get_local_player()) return;\n ui_set_value(\"Visual\", \"SELF\", \"Chams\", \"Configure\", 0);\n ui_set_value(\"Visual\", \"SELF\", \"Chams\", \"Visible override\", scoped ? false : true);\n}", "function onOpen() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var menuEntries = [\n {\n name: \"Setup\",\n functionName: \"setup\"\n },\n {\n name: \"Authorize\",\n functionName: \"showSidebar\"\n },\n {\n name: \"Reset\",\n functionName: \"clearService\"\n },\n {\n name: \"Sync\",\n functionName: \"refreshTimeSeries\"\n },\n {\n name: \"Sync & Save\",\n functionName: \"syncAndSave\"\n }];\n ss.addMenu(\"Fitbit\", menuEntries);\n}", "function setCurrentMenu(menu) {\n menuCurrent = menu;\n }", "function initializeAppBar()\n {\n\n // Add event listeners to handle click of Open option in command bar\n var open = document.getElementById(\"open\");\n if (!open)\n return;\n\n open.addEventListener(\"click\", openClick, false);\n }", "function globalDBUpdate() {\n runPlayerMenuUpdate();\n\n // patch update\n addPatchMenuOptions($('#filter-popup-widget .filter-widget-patch'), function() {\n $('#filter-popup-widget .filter-widget-patch').dropdown('refresh');\n });\n\n addPatchMenuOptions($('#match-patch-select'), function() {\n $('#match-patch-select').dropdown('refresh');\n });\n\n populateStatCollectionMenus();\n}", "function OnGUI()\n{\n\tif(isActionGUIEnabled)\n\t{\n\t\tGUI.Box(actionGUIBox, \"\");\n\t\ttoolbarInt = GUI.Toolbar (Rect (Screen.width-buttonSize.x*3,0,buttonSize.x,buttonSize.y), toolbarInt, toolbarTextures);\n\t\t\n\t}\n}", "function Themes_PreProcessToolBar(theObject)\n{\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\tif (theObject.Parent && theObject.Parent.HTML && (theObject.Parent.HTML.WSCaption && theObject.Parent.HTML.WSCaption.SapLogo || theObject.Parent.HTML.WS_CHILD))\n\t\t\t\ttheObject.HTML.SAPMainToolBar = true;\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\tif (theObject.Parent && theObject.Parent.HTML && (theObject.Parent.HTML.WSCaption && theObject.Parent.HTML.WSCaption.SapLogo || theObject.Parent.HTML.WS_CHILD))\n\t\t\t{\n\t\t\t\ttheObject.HTML.SAPMainToolBar = true;\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TOP] = \"20\";\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = \"26\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\tif (theObject.Parent && theObject.Parent.HTML && (theObject.Parent.HTML.WSCaption || theObject.Parent.HTML.WS_CHILD))\n\t\t\t{\n\t\t\t\ttheObject.HTML.SAPMainToolBar = true;\n\t\t\t\ttheObject.HTML.SAPGUISERVER = theObject.Parent.HTML.WS_CHILD;\n\t\t\t\tif (!theObject.HTML.SAPGUISERVER)\n\t\t\t\t{\n\t\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TOP] = \"15\";\n\t\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = \"30\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\tif (theObject.Parent && theObject.Parent.HTML && (theObject.Parent.HTML.WSCaption || theObject.Parent.HTML.WS_CHILD))\n\t\t\t{\n\t\t\t\ttheObject.HTML.SAPMainToolBar = true;\n\t\t\t\ttheObject.HTML.SAPGUISERVER = theObject.Parent.HTML.WS_CHILD;\n\t\t\t\tif (!theObject.HTML.SAPGUISERVER)\n\t\t\t\t{\n\t\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TOP] = \"10\";\n\t\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = \"37\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tvar bgColor = theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT];\n\tif (theObject.HTML.SAPMainToolBar)\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"Transparent\";\n\telse if (String_IsNullOrWhiteSpace(bgColor))\n\t{\n\t\tswitch (theObject.InterfaceLook)\n\t\t{\n\t\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"Transparent\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"#F0F0F0\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif (theObject.InterfaceLook === __NEMESIS_LOOK_SAP_BELIZE && theObject.Parent && theObject.Parent.Parent && theObject.Parent.Parent.Parent && theObject.Parent.Parent.Parent.HTML && theObject.Parent.Parent.Parent.HTML.WSCaption && Get_Number(theObject.Parent.Properties[__NEMESIS_PROPERTY_TOP], 100) < 10)\n\t{\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"<SAPCLR:9>\";\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = \"26\";\n\t}\n}", "function setupSFX() {\n SOUND_LOW_PIANO_KEY.setVolume(0.3);\n SOUND_HIGH_PIANO_KEY.setVolume(0.15);\n SOUND_DRAWER.setVolume(0.5);\n SOUND_PANEL.setVolume(0.15);\n SOUND_MOVE.setVolume(0.25);\n SOUND_POSTER.setVolume(0.1);\n SOUND_BEEP.setVolume(0.05);\n SOUND_ERROR.setVolume(0.05);\n SOUND_COMBO_LOCK.setVolume(0.25);\n SOUND_COMBO_LOCKED.setVolume(0.15);\n SOUND_DOOR_LOCKED.setVolume(0.75);\n SOUND_DOOR_OPEN.setVolume(0.2);\n SOUND_SWITCH.setVolume(0.2);\n SOUND_TAKE_ITEM.setVolume(0.3);\n SOUND_USE_ITEM.setVolume(0.05);\n SOUND_CM_POWERED.setVolume(0.1);\n SOUND_CM_WORKING.setVolume(0.15);\n SOUND_CM_SWITCH.setVolume(0.1);\n SOUND_PLUG_IN.setVolume(0.15);\n SOUND_PLACE_MUG.setVolume(0.1);\n BGM_CONCLUSION.setVolume(0.15);\n}", "function MenuManager() {\n\tvar PLAYER_OPTIONS = {\n\t\tHuman:PLAYER_HUMAN, \t\n\t\tRandom:PLAYER_RANDOM,\t\t\n\t\tWeak:PLAYER_HEURISTIC,\t\t\n\t\t//Theseus:PLAYER_THESEUS,\t\n\t\tMinotaur:PLAYER_ALPHABETA,\t\n\t\t'EvilKingMinos':PLAYER_MINOTAUR_PLUS,\t\n\t\tNetwork:PLAYER_NETWORK,\t\t\t\t\t\t\n\t\t//wasm:PLAYER_WASM,\t\n\t\t//MonteCarlo:PLAYER_MONTECARLO,\n\t\t//MCTS:PLAYER_MCTS,\n\t};\t\n\t\t\n\tthis.properties = new MenuProperties();\n\tthis.rootMenu = new dat.GUI();\t\n\t\n\t//Options - secondary root\t\n\tvar optionsMenu = this.rootMenu.addFolder('Options');\t\t\t\n\t\n\t//Display menu\n\tvar displayMenu = optionsMenu.addFolder('Display');\t\n\tdisplayMenu.add(this.properties, 'showLabels').onChange(this.persistChange);\t\t\n\tdisplayMenu.add(this.properties, 'showPath').onChange(this.persistChange);\n\tdisplayMenu.add(this.properties, 'showDistance').onChange(this.persistChange);\n\tdisplayMenu.add(this.properties, 'showWallColors').onChange(this.persistChange);\n\t\t\n\n\t//Debug menu\n\tvar debugMenu = optionsMenu.addFolder('Debug');\t\n\tdebugMenu.add(this.properties, 'showGrid');\n\tdebugMenu.add(this.properties, 'showCenters');\t\n\tdebugMenu.add(this.properties, 'showPositions').onChange(this.persistChange);\n\tdebugMenu.add(this.properties, 'showCoordinates');\n\tdebugMenu.add(this.properties, 'animSpeed', 0, 5000);\t\n\n\t//Links menu\n\t//var linksMenu = optionsMenu.addFolder('Links');\t\t\t\t\n\t\n\n\t//Root menu\t\t\t\n\tthis.rootMenu.add(this.properties, 'player1', PLAYER_OPTIONS).onChange(this.onChangePlayer);\n\tthis.rootMenu.add(this.properties, 'player2', PLAYER_OPTIONS).onChange(this.onChangePlayer);\t\n\tthis.rootMenu.add(this.properties, 'hotkeys');\n\n\t//Configure button hack\n\tvar propertyNodes = document.querySelectorAll('.dg.main .property-name');\t\t\t\n\tfor (var n = 0; n < propertyNodes.length; n++) {\n\t\tvar title = propertyNodes[n].innerHTML;\t\t\t\n\t\tif (title == 'player1' || title == 'player2') {\n\t\t\tvar node = propertyNodes[n];\n\t\t\t\n\t\t\tvar btnNode = document.createElement('img');\t\t\n\t\t\tbtnNode.className += 'config-button ' + title;\t\n\t\t\tbtnNode.setAttribute('data-name', title);\n\t\t\tnode.nextSibling.appendChild(btnNode);\n\t\t\tbtnNode.onclick = function(e) {\n\t\t\t\tif (!e) var e = window.event;\n\t\t\t\tvar player = (this.dataset[\"name\"] == \"player1\")? PLAYER1 : PLAYER2;\n\t\t\t\tgame.onPlayerConfig(player);\n\t\t\t\t\n\t\t\t}\n\t\t}\t\t\n\t}\t\n\t\n}", "function setContextMenuAttribs() {\n\t\t\tvar exportList = chart.exportDivElements;\n\t\t\tif (exportList) {\n\t\t\t\t// Set tabindex on the menu items to allow focusing by script\n\t\t\t\t// Set role to give screen readers a chance to pick up the contents\n\t\t\t\tfor (var i = 0; i < exportList.length; ++i) {\n\t\t\t\t\tif (exportList[i].tagName === 'DIV' &&\n\t\t\t\t\t\t!(exportList[i].children && exportList[i].children.length)) {\n\t\t\t\t\t\texportList[i].setAttribute('role', 'menuitem');\n\t\t\t\t\t\texportList[i].setAttribute('tabindex', -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Set accessibility properties on parent div\n\t\t\t\texportList[0].parentNode.setAttribute('role', 'menu');\n\t\t\t\texportList[0].parentNode.setAttribute('aria-label', 'Chart export');\n\t\t\t}\n\t\t}", "function drawMenu(){\r\n ctx.beginPath();\r\n ctx.fillStyle = \"#8a7763\";\r\n ctx.fillRect(0,0,800,600);\r\n for (elemnt in menuButtons)\r\n menuButtons[elemnt].draw();\r\n //Title Text\r\n ctx.font = \"30px Arial\";\r\n ctx.textAlign = \"center\";\r\n ctx.fillStyle = '#000000';\r\n ctx.textBaseline = \"bottom\";\r\n ctx.fillText(\"Welcome to connect 4\", 350, 35);\r\n ctx.font = \"20px Arial\";\r\n ctx.fillText(\"Please Select an Option\", 350, 55);\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "function setMenuCommand($name, $handler) {\r\n if (Params.env.isFirefox) GM_registerMenuCommand($name, $handler);\r\n}", "function doRegisterCommands() {\r\n GM_registerMenuCommand('Configurar ' + appName + ' ' + appVersion + '...', preferences);\r\n GM_registerMenuCommand('Ver información de depurado', showLog);\r\n }", "function updateOptions() {\n\tpush();\n\t\tfill([255,255,255]);\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttranslate(screen.w/2,screen.h/2);\n\t\ttext(\"What options do you need?\",0,0);\n\tpop();\n}" ]
[ "0.6267899", "0.6078762", "0.5981175", "0.59540915", "0.59386784", "0.5938602", "0.5918045", "0.5909882", "0.58985406", "0.58672947", "0.5791357", "0.5786228", "0.5741798", "0.5723836", "0.5716758", "0.5712814", "0.5691221", "0.5688368", "0.56815803", "0.56610215", "0.5654246", "0.56372786", "0.56261647", "0.5625761", "0.5622277", "0.5622229", "0.56208897", "0.56103355", "0.5608307", "0.5584689", "0.558385", "0.55749965", "0.55620754", "0.5551746", "0.55402654", "0.55341905", "0.5530932", "0.55133563", "0.5509774", "0.5505657", "0.54966414", "0.5492031", "0.54914355", "0.54848534", "0.54756016", "0.54742956", "0.5474053", "0.5460739", "0.54579467", "0.54431874", "0.5433047", "0.5424216", "0.54226243", "0.5420563", "0.54116356", "0.5394041", "0.53938586", "0.5392983", "0.5389189", "0.5383852", "0.53795654", "0.5379242", "0.5372203", "0.5367718", "0.53642446", "0.53618413", "0.53467137", "0.53317696", "0.5330537", "0.5327041", "0.5325466", "0.5323211", "0.53117955", "0.531177", "0.53100085", "0.5309914", "0.5309629", "0.53046334", "0.53014696", "0.5299186", "0.5295842", "0.52957284", "0.52850246", "0.5279378", "0.52763987", "0.5272926", "0.526914", "0.526735", "0.5264781", "0.52603525", "0.52545553", "0.52517223", "0.5251168", "0.5248497", "0.52469367", "0.52463555", "0.5245608", "0.52439094", "0.5243057", "0.5238619" ]
0.5636266
22
copies over the results into one of our own objects
function copyResults(result, config) { var r = {}; // copy over Object.keys(result).forEach(function (key) { r[key] = result[key]; }); // because Array's start at 0. r.line -= 1; // pass the user config along with it r.config = config; return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resultObj(){\n\n\t\tthis.nsid = false\n\t\tthis.source = false\n\t\tthis.value = false\n\t\tthis.differentiated = true\t//default is to be differentiated \n\t\tthis.sparse = false\n\t}", "function copyResults(result, config) {\n var r = {};\n Object.keys(result).forEach(function (key) {\n r[key] = result[key];\n });\n r.line -= 1;\n r.config = config;\n return r;\n }", "function resultObj(){\n\n\t\tthis.mainHeadingsData = []\n\t\tthis.heading = false\n\t\tthis.mainHeadingEls = []\n\t}", "prepareForOutput(result) {\n result = model.prepareForFullOutput(result)\n delete result.results\n return result\n }", "function resultWrapper(result) {\n if (result && typeof result.entries !== 'undefined') {\n if (result.entries && result.entries.length) {\n for (var i = 0, _i = result.entries.length; i < _i; i++) {\n result.entries[i] = (0, _result2.default)(result.entries[i]);\n }\n } else {\n result.entries = [];\n }\n } else if (result && result.assets && typeof result.assets !== 'undefined') {\n if (result.assets && result.assets.length) {\n for (var j = 0, _j = result.assets.length; j < _j; j++) {\n result.assets[j] = (0, _result2.default)(result.assets[j]);\n }\n } else {\n result.assets = [];\n }\n } else if (result && typeof result.entry !== 'undefined') {\n result.entry = (0, _result2.default)(result.entry);\n } else if (result && typeof result.asset !== 'undefined') {\n result.asset = (0, _result2.default)(result.asset);\n } else if (result && typeof result.items !== 'undefined') {\n result.items = (0, _result2.default)(result.items).toJSON();\n }\n\n return result;\n}", "copyResults() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = this.resultGrid[col][row]\n }\n }\n }", "get resultObj() {\n return this._resultObj;\n }", "function gotResult(err, results) {\n if (err) {\n console.log(err);\n }\n console.log(results)\n objects = results;\n}", "function initializeResults() {\n let currentResults = [];\n let temp;\n for (let i = 0; i < clueshints.length; i++) {\n temp = { clue: clueshints[i].order_num, time: -1 };\n currentResults.push(temp);\n }\n return currentResults;\n }", "prepareResultsArray() {\n if (this.shouldUseCorrespondingResults()) {\n this.meta.results = Array(this.items().length).fill(promise_pool_1.PromisePool.notRun);\n }\n return this;\n }", "get result() { return this._result; }", "updateResults(results) {\n this._resultsCache[this._query] = results;\n this._results = results;\n }", "function initializeResults() {\n resultsContainer.empty();\n var restaurantsToAdd = [];\n for (var i = 0; i < restaurants.length; i++) {\n restaurantsToAdd.push(createResults(restaurants[i]));\n }\n resultsContainer.append(restaurantsToAdd);\n }", "function Result(rdata){\n this.rdata = rdata;\n }", "map(entityName, result) {\n entityName = utils_1.Utils.className(entityName);\n const meta = this.metadata.get(entityName);\n const data = this.driver.mapResult(result, meta);\n return this.merge(entityName, data, true);\n }", "function EvalResult() {\n\tthis.type = null;\n\tthis.order = [];\n\tthis.scores = [];\n\t\n\treturn this;\n}", "function swapResult(r){\n\t\t\t\tvar temp;\n\t\t\t\ttemp = r.ri; r.ri = r.rj; r.rj = temp;\n\t\t\t\tr.ni.negate(r.ni);\n\t\t\t\ttemp = r.bi; r.bi = r.bj; r.bj = temp;\n\t\t\t}", "function copySearch(fromSearch) {\n var toSearch = {\n GameId: fromSearch.GameId,\n PlayerId: fromSearch.PlayerId,\n Turn: fromSearch.Turn,\n SearchNumber: fromSearch.SearchNumber,\n SearchType: fromSearch.SearchType,\n Area: fromSearch.Area,\n Markers: []\n };\n if (fromSearch.Markers.length) {\n for (var i = 0; i < fromSearch.Markers.length; i++) {\n toSearch.Markers.push({ Zone: fromSearch.Markers[i].Zone, TypesFound: fromSearch.Markers[i].TypesFound });\n }\n }\n return toSearch;\n}", "function initResult() {\n var series = [],\n i = 0\n while (i < NUMBER_OF_SERIES) {\n series.push({\n codingType: 0,\n codingTable: 0,\n resolution: null,\n uncompressSamples: []\n })\n i += 1\n }\n return {\n batch_counter: 0,\n batch_relative_timestamp: 0,\n series: series\n }\n}", "function rghResult(result) {\n // send result back to app\n if (isEmptyObject(resultObject)) {\n resultObject = result;\n }\n else {\n resultObject = _.concat(resultObject, result); // concat/merge with existing group results\n }\n getGroupFiles(++groupIndex); // get next group template to merge\n }", "getWalkedRecordCopy() {}", "function populateResults(callback) {\n\t\tshirtTitles.forEach((vally, indy, arry) => {\n\t\t\tresults[indy].Title = vally;\n\t\t\tresults[indy].Price = shirtPrices[indy];\n\t\t\tresults[indy].ImageURL = shirtImgs[indy];\n\t\t\tresults[indy].URL = shirtURLs[indy];\n\t\t\tresults[indy].Time = getDate();\n\t\t});\n\t\tcallback();\n\t}", "getResult() {}", "copyRV(rv) {\nRQ.setQV(this._r.xyzw, rv);\nreturn this;\n}", "_getResult() {\n\t\treturn null;\n\t}", "function handleResult(result)\n {\n results.push(result);\n doInsert();\n }", "get results() {\n return {\n stepped: this.hasStepped,\n timing: this[TTIME].summary,\n totalTime: this[TTIME].time,\n hasErrors: this[SDATA].reduce((p,c,i,a) => {\n if (p) { return true }\n if (c.error) { return true }\n return false;\n }, false),\n errors: this[SDATA]\n .map(i => i.error)\n .reduce((p,c) => c ? p.concat([c]) : p, []),\n data: this[SDATA]\n }\n }", "function createResultObject(testObj) {\n return {\n \"title\": testObj.title\n , \"index\": testObj.index\n , \"iterations\": []\n };\n }", "init() {\n this._super(...arguments);\n this.filter('').then((data) =>\n this.set('results', data.results))\n }", "function deResultSet() {\n this.selectionA = null;\n this.selectionB = null;\n this.results = null;\n this.name = null;\n this.startTime = null;\n this.endTime = null;\n}", "async getResults() {\n\t\ttry {\n\t\t\tconst res = await axios(`${proxy}https://www.food2fork.com/api/search?key=${key}&q=${this.query}`)\n\t\t\tthis.result = res.data.recipes;\n\n\t\t\t// for local storage when running out of api\n\t\t\t// localStorage.setItem('result',JSON.stringify(res.data.recipes));\n\t\t\t// const storage = JSON.parse(localStorage.getItem('result'));\n\n\t\t\t// this.result = storage;\n\n\t\t} catch(error) {\n\t\t\tconsole.log(error);\n\t\t}\n}", "setResultObject(resultObject, isContainerArray, path) {\n if (isContainerArray) {\n return this.setRawData(_.get(resultObject, _.dropRight(path)));\n }\n return this.setRawData(_.get(resultObject, path));\n }", "constructor(result, vars = []) {\n this.result = result;\n this.vars = vars;\n // this.result = result;\n // this.vars = vars;\n }", "storeResult(result) {\n this.result = result;\n }", "reset(resultsTree) {\n this._results = flatten(resultsTree);\n this.dirty = false;\n this.length = this._results.length;\n this.last = this._results[this.length - 1];\n this.first = this._results[0];\n }", "static fromResult(result)\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "static concatResult(existing, next) {\n return {\n nextContext: next.nextContext,\n resultOps: existing.resultOps.concat(next.resultOps),\n scheduledActions: existing.scheduledActions.concat(next.scheduledActions)\n };\n }", "async processResult(\n resArray,\n originalUserData,\n botStorage,\n ignoreWildcardHistory,\n scoreBasedOnSearch\n ) {\n try {\n this.countEntry++\n debug('countEntry', this.countEntry)\n\n let pList = []\n let uList = []\n let bList = []\n let wList = []\n let infoList = []\n for (let i = 0; i < resArray.length; i++) {\n //Ok, this copies the entire user data, a costly operation.\n //One should just copy the history and database when the time comes.\n\n //debug('originalUserData', originalUserData)\n //debug('botStorage', botStorage)\n let userData = deepcopy(originalUserData)\n //debug('userData aagin', userData)\n\n let lStorage = deepcopy(botStorage)\n\n //let userData = userDataList[i];\n\n let res = resArray[i]\n //debug('RES', res)\n\n let source = res.source\n let wildcards = res.wildcards\n let confidence = res.confidence\n let storage = res.source.storage\n\n let typeIdentifier = this.pdb.getTypeIdentifier(source)\n let replies = this.tellMap.get(typeIdentifier)\n debug('replies', replies)\n debug('typeIdentifier', typeIdentifier)\n\n\n //Store data and fill in from local storage\n //These can override information in the database\n //This could also put in bogus data, but can also put in multiple\n //copies of correct data! Could cause some strange results so watch out!\n debug(\n '------------------------storage-------------------',\n storage,\n source.implies[0]\n )\n let info = null\n if (storage) {\n this.storeData(\n storage,\n wildcards,\n userData,\n source.implies[0],\n source,\n lStorage\n )\n\n //You can also fill in the values\n info = this.retrieveData(\n storage,\n wildcards,\n userData,\n source.implies[0],\n source,\n lStorage\n )\n }\n\n infoList.push(info)\n\n //Lets fill in wildcards ahead of time with guesses\n //debug('wildcards',wildcards)\n debug('userData', userData)\n debug(\n 'wildcards',\n wildcards,\n 'history',\n userData.history,\n 'lastHistory',\n userData.getLastHistory()\n )\n if (!ignoreWildcardHistory) {\n //You ignore the history if your have expanded a word, in general\n for (let i in wildcards) {\n debug('i', i)\n if (!wildcards[i] && i != 'matched') {\n debug('replacing', i, wildcards[i])\n let res = slotFiller.getWildcardFromHistory(i, userData.history, 5)\n //debug('res', res, userData.history)\n if (res.length) {\n wildcards[i] = res[0]\n debug('with', res[0])\n }\n }\n }\n }\n debug('wildcards after insertion', wildcards)\n\n res.wildcards = wildcards\n userData.unshiftHistory(res)\n\n //Actually compute the result\n debug('this.botEngine', this.botEngine)\n let firstGuess = await this.botEngine.computeResult(\n {\n typeIdentifier: typeIdentifier,\n replies: replies,\n wildcards: wildcards,\n source: source,\n doc: this.doc,\n confidence: confidence,\n score: res.score,\n },\n userData,\n scoreBasedOnSearch\n )\n debug('firstGuess', firstGuess)\n\n //All promises must resolve, which I believe they do (rejections caught and turned to resolve)\n pList.push(firstGuess)\n uList.push(userData)\n bList.push(lStorage)\n wList.push(res.wcScore)\n }\n\n debug('ans.length', pList.length)\n let newVal = []\n for (let i = 0; i < pList.length; i++) {\n pList[i].wcScore = wList[i]\n newVal.push({ val: pList[i], userData: uList[i], storage: bList[i] })\n }\n\n debug('--------------------------NEWVAL-------------------', newVal)\n\n //There are many results given in the list, pick the best.\n let final = this.trimResults(newVal, infoList)\n\n debug('final', final)\n \n //copy the two critical components\n originalUserData.shallowCopy(final.userData)\n //debug('originalUserData', originalUserData)\n\n debug(\n 'FINAL STORAGE-------------------------',\n originalUserData.storage,\n final.storage\n )\n debug('botStorage', botStorage)\n for (let i in final.storage) {\n botStorage[i] = final.storage[i]\n }\n //debug('just before final promise.',final)\n debug('finalHistory', final.userData.history)\n return final.val\n } catch (error) {\n debug('Error', JSON.stringify(error, null, 2))\n\n }\n }", "function make_result(r, matched, ast) {\n return { remaining: r, matched: matched, ast: ast };\n}", "copy(obj){\n\t\tif (obj == undefined) obj=null;\n\t\tif (obj == null){\n\t\t\treturn this;\n\t\t}\n\t\tvar res = rtl.newInstance(this.getClassName(), (new Vector()));\n\t\tres.assignObject(this);\n\t\tres.setMap(obj);\n\t\tres.initData();\n\t\t/* Return object */\n\t\treturn res;\n\t}", "function parseResults(results) {\r\n // clear out the old results by deleting everything with class \"article\"\r\n // result is that only 20 results are displayed at a time\r\n document.querySelectorAll('.article').forEach(function(article) {\r\n article.remove();\r\n })\r\n \r\n // display the new search results\r\n let articles = results.articles;\r\n for (let i=0; i<articles.length; i++) {\r\n\r\n // create a div for the article ... content will go inside it\r\n let block = document.createElement('div');\r\n block.classList.add('article'); // tag the block for easy manipulation\r\n resultSection.appendChild(block);\r\n \r\n // add image as a link\r\n addImage(articles[i].url, articles[i].urlToImage, block);\r\n\r\n // add the title as a link\r\n addTitle(articles[i].url, articles[i].title, block);\r\n\r\n // add the source and the date (substring of the publishedAt field to extract date without time)\r\n addChild('h5', articles[i].source['name'] + ', ' + articles[i].publishedAt.substring(0, 10), block);\r\n\r\n // add description\r\n addChild('p', articles[i].description, block);\r\n }\r\n}", "function createFinalResult(testResults) {\n return testResultProcessor(testResults);\n }", "function spreadResult(result) {\n var _results = [];\n if (result && Object.keys(result).length) {\n if (typeof result.entries !== 'undefined') _results.push(result.entries);\n if (typeof result.assets !== 'undefined') _results.push(result.assets);\n if (typeof result.content_type !== 'undefined' || typeof result.schema !== 'undefined') _results.push(result.content_type || result.schema);\n if (typeof result.count !== 'undefined') _results.push(result.count);\n if (typeof result.entry !== 'undefined') _results = result.entry;\n if (typeof result.asset !== 'undefined') _results = result.asset;\n if (typeof result.items !== 'undefined') _results.push(result);\n }\n return _results;\n}", "_recomputeResults(query, oldResults) {\n if (this.paused) {\n // There's no reason to recompute the results now as we're still paused.\n // By flagging the query as \"dirty\", the recompute will be performed\n // when resumeObservers is called.\n query.dirty = true;\n return;\n }\n\n if (!this.paused && !oldResults) {\n oldResults = query.results;\n }\n\n if (query.distances) {\n query.distances.clear();\n }\n\n query.results = query.cursor._getRawObjects({\n distances: query.distances,\n ordered: query.ordered\n });\n\n if (!this.paused) {\n LocalCollection._diffQueryChanges(\n query.ordered,\n oldResults,\n query.results,\n query,\n {projectionFn: query.projectionFn}\n );\n }\n }", "function addSongsResult (result, clear) {\n\n\t\tif (clear) {\n\t\t\tupNext = [];\n\t\t\tnowPlaying = 0;\n\t\t}\n\n\t\tfor (var row of result.rows) {\n\t\t\tdelete row.doc._rev;\n\t\t\tupNext.push(row.doc);\n\t\t}\n\n\t}", "createIterator (results) {\n return {\n next () {\n return results.shift() || { done: true };\n }\n };\n }", "function createResults(image) {\n return {\n url: image.url,\n title: image.title,\n thumbnail: image.thumbnail.url,\n source: image.sourceUrl,\n type: image.type\n }\n}", "set result(value) {\n this._result = value;\n }", "handleResult(result) {\n return this.getResult(result);\n }", "updateResults() {\n if (this.reindexFlag_) {\n this.reindex();\n }\n\n var results = [];\n if (this.timeModel_ && this.binMethod) {\n // make sure the source time model is filtered on the correct range\n if (this.source) {\n this.source.getFilteredFeatures();\n }\n\n var tempFilters = {};\n var filters = this.getParentFilters();\n if (filters) {\n for (var id in filters) {\n if (filters[id] != null) {\n this.timeModel_.filterDimension(id, filters[id]);\n } else {\n // there's a disturbance in the force - don't return any bins! see getParentFilters for details.\n this.results = [];\n return;\n }\n }\n }\n\n // clear the filters to get all of the data, reapply them a little farther down\n if (this.forceAllData_ == true) {\n tempFilters = this.timeModel_.clearAllFilters();\n }\n\n if (this.secondaryBinMethod) {\n results = /** @type {!Array<!os.histo.Result<!ol.Feature>>} */ (this.timeModel_.groupData(this.multiId_,\n this.combinedKeyMethod.bind(this), this.reduceAdd.bind(this),\n this.reduceRemove.bind(this), this.reduceInit.bind(this)));\n } else {\n results = /** @type {!Array<!os.histo.Result<!ol.Feature>>} */ (this.timeModel_.groupData(this.id_,\n this.binMethod.getBinKey.bind(this.binMethod), this.reduceAdd.bind(this),\n this.reduceRemove.bind(this), this.reduceInit.bind(this)));\n }\n\n // reapply the filters\n if (this.source && this.forceAllData_ == true) {\n this.timeModel_.applyFilters(tempFilters);\n }\n\n if (filters) {\n for (var id in filters) {\n this.timeModel_.filterDimension(id, undefined);\n }\n }\n\n\n results = /** @type {!Array<!ColorBin>} */ (results.map(this.map, this).filter(function(item) {\n return item != undefined;\n }));\n\n if (this.sortFn) {\n googArray.sort(results, this.sortFn);\n }\n }\n\n this.results = results;\n }", "function initResult(id) {\n\t\t\t\treturn {\n\t\t\t\t\tapiHighlight: apiHighlights[id],\n\t\t\t\t\tanchoredHighlight: '',\n\t\t\t\t\toutcome: null\n\t\t\t\t}\n\t\t\t}", "initializeResultsArray() {\n\t\t// Can be run only after this.checkpoints are initialized\n\t\tthis.checkpoints.forEach((cp, cp_i) => {\n\t\t\tthis.runResults[cp_i] = [];\n\t\t\tcp.testCases.forEach((testcase, tc_i) => {\n\t\t\t\tthis.runResults[cp_i][tc_i] = [];\n\t\t\t});\n\t\t});\n\t}", "function makeResult(bi,bj){\n\t\t\t\tif(contactPointPool.length){\n\t\t\t\t\tvar c = contactPointPool.pop();\n\t\t\t\t\tc.bi = bi;\n\t\t\t\t\tc.bj = bj;\n\t\t\t\t\treturn c;\n\t\t\t\t} else\n\t\t\t\t\treturn new CANNON.ContactPoint(bi,bj);\n\t\t\t}", "formatSearchResults(rawResults) {\r\n const results = new Array();\r\n const tempResults = rawResults.results ? rawResults.results : rawResults;\r\n for (const tempResult of tempResults) {\r\n const cells = tempResult.Cells.results ? tempResult.Cells.results : tempResult.Cells;\r\n results.push(cells.reduce((res, cell) => {\r\n Object.defineProperty(res, cell.Key, {\r\n configurable: false,\r\n enumerable: true,\r\n value: cell.Value,\r\n writable: false,\r\n });\r\n return res;\r\n }, {}));\r\n }\r\n return results;\r\n }", "async getResults() {\n\n try {\n /** axios:\n * fetching and converting with .json happens in one step rather than 2 separate like fetch\n * API call syntax: is on food2fork.com => browse => api, \n * site name followed http request with documented search data syntax: /api/search?field= ...\n * axios will return a promise, so we need to await and save into a constant. */\n const result = await axios(`https://www.food2fork.com/api/search?key=${key}&q=${this.query}`);\n //a limit of only 50 API calls a day, ran out so result isn't received properly\n console.log(result);\n //we want to save the recipes array inside the Search object, encapsulationnn\n this.result = result.data.recipes;\n } catch (error) {\n alert(error);\n }\n }", "function ParseResult(result, newPosition) {\n this.result = result;\n this.position = newPosition;\n}", "then(result) {\n\t\tthis.resultBlocks.push(result);\n\t\treturn this;\n\t}", "function createIterationResultObject(testObj, iteration) {\n return {\n \"index\": testObj.index\n , \"iteration\": iteration\n };\n }", "function mergeResults(){\n let previousResults = checkResults();\n if(previousResults){\n for(let currentProduct of Product.allProducts){\n for(let previousProduct of previousResults){\n if(currentProduct.name === previousProduct.name){\n currentProduct.shows += previousProduct.shows;\n currentProduct.clicked += previousProduct.clicked;\n }\n }\n }\n localStorage.removeItem('results');\n }\n\n}", "function add_result( value ) {\n r.push(value.data);\n next_question();\n}", "function pushResultsToArrays() {\n for(var i = 0; i < Product.allProducts.length; i++) {\n totalClicksArr.push(Product.allProducts[i].totalClicks);\n }\n for(var j = 0; j < Product.allProducts.length; j++) {\n allProductNames.push(Product.allProducts[j].stringName);\n }\n for(var k = 0; k < Product.allProducts.length; k++) {\n productBgColors.push(Product.allProducts[k].backgroundColor);\n }\n for(var l = 0; l < Product.allProducts.length; l++) {\n timesShownArr.push(Product.allProducts[l].timesShown);\n }\n}", "constructor() {\n super(ExtractionResult);\n }", "getRelatedRecords(results, dataStore){\n const relationships = this.relationships;\n let cnt = 0, finalCnt = 0; \n if(relationships && relationships.length > 0 ){\n results.map(result => { \n relationships.map(relation=>{\n cnt = 0;\n let relatedStore = dataStore[relation.model];\n let key = (relation.in_current === true) ? relation.primary_key : relation.foreign_key;\n let val = (relation.in_current === true) ? result[relation.foreign_key] : result[relation.primary_key];\n let items = this.getRelatedValue(relatedStore,key,val);\n items.map(item => {\n cnt++;\n let k = `${[relation.model]}_${cnt}`;\n if(k in result){\n cnt = finalCnt+1;\n }\n k = `${[relation.model]}_${cnt}`;\n //result[[relation.model]] = item[relation.return_value];\n result[k] = item[relation.return_value];\n finalCnt = cnt;\n }); \n }); \n });\n }\n return results;\n }", "get result() {\n return this._result;\n }", "function buildExtrctResultObj() {\n entityObj.validationResults.extractCols = {\n unqField: entityCols[entityType].unqKey,\n extrctedCols: columns.length\n };\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "function transformResult(result) {\n let qres = result['bmsbi:result']['bmsbi:qresult'].query\n let query = {\n version: qres.version,\n title: result['bmsbi:result'].$.id,\n limitexceeded: result['bmsbi:result'].$.row_limit_reached !== '',\n nosuchuser: qres.userNotAvailable !== '',\n nodata: qres.noDataAvailable !== '',\n nosuchquery: qres.queryNotAvailable !== '',\n noauth: qres.noAuthorization !== ''\n }\n\n let meta = {}\n qres.meta.header.metadata.forEach((e) => {\n let ch = e.fieldname.substring(0,2) === 'ch'\n meta[e.fieldname] = {\n key: ch ? e.basedinfoobject : e.elementid,\n value: e.scrtext\n }\n })\n // let cube = qres.meta.header.metadata.map((e) => {\n // let d = []\n // let type = e.fieldname.substring(0,2)\n // for (let row of qres.cube.row) {\n // if (type === 'ch') d.push({key: row[e.fieldname].$.key, text: row[e.fieldname]._})\n // else if (type === 'kf') d.push({unit: row[e.fieldname].$.u, value: row[e.fieldname]._})\n // }\n // return {\n // oldid: e.fieldname,\n // type: type === 'kf' ? 'value' : type === 'ch' ? 'category' : type,\n // elementid: e.elementid,\n // baseinfoobject: e.basedinfoobject, // type in webservice, should be base not based\n // isstructure: e.isstructure !== '',\n // text: e.scrtext,\n // structureid: e.structureid,\n // technicalname: e.technicalName,\n // data: d\n // }\n // })\n // let meta = qres.meta.header.metadata.map((e) => {\n // let type = e.fieldname.substring(0,2)\n // return {\n // value: (type === 'ch' ? e.basedinfoobject : e.elementid),\n // text: e.srctext\n // }\n // }\n //\n console.log('metadata', meta)\n let cube = qres.cube.row.map((e) => {\n let obj = {}\n for (let k in e) {\n // let meta = qres.meta.header.metadata.find(el => el.fieldname === k)\n let ch = k.substring(0,2) === 'ch'\n obj[k] = ch ? {key: e[k].$.key, value: e[k]._} : {key: meta[k].key, value: e[k]._, unit: e[k].$.u}\n }\n return obj\n })\n\n let filters = qres.filters.filterdescrstr.map(e => ({\n id: e.infoobject,\n from: {key: e.key, value: e.value},\n to: {key: e.keyHigh, to: e.valueHigh}\n }))\n\n let variables = qres.variabs.vardescrstr.map(e => ({\n id: e.vnam,\n from: {key: e.key, value: e.value},\n to: {key: e.keyHigh, to: e.valueHigh}\n }))\n\n return {query: query, meta: meta, cube: cube, filters: filters, variables: variables}\n }", "function getProfile(results, callback) {\n async.concatSeries(results.object, getEachProfile, callback)\n }", "function addResult(player) {\n var winner = new Winner(player);\n results.unshift(winner);\n}", "function addToResults(tracks)\r\n{\r\n\tresults[results.length] = tracks;\r\n}", "function assembleDatums(_result) {\n // *** //\n var obj = {};\n\n _result.forEach(function (d) {\n var id = Object.keys(d)[0];\n\n obj[id] = d[id];\n });\n\n _result = obj;\n\n var _totalNum = 0;\n //Get event and time\n for (var caseId in _result) {\n if (_result.hasOwnProperty(caseId) && _result[caseId] !== \"\" && caseList.indexOf(caseId) !== -1) {\n var _datum = jQuery.extend(true, {}, datum);\n _datum.case_id = _result[caseId].case_id;\n _datum.time = _result[caseId].months;\n _datum.status = _result[caseId].status;\n if (_datum.time !== \"NA\" && (_datum.status !== \"NA\" && typeof _datum.status !== \"undefined\" && _datum.status !== undefined)) {\n datumArr.push(_datum);\n _totalNum += 1;\n }\n }\n }\n // *** //\n //Sort by time\n cbio.util.sortByAttribute(datumArr, \"time\");\n //Set num at risk\n for (var i in datumArr) {\n datumArr[i].num_at_risk = _totalNum;\n _totalNum += -1;\n }\n }", "retrieve() {\n var self = this;\n $.ajax($.extend(this.XHROpts,{success: [function(data) { self.results = data; },self.xhrResultsHandler]}));\n }", "function loadSingleData (results) {\n\t\t\tself.isWaiting = false;\n\t\t\tself.error = null;\n\n\t\t\tself.totalRecordCount = 1;\n\t\t\tself.dataResolvingParams.total(1);\n\n\t\t\tself.data = [];\n\t\t\tself.data.push(results);\n\t\t\tself.defer.resolve(results.data);\n\t\t}", "function cleanupResults(res) {\n var o = {};\n for (var k in res) {\n if (k == 'JourneyDateTime') {\n o[k] = new Date(res[k][0]);\n\t\t} else if (k == 'RealTime' && res[k][0] != '') { // lets remove a couple levels of complexity\n\t\t\to[k] = res[k][0].RealTimeInfo.map(cleanupResults)[0];\n } else {\n o[k] = res[k][0];\n }\n }\n return o;\n}", "function processResult(json) {\n\n var ret = {};\n\n ret.id = json.uuid;\n ret.name = json.name;\n ret.handle = json.handle;\n ret.type = json.type;\n ret.copyrightText = json.copyrightText;\n ret.introductoryText = json.introductoryText;\n ret.shortDescription = json.shortDescription;\n if (typeof json.permission !== 'undefined') {\n ret.canAdminister = json.permission.canAdminister;\n }\n ret.countItems = json.countItems;\n var logo = {};\n if (json.logo !== null) {\n logo.id = json.logo.uuid;\n logo.retrieveLink = json.logo.retrieveLink;\n logo.sizeBytes = json.logo.sizeBytes;\n logo.mimeType = json.logo.mimeType;\n\n }\n ret.logo = logo;\n\n var collections = [];\n var itemTotal = 0;\n for (var i = 0; i < json.collections.length; i++) {\n\n var tmp = {};\n tmp.id = json.collections[i].id;\n tmp.name = json.collections[i].name;\n tmp.handle = json.collections[i].handle;\n tmp.type = json.collections[i].type;\n tmp.copyrightText = json.collections[i].copyrightText;\n tmp.introductoryText = json.collections[i].introductoryText;\n tmp.shortDescription = json.collections[i].shortDescription;\n tmp.numberItems = json.collections[i].numberItems;\n collections[i] = tmp;\n\n // increment total item count\n itemTotal += tmp.numberItems;\n\n }\n ret.items = collections;\n ret.itemTotal = itemTotal;\n\n return ret;\n }", "copy() {\n return new Item(points, image, string);\n }", "function createIterResultObject(value, done) {\n\t\t// 1. Assert: Type(done) is Boolean.\n\t\tif (typeof done !== 'boolean') {\n\t\t\tthrow new Error();\n\t\t}\n\t\t// 2. Let obj be ObjectCreate(%ObjectPrototype%).\n\t\tvar obj = {};\n\t\t// 3. Perform CreateDataProperty(obj, \"value\", value).\n\t\tobj.value = value;\n\t\t// 4. Perform CreateDataProperty(obj, \"done\", done).\n\t\tobj.done = done;\n\t\t// 5. Return obj.\n\t\treturn obj;\n\t}", "function normalize(result) {\n return {\n relevance: result.relevance || 0,\n language: result.language || null,\n value: result.value || []\n };\n}", "function Metrics(results) {\n Metrics.results.push(results);\n}", "returnResults(results){\n var self = this,\n allData = self.insert,\n length = results.length,\n last = results.length -1,\n seconds = self.time,\n selector = self.result;\n\n for(var y = 0 ; y < length; y++){\n if( y === last){\n allData += results[y];\n continue;\n }\n\n allData += (y % 5 == 0)?results[y]+\",\\n\":results[y]+\",\";\n\n }\n seconds = self.seconds(seconds,Date.now());\n $(selector).innerHTML = allData;\n $(selector).style.display = \"block\";\n $(self.timeOutput).innerHTML = seconds+\" seconds\";\n}", "function CreateIterResultObject(value, done) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(done) is Boolean.\n\t\tif (Type(done) !== 'boolean') {\n\t\t\tthrow new Error();\n\t\t}\n\t\t// 2. Let obj be ObjectCreate(%ObjectPrototype%).\n\t\tvar obj = {};\n\t\t// 3. Perform CreateDataProperty(obj, \"value\", value).\n\t\tCreateDataProperty(obj, \"value\", value);\n\t\t// 4. Perform CreateDataProperty(obj, \"done\", done).\n\t\tCreateDataProperty(obj, \"done\", done);\n\t\t// 5. Return obj.\n\t\treturn obj;\n\t}", "async getAllResults() {\n const results = await dbContext.Results.find().populate('profile', 'name picture').populate('game', 'name')\n return results\n }", "function updateResult(changedEntity = null) {\n\t\t\tif (changedEntity && changedEntity[\"meta\"]) {\n\t\t\t\tresult.entities[changedEntity[\"name\"]] = changedEntity[\"meta\"];\n\t\t\t}\n\n\t\t\tresult.isLoading = false;\n\t\t\tresult.loadingError = false;\n\t\t\tentities.forEach(function (entityName) {\n\t\t\t\tlet entityMeta = _store.entities[entityName].meta\n\t\t\t\tresult.isLoading = result.isLoading || entityMeta.isLoading;\n\t\t\t\tresult.loadingError = result.loadingError || entityMeta.loadingError;\n\t\t\t\tresult.lastLoadAttempt = Math.max(result.lastLoadAttempt, entityMeta.lastLoadAttempt);\n\t\t\t\tresult.lastSuccessfulLoad = Math.max(result.lastSuccessfulLoad, entityMeta.lastSuccessfulLoad);\n\t\t\t});\n\n\t\t\tcallback(result); // Return full result to the caller of getAll\n\t\t}", "function processResults (spotifyResults) {\n searchResults = []; // actually stores the song objects. only has unique results. is indexed 0,1,2...\n // the found hash maps from songNames to an index to this array\n var found = {}\n\n for (var res in spotifyResults.tracks) {\n var songResult = spotifyResults.tracks[res];\n var songName = getSongName(songResult);\n var songArtist = getSongArtist(songResult);\n var songString = songName + songArtist;\n if (songString in found) {\n // see if availability is now true (assuming US only)\n if (isSongAvailable(songResult,'US')) {\n // since it is, we want to update the result to reflect this change\n addSongAvailable(searchResults[found[songString]], 'US');\n setSongLink(searchResults[found[songString]], getSongLink(songResult));\n }\n } \n else {\n // add to the found list\n found[songString] = searchResults.length;\n searchResults.push(songResult);\n }\n } \n}", "function normalize(result) {\n return {\n relevance: result.relevance || 0,\n language: result.language || null,\n value: result.value || []\n }\n}", "dataParserMatch(data) {\n console.log(data);\n this.dataMatch = data;\n for (var i = 0; i < data.results; i++) {\n this.dataMatch.response[i] = data.response[i];\n this.tabIntReponse[i] = i;\n }\n }", "copyXYZW() {\nreturn RQ.copyOfQV(this.xyzw);\n}", "function _toPipeline() {\n var oReturn = {\n toArray: function() {\n return aLastResults.map(function(o) {\n return o.$element.get(0);\n });\n },\n pipe: pipe\n };\n\n // add plugin functions to pipeline object\n aPlugins.forEach(function(oPlugin) {\n oReturn[oPlugin.name] = function() {\n _invokePlugin(oPlugin, aLastResults);\n return _toPipeline();\n };\n });\n\n _populateSearchTargetVariables(oReturn, aLastResults);\n\n // borrow properties/functions from Array.prototype\n // TODO: should I just copy directly from aLastResults?\n Object.getOwnPropertyNames(Array.prototype).slice(0).filter(function(o) {\n return jQuery.isFunction(Array.prototype[o]);\n }).forEach(function(sFunctionName) {\n oReturn[sFunctionName] = jQuery.proxy(Array.prototype[sFunctionName], _toControl(aLastResults));\n });\n oReturn.length = oReturn.toArray().length;\n\n return oReturn;\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "function loadResults(){\n //console.log(\"loadQuantity\");\n var $results = $('.' + _results);\n for(var i = 0; i < $results.length; i++){\n var $result = $($results[i]);\n var datas = $result.data();\n if (!datas[_resController]\n || !datas[_resTempHeader]\n || !datas[_resTempHeaderId]\n || !datas[_resTempItem]\n || !datas[_resTempItemId]\n || !datas[_resTempPagination]\n || !datas[_resTempPaginationId]) {\n throw Error(\"Resuts \" + _results + \" do not define datas correctly\");\n }\n\n var ctxt = {\n \"_resTempHeaderId\": _resTempHeaderId,\n \"_resTempItemId\": _resTempItemId,\n \"_resTempPaginationId\": _resTempPaginationId\n };\n var jCookie = getJCookie(_cookieName);\n var jResources = jCookie[_jResources];\n if (jResources) {\n var ids = Object.keys(jResources).join(\"|\");\n ctxt[\"ids\"] = ids;\n $.get(datas[_resController], ctxt)\n .done(function(data){\n $('#' + ctxt[_resTempHeaderId]).empty().append(data);\n $('#' + ctxt[_resTempItemId]).append(data);\n $('#' + ctxt[_resTempPaginationId]).empty().append(data);\n })\n .fail(function(err){\n console.error(\"loading resources\", ctxt, err);\n })\n }\n }\n }", "reset(resultsTree, identityAccessor) {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this;\n self.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }", "reset(resultsTree, identityAccessor) {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this;\n self.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }", "reset(resultsTree, identityAccessor) {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this;\n self.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }", "reset(resultsTree, identityAccessor) {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this;\n self.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }", "reset(resultsTree, identityAccessor) {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this;\n self.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }" ]
[ "0.6646897", "0.66429925", "0.63339907", "0.62893623", "0.61651933", "0.6069167", "0.60538733", "0.598137", "0.5975113", "0.5875084", "0.5773404", "0.5731083", "0.57191104", "0.5700195", "0.563671", "0.56353885", "0.5633537", "0.5618694", "0.56153715", "0.56085706", "0.5589457", "0.55307674", "0.55225766", "0.5512245", "0.5506395", "0.55008966", "0.54915565", "0.54843116", "0.547082", "0.54679364", "0.54500663", "0.5449073", "0.54366434", "0.542133", "0.5391866", "0.5381794", "0.5378947", "0.537341", "0.5368325", "0.5363628", "0.53568876", "0.5355363", "0.5330123", "0.5324338", "0.53237027", "0.5315352", "0.5313192", "0.5298665", "0.529602", "0.5291355", "0.528631", "0.5285689", "0.52721506", "0.52711535", "0.5269195", "0.52577496", "0.5254017", "0.5249209", "0.5245506", "0.5243824", "0.52376", "0.5229413", "0.52288514", "0.5227463", "0.52250683", "0.5224831", "0.5224831", "0.5224831", "0.5224831", "0.5224831", "0.5224831", "0.5217656", "0.52132636", "0.5202006", "0.5197224", "0.51806617", "0.5179316", "0.5174772", "0.51710516", "0.51586074", "0.51519805", "0.51477474", "0.5145317", "0.5144866", "0.51338965", "0.5130463", "0.5127017", "0.5117621", "0.5112846", "0.5111853", "0.51103646", "0.5107905", "0.51058465", "0.5104851", "0.5102307", "0.51006603", "0.51006603", "0.51006603", "0.51006603", "0.51006603" ]
0.6772009
0
checks if this error is fixable, and fixes it
function fixError(r, code) { // call fix function if (errors.hasOwnProperty(r.raw)) { errors[r.raw].fix(r, code); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixError() {\n /* exploit = \"installFix\";\n switch (checkFw()) {\n case \"7.02\":\n localStorage.setItem(\"exploit702\", SCMIRA702(\"miraForFix\"));\n document.location.href = \"mira.html\";\n break;\n case \"6.72\":\n let func2 = SCMIRA(\"c-code\");\n let func1 = SCMIRA(\"MiraForFix\");\n newScript(func1);\n newScript(func2);\n setTimeout(function () {\n loadPayload(\"Todex\");\n }, 8000);\n break;\n }*/\n}", "function _fix(error) {\n if (error.errors) {\n if (!Array.isArray(error.errors)) {\n error.errors = Object.keys(error.errors)\n .map(function (_key) {\n return { field: _key, failure: error.errors[_key] };\n });\n }\n\n return error.errors.map(function (err) {\n return _fix(err)[0];\n });\n }\n\n return [{\n stack: _isDebug && error.stack || undefined,\n field: error.field || undefined,\n failure: error.failure || undefined,\n message: error.message || error.description || error\n }];\n }", "function isFixed(file) {\n return file.eslint != null && file.eslint.fixed;\n}", "function isFixed(file) {\n return file.eslint !== undefined && file.eslint !== null && file.eslint.fixed;\n }", "function fixMyJS(data, src, options) {\n var code = new Code(src);\n var warnings = data.errors || [];\n var results = [];\n var config = data.options || {};\n var current = 0;\n\n// merge custom options into config\n if (options) {\n Object.keys(options).forEach(function (option) {\n config[option] = options[option];\n });\n }\n\n function resetResults() {\n var dupes = {};\n// Filter out errors we don't support.\n// If the error is null then we immediately return false\n// Then we check for duplicate errors. Sometimes JSHint will complain\n// about the same thing twice. This is a safeguard.\n// Otherwise we return true if we support this error.\n results = warnings.filter(function (v) {\n if (!v) {\n return false;\n }\n\n var err = 'line' + v.line +\n 'char' + v.character +\n 'reason' + v.reason;\n\n if (dupes.hasOwnProperty(err)) {\n return false;\n }\n dupes[err] = v;\n\n if (v.hasOwnProperty('fixable')) {\n return v.fixable;\n }\n\n return (v.fixable = errors.hasOwnProperty(v.code));\n });\n\n// sorts errors by priority.\n results.sort(byPriority);\n }\n\n resetResults();\n\n\n// fixMyJS API\n//\n// * getErrors\n// * getAllErrors\n// * getCode\n// * next\n// * fix\n// * getDetails\n// * run\n var api = {\n// returns are supported errors that can be fixed.\n getErrors: function () {\n return results.slice(0);\n },\n\n getAllErrors: function () {\n return warnings.slice(0);\n },\n\n// returns the current state of the code.\n getCode: function () {\n return code.getCode();\n },\n\n// Iterator method. Returns Boolean if there is a next item\n//\n// Example:\n// while (af.hasNext()) {\n// var a = af.next();\n// }\n hasNext: function () {\n return (current < results.length);\n },\n\n// Iterator method. Iterates through each error in the\n// Array and returns an Object with fix and getDetails methods.\n// if the end of the Array is reached then an error is thrown.\n//\n// fix function will fix the current error and return the state of the code.\n// getDetails will return a prototype of the current error's details\n next: function () {\n if (!this.hasNext()) {\n throw new Error('End of list.');\n }\n\n var r = copyResults(results[current], config);\n var data = {\n fix: function () {\n fixError(r, code);\n return code.getCode();\n },\n fixVerbose: function () {\n return {\n original: code._src[r.line],\n replacement: fixError(r, code)\n };\n },\n getDetails: function () {\n return Object.create(r);\n }\n };\n current += 1;\n return data;\n },\n\n filterErrors: function (fn) {\n warnings = warnings.map(function (w) {\n w.fixable = fn(w);\n return w;\n });\n resetResults();\n return warnings.slice(0);\n },\n\n// runs through all errors and fixes them.\n// returns the fixed code.\n//\n// **returnErrors** Boolean - true if you'd like an Array of all errors\n// with the proposed fix.\n//\n// returns the code String || an Array of JSHint errors.\n run: function (returnErrors) {\n if (returnErrors) {\n return warnings\n .slice(0)\n .sort(byPriority)\n .map(function (v) {\n v.fixable && (v.fix = fixError(copyResults(v, config), code));\n return v;\n });\n } else {\n results.forEach(fixErrors(code, config));\n return code.getCode();\n }\n },\n\n runVerbose: function () {\n var lint = [];\n var dup = {};\n var next;\n while (api.hasNext()) {\n next = api.next();\n lint.push(copyResults(next.fixVerbose(), next.getDetails()));\n }\n return lint.reverse().filter(function (x) {\n if (dup.hasOwnProperty(x.original)) {\n return false;\n }\n x.line = x.config.line;\n dup[x.original] = x;\n return true;\n });\n }\n };\n\n return api;\n }", "function isFixed(file) {\n // Has ESLint fixed the file contents?\n return autoFix && file.eslint != null && file.eslint.fixed;\n}", "fixProblem(\n editor,\n range,\n fix,\n getFunctionsMatchingTypeFunction,\n showFunctionsMatchingTypeFunction\n ) {\n switch (fix.type) {\n case 'Replace with':\n editor.setTextInBufferRange(fix.range ? fix.range : range, fix.text);\n break;\n\n case 'Add type annotation':\n // Insert type annotation above the line.\n const leadingSpaces = new Array(range.start.column).join(' ');\n editor.setTextInBufferRange(\n [range.start, range.start],\n fix.text + '\\n' + leadingSpaces\n );\n // Remove type annotation marker, if any.\n const markers = editor.findMarkers({\n fixType: 'Add type annotation',\n fixRange: range,\n });\n if (markers) {\n markers.forEach(marker => {\n marker.destroy();\n });\n }\n break;\n\n case 'Remove unused import':\n editor.buffer.deleteRow(range.start.row);\n break;\n\n case 'Add import':\n // Insert below the last import, or module declaration (unless already imported (as when using `Quick Fix All`)).\n let alreadyImported = false;\n const allImportsRegex = /((?:^|\\n)import\\s([\\w\\.]+)(?:\\s+as\\s+(\\w+))?(?:\\s+exposing\\s*\\(((?:\\s*(?:\\w+|\\(.+\\))\\s*,)*)\\s*((?:\\.\\.|\\w+|\\(.+\\)))\\s*\\))?)+/m;\n editor.scanInBufferRange(\n allImportsRegex,\n [[0, 0], editor.getEofBufferPosition()],\n ({ matchText, range, stop }) => {\n if (!new RegExp('^' + fix.text + '$', 'm').test(matchText)) {\n const insertPoint = range.end.traverse([1, 0]);\n editor.setTextInBufferRange(\n [insertPoint, insertPoint],\n fix.text + '\\n'\n );\n }\n alreadyImported = true;\n stop();\n }\n );\n if (!alreadyImported) {\n const moduleRegex = /(?:^|\\n)((effect|port)\\s+)?module\\s+([\\w\\.]+)(?:\\s+exposing\\s*\\(((?:\\s*(?:\\w+|\\(.+\\))\\s*,)*)\\s*((?:\\.\\.|\\w+|\\(.+\\)))\\s*\\))?(\\s*^{-\\|([\\s\\S]*?)-}\\s*|)/m;\n editor.scanInBufferRange(\n moduleRegex,\n [[0, 0], editor.getEofBufferPosition()],\n ({ range, stop }) => {\n const insertPoint = range.end.traverse([1, 0]);\n editor.setTextInBufferRange(\n [insertPoint, insertPoint],\n '\\n' + fix.text + '\\n'\n );\n alreadyImported = true;\n stop();\n }\n );\n }\n if (!alreadyImported) {\n editor.setTextInBufferRange([[0, 0], [0, 0]], fix.text + '\\n');\n }\n break;\n\n case 'Add missing patterns':\n editor.transact(() => {\n const leadingSpaces =\n new Array(fix.range.start.column + 1).join(' ') +\n helper.tabSpaces();\n editor.setCursorBufferPosition(fix.range.end);\n const patternsString = fix.patterns\n .map(pattern => {\n return (\n '\\n\\n' +\n leadingSpaces +\n pattern +\n ' ->\\n' +\n leadingSpaces +\n helper.tabSpaces() +\n 'Debug.crash \"TODO\"'\n );\n })\n .join('');\n editor.insertText(patternsString);\n });\n break;\n\n case 'Remove redundant patterns':\n // TODO\n break;\n\n case 'Fix module name':\n atom.workspace.open(fix.filePath).then(editor => {\n editor.scanInBufferRange(\n /(?:^|\\n)((?:(?:effect|port)\\s+)?module(?:\\s+))(\\S+)\\s/,\n [[0, 0], editor.getEofBufferPosition()],\n ({ match, range, replace, stop }) => {\n if (match && match.length > 1) {\n const prefix = match[1];\n replace(prefix + fix.text + ' ');\n editor.setCursorBufferPosition([\n range.start.row,\n range.start.column + prefix.length + fix.text.length,\n ]);\n stop();\n }\n }\n );\n });\n break;\n\n case 'Run `elm package install`':\n helper.runElmPackageInstall(fix.directory);\n break;\n\n case 'Define top-level':\n if (fix.filePath) {\n if (fs.existsSync(fix.filePath)) {\n atom.workspace.open(fix.filePath).then(editor => {\n editor.transact(() => {\n editor.setCursorBufferPosition(editor.getEofBufferPosition());\n editor.insertText('\\n\\n' + fix.name + ' =\\n ');\n });\n });\n } else {\n fs.writeFileSync(\n fix.filePath,\n 'module ' +\n fix.moduleName +\n ' exposing (..)\\n\\n' +\n fix.name +\n ' =\\n '\n );\n atom.notifications.addInfo('Created ' + fix.filePath, {\n dismissable: true,\n });\n atom.workspace.open(fix.filePath).then(editor => {\n editor.setCursorBufferPosition(editor.getEofBufferPosition());\n });\n }\n } else {\n let topLevelEnd = editor.getEofBufferPosition();\n if (fix.kind !== 'type') {\n // Look for next top-level position.\n editor.scanInBufferRange(\n helper.blockRegex(),\n [range.end, editor.getEofBufferPosition()],\n ({ matchText, range, stop }) => {\n stop();\n topLevelEnd = range.start;\n }\n );\n }\n const atEndOfFile = topLevelEnd.isEqual(\n editor.getEofBufferPosition()\n );\n editor.transact(() => {\n editor.setCursorBufferPosition(topLevelEnd);\n editor.insertText(\n (atEndOfFile ? '\\n\\n' : '') +\n (fix.kind === 'type' ? 'type ' : '') +\n fix.name +\n (fix.kind === 'type' ? '\\n = ' : ' =\\n ') +\n '\\n\\n\\n'\n );\n editor.setCursorBufferPosition([\n topLevelEnd.row + (atEndOfFile ? 3 : 1),\n fix.kind === 'type' ? 6 : 4,\n ]);\n });\n }\n break;\n\n case 'Change type annotation':\n editor.backwardsScanInBufferRange(\n typeAnnotationRegex(fix.name),\n [range.start, [0, 0]],\n ({ stop, range, replace }) => {\n stop();\n replace(fix.text + '\\n' + fix.name);\n editor.setCursorBufferPosition(range.start);\n }\n );\n break;\n\n case 'Search for functions matching type':\n if (getFunctionsMatchingTypeFunction) {\n const projectDirectory = helper.lookupElmPackage(\n path.dirname(fix.filePath),\n fix.filePath\n );\n getFunctionsMatchingTypeFunction(\n fix.text,\n projectDirectory,\n fix.filePath\n ).then(functions => {\n showFunctionsMatchingTypeFunction(editor, range, functions);\n });\n }\n break;\n\n case 'Convert to port module':\n let moduleNameRange = null;\n editor.scanInBufferRange(\n helper.moduleNameRegex(),\n [[0, 0], editor.getEofBufferPosition()],\n ({ matchText, range, stop, replace }) => {\n moduleNameRange = range;\n replace('port ' + matchText);\n editor.setCursorBufferPosition(moduleNameRange.start);\n stop();\n }\n );\n if (moduleNameRange) {\n } else {\n editor.buffer.setTextViaDiff(\n 'port module Main exposing (..)' + '\\n\\n' + editor.getText()\n );\n editor.setCursorBufferPosition([0, 0]);\n }\n break;\n }\n }", "function fixError(r, code) {\n return errors[r.code](r, code);\n }", "function isFixed(file) {\n\t\tif (file.eslint != null && file.eslint.fixed) {\n\t\t\tfixed.push(file.path);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "fixErrorLocation(error) {\n error.index = this.locationMap.remapIndex(error.index);\n\n const loc = this.microTemplateService.getLocFromIndex(error.index);\n error.lineNumber = loc.line;\n error.column = loc.column + 1;\n }", "rethrowNonDiagnosticError(error) {\n if (!error.isDiagnostic) {\n throw error;\n }\n }", "toAbsolutePositionFix(node, ruleErrorObject) {\n const nodeRange = node.range;\n // if not found `fix`, return empty object\n if (ruleErrorObject.fix === undefined) {\n return {};\n }\n assert_1.default.ok(typeof ruleErrorObject.fix === \"object\", \"fix should be FixCommand object\");\n // if absolute position return self\n if (ruleErrorObject.fix.isAbsolute) {\n return {\n // remove other property that is not related `fix`\n // the return object will be merged by `Object.assign`\n fix: {\n range: ruleErrorObject.fix.range,\n text: ruleErrorObject.fix.text\n }\n };\n }\n // if relative position return adjusted position\n return {\n // fix(command) is relative from node's range\n fix: {\n range: [\n nodeRange[0] + ruleErrorObject.fix.range[0],\n nodeRange[0] + ruleErrorObject.fix.range[1]\n ],\n text: ruleErrorObject.fix.text\n }\n };\n }", "async fixLint() {\n try {\n await execa(path.join('node_modules', '.bin', 'eslint'), ['--fix', '.']);\n } catch (e) {\n return;\n }\n }", "function updateShelterError(error) {\n vm.error = \"Could not update shelter at this time. Please try again later.\";\n scrollToError();\n }", "function handleError(error) {\n if (error && error.name === 'SheetrockError') {\n if (request && request.update) {\n request.update({ failed: true });\n }\n }\n\n if (userOptions.callback) {\n userOptions.callback(error, options, response);\n return;\n }\n\n if (error) {\n throw error;\n }\n }", "function fixUpInsertionPoint() {\n moveIPToOutsideOfParagraphToPreventInvalidHTML();\n backUpCursorIfAfterNonBreakingSpaceInTableCell();\n}", "fix(key, parent, schema) {\n if (schema.hidden) {\n return;\n }\n // Fixes for each type/condition, can be added below.\n const value = parent[key];\n // Recursive calls\n if (schema.type === 'object') {\n if (!schema.properties) {\n throw new Error(`\"${key}\"'s schema has \"type\": \"object\" but doesn't specify \"properties\"`);\n }\n else if (!(value instanceof Object)) {\n throw new Error(`\"${key}\" in ${JSON.stringify(value, null, 2)} is specified as \"object\" by schema but it is not an object in json`);\n }\n // Looping over record to filter out fields that are not in schema.\n Object.keys(value).forEach(prop => {\n if (!schema.properties[prop]) {\n // we don't like fields without schema!\n this.deleteField(value, prop);\n }\n else {\n this.fix(prop, value, schema.properties[prop]);\n }\n });\n }\n else if (schema.type === 'array') {\n if (!schema.items) {\n throw new Error(`\"${key}\"'s schema has \"type\": \"array\" but doesn't specify \"items\"`);\n }\n else if (!Array.isArray(value)) {\n throw new Error(`\"${key}\" in ${JSON.stringify(value, null, 2)} is specified as \"array\" by schema but it is not an array in json`);\n }\n value.forEach((element, index) => {\n this.fix(index, value, schema.items);\n });\n }\n }", "function checkAndFixHTML($this, options){\n\t\t// Check html here\n\t\tvar temp = document.getElementById($this.attr(\"id\"));\n\t\t\n\t\tif(temp.nodeName != \"DIV\"){ // REMOVE\n\t\t\tconsole.log(\"WARNING: outer element in menu is not a div, this can cause problems on autocorrection\"); // <a> = \"A\", <ul> = \"UL\", <div> = \"DIV\"\n\t\t}\n\t\t\n\t\tif($this.children()[0].nodeName == \"UL\"){\n\t\t\tcheckAndFixUl(temp.childNodes[1], options);\n\t\t}else{\n\t\t\tconsole.log(\"ERROR: you appear to be missing an outer <ul> element inside your menu containing div(\" + $this.attr(\"id\") + \"), make sure that \" +\n\t\t\t\"you do not have any other elements between the <div> and the <ul>, aborting autocorrection\");\n\t\t}\n\t\t\n\t}", "repair(log) {\n log = (log !== undefined ? log : util_1.Util.nullLogger);\n if (!this.validateId(this.id)) {\n return false; // can't be helped\n }\n if (!this.validateForm(this.form)) {\n log('repair: blanking invalid FORM');\n this.form = '<ERROR>';\n }\n if (this.isMultiword) {\n // valid as long as everything is blank\n this.lemma = '_';\n this.upostag = '_';\n this.xpostag = '_';\n this.feats = '_';\n this.head = '_';\n this.deprel = '_';\n this.deps = '_';\n // this.misc = '_';\n return true;\n }\n // if we're here, not a multiword token.\n if (!this.validateLemma(this.lemma)) {\n log('repair: blanking invalid LEMMA');\n this.lemma = '<ERROR>';\n }\n if (!this.validateUpostag(this.upostag)) {\n log('repair: blanking invalid UPOSTAG');\n this.upostag = '_'; // TODO: not valid\n }\n if (!this.validateXpostag(this.xpostag)) {\n log('repair: blanking invalid XPOSTAG');\n this.xpostag = '_';\n }\n if (!this.validateFeats(this.feats)) {\n log('repair: blanking invalid FEATS ' + this.toConllU(false));\n this.feats = '_';\n }\n if (!this.validateHead(this.head)) {\n log('repair: blanking invalid HEAD');\n this.head = \"\"; // note: exceptional case\n }\n if (!this.validateDeprel(this.deprel)) {\n log('repair: blanking invalid DEPREL');\n this.deprel = '_'; // TODO: not valid\n }\n if (!this.validateDeps(this.deps)) {\n log('repair: blanking invalid DEPS');\n this.deps = '_';\n }\n if (!this.validateMisc(this.misc)) {\n log('repair: blanking invalid MISC');\n this.misc = '_';\n }\n var issues = this.validate();\n return issues.length === 0;\n }", "function handleErrors(error) {\n console.log('Please try again problem occured!');\n}", "function u(e){return-1<Object.prototype.toString.call(e).indexOf(\"Error\")}", "function reportError(error) {\n errorArea.fillError(error).eachErrorHighlight(function(start, end, i) {\n errorHelpMarks.mark(start, end, \"highlight-\" + (i+1), this);\n });\n }", "function has_bugs(buggy_code) {\n if (buggy_code) {\n return 'sad days'\n } else {\n return 'it\\'s a good day'\n }\n }", "function fixSyntaxHighlighting () {\n var sts = document.querySelectorAll('.err');\n Array.prototype.forEach.call(sts, function (st) {\n if (st.textContent === '`' || st.textContent === ':') {\n st.classList.remove('err');\n }\n })\n}", "function isFixed(name, target) {\n return ({}).hasOwnProperty.call(target, name);\n}", "function isFixed(name, target) {\n return ({}).hasOwnProperty.call(target, name);\n}", "applyLintErrors(parsedMarkdown, notGorgonLintErrors) {\n // These lint errors do not have position data associated with\n // them, so we just plop them at the top.\n if (notGorgonLintErrors.length) {\n var errorText = notGorgonLintErrors.join(\"\\n\\n\");\n parsedMarkdown.unshift({\n content: {\n type: \"text\",\n content: \"\"\n },\n insideTable: false,\n message: errorText,\n ruleName: \"legacy-error\",\n severity: Rule.Severity.ERROR,\n type: \"lint\"\n });\n }\n }", "function checkAndFixLi($this, options){\n\t\tvar children = $this.childNodes;\n\t\t\n\t\tif(children.length <= 0){\n\t\t\t// the <li> element does not contain any information at all...\n\t\t\tconsole.log(\"WARNING: one of your <li>-elements does not contain any information at all\");\n\t\t}\n\t\t\n\t\tfor(var kid in children){\n\t\t\tif(children[kid].nodeName == \"#text\" || children[kid].nodeName == undefined){\n\t\t\t\t// perhaps do something here\n\t\t\t} else if(children[kid].nodeName == \"A\"){ // check here for what element this is and if it is one that is allowed/make sense\n\t\t\t\tcheckAndFixAnchor(children[kid], options);\n\t\t\t}else if(children[kid].nodeName == \"IMG\"){\n\t\t\t\tconsole.log(\"fixing img element\");\n\t\t\t\tcheckAndFixImg(children[kid], options);\n\t\t\t} else if(children[kid].nodeName == \"UL\"){\n\t\t\t\tcheckAndFixUl(children[kid], options);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"WARNING: one child is an unknown/not allowed type: \" + children[kid].nodeName + \" removes it\");\n\t\t\t\tchildren[kid].parentNode.removeChild(children[kid]); // has to use this ugly solution for internet explorer\n\t\t\t\t// children[kid].remove(); // if one wants to keep the data and events, use .detach() instead\n\t\t\t}\n\t\t}\n\t}", "function checkForErrorByIndex(state, index, newValue) {\n return state.solution[index] !== newValue;\n}", "function getSafeCause (errorObj) {\n var cause = errorObj.cause || errorObj\n if (cause instanceof Error) {\n var safeCopy = {}\n Object.getOwnPropertyNames(cause).forEach(function (prop) {\n safeCopy[prop] =\n prop === 'stack' || prop === 'rhinoException'\n ? cause[prop].toString()\n : cause[prop]\n })\n cause = safeCopy\n }\n return cause\n }", "function croak(err) {\n throw new Error(`${err} (${line}:${col})`);\n }", "function fixElement(elementId) {\n\t\t\telementToFix = document.getElementById(elementId);\n\t\t\tscrollY = window.pageYOffset;\n\n\t\t\tif(elementToFix.classList.contains('js-fixed')) {\n\t\t\t\tremoveClass(elementToFix,'js-fixed');\n\t\t\t\telementToFix.style.top = '';\n\t\t\t\tscrollToTarget(0,scrollYMem);\n\t\t\t} else {\n\t\t\t\taddClass(elementToFix,'js-fixed');\n\t\t\t\telementToFix.style.top = '-' + scrollY + 'px';\n\t\t\t\tscrollYMem = scrollY;\n\t\t\t}\n\t\t}", "function Fl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "adjust(reportArgs) {\n const { node, ruleError, ruleId } = reportArgs;\n const errorPrefix = `[${ruleId}]` || \"\";\n const padding = ruleError;\n /*\n FIXME: It is old and un-document way\n new RuleError(\"message\", index);\n */\n let _backwardCompatibleIndexValue;\n if (typeof padding === \"number\") {\n _backwardCompatibleIndexValue = padding;\n feature_flag_1.throwIfTesting(`${errorPrefix} This is un-document way:\nreport(node, new RuleError(\"message\", index);\n\nPlease use { index }: \n\nreport(node, new RuleError(\"message\", {\n index: paddingLineColumn\n});\n`);\n }\n // when running from textlint-tester, assert\n if (padding.line === undefined && padding.column !== undefined) {\n // FIXME: Backward compatible <= textlint.5.5\n feature_flag_1.throwIfTesting(`${errorPrefix} Have to use a sets with \"line\" and \"column\".\nSee FAQ: https://github.com/textlint/textlint/blob/master/docs/faq/line-column-or-index.md \n\nreport(node, new RuleError(\"message\", {\n line: paddingLineNumber,\n column: paddingLineColumn\n});\n\nOR use \"index\" property insteadof only \"column\".\n\nreport(node, new RuleError(\"message\", {\n index: paddingLineColumn\n});\n`);\n }\n // When either one of {column, line} or {index} is not used, throw error\n if ((padding.line !== undefined || padding.column !== undefined) && padding.index !== undefined) {\n // Introduced textlint 5.6\n // https://github.com/textlint/textlint/releases/tag/5.6.0\n // Always throw Error\n throw new Error(`${errorPrefix} Have to use one of {line, column} or {index}.\nYou should use either one:\n\nuse \"line\" and \"column\" property\n\nreport(node, new RuleError(\"message\", {\n line: paddingLineNumber,\n column: paddingLineColumn\n});\n\nOR \n\nuse \"index\" property\n\nreport(node, new RuleError(\"message\", {\n index: paddingIndexValue\n});\n`);\n }\n const adjustedLoc = this.toAbsoluteLocation(node, padding, _backwardCompatibleIndexValue);\n const adjustedFix = this.toAbsolutePositionFix(node, padding);\n /*\n {\n line,\n column\n fix?\n }\n */\n return Object.assign({}, adjustedLoc, adjustedFix);\n }", "function customFix(apiObject) {\n const paths = apiObject.paths;\n const security = apiObject.security;\n const conflict = {};\n\n Object.keys(paths).forEach(path => {\n Object.keys(paths[path]).forEach(method => {\n const obj = paths[path][method];\n obj.security = obj.security || security;\n //let id = customOperationId(path, method, obj.operationId);\n //if (conflict[id])\n // throw new Error(\n // `${method}:${path} operationId '${id}' conflict to ${conflict[id].method}:${conflict[id].path}`,\n // );\n //conflict[id] = { path, method };\n //obj.operationId = id;\n });\n });\n}", "async updateParentCodeError () {\n\t\tif (!this.codeError) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst now = Date.now();\n\t\tconst op = { \n\t\t\t$set: {\n\t\t\t\tnumReplies: (this.codeError.get('numReplies') || 0) + 1,\n\t\t\t\tlastReplyAt: now,\n\t\t\t\tlastActivityAt: now,\n\t\t\t\tmodifiedAt: now\n\t\t\t}\n\t\t};\n\n\t\t// handle any followers that need to be added to the code error, as needed\n\t\tawait this.handleFollowers(this.codeError, op, { ignorePreferences: true });\n\n\t\tthis.transforms.updatedCodeErrors = this.transforms.updatedCodeErrors || [];\n\t\tconst codeErrorUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.codeErrors,\n\t\t\tid: this.codeError.id\n\t\t}).save(op);\n\t\tthis.transforms.updatedCodeErrors.push(codeErrorUpdate);\n\t}", "function Unknown_SetAsFixedObject(theObject, bAdding)\n{\n\t//result (only valid when adding)\n\tvar result = false;\n\t//adding the fixed style?\n\tif (bAdding)\n\t{\n\t\t//must have html\n\t\tif (theObject.HTML)\n\t\t{\n\t\t\t//now create a fake container\n\t\t\ttheObject.HTMLFixedGhost = document.createElement(\"div\");\n\t\t\ttheObject.HTMLFixedGhost.InterpreterObject = theObject;\n\t\t\ttheObject.HTMLFixedGhost.id = \"FixedGhost_\" + theObject.HTML.id;\n\t\t\ttheObject.HTMLFixedGhost.style.cssText = \"position:fixed;\";\n\t\t\t//our html has a parent?\n\t\t\tif (theObject.HTML.parentNode)\n\t\t\t{\n\t\t\t\t//remove it from the parent\n\t\t\t\ttheObject.HTML.parentNode.removeChild(theObject.HTML);\n\t\t\t}\n\t\t\t//now put our html into the ghost\n\t\t\tresult = theObject.HTMLFixedGhost.appendChild(theObject.HTML);\n\t\t\t//now put the ghost into the parent\n\t\t\ttheObject.Parent.AppendChild(theObject.HTMLFixedGhost, true);\n\t\t}\n\t}\n\telse\n\t{\n\t\t//must have the ghost parent\n\t\tif (theObject.HTMLFixedGhost && theObject.HTMLFixedGhost.parentNode)\n\t\t{\n\t\t\t//to remove first remove our html from the ghost\n\t\t\ttheObject.HTMLFixedGhost.removeChild(theObject.HTML);\n\t\t\t//then remove the ghost from its parent\n\t\t\ttheObject.HTMLFixedGhost.parentNode.removeChild(theObject.HTMLFixedGhost);\n\t\t\t//now put our html parent into the real parent\n\t\t\ttheObject.Parent.AppendChild(theObject.HTML);\n\t\t}\n\t}\n\t//return the result (if we were adding)\n\treturn result;\n}", "errorListener(line) {\n verboseLog('ERROR'.red, line);\n this.emit('err', line);\n for (const {match, solution, name, message} of knownErrors) {\n if (line.match(match)) {\n errorLog(`Encountered ${name.red}. ${solution ? 'Known fix:\\n ' + solution : message || 'Unknown error.'}`);\n }\n }\n }", "function squash_errors() {\n if (error_list[0].type) {\n return;\n }\n\n // squask all un-type related errors\n var i;\n var err_data = error_list[0];\n for (i = 1; i < error_list.length; ++i) {\n if (!error_list[i].error.type) {\n err_data.error.list = err_data.error.list\n .concat(error_list[i].error.list)\n .filter(unique);\n err_data.response.push(error_list[i].response[0]);\n err_data.deferred.push(error_list[i].deferred[0]);\n error_list.splice(i, 1);\n --i;\n }\n }\n }", "fix(fixer) {\n // When the spaceAround option is not used,\n // the fix for the built-in space-infix-ops rule\n // will add spaces back around **.\n\n // Only one fixer method can be called\n // and its result must be returned.\n return fixer.replaceText(node, text);\n }", "function no__MODIFICATION__ALLOWED__ERR_ques_(domException) /* (domException : domException) -> bool */ {\n return (domException === 7);\n}", "crashOnCollision() {\n\t\tthis.game.skier.isCrashed = true;\n\t\tthis.game.recordAndResetStyle();\n\t\tif (typeof this.isOnFire !== undefined) {\n\t\t\tif (this.game.skier.isJumping) {\n\t\t\t\tthis.isOnFire = true;\n\t\t\t}\n\t\t}\n\t}", "bugCollision(bug) {\n if ((player.y - 3 === bug.y) && (player.x - bug.x <= 50) && (player.x - bug.x >= -74)) {\n this.restart();\n this.bugHit();\n gem = new Gem();\n }\n }", "function bugEat(bug){\n var targetInd = bugFood(bug.x, bug.y);\n var targetFood = foods[targetInd];\n var x = bug.x;\n var y = bug.y;\n var dist = distanceCalc(x, y, targetFood);\n var CollisionDistance = foodR + 10;\n if(dist <= CollisionDistance){\n clearFood(targetFood);\n foods.splice(targetInd, 1);\n }\n}", "function checkSolution(){\n\t puzzleSolution;\n\t}", "function Ho(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function isRecoverableError(e) {\n return e &&\n e.name === 'SyntaxError' &&\n /^(Unexpected end of input|Unexpected token :)/.test(e.message);\n}", "doesErrorApplyToTarget ( target ) {\n return (this.state.scrollToError && this.state.scrollToError.target === target) ? {...this.state.scrollToError} : undefined;\n }", "tryMove(deltaX, deltaY) {\n const currentPiece = this.state.currentPiece;\n const board = this.state.board;\n if (!currentPiece) {\n return true;\n }\n const newX = currentPiece.x + deltaX;\n const newY = currentPiece.y + deltaY;\n const isValidMove = checkMove(currentPiece, board, newX, newY);\n\n if (isValidMove) {\n this.setState({\n currentPiece: Object.assign({}, currentPiece, {x: newX, y: newY}),\n });\n }\n return isValidMove;\n }", "function fixInvalidVersions( version ) {\n\t\tvar originalVersion = version;\n\n\t\ttry {\n\t\t\tif ( semver.valid( version ) ) {\n\t\t\t\treturn version;\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\t// If the version is missing patch information ( eg \"1.5\" ), then append a .0 to complete it( \"1.5.0\" );\n\t\t\tif ( !rMajorMinorPatch.test( version ) ) {\n\t\t\t\tversion = version.replace( rMajorMinor, \"$1.0\" );\n\t\t\t}\n\n\t\t\t// If the version had bad label formatting ( eg \"1.5.1beta2\" ), then prepend a dash ( \"1.5.1-beta2\" );\n\t\t\tversion = version.replace( badLabel, \"$1-$2\" );\n\n\t\t\tfixedVersions[ version ] = originalVersion;\n\n\t\t\treturn version;\n\t\t}\n\t}", "function refineOrDie_(self, pf, __trace) {\n return refineOrDieWith_(self, pf, _index12.identity, __trace);\n}", "function esconderError() {\n setError(null);\n }", "solveNaive () {\n while (true) {\n const node = this.findAnOpenNode()\n if (node === null) {\n return\n }\n\n if (node.problem.currentSize < node.problem.targetSize) {\n node.rethrow()\n } else if (node.problem.currentSize % node.problem.targetSize === 0) {\n node.reduce(node.problem.targetSize)\n } else {\n node.tryReduce(node.problem.targetSize)\n }\n }\n }", "function validError(error) {\n if (error === null || error === undefined) {\n return false;\n }\n switch (error.reason) {\n case \"Combine this with the previous 'var' statement.\":\n case \"Move 'var' declarations to the top of the function.\":\n return false;\n }\n return true;\n}", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}", "function VeryBadError() {}", "function bugCollision(){ //////////// TO DO\n //boolean function\n //returns true if bug is about to collide with another bug\n //base of measure if their front points are within 10px\n //of radius\n //returns otherwise\n// Not to offend or anything but I have already invested so much\n// time for this assignment that I don't feel like implementing\n// anymore. I have 2 more assignments due the next week I'm done\n// with this.\n}", "function deleteShelterError(error) {\n vm.error = \"Could not delete shelter at this time. Please try again later.\";\n scrollToError();\n }", "function processValidation(obj) {\n\t if (window.onProcessValidation) {\n\t\t var updatedObj = onProcessValidation(obj);\n\t\t if (!isNull(updatedObj)) {\n\t\t\t return updatedObj;\n\t\t }\n\t }\n\t obj.actionType = \"showError\";\n\t obj.action = \"You must fix all errors first.\";\t \n\t return obj;\n }", "handleFailure (error_)\n\t{\n\t\t// todo: Undo all actions\n\t\tthis.cleanup ();\n\t\tthrow error_;\n\t}", "function squashErrors() {\n if (errorList[0].type) {\n return;\n }\n\n // squask all un-type related errors\n let i;\n const err = errorList[0];\n for (i = 1; i < errorList.length; ++i) {\n if (!errorList[i].error.type) {\n err.error.list = err.error.list\n .concat(errorList[i].error.list)\n .filter(unique);\n err.response.push(errorList[i].response[0]);\n err.deferred.push(errorList[i].deferred[0]);\n errorList.splice(i, 1);\n --i;\n }\n }\n }", "function solve(board) {\n throw Error('Not Implemented');\n}", "function fixPatches(patch, paragraph_index, patchNumber, totalPatches, findFixVerifyOptions, rejectedWorkers) {\r\n var fix_hit = requestFixes(patch, findFixVerifyOptions); \r\n var suggestions = new Object();\r\n while (true) {\t\r\n suggestions = joinFixes(fix_hit, patch.plaintextSentence(), paragraph_index, patch, patchNumber, totalPatches, rejectedWorkers, findFixVerifyOptions);\r\n \r\n // make sure every field has a length of at least one\r\n var minLength = Number.MAX_VALUE;\r\n foreach(suggestions, function(alternatives, fieldName) {\r\n minLength = Math.min(minLength, alternatives.length);\r\n });\r\n \r\n if (minLength >= 1 && countKeys(suggestions) > 0) {\r\n break;\r\n }\r\n else {\r\n\t\t\tprint(\"Not enough viable fix suggestions: \" + countKeys(suggestions)) + \" non-rejected submissions and \" + minLength + \" minimum suggestions.\";\r\n extendHit(fix_hit, findFixVerifyOptions.buffer_redundancy, patchNumber);\r\n }\t\r\n }\t\t\r\n \r\n cleanUp(fix_hit);\r\n findFixVerifyOptions.socket.sendStageComplete(Socket.FIX_STAGE, paragraph_index, mturk.getHIT(fix_hit, true), patchNumber, totalPatches);\r\n \r\n return [suggestions, fix_hit];\r\n}", "function displayError() {\n if(originalError instanceof ValidationError) {\n $(\".validation-message--error\").text(`Validation Error: ${originalError.message}`);\n }\n else if(originalError instanceof LocationError) {\n $(\".validation-message--error\").text(`Location Error: ${originalError.message}`);\n }\n else {\n $(\".validation-message--error\").text(`Error: ${originalError.message}`);\n }\n }", "function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences) {\n const codeFixActions = tsLs.getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences);\n for (const errorCode of errorCodes) {\n const fixes = codefix_provider_1.errorCodeToFixes.get(errorCode);\n if (fixes == null)\n continue;\n for (const fix of fixes) {\n fix.replaceCodeActions(codeFixActions);\n }\n }\n return codeFixActions;\n }", "function fixFloSwatches ()\n\t{\n\t\tvar floLibrary = {\n\t\t\t\"Bright Purple B\": \"BRIGHT PURPLE B\",\n\t\t\t\"Flo Yellow B\": \"FLO YELLOW B\",\n\t\t\t\"Flame B\": \"FLAME B\",\n\t\t\t\"Flo Blue B\": \"FLO BLUE B\",\n\t\t\t\"Flo Orange B\": \"FLO ORANGE B\",\n\t\t\t\"Flo Pink B\": \"FLO PINK B\",\n\t\t\t\"Mint B\": \"MINT B\",\n\t\t\t\"Neon Coral B\": \"NEON CORAL B\",\n\t\t\t\"cutline\": \"CUT LINE\",\n\t\t\t\"cut line\": \"CUT LINE\",\n\t\t\t\"Cut Line\": \"CUT LINE\",\n\t\t\t\"CutLine\": \"CUT LINE\",\n\t\t\t\"CUTLINE\": \"CUT LINE\",\n\t\t\t\"CUTline\": \"CUT LINE\",\n\t\t\t\"sewline\": \"SEW LINE\",\n\t\t\t\"sew line\": \"SEW LINE\",\n\t\t\t\"SewLine\": \"SEW LINE\",\n\t\t\t\"Sew Line\": \"SEW LINE\",\n\t\t\t\"Sew Lines\": \"SEW LINE\",\n\t\t\t\"ZUND CUT\": \"Thru-cut\",\n\t\t\t\"ZUNDCUT\": \"Thru-cut\"\n\t\t}\n\n\t\tfor ( var fs = 0; fs < swatches.length; fs++ )\n\t\t{\n\t\t\tvar thisSwatch = swatches[ fs ];\n\t\t\tif ( floLibrary[ thisSwatch.name ] )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthisSwatch.name = floLibrary[ thisSwatch.name ];\n\t\t\t\t}\n\t\t\t\tcatch ( e )\n\t\t\t\t{\n\t\t\t\t\terrorList.push( \"System: \" + e );\n\t\t\t\t\terrorList.push( \"Failed while renaming swatch: \" + thisSwatch.name +\n\t\t\t\t\t\t\".\\nEither there was an MRAP error or there are multiple instances of the same swatch.\\\n\t\t\t\t\t\t\t\t\t\\ni.e. CUTLINE and CUT LINE both exist in the swatches panel.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlog.l( \"Successfully fixed flo swatches.\" );\n\t}", "async handleExistingCodeError () {\n\t\tconst stackTracesToAdd = [];\n\t\tlet didChange = false;\n\n\t\t// account ID must match\n\t\tif (this.attributes.accountId !== this.existingModel.get('accountId')) {\n\t\t\tthrow this.errorHandler.error('createAuth', { reason: 'found existing object but account ID does not match' });\n\t\t}\n\n\t\t// check if this is a new stack trace ...\n\t\t// if so, add it to the array of known stack traces\n\t\t(this.attributes.stackTraces || []).forEach(incomingStackTrace => {\n\t\t\tconst index = (this.existingModel.get('stackTraces') || []).findIndex(existingStackTrace => {\n\t\t\t\tif (existingStackTrace.traceId && incomingStackTrace.traceId) {\n\t\t\t\t\treturn existingStackTrace.traceId === incomingStackTrace.traceId;\n\t\t\t\t} else {\n\t\t\t\t\treturn existingStackTrace.text === incomingStackTrace.text;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (index === -1) {\n\t\t\t\tstackTracesToAdd.push(incomingStackTrace);\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t});\n\t\tthis.attributes.stackTraces = [\n\t\t\t...(this.existingModel.get('stackTraces') || []),\n\t\t\t...stackTracesToAdd\n\t\t];\n\n\t\tdelete this.attributes.postId; // abort creating a new post\n\t\tdelete this.attributes.creatorId; // don't change authors\n\n\t\treturn didChange;\n\t}", "find (api, error) {\n for (let knownError of knownErrors.all) {\n if (typeof knownError.api === \"string\" && !api.name.includes(knownError.api)) {\n continue;\n }\n\n if (typeof knownError.error === \"string\" && !error.message.includes(knownError.error)) {\n continue;\n }\n\n if (knownError.error instanceof RegExp && !knownError.error.test(error.message)) {\n continue;\n }\n\n return knownError;\n }\n }", "function StupidBug() {}", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n }", "function croak(msg) {\n //wow, we report location, it's amazing!\n throw new Error(msg + \" (\" + line + \":\" + col + \")\");\n }", "function update() {\n try{\n esprima.parseScript(editor.getValue());\n if($bugContainer.css('display') != 'none'){\n $bugContainer.css({'display': 'none'})\n }\n }catch(e){\n $bugReport[0].innerHTML = e.message;\n $bugContainer.css({'display': 'flex'})\n }\n }", "_initializePosition() {\n if (this._isVectorWaypoint) {\n return;\n }\n\n const fixPosition = FixCollection.getPositionModelForFixName(this._name);\n\n if (!fixPosition) {\n throw new TypeError(`Expected fix with known position, but cannot find fix '${this._name}'`);\n }\n\n this._positionModel = fixPosition;\n }", "function markError(error) {\n if (error.errorPos) {\n console.log(\"marking error\",error);\n cursorToSeq.push(error);\n }\n}", "function reportCarelessErrors() {\n win.print = win.confirm = win.alert = win.open = function () {\n throw new Error(\"Careless method called.\");\n };\n }", "function i(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function i(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}" ]
[ "0.6161692", "0.60046", "0.57907164", "0.5754214", "0.5615763", "0.5599336", "0.55635893", "0.55439484", "0.55075085", "0.543655", "0.5286961", "0.52278155", "0.51493484", "0.4930272", "0.4890797", "0.48722386", "0.48690188", "0.48433304", "0.48282576", "0.47948614", "0.47943848", "0.47928694", "0.47912085", "0.47901264", "0.4751844", "0.4751844", "0.47458494", "0.47448203", "0.47394723", "0.4738816", "0.47318232", "0.47239217", "0.47075245", "0.47071195", "0.47036934", "0.4695601", "0.46929443", "0.4692081", "0.46920455", "0.46877804", "0.46866268", "0.46619886", "0.46553883", "0.46478438", "0.46271673", "0.46268892", "0.46253183", "0.46235454", "0.46152037", "0.4604969", "0.45979458", "0.45914274", "0.45913252", "0.459029", "0.45887128", "0.457892", "0.457892", "0.457892", "0.457892", "0.457892", "0.457892", "0.457892", "0.45659122", "0.4562968", "0.45598483", "0.455464", "0.455353", "0.4544365", "0.45426437", "0.45301962", "0.4530189", "0.45263085", "0.45255545", "0.45243594", "0.45219493", "0.45217356", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.45185286", "0.44979644", "0.44954467", "0.44952622", "0.44937202", "0.44928515", "0.44907027", "0.44907027", "0.44785202", "0.44785202", "0.44785202" ]
0.6545727
0
Funciones de los menus
function menu(urls,id){ $('#'+id+'').click( function(){ $.ajax({ url: urls, success: function(data){ $('#area_trabajo').html(data); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuOptions() {}", "function menuhrres() {\r\n\r\n}", "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAllActive()) { //Si on est dans la validation du delete\n\t\tdelAll();\n\t}\n}", "function simulat_menu_infos() {\n display_menu_infos();\n}", "function menu(_func){\n\tif(myNodeInit){\t\t\n\t\tif(_func == \"properties\"){\n\t\t\topenproperties();\n\t\t} else if(_func == \"collapse\"){\n \tmyExpandedMode = 0;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"expand\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n\t\t} else if(_func == \"expand\" || _func == \"unfold\"){\n \tmyExpandedMode = 2;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n } else if(_func == \"fold\"){\n \tmyExpandedMode = 1;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"unfold\");\n\t\t} else if(_func == \"duplicate\"){\n\t\t\t;\n\t\t} else if(_func == \"delete\"){\n\t\t\t;\n\t\t} else if(_func == \"help\"){\n\t\t\toutlet(2, \"load\", \"bs.help.node.\" + myNodeHelp + \".maxpat\");\n\t\t}\n\t}\n}", "function onOpen() {\n createMenu();\n}", "function createMenus(){\n // Get the div element which will contain the menus\n var fullScreenMenuContainer = $('#fullScreenMenuContainer')\n // Add basic classes for color and opacity\n .addClass('w3-container w3-black')\n // force full-screen and above every element in html\n .css({\n 'height': '100vh',\n 'width': '100vw',\n 'position': 'fixed',\n 'z-index': '10',\n 'top': '0',\n 'opacity': '0.85'\n }).hide();\n\n // Create the menus with each heading and buttons\n var menus = [\n {\n headingText: 'Tanks n\\' Ducks',\n buttonsArray: [\n {text: '1 Jugador', func: 'toggleMenu(Menu.MAP_SELECTOR)'},\n {text: '1 vs 1', func: 'alert(\\'Comming soon...\\')'},\n {text: 'Instrucciones', func: 'toggleMenu(Menu.INSTRUCTIONS)'},\n {text: 'Opciones', func: 'toggleMenu(Menu.OPTIONS)'},\n ],\n },\n {\n headingText: 'Opciones',\n buttonsArray: [\n {\n text: 'Música (ON)',\n func: 'toggleMusic()',\n id: 'optMusic'\n },\n {\n text: 'Efectos (ON)',\n func: 'toggleEffects()',\n id: 'optEffects'\n },\n {\n text: 'Velocidad (1)',\n func: 'changeSpeed()',\n id: 'optSpeed'\n },\n {\n text: 'Información (ON)',\n func: 'toggleStats()',\n id: 'optStats'\n },\n {text: 'Atrás', func:'toggleMenu(previousMenu)'},\n ],\n },\n {\n headingText: 'Instrucciones',\n image: {\n src: './imgs/Instrucciones.png',\n title: 'Instrucciones',\n alt: 'Instrucciones',\n },\n buttonsArray: [\n {text: 'Atrás', func: 'toggleMenu(previousMenu)'},\n ],\n },\n {\n headingText: 'Pausa',\n buttonsArray: [\n {text: 'Reanudar', func:'toggleMenu(currentMenu)'},\n {text: 'Instrucciones', func: 'toggleMenu(Menu.INSTRUCTIONS)'},\n {text: 'Opciones', func: 'toggleMenu(Menu.OPTIONS)'},\n {text: 'Menú principal', func:'resetGame()'},\n ],\n },\n {\n headingText: 'Selección de mapas',\n buttonsArray: [\n {text: 'Universo', func:'startGame(\\'galaxy\\')'},\n {text: 'Parque', func: 'startGame(\\'park\\')'},\n {text: 'Atrás', func:'toggleMenu(previousMenu)'},\n ],\n },\n {\n headingText: 'Fin del juego',\n image: {\n src: './imgs/see_you_later.png',\n title: 'See you later',\n alt: 'See you later',\n },\n buttonsArray: [\n {text: 'Menú principal', func:'resetGame()'},\n ]\n }\n ];\n\n // For each menu, add it to the html\n menus.forEach(function(currMenuContents){\n // Menu itself\n var currMenu = $('<form>')\n .addClass(\n 'menu w3-container w3-text-light-grey w3-center ' +\n 'w3-display-middle w3-quarter'\n );\n fullScreenMenuContainer.append(currMenu);\n\n // Add a label with the current menu heading\n currMenu.append(\n $('<label>')\n .text(currMenuContents.headingText)\n .addClass(\n 'w3-xxlarge w3-margin-bottom w3-panel w3-block ' +\n 'w3-round-large w3-teal'\n )\n );\n\n if(currMenuContents.image !== undefined)\n currMenu.append(\n $('<img>')\n .attr({\n 'src': currMenuContents.image.src,\n 'title': currMenuContents.image.title,\n 'alt': currMenuContents.image.alt,\n }).width('100%')\n .addClass('w3-margin-bottom w3-round-large')\n );\n\n // Add the buttons to de menu\n currMenuContents.buttonsArray.forEach(function(currButton){\n currMenu.append(\n $('<input>')\n .attr({\n 'id': (currButton.id === undefined? '': currButton.id),\n 'value': currButton.text,\n 'onmouseup':currButton.func,\n 'type': 'button'\n }).addClass(\n 'w3-button w3-block w3-round-large w3-hover-teal'\n )\n );\n });\n\n // Add the current menu to an array for future show/hide\n menusArray.push(currMenu.hide());\n });\n}", "function testMenuPostion( menu ){\n \n }", "function menu(){\n\t\tvar menuCount = 1;\n\t\tvar menuTitle = ['.menu-title:nth-of-type(1)','.menu-title:nth-of-type(2)','.menu-title:nth-of-type(3)'];\n\t\tvar menuContent = ['.menu-content section:nth-of-type(1)','.menu-content section:nth-of-type(2)','.menu-content section:nth-of-type(3)'];\n\t\t$('#move-right').on('click', function(){\n\t\t\tif (menuCount <= 0) {\n\t\t\t\tmenuCount += 1;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount <= 2) {\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\tmenuCount += 1;\n\t\t\t\t\t}\n\t\t});\n\t\t$('#move-left').on('click', function(){\n\t\t\tif (menuCount >= 3) {\n\t\t\t\tmenuCount += -2;\n\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t} else if (menuCount >= 1) {\n\t\t\t\t\t\tmenuCount += -1;\n\t\t\t\t\t\t$('.display-menu').removeClass('display-menu');\n\t\t\t\t\t\t$(menuContent[menuCount]).addClass('display-menu');\n\t\t\t\t\t\t$(menuTitle[menuCount]).addClass('display-menu');\n\t\t\t\t\t}\n\t\t});\n\t}", "function onOpen() { CUSTOM_MENU.add(); }", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function setMenu(menu){ \n switch(menu){\n case 'food-input-icon':\n loadFoodMenu();\n break; \n \n case 'stats-icon':\n loadStatsMenu(); \n break; \n \n case 'settings-icon':\n loadSettingsMenu(); \n break;\n \n case 'share-icon':\n loadShareMenu(); \n break;\n \n case 'sign-out-icon':\n signOut(); \n break;\n case 'nav-icon':\n loadNavMenu(); \n \n }\n}", "function Estiliza_menu_itens()\n{\n //PARA CADA ITEM DO MENU, BASTA CHAMAR A FUNÇÃO ABAIXO, ESPECIFICANDO\n //SEU INDICE(NUMERO), SUA COR(STRING), SEU CONTEUDO(STRING), SEU LABEL(STRING)\n //Estiliza_item(Indice, Cor, Conteudo, Texto Lateral);\n Estiliza_item(0,\"blue\",\"+\",\"Adicionar\");\n Estiliza_item(1,\"red\",\"Botão\");\n}", "function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}", "expandMenu() {\r\n\t}", "function initMenuFunction() {\n if (menuStatus == \"menu-exist\") {\n fetchMenu(dateSelected).done(function (menuArray) {\n backupArray = menuArray;\n setMenuData(menuArray);\n setModifyButtonClickListener();\n setDeleteBtnClickListener(dateSelected);\n setMenuEditable(menuStatus === \"no-menu\" ? true : false);\n });\n }\n }", "function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}", "function RenderMenu()\n{\n var menu = \"\";//Initialise var\n //Build html output based on page items list.\n menu += '<div class=\"show-for-small\">';\n menu += '<form><label>Choose an article:<select id=\"micromenu\">';\n //Small menu loop\n for (var i = 0; i < PagesList.length; i++)\n {\n if (PagesList[i][1] == curPage)\n {\n menu += '<option value=\"' + PagesList[i][1] + '\" selected>';\n }\n else\n {\n menu += '<option value=\"' + PagesList[i][1] + '\">';\n }\n menu += PagesList[i][1];\n menu += '</option>';\n }\n menu += '</select></label>';\n menu += '</form></div>';\n menu += '<ul class=\"side-nav hide-for-small\">';\n //Large menu loop\n for (var ii = 0; ii < PagesList.length; ii++)\n {\n if (PagesList[ii][1] == curPage)\n {\n menu += '<li class=\"active\">';\n }\n else\n {\n menu += '<li>';\n }\n menu += '<a onClick=\"SetPage(\\'' + PagesList[ii][1] + '\\')\">';\n menu += PagesList[ii][1];\n menu += '</a>';\n menu += '</li>';\n }\n menu += '</ul>';\n return menu;\n}", "function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}", "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }", "function showMenu(type) {\n switch (type) {\n case 'beer':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"Öl\"));\n break;\n case 'wine':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"vin\"));\n break;\n case 'spirits':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesWithStrength(\"above\", 20));\n break;\n case 'alcoAbove':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"above\", alcoPercent));\n break;\n case 'alcoBelow':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"below\", alcoPercent));\n break;\n case 'tannin':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'gluten':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'rest':\n currentFiltering = \"rest\";\n showMenu(lastMenu);\n break;\n case 'cat':\n currentFiltering = \"cat\";\n showMenu(lastMenu);\n break;\n case 'back':\n currentFiltering = \"none\";\n showMenu(allMenuBeverages());\n break;\n default:\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allMenuBeverages());\n }\n}", "function managerMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"mainSelection\",\n\t\tmessage: \"Please make a selection: \",\n\t\tchoices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n\t}]).then(function(selection){\n\n\t\t// Call a particular function depending on user's selection\n\t\tswitch(selection.mainSelection){\n\t\t\tcase \"View Products for Sale\":\n\t\t\t\tviewProducts();\n\t\t\t\tbreak;\n\t\t\tcase \"View Low Inventory\":\n\t\t\t\tviewLowInventory();\n\t\t\t\tbreak;\n\t\t\tcase \"Add to Inventory\":\n\t\t\t\taddInventory();\n\t\t\t\tbreak;\n\t\t\tcase \"Add New Product\":\n\t\t\t\taddProduct();\n\t\t}\n\t});\n}", "function setupMenuHandlers() {\n document.querySelector('.center').innerHTML = '&copy; 2020 Student Soroush Bahrami';\n\n document.querySelector('#menu_english').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('English'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - English Names';\n });\n document.querySelector('#menu_arabic').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Arabic'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Arabic Names';\n });\n document.querySelector('#menu_chinese').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Chinese'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Chinese Names';\n });\n document.querySelector('#menu_french').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('French'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - French Names';\n });\n document.querySelector('#menu_hindi').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Hindi'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Hindi Names';\n });\n document.querySelector('#menu_korean').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Korean'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Korean Names';\n });\n document.querySelector('#menu_japanese').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Japanese'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Japanese Names';\n });\n document.querySelector('#menu_russian').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByLanguage('Russian'));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Russian Names';\n });\n\n document.querySelector('#menu_population_100_000_000m').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByPopulation(100000000));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Population Above 100,000,000m';\n });\n document.querySelector('#menu_population_1m_2m').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByPopulation(1000000, 2000000));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Population between 1 and 2 million';\n });\n document.querySelector('#menu_americas_1mkm').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByAreaAndContinent('Americas', 1000000));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - Area Greater than 1 million square KM in Americas';\n });\n document.querySelector('#menu_asia_all').addEventListener('click', function() {\n tableHelper.countriesToTable(countries.getByAreaAndContinent('Asia', 0));\n document.querySelector('#subtitle').innerHTML =\n 'List of Countries and Dependencies - All countries in Asia';\n });\n }", "function basicMenu() {\nif (advancedMenuIsOpen)\n{closeAdvancedMenu()}\nelse {\n if (basicMenuIsOpen) {\n closeBasicMenu();\n } else {\n openBasicMenu();\n }\n}\n}", "function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}", "function Vmenu2()\r\n{\r\n\twindow.colorlink = $(\"a.tablelinkssearch\").css(\"color\");\r\n\t$('.Vmenu2 ul li a').hover(\r\n\tfunction()\r\n\t{\r\n\t\tif($(this).parent().attr('class')!='hr')\r\n\t\t\t$(this).addClass('menu_active');\r\n\t},\r\n\tfunction()\r\n\t{\r\n\t\tif($(this).parent().attr('class')!='hr')\r\n\t\t\t$(this).removeClass('menu_active'); \r\n\t}); \r\n\t$('.Vmenu2 ul li ul').hide();\r\n\t$('li[@view=topitem]:has(ul:has(a.current))').find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t$('.Vmenu2 ul li:has(ul) span').bind('click',function()\r\n\t{\r\n\t\tvar par = $(this).parent();\r\n\t\tvar parc = $('a.current').parent();\r\n\t\t$(par).find('ul:first').slideToggle(); \r\n\t\tif ($(this).find('img.pmimg').attr('src') == 'include/img/plus.gif') \r\n\t\t{\r\n\t\t\t// add to cookie opened menu\r\n\t\t\taddOpenMenuItemIdToCookie($(par).find('ul:first').attr(\"id\"));\r\n\t\t\t$(this).find('img.pmimg').attr('src', 'include/img/minus.gif');\r\n\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t$(par).find('a:first').css('color',window.colorlink);\r\n\t\t\t$(par).find('ul:has(a.current)').each(function(parc)\r\n\t\t\t{\r\n\t\t\t\t$(this).parent().find('img.pmimg:first').attr('src','include/img/minus.gif');\r\n\t\t\t\tif($('a.current',this).length && $(this).parent().attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t\t$(this).parent().find('a:first').css('color',window.colorlink);\r\n\t\t\t\taddOpenMenuItemIdToCookie($(this).attr(\"id\"));\r\n\t\t\t\t$(this).slideDown();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\t// remove from cookie opened menu\r\n\t\t\t\tremoveOpenMenuFromCookie($(par).find('ul:first').attr(\"id\"));\r\n\t\t\t\t// remove all children from cookie\r\n\t\t\t\t$(par).find('ul').each(function()\r\n\t\t\t\t{\r\n\t\t\t\t\tremoveOpenMenuFromCookie($(this).attr(\"id\"));\r\n\t\t\t\t});\r\n\t\t\t\t$(this).find('img.pmimg').attr('src', 'include/img/plus.gif');\r\n\t\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t\t$(par).find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t\t\t}\r\n\t\treturn false;\r\n\t});\r\n\tif($('.Vmenu2 li[@view=topitem]:has(ul)').length && $('.Vmenu2 ul:first').length)\r\n\t{\r\n\t\t$('.Vmenu2_links').css('display','block');\r\n\t\t$('a.plus_minus').click(function()\r\n\t\t{\r\n\t\t if(flag)\r\n\t\t {\r\n\t\t\t\t$(this).parent().parent().find('ul li ul').slideUp('slow');\r\n\t\t\t\t$('a.plus_minus').empty();\r\n\t\t\t\t$('img.pmimg').attr('src','include/img/plus.gif');\r\n\t\t\t\t$('a.plus_minus').append('<img src=\\\"include/img/plus.gif\\\" border=0> &nbsp;&nbsp;'+TEXT_EXPAND_ALL);\r\n\t\t\t\tflag = 0;\r\n\t\t\t\t// on collapse all, remove all ids from cookie\r\n\t\t\t\tdelete_cookie('openMenuItemIds', cookieRoot, '');\r\n\t\t\t\t$(this).parent().parent().find('li:has(ul:has(a.current))').each(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t else{\r\n\t\t\t\t\t$(this).parent().parent().find('ul li ul').slideDown('slow');\r\n\t\t\t\t\t$('a.plus_minus').empty();\r\n\t\t\t\t\t$('img.pmimg').attr('src','include/img/minus.gif');\r\n\t\t\t\t\t$('a.plus_minus').append('<img src=\\\"include/img/minus.gif\\\" border=0> &nbsp;&nbsp;'+TEXT_COLLAPSE_ALL);\r\n\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t// on expand all add all ids to cookie\r\n\t\t\t\t\t$(this).parent().parent().find('ul li ul').each(function()\r\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\taddOpenMenuItemIdToCookie($(this).attr(\"id\"));\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t$(this).parent().parent().find('li:has(ul:has(a.current))').each(function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(this).find('a:first').css('color',window.colorlink);\r\n\t\t\t\t\t});\t\r\n\t\t\t\t}\r\n\t\t\treturn false; \r\n\t\t});\r\n\t}\t\r\n\tif($.browser.msie)\r\n\t\t$('.Vmenu2 ul li').css('padding','5px 0');\t\r\n}", "HideMenus() {\n this.HideMenuSubs();\n this.HideMenusAuds();\n }", "function initialize() {\n activateMenus();\n}", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "function menu() {\n console.log (\"\\n 1 : Lister les contacts\");\n console.log (\" 2 : Ajouter un contact\");\n console.log (\" 0 : Quitter le Gestionnaire\");\n\n}", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }", "function getSubChapterMenu(){\n\t\n}", "function navigasjonsmeny() {\n $('.trestripeknapp').click(function() {\n menyFram();\n })\n}", "createMenus (){\n \n $.each(MenuData.menus, ( menuName, menuItems )=>{\n \n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\n \n $.each(menuItems,( index, item )=>{\n \n var realRoute,itemLink,action,routeId;\n \n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\n return true;\n }\n \n if(item.label){\n // Translate item label\n let key = \"menu.\"+Ember.String.dasherize(menuName)+\".\"+Ember.String.dasherize(item.label);\n item.tLabel = this.get('i18n').t(key);\n }\n \n // Serialize route name for use as CSS id name\n item.cssRoute = item.route.replace(/\\./g,'_');\n \n // Track actionable link\n let addEvent = true;\n \n if(item.menuRoute){\n \n // For routes which don't appear in the menu but will cause a different menu link to highlight\n itemLink = $('<a id=\"menuItem_'+item.cssRoute+'\" class=\"menu-link game-nav hidden\" data-menu-route=\"'+item.menuRoute+'\"></a>');\n addEvent = false;\n \n } else if(item.tempRoute){\n itemLink = $('<a href=\"/'+item.tempRoute+'\" id=\"menuItem_'+item.cssRoute+'\" class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n action = 'transitionAction';\n realRoute = item.tempRoute;\n \n } else if(item.route){\n itemLink = $('<a href=\"/'+item.route+'\" id=\"menuItem_'+item.cssRoute+'\" class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n action = 'transitionAction';\n realRoute = item.route;\n \n if(item.params && item.params.id){\n routeId = item.params.id;\n }\n \n } else if(item.action) {\n itemLink = $('<a class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n let actionName = 'menuAction'+item.label.alphaNumeric();\n action = actionName;\n this.set(actionName,item.action);\n }\n \n if(itemLink){\n \n if(addEvent){\n itemLink.on('click',(e)=>{\n e.preventDefault();\n this.sendAction(action,realRoute,routeId);\n \n if(routeId){\n Ember.Blackout.transitionTo(realRoute,routeId);\n } else {\n Ember.Blackout.transitionTo(realRoute);\n }\n \n this.selectMenuLink(item.route);\n return false;\n });\n }\n \n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\n }\n \n });\n });\n\n // Manually update hover watchers\n Ember.Blackout.refreshHoverWatchers();\n \n }", "function menus(){\n\n\tlet Desplazamiento_Actual = window.pageYOffset;\n\n\tif(Desplazamiento_Actual <= 300){\n\n\t\t//que nos remueva nav2\n\t\tnav.classList.remove('nav2');\n\t\t// className para añadir una determinada clase a un elemento (que nos agrege nav1)\n\t\tnav.className = ('nav1');\n\t\t//tiempo de transicion entre nav1 y nav2 1segundo\n\t\tnav.style.transition = '1s';\n\t\tmenu.style.top = '160px';\n\t\t//menu responsive inicio color blanco\n\t\topen.style.color = '#fff';\n\n\t}else{\n\n\t\tnav.classList.remove('nav1');\n\t\tnav.className = ('nav2');\n\t\t//proporcionan una forma de animar los cambios de las propiedades CSS, en lugar de que los cambios surtan efecto de manera instantánea. \n\t\tnav.style.transition = '1s';\n\t\tmenu.style.top = '100px';\n\t\t//menu responsive despues de 300 color negro\n\t\topen.style.color = '#000';\n\n\t}\n\n}", "function on_paint() {\r\n menu_dt()\r\n menu_idt()\r\n menu_tgt()\r\n menu_aa()\r\n menu_vis()\r\n menu_msc()\r\n handle_vis()\r\n handle_msc_two()\r\n}", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function fnc_child_set_menu()\n{\n\tfnc_SET_variables_de_menu('2311');\n}", "function startMenu() {\n createManager();\n}", "function printMenu() {\n console.log(\"\\n<====== PENDAFATARAN SISWA BARU ======>\");\n console.log(\"<====== SMKN 1 RPL ======>\");\n console.log(\"\\n<====== Menu ======>\");\n console.log(\"1. Registrasi\");\n console.log(\"2. Input Nilai\");\n console.log(\"3. Lihat Profil\");\n console.log(\"4. Informasi Kelulusan\");\n console.log(\"5. keluar\");\n }", "menuHandler(newMenuChoices) {\n this.help.stopVideo();\n switch (newMenuChoices) {\n case MenuChoices.library:\n this.libraryMenu();\n break;\n case MenuChoices.export:\n this.exportMenu();\n break;\n case MenuChoices.help:\n this.helpMenu();\n break;\n case MenuChoices.edit:\n this.editMenu();\n break;\n case MenuChoices.save:\n this.saveMenu();\n break;\n case MenuChoices.load:\n this.loadMenu();\n break;\n case MenuChoices.null:\n this.cleanMenu();\n this.closeMenu();\n break;\n }\n }", "function menu() {\n queryTable(welcome);\n}", "function ips_menu_events()\n{\n}", "function menu(){\n background(img,0);\n //retangulo para selecionar a tela\n fill(255, 204, 0)\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n fill(233,495,67);\n textSize(26);\n text('JOGAR ', 250, 100)\n //detalhes do texto abaixo\n fill(233,495,67);\n textSize(26);\n text('INSTRUÇÕES', 230, 200);\n text('CREDITOS', 230, 300);\n }", "function thememascot_menuzord() {\n $(\"#menuzord\").menuzord({\n align: \"left\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"<i class='fa fa-angle-down'></i>\",\n indicatorSecondLevel: \"<i class='fa fa-angle-right'></i>\"\n });\n $(\"#menuzord-right\").menuzord({\n align: \"right\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"<i class='fa fa-angle-down'></i>\",\n indicatorSecondLevel: \"<i class='fa fa-angle-right'></i>\"\n });\n }", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "function app(){\n mainMenu();\n}", "function fecharMenu() {\n\t\t$('div.menu-mobile').stop(true, true).animate({'marginLeft':'-550px'}, 300);\n\t\t$('.fundo-preto-mobile').stop(true, true).removeClass('active').hide();\n\t\t$('#menumobile a.fecharmenu').stop(true, true).removeClass('fadeIn').addClass('animated fadeOut').hide();\n\t\t$('div.menu-mobile ul.primeira').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.um').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.dois').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.tres').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.quatro').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.cinco').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.seis').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.sete').stop(true, true).hide();\n\t\t$('div.menu-mobile > ul.primeira > li').stop(true, true).removeClass('flipInX').addClass('animated flipOutX').hide();\n\t\t$('div.menu-mobile').stop(true, true).removeClass('open');\n\t\t$('span.flaticon-arrow').stop(true, true).removeClass('flaticon-arrow').addClass('flaticon-arrow-down-sign-to-navigate');\n\t\t$('ul.esconder').stop(true, true).removeClass('bounceInLeft').hide();\n\t}", "function menuOpen(ev) {\n switch(ev.target.id) {\n case \"class-btn\":\n closeMenus(); \n document.getElementById(\"class-menu\").style.display = \"block\";\n break;\n case \"prof-btn\":\n closeMenus(); \n document.getElementById(\"prof-menu\").style.display = \"block\";\n break;\n case \"choose-schedule-btn\":\n closeMenus(); \n document.getElementById(\"choose-schedule-menu\").style.display = \"block\";\n break;\n case \"add-class-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add classes.\");\n return;\n }\n \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"class\");\n document.getElementById(\"add-class\").style.display = \"block\";\n break;\n case \"add-prof-alt\":\n document.getElementById(\"add-class\").className += \" blur-on\";\n case \"add-prof-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add professors.\");\n return;\n }\n\t \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"prof\");\n document.getElementById(\"add-prof\").style.display = \"block\";\n break;\n case \"add-schedule-btn\":\n _popUpCount++;\n document.getElementById(\"add-schedule\").style.display = \"block\";\n break;\n }\n }", "setupMenuHandlers() {\n this.button.onclick = () => {\n this.state.menu.toggleMenu();\n }\n }", "function GM_registerMenuCommand(){\n // TODO: Elements placed into the page\n }", "function handleMenu(){\n\t$(\"#examples-menu\").mouseover(function(){\n\t\tvar position = $(\"#examples-menu\").offset();\n\t\tvar top = $(\"#examples-menu\").outerHeight();\n\t\t$(\"ul.examples\").offset({left:position.left, top:top+position.top});\n\t\t$(\"ul.examples\").show();\n\t})\n\t$(\"h1,table,img,form\").mouseover(function(){\n\t\t$(\"ul.examples\").offset({left:0, top:0});\n\t\t$(\"ul.examples\").hide();\n\t})\t\n}", "addMenuItem(menuItem){\r\n\r\n }", "function initMenuUI() {\n clearMenu();\n let updateBtnGroup = $(\".menu-update-btn-group\");\n let modifyBtnGroup = $(\".menu-modify-btn-group\");\n let delBtn = $(\"#btn-delete-menu\");\n\n setMenuTitle();\n $(\"#btn-update-menu\").text(menuStatus == \"no-menu\" ? \"创建菜单\" : \"更新菜单\");\n menuStatus == \"no-menu\" ? hideElement(modifyBtnGroup) : unhideElement(modifyBtnGroup);\n menuStatus == \"no-menu\" ? unhideElement(updateBtnGroup) : hideElement(updateBtnGroup);\n menuStatus == \"no-menu\" ? setDisable(delBtn) : setEnable(delBtn);\n }", "_overriddenMenuHandler() { }", "function display_menu_infos() {\n var menu_item_html = \"\";\n if (data.menu_info != undefined) {\n for (var i = 0; i < data.menu_info.length; i++) {\n menu_item_html += '<ul id=\"menuItem' + i;\n menu_item_html += '\" onclick=\"selectMenu(' + i + ')\">';\n menu_item_html += data.menu_info[i]['name'] + '</ul>';\n }\n }\n $('#horizontal_menu_bar').html(menu_item_html);\n}", "function displayMenu() {\n var menu = \"1/ Afficher les personnages\\n\";\n menu += \"2/ Calcule de la moyenne d'Age\\n\";\n menu += \"3/ Ajouter un personnage\\n\";\n menu += \"4/ Supprimer un personnage\\n\";\n menu += \"5/ Afficher un personnage\\n\";\n menu += \"0/ Quitter\\n\";\n return menu;\n}", "function menu(){\n while (true) {\n //primeiro ele \"reseta\" o menu..\n infos.menu = []\n //pra depois ir adicionando as opções. essas duas sempre são chamadas.\n infos.menu.push(\"Explorar\", \"Usar items\")\n\n //essas outras, só quando certas partes do jogo estão destravadas\n if (infos.casa){\n infos.menu.push(\"Beber água\", \"Procurar comida\")\n }\n if (infos.casa && infos.fogueira == false) {\n infos.menu.push(\"Acender fogueira\")\n }\n infos.menu.push(\"Sair do jogo\")\n //pra cada item do menu, mostra na tela com o número da opção. gambiarra para transformar 0 em 1\n for (let i in infos.menu) {\n let x = parseInt(i) + 1\n console.log(`${x} - ${infos.menu[i]}`)\n }\n console.log()\n let escolha = +prompt(\">\")\n\n //para ficar igual ao índice da lista\n escolha--\n if (escolha < 0 || escolha > infos.items.length) {\n console.log(\"-- Opção incorreta\")\n menu();\n }\n \n //funcoes para cada escolha\n if (infos.menu[escolha] == \"Explorar\") {\n explorar()\n }\n else if (infos.menu[escolha] == \"Beber água\") {\n beberAgua();\n }\n else if (infos.menu[escolha] == \"Usar items\") {\n usarItems() \n }\n else if (infos.menu[escolha] == \"Procurar comida\") {\n procurarComida();\n }\n else if (infos.menu[escolha] == \"Acender fogueira\") {\n acenderFogueira();\n }\n else if (infos.menu[escolha] == \"Sair do jogo\") {\n //achei na net, pra encerrar um script do node!\n process.exit(0)\n }\n}\n}", "function makeMenues(id){\n$( \"#menu_\"+ id ).menu();\n}", "function spellsMenu() {\n $scope.menuTitle = createText(\"Spells\", [20, 10]);\n createText(\"Not yet implemented\", [50, 80], {});\n }", "function Menu(n=0) {\n\n switch (n) {\n case 1: var btn = Array(1,5);break;\n case 2: var btn = Array(2,4,6);break;\n case 3: var btn = Array(0,3);break;\n default: document.getElementById(\"steuerung\").style.display = \"none\";\n return;\n }\n\n /* hide all */\n for (var c=1;c<7;c++) {document.getElementById(\"btn\"+c).style.display = \"none\";}\n\n // display chosen buttons\n for (c=0;c<btn.length;c++) {\n if (btn[c] > 0)\n document.getElementById(\"btn\"+btn[c]).style.display = \"inline-block\";\n }\n\n document.getElementById(\"steuerung\").style.display = \"block\";\n if (document.getElementById(\"plugin__flashcard_edit_btn\")!=null) {\n if (JSINFO['access']==\"editor\") document.getElementById(\"plugin__flashcard_edit_btn\").style.display = \"inline-block\";\n }\n \n}", "menuButtonClicked() {}", "function selectMenuItem (menuSelector, menuItemSelector) {\n var curMenu = document.querySelector('.' + menuSelector),\n curActive = curMenu.querySelector('.active'),\n newMenuItem = curMenu.querySelector('.' + menuItemSelector),\n max, i;\n\n function selectMenu2 (menu2Selector) {\n var menu2List = document.querySelectorAll('.menu2'),\n curMenu2,\n i, max;\n\n for (i = 0, max = menu2List.length; i < max; i++) {\n curMenu2 = menu2List[i];\n if (curMenu2.classList.contains(menu2Selector)) {\n curMenu2.classList.remove('hidden');\n } else {\n curMenu2.classList.add('hidden');\n }\n }\n }\n\n function selectDocumentation (documentationSelector) {\n var documentationList = document.querySelectorAll('.doc-items'),\n curDocumentation,\n i, max;\n\n for (i = 0, max = documentationList.length; i < max; i++) {\n curDocumentation = documentationList[i];\n if (curDocumentation.classList.contains(documentationSelector)) {\n curDocumentation.classList.remove('hidden');\n } else {\n curDocumentation.classList.add('hidden');\n }\n }\n }\n\n curActive.classList.remove('active');\n newMenuItem.classList.add('active');\n\n switch (menuSelector) {\n case 'html-menu':\n var htmlDivList = document.getElementsByClassName('html-module'),\n curHtmlDiv;\n\n // Display appropriate HTML div\n for (i = 0, max = htmlDivList.length; i < max; i++) {\n curHtmlDiv = htmlDivList[i];\n if (menuItemSelector == curHtmlDiv.id){\n curHtmlDiv.classList.remove('hidden');\n }\n else {\n curHtmlDiv.classList.add('hidden');\n }\n }\n // Display appropriate 2nd menu\n selectMenu2(menuItemSelector + '-menu');\n // Display appropriate links to documentation\n selectDocumentation(menuItemSelector + '-doc');\n break;\n\n case 'mouse-movement-menu':\n case 'click-on-link-menu':\n case 'explore-form-menu':\n case 'drag-drop-menu':\n break;\n }\n\n}", "function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"<h1 id='title' style='position:relative;top:20px;left:-40px;width:500px;'>Sheep's Snake</h1><p style='position:absolute;top:250px;left:-50px;font-size:1.1em;' id='playA'>Press A to play!</p><p style='position:absolute;top:280px;left:-50px;font-size:1.1em;' id='playB'>Press B for some help !</p>\");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function initiateMenus() {\r\n\tmenus = [];\r\n\tfor (var i = menuNames.length - 1; i >= 0; i--) {\r\n\t\tlet menuItem = {\r\n\t\t\tname: menuNames[i],\r\n\t\t\tHTMLbutton: $(\"#button-menu\" + i)[0],\r\n\t\t\tHTMLelement: $(\"#menu\" + i)[0],\r\n\t\t\tHTMLclose: $(\"#close-\" + menuIdentifiers[i] + \"-menu\")[0],\r\n\t\t\tHTMLwindow: $(\"#\" + menuIdentifiers[i] + \"-overlay\")[0],\r\n\t\t\tHTMLcontent: $(\"#\" + menuIdentifiers[i] + \"-overlay-content\")[0]};\r\n\t\tmenus.push(menuItem);\r\n\t}\r\n}", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function menu(objElem, blnEvt) {\n //initalisieren de Menues beim ersten Aufruf\n if(arrTimeouts.length == 0) {\n objElem.onmouseover = new Function('f','return false');\n objMenu = objElem.parentNode;\n blnType = (objElem.rows.length > 1) ? 1 : 0;\n intItems=(blnType)? objElem.rows.length: objElem.rows[0].cells.length\n\n for(i = 0; i < intItems; ++i) {\n objCell = (blnType)? objElem.rows[i].cells[0] : objElem.rows[0].cells[i];\n objCell.onmouseover = new Function('f', 'menu('+i+', 1)');\n objCell.onmouseout = new Function('f',' menu('+i+', 0)');\n objSub = get_sub(objMenu, i+1);\n objSub.style.position = 'absolute';\n\n objSub.style.left = (blnType)\n ? (objCell.offsetLeft + (objSub.rows[0].cells[0].offsetLeft) + objCell.offsetWidth) + intXPadding\n : (objCell.offsetLeft + (objSub.rows[0].cells[0].offsetLeft)) + intXPadding;\n\n objSub.style.top = (blnType)\n ? objCell.offsetTop + (objElem.rows[0].cells[0].offsetTop) + intYPadding\n : objCell.offsetHeight + (objElem.rows[0].cells[0].offsetTop) + intYPadding;\n\n objSub.id = 'sub' + i;\n objSub.width = 1; //fixt opera-Macke mit Tabellenbreite\n objSub.onclick = new Function('f', 'this.style.display = \"none\"');\n objSub.onmouseover = new Function('f', 'menu(' + i + ', 1)');\n objSub.onmouseout = new Function('f', 'menu(' + i + ', 0)');\n objSub.className = 'sub';\n }\n return;\n }\n\n //Zeigen\n if(blnEvt) {\n clearTimeout(arrTimeouts[objElem]);\n document.getElementById('sub'+objElem).style.display = \"\";\n }\n //Verstecken\n else {\n arrTimeouts[objElem] = setTimeout('document.getElementById(\"sub'+objElem+'\").style.display=\"none\"', intTimeout);\n }\n}", "function initMenu()\n{\n\tcore_ativaPainelAjuda(\"ajuda\",\"botaoAjuda\");\n\tnew YAHOO.widget.Button(\"botao2\",{ onclick: { fn: function(){window.open('../../testainstal.php');}} });\n\t$parametros = {\n\t\"simples\": [\n\t\t{\n\t\t\tmensagem: \"ows_abstract\",\n\t\t\tcabeca: $trad(\"resumo\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_abstract\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_keywordlist\",\n\t\t\tcabeca: $trad(\"palavraChave\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_keywordlist\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_fees\",\n\t\t\tcabeca: $trad(\"taxas\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_fees\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_accessconstraints\",\n\t\t\tcabeca: $trad(\"restricao\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_accessconstraints\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_contactperson\",\n\t\t\tcabeca: $trad(\"pessoaContato\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_contactperson\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_contactorganization\",\n\t\t\tcabeca: $trad(\"organizacao\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_contactorganization\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_contactposition\",\n\t\t\tcabeca: $trad(\"cargo\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_contactposition\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_addresstype\",\n\t\t\tcabeca: $trad(\"tipoEndereco\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_addresstype\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_address\",\n\t\t\tcabeca: $trad(\"endereco\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_address\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_city\",\n\t\t\tcabeca: $trad(\"cidade\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_city\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_stateorprovince\",\n\t\t\tcabeca: $trad(\"estado\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_stateorprovince\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_postcode\",\n\t\t\tcabeca: $trad(\"cep\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_postcode\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_country\",\n\t\t\tcabeca: $trad(\"pais\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_country\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_contactelectronicmailaddress\",\n\t\t\tcabeca: $trad(\"email\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_contactelectronicmailaddress\"\n\t\t},\n\t\t{\n\t\t\tmensagem: \"ows_name\",\n\t\t\tcabeca: $trad(\"nomeServico\",i3GEOadmin.ogcws.dicionario),\n\t\t\tvariavel: \"ows_name\"\n\t\t}\n\t]};\n\tcore_carregando(\"ativa\");\n\tcore_pegaDados($trad(\"buscaParametro\",i3GEOadmin.ogcws.dicionario),\"../php/ogcws.php?funcao=pegaParametrosConfigura\",\"pegaParametros\");\n}", "buildMenus(){\r\n for(var menu of this.menus)\r\n this.container.innerHTML += this.buildMenu(menu)\r\n }", "function menuMissionAdmin(){\nvar menuModule=[]\n\t\tmenuModule.push('<div id=\"tabsMissions\"><ul><li>');\n\t\tmenuModule.push('<a href=\"#creerMiss\">Creer une nouvelle missions</a></li>');\n\t\tmenuModule.push('<li><a href=\"#modifMiss\">Remplir des questionnaires</a>');\n\t\tmenuModule.push('</li><li><a href=\"#suppMiss\">Supprimer un module</a></li></ul>');\n\t\tmenuModule.push('<div id=\"creerMiss\"><p>ici se trouveront les fonctions pour la creation des module</p></div>');\n\t\tmenuModule.push('<div id=\"modifMiss\"><p> ici pour la modif des modules</p></div>');\n\t\tmenuModule.push('<div id=\"suppMiss\"><p>ici la suppression</p><div></div>');\n\t\t$(\"#container\").html(menuModule.join(''));\n\t\t$(\"#tabsMissions\").tabs();\n}", "function menu(){\n toggleVisibility(\"root\",\"menu\");\n greeting();\n}", "function loadMenu(dest,type){\n// dest Aff = affluenze Com = composizione Scr = scrutinio\n// type 0 = regionali 1 = camera 2 = senato\n name = dest;\n tipo = type;\n \tif (name == 'Aff'){\n\t\tloadStato();\t\n\t}else{\n\t\tloadData();\n\t}\n}", "function setup_menu() {\n $('div[data-role=\"arrayitem\"]').contextMenu('context-menu1', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n $('div[data-role=\"prop\"]').contextMenu('context-menu2', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n }", "function mainProcess(){\n\n //2: It will then show the Menu = main_menu()\n //options in the main menu array\n main_menu(['Products ','View Credits ','Refund', 'Top-up']);\n\n //3: The user will select an item = main_menu()\n selection = getuserselection();\n\n //4: It will then go to what ever menu the user has selecetd\n menuSelection(selection);\n //If user selects Products this code will then show the products menu\nif(selection == 0){\n //get the choice from the user from the set array\n choice = getuserchoice();\n //From the choice\n purchase(choice);\n //5; It will show the remaining credit after purchase = purchase()\n showCredits();\n}\n}", "function init_menus(trees) {\n menus.pane = new Tweakpane.Pane({\n container: div_tweakpane,\n }).addFolder({ \n title: \"Control panel\", expanded: view.control_panel.show\n });\n\n const tab = menus.pane.addTab({ pages: [\n { title: \"Layout\" },\n { title: \"Selections\" },\n { title: \"Advanced\" },\n ]});\n create_menu_basic(tab.pages[0], trees);\n create_menu_selection(tab.pages[1]);\n create_menu_advanced(tab.pages[2])\n\n\n //const tab = menus.pane.addTab({ pages: [\n //{ title: \"Tree view\" },\n //{ title: \"Representation\" },\n //{ title: \"Selection\" },\n //]});\n //create_menu_main(tab.pages[0], trees);\n //create_menu_representation(tab.pages[1]);\n //create_menu_selection(tab.pages[2]);\n}", "function initMenu() {\n // Set up TreeMenu\n App4Sea.TreeMenu.SetUp();\n\n // Set up TreeInfo\n App4Sea.TreeInfo.SetUp();\n\n // Hook events to menu\n $(\"#MenuContainer input[type='checkbox']\").click(() => {\n updateBaseMap();\n });\n $('#MenuContainer select').change(() => {\n updateBaseMap();\n });\n }", "function menuStuff() {\n if (toggle === 1) {\n menu.css('display', 'table');\n setTimeout(function() {\n // menu.css('opacity', 1);\n menu.stop().animate({opacity: 1}, 200);\n // menuLi.css('left', '0');\n menuLi.stop().animate({left: 0}, 200);\n toggle = 0;\n }, 100);\n }\n if (toggle === 0) {\n // menu.css('opacity', 0);\n menu.stop().animate({opacity: 0}, 200);\n // menuLi.css('left', '-40px');\n menuLi.stop().animate({left: '-40px'}, 200);\n setTimeout(function() {\n menu.css('display', 'none');\n }, 600);\n toggle = 1;\n }\n }", "function f_set_menubar()\r\n{\r\n var retval = // # English # German\r\n [\r\n [\r\n [\"elem_menu\" ,\"Element\" ,\"Element\" ], \r\n [ \"input_item\" ,\"New (Alt-N)\" ,\"Neu (Alt-N)\" ],\r\n [ \"change_item\" ,\"Change (F2)\" ,\"&Auml;ndern (F2)\" ],\r\n [ \"delete_item\" ,\"Delete (Del)\" ,\"L&ouml;schen (Entf)\" ],\r\n [ \"copy_item\" ,\"Copy by Ref (Ctrl-L)\" ,\"Link Kopieren (Strg-L)\" ],\r\n [ \"clone_item\" ,\"Clone (Ctrl-C)\" ,\"Vollst. Kopieren (Strg-C)\" ],\r\n [ \"cut_item\" ,\"Cut (Ctrl-X)\" ,\"Ausschn. (Strg-X)\" ],\r\n [ \"paste_item\" ,\"Paste (Ctrl-V)\" ,\"Einf&uumlgen (Strg-V)\" ],\r\n [ \"export_item\" ,\"Export (Ctrl-Shift-Alt-E)\" ,\"Exportieren (Strg-Shift-Alt-E)\" ],\r\n [ \"do_nothing\" ,\"--------------------\" ,\"--------------------\" ],\r\n [ \"lock_topic\" ,\"Lock (Ctrl-Shift-Alt-L)\" ,\"Festhalten (Strg-Shift-Alt-L)\" ],\r\n [ \"as_news\" ,\"as News Ticker\" ,\"als Nachr.-Ticker\" ],\r\n [ \"as_date\" ,\"as Date Ticker\" ,\"als Termine-Ticker\" ] \r\n ],\r\n \r\n c_LANG_LIB_TREE_ELEMTYPE\r\n ,\r\n [\r\n [\"fav_menu\" ,\"Favorites\" ,\"Favoriten\" ],\r\n [ \"save_favorite\" ,\"Save\" ,\"Speichern\" ],\r\n [ \"load_favorite\" ,\"Load\" ,\"Laden\" ],\r\n [ \"delete_favorite\" ,\"Delete Single\" ,\"Einzeln L&ouml;schen\" ],\r\n [ \"deleteall_favorites\" ,\"Delete All\" ,\"Alle L&ouml;schen\" ] \r\n ], \r\n [\r\n [\"setup_menu\" ,\"Setup\" ,\"Einstellungen\" ],\r\n [ \r\n [\"lang_menu\" ,\"Language\" ,\"Sprache\" ],\r\n ( [\"#output_list\", \"language_select\"]).concat(c_LANG.slice(1,c_LANG.length)) \r\n ] , \r\n [ \r\n [\"db_type\" ,\"Database Type\" ,\"Datenbank-Typ\" ],\r\n [\"#output_list\" ,\"db_type\", \"XML\", \"SQL-Based\"] // \"XML Localhost\", \"XML WWW\", \"SQL-Based WWW\"]\r\n // [\"xml_local\" ,\"XML Localhost\" ,\"XML Localhost\" ],\r\n // [\"xml_web\" ,\"XML on WWW\" ,\"XML im WWW\" ],\r\n // [\"disco_web\" ,\"DISCO on WWW\" ,\"DISCO\" ]\r\n \r\n ] ,\r\n // [\r\n // [\"setup_path_menu\" ,\"Setup Path\" ,\"Pfad zu Einstellungen\" ],\r\n // [\r\n // [\"setup_path_type\" ,\"Type of Source\" ,\"Quellentyp\" ],\r\n // [\"#output_list\" ,\"setup_src_type\", \"RAM\", \"Cookie\", \"DISCO!\", \"XML\"]\r\n // ],\r\n // [\r\n // [\"setup_path_url\" ,\"Path/URL\" ,\"Pfad/URL\" ],\r\n // [\"#input_field\" ,\"setup_src_path\"]\r\n // ]\r\n // ]\r\n [\r\n [\"disp_type\" ,\"Display Type\" ,\"Darstellung\" ],\r\n [\"#output_list\" ,\"disp_type\", \"Tree\", \"Bubbles\"]\r\n // [\"disp_tree\" ,\"Tree ()\" ,\"Baum ()\" ],\r\n // [\"disp_bubbles\" ,\"Bubbles ()\" ,\"Kugeln ()\" ]\r\n ] ,\r\n [\r\n [\"other_setups\" ,\"Other Setups\" ,\"Andere Einstellg.\" ], \r\n [\"#output_list\" ,\"aux_setups\", \"Config Subtree\"] \r\n ],\r\n [\r\n [\"permissions\" ,\"Permissions\" ,\"Zugriffsrechte\" ],\r\n [\"#output_list\" ,\"change\", \"change=\"+String(1-uc_browsing_change_permission)]\r\n ]\r\n ], \r\n [ \r\n // Menu Title \r\n [\"help_menu\" ,\"Help\" ,\"Hilfe\" ],\r\n // [ \"tutorial\" ,\"Tutorial\" ,\"Tutorial\" ],\r\n [ \"erase_cookies\" ,\"Clear Cookies\" ,\"Cookies löschen\" ],\r\n [ \"send_err_log\" ,\"Send Error Log\" ,\"Fehlerbericht senden\" ],\r\n [ \"display_hint\" ,\"Hints\" ,\"Tips\" ],\r\n [ \"source_code\" ,\"Source Code\" ,\"Quellcode\" ],\r\n [ \"display_version\" ,\"Current Version\" ,\"Aktuelle Version\" ]\r\n ]\r\n \r\n ];\r\n\r\n return retval; \r\n}", "function qll_system_menu()\r\n{\r\n\tmenu = document.createElement(\"div\");\r\n\tmenu.setAttribute('id','QLLSMenu');\r\n\tmenu.setAttribute('name','QLLSMenu');\r\n\tdocument.getElementsByTagName(\"body\")[0].appendChild(menu);\r\n\t\r\n\th = document.createElement(\"div\");\r\n\th.setAttribute('id','QLLSMenuHolder_open');\r\n\th.setAttribute('class','QLLSMenuHolder');\r\n\th.innerHTML= '<div class=\"QLLSMenuMHeader\" id=\"QLLSMenuMHeader_open\">'+qll_lang[5]+'</div><div class=\"QLLSMenuContainer\" id=\"QLLSMenuContainer_open\"><div class=\"QLLSMenuHeader\" id=\"QLLSMenuHeader_open\">'+qll_lang[5]+'</div></div>';\r\n\th.setAttribute('onmouseover','document.getElementById(\"QLLSMenuContainer_open\").setAttribute(\"style\",\"display:block;\");');\r\n\th.setAttribute('onmouseout','document.getElementById(\"QLLSMenuContainer_open\").setAttribute(\"style\",\"display:none;\");');\r\n\tmenu.appendChild(h);\r\n\t$(\"#QLLSMenuHeader_open\").click(qll_menu);\r\n\r\n\tch = Number(document.getElementById(\"QLLSMenuContainer_open\").offsetHeight)+5;\r\n\tif(window.innerHeight-60 < ch) ch = Number(Number(window.innerHeight)-60);\r\n\tGM_addStyle(\"#QLLSMenuContainer_open {height:\"+ch+\"px;}\");\r\n\t$(\"#QLLSMenuContainer_open\").hide();\r\n\t\r\n\t\r\n\th = document.createElement(\"div\");\r\n\th.setAttribute('id','QLLSMenuHolder_info');\r\n\th.setAttribute('class','QLLSMenuHolder');\r\n\th.innerHTML= '<div class=\"QLLSMenuMHeader\" id=\"QLLSMenuMHeader_info\">'+qll_lang[82]+'</div><div class=\"QLLSMenuContainer\" id=\"QLLSMenuContainer_info\"><div class=\"QLLSMenuHeader\" id=\"QLLSMenuHeader_info\">'+qll_lang[82]+'</div></div>';\r\n\th.setAttribute('onmouseover','document.getElementById(\"QLLSMenuContainer_info\").setAttribute(\"style\",\"display:block;\");');\r\n\th.setAttribute('onmouseout','document.getElementById(\"QLLSMenuContainer_info\").setAttribute(\"style\",\"display:none;\");');\r\n\tmenu.appendChild(h);\r\n\t\r\n\tinfo = document.getElementById('QLLSMenuContainer_info');\r\n\tinfo.innerHTML = info.innerHTML + '<a class=\"QLLSMenuElement\" id=\"QLLSMenuElement_changelog\" href=\"#QLLSMenu\">'+qll_lang[18]+'</a> \\\r\n\t\t<a class=\"QLLSMenuElement\" href=\"http://www.erepublik.com/en/newspaper/186857/1\" target=\"_blank\">'+qll_lang[83]+'</a> \\\r\n\t\t<a class=\"QLLSMenuElement\" href=\"http://economy.erepublik.com/en/citizen/donate/1376818\" target=\"_blank\">'+qll_lang[84]+'</a>';\r\n\t$(\"#QLLSMenuElement_changelog\").click(function(){qll_fun_showDisplayBox(qll_lang[18], qll_serverURI + '/changelog', true);});\r\n\t\r\n\tch = Number(document.getElementById(\"QLLSMenuContainer_info\").offsetHeight)+5;\r\n\tif(window.innerHeight-60 < ch) ch = Number(Number(window.innerHeight)-60);\r\n\tGM_addStyle(\"#QLLSMenuContainer_info {height:\"+ch+\"px;}\");\r\n\t$(\"#QLLSMenuContainer_info\").hide();\r\n}", "renderMenu(data) {\n // check if there is 1 valid category\n if (data.size < 1) {\n selectors.$content.append(`<p class=\"text-center font-weight-bold\">Infelizmente, nenhuma notícia foi encontrada!</p>`)\n console.log(\"nenhuma categoria encontrada\");\n return;\n }\n\n data.forEach(el => {\n selectors.$menu.append(`<li class=\"nav-item item\" id=\"${el.id}\" data-item><p class=\"nav-link\">${el.nome}</p></li>`)\n })\n\n\n selectors.$menu.find(\"li\").filter(\".item\").on('click', (e) => {\n this._initShowNews(e.currentTarget.id)\n })\n }", "function Menu(params) {\n\n let parentDiv = params.parentDiv;\n if (typeof(parentDiv) == 'string') parentDiv = document.getElementById(parentDiv);\n// div menu\n let divMenu=document.createElement('div');\n divMenu.setAttribute (\"id\",params.idDivMenu);\n// title\n let dt = document.createElement('div');\n dt.classList.add('title');\n dt.appendChild(document.createTextNode(params.title));\n divMenu.appendChild(dt);\n\n for (let k = 0; k < params.lines.length; ++k){\n dt=document.createElement('div');\n dt.classList.add('line');\n dt.appendChild(document.createTextNode(params.lines[k].text));\n dt.style.top=(params.lineOffset + k * params.lineStep) + \"px\";\n dt.addEventListener(\"click\",params.lines[k].func);\n divMenu.appendChild(dt);\n }\n divMenu.style.height = (params.lineOffset + params.lines.length * params.lineStep) +'px'\n parentDiv.appendChild(divMenu);\n} // Menu", "function main () {\n\t$('.bt-menu').click(function(){\n\t\tif (contador == 1) {\n\t\t\t$('nav').animate({\n\t\t\t\tleft: '0'\n\t\t\t});\n\t\t\tcontador = 0;\n\t\t\tmenuresp =menuresp+1;\n\t\t} else {\n\t\t\tcontador = 1;\n\t\t\t//menuresp = menuresp+1;\n\t\t\t$('nav').animate({\n\t\t\t\tleft: '-100%'\n\t\t\t});\n\t\t}\n\t});\n\n\t// Mostramos y ocultamos submenus\n\t$('.submenu').click(function(){\n\t\t$(this).children('.children').slideToggle();\n\t});\n\tvar altura= $('.menu').offset().top;\n\t//alert(altura);\n\t$(window).on('scroll', function(){\n\t\tif ($(window).scrollTop()> altura) {\n\t\t\t$('.menu').addClass('sticky');\n\t\t} else{\n\t\t\t$('.menu').removeClass('sticky');\n\t\t}\n\t});\n}", "function activateMenus() {\n\t\t$('#search-menu').delegate('.menu-button', 'click', function (e) {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\t$('body').toggleClass('sideNav');\n\t\t});\n\n\t\t$('nav li:has(.mega, .sub) > a').click(function (e) {\n\t\t\te.preventDefault();\n\n\t\t\tvar li = $(this).parent();\n\n\t\t\t// Only close menu if user clicked to open it\n\t\t\tif (li.hasClass('hover') && clickOpened) {\n\t\t\t\tli.removeClass('hover');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tli.addClass('hover');\n\t\t\t\t$('nav li').not(li).removeClass('hover');\n\t\t\t\tclickOpened = true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\t$('nav li:has(.mega, .sub)').click(function (e) {\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t/* Positions menu divs */\n\t\t$('nav li .sub').each(function () {\n\t\t\tvar mega = $(this);\n\t\t\tvar left = mega.parent().position().left;\n\t\t\tif (left > mega.parent().parent().outerWidth() - mega.outerWidth()) {\n\t\t\t\tmega.css('right', 0);\n\t\t\t}\n\t\t});\n\n\t\t//Listener for if screen is resized to close sideNav\n\t\t$(window).resize(function (){\n\t\t\tif ($(window).width() <= 256){\n\t\t\t\t$('body').removeClass('sideNav');\n\t\t\t} \n\t\t});\n\n\t\t$(\"body\").click(function(){\n\t\t\t$(\".hover\").removeClass(\"hover\");\n\t\t}); \n\t\t\n\t\t$(\"#content\").click(function(){\n\t\t\t$(\"body\").removeClass(\"sideNav\");\n\t\t});\n\n\t}", "function multiLevelMenu() {\n for (let abc of list) {\n abc.addEventListener('click', function (e) {\n e.stopPropagation();\n remove(this);\n if(this.children[0].nextElementSibling === null) {\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n } else {\n if (this.children[0].nextElementSibling !== null) {\n if (this.children[1].classList.contains('open')) {\n this.children[1].classList.remove('open');\n this.classList.remove('active');\n } else {\n this.children[1].classList.add('open');\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n }\n } \n }\n })\n }\n\n // get nav link text and passing in include HTML file function\n $.each(listMenus, function(ind, currentMenu) {\n currentMenu.addEventListener('click', function(e) {\n pageUrl = $(this).text().trim(); // get text and remove white space around sentence\n pageId++; \n includeHTmlFile(pageUrl);\n })\n })\n }", "function abrirSubMenu(idMenu){\r\n\r\n if(idMenu==1){\r\n $(\"#subMenuCursos\").css(\"display\",\"block\");\r\n $(\"#subMenuSaidas\").css(\"display\",\"none\");\r\n }\r\n\r\n if(idMenu==2){\r\n $(\"#subMenuSaidas\").css(\"display\",\"block\");\r\n $(\"#subMenuCursos\").css(\"display\",\"none\");\r\n }\r\n\r\n\r\n\r\n\r\n}", "loadMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n break;\n case MenuChoices.load:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.loadContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.loadButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n break;\n }\n }", "function gameMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n gameMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n gameMenuStartableid.classList.remove('game-menu-startable');\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\n if (store.getState().activeGameState.isMap1Completed != true) {\n gameMenuStarthereTextid.classList.add('nodisplay');\n }\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n\n loadSavedMenuid.classList.remove('load-saved-menu');\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function add_menu(){\n\t/******* add menu ******/\n\t// menu itsself\n\tvar menu=$(\"#menu\");\n\tif(menu.length){\n\t\trem_menu();\n\t};\n\n\tmenu=$(\"<div></div>\");\n\tmenu.attr(\"id\",\"menu\");\n\tmenu.addClass(\"menu\");\n\t\n\t//////////////// rm setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#rm_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"rules\",\"style\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"rm_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// rm setup //////////////////\n\n\t//////////////// area setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#areas_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"areas\",\"home\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"areas_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// area setup //////////////////\n\n\t//////////////// camera setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#cameras_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"units\",\"camera_enhance\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"cameras_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// camera setup //////////////////\n\n\t//////////////// user setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#users_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t\tlogin_entry_button_state(\"-1\",\"show\");\t// scale the text fields for the \"new\" entry = -1\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"users\",\"group\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"users_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// user setup //////////////////\n\n\n\t//////////////// logout //////////////////\n\tvar f=function(){\n\t\t\tg_user=\"nongoodlogin\";\n\t\t\tg_pw=\"nongoodlogin\";\n\t\t\tc_set_login(g_user,g_pw);\n\t\t\ttxt2fb(get_loading(\"\",\"Signing you out...\"));\n\t\t\tfast_reconnect=1;\n\t\t\tcon.close();\n\n\t\t\t// hide menu\n\t\t\trem_menu();\n\t};\n\tadd_sidebar_entry(menu,f,\"log-out\",\"vpn_key\");\n\t//////////////// logout //////////////////\n\n\t////////////// hidden data_fields /////////////\n\tvar h=$(\"<div></div>\");\n\th.attr(\"id\",\"list_cameras\");\n\th.hide();\n\tmenu.append(h);\n\n\th=$(\"<div></div>\");\n\th.attr(\"id\",\"list_area\");\n\th.hide();\n\tmenu.append(h);\n\t////////////// hidden data_fields /////////////\n\n\n\tmenu.insertAfter(\"#clients\");\n\t\n\n\tvar hamb=$(\"<div></div>\");\n\thamb.click(function(){\n\t\treturn function(){\n\t\t\ttoggle_menu();\n\t\t}\n\t}());\n\thamb.attr(\"id\",\"hamb\");\n\thamb.addClass(\"hamb\");\n\tvar a=$(\"<div></div>\");\n\tvar b=$(\"<div></div>\");\n\tvar c=$(\"<div></div>\");\n\ta.addClass(\"hamb_l\");\n\tb.addClass(\"hamb_l\");\n\tc.addClass(\"hamb_l\");\n\thamb.append(a);\n\thamb.append(b);\n\thamb.append(c);\n\thamb.insertAfter(\"#clients\");\n\t/******* add menu ******/\n}", "initMenus(menus) {\n let xhtml = null\n let manageMenu = menus[2];\n if (manageMenu && manageMenu.sub_menus && manageMenu.sub_menus.length) {\n xhtml = manageMenu.sub_menus.map((menu, index) => {\n return (\n <SelectMenuLink key={index} menu={menu} />\n )\n })\n }\n return xhtml\n }", "function updateRoles(){\n console.log('update role')\n mainMenu();\n}", "function fecharSubMenu(idMenu){\r\n \r\n if(idMenu==1){\r\n $(\"#subMenuCursos\").css(\"display\",\"none\");\r\n }\r\n\r\n if(idMenu==2){\r\n $(\"#subMenuSaidas\").css(\"display\",\"none\");\r\n }\r\n\r\n}", "function OsSelectMenu() {\r\n $('.select-menu').each(function () {\r\n $(this).selectmenu();\r\n })\r\n }", "function closeAllMenus(){\n closeMenu(\"divMenuHelp\");\n closeMenu(\"divMenuOpt\");\n closeMenu(\"divMenuGame\"); }", "init( _menus ) {\r\n const self = this;\r\n\r\n if ( ! Array.isArray( _menus ) || ! _menus.length ) {\r\n self.menuError( '[menuHandler] [general] Initialization requires an array of menus to be passed as an argument. see documentation' );\r\n }\r\n\r\n _menus.forEach( function ( _menu ) {\r\n const menuTemplate = {\r\n name: null,\r\n open: null,\r\n close: null,\r\n enterFocus: null,\r\n exitFocus: null,\r\n activeOpen: null,\r\n activeClose: null,\r\n activeEnterFocus: null,\r\n activeExitFocus: null,\r\n container: null,\r\n innerContainer: null,\r\n loop: false,\r\n type: 'menu', // menu, dropdown, popup // TODO: add to README\r\n isOpen: false, // run time\r\n isPinned: false, // run time\r\n isMobile: false, // run time\r\n openDelay: 0,\r\n closeDelay: 0,\r\n debounce: 20,\r\n openOnMouseEnter: false,\r\n transitionDelay: 0, // run time\r\n transitionDuration: 0, // run time\r\n orientation: 'horizontal', // TODO: add to README\r\n direction: null, // TODO: add to README\r\n menuFunc: self.menuFunc,\r\n pin: false,\r\n preventBodyScroll: true,\r\n mobile: {\r\n breakpoint: '667px',\r\n open: null,\r\n close: null,\r\n pin: false,\r\n enterFocus: null,\r\n exitFocus: null,\r\n orientation: 'vertical',\r\n preventBodyScroll: true,\r\n },\r\n on: {\r\n beforeInit: null,\r\n afterInit: null,\r\n beforeOpen: null,\r\n afterOpen: null,\r\n beforeClose: null,\r\n afterClose: null,\r\n beforePinOpen: null,\r\n afterPinOpen: null,\r\n beforePinClose: null,\r\n afterPinClose: null,\r\n },\r\n submenuOptions: {\r\n isEnabled: true,\r\n menuFunc: self.submenuFunc,\r\n openOnMouseEnter: false,\r\n closeOnBlur: true,\r\n closeDelay: 0,\r\n orientation: 'vertical',\r\n closeSubmenusOnOpen: true,\r\n mobile: {\r\n closeOnBlur: true,\r\n closeDelay: 0,\r\n closeSubmenusOnOpen: true,\r\n orientation: 'vertical',\r\n },\r\n on: {\r\n beforeOpen: null,\r\n afterOpen: null,\r\n beforeClose: null,\r\n afterClose: null,\r\n }\r\n },\r\n actions: {},\r\n submenus: {},\r\n };\r\n\r\n if ( ! _menu.name ) {\r\n menuTemplate.name = Math.random().toString( 36 ).substr( 2 ); // create a random menu name from a random number converted to base 36.\r\n } else {\r\n menuTemplate.name = _menu.name;\r\n }\r\n\r\n if ( ! _menu.elements ) {\r\n self.menuError( `[menuHandler] [menu:${menuTemplate.name}] Error: menu elements object is missing` );\r\n }\r\n self.initMenuElements( menuTemplate, _menu.elements );\r\n\r\n if ( _menu.mobile && _menu.mobile.elements ) {\r\n self.initMenuMobileElements( menuTemplate, _menu.mobile.elements );\r\n }\r\n\r\n self.initMenuOptions( menuTemplate, _menu );\r\n\r\n menuTemplate.direction = getComputedStyle( menuTemplate.container ).direction;\r\n\r\n // ! important: in order to find the event and remove it by removeEventListener, \r\n // we need to pass a reference to the function and bind it to the menuHandler object\r\n menuTemplate.toggleMenu = self.toggleMenu.bind( self, menuTemplate );\r\n\r\n if ( self.checkRequiredElement( menuTemplate ) ) {\r\n self.menus.push( menuTemplate );\r\n }\r\n } );\r\n\r\n if ( ! self.menus.length ) {\r\n self.menuError( `[menuHandler] [general] Error: no menus initialized` );\r\n }\r\n\r\n self.initMenus();\r\n }", "function main(){\n\t$('.Menu_barras').click(function(){ //Función OnClick\n\t\tif(contador == 1){\n\t\t\t$('nav').animate({\n\t\t\t\tleft:'0' //Hace que Nav aparezca \n\t\t\t});\n\t\tcontador = 0;\n\t\tdocument.getElementById('img1').style.display = 'none';\n\t\tdocument.getElementById('img2').style.display = 'none';\n\t}else{\n\t\t$('nav').animate({\n\t\t\tleft:'-120%' //Vuelve a ocultar nav\n\t\t});\n\t\tcontador = 1;\n\t\tdocument.getElementById('img1').style.display = 'none';\n\t\tdocument.getElementById('img2').style.display = 'none';\n\t}\n\t\t\n\t});\n}", "collapseMenu() {\r\n\t}", "function Afstande()\r\n{\r\n\tdocument.getElementById(\"Afstande\").style.display=\"inline\";\r\n\tdocument.getElementById(\"Afstande_menu\").className=\"sub_menu_2\";\r\n\tdocument.getElementById(\"Tekst_2\").style.display=\"none\";\r\n\tdocument.getElementById(\"Tekst_2_menu\").className=\"sub_menu_1\";\r\n\tdocument.getElementById(\"Overskrifter\").style.display=\"none\";\r\n\tdocument.getElementById(\"Overskrifter_menu\").className=\"sub_menu_1\";\r\n\tdocument.getElementById(\"Kommentarer\").style.display=\"none\";\r\n\tdocument.getElementById(\"Kommentarer_menu\").className=\"sub_menu_1\";\r\n\tdocument.getElementById(\"Gem_layout\").style.display=\"none\";\r\n\tdocument.getElementById(\"Gem_layout_menu\").className=\"sub_menu_1\";\r\n}", "function menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}", "function mediacontrollermenu() {\r\n try { gvar.page_lang=get_page_lang(); } catch(err) { show_alert('Initialisation failed: '+err); }\r\n try { add_media_controller(); } catch(err) { show_alert('media_controller => '+err); }\r\n}" ]
[ "0.7892099", "0.76655406", "0.7402291", "0.73971885", "0.7183003", "0.7127317", "0.7086527", "0.6965697", "0.6904595", "0.6903715", "0.6886215", "0.6848438", "0.6812586", "0.679516", "0.6788568", "0.6738062", "0.6712725", "0.67064685", "0.6700338", "0.6700084", "0.6685255", "0.66789687", "0.66580147", "0.66535664", "0.6650954", "0.6641772", "0.6632238", "0.6617964", "0.6592682", "0.6591601", "0.6573555", "0.6568377", "0.65534097", "0.65464264", "0.6542719", "0.6527465", "0.65171736", "0.6516805", "0.65080357", "0.6495963", "0.6494877", "0.6493818", "0.6488395", "0.6482306", "0.6481884", "0.64771783", "0.64737415", "0.6468214", "0.6461825", "0.6456525", "0.6454247", "0.64529485", "0.6451328", "0.6451243", "0.64507145", "0.64408827", "0.6440699", "0.64405334", "0.6437467", "0.64369744", "0.64166063", "0.6408389", "0.64067966", "0.64056796", "0.64012545", "0.6371701", "0.6370549", "0.6367115", "0.63602567", "0.63538176", "0.6348858", "0.6347982", "0.63475955", "0.63445777", "0.6340973", "0.6337243", "0.6332137", "0.632247", "0.63213134", "0.63212305", "0.6319855", "0.6314937", "0.6312726", "0.6310408", "0.63069636", "0.63021487", "0.6299518", "0.62983936", "0.6297875", "0.62959784", "0.62935436", "0.6293391", "0.6288816", "0.62880665", "0.628408", "0.6283513", "0.62734216", "0.62681544", "0.6263744", "0.6259859", "0.62580055" ]
0.0
-1
dependent on selected conversion mode via radiobutton
execConvert(mode) { switch (mode) { case "bin": return new BinaryConverter(); case "rom": return new RomanConverter(); default: return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineConverter (clickEvent) {\n if (radioCel.checked === true) {\n toCelsius();\n } else {\n toFahrenheit();\n }\n}", "function determineConverter (clickEvent) {\n\tuserTemp = document.getElementById(\"userTemp\").value;\n\n\tif(fRadio.checked){\n\t\ttoFahrenheit(userTemp);\n\t\tconsole.log(\"FAHRENHEIT\");\n\t\treturn;\n\t}else if(cRadio.checked){\n\t\ttoCelsius(userTemp);\n\t\tconsole.log(\"CELSIUS\");\n\t\treturn;\n\t}else{\n\t\treturn;\n\t}\n\tconsole.log(\"Input: \", userTemp);\n}", "function determineConverter (clickEvent) {\n\n\tvar fahBtn = document.getElementById(\"fahrenheit-scale-radio\");\n\tvar celsBtn = document.getElementById(\"celsius-scale-radio\");\n\n\t//calls upon the functions that convert temperatures\n\tif (fahBtn.checked){\n\t\ttoFahrenheit(userInput.value);\n\t}else if (celsBtn.checked) {\n\t\ttoCelsius(userInput.value);\n\t}\n\tdebugger\n\tif (fahBtn.checked && userInput.value > 32 || celsBtn.checked && userInput > 90){\n\t\tconsole.log('red');\n\t}else if(fahBtn.checked && userInput.value < 32 || celsBtn.checked && userInput < 0){\n\t\tconsole.log('blue');\n\t}else{\n\t\tconsole.log('green')\n\t}\n}", "function determineConverter(clickevent) {\n\n if (toF.checked === true && tempInput.value !== \"\") {\n var cTemp = toCelsius(tempInput.value);\n tempOutput.value = +cTemp.toFixed(1);\n } else if (toC.checked === true && tempInput.value !== \"\") {\n var fTemp = toFahrenheit(tempInput.value);\n tempOutput.value = +fTemp.toFixed(1);\n }\n}", "radiosetter(event){\n console.log(event.target.value)\n switch (event.target.value) {\n case \"TRUE\":\n window.$attend = event.target.value\n break;\n case \"FALSE\":\n window.$attend = event.target.value\n break;\n case \"Public\":\n window.$classi = event.target.value\n break;\n case \"Private\":\n window.$classi = event.target.value\n break;\n case \"Confidential\":\n window.$classi = event.target.value\n break;\n case \"3\":\n window.$prio = event.target.value\n break;\n case \"2\":\n window.$prio = event.target.value\n break;\n case \"1\":\n window.$prio = event.target.value\n break;\n case \"reTRUE\":\n window.$reoccur = true\n break;\n case \"reFALSE\":\n window.$reoccur = false\n break;\n }\n }", "function radioSelection(already, num){\n var mode = document.getElementById('mode-num').innerHTML;\n if(mode == num){\n already.checked = false;\n mode = 0;\n viewTag.checked = true;\n }\n}", "function determineConverter (clickEvent) {\n var startTemp = numberGet();\n if (choiceFahren) {\n \ttoFahrenheit(startTemp);\n } else {\n \ttoCelsius(startTemp);\n }\n}", "function setMode(radioButton) {\n REDIPS.drag.dropMode = radioButton.value;\n}", "openConvert(){\n this.convert = true; \n }", "function getCalcMode() {\n // current calculaltion mode : amort, duration or capital\n return $('#modeForm input[type=radio]:checked').val()\n}", "function updateRadio(val) {\n toolType = val;\n}", "function determineConverter (clickEvent) {\r\n console.log(\"event\", clickEvent);\r\n \r\n var userTemperature = document.getElementById(\"enterTemp\").value;\r\n var celsiusChecked = document.getElementById(\"chkCel\").checked;\r\n var fahrenheitChecked = document.getElementById(\"chkFar\").checked;\r\n var displayTemp = document.getElementById(\"convertedTemp\");\r\n\r\n if (celsiusChecked) {\r\n console.log(\"cel check\");\r\n toCelsius(userTemperature);\r\n console.log(\"toCelsius\", toCelsius(userTemperature));\r\n displayTemp.innerHTML = toCelsius(userTemperature);\r\n if (toCelsius(userTemperature) >= 32) {\r\n displayTemp.style.color = \"red\";\r\n } else if (toCelsius(userTemperature) <= 0) {\r\n displayTemp.style.color = \"blue\";\r\n } else {\r\n displayTemp.style.color = \"green\";\r\n }\r\n } \r\n else if (fahrenheitChecked) {\r\n console.log(\"far check\");\r\n toFahrenheit(userTemperature);\r\n console.log(\"toFahrenheit\", toFahrenheit(userTemperature));\r\n displayTemp.innerHTML = toFahrenheit(userTemperature);\r\n if (toFahrenheit(userTemperature) >= 90) {\r\n displayTemp.style.color = \"red\";\r\n } else if (toFahrenheit(userTemperature) <= 32) {\r\n displayTemp.style.color = \"blue\";\r\n } else {\r\n displayTemp.style.color = \"green\";\r\n }\r\n }\r\n}", "function reactionRadio () {\n genDC = rb2.checked; // Flag für Gleichspannungs-Generator (mit Kommutator) \n reset(); // Ausgangsstellung\n }", "function RadioButton(value) {\n dmsManifestConfig.SelectedValue = value;\n if (value == \"Consignment\") {\n getConsignmentDetails();\n ManifestOrdersCtrl.ePage.Masters.Consignment = true;\n ManifestOrdersCtrl.ePage.Masters.SalesOrder = false;\n ManifestOrdersCtrl.ePage.Masters.ASNLine = false;\n } else if (value == \"ASNLine\") {\n // getASNDetails();\n ManifestOrdersCtrl.ePage.Masters.ASNLine = true;\n ManifestOrdersCtrl.ePage.Masters.Consignment = false;\n ManifestOrdersCtrl.ePage.Masters.SalesOrder = false;\n } else if (value == \"SalesOrder\") {\n getOrderDetails();\n ManifestOrdersCtrl.ePage.Masters.SalesOrder = true;\n ManifestOrdersCtrl.ePage.Masters.ASNLine = false;\n ManifestOrdersCtrl.ePage.Masters.Consignment = false;\n }\n GetConfigDetails(value);\n }", "function checkMode(){\n var selValue = comboSelectedValueGet('tf1_selAdvtMode');\n if (!selValue) \n return;\n switch (parseInt(selValue, 10)) {\n case 1:\n fieldStateChangeWr('', '', 'tf1_txtAdvInterval', '');\n vidualDisplay('tf1_txtAdvInterval', 'configRow');\n vidualDisplay('break_txtAdvInterval', 'break');\n \n break;\n case 2:\n fieldStateChangeWr('tf1_txtAdvInterval', '', '', '');\n vidualDisplay('tf1_txtAdvInterval', 'hide');\n vidualDisplay('break_txtAdvInterval', 'hide');\n \n break;\n }\n}", "function reactionRadioButton () {\n if (rbR.checked) {dPhi = 0; r = 500;} // Für Widerstand: Phasenverschiebung, Widerstand\n else if (rbC.checked) {dPhi = Math.PI/2; c = 0.0001;} // Für Kondensator: Phasenverschiebung, Kapazität\n else {dPhi = -Math.PI/2; l = 200;} // Für Spule: Phasenverschiebung, Induktivität\n reaction(false); // Eingabefelder aktualisieren, rechnen, Ausgabe aktualisieren\n }", "_changeToRadioButtonMode(newValue, container, item) {\n if (newValue === 'radioButton') {\n const checkedChildren = [];\n\n for (let i = 0; i < container.childElementCount; i++) {\n const currentItem = container.children[i];\n\n if (currentItem.checked && !currentItem.disabled && !currentItem.templateApplied) {\n checkedChildren.push(currentItem);\n }\n }\n\n this._validateRadioButtonSelection(item, item ? item.level + 1 : 1, checkedChildren);\n }\n }", "function gameSettings_radio(event) {\r\n\tevent.preventDefault();\r\n\tevent.stopPropagation();\r\n\t//button sound\r\n\tbtnSound();\r\n\t//change setting\r\n\tvar state = event.target.value;\r\n\tsettings.console = state;\r\n\tvar consoles = document.querySelectorAll('.gameScreen .playerGroup-btn');\r\n\t\r\n\tconsoles.forEach(function(console){\r\n\t\tconsole.classList.remove('typeA', 'typeB');\r\n\t\tconsole.classList.add(state);\r\n\t});\r\n\t\r\n\t//update canvas\r\n\tactivate_canvas(settings.console);\r\n}", "function definisciRadioEntrataSpesa() {\n ['fieldsetRicercaConciliazioni', 'inserimento_fieldsetConciliazioni', 'aggiornamento_fieldsetConciliazioni'].forEach(function(val) {\n $('input[type=\"radio\"][name^=\"entrataSpesa\"]', '#' + val).change(showHideCampiRicerca.bind(undefined, '#' + val)).filter(':checked').change();\n });\n }", "function onSelectRecurringType(){\n var type = getSelectedRadioButton(\"type_option\");\n if (type == \"none\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(false);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"once\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"day\") {\n enabledDay(true);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"week\") {\n enabledDay(false);\n enabledWeek(true);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"month\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(true);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"year\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(true);\n enableField([\"total\"],true);\n }\n if (type != \"none\" && type != \"once\" ) {\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(true);\n }\n \n //add note\n addNote();\n \n //display area by type\n displayAreaBytype(type);\n}", "radioHandler(radio) {\n if (this.difficulty === radio.value) {\n radio.classList.add('active');\n }\n radio.onclick = () => {\n this.resetRadioStyle();\n this.newGame.setDifficulty(radio.value);\n radio.classList.add('active');\n };\n }", "function getDexType() {\n // get either national or galar dex\n var nationalDexChosen = document.getElementById(\"national\").checked;\n var galarDexChosen = document.getElementById(\"galar\").checked;\n\n if (nationalDexChosen) {\n return \"national\"\n }\n else if (galarDexChosen) {\n return \"galar\"\n }\n}", "_prescriptionLogic(button,option){\n\t\tif(this.rank == 3){\n\t\t\tvar data_for_next = {'next_category':'graduacion1','button_id':'','category_position':3,'button_type':button.className}\n\t\t\tthis.lensTable.showNextCategory(data_for_next);\n\t\t}else{\n\t\t\tvar data_for_next = {'next_category': null,'button_id':'','category_position':4,'button_type':button.className}\n\t\t\tthis._erasePhotoInput();\n\t\t\tif(option.name == 'opcion1'){\n\t\t\t\tdata_for_next['next_category'] = 'graduacion2';\n\t\t\t\tthis.lensTable.showNextCategory(data_for_next);\n\t\t\t}else{\n\t\t\t\tthis._restOfOptionsLogic(button,option,data_for_next);\n\t\t\t}\n\t\t}\t\n\t}", "function conversionToggle() {\n if ( $('#conversion_submission').attr('onclick') == 'convertFtoC()' ) {\n $('#conversion_submission').attr('onclick', 'convertCtoF()');\n $('#conversion_toggle').attr('class', 'c_to_f');\n } else {\n $('#conversion_submission').attr('onclick', 'convertFtoC()');\n $('#conversion_toggle').attr('class', 'f_to_c');\n }\n}", "function viewRadio()\r\n{\r\n changeContent('content', '../Php/json.php', 'EX=radio');\r\n\t \r\n}", "function getInput() {\n\tinTemp = Number(input.value);\n\tcelsCheck = celsRadio.checked;\n\tif (celsCheck) {\n\t\toutScale = 'C';\n\t} else {\n\t\toutScale = 'F';\n\t}\n}", "function savePlan() {\n if (radio1.checked == true) {\n console.log(radio1.value);\n changeWelcomeText(radio1.value)\n return radio1.value;\n } else if (radio2.checked == true) {\n console.log(radio2.value);\n changeWelcomeText(radio2.value)\n return radio2.value;\n } else if (radio3.checked == true) {\n console.log(radio3.value);\n changeWelcomeText(radio3.value)\n return radio3.value;\n } else {\n changeWelcomeText('subscription')\n }\n}", "function changeMode(e){\n PUZZLE_DIFFICULTY = e.value;\n onImage();\n}", "modeBtnAction() {\n console.log('Toggling scale mode/unit')\n this._unit = trickler.TricklerUnits.GRAINS === this._unit ? trickler.TricklerUnits.GRAMS : trickler.TricklerUnits.GRAINS\n }", "function DiametroCirculo (radio){ return radio*2;}", "function toggle_field() {\n$(document).ready(function() {\n\n var option = $('input[name=\"formats\"]:checked').val();\n if (option == 'paste'){\n $('#div_id_test_motif').removeClass('disableField');\n $('#div_id_uploaded_motif').addClass('disableField');\n }\n else if (option == 'upload'){\n $('#div_id_uploaded_motif').removeClass('disableField');\n $('#div_id_test_motif').addClass('disableField');\n }\n else{\n console.log(\"We got here\")\n }\n var options = $('input[name=\"mode\"]:checked').val();\n\n if (options == 'GIMME') {\n $('#div_id_score').addClass('disableField');\n $('#div_id_data').addClass('disableField');\n $('#div_id_uploaded_chipseq').addClass('disableField');\n }\n else {\n $('#div_id_score').removeClass('disableField');\n $('#div_id_data').removeClass('disableField');\n $('#div_id_uploaded_chipseq').removeClass('disableField');\n\n }\n $('input[name=\"formats\"]').change(function() {\n\n var option = $('input[name=\"formats\"]:checked').val();\n\n if (option == 'paste'){\n $('#div_id_test_motif').removeClass('disableField');\n $('#div_id_uploaded_motif').addClass('disableField');\n }\n else{\n $('#div_id_uploaded_motif').removeClass('disableField');\n $('#div_id_test_motif').addClass('disableField');\n }\n\n\n //alert($('input[name=\"formats\"]:checked', '#id-seq').val());\n\n\n });\n\n $('input[name=\"mode\"]').change(function () {\n\n var option = $('input[name=\"mode\"]:checked').val();\n\n if (option == 'GIMME') {\n $('#div_id_score').addClass('disableField');\n $('#div_id_data').addClass('disableField');\n $('#div_id_uploaded_chipseq').addClass('disableField');\n }\n else {\n $('#div_id_score').removeClass('disableField');\n $('#div_id_data').removeClass('disableField');\n $('#div_id_uploaded_chipseq').removeClass('disableField');\n }\n //alert($('input[name=\"formats\"]:checked', '#id-seq').val());\n\n\n\n });\n\n $('input[name=\"data\"]').change(function() {\n\n var option = $('input[name=\"data\"]:checked').val();\n\n if (option == 'PBM'){\n $('#div_id_uploaded_chipseq').addClass('disableField');\n }\n else{\n $('#div_id_uploaded_chipseq').removeClass('disableField');\n }\n\n\n });\n\n //$(\"input:radio:first\").prop(\"checked\", true).trigger(\"click\");\n\n});\n}", "function createModeSwitcher() {\n var ms = {\n xtype: 'radiogroup',\n id: 'ms',\n hidden: !GeoNetwork.MapModule,\n items: [{\n name: 'mode',\n ctCls: 'mn-main',\n boxLabel: OpenLayers.i18n('discovery'),\n id: 'discoveryMode',\n width: 110,\n inputValue: 0,\n checked: true\n }, {\n name: 'mode',\n ctCls: 'mn-main',\n width: 140,\n boxLabel: OpenLayers.i18n('visualization'),\n id: 'visualizationMode',\n inputValue: 1\n }],\n listeners: {\n change: function (rg, checked) {\n app.switchMode(checked.getGroupValue(), false);\n /* TODO : update viewport */\n }\n }\n };\n \n return new Ext.form.FormPanel({\n renderTo: 'mode-form',\n border: false,\n layout: 'hbox',\n items: ms\n });\n }", "function getConversionType(){\n\tvar convConstant = 0\n\t//Reference the form\n\tvar theForm = document.forms[\"conversion\"];\n\t//Reference the select box\n\tvar convType = theForm.elements[\"conversionType\"];\n\t//Set equal to the constants in the array\n\tconvConstant = constants[convType.value];\n\treturn convConstant\n}", "function conversion(){\n if (scale.innerHTML == \"°F\") {\n scale.innerHTML = \"°C\";\n convert.innerHTML =\"°F?\";\n } else {\n scale.innerHTML = \"°F\";\n convert.innerHTML =\"°C?\";\n }\n temp.innerHTML = checkType(weather.temp);\n}", "switcherClicked () {\r\n this.$emit('input', !this.value)\r\n }", "function in_format_handler() {\r\n var val = $('#math-in-format-select').val();\r\n if (val == 'mml' || val == 'jats') {\r\n $('#latex-style-select').attr('disabled', 'disabled');\r\n $('#latex-style-label').attr('class', 'disabled');\r\n }\r\n else {\r\n $('#latex-style-select').removeAttr('disabled');\r\n $('#latex-style-label').attr('class', '');\r\n }\r\n }", "displayChartOptions2d(){\n return(\n <div>\n\n <label className=\"radio-button\">\n <input type=\"radio\" name=\"button\" value=\"scatter\" onChange={(e)=>{\n console.log(\"setting state scatter\");\n this.setState({chartType: e.target.value});\n }}/> Scatter\n <span className=\"checkmark\"></span>\n </label>\n <label className=\"radio-button\">\n <input type=\"radio\" name=\"button\" value=\"bubble\" onChange={(e)=>{\n console.log(\"Setting state bubble\");\n this.setState({chartType: e.target.value});\n }}/> Bubble\n <span className=\"checkmark\"></span>\n </label>\n </div>\n );\n }", "function SelectConsumptionType(type, tankid, day1, day2) {\n //default selection\n $('#rbAvgConsumption')[0].checked = true;\n\n //dialog for consumption type selection\n $(\"#consumptionType\").dialog({\n title: \"Select Consumption Type\",\n resizable: true,\n height: 180,\n width: 450,\n modal: true,\n autoOpen: true,\n buttons: {\n 'Yes': function () {\n $(this).dialog('close');\n\n //load the tanks\n LoadReorderByETRandETE(type, $(\"input[name='rbConsumptionType']:checked\").val(), tankid, day1, day2);\n },\n 'No': function () {\n $(this).dialog('close');\n }\n }\n });\n}", "function Checklist_Format(props) {\n\n const [value, setValue] = React.useState('female');\n function handleChange(event) {\n props.answerFeedback(event.target.value);\n setValue(event.target.value);\n }\n\n return (\n <FormControl component=\"fieldset\">\n <FormLabel component=\"legend\"></FormLabel>\n <RadioGroup aria-label=\"position\" name=\"position\" value={value}\n onChange={handleChange} row>\n <FormControlLabel\n value=\"option1\"\n control={<Radio color=\"primary\" />}\n label=\"Yes\"\n labelPlacement=\"start\"\n />\n <FormControlLabel\n value=\"option2\"\n control={<Radio color=\"primary\" />}\n label=\"No\"\n labelPlacement=\"start\"\n />\n <FormControlLabel\n value=\"option3\"\n control={<Radio color=\"primary\" />}\n label=\"Not Sure\"\n labelPlacement=\"start\"\n />\n </RadioGroup>\n </FormControl>\n );\n\n}", "function bsInpChn(inpt) {\n switch (inpt.type) {\n case \"select-one\":\n if (!inpt.options[inpt.selectedIndex].defaultSelected && !inpt.classList.contains('changed')) {\n inpt.classList.add('changed');\n return true;\n } else if(inpt.options[inpt.selectedIndex].defaultSelected && inpt.classList.contains('changed')) {\n inpt.classList.remove('changed');\n return true;\n }\n return false;\n case \"checkbox\":\n return bsChekbChd(inpt);\n case \"radio\":\n var radios = document.getElementsByName(inpt.name);\n var isChanged = false;\n for (i = 0; i < radios.length; i++) {\n if (radios[i].type == \"radio\") { //filter hidden from main form\n if (bsChekbChd(radios[i])) {\n isChanged = true;\n }\n }\n }\n return isChanged;\n default:\n if (inpt.value != inpt.defaultValue && !inpt.classList.contains('changed')) {\n inpt.classList.add('changed');\n return true;\n } else if(inpt.value == inpt.defaultValue && inpt.classList.contains('changed')) {\n inpt.classList.remove('changed');\n return true;\n }\n return false;\n }\n}", "function optionButtonsOutput() {\n /* help from stackoverflow with the following two lines to separate the selections in multiple\n bootstrap button groups on same page */\n $(this).addClass(\"active no-shadow disable\");\n $(this).siblings().removeClass(\"active disable no-shadow\");\n scienceQuiz.category = activeButton(categoryButtons);\n scienceQuiz.amount = activeButton(quantityButtons);\n scienceQuiz.difficulty = activeButton(difficultyButtons);\n if (scienceQuiz.category === \"18\") {\n scienceQuiz.categoryString = \"computing\";\n } else if (scienceQuiz.category === \"19\") {\n scienceQuiz.categoryString = \"mathematics\";\n } else if (scienceQuiz.category === \"17\") {\n scienceQuiz.categoryString = \"general\";\n }\n}", "function initialize_device_picker(){\n $('.pooltool_grid_item_modifier_class').on('vclick', function(ev){\n ev.preventDefault();\n if(ev.currentTarget.nextElementSibling && ev.currentTarget.nextElementSibling.className === \"radiobutton_griditem\"){\n ev.currentTarget.nextElementSibling.firstElementChild.checked = true;\n $('#' + ev.currentTarget.nextElementSibling.firstElementChild.id).change();\n }\n });\n }", "function setUntilType() {\n if ($(\"#recur_radio\").attr(\"checked\")) {\n $(\"#nr_occurr\").removeAttr(\"disabled\");\n $(\"#untilDate\").attr(\"disabled\", \"disabled\");\n if ($(\"#nr_occurr\").val() == 1) {\n $(\"#until_desc\").html($(\"#nr_occurr\").val() + ' ' + time_string);\n //$(\"#short_desc\").empty();\n //$(\"#until_desc\").html(\"Only once\");\n } else\n $(\"#until_desc\").html($(\"#nr_occurr\").val() + ' ' + times_string);\n }\n else if ($(\"#date_radio\").attr(\"checked\")) {\n $(\"#untilDate\").removeAttr(\"disabled\");\n $(\"#nr_occurr\").attr(\"disabled\", \"disabled\");\n $(\"#until_desc\").html(until_string + ' ' + $(\"#untilDate\").val());\n } else {\n $(\"#untilDate\").attr(\"disabled\", \"disabled\");\n $(\"#nr_occurr\").attr(\"disabled\", \"disabled\");\n }\n}", "function GetItemTrueFalseButton(){\n var val1 = document.getElementById(\"radio1\").checked;\n var val2 = document.getElementById(\"radio2\").checked;\n var returnval;\n if(val1 === true){\n returnval = \"open\";\n }\n else if(val2 === true){\n returnval = \"closed\";\n }else{\n returnval = \"N/A\";\n }\n Validation(returnval);\n return returnval;\n}", "function selectFormatType(formatOptionItem)\n{\n var currentRecordingOption = '';\n \n if($('#assistedRecordingFormatInputOptions').css('display') == 'block')\n {\n currentRecordingOption = 'assisted';\n } else if($('#selfRecordingFormatInputOptions').css('display') == 'block')\n {\n currentRecordingOption = 'self';\n }\n \n var formatOptionSelected = '';\n formatOptionSelected = $('#'+formatOptionItem.id).attr('data-formatType');\n \n if(currentRecordingOption == 'assisted')\n {\n var selectedFormatButtonHTML = '<button id=\"assistedRecordingFormatInput\" type=\"button\" onclick=showSelectFormatOptions(\"assisted\")>'+formatOptionSelected+'</button>';\n $('#assistedRecordingFormatInputDiv').html(selectedFormatButtonHTML);\n $('#assistedRecordingFormatInput').button().button('refresh');\n $('#assistedRecordingFormatInputOptions').css('display', 'none');\n } else if(currentRecordingOption == 'self')\n {\n var selectedFormatButtonHTML = '<button id=\"selfRecordingFormatInput\" type=\"button\" onclick=showSelectFormatOptions(\"self\")>'+formatOptionSelected+'</button>';\n $('#selfRecordingFormatInputDiv').html(selectedFormatButtonHTML);\n $('#selfRecordingFormatInput').button().button('refresh');\n $('#selfRecordingFormatInputOptions').css('display', 'none');\n }\n \n\n\n}", "function assignRoverChoice() {\n roverChoice = $(\"input:radio[name=inlineRadioOptions]:checked\").val();\n}", "function diametroCirculo(radio){\n return radio *2\n}", "function change() {\n //Depending on which botton was checked is the respected\n //transition function called\n if (this.value == 2016) { \n transition2016();\n } else if (this.value == 2014) {\n transition2014();\n } else{\n transition2006(); \n }\n}", "function Radio(mode){\n let on = false;\n\n return{\n mode: mode,\n turnOn: function (){\n on = true;\n },\n isOn: function (){\n return on;\n }\n };\n}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "function CalculateSeasonSpotFee() {\n var totalSpotFee = 0;\n\n var selecetRadioButton = GetCheckedRadioButtonFromName('SeasonSpot');\n //If a button is not selected then the switch statement will not run .\n if (selecetRadioButton != null) {\n switch (selecetRadioButton.value) {\n case 'Forår':\n totalSpotFee += sæsonpladsForår;\n break;\n case 'Sommer':\n totalSpotFee += sæsonpladsSommer;\n break;\n case 'Efterår':\n totalSpotFee += sæsonpladsEfterår;\n break;\n case 'Vinter':\n totalSpotFee += sæsonpladsVinter;\n break;\n }\n \n }\n return totalSpotFee;\n}", "convertHandler() {\n\t\tlet category = this.m_catMenu.value;\n\t\tlet unitA = this.m_unitAMenu.value;\n\t\tlet unitB = this.m_unitBMenu.value;\n\t\tlet value = this.m_unitAInput.value;\n\t\tif(value != \"\") {\n\t\t\tlet newVal = this.CALCULATOR.convert(category, unitA, unitB, value);\n\t\t\tthis.m_unitBOutput.value = newVal;\n\t\t}\n\t}", "function diametroCirculo(radio){\n return radio * 2;\n}", "function fromDecClicked(){colorFrom(2); fromDec = true, fromBin = false, fromOct = false, fromHex = false;}", "function getAccountTypeRadioValue() {\n\n if(document.getElementById('typeStudent').checked){\n return 'student';\n }\n else if (document.getElementById('typeCounselor').checked){\n\n return 'guidance';\n }\n\n}", "function radioCheckUI() {\n\t$('input[type=radio]:checked').parent('label').addClass('on');\n\t$('input[type=radio]').on('change', function() {\n\t\tif ( $(this).prop('checked') ) {\n\t\t\t$(this).parent('label').siblings('label').removeClass('on');\n\t\t\t$(this).parent('label').addClass('on');\n\t\t}\n\t});\n}", "function radio_value(the_id, $n, data) {\n\n var id_prt = the_id.parent().parent();\n\n // for none btn\n id_prt.find(\".yp-btn-action.active\").trigger(\"click\");\n\n if (data == id_prt.find(\".yp-none-btn\").text()) {\n id_prt.find(\".yp-none-btn\").trigger(\"click\");\n }\n\n if (data == 'auto auto') {\n data = 'auto';\n }\n\n if (data != '' && typeof data != 'undefined') {\n\n if (data.match(/\\bauto\\b/g)) {\n data = 'auto';\n }\n\n if (data.match(/\\bnone\\b/g)) {\n data = 'none';\n }\n\n if ($(\"input[name=\" + $n + \"][value=\" + escape(data) + \"]\").length > 0) {\n\n the_id.find(\".active\").removeClass(\"active\");\n\n $(\"input[name=\" + $n + \"][value=\" + escape(data) + \"]\").prop('checked', true).parent().addClass(\"active\");\n\n } else {\n\n the_id.find(\".active\").removeClass(\"active\");\n\n // Disable all.\n $(\"input[name=\" + $n + \"]\").each(function () {\n\n $(this).prop('checked', false);\n\n });\n\n id_prt.find(\".yp-none-btn:not(.active)\").trigger(\"click\");\n\n }\n\n }\n\n }", "function changeStatus() {\n\t\n\tvar hiddenStatus = document.getElementById('hiddenstatus');\n\tvar statusBtn = document.getElementById('statusbtn');\n\tif(selectedRadio() != false)\n\t{\n\t//choice exist\n\tif(hiddenStatus.value == \"yellow\")\n\t\t{\n\t\t\t//marking on dobut\n\t\t\thiddenStatus.value = \"green\";\n\t\t\tstatusBtn.style.backgroundColor = \"#228B22\";\n\t\t\tstatusBtn.innerHTML = \"Flag\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\thiddenStatus.value =\"yellow\";\n\t\t\tstatusBtn.style.backgroundColor = \"orange\";\n\t\t\tstatusBtn.innerHTML = \"Unflag\";\n\t\t}\n\t}\n\telse\n\t{\n\t\t//no choice exist\n\t\tif(hiddenStatus.value == \"yellow\")\n\t\t{\n\t\t\thiddenStatus.value = \"red\";\n\t\t\tstatusBtn.style.backgroundColor = \"red\";\n\t\t\tstatusBtn.innerHTML = \"Flag\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\thiddenStatus.value = \"yellow\";\n\t\t\tstatusBtn.style.backgroundColor = \"orange\";\n\t\t\tstatusBtn.innerHTML = \"Unflag\";\n\t\t}\n\n\t}\n\tconsole.log(hiddenStatus.value + \" hidden\")\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 sexRadio(value) {\n\t$Sex = value;\n\tchangeBMR();\n}", "function getOption() {\n var obj = document.getElementById(\"robot-control-mode-select\");\n var mytext = obj.options[obj.selectedIndex].text;\n document.getElementById(\"robot-current-mode\").innerHTML = mytext;\n\n if (mytext === \"Forward\") {\n document.getElementById(\"p1\").innerHTML = \"Theta1\";\n document.getElementById(\"p2\").innerHTML = \"Theta2\";\n document.getElementById(\"p3\").innerHTML = \"d3 \";\n }\n else if (mytext === \"Inverse\") {\n document.getElementById(\"p1\").innerHTML = \"Px\";\n document.getElementById(\"p2\").innerHTML = \"Py\";\n document.getElementById(\"p3\").innerHTML = \"Pz\";\n }\n else if(mytext === \"Auto\") {\n document.getElementById(\"p1\").innerHTML = \"Parameter 1\";\n document.getElementById(\"p2\").innerHTML = \"Parameter 2\";\n document.getElementById(\"p3\").innerHTML = \"Parameter 3\";\n }\n else {\n document.getElementById(\"p1\").innerHTML = \"Parameter 1\";\n document.getElementById(\"p2\").innerHTML = \"Parameter 2\";\n document.getElementById(\"p3\").innerHTML = \"Parameter 3\";\n }\n}", "function update(radio) {\r\n if (sha.checked || md5.checked) {\r\n key.disabled = true;\r\n }\r\n else {\r\n key.disabled = false;\r\n }\r\n\r\n clear();\r\n\r\n switch (radio.value) {\r\n case \"0\":\r\n console.log(\"SHA\");\r\n type = \"/sha/\";\r\n btn.innerHTML = \"encode\";\r\n break;\r\n case \"1\":\r\n console.log(\"MD5\");\r\n type = \"/md5/\";\r\n btn.innerHTML = \"decode\";\r\n break;\r\n case \"2\":\r\n console.log(\"otpE\");\r\n type = \"/otp/e/\";\r\n btn.innerHTML = \"encrypt\";\r\n break;\r\n case \"3\":\r\n console.log(\"otpD\");\r\n type = \"/otp/d/\";\r\n btn.innerHTML = \"decrypt\";\r\n break;\r\n }\r\n}", "swapMode(event) {\r\n if (this.state == STATES.play) {\r\n this.mode = (this.mode == MODES.flag) ? MODES.dig : MODES.flag;\r\n event.target.value = this.mode;\r\n }\r\n }", "function onFileTypeChange (){\n\n\t// Hide all additional options\n\tdlgMain.pnlExportSettings.grpOptions.grpJPGOptions.hide();\n\tdlgMain.pnlExportSettings.grpOptions.grpPNGOptions.hide();\n\tdlgMain.pnlExportSettings.grpOptions.grpPSDOptions.hide();\n\tdlgMain.pnlExportSettings.grpOptions.grpTIFFOptions.hide();\n\n\t// Show selected\n\tvar selectedIndex = dlgMain.pnlExportSettings.grpFileType.field.selection.index;\n\tvar selectedFileType = fileTypes[selectedIndex];\n\tswitch (selectedFileType) {\n\t\tcase \"JPG\": \tdlgMain.pnlExportSettings.grpOptions.grpJPGOptions.show(); \t\tbreak;\n\t\tcase \"PNG\": \tdlgMain.pnlExportSettings.grpOptions.grpPNGOptions.show(); \t\tbreak;\n\t\tcase \"PSD\": \tdlgMain.pnlExportSettings.grpOptions.grpPSDOptions.show(); \t\tbreak;\n\t\tcase \"TIFF\":\tdlgMain.pnlExportSettings.grpOptions.grpTIFFOptions.show(); \tbreak;\n\t}\n\n}", "function setRadioButton(){\t\r\n\tif (document.getElementById('r1').checked) {\r\n\t\tpolygon = true;\r\n\t}else if(document.getElementById('r2').checked){\r\n\t\tpolygon = false;\r\n\t}\r\n}", "function changemode(that){\n if(that.value==='link'){\n document.getElementById(\"topo-seg-input\").disabled=true;\n document.getElementById(\"link-input\").disabled=false;\n }else if (that.value === 'topo'){\n document.getElementById(\"link-input\").disabled=true;\n document.getElementById(\"topo-seg-input\").disabled=false;\n }\n}", "function EditShownAttributes() {\n //Gets the spottype that is checked.\n switch (GetCheckedRadioButtonFromName('typeSelector').value) {\n \n case \"Campingvognplads\":\n TypeChoosingChanged();\n document.getElementById(\"bigSpotOptions\").style.display = \"block\";\n break;\n case \"Teltplads\":\n TypeChoosingChanged();\n break;\n case \"Standard Hytte\":\n TypeChoosingChanged()\n document.getElementById(\"cabinOptions\").style.display = \"block\";\n break;\n case \"Luksus Hytte\":\n TypeChoosingChanged();\n document.getElementById(\"cabinOptions\").style.display = \"block\";\n break;\n case \"Sæsonplads\":\n TypeChoosingChanged();\n document.getElementById(\"seasonOptions\").style.display = \"block\";\n document.getElementById('viewDiv').style.display = 'none';\n //Removes the option to change the date and time as the seasons are predetermined.\n document.getElementById(\"MainContent_startDate\").disabled = true;\n document.getElementById(\"MainContent_endDate\").disabled = true;\n \n break;\n }\n \n}", "function diametroCirculo(radio){\n return 2*radio;\n}", "function diametroCirculo(radio) {\n return radio *2;\n}", "function convertcalaries(){\n let light = document.getElementById(\"light\");\n let moderate = document.getElementById(\"moderate\");\n let highlyactive = document.getElementById(\"highlyactive\");\n let bmr = document.getElementById(\"bmr\").value;\n if (light.checked==true){\n calarieintake =bmr*1.53\n document.getElementById(\"calariemessage\").innerHTML = \"Your daily Energy Expenditure be around \"+calarieintake;\n }\n else if (moderate.checked==true){\n calarieintake =bmr*1.76\n document.getElementById(\"calariemessage\").innerHTML = \"Your daily Energy Expenditure be around \"+calarieintake;\n }\n else if (highlyactive.checked==true){\n calarieintake =bmr*2.25\n document.getElementById(\"calariemessage\").innerHTML = \"Your daily Energy Expenditure be around \"+calarieintake;\n }\n else{\n alert(\"Select any of the lifestyle to know your energy expenditure\");\n }\n }", "function changePrice() {\n if ($('#switch1').is(\":checked\")) {\n if ($pr_sale.val() != 0 && $pr_price.val() != '') {\n $('#price-sale-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-preview').html(formatNumber($pr_price.val() - $pr_price.val() / 100 * $pr_sale.val()) + \" ₫\")\n $('#sale-preview').show()\n $('#sale-preview').html($pr_sale.val() + \"%\")\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n }", "function makeChoice()\r\n{\r\n\r\nif(document.getElementById(\"rabuse6\").checked)\r\n {\r\n document.form3.other.style.visibility=\"visible\";\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n document.form3.other.value=\"\";\r\n\r\n }\r\n/*\r\n var val = 0;\r\n for( i = 0; i < document.form3.rabuse.length; i++ )\r\n {\r\n if(document.getElementById(\"rabuse\"+i).checked)\r\n {\r\n val = document.getElementById(\"rabuse\"+i).value;\r\n\r\n if(val=='rabuse6')\r\n {\r\n document.form3.other.style.visibility=\"visible\";\r\n document.form3.other.disabled=false;\r\n document.form3.other.focus();\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n document.form3.other.value=\"\";\r\n }\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n }\r\n }\r\n*/\r\n}", "function dhcpChangeMode(radioName){\n var selValue = radioCheckedValueGet(radioName);\n if (!selValue) \n return;\n switch (parseInt(selValue, 10)) {\n case 1: /* None */\n fieldStateChangeWr('tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime tf1_dhcpRelayGateway', '', '', '');\n vidualDisplay('tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime tf1_dhcpRelayGateway', 'hide');\n vidualDisplay('break1 break2 break3 break4 break5 break6 break7 break8', 'hide');\n break;\n case 2: /* DHCP Server */\n fieldStateChangeWr('tf1_dhcpRelayGateway', '', 'tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime', '');\n vidualDisplay('tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime', 'configRow');\n vidualDisplay('break1 break2 break3 break4 break5 break6 break7', 'break');\n \n vidualDisplay('tf1_dhcpRelayGateway', 'hide');\n vidualDisplay('break8', 'hide');\n break;\n \n case 3: /* DHCP Relay */\n fieldStateChangeWr('tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime', '', 'tf1_dhcpRelayGateway', '');\n vidualDisplay('tf1_dhcpRelayGateway', 'configRow');\n vidualDisplay('break7 break8', 'break');\n \n vidualDisplay('tf1_dhcpDomainName tf1_dhcpStartIp tf1_dhcpEndIp tf1_dhcpDefGateway tf1_dhcpPrimaryDnsServer tf1_dhcpSecondaryDnsServer tf1_dhcpLeaseTime', 'hide');\n vidualDisplay('break1 break2 break3 break4 break5 break6', 'hide');\n \n break;\n }\n}", "function checkboxRadioStyle(){\n if($('.seotoaster').length && !$('.ie8').length){\n $('input:checkbox, input:radio', '.seotoaster').not('.processed, .icon, .hidden').each(function(){\n var id = $(this).prop('id');\n if(!id.length){\n id = 'chr-'+Math.floor((Math.random()*100)+1);\n $(this).prop('id', id);\n }\n if($(this).is(':radio')){\n $(this).addClass('radio-upgrade filed-upgrade');\n }else{\n $(this).addClass('checkbox-upgrade filed-upgrade');\n }\n if(!$(this).closest('.btn-set').length){\n var $parent = $(this).parent('label');\n if($parent.length){\n $parent.prop('for', id);\n !$(this).hasClass('switcher') ? $(this).after('<span class=\"checkbox_radio\"></span>') : $(this).after('<span class=\"checkbox_radio\"><span></span></span>');\n }else{\n !$(this).hasClass('switcher') ? $(this).wrap('<label for=\"'+id+'\" class=\"checkbox_radio-wrap\"></label>').after('<span class=\"checkbox_radio\"></span>') : $(this).wrap('<label class=\"checkbox_radio-wrap\"></label>').after('<span class=\"checkbox_radio\"><span></span></span>');\n }\n }\n $(this).addClass('processed');\n });\n }\n}", "function powerModeChange() {\n var newPowerUnit = document.getElementById('powerMode').value;\n if(powerUnit != newPowerUnit) {\n if(newPowerUnit == \"Power\") {\n document.getElementById('powerunit').innerHTML = 'W';\n document.getElementById('power').value = (eps * Ebeam*1.e9 * 1.602e-19).toPrecision(3);\n }\n if(newPowerUnit == \"Current\") {\n document.getElementById('powerunit').innerHTML = 'mA';\n document.getElementById('power').value = (eps * 1.602e-19 * 1000).toPrecision(3);\n }\n powerUnit = newPowerUnit\n }\n}", "function playdirection_value(ele) { \n var selected = ele.value;\n playdirection_select = playDirection[selected]\n}", "function toggleSwitch() {\n\n \n $(\"#slider\").change(function() {\n console.log(\"slider\");\n \n var currentSelection = $(\"#slider option:selected\" ).text();\n var currentTemp = $(\"#temp\").html();\n var unitMeasure = document.getElementById(\"unit-measure\");\n unitMeasure.innerHTML =\"\";\n\n // var currentTemp = document.getElementById(\"temp-unit\").innerHTML;\n console.log(currentTemp + \"test\");\n convertDegrees(currentSelection,currentTemp);\n \n \n });\n \n \n}", "function changeDefaultModeButtons(type) {\n if (type === \"M\") {\n document.getElementById(\"btnActualizar\").style.display = \"inline\";\n document.getElementById(\"btnEliminar\").style.display = \"inline\";\n document.getElementById(\"btnBuscar\").style.display = \"inline\";\n document.getElementById(\"btnCancelar\").style.display = \"inline\";\n document.getElementById(\"btnGuardar\").style.display = \"inline\";\n // if (!isPrm) {\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n // }\n }\n else if (type === \"C\" || type === \"E\" || type === \"U\") {\n document.getElementById(\"btnActualizar\").style.display = \"none\";\n document.getElementById(\"btnEliminar\").style.display = \"none\";\n document.getElementById(\"btnBuscar\").style.display = \"inline\";\n document.getElementById(\"btnCancelar\").style.display = \"inline\";\n if (type === \"C\") {\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n } else {\n document.getElementById(\"btnGuardar\").style.display = \"inline\";\n }\n }\n}", "function sndRecPairClick() {\n if (buttonChecked == button_options.SENDREC) {\n //Clear colours\n buttonChecked = button_options.NONE;\n }\n else {\n //Clear button method, change to selected\n buttonChecked = button_options.SENDREC;\n }\n consoleAdd(\"Button Selected: \" + buttonChecked);\n}", "handleimgCapture() {\n let RadioimgNo = document.getElementById(\"imgCaptureNo\")\n let RadioimgYes = document.getElementById(\"imgCaptureYes\")\n\n if (RadioimgNo.checked) {\n this.RadioVal1 = false\n }\n if (RadioimgYes.checked) {\n this.RadioVal1 = true\n }\n }", "function setupModeButtons() {\n\t$(\".mode\").on(\"click\", function() {\n\t\t$(\".mode\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\t\t\t\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Easy\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else if($(this).text() === \"Medium\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}\n\t});\t\n}", "function ultimateConverter() {\n\tvar input = +document.getElementById(\"numberInput\").value; //+ in front of input var is to turn input string into a number\n\tvar selectedTemp = document.querySelector('input[name=\"tempValue\"]:checked').value;\n\tvar converted = inputConvert(input, selectedTemp);\n\tvar color = colorChange(converted, selectedTemp);\n\t\tbuildTemp(converted, color);\n}", "function checkConversionType()\r\n{\r\n\tif ($(\"#conversionTypeId\").val() == \"EXIF\")\r\n\t{\r\n\t\t$(\"#inputFormatId\").val(\"yyyy:MM:dd HH:mm:ss\");\r\n\t}\r\n}", "function changeInput(radio,shift) {\n //kamus\n var val = $(radio).val();\n var td, tdFlow, tdWhp;\n var selector;\n\n //algoritma\n td = $(radio).parent().next();\n tdFlow = td.next();\n tdWhp = tdFlow.next();\n selector = '.sh' + shift + '_fcv';\n\n if (val == 1) { //text => hide flow & whp\n td.attr(\"class\", \"yellow-bg center\");\n td.attr('colspan', '3');\n\n td.find(selector).attr('style', 'width: 150px;');\n\n tdFlow.hide();\n tdWhp.hide();\n } else { //input => show flow & whp\n td.attr(\"class\", \"gray-bg center number\");\n td.removeAttr('colspan');\n\n td.find(selector).attr('style', 'width: 50px;');\n\n tdFlow.show();\n tdWhp.show();\n }\n}", "function radioSelectionHandler(objct) {\n\t\t$(\"#proptable\").append(\"<tr><td><input id='chkbox' type='checkbox'>select</input> </td></tr>\");\n\t\tvar chkbox = document.getElementById('chkbox');\n\t\tobjct.paths[1].fill === '#555555' ? chkbox.checked = true : chkbox.checked = false;\n\t\tchkbox.onmousedown = function () {\n\t\t\tif (!chkbox.checked) {\n\t\t\t\tobjct.paths[1].fill = '#555555';\n\t\t\t} else {\n\t\t\t\tobjct.paths[1].fill = '#eeeeee';\n\t\t\t}\n\t\t\tmatisse.comm.sendDrawMsg({\n\t\t\t\taction: \"modified\",\n\t\t\t\targs: [{\n\t\t\t\t\tuid: objct.uid,\n\t\t\t\t\tobject: objct\n\t\t\t\t}]\n\t\t\t});\n\t\t\tcanvas.renderAll();\n\t\t};\n\t}", "idcaptureVal() {\n let RadioidNo = document.getElementById(\"idCaptureNo\")\n let RadioidYes = document.getElementById(\"idCaptureYes\")\n if (!RadioidNo.checked && !RadioidYes.checked){\n this.idCapVal = false\n }\n else{\n this.idCapVal = true\n }\n }", "function colorChange(converted, selectedTemp) {\n\tvar selectedTemp = document.querySelector('input[name=\"tempValue\"]:checked').value;\n\tif (selectedTemp === \"farenheit\" && converted > 90 || selectedTemp === \"celcius\" && converted > 32) {\n\t\treturn \"red\";\n\t} else if (selectedTemp === \"farenheit\" && converted < 32 || selectedTemp === \"celcius\" && converted < 0) {\n\t\treturn \"blue\";\n\t} else {\n\t\treturn \"green\";\n\t}\n}", "function getSelectedRadio() {\n\t\tvar radios = document.forms[0].status;\n\t\tfor(var i=0; i<radios.length; i++) {\n\t\t\tif(radios[i].checked) {\n\t\t\t\tcrateValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t} // End Selected Radio Button Function", "function toDecClicked(){colorTo(2); toDec = true, toBin = false; toOct = false, toHex = false;}", "function changeButton() {\n if(document.getElementById('f').checked === true) {\n return unit = document.getElementById('f').value\n } else {\n return unit = document.getElementById('m').value\n }\n}", "handleRadio(event) {\r\n const radioButton = event.currentTarget;\r\n const label = radioButton.parentNode;\r\n this.messageToSend(label.innerText);\r\n // When an option is selected, the buttons will be disabled\r\n this.radioOptions.forEach((option) => (option.disabled = true));\r\n }", "function Plan1Chosen() {\n radio1.checked;\n console.log(\"checked1\");\n plan1.style.color = \"#282D2D\";\n plan1.style.backgroundColor = \"white\";\n radio2.checked = false;\n radio3.checked = false;\n plan2.style.color = \"white\";\n plan3.style.color = \"white\";\n plan2.style.backgroundColor = \"transparent\";\n plan3.style.backgroundColor = \"transparent\";\n}", "function OnOther_Change( e , type )\r\n{\r\n var newOtherValue = $.widgetAppTextFieldAeDESModeFormsSectionEightOther.get_text_value() ;\r\n Alloy.Globals.AeDESModeSectionEight[\"OTHER\"] = newOtherValue ;\r\n // If the value is not empty, we must also set the selected item of the TypeOfConstruction picker to \"Other\"\r\n if( newOtherValue )\r\n {\r\n $.widgetAppComboBoxAeDESModeFormsSectionEightAccuracyVisit.set_selected_index( \"7\" ) ;\r\n Alloy.Globals.AeDESModeSectionEight[\"ACCURACY_VISIT\"] = \"7\" ;\r\n }\r\n}", "function handleOnChangeRadioCaptain(event)\n {\n var name=event.target.name;\n var val=event.target.value;\n \n \n setRadioVal(val);\n setMatchFormCaptain((prev)=>(\n {\n ...prev,\n [name]:val\n }\n ));\n if(val==\"individual\")\n {\n setIsIndividual(true);\n }\n else{\n setIsIndividual(false);\n }\n \n \n \n \n }", "function handleBlackAndWhiteConversionUI() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tif (document.getElementById(\"BlackAndWhiteThresholdMethod\").value === \"automatic\") {\n\t\tslider.style.visibility = \"hidden\"; \n\t\tnum_input.style.visibility = \"hidden\"; \n\t}\n\telse {\n\t\tslider.style.visibility = \"visible\";\n\t\tnum_input.style.visibility = \"visible\";\n\t}\n}", "function setRadioButtonR(){\t\r\n\tif (polygon) {\r\n\t\tconsole.log(\"a\")\r\n\t\tdocument.getElementById('r1').checked = \"checked\";\r\n\t\t//document.getElementById('r2').checked = \"unchecked\";\r\n\t}else{\r\n\t\tconsole.log(\"b\")\r\n\t\tdocument.getElementById('r2').checked = \"checked\";\r\n\t\t//document.getElementById('r1').checked = \"unchecked\";\r\n\t}\r\n}", "function setRadioChoice(origAnswer, sBlank, resObj)\n{\n // Finds index number of chosen option.\n var matchIndex = resObj.optionList.indexOf(origAnswer);\n\n if (matchIndex >= 0 && matchIndex < resObj.optionList.length)\n {\n // Known option chosen.\n resObj.chosenOption = matchIndex;\n resObj.enabledFlag = 1;\n }\n else if (origAnswer.length > 0 && resObj.customEnabled === true)\n {\n // Other option entered.\n resObj.customText = origAnswer;\n resObj.enabledFlag = 1;\n }\n else if (sBlank === true)\n {\n // Skip blank answer.\n resObj.customText = \"\";\n resObj.enabledFlag = -1;\n }\n else\n {\n // Include blank answer.\n resObj.chosenOption = -1;\n resObj.enabledFlag = 0;\n }\n}", "function changeCurrency() {\n if (selectedOption == 'cycle') {\n document.getElementById('dailyPass').value = convertCurrency(5);\n document.getElementById('monthlyPass').value = convertCurrency(100);\n document.getElementById('yearlyPass').value = convertCurrency(500);\n } else if (selectedOption == 'motorcycle') {\n document.getElementById('dailyPass').value = convertCurrency(10);\n document.getElementById('monthlyPass').value = convertCurrency(200);\n document.getElementById('yearlyPass').value = convertCurrency(1000);\n\n } else {\n document.getElementById('dailyPass').value = convertCurrency(20);\n document.getElementById('monthlyPass').value = convertCurrency(500);\n document.getElementById('yearlyPass').value = convertCurrency(3500);\n }\n}", "function SetButtonsTypeHandler()\n{\n switch ($(this).text())\n {\n case cBUT.TITLES : if (GetState(\"media\") == \"movies\") \n {\n SetState(\"type\", \"titles\");\n ShowMediaTypePage(cBUT.SETS, true);\n }\n else {\n SetState(\"type\", \"tvtitles\");\n ShowMediaTypePage(cBUT.SERIES, false);\n }\n break;\n \n case cBUT.SETS : SetState(\"type\", \"sets\");\n ShowMediaTypePage(cBUT.TITLES, true);\n break;\n \n case cBUT.BACK + \n cBUT.SETS : BackToMedia(\"sets\");\n break;\n \n case cBUT.SERIES : SetState(\"type\", \"series\");\n ShowMediaTypePage(cBUT.TITLES, false);\n break; \n \n case cBUT.BACK +\n cBUT.SERIES : BackToMedia(\"series\");\n break;\n \n case cBUT.BACK +\n cBUT.SEASONS: BackToMedia(\"seasons\");\n break; \n \n case cBUT.ALBUMS : SetState(\"type\", \"albums\");\n ShowMediaTypePage(cBUT.SONGS, false);\n break; \n \n case cBUT.SONGS : SetState(\"type\", \"songs\");\n ShowMediaTypePage(cBUT.ALBUMS, false);\n break; \n \n case cBUT.BACK +\n cBUT.SONGS : BackToMedia(\"songs\");\n break; \n }\n}", "function changeValue(questo) {\n switch(questo.parentElement.textContent) {\n case \"tracer\":\n tracerVar = questo.checked;\n break;\n case \"NoRecoil\":\n recoilHack = questo.checked;\n break;\n case \"NoSpread\":\n SpreadHack = questo.checked;\n break;\n case \"instaBreak\":\n instaBreak = questo.checked;\n break;\n case \"noReload\":\n noReload = questo.checked;\n break;\n case \"noBlockUpdate\":\n noBlocksUpdate = questo.checked;\n break;\n case \"noClip\":\n noClip = questo.checked;\n break;\n case \"jumpyGlitch\":\n jumpyGlitch = questo.checked;\n break;\n case \"noChat\":\n document.getElementsByClassName(\"Chat__Wrapper-sc-16u2dec-0 cOWABl\")[0].style.display = questo.checked ? \"none\" : \"initial\";\n break;\n case \"listPlayer\":\n listPlayerValue = questo.checked;\n document.getElementById(\"players\").style.display = listPlayerValue ? \"initial\" : \"none\";\n break;\n case \"noKillFeed\":\n document.getElementsByClassName(\"KillFeed__Wrapper-sc-1xasb9r-0 byxfaz\")[0].style.display = questo.checked ? \"none\" : \"initial\";\n break;\n case \"waterSpeed\":\n waterSpeed = parseFloat(questo.value);\n break;\n case \"waterSpeedVer\":\n waterSpeedVer = parseFloat(questo.value);\n break;\n case \"ChunkSize\":\n chunkSize = parseInt(questo.value);\n break;\n case \"aimbot\":\n aimbotHack = questo.checked;\n break;\n case \"hitbox\":\n hitboxhack = questo.checked;\n break;\n }\n}", "function convert() {\n if (!checkbox.checked) {\n temp.innerHTML = tempC;\n wind.innerHTML = windMs;\n } else {\n temp.innerHTML = tempF;\n wind.innerHTML = windMph;\n }\n}" ]
[ "0.69719696", "0.69033223", "0.6802354", "0.6719851", "0.65819967", "0.6391341", "0.6376588", "0.6275576", "0.6252695", "0.61912256", "0.6119355", "0.60224265", "0.59989476", "0.5994305", "0.5981777", "0.5974612", "0.5933151", "0.59169775", "0.5854362", "0.57823277", "0.57654047", "0.574262", "0.5739728", "0.573429", "0.57029575", "0.5697747", "0.5687732", "0.568142", "0.5654689", "0.5636718", "0.5622485", "0.56046706", "0.55781734", "0.5577107", "0.55758125", "0.55702263", "0.5561516", "0.55580306", "0.5537959", "0.5536105", "0.55245847", "0.55199397", "0.55175656", "0.55116946", "0.5509864", "0.55041283", "0.5494289", "0.54854614", "0.548427", "0.5483383", "0.54762", "0.54756176", "0.54705304", "0.5467998", "0.5457881", "0.54542303", "0.5446189", "0.5445638", "0.5440465", "0.5437955", "0.5431563", "0.54314286", "0.542851", "0.54265434", "0.54240835", "0.54137874", "0.5409338", "0.54080105", "0.5405643", "0.5396935", "0.539506", "0.53890824", "0.53866804", "0.5385675", "0.5385133", "0.5382514", "0.53823537", "0.53822786", "0.5381767", "0.5380322", "0.5376378", "0.53724396", "0.5372394", "0.5370887", "0.5367378", "0.5365624", "0.53648615", "0.53516483", "0.5350839", "0.5347415", "0.53473395", "0.53468525", "0.5343929", "0.5331234", "0.53262913", "0.5326077", "0.5321725", "0.5319481", "0.53186095", "0.53181595", "0.531291" ]
0.0
-1
color the events on the calendar
function showEvents () { let days = document.getElementsByClassName('day'); let events = []; [...eventData['events']].forEach((event)=>{ [...days].forEach((day)=>{ if(event['day']===day.innerHTML && event['month']===headerMonths.innerHTML && event['year']===headerYears.innerHTML){ day.classList.add('active-event'); events.push(event) } }); }); return events; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorOnDutyDays(events) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = events[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var evt = _step.value;\n\n if (evt.title === $scope.user) {\n evt.color = '#98FB98';\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }", "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red \n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\n }", "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red\n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\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}", "_set_day_colors() {\n document.getElementById('signup_heading').innerText = LANG.signup_heading;\n var back = document.getElementById('back_button');\n back.innerText = LANG.back_button;\n var refresh = document.getElementById('refresh_button');\n refresh.innerText = LANG.refresh_button;\n var next = document.getElementById('next_button');\n next.innerText = LANG.next_button;\n var d=this.start_date;\n for (var i=1; i<=7; i++) {\n if (d.toLocaleDateString() == this.today.toLocaleDateString()) { // today\n document.getElementById(\"day_\"+i).style.backgroundColor = 'aliceblue';\n document.getElementById(\"day_\"+i).style.color = 'black';\n } else {\n if (d.to_weekday() == LANG.saturday) {\n document.getElementById(\"day_\"+i).style.backgroundColor = 'rgb(99 99 99)';\n } else if (d.to_weekday() === LANG.sunday) {\n document.getElementById(\"day_\"+i).style.backgroundColor = '#828282';\n } else {\n document.getElementById(\"day_\"+i).style.backgroundColor = \"\";\n }\n document.getElementById(\"day_\"+i).style.color = \"\";\n }\n document.getElementById(\"day_\"+i).innerText = d.get_date_string();\n d = d.next_day();\n }\n }", "function highlightSelectedEvents() {\n var foundEvents = [];\n var selectedCrn = localStorage.getItem(\"mainContentCalendarSelectedCrn\");\n var events = $('#calendar').fullCalendar('clientEvents');\n for (var i = 0; i < events.length; i++) {\n var eventCrn = events[i]._id.split(\"_\")[0];\n if (eventCrn == selectedCrn) {\n events[i].borderColor = \"#e6e600\";//light yellow\n foundEvents.push(events[i]);\n } else {\n events[i].borderColor = \"black\";\n }\n }\n\n return foundEvents;\n}", "function makeDay(){\n bgColor = '#87ceeb';\n grassColor= \"#7cfc00\";\n}", "function highlightDateWithEvent(month){\n\t$(\"#calendar>tr>td.dateWithEvent\").removeClass(\"dateWithEvent\");\n\tvar events = [];\n\tevents = eventRecord.getMonthEvents(month);\n\tfor (var i=0; i<31; i++) {\n\t\tif (events[i].isNotEmpty()) {\n\t\t\tvar d = i+1;\n\t\t\t$(\"#\"+d+\"-\"+month+\"-\"+yearIndex).addClass(\"dateWithEvent\");\n\t\t}\n\t}\n}", "function colorEventCell(str,r,c)\n{\n globalEventSheet.getRange(r , c).setBackground(str);\n}", "function colorDay(date) {\n // Transform to right format\n let new_date = `${date.substring(8, 10)}${date.substring(4, 8)}${date.substring(0, 4)}`\n\n // Returning the prevoues block to original color\n if (previous_block){\n if (document.querySelector(`rect#__${previous_block}`)){\n var ele = document.querySelector(`rect#__${previous_block}`)\n let color = ele.attributes.class.value\n ele.style = `fill:${color};`\n\n }\n // If it had no color, make it white\n else{\n var ele2 = document.querySelector(`rect#_${previous_block}`)\n let color = ele2.attributes.class.value\n ele2.style = `fill:white;`\n\n }\n }\n // Make red\n if (document.querySelector(`rect#__${new_date}`)){\n var ele = document.querySelector(`rect#__${new_date}`)\n ele.style = \"fill:red;\"\n previous_block = new_date\n\n }\n else{\n var ele2 = document.querySelector(`rect#_${new_date}`)\n ele2.style = \"fill:red;\"\n previous_block = new_date\n }\n}", "function addColorEvent(evt) {\n if (evt.target.nodeName.toLowerCase() === \"td\") {\n evt.target.style.backgroundColor = colorPicker.value;\n }\n}", "function colorVerification(){\n for(i = 0; i < generalInfo.length; i++){\n var timeDisplay = moment(generalInfo[i].display,'hA');\n timeSame = (moment(timeNow).isSame(timeDisplay));\n timeAfter = (moment(timeNow).isAfter(timeDisplay));\n timeBefore = (moment(timeNow).isBefore(timeDisplay));\n if (timeSame == true) {\n $(\"#hoursText\"+generalInfo[i].display).css({\"background-color\" : \"red\"});\n $(\"#inputEvent\"+generalInfo[i].display).css({\"background-color\" : \"red\"});\n //console.log($(\"#mainHours\"+hourDis[i]));\n }if (timeBefore == true) {\n $(\"#hoursText\"+generalInfo[i].display).css({\"background-color\" : \"lightgreen\"});\n $(\"#inputEvent\"+generalInfo[i].display).css({\"background-color\" : \"lightgreen\"});\n //console.log(\"future\");\n }if (timeAfter == true) {\n $(\"#hoursText\"+generalInfo[i].display).css({\"background-color\" : \"lightgray\"});\n $(\"#inputEvent\"+generalInfo[i].display).css({\"background-color\" : \"lightgray\"});\n //console.log(\"past\")\n }\n }\n }", "function resetRevertColors() {\n var events = JSON.parse(localStorage.getItem(\"manageClasses_revertColorEvents\"));\n var allEvents = $('#calendar').fullCalendar('clientEvents');\n for (var i = 0; i < allEvents.length; i++) {\n if (allEvents[i]._id in events) {\n allEvents[i].color = '#5f5f5f';\n }\n }\n localStorage.setItem(\"manageClasses_revertColorEvents\", \"{}\");\n //rerender events\n $(\"#calendar\").fullCalendar('renderEvents', events);\n}", "function addColor() {\n var taskBlock = document.getElementsByClassName(\"task\");\n for (i = 0; i < taskBlock.length; i++) {\n if (i + 8 == currentHour) {\n //if the time block is the current hour, then background is red\n taskBlock[i].style.backgroundColor = '#F5B7B1';\n } else if (i + 8 > currentHour) {\n //if the time block is greater than the current hour, future, then green\n taskBlock[i].style.backgroundColor = '#ABEBC6';\n } else {\n //all other cases means that the time has passed, so grey\n taskBlock[i].style.backgroundColor = '#D5D8DC';\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 setTimeSlotColors() {\n var currentTime = moment().format(\"H\");\n\n for (var i = 0; i < timeSlots.length; i++) {\n if (timeSlots[i].id === currentTime) {\n timeSlots[i].style.backgroundColor = current_task_color;\n } else if (parseInt(timeSlots[i].id) > parseInt(currentTime)) {\n timeSlots[i].style.backgroundColor = future_task_color;\n } else if (parseInt(timeSlots[i].id) < parseInt(currentTime)) {\n timeSlots[i].style.backgroundColor = past_task_color;\n }\n }\n}", "function resetColours(){\r\nfor (var x = 0;x < reminders.length; x++)\r\n\t{\r\n\thighlightDate(reminders[x]);\r\n\t}\r\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 renderEvent () {\n const daysContainer = document.querySelectorAll(\".current-month-day\");\n const currentMonth = date.getMonth() + 1;\n const currentYear = date.getFullYear();\n //* Calendar days divs pass by\n for (let div of daysContainer) {\n const dayNumber = div.firstChild.innerHTML;\n //* checking that day has events\n if (!!eventsByDate[`${currentYear}-${currentMonth}-${dayNumber}`]) {\n //* Looping thru events in array\n for (let eventObjectId of eventsByDate[`${currentYear}-${currentMonth}-${dayNumber}`]){\n //* Access to event data\n const eventTitle = eventsById[eventObjectId].title;\n const eventType = eventsById[eventObjectId].eventType;\n //* Create of the event element\n let newEvent = document.createElement(\"div\");\n newEvent.classList.add(\"event-in-calendar\");\n newEvent.innerHTML = eventTitle;\n newEvent.setAttribute(\"divEventId\", eventObjectId);\n //* choosing event color depending of event type\n switch (eventType) {\n case 'Study':\n newEvent.classList.add(\"blue-event\");\n break;\n case 'Meeting':\n newEvent.classList.add(\"green-event\");\n break;\n case 'Personal':\n newEvent.classList.add(\"orange-event\");\n break;\n default:\n break;\n }\n newEvent.addEventListener('click', eventModal);\n //* Insert element in DOM\n div.firstChild.insertAdjacentElement('afterend',newEvent);\n }\n }\n }\n}", "function dayClick(date, jsEvent, view)\n {\n\n alert('Clicked on: ' + date.format());\n\n // alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);\n\n // alert('Current view: ' + view.name);\n\n // change the day's background color just for fun\n // $(this).css('background-color', 'red');\n }", "function getColor(e) {\n color = e.value;\n }", "function drawDayEvent() {\r\n if (eventSource != null) {\r\n $.each(eventSource, function (i, result) {\r\n $(\"#evxDay\" + formatJsonSimple(result.StartDate)).append('<tr><td width=\"100%\" valign=\"top\"><img id=\"imgApproved' + result.Id + '\" style=\"display:none\" border=\"0\" align=\"absmiddle\" title=\"Đã chấp nhận\" src=\"' + urlRoot + 'images/img_Calendar/icon_approved.gif\"><img id=\"imgRejected' + result.Id + '\" style=\"display:none\" border=\"0\" align=\"absmiddle\" title=\"Đã từ chối\" src=\"' + urlRoot + 'images/img_Calendar/icon_rejected.gif\"><a id=\"lnkViewId' + result.Id + '\" href=\"javascript:;\" onclick=\"viewEventDetail(' + result.Id + ')\">' + formatDateTime(result.StartDate) + ' ' + result.Title + '</a></td></tr>');\r\n /* cai dat hien thi cac icon trang thai */\r\n if (result.Status == 2) {\r\n $(\"#imgApproved\" + result.Id).attr(\"style\", \"\");\r\n }\r\n else if (result.Status == 3) {\r\n $(\"#imgRejected\" + result.Id).attr(\"style\", \"\");\r\n }\r\n else if (result.Status == 4) {\r\n $(\"#lnkViewId\" + result.Id).html('<strike>' + $(\"#lnkViewId\" + result.Id).text() + '</strike>');\r\n $(\"#lnkViewId\" + result.Id).attr(\"style\", \"color: red\");\r\n $(\"#lnkViewId\" + result.Id).attr(\"title\", \"Đã hủy\");\r\n $(\"#lnkViewId\" + result.Id).attr(\"alt\", \"Đã hủy\");\r\n }\r\n });\r\n }\r\n}", "function drawTimeline(){\n\t\n\tvar color;\n\n\tfor(var i=0; i<timeline.length; i++){\n\t\tvar newPar = document.createElement(\"p\");\n\n\t\tif(timeline[i].name == \"Economic Downturn\"){\n\t\t\tcolor = \"red\";\n\t\t}else if(timeline[i].name == \"Economic Boom\"){\n\t\t\tcolor = \"green\";\n\t\t}\n\n\t\tvar text = timeline[i].year + \": \" + timeline[i].name + \" occured in \" + timeline[i].to + \".\";\n\n\t\tvar textNode = document.createTextNode(text);\n\t\tnewPar.appendChild(textNode);\n\t\tnewPar.className += \"mes \" + color;\n\t\tdocument.getElementById(\"events\").appendChild(newPar);\n\t\tscrollEvents();\n\t}\n}", "function changeColor(e) {}", "function changeColor() {\n\n // iterate through the daySchedule object \n for (var c = 0; c < daySchedule.length; c++) {\n currentTime = moment().format('HH');\n var d = daySchedule[c].time;\n\n // divide the object's time value by 100 to get two digits (representing hours)\n d = daySchedule[c].time / 100;\n\n // declare the variable that represents each iteration of the activity elements\n var a = $('#activity-' + c);\n\n // check if the time value in the object is less than, greater than, or equal to the current time\n if (d < currentTime) {\n\n // apply grey background to activity slots for previous hours\n a.addClass('past');\n a.removeClass('present');\n a.removeClass('future');\n\n }\n else if (d > currentTime) {\n\n // apply green background to activity slots for future hours\n a.removeClass('past');\n a.removeClass('present');\n a.addClass('future');\n\n }\n else {\n\n // apply red background to activity slots for the current hour\n a.removeClass('past');\n a.addClass('present');\n a.removeClass('future');\n\n }\n }\n}", "function updateCalendar(){\n //events = [];\n document.getElementById(\"display_events\").innerHTML = \"\";\n //document.getElementById(\"days\").innerHTML = \"\";\n $(\"#days\").empty();\n\tlet weeks = currentMonth.getWeeks();\n \n const data = {'month': currentMonth.month+1, 'year': currentMonth.year};\n eventsDay(data);\n //console.log(currentMonth);\n let index = 0;\n\tfor(let w in weeks){\n\t\tlet days = weeks[w].getDates();\n index++;\n\t\t// days contains normal JavaScript Date objects.\n\t\t//alert(\"Week starting on \"+days[0]); \n\t\t//$(\"#days\").append(\"<div class='calendar__week'>\");\n\t\tfor(let d in days){ \n\t\t\t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\n\t\t\t// WebWit Inspector, or Dragonfly.\n const dayRegex = /(\\d{2})/g;\n const dayMatch = dayRegex.exec(days[d])[1];\n //const data = {'day': dayMatch, 'month': currentMonth.month+1, 'year': currentMonth.year};\n let name =\"\";\n let namearray = [];\n let count = 0;\n for (let i = 0; i < eventclass.length; ++i) {\n //console.log(eventclass[i].name);\n //console.log(eventclass[i].day + \" \" + dayMatch);\n const c = eventclass[i].tag;\n let color;\n if (c == 'holiday') {\n color = 'green';\n }\n else if (c == 'birthday') {\n color = 'pink';\n }\n else if (c == 'exam') {\n color = 'blue';\n }\n else if (c == 'important') {\n color = 'red';\n }\n else {\n color = '#aab2b8';\n }\n //console.log(eventclass[i].name + \" \" + eventclass[i].month);\n \n if (eventclass[i].day == dayMatch && currentMonth.month+1 == eventclass[i].month && currentMonth.year == eventclass[i].year) {\n //console.log(\"entered\");\n if (eventclass[i].day < 7) {\n if(index > 1) {\n //console.log(\"less than 1\");\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(eventclass[i].month);\n //console.log(\"greater\");\n }\n \n }\n else if (eventclass[i].day > 23) {\n if(index < 3) {\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n \n }\n }\n else {\n //sname = name.concat(eventclass[i].name);\n // name= name.concat(\"<button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">\" + eventclass[i].name + \"</button><p>\");\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(\"work\");\n //name = name + \"\\n\" + \"\\n\";\n //namearray[count] = name;\n //count ++;\n }\n\n }\n }\n if(name == \"\"){\n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"</div></li>\");\n } else {\n \n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"<br>\" +name + \"</div></li>\");\n }\n }\n\t}\n const mod_buttons = document.getElementsByClassName('mod');\n const del_buttons = document.getElementsByClassName('del');\n const time_buttons = document.getElementsByClassName('time');\n for ( let j in Object.keys( mod_buttons ) ) {\n mod_buttons[j].addEventListener(\"click\", modifyEvents, false);\n }\n for ( let k in Object.keys( del_buttons ) ) {\n del_buttons[k].addEventListener(\"click\", deleteEvents, false);\n }\n for ( let m in Object.keys( time_buttons ) ) {\n time_buttons[m].addEventListener(\"click\", viewtime, false);\n }\n \n}", "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n console.log(events);\n eventos = [];\n if (events.length > 0) {\n events.forEach(obj => {\n colorEvent = \"\";\n for(var color in colores){\n if (colores[color].id == obj.colorId ) {\n colorEvent = colores[color].color;\n textColorEvent = \"#FFFFFF\";\n }\n }\n eventos.push({id: obj.id, title: obj.summary, description:obj.description,location:obj.location, start: obj.start.dateTime, end: obj.end.dateTime, color: colorEvent, textColor: textColorEvent});\n })\n //console.log(eventos);\n $('#calendar').fullCalendar({\n header: {\n language: 'es',\n left: 'prev,next today',\n center: 'title',\n right: 'month,basicWeek,basicDay',\n },\n timeZone: 'UTC',\n timeFormat: 'h:mm a',\n editable: true,\n eventLimit: true, // allow \"more\" link when too many events\n selectable: true,\n selectHelper: true,\n select: function(start, end) {\n document.getElementById(\"start\").value = moment(start).format('YYYY-MM-DD');\n document.getElementById(\"hrastart\").value = moment(start).format('HH:mm:ss');\n document.getElementById(\"end\").value = moment(end).format('YYYY-MM-DD');\n document.getElementById(\"hraend\").value = moment(end).format('HH:mm:ss');\n document.getElementById(\"btnGuardar\").style.display = \"inline-block\";\n document.getElementById(\"btnActualizar\").style.display = \"none\";\n document.getElementById(\"btnEliminar\").style.display = \"none\";\n mostrarModal();\n },\n eventRender: function(event, element) {\n element.bind('click', function() {\n document.getElementById(\"id\").value = event.id;\n document.getElementById(\"title\").value = event.title;\n document.getElementById(\"descripcion\").value = event.description;\n document.getElementById(\"direccion\").value = event.location;\n document.getElementById(\"color\").value = event.color;\n document.getElementById(\"start\").value = moment(event.start).format('YYYY-MM-DD');\n document.getElementById(\"hrastart\").value = moment(event.start).format('HH:mm:ss');\n document.getElementById(\"end\").value = moment(event.end).format('YYYY-MM-DD');\n document.getElementById(\"hraend\").value = moment(event.end).format('HH:mm:ss');\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n document.getElementById(\"btnActualizar\").style.display = \"inline-block\";\n document.getElementById(\"btnEliminar\").style.display = \"inline-block\";\n mostrarModal();\n });\n },\n // eventDrop: function(event, delta, revertFunc) { // si changement de position\n // edit(event);\n // },\n // eventResize: function(event,dayDelta,minuteDelta,revertFunc) { // si changement de longueur\n // edit(event);\n // },\n events:eventos,\n });\n }\n });\n}", "function coloring(event) {\n event.target.style.backgroundColor = pickColor();\n}", "function highlightday() {\r\n var day = new Date();\r\n var dayAsInt = day.getDay();\r\n var block1 = \"\";\r\n var block2 = \"\";\r\n var block3 = \"\";\r\n if (dayAsInt == 0) {\r\n block1 = document.getElementsByClassName(\"sun\")\r\n block2 = document.getElementsByClassName(\"weekend\");\r\n } else if (dayAsInt <= 3) {\r\n block1 = document.getElementsByClassName(\"mon-wed\");\r\n block2 = document.getElementsByClassName(\"mon-thurs\");\r\n block3 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt <= 4) {\r\n block1 = document.getElementsByClassName(\"thurs\");\r\n block2 = document.getElementsByClassName(\"mon-thurs\");\r\n block3 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt == 5) {\r\n block1 = document.getElementsByClassName(\"fri\");\r\n block2 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt == 6) {\r\n block1 = document.getElementsByClassName(\"sat\");\r\n block2 = document.getElementsByClassName(\"weekend\");\r\n }\r\n\r\n for (var i = 0; i < block1.length; i++) {\r\n block1[i].style[\"color\"] = \"#2E8B57\";\r\n block1[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n\r\n for (var i = 0; i < block2.length; i++) {\r\n block2[i].style[\"color\"] = \"#2E8B57\";\r\n block2[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n\r\n for (var i = 0; i < block3.length; i++) {\r\n block3[i].style[\"color\"] = \"#2E8B57\";\r\n block3[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n}", "drawCalendarDayOfTheWeek() {\n const ctx = this.context;\n const dayOfTheWeek = this.coordinate.calendarArea.dayOfTheWeek;\n dayOfTheWeek.forEach((v, idx) => {\n this.dynamicDraw(\n ctx,\n v.startX, v.startY,\n v.width, v.height,\n {\n fillText: {\n show: true,\n text: this.options.dayOfTheWeekArr[this.options.titleType.dayOfTheWeek][idx],\n },\n stroke: {\n show: false,\n },\n align: 'center',\n padding: { bottom: 8 },\n font: '10px Roboto Condensed',\n },\n );\n });\n }", "function getFillColor(index, color) {\n var fillColor = color;\n\n if ((index === (DAYS_OF_WEEK - 2)) || (index === (DAYS_OF_WEEK - 1))) {\n fillColor = Utilities.shadeColor(color, -0.3);\n }\n\n return fillColor;\n }", "function timeColor() {\n currentHour = moment().format(\"hhA\");\n //If currentHours is before 9am set all hours to background color to gray\n if (possibleHours.before.indexOf(currentHour) !==-1){\n $(\".hourNotes\").css(\"background-color\", \"#d3d3d3\");\n }\n // If currentHour is after 5, set all hours to background-color to gray\n if (possibleHours.after.indexOf(currentHour) !== -1) {\n $(\".hourNotes\").css(\"background-color\", \"#d3d3d3\");\n }\n // If currentHour is between 9 and 5...\n if (possibleHours.business.indexOf(currentHour) !== -1) {\n // Set the id that matches currentHour to background-color to red\n $(\"#\" + currentHour).css(\"background-color\", \"#ff6961\");\n // Set all hours before currentHour to background-color: gray\n for (let i = 0; i < possibleHours.business.indexOf(currentHour); i++) {\n $(\"#\" + possibleHours.business[i]).css(\"background-color\", \"#d3d3d3\");\n }\n // Set all hours after currentHour to background-color to green\n for (\n let i = possibleHours.business.length - 1;\n i > possibleHours.business.indexOf(currentHour);\n i--\n ) {\n $(\"#\" + possibleHours.business[i]).css(\"background-color\", \"#77dd77\");\n }\n }\n }", "function setColors() {\n timeBlock.each(function() {\n var hour = $(this).attr(\"id\")\n\n if (currentTime > hour) {\n $(this).addClass('past')\n }\n if (currentTime == hour) {\n $(this).removeClass('past')\n $(this).addClass('present')\n }\n if (currentTime < hour) {\n $(this).removeClass('past')\n $(this).removeClass('present')\n $(this).addClass('future')\n }\n })\n}", "function changeColor(e) {\n color = e.target.dataset.color;\n section.style.backgroundColor = color;\n }", "function assignColorIndication(data) {\n var finalArray = []; //stores formatted events data\n var overLappingArray = []; //stores set of overlapping arrays\n var oReferenceObject = data[0]; //Assuming Niki's data will be firts element\n data[0][\"label\"] = \"Me\"; //Assign lunch event as \"Me\" assuming first entry will be for Nikki\n data[0][\"top\"] = data[0].start;\n data[0][\"color\"] = \"green\";\n data[0][\"position\"] = 1;\n data[0][\"id\"] = 0;\n finalArray.push(data[0]);\n //Loop through every item in eventsdata to calculate overlap value and assign respective color codes\n for (var i = 1; i < data.length; i++) {\n data[i][\"id\"] = i;\n /*\n * Usecase-1\n * Event Planned earlier than Nikki and overlaps with Nikki's time slot\n **/\n if (data[i].start < oReferenceObject.start) {\n if (data[i].end - oReferenceObject.start > 30) {\n data[i][\"color\"] = \"green\";\n } else {\n data[i][\"color\"] = \"#4f85f0\";\n }\n data[i][\"overlap\"] = data[i].end - oReferenceObject.start;\n data[i][\"label\"] = \"Brilliant Lunch\";\n finalArray.push(data[i]);\n }\n /*\n * Usecase-2\n * Event planned later than Nikki and overlaps with Nikki's time slot\n **/\n if (data[i].start > oReferenceObject.start) {\n if (oReferenceObject.end - data[i].start > 30) {\n data[i][\"color\"] = \"green\";\n } else {\n data[i][\"color\"] = \"#4f85f0\";\n }\n data[i][\"overlap\"] = oReferenceObject.end - data[i].start;\n data[i][\"label\"] = \"Brilliant Lunch\";\n finalArray.push(data[i]);\n }\n /*\n * Usecase-3\n * Event never matches with Nikki's timeslot\n **/\n if ((data[i].start > oReferenceObject.end) || (data[i].end < oReferenceObject.start)) {\n data[i][\"color\"] = \"#4f85f0\";\n data[i][\"overlap\"] = 0;\n }\n }\n\n var bIfAnyOverLapExists = false; //declaring bIfAnyOverLapExists to false\n var overlappingSameSlotEvents = []; //stores set of overlapping elements\n //Looping finalArray to find if overlapping exists\n for (var i = 1; i < finalArray.length; i++) {\n if (finalArray[i].overlap > 30) {\n bIfAnyOverLapExists = true; //set to true if overlap value is greater than 30\n overLappingArray.push(finalArray[i]);\n }\n }\n\n //Sorting overlap array to derive the item with highest overlap value\n overLappingArray.sort(function(a, b) {\n return b.overlap - a.overlap;\n });\n\n /* If there exists one or set of overlapping array then picking the first element whihc has higher\n overlap value */\n if (overLappingArray.length > 0) {\n var matchedEvent = overLappingArray[0];\n for (var i = 1; i < finalArray.length; i++) {\n //If ID of first element with highest overlap value matches with any of element in finalArray\n if (matchedEvent[\"id\"] == finalArray[i].id) {\n finalArray[i].color = \"green\";\n } else {\n finalArray[i].color = \"#4f85f0\";\n }\n }\n }\n\n //If no event overlaps with nikki's event then conclude the color of display\n !bIfAnyOverLapExists ? finalArray[0].color = \"black\" : '';\n return finalArray;\n}", "function colorEventCells(lngEventTypeId,lngEventId)\n{\n clearColors('F'); \n if(lngEventTypeId == CONSTANTS.EventDataTypeId.lngTime)\n {\n colorEventCell(COLORS.Red, CONSTANTS.cellEventMilesValue[0] , CONSTANTS.cellEventMilesValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventAmountValue[0] , CONSTANTS.cellEventAmountValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventVehicleUsedValue[0] , CONSTANTS.cellEventVehicleUsedValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventPaymentTypeValue[0] , CONSTANTS.cellEventPaymentTypeValue[1], globalEventSheet.getSheetName());\n var cellTmp = globalEventSheet.getRange(CONSTANTS.cellEventTimeStartValue[0] , CONSTANTS.cellEventTimeStartValue[1]);\n globalEventSheet.setActiveRange(cellTmp);\n \n }else if (lngEventTypeId == CONSTANTS.EventDataTypeId.lngAmount)\n {\n colorEventCell(COLORS.Red, CONSTANTS.cellEventMilesValue[0] , CONSTANTS.cellEventMilesValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventTimeStartValue[0] , CONSTANTS.cellEventTimeStartValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventTimeStopValue[0] , CONSTANTS.cellEventTimeStopValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventVehicleUsedValue[0] , CONSTANTS.cellEventVehicleUsedValue[1], globalEventSheet.getSheetName()); \n var cellTmp = globalEventSheet.getRange(CONSTANTS.cellEventAmountValue[0] , CONSTANTS.cellEventAmountValue[1]);\n globalEventSheet.setActiveRange(cellTmp);\n \n }else if (lngEventTypeId == CONSTANTS.EventDataTypeId.lngMileage)\n {\n colorEventCell(COLORS.Red, CONSTANTS.cellEventTimeStartValue[0] , CONSTANTS.cellEventTimeStartValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventTimeStopValue[0] , CONSTANTS.cellEventTimeStopValue[1], globalEventSheet.getSheetName());\n var strEventPaymentDefault = globalProgramDataSheet.getRange(CONSTANTS.cellDefaultPaymentType[0],CONSTANTS.cellDefaultPaymentType[1]).getValue();\n globalEventSheet.getRange(CONSTANTS.cellEventPaymentTypeValue[0] , CONSTANTS.cellEventPaymentTypeValue[1]).setValue(strEventPaymentDefault);\n var cellTmp = globalEventSheet.getRange(CONSTANTS.cellEventMilesValue[0] , CONSTANTS.cellEventMilesValue[1]);\n globalEventSheet.setActiveRange(cellTmp);\n } else if(lngEventTypeId === CONSTANTS.EventDataTypeId.lngTimeAmount)\n {\n colorEventCell(COLORS.Red, CONSTANTS.cellEventMilesValue[0] , CONSTANTS.cellEventMilesValue[1], globalEventSheet.getSheetName());\n colorEventCell(COLORS.Red, CONSTANTS.cellEventVehicleUsedValue[0] , CONSTANTS.cellEventVehicleUsedValue[1], globalEventSheet.getSheetName());\n var lngEventDefault = getEventDefault(lngEventId);\n globalEventSheet.getRange(CONSTANTS.cellEventAmountValue[0] , CONSTANTS.cellEventAmountValue[1]).setValue(lngEventDefault);\n var strEventPaymentDefault = globalProgramDataSheet.getRange(CONSTANTS.cellDefaultPaymentType[0],CONSTANTS.cellDefaultPaymentType[1]).getValue();\n globalEventSheet.getRange(CONSTANTS.cellEventPaymentTypeValue[0] , CONSTANTS.cellEventPaymentTypeValue[1]).setValue(strEventPaymentDefault);\n \n }\n}", "function renderCal() {\n $('#calendar').fullCalendar('rerenderEvents');\n }", "function select(dayView) {\n\t\tif (isCurrentMonth && oldDay.text == dayOfMonthToday) {\n\t\t\t//oldDay.color = 'white';\n\t\t\toldDay.backgroundColor = util.CalendarWindowColor.CURRENTDATE_COLOR;\t\t\t//'#FFFFF000';\n\t\t\toldDay.borderColor = util.CalendarWindowColor.CURRENTDATE_COLOR;\n\t\t} else {\n\t\t\t//oldDay.color = '#3a4756';\n\t\t\toldDay.backgroundColor = util.CalendarWindowColor.FOCUSDATE_COLOR;\t\t\t//'#FFDCDCDF';\n\t\t\toldDay.borderColor = util.CalendarWindowColor.FOCUSDATE_COLOR;\n\t\t}\n\t\toldDay.backgroundPaddingLeft = 0;\n\t\toldDay.backgroundPaddingBottom = 0;\n\t\tif (isCurrentMonth && dayView.text == dayOfMonthToday) {\n\t\t\tdayView.backgroundColor = util.CalendarWindowColor.OVERLAP_COLOR;\t\t\t//'#FFFF00FF';\n\t\t\tdayView.borderColor = util.CalendarWindowColor.OVERLAP_COLOR;\n\t\t} else {\n\t\t\tdayView.backgroundColor = util.CalendarWindowColor.FOCUSDATE_COLOR;\t\t\t//'#FFFF0000';\n\t\t\tdayView.borderColor = util.CalendarWindowColor.FOCUSDATE_COLOR;\n\t\t}\n\t\t// to fix the strange color bug we were having, reclicking the overlapping date should not result in a color change\n\t\tif (oldDay.text == dayView.text && dayView.backgroundColor == util.CalendarWindowColor.OVERLAP_COLOR){\n\t\t\tdayView.backgroundColor = util.CalendarWindowColor.OVERLAP_COLOR;\t\t\t//'#FFFF00FF';\n\t\t\tdayView.borderColor = util.CalendarWindowColor.OVERLAP_COLOR;\n\t\t\toldDay.backgroundColor = util.CalendarWindowColor.OVERLAP_COLOR;\t\t\t//'#FFFF00FF';\n\t\t\toldDay.borderColor = util.CalendarWindowColor.OVERLAP_COLOR;\n\t\t}\n\t\tdayView.backgroundPaddingLeft = 1;\n\t\tdayView.backgroundPaddingBottom = 1;\n\t\t//dayView.color = 'white';\n\t\toldDay = dayView;\n\t}", "function AllEvent(event) {\n\t\t// copy the original event\n\t\tthis.event = event;\n\t\t\n\t\tthis.style = {\n\t\t\t\"background-color\": this.event.color,\n\t\t\t'width': '100%',\n\t\t\t'height': '20px',\n\t\t\t'color': 'white',\n\t\t\t'text-align': 'left',\n\t\t\t'margin-top': '2px',\n\t\t\t'font-size': '15px',\n\t\t\t'overflow': 'hidden',\n\t\t\t'position': 'relative',\n\t\t\t'z-index': '1',\n\t\t};\n\t\t\n\t}", "function eleccion_color(){\r\n\r\n }", "eventStyleGetter(event){\n var backgroundColor = event.hexColor;\n var style = {\n backgroundColor: backgroundColor,\n opacity: 0.8,\n fontWeight: 600, //Slightly less than bold.\n color: 'white',\n textShadow: '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black' //Bc webkit-text-stroke is not supported on major browsers yet\n };\n return {\n style: style\n };\n }", "formatForCal() {\n var endDate;\n if(this.allday) { //respect that fullcalendar expects allday events to end at 0:00\n endDate = moment(this.end).add('1', 'day').format('YYYY-MM-DD');\n this.end = endDate + 'T00:00';\n } /* else if(!this.allday && changed) {\n endDate = moment(this.end).subtract('1', 'day').format('YYYY-MM-DD');\n this.end = endDate + 'T23:59';\n } */\n\n\n var calEvent = {\n \"title\": this.title,\n \"allDay\": this.allday,\n \"start\": moment(this.start),\n \"end\": moment(this.end),\n \"_id\": this.id,\n \"location\": this.location,\n \"description\": {\n \"organizer\": this.organizer,\n \"imageurl\": this.imageurl,\n \"status\": this.status,\n \"webpage\": this.webpage,\n \"categories\": this.categories,\n \"changed\": this.changed\n },\n };\n\n console.log(this);\n\n this.categories.forEach(function(objCategory) {\n categories.forEach(function (category) {\n if (objCategory.id === category.id) {\n calEvent[\"backgroundColor\"] = category.color;\n calEvent[\"borderColor\"] = category.color;\n }\n });\n });\n\n //console.log('Formatted for cal: ', calEvent);\n\n return calEvent;\n }", "function customEvent(event) {\n heading.textContent = `${event.clientX}, ${event.clientY}`;\n document.body.style.backgroundColor = `rgb(${event.clientX}, ${event.clientY}, 40)`;\n}", "function displayColor(time, index) {\n const item = calendarList[time];\n let indexClass = \"\";\n let momentTime = moment(time, 'hA').format(\"HH\"); // military time in order to compare with the current hour\n // check if the time value is equal to the current hour\n // if equals, set the item to red; if less, set to grey; if greater, set to green\n if (momentTime == currenthour) {\n indexClass = \"description present\";\n } else if (momentTime < currenthour) {\n indexClass = \"description past\";\n } else {\n indexClass = \"description future\";\n }\n // This is building the time blocks based on the array.\n calendarListEl.innerHTML +=\n `\n <div id='listgroup' class=\"input-group row\">\n <div class=\"input-group-prepend time-block\">\n <span class=\"input-group-text hour\">${time}</span>\n </div>\n <textarea id='${time}' type=\"text\" class=\"${indexClass}\" data-idx='${index}'>${item}</textarea>\n <div class=\"input-group-append\">\n <button id=\"savebtn${index}\" type=\"button\" class=\"saveBtn\" onclick=\"saveItem('${time}',event);\"><i class=\"fas fa-lock\"></i></button>\n </div>\n </div>\n `;\n }", "function setEventBackground(date, url) {\n (month = Number(date[0]) + Number(date[1]) - 1),\n (day = Number(date[3] + date[4])),\n (year = Number(date.slice(6)));\n\n let d = new Date(year, month, 1),\n firstDay = d.getDay(),\n calendarElements = firstDay + day;\n let item = document.querySelector(\n `tbody>tr:nth-child(${Math.ceil(calendarElements / 7)}) >td:nth-child(${\n calendarElements % 7 || 7\n })`\n );\n item.style = `background:url(${url}) no-repeat center center/cover`;\n // Add class for background behind date to make it visible with image background if applicable\n let eventDate = item.innerHTML;\n item.innerHTML = `<span class='eventDate'>${eventDate}</span>`;\n item.prepend(createDeleteBtn());\n}", "function colorCode() {\n\n let breakpoint = false;\n let time = \"\"\n let start = \"\";\n let end = moment();\n\n for (var i = 0; i < times.length; i++) {\n time = times[i];\n start = moment(time, 'h:mm');\n\n if(end.isBefore(start)){\n //colors red first then green after\n if(breakpoint == false){\n $(\"#area\" + i).addClass(\"present\");\n breakpoint = true;\n }else{$(\"#area\" + i).addClass(\"future\");} \n }else{\n //colors grey\n $(\"#area\" + i).addClass(\"past\");\n $('#area' + i).prop('readonly', true);\n } \n }\n}", "function setEvent() {\n $('.day-event').each(function(i) {\n var eventMonth = $(this).attr('date-month');\n var eventDay = $(this).attr('date-day');\n var eventYear = $(this).attr('date-year');\n var eventClass = $(this).attr('event-class');\n if (eventClass === undefined) eventClass = 'event';\n else eventClass = 'event ' + eventClass;\n\n if (parseInt(eventYear) === yearNumber) {\n $('tbody.event-calendar tr td[date-month=\"' + eventMonth + '\"][date-day=\"' + eventDay + '\"]').addClass(eventClass);\n }\n });\n }", "function colorCoding() {\n for (var i = 8; i < 18; i++){\n if (hour < i){\n $(\".\" + i).attr(\"style\", \"background-color: skyblue;\")\n }\n if (hour === i){\n $(\".\" + i).attr(\"style\", \"background-color: white;\")\n }\n if (hour > i){\n $(\".\" + i).attr(\"style\", \"background-color: pink;\")\n }\n\n }\n }", "function paint(event){\n event.target.style.backgroundColor = color;\n}", "CalcStyle() {\n\t\tconst diff = this.DiffinDays();\n\t\tif (diff <= 1) {\n\t\t\treturn 'item_red';\n\t\t}\n\t\tif (diff <= 3) {\n\t\t\treturn 'item_yellow';\n\t\t} else {\n\t\t\treturn 'item_green';\n\t\t}\n\t}", "function mark_holidays(type, holiday) {\n $('.fc-day').each(function(){\n if ($(this).attr('data-date') == holiday) {\n if (type === 'Legal Holiday') {\n $(this).css('background-color', '#d15b47');\n } else {\n $(this).css('background-color', '#fee188');\n }\n }\n });\n }", "function color (e){\n e.target.style.color = \"red\"\n}", "function color(d) {\n return '#2960b5'\n }", "function renderColor() {\n if (time >= \"9:00:00\" && time <= \"9:59:59\") {\n nine.classList.remove(\"hover\")\n nine.contentEditable = \"false\"\n nine.style = \"background-color: red\"\n } else if (time >= \"10:00:00\" && time < \"18:00:00\") {\n nine.classList.remove(\"hover\")\n nine.contentEditable = \"false\"\n nine.style = \"background-color: gainsboro\"\n }\n if (time >= \"10:00:00\" && time <= \"10:59:59\") {\n ten.classList.remove(\"hover\")\n ten.contentEditable = \"false\"\n ten.style = \"background-color: red\"\n } else if (time >= \"11:00:00\" && time < \"18:00:00\") {\n ten.classList.remove(\"hover\")\n ten.contentEditable = \"false\"\n ten.style = \"background-color: gainsboro\"\n }\n if (time >= \"11:00:00\" && time <= \"11:59:59\") {\n eleven.classList.remove(\"hover\")\n eleven.contentEditable = \"false\"\n eleven.style = \"background-color: red\"\n } else if (time >= \"12:00:00\" && time < \"18:00:00\") {\n eleven.classList.remove(\"hover\")\n eleven.contentEditable = \"false\"\n eleven.style = \"background-color: gainsboro\"\n }\n if (time >= \"12:00:00\" && time <= \"12:59:59\") {\n twelve.classList.remove(\"hover\")\n twelve.contentEditable = \"false\"\n twelve.style = \"background-color: red\"\n } else if (time >= \"13:00:00\" && time < \"18:00:00\") {\n twelve.classList.remove(\"hover\")\n twelve.contentEditable = \"false\"\n twelve.style = \"background-color: gainsboro\"\n }\n if (time >= \"13:00:00\" && time <= \"13:59:59\") {\n one.classList.remove(\"hover\")\n one.contentEditable = \"false\"\n one.style = \"background-color: red\"\n } else if (time >= \"14:00:00\" && time < \"18:00:00\") {\n one.classList.remove(\"hover\")\n one.contentEditable = \"false\"\n one.style = \"background-color: gainsboro\"\n }\n if (time >= \"14:00:00\" && time <= \"14:59:59\") {\n two.classList.remove(\"hover\")\n two.contentEditable = \"false\"\n two.style = \"background-color: red\"\n } else if (time >= \"15:00:00\" && time < \"18:00:00\") {\n two.classList.remove(\"hover\")\n two.contentEditable = \"false\"\n two.style = \"background-color: gainsboro\"\n }\n if (time >= \"15:00:00\" && time <= \"15:59:59\") {\n three.classList.remove(\"hover\")\n three.contentEditable = \"false\"\n three.style = \"background-color: red\"\n } else if (time >= \"16:00:00\" && time < \"18:00:00\") {\n three.classList.remove(\"hover\")\n three.contentEditable = \"false\"\n three.style = \"background-color: gainsboro\"\n }\n if (time >= \"16:00:00\" && time <= \"16:59:59\") {\n four.classList.remove(\"hover\")\n four.contentEditable = \"false\"\n four.style = \"background-color: red\"\n } else if (time >= \"17:00:00\" && time < \"18:00:00\") {\n four.classList.remove(\"hover\")\n four.contentEditable = \"false\"\n four.style = \"background-color: gainsboro\"\n }\n if (time >= \"17:00:00\" && time <= \"17:59:59\") {\n five.classList.remove(\"hover\")\n five.contentEditable = \"false\"\n five.style = \"background-color: red\"\n } \n if (time = \"18:00:00\") {\n localStorage.clear();\n location.reload() // will reload the screen at the end of the day, clearing the stored items\n }\n}", "function colorChange(){\n Array.from(rows).forEach(row => {\n let\n rowIdString = row.id,\n rowHour;\n if (rowIdString) {\n rowHour = parseInt(rowIdString);\n }\n if(rowHour){\n if(currentHour === rowHour){\n setColor(row, \"red\");\n }else if ((currentHour < rowHour) && (currentHour > rowHour -6)){\n setColor(row, \"green\");\n }else if ((currentHour > rowHour) && (currentHour < rowHour +6)){\n setColor(row, \"lightgrey\");\n }else{\n setColor(row, \"white\");\n }\n }\n })\n}", "function getColorCSSClass(eventDateTime){\n let colorClass = '';\n \n switch (checkDate(eventDateTime))\n {\n case \"before\": \n colorClass = 'past';\n break;\n\n case \"after\":\n colorClass = 'future';\n break;\n\n default:\n colorClass = 'present';\n break;\n\n }\n\n return colorClass;\n}", "function renderEvents() {\n var totalPercent = 100,\n currentEvent,\n curCol,\n width,\n height,\n leftOffset,\n eventText,\n i,\n j;\n \n // empty container before adding new events\n $el.empty();\n \n // go through all columns\n for (i=0; i<columns.length; i++) {\n \n // go through all events in single column\n for (j=0; j<columns[i].length; j++) {\n currentEvent = columns[i][j];\n \n width = totalPercent / (columnWidths[currentEvent.groupIndex] + 1);\n height = currentEvent.end - currentEvent.start;\n leftOffset = i * width;\n \n // If container is too short, only display event title\n if (height < 45) {\n eventText = \"<h2>Sample Event</h2>\";\n }\n // Otherwise, display event title & location\n else {\n eventText = \"<h2>Sample Event</h2><h3>Sample Location</h3>\";\n }\n \n $el.append('<div class=\"calendarSlot\" style=\"width: ' + width + '%; height:'+ height +'px; top:' + currentEvent.start + 'px; left: ' + leftOffset + '%\">' + eventText + '</div>');\n }\n }\n }", "function setColor(event) {\r\n color_random = getRandomColor()\r\n event.style.background = color_random\r\n event.style.boxShadow = `0 0 10px ${color_random}`\r\n}", "function acende(evento){\n\tvar obj = evento.target;\n\tobj.style.color = \"#000000\";\t\n}", "function setBackgroundColorToSpan(color) {\n for (let i = 0; i < color.length; i++) {\n colorEle[i].style.backgroundColor = color[i];\n handleColorClick(i, color[i]);\n }\n }", "function CalendarTheme(w, h, o, h, b) {\r\n\tthis.width = w;\r\n\tthis.height = h;\r\n\tthis.offset = o;\r\n\tthis.hoverbg = h;\r\n\tthis.background = b;\r\n}", "function background_color() {\n var data = new Date()\n var hora = data.getHours()\n if (hora >= 0 && hora < 12) {\n document.body.style.background = 'thistle'\n document.getElementsByClassName('msg').innerHTML = \"Bom Dia!\"\n } else if (hora >= 12 && hora <= 18) {\n document.body.style.background = 'rgb(191, 216, 215)'\n document.getElementsByClassName('msg').innerHTML = \"Boa Tarde!\"\n } else {\n document.body.style.background = 'rgb(195, 191, 216)'\n document.getElementsByClassName('msg').innerHTML = \"Boa Noite!\"\n }\n}", "function cellColor(e){\n\t//if BG is set, change color back to white\n\tif(e.className === 'clicked'){\n\t\te.style.backgroundColor = '#FFFF';\n\t\te.className = 'colorCell';\n\t\treturn true;\n\t}\n\n\tlet color;\n\tcolor = document.getElementById('colorPicker').value;\n\te.className = 'clicked';\n\n\n\te.style.backgroundColor = color;\n\treturn true;\n}", "function DrawSeasonCalendar() {\n let ourDate = BackendHelper.Filter.CalendarDate;\n let firstDayOfMonthDate = new C_YMD(ourDate.Year, ourDate.Month, 1);\n let firstDayOfMonthDayOfWeek = firstDayOfMonthDate.DayOfWeek();\n\n CalendarModalDate = ourDate;\n $('#vitasa_modal_calendar_date')[0].innerText = MonthNames[ourDate.Month - 1] + \" - \" + ourDate.Year.toString();\n //$('#vitasa_cal_date')[0].innerText = MonthNames[OurDate.Month - 1] + \" - \" + OurDate.Year.toString();\n\n for(let x = 0; x !== 7; x++) {\n for(let y = 0; y !== 7; y++) {\n let calSelector = \"#vitasa_cal_\" + x.toString() + y.toString();\n let calCel = $(calSelector)[0];\n let dn = x * 7 + (y - firstDayOfMonthDayOfWeek + 1);\n\n if (x === 0) {\n if (y < firstDayOfMonthDayOfWeek) {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n else {\n //let thisdate = new C_YMD(ourDate.Year, ourDate.Month, dn);\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n }\n else {\n let date = new C_YMD(ourDate.Year, ourDate.Month, dn);\n let daysInMonth = date.DaysInMonth();\n\n if (date.Day <= daysInMonth) {\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n else {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n }\n }\n }\n}", "changeCaseColor(){\n\t cases.forEach((files, index) =>{\n\t\tif(files.daysHaveLeft===3 || files.daysHaveLeft===4){\n\t\t\tfiles.color = \"warnColor smallScreenSmallerCaseContainers\";\t//if 3 or 4 days, use a yellowish color\n\t\t}else if(files.daysHaveLeft <= 2){\n\t\t\tfiles.color = \"dangerColor smallScreenSmallerCaseContainers\";//if less 2, use reddish color\t\n\t\t}else if(files.daysHaveLeft >5 && (index % 2) === 0 ) {\n\t\t\tfiles.color = \"mainColor smallScreenSmallerCaseContainers\";\t/*if greater then 5, alternate between two huse of blue*/\n\t\t}else\n\t\t\tfiles.color = \"testColor smallScreenSmallerCaseContainers\";\n\t\t\t \n\t });\n }", "function render(time, color) {\n let hours = time.getHours() % 12;\n let minutes = time.getMinutes();\n let seconds = time.getSeconds();\n \n let hoursOpacity = -0.4 + (hours/20);\n let minutesOpacity = -0.5 + (minutes/100);\n let secondsOpacity = -0.6 + (seconds/100);\n \n arcHours.sweepAngle = NUM_OF_DEGREES / NUM_OF_HOURS * (hours + minutes/NUM_OF_MINUTES);\n arcMinutes.sweepAngle = NUM_OF_DEGREES / NUM_OF_MINUTES * (minutes + seconds/NUM_OF_SECONDS);\n arcSeconds.sweepAngle = NUM_OF_DEGREES / NUM_OF_SECONDS * seconds;\n \n arcHours.style.fill = currentClockColor;\n arcMinutes.style.fill = currentClockColor;\n arcSeconds.style.fill = currentClockColor;\n \n dayNumber.text = zeroPad(time.getDate());\n dayName.text = days[time.getDay()];\n timeNum.text = hours + \":\" + minutes;\n\n}", "function timeHighlight(){\n\n if (hours > 9) {nineAm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 9) {nineAm.style.backgroundColor = \"#007000\"};\n\n if (hours > 10) {tenAm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 10) {tenAm.style.backgroundColor = \"#007000\"};\n\n if (hours > 11) {elevenAm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 11) {elevenAm.style.backgroundColor = \"#007000\"};\n\n if (hours > 12) {twelvePm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 12) {twelvePm.style.backgroundColor = \"#007000\"};\n\n if (hours > 13) {onePm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 13) {onePm.style.backgroundColor = \"#007000\"};\n\n if (hours > 14) {twoPm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 14) {twoPm.style.backgroundColor = \"#007000\"};\n\n if (hours > 15) {threePm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 15) {threePm.style.backgroundColor = \"#007000\"};\n\n if (hours > 16) {fourPm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 16) {fourPm.style.backgroundColor = \"#007000\"};\n\n if (hours > 17) {fivePm.style.backgroundColor = \"#c5c5c5\"};\n if (hours < 17) {fivePm.style.backgroundColor = \"#007000\"};\n\n }", "function updateCalendarEvent(event, calendar)\n{\n if(event) {\n var calendarEvent = calendar.getEventById(event.id);\n var eventStart = new Date(event.start_at);\n var eventEnd = new Date(event.end_at);\n var eventColor = event.color;\n var eventStatus = event.status;\n var eventPatient = event.patient;\n\n calendarEvent.setProp('backgroundColor', eventColor);\n calendarEvent.setProp('borderColor', eventColor);\n calendarEvent.setExtendedProp('status', eventStatus);\n calendarEvent.setExtendedProp('patient', eventPatient);\n calendarEvent.setDates(eventStart, eventEnd);\n }\n}", "function createCalendar (schedule) {\n\n\t$('#calendar').fullCalendar('removeEvents')\n\n\t$('#calendar').fullCalendar({\n\t\theader: false,\n\t\tdefaultView: 'agendaWeek',\n\t\tweekends: false,\n\t\tdefaultDate: '2015-02-09',\n\t\teditable: false,\n\t\teventLimit: true, // allow \"more\" link when too many events\n\t\tminTime: \"07:00:00\",\n\t\tallDayText: \"Online\",\n\t\tcolumnFormat: \"ddd\"\n\t});\n\n\t\t\t\t\n\tfor (var i = 0; i < schedule.length; i++) {\n\t\tvar days = splitDays(schedule[i]);\n\t\tvar color = getColor(i)\n\n\t\tif(days == \"\") // The class has no meeting days (online)\n\t\t{\n\t\t\t\tvar newEvent = new Object();\n\t\t\t\tnewEvent.title = schedule[i][\"CourseName\"] + \" \" + schedule[i][\"Title\"] + \" \" + schedule[i][\"Instructor\"]\n\t\t\t\tnewEvent.color = color\n\t\t\t\tnewEvent.start = \"2015-02-09\"\n\t\t\t\tnewEvent.end = \"2015-02-14\"\n\t\t\t\tnewEvent.allDay = true;\n\t\t\t\t$('#calendar').fullCalendar( 'renderEvent', newEvent );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (var j = 0; j < days.length; j++) {\n\t\t\t\tvar newEvent = new Object();\n\t\t\t\tnewEvent.title = schedule[i][\"CourseName\"] + \" \" + schedule[i][\"Title\"] + \" \" + schedule[i][\"Instructor\"]\n\t\t\t\tnewEvent.color = color\n\t\t\t\tvar day;\n\t\t\t\t//lazy way to do it\n\t\t\t\tif (days[j] == \"M\") {\n\t\t\t\t\tday = \"2015-02-09\"\n\t\t\t\t} else if (days[j] == \"T\") {\n\t\t\t\t\tday = \"2015-02-10\"\n\t\t\t\t} else if (days[j] == \"W\") {\n\t\t\t\t\tday = \"2015-02-11\"\n\t\t\t\t} else if (days[j] == \"R\") {\n\t\t\t\t\tday = \"2015-02-12\"\n\t\t\t\t} else if (days[j] == \"F\") {\n\t\t\t\t\tday = \"2015-02-13\"\n\t\t\t\t}\n\t\t\t\tnewEvent.start = day + \"T\" + convertMilitaryTimeToFullCalendarFormat(schedule[i][\"Start\"])\n\t\t\t\tnewEvent.end = day + \"T\" + convertMilitaryTimeToFullCalendarFormat(schedule[i][\"End\"])\n\t\t\t\tnewEvent.allDay = false;\n\n\t\t\t\t$('#calendar').fullCalendar( 'renderEvent', newEvent );\n\t\t\t}\n\t\t}\n\t}\n}", "function setColors () {\n for (const block in timeBlockArray) {\n if (currentTime > $(`#${block}`).data(\"hour\")) {\n $(`#${block}`).addClass(\"past\");\n } else if (currentTime < $(`#${block}`).data(\"hour\")) {\n $(`#${block}`).addClass(\"future\");\n } else {\n $(`#${block}`).addClass(\"present\");\n }\n }\n}", "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': '[email protected]', //'primary'\n 'timeMin': (new Date(firstDate)).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 2000,\n 'orderBy': 'startTime'\n })\n request.execute(function(resp) {\n var events = resp.items;\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n \tvar event = events[i];\n\t var when = event.start.dateTime;\n\t // oneWhen = events[0].start;\n \tif(events[i].colorId==undefined){\n \t\tconsole.log(events[i].summary);\n \t}\n\n\t // console.log(events[i].colorId)\n\t\t\tif(when){\n\t\t\t\tvar when = new Date(event.start.dateTime);\n\t\t\t\tvar whenEnd = new Date(event.end.dateTime);\n\t\t\t\tpushHere[i]=({\n\t\t\t\t\t\t\"who\": event.attendees,\n\t\t\t\t\t\t\"what\": event.summary,\n\t\t\t\t\t\t\"how\": event.description,\n\t\t\t\t\t\t\"start\": format(when),//new Date(event.start.dateTime),\n\t\t\t\t\t\t\"end\": format(whenEnd),//new Date(event.end.dateTime),\n\t\t\t\t\t\t\"colorId\": event.colorId,\n\t\t\t\t\t\t\"diff\": parseInt(new Date(format(whenEnd)) - new Date(format(when)))\t\t\t\t\t\t\n\t\t\t\t\t})\n\t\t\t}\n if (!when) {\n\t\t\t\tvar when = new Date(event.start.date);\n\t\t\t\tvar whenEnd = new Date(event.end.date);\n\t\t\t\tpushHere[i]=({\n\t\t\t\t\t\t\"who\": event.attendees,\n\t\t\t\t\t\t\"what\": event.summary,\n\t\t\t\t\t\t\"how\": event.description,\n\t\t\t\t\t\t\"start\": format(when),//new Date(event.start.date),\n\t\t\t\t\t\t\"end\": format(whenEnd),//new Date(event.end.date),\n\t\t\t\t\t\t\"colorId\": event.colorId,\n\t\t\t\t\t\t\"diff\": parseInt(new Date(format(whenEnd)) - new Date(format(when)))\t\t\t\t\t\t\n\t\t\t\t\t})\n }\n\n nestThis = d3.nest()\n\t\t\t\t.key(function(d) { return d.start; })\n\t\t\t\t.entries(pushHere);\n\n\n\t\t\t// if(nestThis.length>0){\n\t\t\t// \tfor(i=0; i<nestThis.length; i++){\n\t\t\t// \t\tdrawData(nestThis[i].values)\n\t\t\t// \t}\n\t\t\t// }\n // if(event.attendees!=undefined){\n\t // for(j=0; j<event.attendees.length; j++){\n\t // \t// console.log(i+event.attendees[j].displayName);\n\t // }\n // }\n // var when = event.start.dateTime;\n // if (!when) {\n // when = event.start.date;\n // }\n }\n } \n else {\n }\n\n });\n }", "function updateColors() {\n var today = new Date();\n var timeNow = today.getHours();\n //${i} for assigning to the style.css and added classes\n for (var i = 9; i < 18; i++) {\n //current time\n if ($(`#${i}`).data(\"time\") == timeNow) {\n $(`#text${i}`).addClass(\"present\");\n //future time\n } else if (timeNow < $(`#${i}`).data(\"time\")) {\n $(`#text${i}`).addClass(\"future\");\n }\n }\n }", "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 Schedule (name,color) {\n this.name = name;\n this.color = color;\n this.calEvents = [];\n this.isShowing = true;\n this.selectorID = parseName(this.name)\n this.html = '';\n scheduleArray.push(this);\n }", "function eventsRender(events, identifier) {\n if(activeTab == \"term1\"){\n for (var i = 0; i < events.length; i++) {\n calendar_term1.fullCalendar('renderEvent', events[i], true);\n }\n } else if(activeTab == \"term2\"){\n for (var i = 0; i < events.length; i++) {\n calendar_term2.fullCalendar('renderEvent', events[i], true);\n }\n }\n }", "function highlight_period(x_start, x_end, color) {\n var width = x_end - x_start;\n canvas.fillStyle = color;\n canvas.fillRect(x_start, area.y, width, area.h);\n }", "function colors() {\n var timeAdj = hour - 9;\n if (after == \"pm\" && hour < 12) {\n timeAdj = timeAdj + 12;\n }\n \n for (var i = 0; i < 9; i++) {\n if (i < timeAdj) {\n\n // Past color change\n $(\"#\" + i).siblings(\"textarea\").css(\"background-color\", \"#d6d6d6\");\n \n }\n else if (i > timeAdj) {\n\n // Future color change\n $(\"#\" + i).siblings(\"textarea\").css(\"background-color\", \"#ffd5d4\");\n\n }\n else {\n\n // Present color change\n $(\"#\" + i).siblings(\"textarea\").css(\"background-color\", \"#d4ffd7\");\n \n }\n }\n}", "function set_colors_dialog(){\r\n box = document.getElementById('TL_MENU');\r\n base = box.innerHTML;\r\n clr = '<i>Customize your event colours...</i>\\n';\r\n\r\n function add_color(display, event_name){\r\n clr += display.pad(9)+'= <input id=\"TL_EVENT_'+event_name+'\" value=\"'+eval(event_name)+'\"/>\\n';\r\n }\r\n add_color('BUILDING', 'BUILDING_COLOR');\r\n add_color('ATTACK', 'ATTACK_COLOR');\r\n add_color('REPORT', 'REPORT_COLOR');\r\n add_color('MARKET', 'MARKET_COLOR');\r\n add_color('RESEARCH', 'RESEARCH_COLOR');\r\n add_color('PARTY', 'PARTY_COLOR');\r\n\r\n clr += '\\n<a href=\"#\" style=\"color: blue\" id=\"TL_MENU_BACK\">BACK</a>\\n';\r\n\r\n box.innerHTML = clr;\r\n\r\n document.getElementById('TL_MENU_BACK').addEventListener('click', function(e){\r\n box.innerHTML = base;\r\n set_add_listeners(box);\r\n }, false);\r\n colors = box.childNodes;\r\n for (i in colors){\r\n if (colors[i] == undefined) continue;\r\n colors[i].addEventListener('change', function(e){\r\n id = e.target.id.substr(9);\r\n GM_setValue(prefix(id), eval(id+'=\"'+e.target.value+'\"'));\r\n }, false);\r\n }\r\n }", "function renderCalendar() {\n // render month title\n renderMonthTitle(currentMonth, monthTitleEl);\n\n // render days\n renderDays(currentMonth, daysContainerEl);\n }", "function apaga(evento){\n\tvar obj = evento.target;\n\tobj.style.color = \"#808080\";\n\t\n}", "function setCellColor(event) {\n const colorPicker = document.querySelector(\"input[type='color']\");\n event.target.style.backgroundColor = colorPicker.value;\n}", "function cambiarColor(e){\n indicadorColor.style.backgroundColor = e.target.style.backgroundColor;\n}", "function returnColor(){\n\t$('.notification-color-picker > li a i').on('click', function(e){\n\t\te.preventDefault();\n\t\tvar color = $(this).data('color');\n\n\t\t$('#notification-color').val(color);\n\t\t$('#new-event').css('background-color', color);\n\t});\n}", "_menuEventColor() {\n\n this.colorData[\"type\"] = \"set-color\";\n this._menuEventHandler(this.colorData);\n this.colorData[\"type\"] = \"select-color\";\n }", "function updateCalendarMenu() {\n let menulist = document.getElementById(\"calendar-ics-file-dialog-calendar-menu\");\n menulist.style.setProperty(\n \"--item-color\",\n menulist.selectedItem.style.getPropertyValue(\"--item-color\")\n );\n}", "function colorear(e) {\n e.target.style.backgroundColor = indicadorColor.style.backgroundColor;\n }", "function setColoringOfTasks() {\n Math.seedrandom(\"hello.\");\n\n\t// For each task, create a CSS class with a random color\n for (var i = 0; i < taskNames.length; i++) {\n \n if (taskNames[i] !== '<idle>') {\n\n \t// generating colors for non-cycle, non idle events\n\t var style = document.createElement('style');\n\t style.type = 'text/css';\n\t var color = ('00000'+(Math.random()*(1<<24)|0).toString(16)).slice(-6)\n\t style.innerHTML = '.' + taskNames[i] + ' { fill: #' + color + '; }';\n\t document.getElementsByTagName('head')[0].appendChild(style);\n } \n \n // make <idle> white\n else {\n var style = document.createElement('style');\n style.type = 'text/css';\n style.innerHTML = '.idle { fill: white; }';\n document.getElementsByTagName('head')[0].appendChild(style);\n }\n }\n}", "function ColorUpdate(){\n let mccafe=moment().hour();\n for (let i = 0; i < ts.length; i++) {\n if (ts[i]==mccafe){\n $(\"#TS\"+ ts[i]).addClass(\"present\");\n }\n else if( ts[i]>mccafe){\n $(\"#TS\"+ ts[i]).addClass(\"future\");\n }\n else {\n $(\"#TS\"+ ts[i]).addClass(\"past\");\n }\n }\n}", "function colorchng(){\n $(\"input\").each(function(){\n var rowHour = $(this).attr(\"id\");\n var rowNumber = parseInt(rowHour);\n if (rowNumber === hour){\n $(this).addClass(\"present\");\n } else if (rowNumber < hour){\n $(this).addClass(\"past\");\n } else {\n $(this).addClass(\"future\");\n };\n });\n }", "function rowColor() {\n if (time == hours24) {\n description.addClass(\"present\");\n } else if (time < hours24) {\n description.addClass(\"past\");\n } else {\n description.addClass(\"future\");\n };\n}", "function calendar_helper_updateCalEventTitleAndBackground(cal_event, new_title){\n if (cal_event.title != new_title){\n cal_event.title = new_title;\n $(\"#calendar\").weekCalendar(\"updateEvent\", cal_event);\n }\n setEventBackground(cal_event);\n}", "function renderColorTime() {\n\n $textbox.each(function () {\n //get time id for each row\n var blockHour = parseInt($(this).attr(\"hour-id\"));\n console.log(blockHour);\n\n //sets appropriate colors for each cell\n if (blockHour == currentHour) {\n $(this).addClass(\"present\")\n $(this).removeClass(\"past future\");\n }\n if (blockHour < currentHour) {\n $(this).addClass(\"past\")\n $(this).removeClass(\"present future\");\n }\n if (blockHour > currentHour) {\n $(this).addClass(\"future\")\n $(this).removeClass(\"past present\");\n }\n\n });\n}", "function drawShade(eventObj, firstTime) {\n if(current_user == undefined) {return;}\n\n var groupNum = eventObj[\"id\"];\n var members = eventObj[\"members\"];\n var task_g = getTaskGFromGroupNum(groupNum);\n\n // draw shade on main rect of this event\n //for each event it draws the shade. \n //in doing so it takes its array of members FOR THAT EVENT\n //for each member for that event it gets their ID\n //if they are the CURRENT member\n for (var i=0; i<members.length; i++) {\n var member_id = members[i];\n //var idx = getMemberIndexFromName(member[\"name\"]);\n //debugger;\n if (current_user.id == member_id){\n if (currentUserIds.indexOf(groupNum) < 0){\n currentUserIds.push(groupNum);\n currentUserEvents.push(eventObj);\n }\n\n task_g.selectAll(\"#rect_\" + groupNum)\n .attr(\"fill\", color)\n .attr(\"fill-opacity\", .4);\n\n break;\n }\n }\n\n if (currentUserEvents.length > 0){\n currentUserEvents = currentUserEvents.sort(function(a,b){return parseInt(a.startTime) - parseInt(b.startTime)});\n upcomingEvent = currentUserEvents[0].id; \n task_g.selectAll(\"#rect_\" + upcomingEvent)\n .attr(\"fill\", color)\n .attr(\"fill-opacity\", .9); \n }\n}", "function setAllEvents(savedCourses) {\n colorCounter = 0;\n classSchedules = [];\n var hours = 0;\n for (let i = 0; i < savedCourses.length; i++) {\n var classInfo = savedCourses[i];\n var course_nbr = classInfo.coursename.substring(classInfo.coursename.search(/\\d/), classInfo.coursename.indexOf(\" \", classInfo.coursename.search(/\\d/)));\n hours += parseInt(course_nbr.substring(course_nbr.search(/\\d/), course_nbr.search(/\\d/) + 1));\n for (let j = 0; j < savedCourses[i].datetimearr.length; j++) {\n let session = savedCourses[i].datetimearr[j]; // One single session for a class\n setEventForSection(session, colorCounter, i);\n }\n colorCounter++;\n }\n $(\"#hours\").text(hours + \" Hours\");\n $(\"#num\").text(savedCourses.length + \" Courses\");\n }", "function highlight(e){\neventobj=ns6? e.target : event.srcElement\nif (previous!=''){\nif (checkel(previous))\nprevious.style.backgroundColor=''\nprevious=eventobj\nif (checkel(eventobj))\neventobj.style.backgroundColor=highlightcolor\n}\nelse{\nif (checkel(eventobj))\neventobj.style.backgroundColor=highlightcolor\nprevious=eventobj\n}\n}", "function initLogCalendar(){\t\n\tvar selected_month = $(\"#cal_selected_month\").val();\n\t$('#month_' + selected_month).css(\"background-image\", \"url(\" + ReturnLink('/images/channel/calpicker/month_selector.png') + \")\");\n\t$('#month_' + selected_month).css(\"color\", \"#fff\");\n}", "function changeColor() {\n currentTime = moment().hours()\n $(\".time-block\").each(function () {\n \n var timeEvent = $(this).attr(\"id\")\n\n if (currentTime == timeEvent) {\n $(this).addClass(\"present\")\n } else if (currentTime < timeEvent) {\n $(this).addClass(\"future\")\n } else {\n $(this).addClass(\"past\")\n }\n\n })\n}", "function tableColorChangeSeventeen () {\n var currentHour = Number(`${moment().format('H')}00`);\n if (currentHour > timeTable.seventeenthHour) {\n //changing of colour to past\n $(\".17\").css({\n 'background-color': '#d3d3d3',\n 'color': 'white',\n })\n // changing of color to the present css\n } else if (currentHour == timeTable.seventeenthHour) {\n $(\".17\").css({ \n 'background-color': '#ff6961',\n 'color': 'white',\n });\n } else if (currentHour < timeTable.seventeenthHour) {\n //changing of color to future\n $(\".17\").css({\n 'background-color': '#77dd77',\n 'color': 'white',\n });\n }\n}", "function colorCode() {\n var currentTime = moment().hours();\n\n $(\".time-block\").each(function () {\n var timeBlock = parseInt($(this).attr(\"id\").split(\"-\")[0]);\n\n if (timeBlock === currentTime) {\n $(this).addClass(\"present\");\n }\n else if (timeBlock < currentTime) {\n $(this).addClass(\"past\");\n }\n else {\n $(this).addClass(\"future\");\n }\n });\n }", "function closeEventAdd(){\n window.addEvents.classList.add('hidden');\n if(selectedDay){\n selectedDay.style.backgroundColor = 'inherit';\n }\n}", "function taskNine() {\n //for loop, we style one \"answer-container\" at the time\n for (let i = 0; i < allContainers.length; i++) {\n //depending on the time we style with red or blue\n if (hour >= 17) {\n allContainers[i].style.backgroundColor = \"blue\";\n } else {\n allContainers[i].style.backgroundColor = \"red\";\n }\n }\n}" ]
[ "0.7248624", "0.7222284", "0.6989382", "0.6987157", "0.68738794", "0.67348254", "0.67117745", "0.64718235", "0.6469848", "0.63437915", "0.6327179", "0.62514055", "0.6214961", "0.62094647", "0.6176478", "0.61717534", "0.6167375", "0.61454374", "0.6106831", "0.6101825", "0.60992604", "0.6095243", "0.6092578", "0.60600185", "0.60565835", "0.6053143", "0.6038653", "0.6037219", "0.6022641", "0.5987063", "0.5981184", "0.5962439", "0.596189", "0.59539294", "0.5951201", "0.5946964", "0.5929323", "0.58643085", "0.5848896", "0.58365697", "0.5835338", "0.5833526", "0.5826802", "0.5821851", "0.5817329", "0.58158106", "0.5809267", "0.57971776", "0.57857096", "0.5782297", "0.5777409", "0.5777294", "0.577061", "0.57669425", "0.5763439", "0.57554543", "0.5752125", "0.574926", "0.5743462", "0.5743377", "0.57339746", "0.57280064", "0.57202363", "0.57159144", "0.570804", "0.57038605", "0.57015216", "0.5701244", "0.5697516", "0.56951153", "0.5688954", "0.5673149", "0.5659998", "0.5652785", "0.5651284", "0.56507826", "0.5650324", "0.56295663", "0.56205976", "0.5619399", "0.56172204", "0.5615408", "0.5615038", "0.5611264", "0.5604441", "0.5602338", "0.5595672", "0.559197", "0.55831933", "0.5580432", "0.55786145", "0.55773926", "0.55669117", "0.55627733", "0.55591553", "0.55525184", "0.5551839", "0.5551807", "0.5549364", "0.55429065", "0.553969" ]
0.0
-1
clears previous event Text
function clearEventText() { if(document.getElementsByClassName('event-desc')){ [...document.getElementsByClassName('event-desc')].forEach((event)=>{ event.outerHTML=''; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearText() {\n this.text = \"\";\n this.removeTextFromBlob(this)\n }", "function allClear() {\n previousText.innerHTML = '';\n currentText.innerHTML = '';\n}", "function clearText(e){\n\t$.originalText.value= \"\";\n\t$.originalText.focus();\n\t$.encryptedText.text = \"\";\n\t$.label2.enabled = false;\n\t$.encryptedText.enabled = false;\n}", "function clearText(text) {\n\ttext.text(\"\");\n\n\tif (text.id() == 'monologue') {\n\t\tspeech_bubble.hide();\n\t}\n\ttext_layer.draw();\n}", "function resetText(event) {\n // O Event é passado como um parâmetro para a função.\n event.target.innerText = 'Opção reiniciada';\n // O event possui várias propriedades, porém a mais usada é o event.target,\n // que retorna o objeto que disparou o evento.\n}", "function clearLogText() {\n\t\ttextLines = [];\n\t\tstartIndex = 0;\n\t\tlogTextBuffer.setText(\"\");\n\t\tlogTextBuffer.moveTo(0, 0);\n\t\tlogDraw();\n\t}", "function handleClearTranscript(event) {\r\n event.preventDefault();\r\n console.log(\"speech deleted\");\r\n\ttranscript.textContent = \"\";\r\n transcriptt.textContent = \"\";\r\n transcripttt.textContent = \"\";\r\n \r\n}", "function onRemoveText() {\n let elText = document.querySelector('.currText').value\n if (elText === '' || gMeme.existText.length === 1) return;\n var text = findTextById(gMeme.currText.id)\n gMeme.existText.splice(text, 1);\n resetValues()\n gMeme.currText = gMeme.existText[0]\n draw()\n}", "function removeText(){\r\n console.log('hell');\r\n t_text_1.destroy();\r\n t_1_flag = false;\r\n}", "function clearSelectedText() {\n selectedText = \"\";\n}", "clearText(event) {\n this.setState({\n seed: '',\n mnemonic: '',\n qrSeedContent: '',\n qrAddressContent: '',\n })\n }", "function clearText(){\n game.innerText = \"\";\n}", "clearText(event) {\n switch(event.target.value) {\n case 'seed':\n this.setState({\n seed: '',\n validSeed: false\n })\n break\n\n case 'address':\n this.setState({\n address: '',\n validAddress: false\n })\n break\n case 'output':\n this.setState({\n output: '',\n })\n break\n default:\n break\n }\n }", "clear(e) {\n this.setValue(\"\")\n }", "function removeText2(){\r\n t_text_2.destroy();\r\n}", "function clearText() {\n var inputText = document.getElementById(\"inputText\");\n inputText.value = null;\n }", "function clear() {\n calInput.innerText = \"\";\n}", "function clearFont() {\n fontArea.innerHTML = \"\";\n}", "function _onclear(event) {\n that.clear();\n that.onclear(buff.join(\"\"), buff);\n return null;\n }", "function removeD_text(){\r\n d_text.destroy();\r\n}", "finishEditingText() {\n if (!this.editingText) return;\n this.editingText.finishEditing();\n\n if (this.editingText.content === '') {\n this.editingText.remove();\n }\n\n this.editingText = null;\n this.fireEvent('canvasModified');\n }", "function clearTextZone() {\n textareaDOM.val(\"\");\n }", "clearText() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.click();\n yield this._element.clear();\n });\n }", "clearText(){\n\n\t\t\tif(clearFilterText === this.props.listing_as){\n\t\t\t\tthis.setState({\n\t\t\t\t\tfilterText: '',\n\t\t\t\t});\n\t\t\t\tclearFilterText = false;\n\t\t\t}\n\t\t}", "function clearEntryPressed(){\n inputs[inputs.length-1] = \"\";\n if(inputs.length-1 == 0){\n $(\"#displayScreen p\").text(0);\n }\n $(\"#displayScreen p\").text(inputs[inputs.length-2]);\n}", "function clearAlert () {\n alertText.innerText = \"\";\n}", "function clearChat() {\n $(\"gameOutputField\").innerHTML = \"\";\n displayMessage(\"<a href='images/how-about-no-bear.jpg' target='_blank'>see chat history</a>\");\n $(\"gameInputField\").focus();\n }", "function handleClearButton() {\n textArea.value = '';\n inputs.forEach(input => input.value = '');\n }", "clearText(event) {\n switch(event.target.value) {\n case 'seed':\n this.setState({\n seed: '',\n validSeed: false\n })\n break\n case 'address':\n this.setState({\n address: '',\n validAddress: false\n })\n break\n default:\n break\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "function clear(event){\n setProductName(\"\")\n\n }", "function onReset() {\n clear();\n}", "function clearText()\n{\n codeProcessor.clear();\n}", "function clearCurrent() {\n\n currentCity.text(\"\");\n displayedDate.text(\"\");\n currentTemp.text(\"Temperature: \");\n currentHumidity.text(\"Humidity: \");\n currentWind.text(\"Wind Speed: \");\n currentUvi.text(\"UV Index: \");\n \n}", "function clearCalendar() {\n\t$(\"#calendar\").html(\"\").css(\"background-color\",\"white\").stop().css(\"opacity\",1);\n\t$(\"#term\").html(\"\");\n}", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "clear() {\n if (this._liveElement) {\n this._liveElement.textContent = '';\n }\n }", "function clearTextField(e, message){\n if ($(e.currentTarget).val() === message){\n $(e.currentTarget).val('');\n $(e.currentTarget).css(\"color\" , \"black\");\n }\n}", "function clearPrevious() {\n previousOperand = '';\n previousOperandTextElement.innerHTML = previousOperand;\n}", "function buttonClearClickHandler(eventArg) {\n var display = document.getElementById(\"display\");\n display.value = \"\";\n }", "function resetSelectedTextElement() \n {\n element = this;\n clearPreviousSelection();\n }", "@action eventBinder() {\n var that = this;\n\n that.startPos = 0;\n that.endPos = 0;\n that.selection = '';\n that.lastchar = '\\n';\n that.previousValue = that.value;\n\n that.clearUndo();\n }", "function clickedRandomText() {\n originText.innerHTML = texts[Math.floor(Math.random() * texts.length)];\n // It will also call the reset function to reset evrything\n reset();\n}", "function clearBtnFunc() {\n\toutput.innerHTML = \"\";\n}", "function clearAPText()\n {\n // check if ap has text\n if (ap.text() != '')\n {\n // clear & fade out ap text\n ap.addClass(fadeOut)\n .text('');\n // reset AP classes after animation runs\n setTimeout(function()\n {\n ap.removeClass(fadeOut);\n }, fadeTime);\n }\n }", "function _clear(){\n\t\t\t_$content.off('click');\n\t\t\t_$content.empty();\n\t\t}", "function clearText() {\n textarea.value = \"\";\n}", "clear(e) {\n if (e) {\n if (typeof e === \"string\") {\n const element = this.get(e);\n\n if (element) {\n element.innerHTML = \"\";\n }\n } else {\n e.innerHTML = \"\";\n }\n }\n }", "_clear() {\n this.editableNode.innerHTML = \"\";\n }", "function ClearOldMessage(){\n document.getElementById(\"message\").innerHTML = \"\";\n}", "function clearText() {\n let textBox = document.getElementById('textbox');\n textBox.value = \"\"\n }", "function bindTextAreaClear(){\r\n $('#id_xel_textArea_pop_clear').unbind( \"click\" ).click(function (){\r\n\tvar tempData = $('#xel_popup_textArea').val();\r\n \t\t$('#xel_popup_textArea').val('');\r\n \t\tif($(e.target).attr(\"id\") == \"#id_xel_textArea_pop_cancel\"){\r\n\t\t $('#xel_popup_textArea').val(tempData);\r\n\t\t}\r\n\r\n\t});\r\n\r\n}", "clear () {\n this._events = {}\n }", "delete() {\n this.domElement.innerText = \"\";\n }", "function destroy(){\n\t\tif(textEl && _.isFunction(textEl.remove)){\n\t\t\ttextEl.remove();\n\t\t}\n\t}", "function clearEverything() {\n document.getElementById(\"previous\").innerText = \"\";\n previousValue = \"\";\n document.getElementById(\"current\").innerText = \"\";\n currentValue = \"\";\n output = \"\";\n operationSymbol = \"\";\n}", "function eraseFun(evt){\n if(evt.target.id === 'backspace'){ \n num = num.substring(0, num.length -1);\n screen.value = num;\n }\n // The CE button clears the entire string\n if(evt.target.id === 'clearNum'){\n num = '';\n screen.value = runningTotalInt;\n }\n // The CA Button clears the running total var\n if(evt.target.id === 'clearRunning'){\n num = '';\n runningTotalInt = 0;\n runningTotalStr = '';\n screen.value = '';\n } \n}", "function clear(){\r\n\tmessages.push({command:\"clearHighlights\"});\r\n\tgetCurrentTabAndSendMessages();\r\n}", "function clear() {\r\n msg.value = \"\";\r\n key.value = \"\";\r\n msgLen = 0;\r\n keyLen = 0;\r\n btn.disabled = true;\r\n}", "clear () {\n this.setValue('');\n }", "clearSendedLabel()\n\t{\n\t\tthis.sendedLabel = [];\n\t}", "function clearCurrentQuestion() {\n questionText.textContent = \"\";\n optionList.textContent = \"\";\n}", "function clearText() {\n let chooseWarning = document.getElementById('chooseWarning');\n if (chooseWarning != null) {\n chooseWarning.remove();\n }\n}", "function clearText () {\n guessMessage.innerHTML=\"\";\n guessedNumber.innerHTML=\"\";\n challengeMessage.innerHTML =\"\"\n flowerSpinner.classList.add('hidden');\n}", "function clearScheduleTitle(e) {\n\t\tvar id = e.target.id;\n\t\tvar target;\n\n\t\tif (id === 'clearMain') target = document.getElementById('mainInput');\n\t\telse target = document.getElementById('otherInput');\n\n\t\ttarget.value = '';\n\t\ttarget.focus();\n\t}", "function clearEventConfig() {\n eventConfig.innerHTML = '';\n}", "function clearText(element) {\n element.value = '';\n}", "function partialClear() {\n calcInput = \"\";\n screenContents = [];\n}", "function clearTextValue(){\n\t\t$(\"#\" + g.k).val(\"\");\n\t\t$(\"#clearbtn\").hide();\n\t}", "function clearLabel() {\n}", "function reset() {\n processText(task.text);\n remark();\n }", "function ClearTextSelection() {\n\t//console.log('Clear text selection.');\n\tif ( document.selection ) {\n //console.log('document.selection'); \n\t\tdocument.selection.empty();\n\t} else if ( window.getSelection ) {\n\t\t//console.log('window.getSelection');\n\t\twindow.getSelection().removeAllRanges();\n\t}\n} // END ClearTextSelection.", "function clearMessages() {\n hint.textContent = \"\";\n hold.textContent = \"\";\n wrongGuess.textContent = \"\";\n usedLetters.textContent = \"\";\n usedLettersLabel.textContent = \"\";\n changeImageNull(\"\");\n \n }", "function consoleClear() {\n //Get document text and clear\n document.getElementById(\"consoleText\").value = \"\";\n}", "function cleartextbox(){\n $(\"#final_span\").val('');\n // $('#MessageBox').val('');\n}", "function clearGrammar() {\n document.getElementById(\"gtextArea\").value = \"\";\n}", "function onClearClick() {\n function callback(state) {\n $('feedback').update('');\n $('feedback_code').update('');\n derivation = [];\n fillWorkField(state.term);\n derivation.push(state);\n }\n\n generateService('tutor', \"Medium\", callback);\n}", "function clear() {\n\t\t\tdiv.update('');\n\t\t\tlastSelected = null;\n\t\t\tspinnerVisible = false;\n\t\t}", "clean () {\n this._messageBoard.textContent = ''\n }", "function clear(){\n output.innerHTML = '';\n}", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function clear(operation = '') {\r\n history += current+ ' ' + operation + ' ';\r\n historyDisplay.innerText = history;\r\n currentDisplay.innerText = '';\r\n current = '';\r\n tempDisplay.innerText = result;\r\n}", "function onClearClick()\n {\n //Reset all the variables back to their initial state.\n runningTotal = 0;\n currentOperand = 0;\n currentOperator = \"\";\n hasPressedOperand = false;\n hasPressedOperator = false;\n \n //Update the display to show the changes.\n updateDisplay();\n }", "clear(e){\n this.marquee.style.width = 0\n }", "clear() {\n\t\t\tthis.mutate('');\n\t\t}", "function clear(){\n \n for(i=0;i<valueBtn.length;i++){\n valueBtn[i].textContent=null;\n }\n move.textContent=\"move:0\";\n time.textContent=\"time:0\";\n msg.textContent=null;\n \n}", "static clearAllText() {\n for (numberBase in NumberInputView.inputViews) {\n NumberInputView.inputViews[numberBase].setState((prevState, props) => {\n return {text: ''};\n });\n }\n }", "function handleClear() {\n inputField.current.focus()\n selectionContext.updateSelection({ terms: '' }, true)\n }", "function clearExistingText(id) {\r\n\tdocument.getElementById(id).innerHTML = \"\";\r\n}", "clear() {\n console.log('TabbyDRO::clear');\n var message_div = document.getElementById(\"messages\");\n message_div.innerHTML = \"\";\n }", "function resetText(){\n \t$(\"#id\").val(\"\");\n \t$(\"#tenDanhMuc\").val(\"\");\n }", "function clearMessages() {\n titleList.innerHTML = '';\n }", "function nextText() {\n document.getElementById(currOrder).remove();\n currOrder++;\n putText(curr.text, currOrder);\n currentRoom.removeEventListener(\"click\", nextText);\n }", "function clearBox(){\r\n\t\tthis.value = \"\";\r\n\t}", "function end(ev) {\nev.dataTransfer.clearData(\"text\");\n}", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "clearSelection() {\n this._clearSelection();\n }", "function reset() {\n\tvar eventDom = document.getElementById('event');\n\tvar timeDom = document.getElementById('time');\n\twhile (eventDom.firstChild) {\n\t\teventDom.removeChild(eventDom.firstChild);\n\t}\n\twhile (timeDom.firstChild) {\n\t\ttimeDom.removeChild(timeDom.firstChild);\n\t}\n}", "function addressBarUnFocused(event){\n textChanged(event.target);\n }" ]
[ "0.7547148", "0.73806345", "0.7340957", "0.732975", "0.719757", "0.7190587", "0.71485156", "0.6981213", "0.6930317", "0.6922503", "0.68709725", "0.6764964", "0.67129636", "0.6699456", "0.668519", "0.66842955", "0.6678535", "0.6674945", "0.6670356", "0.6625484", "0.66188854", "0.6602738", "0.6565227", "0.65512115", "0.6521431", "0.65049815", "0.6495987", "0.648747", "0.6481167", "0.6426339", "0.64235157", "0.6411461", "0.6398736", "0.63940173", "0.6393006", "0.63882697", "0.63882697", "0.63882697", "0.6373982", "0.6345427", "0.63263285", "0.6325607", "0.631412", "0.6313436", "0.63073355", "0.6305997", "0.63003814", "0.6293427", "0.628986", "0.6287425", "0.6285209", "0.62849116", "0.62789214", "0.62753516", "0.6268975", "0.62624705", "0.62611127", "0.62549365", "0.6254073", "0.6247565", "0.6244217", "0.6235676", "0.62324655", "0.62296563", "0.62262166", "0.62235254", "0.62212497", "0.6218528", "0.6212528", "0.6211762", "0.6204706", "0.6192624", "0.61860657", "0.61810184", "0.6180891", "0.6171527", "0.6169151", "0.6167784", "0.61673206", "0.6164493", "0.6141128", "0.61322635", "0.61297566", "0.6128313", "0.6124877", "0.61182976", "0.6111054", "0.61014885", "0.60964847", "0.6090027", "0.6089523", "0.6088287", "0.6083232", "0.60805434", "0.60716534", "0.6070372", "0.60683036", "0.6062432", "0.6050053", "0.6048132" ]
0.69302785
9
import ProfileTitle from "../components/ProfileTitle";
function Profile() { return ( <div> {/* <ProfileTitle/> */} <CardWrapper> <UsersProfile /> </CardWrapper> </div > ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InboxHeader(props) {\n return (\n <div className=\"ProjectHeader\">\n <h1> {props.title} </h1>\n </div>\n )\n}", "function Header(props) {\n return (\n <div className=\"header\">\n <h1>{props.title}</h1>\n </div>\n\n )\n}", "function UserPage() {\n\n return (\n <main className=\"component\">\n {/* <Header /> */}\n <UserTabs />\n\n </main>\n );\n\n}", "function Header() {\n return (\n <div>\n <h1 className=\"title\">Meet the Members of Mystery Inc.</h1>\n </div>\n );\n}", "function Header(){\n return(\n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n );\n}", "function RetailerProfileView(props) {\n return (<h1>Retailer Profile View</h1>);\n}", "function Title(props){\n return <h1>{props.text}</h1>;\n}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function CampaignName(props) {\n return (\n <h1 className=\"campaign-title\">\n {props.title}\n </h1>\n )\n}", "render() {\n return (\n <h1>{this.props.myTitle}</h1>\n \n );\n }", "function Title() {\n return (\n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n )\n}", "function App() {\n return (\n <Wrapper>\n <Title>Employee Directory</Title>\n\n </Wrapper>\n );\n}", "function Title(props){\n return <h4>{props.content}</h4>\n}", "componentDidMount() {\n document.title = `Contact | ${config.companyName}`;\n this.props.setPageTitle( 'Contact', 'Our companies contact information can be viewed here' );\n }", "function Header(props){\n\treturn(\n\t\t<div className=\"header\">\n\t\t\t<h1>{props.title}</h1>\n\t\t</div>\t\t\n\t)\t\n}", "function Header () {\n return (\n <div className='jumbotron jumbotron-fluid text-center bg-info text-white'>\n <h1 style={{ fontWeight: 'bold' }}>Employee Directory</h1>\n </div>\n )\n}", "function App() {\n return (\n <>\n <h1> Reactjs - Single page Web App 🚀 </h1>\n <h2> Github users </h2>\n\n <User></User>\n </>\n );\n}", "render () {\n return (\n <div>\n <h1> {this.props.title} </h1>\n </div>\n )\n }", "function Header(props) {\n \n return (\n <nav className=\"navbar\">\n <h1>Winner's Name: {props.userName}</h1>\n <h1>Dollars to bet: {props.userMoney}</h1>\n </nav>\n );\n}", "function Header () {\n\n return (\n \n <div className= 'headerContainer'>\n <h1 className = 'header-Title'>Dakota And Andrea's Star Wars Chat App</h1>\n </div>\n \n \n \n )\n\n}", "function App() {\n return (\n <div>\n <h1>Portfolio Tracker</h1>\n <SignUpPage />\n </div>\n );\n}", "function AdminHeader() {\n\n return (\n <>\n <header className=\"App-Admin-header\">\n <h1 className=\"App-Admin-title\">DNH Orders</h1>\n\n </header>\n\n \n </>\n );\n}", "componentDidMount() {\n // Set the title of the page\n document.title = \"Support | Sober Buddy\";\n }", "function PageProfileEdit() {\n return (\n <>\n \n <ProfileEditForm />\n </>\n\n )\n}", "function App(){\n return(\n <div>\n <ContactCard name = \"Tarik\" email = \"random@gmail\" number = \"123-321-1231\" url = \"linkedin.com/in/user\" />\n </div>\n )\n}", "function Header() {\n return (\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\"/>\n <h1 className=\"App-title\">ReactND - Coding Practice</h1>\n </header>\n );\n}", "componentDidMount() {\n // Set the title of the page\n document.title = \"Forum | Sober Buddy\";\n }", "function Header(){\n return(\n <header className = \"Header\" > \"To do\" List </header> \n )\n}", "function Profile(props) {\n return (\n <div>\n <h4 style={{marginLeft:\"40px\",marginTop:\"30px\"}}>Hello {props.user}</h4>\n <h4>\n <Link to=\"/reset\" style={{marginLeft:\"40px\"}}>Reset Password</Link>\n </h4>\n </div>\n )\n}", "function App() {\n return (\n\n <div >\n\n <Header></Header>\n <AuctionPlayers></AuctionPlayers>\n\n </div>\n );\n}", "function header(){\n return (\n <header>\n <div className=\"header-name\"><h1>Developer hub</h1></div>\n </header>\n );\n}", "function AboutPage() {\n return (\n <div>\n <div className=\"component-head\">\n <h1>Technologies Used</h1>\n </div>\n <div className=\"hop-logo\">\n <HopsLogo />\n </div>\n <div className=\"container\">\n <div>\n <ul>\n <li>React</li>\n <li>Redux-Saga</li>\n <li>Email.js</li>\n <li>Moment.js</li>\n <li>Node</li>\n <li>Express</li>\n <li>Material-UI</li>\n <li>HTML</li>\n <li>CSS</li>\n </ul>\n </div>\n </div>\n </div>\n );\n}", "function App() {\n \n return (\n <>\n {/* <handleName fullName ='Salma Ben Mejdouba'/> */}\n <div className = 'App'>\n <Profile fullName = 'Salma Ben Mejdouba' bio = 'An ambitious, curious, and hard-working girl who studied interior design because she liked everything related to creativity. Even if her family financial situation was good, she chose to be independent. She decided to have her master’s degree while freelancing at the same time. After graduating with a research master’s degree in Theories of creation, she started working at a startup to gain experience and was assigned as a project manager in 2 months. Working 8 hours a day while maintaining the freelance job wasn’t easy, but she didn’t give up. After 1 year of hard work, she chose to change her career path. She was interested in the web development field and decided to dive into that world.' profession ='Interior designer, JS Full Stack Developer, Freelance Designer'>\n <img src ={'avatar-2.png'} alt='profile'></img>\n </Profile>\n </div>\n \n \n </>\n );\n}", "function Profile() {\n return (\n\n\n <div className=\"Profile\">\n\n <Navme />\n\n\n\n\n <h2>Profile Page</h2>\n\n\n\n {/* <Image src=\"holder.js/171x180\" roundedCircle /> */}\n\n\n <Container>\n <Row>\n <Col>\n <h4>Total Points:</h4>\n </Col>\n <Col xs={5}>\n <h4>Correct Predictions:13</h4>\n </Col>\n <Col xs={5}>\n <h4>Incorrect Predictions:1</h4>\n </Col>\n </Row>\n <Row>\n <Col></Col>\n <Col xs={10}>\n <h3>Current Ranking Status: 1 out of 200</h3>\n </Col>\n </Row>\n\n <Row>\n <Col></Col>\n <Col xs={10}>\n <h3>To make a prediction, please go to Homepage</h3>\n </Col>\n </Row>\n </Container>\n\n\n\n </div>\n\n );\n}", "function App() {\n return (\n <div>\n <Profile firstname=\"david\" lastname={'mike'} age={25} />\n </div>\n );\n}", "function Header(){\n return (\n <div>\n <h1>My Relationship Assistant</h1>\n </div>\n );\n}", "function UserProfilePage(props) {\n // return props.user.name && props.user.email ? <UserProfile {...props} /> : <SignInPromptComponent page= \"profile\" /> ;\n return <UserProfile {...props} />;\n}", "renderTitle () {\n\n return (\n <div className=\"title\">\n <label>\n Camera Tween\n </label>\n </div>\n )\n }", "function Home(props) {\n return <h1>Home</h1>;\n}", "function MyComponentClass (props) {\n\tvar title = props.title;\n return <h1>{title}</h1>;\n}", "function Main() {\n\n\n return (\n <div>\n <CardGrillaArriendosHome />\n\n </div>\n )\n}", "function Uprofile(props){\n const { profile } = props;\n console.log(profile);\n return(\n <div className=\"profile_render\">\n <img className=\"img1\" src={profile.profileimg1}></img>\n <img className=\"img2\" src={profile.profileimg2}></img>\n <div className=\"profile-details\">\n <h1>{profile.firstname} {profile.lastname}</h1>\n <h1>Age: {profile.age}</h1>\n <h1>Height: {profile.height} inches</h1>\n <h1>Weight: {profile.weight} lbs</h1>\n <h1>BMI: {profile.bmi}%</h1>\n </div>\n </div>\n )\n}", "function Home() {\n \n \n return (\n \n <TeacherSignIn />\n );\n}", "render() {\n const { initialMessage } = this.props;\n const styles = require('./App.scss');\n\n return (\n <div className={styles.app}>\n <Helmet {...config.app.head} />\n <div>Contenido de la Aplicacion</div>\n <div>{initialMessage}</div>\n\n <div>\n {this.props.children}\n </div>\n </div>\n );\n }", "function Header() {\r\n return (\r\n <>\r\n <Headeritem />\r\n </>\r\n );\r\n}", "function Home() {\n return (\n <>\n {/* <SocialAuth/> */}\n <Editor/>\n </>\n );\n}", "function About(){\n\n return(\n <div className=\"container jumbotron\">\n <div className=\"card\">\n <h1>About Paage</h1>\n </div>\n </div>\n );\n}", "render() {\n return (\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <h1 className=\"App-title\">Welcome to React, Dave</h1>\n </header>\n );\n }", "function About() {\n return (\n <div className=\"container\">\n <h1>Your Bookings</h1>\n </div>\n );\n}", "render(){\n return(\n <div className='Profile'>\n {this.renderuser()}\n </div>\n );\n }", "function Header(props) {\n return (\n <header>\n <h1>{props.name}'s kitchen</h1>\n </header>\n );\n}", "render() {\n return (\n <div className=\"blog-profile\">\n <div className=\"blog-profile--name\">\n <div>\n {this.props.firstName.toUpperCase()}\n </div>\n <div>\n {this.props.lastName.toUpperCase()}\n </div>\n </div>\n <div className=\"blog-profile--punchline\">{this.props.punchLine}</div>\n </div>\n );\n }", "function Index() {\n return <Homepage />;\n}", "render() {\r\n\t return (\r\n\t \t<div className=\"row App-header\">\r\n\t \t\t<div className=\"col-1\">\r\n\t \t\t</div>\r\n\r\n\t \t\t<div className=\"col-6 App-title\">\r\n\t \t\t<h1>{this.props.headerTitle}</h1>\r\n\t \t</div>\r\n\r\n\t \t<div className=\"col-3\">\r\n\t \t\t<LoginComponent />\r\n\t \t</div>\r\n\r\n\t \t\t<div className=\"col-2\">\r\n\t \t\t<div className=\"Address-Block\">\r\n\t\t \t\t<address>\r\n\t\t\t\t\t\t <strong>Online Pizza, Inc.</strong><br/>\r\n\t\t\t\t\t\t 1355 Market St, Suite 900<br/>\r\n\t\t\t\t\t\t Vancouver, CA 94103<br/>\r\n\t\t\t\t\t\t <abbr title=\"Phone\">P:</abbr> (123) 456-7890\r\n\t\t\t\t\t\t</address>\r\n\t\t\t\t\t</div>\r\n\t \t\t</div>\r\n\t </div>\r\n\t );\r\n\t}", "function Header() {\n return (\n <header>\n <h1>Scoreboard</h1>\n <span className=\"stats\">Players: 1</span>\n </header>\n );\n}", "function Services() {\r\n document.title = \"TRVL | Services\";\r\n return (\r\n <>\r\n {\r\n <div className=\"services\">Hola soy el contenido de Services</div>\r\n //<HeroSection />\r\n //<Cards />\r\n }\r\n </>\r\n );\r\n}", "render(){\n return(\n <header className=\"header\">\n <img className=\"header__logo\" alt=\"Site Logo\" src={ImageSource}/>\n <h2 className=\"header__title\">Nick Lucero • Apps • Games • Coding</h2>\n </header>\n )\n }", "function AppComponent() {\n this.title = \"Restaurants\";\n }", "function App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\n \n}", "render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"title\">Your location here...</div>\r\n\t\t);\r\n\t}", "function ProfileName() {\n return (\n <React.Fragment>\n <img src={randoCalrissian} alt=\"Billy Dee Williams Impersonator - Jimmie Morgan\" width=\"50%\"/>\n <h3>Rando Calrissian</h3>\n </React.Fragment>\n );\n}", "render() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">MY APP</header>\n <ListCard/>\n <ListList/>\n </div>\n );\n }", "function ProfileAbout() {\n return (\n <React.Fragment>\n <p>\n Once a smooth-talking smuggler, Rando Calrissian changed from a get-rich-quick schemer to a selfless leader in the fight against the Empire. From adventures with the Ghost crew of rebels to the attack on Death Star II, his quick wit and daring proved to be invaluable.\n </p>\n </React.Fragment>\n );\n}", "render() {\r\n return <h1> I am a Heading Component</h1>\r\n }", "componentDidMount() {\n document.title = \"Users\";\n this.getUsers();\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 App() {\n return (\n <Container>\n <NavBarComponent />\n\n <h1>hello</h1>\n </Container>\n );\n}", "function Header() \n{ \n return <div><h3 className=\"h3-text\">iCrowdTask Web Application</h3> \n <h4 className=\"h4-text\">Home Page.</h4></div>\n}", "function App() {\n return (\n <PublicHome />\n );\n}", "render() {\n const { title } = this.props;\n return (\n <header className=\"posts-card__header\" data-testid=\"post-header\">\n <h2 className=\"posts-card__title\">{title}</h2>\n </header>\n )\n }", "render() {\n return (\n <div className=\"flex\">{this.profile()}</div>\n );\n }", "function Profileinfo(props) {\n if (!props.profile){\n return <Preloader/>\n }\n\n return (\n <div>\n <div className={classes.test}>\n\n {/* <img\n src=\"https://image.shutterstock.com/image-photo/bright-spring-view-cameo-island-260nw-1048185397.jpg\"\n alt=\"\"/>*/}\n </div>\n\n <div className={classes.descriptionBlock}>\n <div>\n <img src={props.profile.photos.large} alt=\"\"/>\n </div>\n\n <div>{props.profile.lookingForAJobDescription}</div>\n <ProfileStatus status={props.status}/>\n </div>\n </div>\n );\n}", "function Home() {\r\n return (\r\n <>\r\n <HeroSection/>\r\n <HomeSearch/>\r\n </>\r\n );\r\n}", "function App() {\n\n\n return (\n\n <Login>\n\n </Login>\n\n\n );\n}", "function MyComponentClass (props) {\n return <h1>{props.title}</h1>;\n}", "function NetflixandChill(props) {\n return (\n <>\n <h1>Netflix and Chill</h1>\n </>\n );\n}", "function Welcome(props) {\n return(\n <div className='container'>\n <div className='Fitness-User-Info'>\n <h1>Hello {props.username}!</h1>\n <p>Let´s workout to get someone gains!</p>\n </div>\n </div>\n )\n\n}", "function Home() {\n return (\n <div className=\"App\">\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <Link to=\"/play\">Play</Link>\n </li>\n </ul>\n <header className=\"App-header\">\n <div style={{ width: '80%' }}>\n <TopBarGame userDetails={['Reeve', 'Civilian']} showTimer showRole />\n <GameEnv />\n <BottomBar />\n </div>\n </header>\n </div>\n );\n}", "static header() {\n return (\n <Grid>\n <br/>\n <Row bsClass='title'>File Registration</Row>\n <hr/>\n <Row bsClass='paragraph'>\n <p>This page allows users that have an Ethereum account and are using it on the Metamask\n extension for browsers, to register files and allow other users to access them for a set\n fee. <br/> Whenever another user requests to buy access to the file you uploaded, an email will be sent\n to you and you will need to <a href=\"/MyFiles\" className=\"link\">accept the requests</a>,\n then the funds will be transferred to your account and the user will be able to download a copy of the document.\n <br/><br/>You only need to <b>unlock your Metamask extension</b> and choose the document.\n <br/>Note that we do not store any data regarding the documents you upload; Only the hashes are retrieved.\n The document will be stored in an encrypted format on the IPFS network, using AES 256-bit encryption\n </p>\n </Row>\n </Grid>\n );\n }", "render() {\n return <div>Log In Page</div>;\n }", "profile() {\n sessionStorage.setItem(\n \"access-token\",\n \"8661035776.d0fcd39.39f63ab2f88d4f9c92b0862729ee2784\"\n );\n ReactDOM.render(<Profile />, document.getElementById(\"root\"));\n }", "function App() {\n return (\n<div>\n\n<Homepage />\n\n</div>\n\n );\n}", "render() {\n return (\n <h1>This is a placeholder for another page</h1>\n )\n }", "function About() {\n return (\n <div>\n <Header />\n <main>\n <Container className='stats'>\n <h2 style={{ marginBottom: '5%', fontWeight: 'bold' }}>About</h2>\n <Row xs={1} sm={1} md={2} lg={2}>\n <Col>\n <img src=\"../../img/profile.png\" alt=\"\" className=\"myProfile\" />\n </Col>\n <Col>\n <div className=\"card-body profile-head\">\n <h5 className=\"card-title\">SYED ANIQUE HUSSAIN</h5>\n <div className='profile-text'>\n <p className=\"card-text profession\"><small className=\"text-muted\">Full Stack Web developer &amp; Software developer</small></p>\n <p className=\"card-text\">Hey,I'm Syed Anique Hussain.A software and web developer.I'm a student of Computer &amp; Science Engineering <br /><b><br />Some facts about me: </b>I'm enthiusiastic about computers,I get driven by new technologies<br /><a href=\"mailto:[email protected]\">Contact me</a> for work.</p>\n </div>\n\n\n </div>\n </Col>\n </Row>\n </Container>\n\n </main>\n </div>\n )\n}", "render() {\n return (\n <div>\n <h1 className=\"welcome\">\n { this.props.user.username }'s Projects\n </h1>\n <Projects />\n <NewProject />{/* the new project button */}\n </div>\n );\n }", "function SecondComponent() {\n return (\n <>\n <h1>Soy otro componente</h1>\n </>\n )\n}", "render() {\n return (\n <React.Fragment>\n <h1>Your Profile</h1>\n <h2>{this.props.user.firstName} {this.props.user.lastName}</h2>\n {/*<List\n itemLayout=\"horizontal\"\n dataSource={officesUnderExperienceManagerData}\n renderItem={item => (\n <List.Item>\n <List.Item.Meta\n avatar={<Avatar src=\"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png\" />}\n title={<a href=\"https://ant.design\">{item.title}</a>}\n description=\"Ant Design, a design language for background applications, is refined by Ant UED Team\"\n />\n </List.Item>*/}\n )}\n />\n\n </React.Fragment>\n \n );\n\n }", "function App() {\n return (\n <div className=\"App\">\n <Projects />\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n \n <Title/>\n {/*\n <PersonalInfo/>\n <VideoBanner/>\n \n <SplitText/>\n <LandingPage/>\n */}\n\n\n\n </div>\n );\n}", "render() {\n return (\n <div>\n <h1>{this.props.title}</h1>\n <p>{this.props.description}</p>\n </div>\n )\n }", "function Test() {\n return (\n <h1>Hi, I'm Test component</h1>\n );\n}", "render() {\n return (\n <div className=\"RegistrationHeader\">\n <i className={`${this.props.HeaderIcon} RegistrationPersonIcon`}></i>\n <span className=\"RegistrationHeaderText\">{this.props.HeaderText}</span>\n </div>\n );\n }", "render() {\n return (\n // create a div with text in h1 tags\n <div>\n <h1>This is the header component</h1>\n </div>\n );\n }", "function App() {\n const person = {\n firstName: 'Nayem',\n lastName: 'Khan',\n job: 'Programmer'\n }\n \n return (\n <div className=\"App\" >\n <header className=\"App-header\" >\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p> My Heading: </p>\n </header>\n </div>\n );\n }", "function About() {\n return (\n <div>\n <h2 className=\"switch-header\">About</h2>\n </div>\n );\n}", "function eCommerce() {\n return (\n <div>\n <Header title=\"E-commerce\" />\n \n </div>\n )\n}", "getUserNavigation() {\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 >User Account</ListSubheader>\r\n }>\r\n <Divider />\r\n {this.NavigationListItem({\r\n title: 'User Profile',\r\n route: '/profile',\r\n icon: <SettingsIcon />\r\n })}\r\n {this.NavigationListItem({\r\n title: 'Log Out',\r\n route: '/logout',\r\n icon: <SubdirectoryArrowRightIcon />\r\n })}\r\n </List>\r\n );\r\n }", "render() {\n return (\n <div className=\"websiteName\">\n\t Terminal Hunger\n </div>\n );\n }", "render() {\n \n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <h1 className=\"App-title\">Welcome to React</h1>\n </header>\n <div>TODO App</div>\n <ListItems/>\n </div>\n );\n }", "function Home() {\n return (\n <div>\n <Header />\n <Employee />\n </div>\n )\n}" ]
[ "0.6351072", "0.61878794", "0.61363184", "0.6131286", "0.6123139", "0.6091882", "0.6087841", "0.6086385", "0.6061564", "0.60608673", "0.6024049", "0.60169667", "0.60099024", "0.6003747", "0.59255886", "0.58919424", "0.5880093", "0.58571887", "0.585398", "0.5841795", "0.5839608", "0.5813678", "0.5801923", "0.57949245", "0.57850873", "0.575598", "0.57509136", "0.5749257", "0.57423717", "0.57166576", "0.57124406", "0.57108474", "0.57007736", "0.5687323", "0.5686299", "0.56727165", "0.56677324", "0.5658141", "0.5640881", "0.56327164", "0.5630387", "0.5628133", "0.56269914", "0.5620587", "0.56201804", "0.5604203", "0.56017923", "0.56001437", "0.5598899", "0.5595232", "0.55915135", "0.5585084", "0.5583203", "0.5582898", "0.55800235", "0.5579749", "0.5577437", "0.55763286", "0.5573192", "0.5569091", "0.55666196", "0.55643594", "0.55555654", "0.55536675", "0.55534637", "0.555151", "0.55504763", "0.55493706", "0.5543878", "0.55422443", "0.553645", "0.55357975", "0.5535761", "0.5521321", "0.55203605", "0.55174077", "0.5507519", "0.5502315", "0.55000925", "0.54989856", "0.5497848", "0.5497772", "0.5491402", "0.54821837", "0.5476188", "0.5475636", "0.547549", "0.54733056", "0.5470319", "0.54699564", "0.54695493", "0.5465894", "0.54614437", "0.54604596", "0.54579985", "0.5456011", "0.54553413", "0.54543406", "0.54532814", "0.54525924" ]
0.67856216
0
Base class for GradientPicker, HuePicker and AlphaPicker. Creates a gradient on a canvas surface and a picker surface.
function CanvasPicker(size, initialColor, opts) { View.apply(this); this.eventInput.pipe( this.eventOutput ); this.options = { pickerSize: [4, size[1] + 5], transition: { curve: Easing.inSineNorm, duration: 50 }, pickerPosX: 0, pickerPosY: 0, pickerZ: 2, railsY: false, pickerProperties: {}, colorPicker: false } this.setOptions(opts); this.size = size; this.color = initialColor.clone(); this.name = name; this.pos = []; this._dirty = true; this.canvasSize = [this.size[0]*2, this.size[1]*2]; this._selectedCoords = [ Utils.map(this.options.pickerPosX, 0, 1, 0, this.size[0]-1, true), Utils.map(this.options.pickerPosY, 0, 1, 0, this.size[1]-1, true), ] this.gradient = new CanvasSurface({ size: [this.size[0], this.size[0]], canvasSize: [this.size[0]*2, this.size[0]*2] }); var pickerPos = getPickerPos.call(this, this.size[0] * this.options.pickerPosX, this.size[1] * this.options.pickerPosY); this.pickerTransform = new Modifier({ transform: FM.translate(pickerPos[0], pickerPos[1], 0) }); if(this.options.colorPicker) { this.picker = new ColorButton(this.options.pickerSize, this.color) } else { this.picker = new Surface({ size: this.options.pickerSize }); } this.picker.setProperties(this.options.pickerProperties); this._mousemove = mousemove.bind(this); this._mouseup = mouseup.bind(this); this.gradient.on('mousedown', mousedown.bind(this)); this.picker.on('mousedown', mousedown.bind(this)); this.gradient.on('touchstart', touchstart.bind(this)); this.picker.on('touchstart', touchstart.bind(this)); this.gradient.on('touchmove', touchmove.bind(this)); this.picker.on('touchmove', touchmove.bind(this)); this.gradient.on('click', blockEvent); this.picker.on('click', blockEvent); this.on('updatePosition', this.updateColor.bind(this)); this.on('updatePosition', updatePicker.bind(this)); // Render Tree this._add(this.pickerTransform)._link(this.picker); this._add(this.gradient); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ColorPicker(\n painter,\n parameterName,\n wgl,\n canvas,\n shaderSources,\n left,\n bottom\n ) {\n this.wgl = wgl;\n this.canvas = canvas;\n this.input = document.querySelector(\"input\");\n\n this.input.addEventListener(\"change\", this.onInputChange.bind(this));\n\n //painter[parameterName] points to the HSVA array this picker edits\n this.painter = painter;\n this.parameterName = parameterName;\n\n this.left = left;\n this.bottom = bottom;\n\n //whether we're currently manipulating the hue or the saturation/lightness\n this.huePressed = false;\n this.saturationLightnessPressed = false;\n this.alphaPressed = false;\n\n this.pickerProgram = wgl.createProgram(\n shaderSources[\"shaders/picker.vert\"],\n shaderSources[\"shaders/picker.frag\"],\n { a_position: 0 }\n );\n\n this.pickerProgramRGB = wgl.createProgram(\n shaderSources[\"shaders/picker.vert\"],\n \"#define RGB \\n \" + shaderSources[\"shaders/picker.frag\"],\n { a_position: 0 }\n );\n\n this.quadVertexBuffer = wgl.createBuffer();\n wgl.bufferData(\n this.quadVertexBuffer,\n wgl.ARRAY_BUFFER,\n new Float32Array([-1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0]),\n wgl.STATIC_DRAW\n );\n }", "function PdfGradientBrush(shading){var _this=_super.call(this)||this;// Fields\n/**\n * Local variable to store the background color.\n * @private\n */_this.mbackground=new PdfColor(255,255,255);/**\n * Local variable to store the stroking color.\n * @private\n */_this.mbStroking=false;/**\n * Local variable to store the function.\n * @private\n */_this.mfunction=null;/**\n * Local variable to store the DictionaryProperties.\n * @private\n */_this.dictionaryProperties=new DictionaryProperties();_this.mpatternDictionary=new PdfDictionary();_this.mpatternDictionary.items.setValue(_this.dictionaryProperties.type,new PdfName(_this.dictionaryProperties.pattern));_this.mpatternDictionary.items.setValue(_this.dictionaryProperties.patternType,new PdfNumber(2));_this.shading=shading;_this.colorSpace=exports.PdfColorSpace.Rgb;return _this;}", "_create() {\n this.frame = document.createElement('div');\n this.frame.className = 'vis-color-picker';\n\n this.colorPickerDiv = document.createElement('div');\n this.colorPickerSelector = document.createElement('div');\n this.colorPickerSelector.className = 'vis-selector';\n this.colorPickerDiv.appendChild(this.colorPickerSelector);\n\n this.colorPickerCanvas = document.createElement('canvas');\n this.colorPickerDiv.appendChild(this.colorPickerCanvas);\n\n if (!this.colorPickerCanvas.getContext) {\n let noCanvas = document.createElement( 'DIV' );\n noCanvas.style.color = 'red';\n noCanvas.style.fontWeight = 'bold' ;\n noCanvas.style.padding = '10px';\n noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';\n this.colorPickerCanvas.appendChild(noCanvas);\n }\n else {\n let ctx = this.colorPickerCanvas.getContext(\"2d\");\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n this.colorPickerCanvas.getContext(\"2d\").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n this.colorPickerDiv.className = 'vis-color';\n\n this.opacityDiv = document.createElement('div');\n this.opacityDiv.className = 'vis-opacity';\n\n this.brightnessDiv = document.createElement('div');\n this.brightnessDiv.className = 'vis-brightness';\n\n this.arrowDiv = document.createElement('div');\n this.arrowDiv.className = 'vis-arrow';\n\n this.opacityRange = document.createElement('input');\n try {\n this.opacityRange.type = 'range'; // Not supported on IE9\n this.opacityRange.min = '0';\n this.opacityRange.max = '100';\n }\n // TODO: Add some error handling and remove this lint exception\n catch (err) {} // eslint-disable-line no-empty\n this.opacityRange.value = '100';\n this.opacityRange.className = 'vis-range';\n\n this.brightnessRange = document.createElement('input');\n try {\n this.brightnessRange.type = 'range'; // Not supported on IE9\n this.brightnessRange.min = '0';\n this.brightnessRange.max = '100';\n }\n // TODO: Add some error handling and remove this lint exception\n catch (err) {} // eslint-disable-line no-empty\n this.brightnessRange.value = '100';\n this.brightnessRange.className = 'vis-range';\n\n this.opacityDiv.appendChild(this.opacityRange);\n this.brightnessDiv.appendChild(this.brightnessRange);\n\n var me = this;\n this.opacityRange.onchange = function () {me._setOpacity(this.value);};\n this.opacityRange.oninput = function () {me._setOpacity(this.value);};\n this.brightnessRange.onchange = function () {me._setBrightness(this.value);};\n this.brightnessRange.oninput = function () {me._setBrightness(this.value);};\n\n this.brightnessLabel = document.createElement(\"div\");\n this.brightnessLabel.className = \"vis-label vis-brightness\";\n this.brightnessLabel.innerHTML = 'brightness:';\n\n this.opacityLabel = document.createElement(\"div\");\n this.opacityLabel.className = \"vis-label vis-opacity\";\n this.opacityLabel.innerHTML = 'opacity:';\n\n this.newColorDiv = document.createElement(\"div\");\n this.newColorDiv.className = \"vis-new-color\";\n this.newColorDiv.innerHTML = 'new';\n\n this.initialColorDiv = document.createElement(\"div\");\n this.initialColorDiv.className = \"vis-initial-color\";\n this.initialColorDiv.innerHTML = 'initial';\n\n this.cancelButton = document.createElement(\"div\");\n this.cancelButton.className = \"vis-button vis-cancel\";\n this.cancelButton.innerHTML = 'cancel';\n this.cancelButton.onclick = this._hide.bind(this, false);\n\n this.applyButton = document.createElement(\"div\");\n this.applyButton.className = \"vis-button vis-apply\";\n this.applyButton.innerHTML = 'apply';\n this.applyButton.onclick = this._apply.bind(this);\n\n this.saveButton = document.createElement(\"div\");\n this.saveButton.className = \"vis-button vis-save\";\n this.saveButton.innerHTML = 'save';\n this.saveButton.onclick = this._save.bind(this);\n\n this.loadButton = document.createElement(\"div\");\n this.loadButton.className = \"vis-button vis-load\";\n this.loadButton.innerHTML = 'load last';\n this.loadButton.onclick = this._loadLast.bind(this);\n\n this.frame.appendChild(this.colorPickerDiv);\n this.frame.appendChild(this.arrowDiv);\n this.frame.appendChild(this.brightnessLabel);\n this.frame.appendChild(this.brightnessDiv);\n this.frame.appendChild(this.opacityLabel);\n this.frame.appendChild(this.opacityDiv);\n this.frame.appendChild(this.newColorDiv);\n this.frame.appendChild(this.initialColorDiv);\n\n this.frame.appendChild(this.cancelButton);\n this.frame.appendChild(this.applyButton);\n this.frame.appendChild(this.saveButton);\n this.frame.appendChild(this.loadButton);\n }", "function CanvasGradient_() {\n this.colors_ = [];\n }", "function Gradient(){\n this.name = \"Gradient\"\n\n this.config = {\n color1: {\n type: 'color',\n value: {\n r: 255,\n g: 233,\n b: 61\n }\n },\n color2: {\n type: 'color',\n value: {\n r: 0,\n g: 16,\n b: 94\n }\n },\n speed: {\n name: 'Speed',\n type: 'range',\n value: 300,\n min: 100,\n max: 50000\n }\n }\n\n this.frame = 0;\n this.duration = -1;\n this.complete = false;\n this.rgb = false;\n this.color3 = null;\n}", "function set_gradient_slider(json_gradient) {\r\n const gp = new Grapick({\r\n el: '#gp',\r\n min: 1,\r\n max: 99,\r\n colorEl: '<div class=\"colorpicker grp-handler-cp-wrap cp\"></div>', // Custom color picker from colorpicker.min.js -- class is from original grapick.min.css\r\n width: 25\r\n });\r\n gp.setColorPicker(handler => {\r\n const el = handler.getEl().querySelector('.colorpicker.grp-handler-cp-wrap.cp');\r\n var picker = CP(el);\r\n // Add colorpicker change event to dynamically add color to the gradient\r\n picker.on('change', function (r, g, b, a) {\r\n if (1 === a) {\r\n var color = 'rgb(' + r + ', ' + g + ', ' + b + ')';\r\n /* Checks if given handler is selected or not\r\n If this if-statement is not written, When a new handler is added via programatically (using gp.addHandler()) colorpicker.js overwrites that color to black\r\n Or to the the color defined as data-color attribute on gp.colorEl */\r\n if (handler.isSelected()) {\r\n var handlerColor = handler.getColor().substring(5, handler.getColor().length - 1).replace(/\\s/g, '').split(\",\");\r\n handlerColor = CP.HEX([Number(handlerColor[0]), Number(handlerColor[1]), Number(handlerColor[2]), Number(handlerColor[3])]);\r\n this.source.style.backgroundColor = handler.getColor();\r\n this.source.setAttribute(\"data-color\", handlerColor);\r\n handler.setColor(color);\r\n }\r\n }\r\n else {\r\n var color = 'rgba(' + r + ', ' + g + ', ' + b + ',' + a + ')';\r\n if (handler.isSelected()) {\r\n var handlerColor = handler.getColor().substring(4, handler.getColor().length - 1).replace(/\\s/g, '').split(\",\");\r\n handlerColor = CP.HEX([Number(handlerColor[0]), Number(handlerColor[1]), Number(handlerColor[2])]);\r\n this.source.style.backgroundColor = handler.getColor();\r\n this.source.setAttribute(\"data-color\", handlerColor);\r\n handler.setColor(color);\r\n }\r\n }\r\n /* Select the handler anyway after the color is added otherwise when handler is added via click the right color will not render to the \r\n gradient slider.. To prevent that click event is added to the gradient slider... when a click is occured a new handler will be added and it will be \r\n deselected automatically (preventing [black color/or data-color value] from overwriting the neccessary color)... \r\n Since it is not possible to prevent that event from firing this(colorpicker change event) event... that handler (the one that a change has occured) will be automatically selected\r\n */\r\n handler.select();\r\n // handler.deselect();\r\n });\r\n });\r\n gp.on('handler:select', function () {\r\n var handler = gp.getSelected();\r\n\r\n var selectedPicker = document.getElementsByClassName('grp-handler grp-handler-selected')[0].getElementsByClassName('colorpicker grp-handler-cp-wrap cp')[0];\r\n if (handler.getColor()[3] == '(') {\r\n var selectedColorHEX = handler.getColor().substring(4, handler.getColor().length - 1).replace(/\\s/g, '').split(\",\");\r\n selectedColorHEX = CP.HEX([Number(selectedColorHEX[0]), Number(selectedColorHEX[1]), Number(selectedColorHEX[2])]);\r\n }\r\n else if (handler.getColor()[3] == 'a') {\r\n var selectedColorHEX = handler.getColor().substring(5, handler.getColor().length - 1).replace(/\\s/g, '').split(\",\");\r\n selectedColorHEX = CP.HEX([Number(selectedColorHEX[0]), Number(selectedColorHEX[1]), Number(selectedColorHEX[2]), Number(selectedColorHEX[3])]);\r\n }\r\n // Set selected handler's value to the handler selection circle (div tag) and to the colocpicker's value (data-color)\r\n selectedPicker.style.backgroundColor = handler.color;\r\n selectedPicker.setAttribute(\"data-color\", selectedColorHEX);\r\n })\r\n document.getElementsByClassName('grp-preview')[0].onclick = function () {\r\n // This event is to fire whenever a new handler is added to the slider via click event.. handler:add will not work because it'll fire when a new handler is added via programatically. \r\n // Get the index of the newly added handler\r\n var handler_index = gp.getHandlers().indexOf(gp.getSelected())\r\n // Deselect that handler\r\n gp.getHandler(handler_index).deselect();\r\n // Then this event will fire picker.on('change') event above.\r\n }\r\n // Handlers are color stops\r\n // in format : gp.addHandler(25, 'rgb(255, 0, 0)'); If the given offset is 0.25 then the handler format offset will be 25 (0.25*100)\r\n for (var i = 0; i < json_gradient.length; i++) {\r\n if (json_gradient[i].color[0] == \"#\") {\r\n json_gradient[i].color = hexToRgb(json_gradient[i].color);\r\n }\r\n gp.addHandler(json_gradient[i].offset * 100, json_gradient[i].color, 0);\r\n }\r\n\r\n // Updates the corresponding object according to the changes made to the slider... An event on the slider\r\n gp.on('change', complete => {\r\n var gradient = gp.getSafeValue();\r\n var json_gradient = parse_gradient(gradient);\r\n set_gradient(json_gradient);\r\n });\r\n}", "function PdfGradientBrush(shading) {\n var _this = _super.call(this) || this;\n // Fields\n /**\n * Local variable to store the background color.\n * @private\n */\n _this.mbackground = new PdfColor(255, 255, 255);\n /**\n * Local variable to store the stroking color.\n * @private\n */\n _this.mbStroking = false;\n /**\n * Local variable to store the function.\n * @private\n */\n _this.mfunction = null;\n /**\n * Local variable to store the DictionaryProperties.\n * @private\n */\n _this.dictionaryProperties = new DictionaryProperties();\n _this.mpatternDictionary = new PdfDictionary();\n _this.mpatternDictionary.items.setValue(_this.dictionaryProperties.type, new PdfName(_this.dictionaryProperties.pattern));\n _this.mpatternDictionary.items.setValue(_this.dictionaryProperties.patternType, new PdfNumber(2));\n _this.shading = shading;\n _this.colorSpace = PdfColorSpace.Rgb;\n return _this;\n }", "function gradient() {\n /** Gradient\n * Holds the gradient css statement.\n *\n * @type {string}\n */\n var gradient = \"\";\n /* Configure Gradient to Options */\n\n switch (options) {\n case 'radial':\n gradient = \"radial-gradient(\" + value + \")\";\n break;\n\n case 'conic':\n gradient = \"conic-gradient(\" + value + \")\";\n break;\n\n case 'repeating-linear':\n gradient = \"repeating-linear-gradient(\" + value + \")\";\n break;\n\n case 'repeating-radial':\n gradient = \"repeating-radial-gradient(\" + value + \")\";\n break;\n\n case 'linear':\n default:\n gradient = \"linear-gradient(\" + value + \")\";\n }\n /* Set Gradient Dom Style */\n\n\n canvas.style.backgroundImage = gradient;\n }", "function ColorPicker() {\n this._colorPos = {};\n this.el = o(require('./template'));\n this.main = this.el.find('.main').get(0);\n this.spectrum = this.el.find('.spectrum').get(0);\n this.hue(rgb(255, 0, 0));\n this.spectrumEvents();\n this.mainEvents();\n this.w = 180;\n this.h = 180;\n this.render();\n}", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function GradientColor(canvas,color1,color2,x1,y1,x2,y2) {\n\t /**#@+\n\t * @memberOf RadialColor\n\t */\nthis.canvas = canvas.canvasContext;\nthis.colorStop = new Array();\nthis.colorStop[0] = [0,color1,x1,y1];\nthis.colorStop[1] = [1,color2,x2,y2];\n\nthis.getColor = function() {\n gradient = this.canvas.createLinearGradient(\n this.colorStop[1][2],this.colorStop[1][3],\n this.colorStop[0][2],this.colorStop[0][3]\n );\n var i=0;\n for(i=0;i<this.colorStop.length;i++)\n {\n gradient.addColorStop(this.colorStop[i][0],this.colorStop[i][1]);\n }\n return gradient;\n};\n}", "addGradient (canvas, ctx) {\n\n let p = LinearGradient(ctx, 0, 0, 0, canvas.height * 2, [ 0, 'rgba(255,0,255,0.5)', 0.5, 'rgba(50,255,255,0.5)', 1, 'rgba(50,50,255,0.5)' ]);\n\n Rectangle(ctx, 0, 0, canvas.width, canvas.height);\n\n FillGradient(ctx, p);\n\n }", "function buildColorPicker() {\n // modify the DOM\n var container = $(\"#color-container\");\n if (!state.canvasDrawn) {\n var label = document.createElement(\"p\");\n var labelText = document.createTextNode(\"Color: \");\n label.className = \"colorLabel\";\n label.appendChild(labelText);\n var colorPicker = document.createElement(\"input\");\n colorPicker.id = \"color-picker\";\n container.append(label);\n container.append(colorPicker);\n }\n container.css(\"top\", canvas.height + 15 + \"px\");\n\n // create Spectrum color picker\n $(\"#color-picker\").spectrum({\n preferredFormat: \"hex\",\n showInput: true,\n showInitial: true,\n showPaletteOnly: true,\n hideAfterPaletteSelect: true,\n togglePaletteOnly: true,\n maxSelectionSize: 5,\n togglePaletteMoreText: \"More\",\n togglePaletteLessText: \"Less\",\n chooseText: \"Accept\",\n cancelText: \"Nevermind\",\n color: \"#1abc9c\",\n palette: [\n [\"#1abc9c\", \"#2ecc71\", \"#3498db\", \"#9b59b6\", \"#34495e\"],\n [\"#f1c40f\", \"#e67e22\", \"#e74c3c\", \"#dc4496\", \"#95a5a6\"],\n [\"000000\", \"ffffff\"]\n ],\n hide: function(e) {\n state.color = e.toHexString();\n }\n });\n state.color = $(\"#color-picker\")\n .spectrum(\"get\")\n .toHexString();\n }", "function Gradient() {\n this.defaultColor = null;\n this.points = [];\n}", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function CanvasGradient_(aType) {\n this.type_ = aType;\n this.x0_ = 0;\n this.y0_ = 0;\n this.r0_ = 0;\n this.x1_ = 0;\n this.y1_ = 0;\n this.r1_ = 0;\n this.colors_ = [];\n }", "function initiateDrawColorPicker() {\r\n var colorPickerInputArray = document.querySelectorAll(\r\n \"input.color-input\"\r\n );\r\n var red = document.getElementById(\"redDrawColorSelector\").value;\r\n var green = document.getElementById(\"greenDrawColorSelector\").value;\r\n var blue = document.getElementById(\"blueDrawColorSelector\").value;\r\n colorPickerDisplay = document.getElementById(\"colorDrawDisplay\");\r\n if (colorPickerDisplay && red && green && blue) {\r\n colorPickerDisplay.style.background = `rgba(${red}, ${green}, ${blue}, 1)`;\r\n }\r\n if (colorPickerInputArray && colorPickerInputArray.length > 0) {\r\n for (var i = 0; i < colorPickerInputArray.length; i++) {\r\n colorPickerInputArray[i].addEventListener(\"input\", function () {\r\n red = document.getElementById(\"redDrawColorSelector\").value;\r\n green = document.getElementById(\"greenDrawColorSelector\").value;\r\n blue = document.getElementById(\"blueDrawColorSelector\").value;\r\n colorPickerDisplay = document.getElementById(\"colorDrawDisplay\");\r\n if (colorPickerDisplay && red && green && blue) {\r\n colorPickerDisplay.style.background = `rgba(${red}, ${green}, ${blue}, 1)`;\r\n currentDrawRGBValues = {\r\n red: red,\r\n green: green,\r\n blue: blue,\r\n alpha: \"1\"\r\n };\r\n }\r\n });\r\n }\r\n }\r\n currentDrawRGBValues = {\r\n red: red,\r\n green: green,\r\n blue: blue\r\n };\r\n }", "function updateMiniPickerSpectrum() {\n let ctx = miniPickerCanvas.getContext('2d');\n let hsv = rgbToHsv(hexToRgb(colourValue.value));\n let tmp;\n let white = {h:hsv.h * 360, s:0, v: parseInt(miniPickerSlider.value)};\n\n white = hsvToRgb(white.h, white.s, white.v);\n\n ctx.clearRect(0, 0, miniPickerCanvas.width, miniPickerCanvas.height);\n\n // Drawing hues\n var hGrad = ctx.createLinearGradient(0, 0, miniPickerCanvas.width, 0);\n\n for (let i=0; i<7; i++) {\n tmp = hsvToRgb(60 * i, 100, hsv.v * 100);\n hGrad.addColorStop(i / 6, '#' + rgbToHex(Math.round(tmp[0]), Math.round(tmp[1]), Math.round(tmp[2])));\n }\n ctx.fillStyle = hGrad;\n ctx.fillRect(0, 0, miniPickerCanvas.width, miniPickerCanvas.height);\n\n // Drawing sat / lum\n var vGrad = ctx.createLinearGradient(0, 0, 0, miniPickerCanvas.height);\n vGrad.addColorStop(0, 'rgba(' + white[0] +',' + white[1] + ',' + white[2] + ',0)');\n /*\n vGrad.addColorStop(0.1, 'rgba(255,255,255,0)');\n vGrad.addColorStop(0.9, 'rgba(255,255,255,1)');\n */\n vGrad.addColorStop(1, 'rgba(' + white[0] +',' + white[1] + ',' + white[2] + ',1)');\n \n ctx.fillStyle = vGrad;\n ctx.fillRect(0, 0, miniPickerCanvas.width, miniPickerCanvas.height);\n}", "function setGradient(canvas, canvasOuter, circle, color1, color2) {\r\n if (circle == \"inner\") {\r\n var circleInner = canvas.getContext('2d');\r\n } else {\r\n var circleOuter = canvasOuter.getContext('2d');\r\n }\r\n\r\n var x = 150,\r\n y = 75,\r\n // Radii of the black glow.\r\n innerRadius = 0,\r\n outerRadius = 200,\r\n // Radius of the entire circle.\r\n radius = 200;\r\n\r\n if (circle == \"inner\") {\r\n var gradient = circleInner.createRadialGradient(x, y, innerRadius, x, y, outerRadius);\r\n } else {\r\n var gradient = circleOuter.createRadialGradient(x, y, innerRadius, x, y, outerRadius);\r\n }\r\n\r\n gradient.addColorStop(0, color1);\r\n gradient.addColorStop(1, color2);\r\n\r\n if (circle == \"inner\") {\r\n circleInner.arc(x, y, radius, 0, 2 * Math.PI);\r\n\r\n circleInner.fillStyle = gradient;\r\n circleInner.fill();\r\n\r\n return circleInner;\r\n } else {\r\n circleOuter.arc(x, y, radius, 0, 2 * Math.PI);\r\n\r\n circleOuter.fillStyle = gradient;\r\n circleOuter.fill();\r\n\r\n return circleOuter;\r\n }\r\n\r\n}", "function ColorPickerInstance()\r\n{\r\n this._id = $.colorPicker._register(this);\r\n this._input = null;\r\n this._colorPickerDiv = $.colorPicker._colorPickerDiv;\r\n this._sampleSpan = null;\r\n}", "constructor(canvasId, previewElemId=null, modalElemId=null, \n onColorPicked=null, onPatternSelected=null, onConfigAdjusted=null, startHSV=[0.,0.,0.]) {\n this.canvas = document.getElementById(canvasId);\n this.modal = document.getElementById(modalElemId);\n this.hue = startHSV[0] || 0.; // 0 - 1\n this.saturation = 1.0; // 0 - 1\n this.brightness = startHSV[2] || 0.; // 0 - 1\n this.createColorOverlay();\n this.previewElem = document.getElementById(previewElemId) || null;\n this.curStrip = -1;\n\n this.hueCircleDrawn = false;\n\n this.patternDict = null;\n this.lastPattern = null;\n\n this.onColorPicked = onColorPicked;\n this.onPatternSelected = onPatternSelected;\n this.onConfigAdjusted = onConfigAdjusted;\n\n this.updatePreview(startHSV);\n\n var me = this; // me = current object\n window.onresize = function(e) {\n me.resizeModal();\n }\n\n this.resizeModal();\n\n this.modal.classList.add(\"modal-open\");\n }", "function PdfLinearGradientBrush(arg1,arg2,arg3,arg4){var _this=_super.call(this,new PdfDictionary())||this;/**\n * Local variable to store the dictionary properties.\n * @private\n */_this.mDictionaryProperties=new DictionaryProperties();if(arg1 instanceof PointF&&arg2 instanceof PointF&&arg3 instanceof PdfColor&&arg4 instanceof PdfColor){_this.initialize(arg3,arg4);_this.mPointStart=arg1;_this.mPointEnd=arg2;_this.setPoints(_this.mPointStart,_this.mPointEnd);}else if(arg1 instanceof Rectangle){_this.initialize(arg2,arg3);/* tslint:disable-next-line:max-line-length */if(arg4===PdfLinearGradientMode.BackwardDiagonal||arg4===PdfLinearGradientMode.ForwardDiagonal||arg4===PdfLinearGradientMode.Horizontal||arg4===PdfLinearGradientMode.Vertical){_this.mBoundaries=arg1;switch(arg4){case PdfLinearGradientMode.BackwardDiagonal:_this.mPointStart=new PointF(arg1.right,arg1.top);_this.mPointEnd=new PointF(arg1.left,arg1.bottom);break;case PdfLinearGradientMode.ForwardDiagonal:_this.mPointStart=new PointF(arg1.left,arg1.top);_this.mPointEnd=new PointF(arg1.right,arg1.bottom);break;case PdfLinearGradientMode.Horizontal:_this.mPointStart=new PointF(arg1.left,arg1.top);_this.mPointEnd=new PointF(arg1.right,arg1.top);break;case PdfLinearGradientMode.Vertical:_this.mPointStart=new PointF(arg1.left,arg1.top);_this.mPointEnd=new PointF(arg1.left,arg1.bottom);break;default:throw new Error('ArgumentException -- Unsupported linear gradient mode: '+arg4+' mode');}_this.setPoints(_this.mPointStart,_this.mPointEnd);}else if(typeof arg4==='number'&&typeof arg4!=='undefined'){_this.mBoundaries=arg1;arg4=arg4%360;if(arg4===0){_this.mPointStart=new PointF(arg1.left,arg1.top);_this.mPointEnd=new PointF(arg1.right,arg1.top);}else if(arg4===90){_this.mPointStart=new PointF(arg1.left,arg1.top);_this.mPointEnd=new PointF(arg1.left,arg1.bottom);}else if(arg4===180){_this.mPointEnd=new PointF(arg1.left,arg1.top);_this.mPointStart=new PointF(arg1.right,arg1.top);}else if(arg4===270){_this.mPointEnd=new PointF(arg1.left,arg1.top);_this.mPointStart=new PointF(arg1.left,arg1.bottom);}else{var d2r=Math.PI/180;var radAngle=arg4*d2r;var k=Math.tan(radAngle);var x=_this.mBoundaries.left+(_this.mBoundaries.right-_this.mBoundaries.left)/2;var y=_this.mBoundaries.top+(_this.mBoundaries.bottom-_this.mBoundaries.top)/2;var centre=new PointF(x,y);x=_this.mBoundaries.width/(2*Math.cos(radAngle));y=k*x;x=x+centre.x;y=y+centre.y;var p1=new PointF(x,y);var cp1=_this.subPoints(p1,centre);// P1 - P0\nvar p=_this.choosePoint(arg4);var coef=_this.mulPoints(_this.subPoints(p,centre),cp1)/_this.mulPoints(cp1,cp1);_this.mPointEnd=_this.addPoints(centre,_this.mulPoint(cp1,coef));// Parametric line equation.\n_this.mPointStart=_this.addPoints(centre,_this.mulPoint(cp1,coef*-1));}_this.setPoints(_this.mPointEnd,_this.mPointStart);}}return _this;}", "function changeBackground() {\n color1 = document.getElementById(\"picker-1\").value\n color2 = document.getElementById(\"picker-2\").value\n splitValue = document.getElementById(\"split1\").value\n degree = document.getElementById(\"degree\").value\n grad = `linear-gradient(${degree}deg`\n for (i=1; i <= totalColors -1; i++){\n splitArray[i] = document.getElementById(`split${i}`).value\n }\n for(i=1; i <= totalColors; i++){\n colorArray[i] = document.getElementById(`picker-${i}`).value\n if (i == totalColors) {\n grad += `, ${colorArray[i]}`\n } else {\n grad += `, ${colorArray[i]}, ${splitArray[i]}%`\n }\n \n }\n grad += ')'\n document.getElementById(\"gradient\").style.background = grad\n}", "render() {\n return (\n <div>\n <div>\n <canvas ref=\"canvas\" width={1680} height={1050} />\n <div className=\"picker-position\">\n <ChromePicker color={this.state.spaceColor} onChangeComplete={this.handleColorChange} />\n </div>\n <BackButton />\n </div>\n </div>\n );\n }", "function ColorPicker() {\n this.selector = '.t3js-color-picker';\n }", "function Gradientify (element, options) {\n this.element = element;\n this.settings = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.updateSettings = function (settings) {\n this.settings = $.extend({}, defaults, options, settings);\n\n this.init();\n };\n\n this.init();\n }", "function init_ColorPicker() {\n\n\t\t\tif( typeof ($.fn.colorpicker) === 'undefined'){ return; }\n\t\t\tconsole.log('init_ColorPicker');\n\n\t\t\t\t$('.demo1').colorpicker();\n\t\t\t\t$('.demo2').colorpicker();\n\n\t\t\t\t$('#demo_forceformat').colorpicker({\n\t\t\t\t\tformat: 'rgba',\n\t\t\t\t\thorizontal: true\n\t\t\t\t});\n\n\t\t\t\t$('#demo_forceformat3').colorpicker({\n\t\t\t\t\tformat: 'rgba',\n\t\t\t\t});\n\n\t\t\t\t$('.demo-auto').colorpicker();\n\n\t\t}", "function CreateGradient(w, h, ur, ul, lr, ll)\n{\n var surf = CreateSurface(w, h, Colors.white);\n surf.gradientRectangle(0, 0, w, h, ur, ul, lr, ll);\n return surf.createImage();\n}", "function updateFromControl(input, target) {\nfunction getCoords(picker, container) {\nvar left, top;\nif( !picker.length || !container ) return null;\nleft = picker.offset().left;\ntop = picker.offset().top;\nreturn {\nx: left - container.offset().left + (picker.outerWidth() / 2),\ny: top - container.offset().top + (picker.outerHeight() / 2)\n};\n}\nvar hue, saturation, brightness, x, y, r, phi,\nhex = input.val(),\nopacity = input.attr('data-opacity'),\n// Helpful references\nminicolors = input.parent(),\nsettings = input.data('minicolors-settings'),\nswatch = minicolors.find('.minicolors-swatch'),\n// Panel objects\ngrid = minicolors.find('.minicolors-grid'),\nslider = minicolors.find('.minicolors-slider'),\nopacitySlider = minicolors.find('.minicolors-opacity-slider'),\n// Picker objects\ngridPicker = grid.find('[class$=-picker]'),\nsliderPicker = slider.find('[class$=-picker]'),\nopacityPicker = opacitySlider.find('[class$=-picker]'),\n// Picker positions\ngridPos = getCoords(gridPicker, grid),\nsliderPos = getCoords(sliderPicker, slider),\nopacityPos = getCoords(opacityPicker, opacitySlider);\n// Handle colors\nif( target.is('.minicolors-grid, .minicolors-slider') ) {\n// Determine HSB values\nswitch(settings.control) {\ncase 'wheel':\n// Calculate hue, saturation, and brightness\nx = (grid.width() / 2) - gridPos.x;\ny = (grid.height() / 2) - gridPos.y;\nr = Math.sqrt(x * x + y * y);\nphi = Math.atan2(y, x);\nif( phi < 0 ) phi += Math.PI * 2;\nif( r > 75 ) {\nr = 75;\ngridPos.x = 69 - (75 * Math.cos(phi));\ngridPos.y = 69 - (75 * Math.sin(phi));\n}\nsaturation = keepWithin(r / 0.75, 0, 100);\nhue = keepWithin(phi * 180 / Math.PI, 0, 360);\nbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\nhex = hsb2hex({\nh: hue,\ns: saturation,\nb: brightness\n});\n// Update UI\nslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\nbreak;\ncase 'saturation':\n// Calculate hue, saturation, and brightness\nhue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\nsaturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\nbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\nhex = hsb2hex({\nh: hue,\ns: saturation,\nb: brightness\n});\n// Update UI\nslider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\nminicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\nbreak;\ncase 'brightness':\n// Calculate hue, saturation, and brightness\nhue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\nsaturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\nbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\nhex = hsb2hex({\nh: hue,\ns: saturation,\nb: brightness\n});\n// Update UI\nslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\nminicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\nbreak;\ndefault:\n// Calculate hue, saturation, and brightness\nhue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);\nsaturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\nbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\nhex = hsb2hex({\nh: hue,\ns: saturation,\nb: brightness\n});\n// Update UI\ngrid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\nbreak;\n}\n// Adjust case\ninput.val( convertCase(hex, settings.letterCase) );\n}\n// Handle opacity\nif( target.is('.minicolors-opacity-slider') ) {\nif( settings.opacity ) {\nopacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\n} else {\nopacity = 1;\n}\nif( settings.opacity ) input.attr('data-opacity', opacity);\n}\n// Set swatch color\nswatch.find('SPAN').css({\nbackgroundColor: hex,\nopacity: opacity\n});\n// Handle change event\ndoChange(input, hex, opacity);\n}", "function updateGradient(inspiration) {\n const degreeValue = inspiration.degrees;\n picker1.value = inspiration.firstColor;\n picker2.value = inspiration.secondColor;\n split.value = inspiration.split;\n styleGradientForm(degreeValue);\n updateSplit();\n setContrastingColor();\n}", "function vxlPicker(){\n this._objects = {};\n this._colors = {};\n}", "function getGradient() {\n var id = Ext.id();\n gradient = {\n id: id,\n angle: 90,\n stops: {\n 0: {\n color: 'rgb(33, 33, 33)'\n },\n 100: {\n color: 'rgb(156, 178, 248)'\n }\n }\n };\n return gradient;\n }", "function BG_Gradient(color1, color2){\n\tlet bg = ctx.createLinearGradient(0, 0, canvasWidth, canvasHeight)\n\tbg.addColorStop(0, color1)\n\tbg.addColorStop(1, color2)\n\treturn bg\n}", "_setupColorPicker() {\n\t\tlet options = _.defaults( this.options.colorPicker || {}, {\n\t\t\tdefaultColor: this.shadowColor,\n\t\t\thide: false,\n\t\t\tchange: () => {}\n\t\t} );\n\n\t\tthis.colorPicker.init( false, options );\n\n\t\t// Add change event after initialize to prevent, programtic change events frm changing colors.\n\t\tthis.colorPicker.$input.iris( 'option', 'change', ( e, ui ) => {\n\t\t\tthis.shadowColor = ui.color.toString();\n\t\t\tthis._updateCss();\n\t\t\tthis._triggerChangeEvent();\n\t\t} );\n\t}", "function updateBackground(colorPicker) {\n\tlet canvas = document.getElementById('imagepreview');\n\tlet color = colorPicker.target.value;\n\tcanvas.style.backgroundColor = color;\n}", "function Gradient(ctxGradient) {\n\t\tthis.ctxGradient = ctxGradient;\n\t}", "function ColorPicker(container, colorChangedCallback) {\n this.colorChanged = colorChangedCallback;\n this.domColor = this.createColorElement();\n container.append(this.domColor);\n }", "function registerColorpicker(elem1, elem2, clr){\n \n\telem1.ColorPicker({\n\t\tflat:true, \n\t\tcolor: clr,\n\t\tonChange: function(hsb, hex, rgb){\n\t\t\telem2.css('background', '#' + hex);\n\t\t},\n\t\tonSubmit: function(hsb, hex, rgb){\n\t\t\n colorchanged = true;\n \n\t\t\tif($('#visSelect').val() == \"gazeplot\")\n\t\t\t\tdrawGazeplot();\n\t\t\telse if($('#visSelect').val() == \"heatmap\")\n\t\t\t\tdrawHeatmap();\n\t\t\telse if($('#visSelect').val() == \"attentionmap\")\n\t\t\t\tdrawAttentionmap();\n\t\t\t\t\n\t\t\tshowColorpicker(elem1);\t\n\t\t}\n\t});\n\telem1.removeAttr(\"style\");\n\telem1.css({'z-index':'99', position:'absolute'});\n\telem1.hide();\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root and then prepare it.\n P.$root = $( '<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />' )\n prepareElementRoot()\n\n\n // Create the picker holder and then prepare it.\n P.$holder = $( createWrappedComponent() ).appendTo( P.$root )\n prepareElementHolder()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) {\n P.$holder = $( createWrappedComponent() )\n prepareElementHolder()\n P.$root.html( P.$holder )\n }\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n focusPickerOnceOpened()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$holder[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n if ( SETTINGS.editable ) {\n ELEMENT.focus()\n }\n else {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$holder.off( 'focus.toOpen' ).focus()\n setTimeout( function() {\n P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder,\n\n 'tabindex=\"-1\"'\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, open the picker.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) {\n event.preventDefault()\n P.open()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the holder picker element with all bindings.\n */\n function prepareElementHolder() {\n\n P.$holder.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n 'focus.toOpen': handleFocusToOpenEvent,\n\n blur: function() {\n // Remove the “target” class.\n $ELEMENT.removeClass( CLASSES.target )\n },\n\n // When something within the holder is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$holder[0] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the holder so that users can click away\n // from elements focused within the picker.\n P.$holder[0].focus()\n }\n }\n }\n\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$holder[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear()\n if ( SETTINGS.closeOnClear ) {\n P.close( true )\n }\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$holder\n\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n }\n\n\n // Wait for transitions to end before focusing the holder. Otherwise, while\n // using the `container` option, the view jumps to the container.\n function focusPickerOnceOpened() {\n\n if (IS_DEFAULT_THEME && supportsTransitions) {\n P.$holder.find('.' + CLASSES.frame).one('transitionend', function() {\n P.$holder[0].focus()\n })\n }\n else {\n P.$holder[0].focus()\n }\n }\n\n\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // Add the “target” class.\n $ELEMENT.addClass( CLASSES.target )\n\n // Add the “focused” class to the root.\n P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close( true )\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root and then prepare it.\n P.$root = $( '<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />' )\n prepareElementRoot()\n\n\n // Create the picker holder and then prepare it.\n P.$holder = $( createWrappedComponent() ).appendTo( P.$root )\n prepareElementHolder()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) {\n P.$holder = $( createWrappedComponent() )\n prepareElementHolder()\n P.$root.html( P.$holder )\n }\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n focusPickerOnceOpened()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$holder[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n if ( SETTINGS.editable ) {\n ELEMENT.focus()\n }\n else {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$holder.off( 'focus.toOpen' ).focus()\n setTimeout( function() {\n P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder,\n\n 'tabindex=\"-1\"'\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, open the picker.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) {\n event.preventDefault()\n P.open()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the holder picker element with all bindings.\n */\n function prepareElementHolder() {\n\n P.$holder.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n 'focus.toOpen': handleFocusToOpenEvent,\n\n blur: function() {\n // Remove the “target” class.\n $ELEMENT.removeClass( CLASSES.target )\n },\n\n // When something within the holder is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$holder[0] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the holder so that users can click away\n // from elements focused within the picker.\n P.$holder[0].focus()\n }\n }\n }\n\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$holder[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear()\n if ( SETTINGS.closeOnClear ) {\n P.close( true )\n }\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$holder\n\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n }\n\n\n // Wait for transitions to end before focusing the holder. Otherwise, while\n // using the `container` option, the view jumps to the container.\n function focusPickerOnceOpened() {\n\n if (IS_DEFAULT_THEME && supportsTransitions) {\n P.$holder.find('.' + CLASSES.frame).one('transitionend', function() {\n P.$holder[0].focus()\n })\n }\n else {\n P.$holder[0].focus()\n }\n }\n\n\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // Add the “target” class.\n $ELEMENT.addClass( CLASSES.target )\n\n // Add the “focused” class to the root.\n P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close( true )\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function colorPicker(field_name_prefix)\n{\t\t\n\t$('#'+field_name_prefix+'picker').jPicker(\t\n\t\t{\n\t\t window:\n\t\t {\n\t\t\texpandable: true,\n\t\t\tupdateInputColor: true,\n\t\t\tbindToInput: true,\n\t\t\tinput: $('#'+field_name_prefix+'r,'+'#'+field_name_prefix+'g,'+'#'+field_name_prefix+'b'),\n\t\t\tposition:\n\t\t\t{\n\t\t\t x: 'screenCenter', // acceptable values \"left\", \"center\", \"right\", \"screenCenter\", or relative px value\n\t\t\t y: '500px', // acceptable values \"top\", \"bottom\", \"center\", or relative px value\n\t\t\t},\n\t\t\talphaSupport: true\n\t\t },\t\t \n\t\t color:\n\t\t {\t\t\t\n\t\t\tactive: new $.jPicker.Color({ r: $('#'+field_name_prefix+'r').val(), g: $('#'+field_name_prefix+'g').val(), b: $('#'+field_name_prefix+'b').val() })\n\t\t },\n\t\t images:\n\t\t {\n\t\t\tclientPath: 'application/modules/Administrator/layouts/scripts/js/jpicker/images/',\n\t\t }\n\t },\n\t function(color, context)\n\t\t{\n\t\t\tvar all = color.val('all');\n\t\t\t// alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none') + ' r : '+ all.r + ' g : '+ all.g + ' b : '+ all.b);\n\t\t\t $('#'+field_name_prefix+'r').val(all.r);\t\t\t \n\t\t\t $('#'+field_name_prefix+'g').val(all.g);\n\t\t\t $('#'+field_name_prefix+'b').val(all.b);\n\t\t\t $('#'+field_name_prefix+'r,'+'#'+field_name_prefix+'g,'+'#'+field_name_prefix+'b').css(\n\t\t\t\t{\n\t\t\t\t backgroundColor: all && '#' + all.hex || 'transparent'\n\t\t\t\t});\n\t\t},\n function(color, context)\n {\n\t\t\t\n },\n function(color, context)\n {\n var all = this.color.active.val('all');\n\t\t\t//alert('Active Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none') + ' r : '+ all.r + ' g : '+ all.g + ' b : '+ all.b);\n\t\t\t $('#'+field_name_prefix+'r').val(all.r);\t\t\t \n\t\t\t $('#'+field_name_prefix+'g').val(all.g);\n\t\t\t $('#'+field_name_prefix+'b').val(all.b);\n\t\t\t $('#'+field_name_prefix+'r,'+'#'+field_name_prefix+'g,'+'#'+field_name_prefix+'b').css(\n\t\t\t\t{\n\t\t\t\t backgroundColor: all && '#' + all.hex || 'transparent'\n\t\t\t\t});\n }\t \n\t );\t\t \n}", "drawGradientBackground() {\n const grd = this.ctx.createLinearGradient(0, 0, this.width, this.height);\n grd.addColorStop(0, '#333333');\n grd.addColorStop(1, '#000000');\n this.ctx.fillStyle = grd;\n this.ctx.fillRect(0, 0, this.width, this.height);\n }", "function TransparentColorControl(parent, initialValue, toolTip)\n{\n this.__base__ = Control;\n if (parent)\n this.__base__(parent);\n else\n this.__base__();\n\n this.color = initialValue;\n this.onColorChanged = null;\n\n this.color_ComboBox = new ColorComboBox(parent);\n this.color_ComboBox.setCurrentColor(this.color);\n this.color_ComboBox.toolTip = toolTip;\n this.color_ComboBox.onColorSelected = function (rgba)\n {\n this.parent.color = Color.setAlpha(rgba, Color.alpha(this.parent.color));\n if (this.parent.onColorChanged)\n this.parent.onColorChanged(this.parent.color);\n };\n\n this.transparency_SpinBox = new SpinBox(parent);\n this.transparency_SpinBox.minValue = 0;\n this.transparency_SpinBox.maxValue = 255;\n this.transparency_SpinBox.setFixedWidth(parent.font.width(\"8888888\"))\n this.transparency_SpinBox.value = Color.alpha(this.color);\n this.transparency_SpinBox.toolTip = toolTip + \": Alpha value (0=transparent, 255=opaque)\";\n this.transparency_SpinBox.onValueUpdated = function (value)\n {\n this.parent.color = Color.setAlpha(this.parent.color, value);\n if (this.parent.onColorChanged)\n this.parent.onColorChanged(this.parent.color);\n };\n\n this.color_Button = new ToolButton(parent);\n this.color_Button.icon = this.scaledResource(\":/icons/select-color.png\");\n this.color_Button.setScaledFixedSize(20, 20);\n this.color_Button.toolTip = toolTip + \": Define a custom color.\";\n this.color_Button.onClick = function ()\n {\n //console.writeln( format(\"%x\",this.parent.color), this.parent.color_ComboBox);\n var scd = new SimpleColorDialog(this.parent.color);\n scd.windowTitle = toolTip + \": Custom RGBA Color\";\n if (scd.execute())\n {\n this.parent.color = scd.color;\n this.parent.color_ComboBox.setCurrentColor(scd.color);\n this.parent.transparency_SpinBox.value = Color.alpha(scd.color);\n if (this.parent.onColorChanged)\n this.parent.onColorChanged(this.parent.color);\n }\n };\n\n this.sizer = new HorizontalSizer;\n this.sizer.scaledSpacing = 4;\n this.sizer.add(this.color_ComboBox);\n this.sizer.add(this.transparency_SpinBox);\n this.sizer.add(this.color_Button);\n}", "function Gradient( options ){\n\tthis.pos = (options.pos) ? new Haze.meta.M.Vec(options.pos.x, options.pos.y) : Haze.meta.M.Vec(0, 0);\n\tthis.size = (options.size) ? new Haze.meta.M.Vec(options.size.x, options.size.y) : Haze.meta.M.Vec(1,1);\n\t\n\tif(options.r1) this.r1 = options.r1;\n\tif(options.r2) this.r2 = options.r2;\n\t\n\tthis.colorStops = [];\n\t\n\tthis.type = options.type || this.Types.radial;\n\t\n\t//TODO implement static\n\t\n\tthis.static = (options.static) ? true : false;\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) ),\n handlingOpen: false,\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root and then prepare it.\n P.$root = $( '<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />' )\n prepareElementRoot()\n\n\n // Create the picker holder and then prepare it.\n P.$holder = $( createWrappedComponent() ).appendTo( P.$root )\n prepareElementHolder()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) {\n P.$holder = $( createWrappedComponent() )\n prepareElementHolder()\n P.$root.html( P.$holder )\n }\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $('body').\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n focusPickerOnceOpened()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n // If the picker is currently midway through processing\n // the opening sequence of events then don't handle clicks\n // on any part of the DOM. This is caused by a bug in Chrome 73\n // where a click event is being generated with the incorrect\n // path in it.\n // In short, if someone does a click that finishes after the\n // new element is created then the path contains only the\n // parent element and not the input element itself.\n if (STATE.handlingOpen) {\n return;\n }\n\n var target = getRealEventTarget( event, ELEMENT )\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n // * In Chrome 62 and up, password autofill causes a simulated focusin event which\n // closes the picker.\n if ( ! event.isSimulated && target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$holder[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = getRealEventTarget( event, ELEMENT )\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n if ( SETTINGS.editable ) {\n ELEMENT.focus()\n }\n else {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$holder.off( 'focus.toOpen' ).focus()\n setTimeout( function() {\n P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $('body').\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( ( thingItem == 'select' || thingItem == 'clear' ) && SETTINGS.updateInput ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder,\n\n 'tabindex=\"-1\"'\n ) //endreturn\n } //createWrappedComponent\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n ).\n\n // On focus/click, open the picker.\n on( 'focus.' + STATE.id + ' click.' + STATE.id,\n function(event) {\n event.preventDefault()\n P.open()\n }\n )\n\n // Mousedown handler to capture when the user starts interacting\n // with the picker. This is used in working around a bug in Chrome 73.\n .on('mousedown', function() {\n STATE.handlingOpen = true;\n var handler = function() {\n // By default mouseup events are fired before a click event.\n // By using a timeout we can force the mouseup to be handled\n // after the corresponding click event is handled.\n setTimeout(function() {\n $(document).off('mouseup', handler);\n STATE.handlingOpen = false;\n }, 0);\n };\n $(document).on('mouseup', handler);\n });\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the holder picker element with all bindings.\n */\n function prepareElementHolder() {\n\n P.$holder.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n 'focus.toOpen': handleFocusToOpenEvent,\n\n blur: function() {\n // Remove the “target” class.\n $ELEMENT.removeClass( CLASSES.target )\n },\n\n // When something within the holder is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = getRealEventTarget( event, ELEMENT )\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$holder[0] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the holder so that users can click away\n // from elements focused within the picker.\n P.$holder.eq(0).focus()\n }\n }\n }\n\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( (activeElement.type || activeElement.href ) ? activeElement : null);\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$holder.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n if ( SETTINGS.closeOnSelect ) {\n P.close( true )\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear()\n if ( SETTINGS.closeOnClear ) {\n P.close( true )\n }\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$holder\n\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n }\n\n\n // Wait for transitions to end before focusing the holder. Otherwise, while\n // using the `container` option, the view jumps to the container.\n function focusPickerOnceOpened() {\n\n if (IS_DEFAULT_THEME && supportsTransitions) {\n P.$holder.find('.' + CLASSES.frame).one('transitionend', function() {\n P.$holder.eq(0).focus()\n })\n }\n else {\n setTimeout(function() {\n P.$holder.eq(0).focus()\n }, 0)\n }\n }\n\n\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // Add the “target” class.\n $ELEMENT.addClass( CLASSES.target )\n\n // Add the “focused” class to the root.\n P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close( true )\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function getSliderCSS(index, sliderValues) {\n let ret = 'input[type=range]#';\n let sliderId;\n let gradientMin;\n let gradientMax;\n let hueGradient;\n let rgbColour;\n\n switch (index) {\n case 1:\n sliderId = 'first-slider';\n switch (currentPickerMode) {\n case 'rgb':\n gradientMin = 'rgba(0,' + sliderValues[1] + ',' + sliderValues[2] + ',1)';\n gradientMax = 'rgba(255,' + sliderValues[1] + ',' + sliderValues[2] + ',1)';\n break;\n case 'hsv':\n hueGradient = getHueGradientHSV(sliderValues);\n break;\n case 'hsl':\n // Hue gradient\n hueGradient = getHueGradientHSL(sliderValues);\n break;\n }\n break;\n case 2:\n sliderId = 'second-slider';\n switch (currentPickerMode) {\n case 'rgb':\n gradientMin = 'rgba(' + sliderValues[0] + ',0,' + sliderValues[2] + ',1)';\n gradientMax = 'rgba(' + sliderValues[0] + ',255,' + sliderValues[2] + ',1)';\n break;\n case 'hsv':\n rgbColour = hsvToRgb(sliderValues[0], 0, sliderValues[2]);\n gradientMin = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n\n rgbColour = hsvToRgb(sliderValues[0], 100, sliderValues[2]);\n gradientMax = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n break;\n case 'hsl':\n rgbColour = cpHslToRgb(sliderValues[0], 0, sliderValues[2]);\n gradientMin = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n\n rgbColour = cpHslToRgb(sliderValues[0], 100, sliderValues[2]);\n gradientMax = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n break;\n }\n break;\n case 3:\n sliderId = 'third-slider';\n switch (currentPickerMode) {\n case 'rgb':\n gradientMin = 'rgba(' + sliderValues[0] + ',' + sliderValues[1] + ',0,1)';\n gradientMax = 'rgba(' + sliderValues[0] + ',' + sliderValues[1] + ',255,1)';\n break;\n case 'hsv':\n rgbColour = hsvToRgb(sliderValues[0], sliderValues[1], 0);\n gradientMin = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n\n rgbColour = hsvToRgb(sliderValues[0], sliderValues[1], 100);\n gradientMax = 'rgba(' + rgbColour[0] + ',' + rgbColour[1] + ',' + rgbColour[2] + ',1)';\n break;\n case 'hsl':\n gradientMin = 'rgba(0,0,0,1)';\n gradientMax = 'rgba(255,255,255,1)';\n break;\n }\n\n break;\n default:\n return '';\n }\n\n ret += sliderId;\n ret += '::-webkit-slider-runnable-track {';\n\n switch (currentPickerMode) {\n case 'rgb':\n ret += 'background: linear-gradient(90deg, rgba(2,0,36,1) 0%, ' +\n gradientMin + ' 0%, ' + gradientMax + '100%)';\n break;\n case 'hsv':\n case 'hsl':\n ret += 'background: ';\n if (index == 1) {\n ret += hueGradient;\n }\n else { \n ret += 'linear-gradient(90deg, rgba(2,0,36,1) 0%, ' + gradientMin + ' 0%, ';\n // For hsl I also have to add a middle point\n if (currentPickerMode == 'hsl' && index == 3) {\n let rgb = cpHslToRgb(sliderValues[0], sliderValues[1], 50);\n ret += 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',1) 50%,';\n }\n \n ret += gradientMax + '100%);';\n }\n break;\n }\n\n ret += '}'\n\n ret += ret.replace('::-webkit-slider-runnable-track', '::-moz-range-track');\n\n return ret;\n}", "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\r\n\r\n // If there’s no element, return the picker constructor.\r\n if (!ELEMENT) return PickerConstructor;\r\n\r\n var IS_DEFAULT_THEME = false,\r\n\r\n\r\n // The state of the picker.\r\n STATE = {\r\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\r\n },\r\n\r\n\r\n // Merge the defaults and options passed.\r\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\r\n\r\n\r\n // Merge the default classes with the settings classes.\r\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\r\n\r\n\r\n // The element node wrapper into a jQuery object.\r\n $ELEMENT = $(ELEMENT),\r\n\r\n\r\n // Pseudo picker constructor.\r\n PickerInstance = function () {\r\n return this.start();\r\n },\r\n\r\n\r\n // The picker prototype.\r\n P = PickerInstance.prototype = {\r\n\r\n constructor: PickerInstance,\r\n\r\n $node: $ELEMENT,\r\n\r\n /**\r\n * Initialize everything\r\n */\r\n start: function () {\r\n\r\n // If it’s already started, do nothing.\r\n if (STATE && STATE.start) return P;\r\n\r\n // Update the picker states.\r\n STATE.methods = {};\r\n STATE.start = true;\r\n STATE.open = false;\r\n STATE.type = ELEMENT.type;\r\n\r\n // Confirm focus state, convert into text input to remove UA stylings,\r\n // and set as readonly to prevent keyboard popup.\r\n ELEMENT.autofocus = ELEMENT == getActiveElement();\r\n ELEMENT.readOnly = !SETTINGS.editable;\r\n ELEMENT.id = ELEMENT.id || STATE.id;\r\n if (ELEMENT.type != 'text') {\r\n ELEMENT.type = 'text';\r\n }\r\n\r\n // Create a new picker component with the settings.\r\n P.component = new COMPONENT(P, SETTINGS);\r\n\r\n // Create the picker root with a holder and then prepare it.\r\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\r\n prepareElementRoot();\r\n\r\n // If there’s a format for the hidden input element, create the element.\r\n if (SETTINGS.formatSubmit) {\r\n prepareElementHidden();\r\n }\r\n\r\n // Prepare the input element.\r\n prepareElement();\r\n\r\n // Insert the root as specified in the settings.\r\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\r\n\r\n // Bind the default component and settings events.\r\n P.on({\r\n start: P.component.onStart,\r\n render: P.component.onRender,\r\n stop: P.component.onStop,\r\n open: P.component.onOpen,\r\n close: P.component.onClose,\r\n set: P.component.onSet\r\n }).on({\r\n start: SETTINGS.onStart,\r\n render: SETTINGS.onRender,\r\n stop: SETTINGS.onStop,\r\n open: SETTINGS.onOpen,\r\n close: SETTINGS.onClose,\r\n set: SETTINGS.onSet\r\n });\r\n\r\n // Once we’re all set, check the theme in use.\r\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\r\n\r\n // If the element has autofocus, open the picker.\r\n if (ELEMENT.autofocus) {\r\n P.open();\r\n }\r\n\r\n // Trigger queued the “start” and “render” events.\r\n return P.trigger('start').trigger('render');\r\n }, //start\r\n\r\n\r\n /**\r\n * Render a new picker\r\n */\r\n render: function (entireComponent) {\r\n\r\n // Insert a new component holder in the root or box.\r\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\r\n\r\n // Trigger the queued “render” events.\r\n return P.trigger('render');\r\n }, //render\r\n\r\n\r\n /**\r\n * Destroy everything\r\n */\r\n stop: function () {\r\n\r\n // If it’s already stopped, do nothing.\r\n if (!STATE.start) return P;\r\n\r\n // Then close the picker.\r\n P.close();\r\n\r\n // Remove the hidden field.\r\n if (P._hidden) {\r\n P._hidden.parentNode.removeChild(P._hidden);\r\n }\r\n\r\n // Remove the root.\r\n P.$root.remove();\r\n\r\n // Remove the input class, remove the stored data, and unbind\r\n // the events (after a tick for IE - see `P.close`).\r\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\r\n setTimeout(function () {\r\n $ELEMENT.off('.' + STATE.id);\r\n }, 0);\r\n\r\n // Restore the element state\r\n ELEMENT.type = STATE.type;\r\n ELEMENT.readOnly = false;\r\n\r\n // Trigger the queued “stop” events.\r\n P.trigger('stop');\r\n\r\n // Reset the picker states.\r\n STATE.methods = {};\r\n STATE.start = false;\r\n\r\n return P;\r\n }, //stop\r\n\r\n\r\n /**\r\n * Open up the picker\r\n */\r\n open: function (dontGiveFocus) {\r\n\r\n // If it’s already open, do nothing.\r\n if (STATE.open) return P;\r\n\r\n // Add the “active” class.\r\n $ELEMENT.addClass(CLASSES.active);\r\n aria(ELEMENT, 'expanded', true);\r\n\r\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\r\n // killing transitions :(. So add the “opened” state on the next tick.\r\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\r\n setTimeout(function () {\r\n\r\n // Add the “opened” class to the picker root.\r\n P.$root.addClass(CLASSES.opened);\r\n aria(P.$root[0], 'hidden', false);\r\n }, 0);\r\n\r\n // If we have to give focus, bind the element and doc events.\r\n if (dontGiveFocus !== false) {\r\n\r\n // Set it as open.\r\n STATE.open = true;\r\n\r\n // Prevent the page from scrolling.\r\n if (IS_DEFAULT_THEME) {\r\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\r\n }\r\n\r\n // Pass focus to the root element’s jQuery object.\r\n // * Workaround for iOS8 to bring the picker’s root into view.\r\n P.$root.eq(0).focus();\r\n\r\n // Bind the document events.\r\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\r\n\r\n var target = event.target;\r\n\r\n // If the target of the event is not the element, close the picker picker.\r\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\r\n // Also, for Firefox, a click on an `option` element bubbles up directly\r\n // to the doc. So make sure the target wasn't the doc.\r\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\r\n // which causes the picker to unexpectedly close when right-clicking it. So make\r\n // sure the event wasn’t a right-click.\r\n if (target != ELEMENT && target != document && event.which != 3) {\r\n\r\n // If the target was the holder that covers the screen,\r\n // keep the element focused to maintain tabindex.\r\n P.close(target === P.$root.children()[0]);\r\n }\r\n }).on('keydown.' + STATE.id, function (event) {\r\n\r\n var\r\n // Get the keycode.\r\n keycode = event.keyCode,\r\n\r\n\r\n // Translate that to a selection change.\r\n keycodeToMove = P.component.key[keycode],\r\n\r\n\r\n // Grab the target.\r\n target = event.target;\r\n\r\n // On escape, close the picker and give focus.\r\n if (keycode == 27) {\r\n P.close(true);\r\n }\r\n\r\n // Check if there is a key movement or “enter” keypress on the element.\r\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\r\n\r\n // Prevent the default action to stop page movement.\r\n event.preventDefault();\r\n\r\n // Trigger the key movement action.\r\n if (keycodeToMove) {\r\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\r\n }\r\n\r\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\r\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\r\n P.set('select', P.component.item.highlight);\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n }\r\n }\r\n\r\n // If the target is within the root and “enter” is pressed,\r\n // prevent the default action and trigger a click on the target instead.\r\n else if ($.contains(P.$root[0], target) && keycode == 13) {\r\n event.preventDefault();\r\n target.click();\r\n }\r\n });\r\n }\r\n\r\n // Trigger the queued “open” events.\r\n return P.trigger('open');\r\n }, //open\r\n\r\n\r\n /**\r\n * Close the picker\r\n */\r\n close: function (giveFocus) {\r\n\r\n // If we need to give focus, do it before changing states.\r\n if (giveFocus) {\r\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\r\n // The focus is triggered *after* the close has completed - causing it\r\n // to open again. So unbind and rebind the event at the next tick.\r\n P.$root.off('focus.toOpen').eq(0).focus();\r\n setTimeout(function () {\r\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\r\n }, 0);\r\n }\r\n\r\n // Remove the “active” class.\r\n $ELEMENT.removeClass(CLASSES.active);\r\n aria(ELEMENT, 'expanded', false);\r\n\r\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\r\n // killing transitions :(. So remove the “opened” state on the next tick.\r\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\r\n setTimeout(function () {\r\n\r\n // Remove the “opened” and “focused” class from the picker root.\r\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\r\n aria(P.$root[0], 'hidden', true);\r\n }, 0);\r\n\r\n // If it’s already closed, do nothing more.\r\n if (!STATE.open) return P;\r\n\r\n // Set it as closed.\r\n STATE.open = false;\r\n\r\n // Allow the page to scroll.\r\n if (IS_DEFAULT_THEME) {\r\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\r\n }\r\n\r\n // Unbind the document events.\r\n $document.off('.' + STATE.id);\r\n\r\n // Trigger the queued “close” events.\r\n return P.trigger('close');\r\n }, //close\r\n\r\n\r\n /**\r\n * Clear the values\r\n */\r\n clear: function (options) {\r\n return P.set('clear', null, options);\r\n }, //clear\r\n\r\n\r\n /**\r\n * Set something\r\n */\r\n set: function (thing, value, options) {\r\n\r\n var thingItem,\r\n thingValue,\r\n thingIsObject = $.isPlainObject(thing),\r\n thingObject = thingIsObject ? thing : {};\r\n\r\n // Make sure we have usable options.\r\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\r\n\r\n if (thing) {\r\n\r\n // If the thing isn’t an object, make it one.\r\n if (!thingIsObject) {\r\n thingObject[thing] = value;\r\n }\r\n\r\n // Go through the things of items to set.\r\n for (thingItem in thingObject) {\r\n\r\n // Grab the value of the thing.\r\n thingValue = thingObject[thingItem];\r\n\r\n // First, if the item exists and there’s a value, set it.\r\n if (thingItem in P.component.item) {\r\n if (thingValue === undefined) thingValue = null;\r\n P.component.set(thingItem, thingValue, options);\r\n }\r\n\r\n // Then, check to update the element value and broadcast a change.\r\n if (thingItem == 'select' || thingItem == 'clear') {\r\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\r\n }\r\n }\r\n\r\n // Render a new picker.\r\n P.render();\r\n }\r\n\r\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\r\n return options.muted ? P : P.trigger('set', thingObject);\r\n }, //set\r\n\r\n\r\n /**\r\n * Get something\r\n */\r\n get: function (thing, format) {\r\n\r\n // Make sure there’s something to get.\r\n thing = thing || 'value';\r\n\r\n // If a picker state exists, return that.\r\n if (STATE[thing] != null) {\r\n return STATE[thing];\r\n }\r\n\r\n // Return the submission value, if that.\r\n if (thing == 'valueSubmit') {\r\n if (P._hidden) {\r\n return P._hidden.value;\r\n }\r\n thing = 'value';\r\n }\r\n\r\n // Return the value, if that.\r\n if (thing == 'value') {\r\n return ELEMENT.value;\r\n }\r\n\r\n // Check if a component item exists, return that.\r\n if (thing in P.component.item) {\r\n if (typeof format == 'string') {\r\n var thingValue = P.component.get(thing);\r\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\r\n }\r\n return P.component.get(thing);\r\n }\r\n }, //get\r\n\r\n\r\n /**\r\n * Bind events on the things.\r\n */\r\n on: function (thing, method, internal) {\r\n\r\n var thingName,\r\n thingMethod,\r\n thingIsObject = $.isPlainObject(thing),\r\n thingObject = thingIsObject ? thing : {};\r\n\r\n if (thing) {\r\n\r\n // If the thing isn’t an object, make it one.\r\n if (!thingIsObject) {\r\n thingObject[thing] = method;\r\n }\r\n\r\n // Go through the things to bind to.\r\n for (thingName in thingObject) {\r\n\r\n // Grab the method of the thing.\r\n thingMethod = thingObject[thingName];\r\n\r\n // If it was an internal binding, prefix it.\r\n if (internal) {\r\n thingName = '_' + thingName;\r\n }\r\n\r\n // Make sure the thing methods collection exists.\r\n STATE.methods[thingName] = STATE.methods[thingName] || [];\r\n\r\n // Add the method to the relative method collection.\r\n STATE.methods[thingName].push(thingMethod);\r\n }\r\n }\r\n\r\n return P;\r\n }, //on\r\n\r\n\r\n /**\r\n * Unbind events on the things.\r\n */\r\n off: function () {\r\n var i,\r\n thingName,\r\n names = arguments;\r\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\r\n thingName = names[i];\r\n if (thingName in STATE.methods) {\r\n delete STATE.methods[thingName];\r\n }\r\n }\r\n return P;\r\n },\r\n\r\n /**\r\n * Fire off method events.\r\n */\r\n trigger: function (name, data) {\r\n var _trigger = function (name) {\r\n var methodList = STATE.methods[name];\r\n if (methodList) {\r\n methodList.map(function (method) {\r\n PickerConstructor._.trigger(method, P, [data]);\r\n });\r\n }\r\n };\r\n _trigger('_' + name);\r\n _trigger(name);\r\n return P;\r\n } //trigger\r\n //PickerInstance.prototype\r\n\r\n\r\n /**\r\n * Wrap the picker holder components together.\r\n */\r\n };function createWrappedComponent() {\r\n\r\n // Create a picker wrapper holder\r\n return PickerConstructor._.node('div',\r\n\r\n // Create a picker wrapper node\r\n PickerConstructor._.node('div',\r\n\r\n // Create a picker frame\r\n PickerConstructor._.node('div',\r\n\r\n // Create a picker box node\r\n PickerConstructor._.node('div',\r\n\r\n // Create the components nodes.\r\n P.component.nodes(STATE.open),\r\n\r\n // The picker box class\r\n CLASSES.box),\r\n\r\n // Picker wrap class\r\n CLASSES.wrap),\r\n\r\n // Picker frame class\r\n CLASSES.frame),\r\n\r\n // Picker holder class\r\n CLASSES.holder); //endreturn\r\n } //createWrappedComponent\r\n\r\n\r\n /**\r\n * Prepare the input element with all bindings.\r\n */\r\n function prepareElement() {\r\n\r\n $ELEMENT.\r\n\r\n // Store the picker data by component name.\r\n data(NAME, P).\r\n\r\n // Add the “input” class name.\r\n addClass(CLASSES.input).\r\n\r\n // Remove the tabindex.\r\n attr('tabindex', -1).\r\n\r\n // If there’s a `data-value`, update the value of the element.\r\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\r\n\r\n // Only bind keydown events if the element isn’t editable.\r\n if (!SETTINGS.editable) {\r\n\r\n $ELEMENT.\r\n\r\n // On focus/click, focus onto the root to open it up.\r\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\r\n event.preventDefault();\r\n P.$root.eq(0).focus();\r\n }).\r\n\r\n // Handle keyboard event based on the picker being opened or not.\r\n on('keydown.' + STATE.id, handleKeydownEvent);\r\n }\r\n\r\n // Update the aria attributes.\r\n aria(ELEMENT, {\r\n haspopup: true,\r\n expanded: false,\r\n readonly: false,\r\n owns: ELEMENT.id + '_root'\r\n });\r\n }\r\n\r\n /**\r\n * Prepare the root picker element with all bindings.\r\n */\r\n function prepareElementRoot() {\r\n\r\n P.$root.on({\r\n\r\n // For iOS8.\r\n keydown: handleKeydownEvent,\r\n\r\n // When something within the root is focused, stop from bubbling\r\n // to the doc and remove the “focused” state from the root.\r\n focusin: function (event) {\r\n P.$root.removeClass(CLASSES.focused);\r\n event.stopPropagation();\r\n },\r\n\r\n // When something within the root holder is clicked, stop it\r\n // from bubbling to the doc.\r\n 'mousedown click': function (event) {\r\n\r\n var target = event.target;\r\n\r\n // Make sure the target isn’t the root holder so it can bubble up.\r\n if (target != P.$root.children()[0]) {\r\n\r\n event.stopPropagation();\r\n\r\n // * For mousedown events, cancel the default action in order to\r\n // prevent cases where focus is shifted onto external elements\r\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\r\n // Also, for Firefox, don’t prevent action on the `option` element.\r\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\r\n\r\n event.preventDefault();\r\n\r\n // Re-focus onto the root so that users can click away\r\n // from elements focused within the picker.\r\n P.$root.eq(0).focus();\r\n }\r\n }\r\n }\r\n }).\r\n\r\n // Add/remove the “target” class on focus and blur.\r\n on({\r\n focus: function () {\r\n $ELEMENT.addClass(CLASSES.target);\r\n },\r\n blur: function () {\r\n $ELEMENT.removeClass(CLASSES.target);\r\n }\r\n }).\r\n\r\n // Open the picker and adjust the root “focused” state\r\n on('focus.toOpen', handleFocusToOpenEvent).\r\n\r\n // If there’s a click on an actionable element, carry out the actions.\r\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\r\n\r\n var $target = $(this),\r\n targetData = $target.data(),\r\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\r\n\r\n\r\n // * For IE, non-focusable elements can be active elements as well\r\n // (http://stackoverflow.com/a/2684561).\r\n activeElement = getActiveElement();\r\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\r\n\r\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\r\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\r\n P.$root.eq(0).focus();\r\n }\r\n\r\n // If something is superficially changed, update the `highlight` based on the `nav`.\r\n if (!targetDisabled && targetData.nav) {\r\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\r\n }\r\n\r\n // If something is picked, set `select` then close with focus.\r\n else if (!targetDisabled && 'pick' in targetData) {\r\n P.set('select', targetData.pick);\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n }\r\n\r\n // If a “clear” button is pressed, empty the values and close with focus.\r\n else if (targetData.clear) {\r\n P.clear();\r\n if (SETTINGS.closeOnSelect) {\r\n P.close(true);\r\n }\r\n } else if (targetData.close) {\r\n P.close(true);\r\n }\r\n }); //P.$root\r\n\r\n aria(P.$root[0], 'hidden', true);\r\n }\r\n\r\n /**\r\n * Prepare the hidden input element along with all bindings.\r\n */\r\n function prepareElementHidden() {\r\n\r\n var name;\r\n\r\n if (SETTINGS.hiddenName === true) {\r\n name = ELEMENT.name;\r\n ELEMENT.name = '';\r\n } else {\r\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\r\n name = name[0] + ELEMENT.name + name[1];\r\n }\r\n\r\n P._hidden = $('<input ' + 'type=hidden ' +\r\n\r\n // Create the name using the original input’s with a prefix and suffix.\r\n 'name=\"' + name + '\"' + (\r\n\r\n // If the element has a value, set the hidden value as well.\r\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\r\n\r\n $ELEMENT.\r\n\r\n // If the value changes, update the hidden input with the correct format.\r\n on('change.' + STATE.id, function () {\r\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\r\n });\r\n\r\n // Insert the hidden input as specified in the settings.\r\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\r\n }\r\n\r\n // For iOS8.\r\n function handleKeydownEvent(event) {\r\n\r\n var keycode = event.keyCode,\r\n\r\n\r\n // Check if one of the delete keys was pressed.\r\n isKeycodeDelete = /^(8|46)$/.test(keycode);\r\n\r\n // For some reason IE clears the input value on “escape”.\r\n if (keycode == 27) {\r\n P.close();\r\n return false;\r\n }\r\n\r\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\r\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\r\n\r\n // Prevent it from moving the page and bubbling to doc.\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n // If `delete` was pressed, clear the values and close the picker.\r\n // Otherwise open the picker.\r\n if (isKeycodeDelete) {\r\n P.clear().close();\r\n } else {\r\n P.open();\r\n }\r\n }\r\n }\r\n\r\n // Separated for IE\r\n function handleFocusToOpenEvent(event) {\r\n\r\n // Stop the event from propagating to the doc.\r\n event.stopPropagation();\r\n\r\n // If it’s a focus event, add the “focused” class to the root.\r\n if (event.type == 'focus') {\r\n P.$root.addClass(CLASSES.focused);\r\n }\r\n\r\n // And then finally open the picker.\r\n P.open();\r\n }\r\n\r\n // Return a new picker instance.\r\n return new PickerInstance();\r\n }", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' ).eq(0).focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' ).eq(0).focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root.eq(0).focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root.eq(0).focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root[0].focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' )[0].focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root[0].focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' )[0].focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root[0].focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' )[0].focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {\n\n // If there’s no element, return the picker constructor.\n if (!ELEMENT) return PickerConstructor;\n\n var IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $(ELEMENT),\n\n\n // Pseudo picker constructor.\n PickerInstance = function () {\n return this.start();\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n /**\n * Initialize everything\n */\n start: function () {\n\n // If it’s already started, do nothing.\n if (STATE && STATE.start) return P;\n\n // Update the picker states.\n STATE.methods = {};\n STATE.start = true;\n STATE.open = false;\n STATE.type = ELEMENT.type;\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement();\n ELEMENT.readOnly = !SETTINGS.editable;\n ELEMENT.id = ELEMENT.id || STATE.id;\n if (ELEMENT.type != 'text') {\n ELEMENT.type = 'text';\n }\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS);\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $(PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"'));\n prepareElementRoot();\n\n // If there’s a format for the hidden input element, create the element.\n if (SETTINGS.formatSubmit) {\n prepareElementHidden();\n }\n\n // Prepare the input element.\n prepareElement();\n\n // Insert the root as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.before(P.$root);\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n });\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme(P.$root.children()[0]);\n\n // If the element has autofocus, open the picker.\n if (ELEMENT.autofocus) {\n P.open();\n }\n\n // Trigger queued the “start” and “render” events.\n return P.trigger('start').trigger('render');\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function (entireComponent) {\n\n // Insert a new component holder in the root or box.\n if (entireComponent) P.$root.html(createWrappedComponent());else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));\n\n // Trigger the queued “render” events.\n return P.trigger('render');\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function () {\n\n // If it’s already stopped, do nothing.\n if (!STATE.start) return P;\n\n // Then close the picker.\n P.close();\n\n // Remove the hidden field.\n if (P._hidden) {\n P._hidden.parentNode.removeChild(P._hidden);\n }\n\n // Remove the root.\n P.$root.remove();\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass(CLASSES.input).removeData(NAME);\n setTimeout(function () {\n $ELEMENT.off('.' + STATE.id);\n }, 0);\n\n // Restore the element state\n ELEMENT.type = STATE.type;\n ELEMENT.readOnly = false;\n\n // Trigger the queued “stop” events.\n P.trigger('stop');\n\n // Reset the picker states.\n STATE.methods = {};\n STATE.start = false;\n\n return P;\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function (dontGiveFocus) {\n\n // If it’s already open, do nothing.\n if (STATE.open) return P;\n\n // Add the “active” class.\n $ELEMENT.addClass(CLASSES.active);\n aria(ELEMENT, 'expanded', true);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass(CLASSES.opened);\n aria(P.$root[0], 'hidden', false);\n }, 0);\n\n // If we have to give focus, bind the element and doc events.\n if (dontGiveFocus !== false) {\n\n // Set it as open.\n STATE.open = true;\n\n // Prevent the page from scrolling.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root.eq(0).focus();\n\n // Bind the document events.\n $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {\n\n var target = event.target;\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if (target != ELEMENT && target != document && event.which != 3) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close(target === P.$root.children()[0]);\n }\n }).on('keydown.' + STATE.id, function (event) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[keycode],\n\n\n // Grab the target.\n target = event.target;\n\n // On escape, close the picker and give focus.\n if (keycode == 27) {\n P.close(true);\n }\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if (target == P.$root[0] && (keycodeToMove || keycode == 13)) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault();\n\n // Trigger the key movement action.\n if (keycodeToMove) {\n PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {\n P.set('select', P.component.item.highlight);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n }\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ($.contains(P.$root[0], target) && keycode == 13) {\n event.preventDefault();\n target.click();\n }\n });\n }\n\n // Trigger the queued “open” events.\n return P.trigger('open');\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function (giveFocus) {\n\n // If we need to give focus, do it before changing states.\n if (giveFocus) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off('focus.toOpen').eq(0).focus();\n setTimeout(function () {\n P.$root.on('focus.toOpen', handleFocusToOpenEvent);\n }, 0);\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass(CLASSES.active);\n aria(ELEMENT, 'expanded', false);\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout(function () {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);\n aria(P.$root[0], 'hidden', true);\n }, 0);\n\n // If it’s already closed, do nothing more.\n if (!STATE.open) return P;\n\n // Set it as closed.\n STATE.open = false;\n\n // Allow the page to scroll.\n if (IS_DEFAULT_THEME) {\n $html.css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());\n }\n\n // Unbind the document events.\n $document.off('.' + STATE.id);\n\n // Trigger the queued “close” events.\n return P.trigger('close');\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function (options) {\n return P.set('clear', null, options);\n }, //clear\n\n\n /**\n * Set something\n */\n set: function (thing, value, options) {\n\n var thingItem,\n thingValue,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject(value) ? value : options || {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = value;\n }\n\n // Go through the things of items to set.\n for (thingItem in thingObject) {\n\n // Grab the value of the thing.\n thingValue = thingObject[thingItem];\n\n // First, if the item exists and there’s a value, set it.\n if (thingItem in P.component.item) {\n if (thingValue === undefined) thingValue = null;\n P.component.set(thingItem, thingValue, options);\n }\n\n // Then, check to update the element value and broadcast a change.\n if (thingItem == 'select' || thingItem == 'clear') {\n $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');\n }\n }\n\n // Render a new picker.\n P.render();\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger('set', thingObject);\n }, //set\n\n\n /**\n * Get something\n */\n get: function (thing, format) {\n\n // Make sure there’s something to get.\n thing = thing || 'value';\n\n // If a picker state exists, return that.\n if (STATE[thing] != null) {\n return STATE[thing];\n }\n\n // Return the submission value, if that.\n if (thing == 'valueSubmit') {\n if (P._hidden) {\n return P._hidden.value;\n }\n thing = 'value';\n }\n\n // Return the value, if that.\n if (thing == 'value') {\n return ELEMENT.value;\n }\n\n // Check if a component item exists, return that.\n if (thing in P.component.item) {\n if (typeof format == 'string') {\n var thingValue = P.component.get(thing);\n return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';\n }\n return P.component.get(thing);\n }\n }, //get\n\n\n /**\n * Bind events on the things.\n */\n on: function (thing, method, internal) {\n\n var thingName,\n thingMethod,\n thingIsObject = $.isPlainObject(thing),\n thingObject = thingIsObject ? thing : {};\n\n if (thing) {\n\n // If the thing isn’t an object, make it one.\n if (!thingIsObject) {\n thingObject[thing] = method;\n }\n\n // Go through the things to bind to.\n for (thingName in thingObject) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[thingName];\n\n // If it was an internal binding, prefix it.\n if (internal) {\n thingName = '_' + thingName;\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[thingName] = STATE.methods[thingName] || [];\n\n // Add the method to the relative method collection.\n STATE.methods[thingName].push(thingMethod);\n }\n }\n\n return P;\n }, //on\n\n\n /**\n * Unbind events on the things.\n */\n off: function () {\n var i,\n thingName,\n names = arguments;\n for (i = 0, namesCount = names.length; i < namesCount; i += 1) {\n thingName = names[i];\n if (thingName in STATE.methods) {\n delete STATE.methods[thingName];\n }\n }\n return P;\n },\n\n /**\n * Fire off method events.\n */\n trigger: function (name, data) {\n var _trigger = function (name) {\n var methodList = STATE.methods[name];\n if (methodList) {\n methodList.map(function (method) {\n PickerConstructor._.trigger(method, P, [data]);\n });\n }\n };\n _trigger('_' + name);\n _trigger(name);\n return P;\n } //trigger\n //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n };function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node('div',\n\n // Create a picker wrapper node\n PickerConstructor._.node('div',\n\n // Create a picker frame\n PickerConstructor._.node('div',\n\n // Create a picker box node\n PickerConstructor._.node('div',\n\n // Create the components nodes.\n P.component.nodes(STATE.open),\n\n // The picker box class\n CLASSES.box),\n\n // Picker wrap class\n CLASSES.wrap),\n\n // Picker frame class\n CLASSES.frame),\n\n // Picker holder class\n CLASSES.holder); //endreturn\n } //createWrappedComponent\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value);\n\n // Only bind keydown events if the element isn’t editable.\n if (!SETTINGS.editable) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on('focus.' + STATE.id + ' click.' + STATE.id, function (event) {\n event.preventDefault();\n P.$root.eq(0).focus();\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on('keydown.' + STATE.id, handleKeydownEvent);\n }\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n });\n }\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function (event) {\n P.$root.removeClass(CLASSES.focused);\n event.stopPropagation();\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function (event) {\n\n var target = event.target;\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if (target != P.$root.children()[0]) {\n\n event.stopPropagation();\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {\n\n event.preventDefault();\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root.eq(0).focus();\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function () {\n $ELEMENT.addClass(CLASSES.target);\n },\n blur: function () {\n $ELEMENT.removeClass(CLASSES.target);\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on('focus.toOpen', handleFocusToOpenEvent).\n\n // If there’s a click on an actionable element, carry out the actions.\n on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {\n\n var $target = $(this),\n targetData = $target.data(),\n targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),\n\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement();\n activeElement = activeElement && (activeElement.type || activeElement.href) && activeElement;\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {\n P.$root.eq(0).focus();\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if (!targetDisabled && targetData.nav) {\n P.set('highlight', P.component.item.highlight, { nav: targetData.nav });\n }\n\n // If something is picked, set `select` then close with focus.\n else if (!targetDisabled && 'pick' in targetData) {\n P.set('select', targetData.pick);\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if (targetData.clear) {\n P.clear();\n if (SETTINGS.closeOnSelect) {\n P.close(true);\n }\n } else if (targetData.close) {\n P.close(true);\n }\n }); //P.$root\n\n aria(P.$root[0], 'hidden', true);\n }\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name;\n\n if (SETTINGS.hiddenName === true) {\n name = ELEMENT.name;\n ELEMENT.name = '';\n } else {\n name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];\n name = name[0] + ELEMENT.name + name[1];\n }\n\n P._hidden = $('<input ' + 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' + (\n\n // If the element has a value, set the hidden value as well.\n $ELEMENT.data('value') || ELEMENT.value ? ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : '') + '>')[0];\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function () {\n P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';\n });\n\n // Insert the hidden input as specified in the settings.\n if (SETTINGS.container) $(SETTINGS.container).append(P._hidden);else $ELEMENT.before(P._hidden);\n }\n\n // For iOS8.\n function handleKeydownEvent(event) {\n\n var keycode = event.keyCode,\n\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode);\n\n // For some reason IE clears the input value on “escape”.\n if (keycode == 27) {\n P.close();\n return false;\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault();\n event.stopPropagation();\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if (isKeycodeDelete) {\n P.clear().close();\n } else {\n P.open();\n }\n }\n }\n\n // Separated for IE\n function handleFocusToOpenEvent(event) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation();\n\n // If it’s a focus event, add the “focused” class to the root.\n if (event.type == 'focus') {\n P.$root.addClass(CLASSES.focused);\n }\n\n // And then finally open the picker.\n P.open();\n }\n\n // Return a new picker instance.\n return new PickerInstance();\n }", "function makeGradient( targetScreen, rasterList ) {\n \treturn new grad( targetScreen, makeGradientColours( rasterList ) );\n \t}", "colorPicker(args, field) {\n\n let fieldName = field.data.name;\n\n if ('background_color' == fieldName) {\n\n // background_color args\n args.palettes = [\n '', // empty for transparent or no color\n '#FFFFFF', // $color__white\n '#F0F4FF', // $color__gray\n '#92297D', // $color__purple\n '#50267A', // $color__purple2\n '#672E6C', // $color__purple3\n '#EC4521', // $color__orange\n '#DE6D1E', // $color__orange2\n '#9F8C28', // $color__green\n '#1E914E', // $color__green2\n '#82BF37', // $color__green3\n '#C79B21', // $color__green4\n '#669933', // $color__green5\n '#08194D', // $color__blue2\n '#142966', // $color__blue3\n '#000D33', // $color__blue4\n '#1C8093', // $color__blue5\n '#1BA1C6', // $color__blue6\n '#182D75', // $color__blue7\n '#23409A', // $color__blue9\n '#CCD9FF', // $color__blue10\n '#901A1E', // $color__brown\n '#D32E34', // $color__red\n '#AC014D', // $color__red3\n ];\n }\n\n return args;\n }", "function ColorSlot(parent, slot_idx) {\n // Color picker\n var addr = 47 + (48 * set_idx) + (3 * slot_idx);\n var id = prefix + \"-color-\" + set_idx + \"-\" + slot_idx;\n\n var color_elem = document.createElement(\"div\");\n color_elem.style.display = \"inline-block\";\n parent.appendChild(color_elem);\n\n var color_input = document.createElement(\"input\");\n color_input.id = id;\n color_input.type = \"text\";\n color_input.setAttribute(\"set\", set_idx);\n color_input.setAttribute(\"slot\", slot_idx);\n color_input.style.display = 'none';\n color_elem.appendChild(color_input);\n\n var color_target = document.createElement(\"div\");\n color_target.id = id + \"-target\";\n color_target.className = \"color\";\n color_elem.appendChild(color_target);\n\n var sendColor = function() {\n return function(event, color) {\n if (color.formatted && color.colorPicker.generated) {\n var rgb = hex2rgb(color.formatted);\n sendData(addr + 0, rgb.r);\n sendData(addr + 1, rgb.g);\n sendData(addr + 2, rgb.b);\n color_target.style.background = normColor(color.formatted);\n }\n };\n }();\n\n var viewColor = function() {\n return function(event, ui) {\n sendCommand([SER_VIEW_COLOR, set_idx, slot_idx, 0]);\n };\n }();\n\n var viewMode = function() {\n return function(event, ui) {\n sendCommand([SER_VIEW_MODE, 0, 0, 0]);\n };\n }();\n\n var picker = $(color_input).colorpicker({\n alpha: false,\n closeOnOutside: false,\n swatches: 'custom_array',\n swatchesWidth: 96,\n colorFormat: 'HEX',\n altField: color_target.id,\n altProperties: \"background-color\",\n parts: ['header', 'preview', 'map', 'bar', 'rgb', 'hsv', 'swatches', 'footer'],\n layout: {\n map: [0, 0, 1, 3],\n bar: [1, 0, 1, 3],\n preview: [2, 0, 1, 1],\n rgb: [2, 1, 1, 1],\n hsv: [2, 2, 1, 1],\n swatches: [3, 0, 1, 3]\n },\n select: sendColor,\n open: viewColor,\n close: viewMode\n });\n\n var onclick = function() {\n return function() {\n $(color_input).colorpicker(\"open\");\n };\n }();\n color_target.onclick = onclick;\n\n var updateColor = function(channel) {\n return function(val) {\n var hex = getColorHex(set_idx, slot_idx);\n color_target.style.background = hex;\n $(color_input).val(hex);\n };\n };\n\n var showOrHide = function() {\n return function(val) {\n if (slot_idx >= val) {\n color_target.style.display = 'none';\n } else {\n color_target.style.display = null;\n }\n }\n }();\n\n // listeners for RGB changes\n readListeners[addr + 0].push(updateColor(0));\n readListeners[addr + 1].push(updateColor(1));\n readListeners[addr + 2].push(updateColor(2));\n\n // listener on numc change\n readListeners[35 + set_idx].push(showOrHide);\n updateListeners[35 + set_idx].push(showOrHide);\n }", "function updateFromControl(input, target) {\r\n\r\n function getCoords(picker, container) {\r\n var left, top;\r\n if(!picker.length || !container) return null;\r\n left = picker.offset().left;\r\n top = picker.offset().top;\r\n\r\n return {\r\n x: left - container.offset().left + (picker.outerWidth() / 2),\r\n y: top - container.offset().top + (picker.outerHeight() / 2)\r\n };\r\n }\r\n\r\n var hue, saturation, brightness, x, y, r, phi;\r\n var hex = input.val();\r\n var opacity = input.attr('data-opacity');\r\n\r\n // Helpful references\r\n var minicolors = input.parent();\r\n var settings = input.data('minicolors-settings');\r\n var swatch = minicolors.find('.minicolors-input-swatch');\r\n\r\n // Panel objects\r\n var grid = minicolors.find('.minicolors-grid');\r\n var slider = minicolors.find('.minicolors-slider');\r\n var opacitySlider = minicolors.find('.minicolors-opacity-slider');\r\n\r\n // Picker objects\r\n var gridPicker = grid.find('[class$=-picker]');\r\n var sliderPicker = slider.find('[class$=-picker]');\r\n var opacityPicker = opacitySlider.find('[class$=-picker]');\r\n\r\n // Picker positions\r\n var gridPos = getCoords(gridPicker, grid);\r\n var sliderPos = getCoords(sliderPicker, slider);\r\n var opacityPos = getCoords(opacityPicker, opacitySlider);\r\n\r\n // Handle colors\r\n if(target.is('.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider')) {\r\n\r\n // Determine HSB values\r\n switch(settings.control) {\r\n case 'wheel':\r\n // Calculate hue, saturation, and brightness\r\n x = (grid.width() / 2) - gridPos.x;\r\n y = (grid.height() / 2) - gridPos.y;\r\n r = Math.sqrt(x * x + y * y);\r\n phi = Math.atan2(y, x);\r\n if(phi < 0) phi += Math.PI * 2;\r\n if(r > 75) {\r\n r = 75;\r\n gridPos.x = 69 - (75 * Math.cos(phi));\r\n gridPos.y = 69 - (75 * Math.sin(phi));\r\n }\r\n saturation = keepWithin(r / 0.75, 0, 100);\r\n hue = keepWithin(phi * 180 / Math.PI, 0, 360);\r\n brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n hex = hsb2hex({\r\n h: hue,\r\n s: saturation,\r\n b: brightness\r\n });\r\n\r\n // Update UI\r\n slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\r\n break;\r\n\r\n case 'saturation':\r\n // Calculate hue, saturation, and brightness\r\n hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\r\n saturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n hex = hsb2hex({\r\n h: hue,\r\n s: saturation,\r\n b: brightness\r\n });\r\n\r\n // Update UI\r\n slider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\r\n minicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\r\n break;\r\n\r\n case 'brightness':\r\n // Calculate hue, saturation, and brightness\r\n hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\r\n saturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n hex = hsb2hex({\r\n h: hue,\r\n s: saturation,\r\n b: brightness\r\n });\r\n\r\n // Update UI\r\n slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\r\n minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\r\n break;\r\n\r\n default:\r\n // Calculate hue, saturation, and brightness\r\n hue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);\r\n saturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\r\n brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n hex = hsb2hex({\r\n h: hue,\r\n s: saturation,\r\n b: brightness\r\n });\r\n\r\n // Update UI\r\n grid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\r\n break;\r\n }\r\n\r\n // Handle opacity\r\n if(settings.opacity) {\r\n opacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\r\n } else {\r\n opacity = 1;\r\n }\r\n\r\n updateInput(input, hex, opacity);\r\n }\r\n else {\r\n // Set swatch color\r\n swatch.find('span').css({\r\n backgroundColor: hex,\r\n opacity: opacity\r\n });\r\n\r\n // Handle change event\r\n doChange(input, hex, opacity);\r\n }\r\n }", "function updateFromControl(input, target) {\n\n function getCoords(picker, container) {\n var left, top;\n if(!picker.length || !container) return null;\n left = picker.offset().left;\n top = picker.offset().top;\n\n return {\n x: left - container.offset().left + (picker.outerWidth() / 2),\n y: top - container.offset().top + (picker.outerHeight() / 2)\n };\n }\n\n var hue, saturation, brightness, x, y, r, phi;\n var hex = input.val();\n var opacity = input.attr('data-opacity');\n\n // Helpful references\n var minicolors = input.parent();\n var settings = input.data('minicolors-settings');\n var swatch = minicolors.find('.minicolors-input-swatch');\n\n // Panel objects\n var grid = minicolors.find('.minicolors-grid');\n var slider = minicolors.find('.minicolors-slider');\n var opacitySlider = minicolors.find('.minicolors-opacity-slider');\n\n // Picker objects\n var gridPicker = grid.find('[class$=-picker]');\n var sliderPicker = slider.find('[class$=-picker]');\n var opacityPicker = opacitySlider.find('[class$=-picker]');\n\n // Picker positions\n var gridPos = getCoords(gridPicker, grid);\n var sliderPos = getCoords(sliderPicker, slider);\n var opacityPos = getCoords(opacityPicker, opacitySlider);\n\n // Handle colors\n if(target.is('.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider')) {\n\n // Determine HSB values\n switch(settings.control) {\n case 'wheel':\n // Calculate hue, saturation, and brightness\n x = (grid.width() / 2) - gridPos.x;\n y = (grid.height() / 2) - gridPos.y;\n r = Math.sqrt(x * x + y * y);\n phi = Math.atan2(y, x);\n if(phi < 0) phi += Math.PI * 2;\n if(r > 75) {\n r = 75;\n gridPos.x = 69 - (75 * Math.cos(phi));\n gridPos.y = 69 - (75 * Math.sin(phi));\n }\n saturation = keepWithin(r / 0.75, 0, 100);\n hue = keepWithin(phi * 180 / Math.PI, 0, 360);\n brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n hex = hsb2hex({\n h: hue,\n s: saturation,\n b: brightness\n });\n\n // Update UI\n slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n break;\n\n case 'saturation':\n // Calculate hue, saturation, and brightness\n hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n saturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n hex = hsb2hex({\n h: hue,\n s: saturation,\n b: brightness\n });\n\n // Update UI\n slider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\n minicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\n break;\n\n case 'brightness':\n // Calculate hue, saturation, and brightness\n hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n saturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n hex = hsb2hex({\n h: hue,\n s: saturation,\n b: brightness\n });\n\n // Update UI\n slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\n break;\n\n default:\n // Calculate hue, saturation, and brightness\n hue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);\n saturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\n brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n hex = hsb2hex({\n h: hue,\n s: saturation,\n b: brightness\n });\n\n // Update UI\n grid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\n break;\n }\n\n // Handle opacity\n if(settings.opacity) {\n opacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\n } else {\n opacity = 1;\n }\n\n updateInput(input, hex, opacity);\n }\n else {\n // Set swatch color\n swatch.find('span').css({\n backgroundColor: hex,\n opacity: opacity\n });\n\n // Handle change event\n doChange(input, hex, opacity);\n }\n }", "constructor(x,y,w,h,Slider, canvas,c_1,c_2, c_3, Button, SFButton){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n\r\n // class Button x,y,w,h,text, c_1, c_2, c_3, canvas\r\n this.strokeB = new SFButton(x+4*0.125*w, y-0.15*h, 0.1*w, 0.2*h, \"S\", c_1, c_3, c_2, canvas, \"Stroke\" );\r\n this.fillB = new SFButton(x+5*0.125*w, y-0.15*h, 0.1*w, 0.2*h, \"F\", c_1, c_3, c_2, canvas, \"Fill\" );\r\n \r\n //class Slider (canvas,x,y,w,h,c_1,c_2, c_3, max, min, start)\r\n this.StrkWidth = new Slider(canvas, x+0*0.125*w, y-0.1*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 10, 0, 10);\r\n\r\n this.R = new Slider(canvas, x+0*0.125*w, y+0.1*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 255, 0, 255);\r\n this.G = new Slider(canvas, x+0*0.125*w, y+0.3*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 255, 0, 255);\r\n this.B = new Slider(canvas, x+0*0.125*w, y+0.5*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 255, 0, 255);\r\n this.A = new Slider(canvas, x+0*0.125*w, y+0.7*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 100, 0, 100);\r\n\r\n this.outline = c_1;\r\n this.fill = c_2;\r\n this.stroke = c_3;\r\n this.colour = \"\";\r\n this.strokeColour = \"rgba(0,0,0,1)\";\r\n\r\n this.strokeWidth = 0;\r\n this.selectedStyle = SFButton.selectedStyle;\r\n\r\n}", "function colorPicker(){\n\tif (key === \"r\"){\n\t\tfill(255, 0, 0);\n\t\tcolorPicked = 1;\n\t} else if (key === \"g\"){\n\t\tfill(0, 255, 0);\n\t\tcolorPicked = 2;\n\t} else if (key === \"b\"){\n\t\tfill (0, 0, 255);\n\t\tcolorPicked = 3;\n\t} else {\n\t\tfill(255);\n\t}\n\trect(width/15, height/15, width/10, width/10);\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n // The state of the picker.\n STATE = {\n id: Math.abs( ~~( Math.random() * 1e9 ) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, save original type, convert into text input\n // to remove UA stylings, and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == document.activeElement\n ELEMENT.type = 'text'\n ELEMENT.readOnly = true\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT( P, SETTINGS )\n\n\n // Create the picker root with a new wrapped holder and bind the events.\n P.$root = $( PickerConstructor._.node( 'div', createWrappedComponent(), CLASSES.picker ) ).on({\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // If the event is not on the root holder, stop it from bubbling to the doc.\n mousedown: function( event ) {\n if ( event.target != P.$root.children()[ 0 ] ) {\n event.stopPropagation()\n }\n },\n\n // When something within the root holder is clicked, handle the various event.\n click: function( event ) {\n\n var target = event.target,\n $target = target.attributes.length ? $( target ) : $( target ).closest( '[data-pick]' ),\n targetData = $target.data()\n\n // If the event is not on the root holder itself, handle the clicks within.\n if ( target != P.$root.children()[ 0 ] ) {\n\n // Stop it from propagating to the doc.\n event.stopPropagation()\n\n // If nothing inside is actively focused, re-focus the element.\n if ( !$.contains( P.$root[0], document.activeElement ) ) {\n ELEMENT.focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( targetData.nav && !$target.hasClass( CLASSES.navDisabled ) ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( PickerConstructor._.isInteger( targetData.pick ) && !$target.hasClass( CLASSES.disabled ) ) {\n P.set( 'select', targetData.pick ).close( true )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n }\n }\n }) //P.$root\n\n\n // If there’s a format for the hidden input element, create the element\n // using the name of the original input plus suffix. Otherwise set it to undefined.\n // If the element has a value, use either the `data-value` or `value`.\n if ( SETTINGS.formatSubmit ) {\n P._hidden = $( '<input type=hidden name=\"' + ELEMENT.name + ( SETTINGS.hiddenSuffix || '_submit' ) + '\"' + ( $ELEMENT.data( 'value' ) ? ' value=\"' + PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) + '\"' : '' ) + '>' )[ 0 ]\n }\n\n\n // Add the class and bind the events on the element.\n $ELEMENT.addClass( CLASSES.input ).\n\n // On focus/click, open the picker and adjust the root “focused” state.\n on( 'focus.P' + STATE.id + ' click.P' + STATE.id, focusToOpen ).\n\n // If the value changes, update the hidden input with the correct format.\n on( 'change.P' + STATE.id, function() {\n if ( P._hidden ) {\n P._hidden.value = ELEMENT.value ? PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) : ''\n }\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.P' + STATE.id, function( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test( keycode )\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[ keycode ] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data( 'value' ) ? PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.format, P.component.item.select ] ) : ELEMENT.value ).\n\n // Insert the hidden input after the element.\n after( P._hidden ).\n\n // Store the picker data by component name.\n data( NAME, P )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, unbind the events, and remove the stored data.\n $ELEMENT.removeClass( CLASSES.input ).off( '.P' + STATE.id ).removeData( NAME )\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /*\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Pass focus to the element’s jQuery object.\n $ELEMENT.focus()\n\n // Bind the document events.\n $document.on( 'click.P' + STATE.id + ' focusin.P' + STATE.id, function( event ) {\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n if ( event.target != ELEMENT && event.target != document ) P.close()\n\n }).on( 'keydown.P' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == ELEMENT && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ keycodeToMove ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n $ELEMENT.off( 'focus.P' + STATE.id ).focus()\n setTimeout( function() {\n $ELEMENT.on( 'focus.P' + STATE.id, focusToOpen )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n\n // If it’s open, update the state.\n if ( STATE.open ) {\n\n // Set it as closed.\n STATE.open = false\n\n // Unbind the document events.\n $document.off( '.P' + STATE.id )\n }\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function() {\n return P.set( 'clear' )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = PickerConstructor._.isObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( P.component.item[ thingItem ] ) {\n P.component.set( thingItem, thingValue, options || {} )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.val( thingItem == 'clear' ? '' :\n PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.format, P.component.get( thingItem ) ] )\n ).trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // Trigger queued “set” events and pass the `thingObject`.\n return P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( P.component.item[ thing ] ) {\n if ( typeof format == 'string' ) {\n return PickerConstructor._.trigger( P.component.formats.toString, P.component, [ format, P.component.get( thing ) ] )\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method ) {\n\n var thingName, thingMethod,\n thingIsObject = PickerConstructor._.isObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n // Separated for IE\n function focusToOpen( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function PriceColorPicker() {\n\tthis.colorCache={};\n\tthis.get = function(x, xmin, xmax, xmu) {\n\t\tif (x in this.colorCache) return this.colorCache[x];\n\t\tif (xmax==xmin) return array2color(CMU);\n\t\tif (x>=xmax) return array2color(CMAX);\n\t\tif (x<=xmin) return array2color(CMIN);\n\t\tif (typeof xmu == \"undefined\") xmu = (xmin+xmax)/2;\t// media aritmética\n\t\tvar cmin=CMIN,cmax=CMAX;\n\t\tif (x<xmu) {xmax=xmu;cmax=CMU}\n\t\telse {xmin=xmu;cmin=CMU};\n\t\tvar rgb = [];\n\t\tfor (var c=0; c<3; c++) {\n\t\t\tvar val = cmin[c] + (x-xmin) * (cmax[c]-cmin[c]) / (xmax-xmin);\n\t\t\trgb[c] = (val<0) ? 0 : Math.round(Math.min(255,val));\n\t\t}\n\t\tvar color = array2color(rgb);\n\t\tthis.colorCache[x] = color;\n\t\treturn color;\n\t}\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n // The state of the picker.\n STATE = {\n id: Math.abs( ~~( Math.random() * 1e9 ) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == document.activeElement\n ELEMENT.type = 'text'\n ELEMENT.readOnly = true\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT( P, SETTINGS )\n\n\n // Create the picker root with a new wrapped holder and bind the events.\n P.$root = $( PickerConstructor._.node( 'div', createWrappedComponent(), CLASSES.picker ) ).\n on({\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // If the click is not on the root holder, stop it from bubbling to the doc.\n 'mousedown click': function( event ) {\n if ( event.target != P.$root.children()[ 0 ] ) {\n event.stopPropagation()\n }\n }\n }).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = document.activeElement\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || !$.contains( P.$root[0], activeElement ) ) {\n ELEMENT.focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( targetData.nav && !targetDisabled ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( PickerConstructor._.isInteger( targetData.pick ) && !targetDisabled ) {\n P.set( 'select', targetData.pick ).close( true )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n }) //P.$root\n\n\n // If there’s a format for the hidden input element, create the element\n // using the name of the original input plus suffix. Otherwise set it to undefined.\n // If the element has a value, use either the `data-value` or `value`.\n if ( SETTINGS.formatSubmit ) {\n P._hidden = $( '<input type=hidden name=\"' + ELEMENT.name + ( SETTINGS.hiddenSuffix || '_submit' ) + '\"' + ( $ELEMENT.data( 'value' ) ? ' value=\"' + PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) + '\"' : '' ) + '>' )[ 0 ]\n }\n\n\n // Add the class and bind the events on the element.\n $ELEMENT.addClass( CLASSES.input ).\n\n // On focus/click, open the picker and adjust the root “focused” state.\n on( 'focus.P' + STATE.id + ' click.P' + STATE.id, focusToOpen ).\n\n // If the value changes, update the hidden input with the correct format.\n on( 'change.P' + STATE.id, function() {\n if ( P._hidden ) {\n P._hidden.value = ELEMENT.value ? PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) : ''\n }\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.P' + STATE.id, function( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test( keycode )\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[ keycode ] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data( 'value' ) ? PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.format, P.component.item.select ] ) : ELEMENT.value ).\n\n // Insert the hidden input after the element.\n after( P._hidden ).\n\n // Store the picker data by component name.\n data( NAME, P )\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, unbind the events, and remove the stored data.\n $ELEMENT.removeClass( CLASSES.input ).off( '.P' + STATE.id ).removeData( NAME )\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /*\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Pass focus to the element’s jQuery object.\n $ELEMENT.focus()\n\n // Bind the document events.\n $document.on( 'click.P' + STATE.id + ' focusin.P' + STATE.id, function( event ) {\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n if ( event.target != ELEMENT && event.target != document ) P.close()\n\n }).on( 'keydown.P' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == ELEMENT && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ keycodeToMove ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n $ELEMENT.off( 'focus.P' + STATE.id ).focus()\n setTimeout( function() {\n $ELEMENT.on( 'focus.P' + STATE.id, focusToOpen )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n\n // If it’s open, update the state.\n if ( STATE.open ) {\n\n // Set it as closed.\n STATE.open = false\n\n // Unbind the document events.\n $document.off( '.P' + STATE.id )\n }\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function() {\n return P.set( 'clear' )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = PickerConstructor._.isObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( P.component.item[ thingItem ] ) {\n P.component.set( thingItem, thingValue, options || {} )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.val( thingItem == 'clear' ? '' :\n PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.format, P.component.get( thingItem ) ] )\n ).trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // Trigger queued “set” events and pass the `thingObject`.\n return P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( P.component.item[ thing ] ) {\n if ( typeof format == 'string' ) {\n return PickerConstructor._.trigger( P.component.formats.toString, P.component, [ format, P.component.get( thing ) ] )\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method ) {\n\n var thingName, thingMethod,\n thingIsObject = PickerConstructor._.isObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n // Separated for IE\n function focusToOpen( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) P.$root.addClass( CLASSES.focused )\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n}", "function colorSlider() {\n seek_slider.oninput = function() {\n\n var value = (this.value-this.min)/(this.max-this.min)*100;\n this.style.background = 'linear-gradient(to right, #fff 0%, #fff ' + value + '%, rgb(156, 152, 152) ' + value + '%, rgb(156, 152, 152) 100%)';\n };\n \n \n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\t\n\t // If there’s no element, return the picker constructor.\n\t if ( !ELEMENT ) return PickerConstructor\n\t\n\t\n\t var\n\t IS_DEFAULT_THEME = false,\n\t\n\t\n\t // The state of the picker.\n\t STATE = {\n\t id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n\t },\n\t\n\t\n\t // Merge the defaults and options passed.\n\t SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\t\n\t\n\t // Merge the default classes with the settings classes.\n\t CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\t\n\t\n\t // The element node wrapper into a jQuery object.\n\t $ELEMENT = $( ELEMENT ),\n\t\n\t\n\t // Pseudo picker constructor.\n\t PickerInstance = function() {\n\t return this.start()\n\t },\n\t\n\t\n\t // The picker prototype.\n\t P = PickerInstance.prototype = {\n\t\n\t constructor: PickerInstance,\n\t\n\t $node: $ELEMENT,\n\t\n\t\n\t /**\n\t * Initialize everything\n\t */\n\t start: function() {\n\t\n\t // If it’s already started, do nothing.\n\t if ( STATE && STATE.start ) return P\n\t\n\t\n\t // Update the picker states.\n\t STATE.methods = {}\n\t STATE.start = true\n\t STATE.open = false\n\t STATE.type = ELEMENT.type\n\t\n\t\n\t // Confirm focus state, convert into text input to remove UA stylings,\n\t // and set as readonly to prevent keyboard popup.\n\t ELEMENT.autofocus = ELEMENT == getActiveElement()\n\t ELEMENT.readOnly = !SETTINGS.editable\n\t ELEMENT.id = ELEMENT.id || STATE.id\n\t if ( ELEMENT.type != 'text' ) {\n\t ELEMENT.type = 'text'\n\t }\n\t\n\t\n\t // Create a new picker component with the settings.\n\t P.component = new COMPONENT(P, SETTINGS)\n\t\n\t\n\t // Create the picker root with a holder and then prepare it.\n\t P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n\t prepareElementRoot()\n\t\n\t\n\t // If there’s a format for the hidden input element, create the element.\n\t if ( SETTINGS.formatSubmit ) {\n\t prepareElementHidden()\n\t }\n\t\n\t\n\t // Prepare the input element.\n\t prepareElement()\n\t\n\t\n\t // Insert the root as specified in the settings.\n\t if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n\t else $ELEMENT.after( P.$root )\n\t\n\t\n\t // Bind the default component and settings events.\n\t P.on({\n\t start: P.component.onStart,\n\t render: P.component.onRender,\n\t stop: P.component.onStop,\n\t open: P.component.onOpen,\n\t close: P.component.onClose,\n\t set: P.component.onSet\n\t }).on({\n\t start: SETTINGS.onStart,\n\t render: SETTINGS.onRender,\n\t stop: SETTINGS.onStop,\n\t open: SETTINGS.onOpen,\n\t close: SETTINGS.onClose,\n\t set: SETTINGS.onSet\n\t })\n\t\n\t\n\t // Once we’re all set, check the theme in use.\n\t IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\t\n\t\n\t // If the element has autofocus, open the picker.\n\t if ( ELEMENT.autofocus ) {\n\t P.open()\n\t }\n\t\n\t\n\t // Trigger queued the “start” and “render” events.\n\t return P.trigger( 'start' ).trigger( 'render' )\n\t }, //start\n\t\n\t\n\t /**\n\t * Render a new picker\n\t */\n\t render: function( entireComponent ) {\n\t\n\t // Insert a new component holder in the root or box.\n\t if ( entireComponent ) P.$root.html( createWrappedComponent() )\n\t else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\t\n\t // Trigger the queued “render” events.\n\t return P.trigger( 'render' )\n\t }, //render\n\t\n\t\n\t /**\n\t * Destroy everything\n\t */\n\t stop: function() {\n\t\n\t // If it’s already stopped, do nothing.\n\t if ( !STATE.start ) return P\n\t\n\t // Then close the picker.\n\t P.close()\n\t\n\t // Remove the hidden field.\n\t if ( P._hidden ) {\n\t P._hidden.parentNode.removeChild( P._hidden )\n\t }\n\t\n\t // Remove the root.\n\t P.$root.remove()\n\t\n\t // Remove the input class, remove the stored data, and unbind\n\t // the events (after a tick for IE - see `P.close`).\n\t $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n\t setTimeout( function() {\n\t $ELEMENT.off( '.' + STATE.id )\n\t }, 0)\n\t\n\t // Restore the element state\n\t ELEMENT.type = STATE.type\n\t ELEMENT.readOnly = false\n\t\n\t // Trigger the queued “stop” events.\n\t P.trigger( 'stop' )\n\t\n\t // Reset the picker states.\n\t STATE.methods = {}\n\t STATE.start = false\n\t\n\t return P\n\t }, //stop\n\t\n\t\n\t /**\n\t * Open up the picker\n\t */\n\t open: function( dontGiveFocus ) {\n\t\n\t // If it’s already open, do nothing.\n\t if ( STATE.open ) return P\n\t\n\t // Add the “active” class.\n\t $ELEMENT.addClass( CLASSES.active )\n\t aria( ELEMENT, 'expanded', true )\n\t\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So add the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout( function() {\n\t\n\t // Add the “opened” class to the picker root.\n\t P.$root.addClass( CLASSES.opened )\n\t aria( P.$root[0], 'hidden', false )\n\t\n\t }, 0 )\n\t\n\t // If we have to give focus, bind the element and doc events.\n\t if ( dontGiveFocus !== false ) {\n\t\n\t // Set it as open.\n\t STATE.open = true\n\t\n\t // Prevent the page from scrolling.\n\t if ( IS_DEFAULT_THEME ) {\n\t $html.\n\t css( 'overflow', 'hidden' ).\n\t css( 'padding-right', '+=' + getScrollbarWidth() )\n\t }\n\t\n\t // Pass focus to the root element’s jQuery object.\n\t // * Workaround for iOS8 to bring the picker’s root into view.\n\t P.$root.eq(0).focus()\n\t\n\t // Bind the document events.\n\t $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\t\n\t var target = event.target\n\t\n\t // If the target of the event is not the element, close the picker picker.\n\t // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n\t // Also, for Firefox, a click on an `option` element bubbles up directly\n\t // to the doc. So make sure the target wasn't the doc.\n\t // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n\t // which causes the picker to unexpectedly close when right-clicking it. So make\n\t // sure the event wasn’t a right-click.\n\t if ( target != ELEMENT && target != document && event.which != 3 ) {\n\t\n\t // If the target was the holder that covers the screen,\n\t // keep the element focused to maintain tabindex.\n\t P.close( target === P.$root.children()[0] )\n\t }\n\t\n\t }).on( 'keydown.' + STATE.id, function( event ) {\n\t\n\t var\n\t // Get the keycode.\n\t keycode = event.keyCode,\n\t\n\t // Translate that to a selection change.\n\t keycodeToMove = P.component.key[ keycode ],\n\t\n\t // Grab the target.\n\t target = event.target\n\t\n\t\n\t // On escape, close the picker and give focus.\n\t if ( keycode == 27 ) {\n\t P.close( true )\n\t }\n\t\n\t\n\t // Check if there is a key movement or “enter” keypress on the element.\n\t else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\t\n\t // Prevent the default action to stop page movement.\n\t event.preventDefault()\n\t\n\t // Trigger the key movement action.\n\t if ( keycodeToMove ) {\n\t PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n\t }\n\t\n\t // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n\t else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n\t P.set( 'select', P.component.item.highlight ).close()\n\t }\n\t }\n\t\n\t\n\t // If the target is within the root and “enter” is pressed,\n\t // prevent the default action and trigger a click on the target instead.\n\t else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n\t event.preventDefault()\n\t target.click()\n\t }\n\t })\n\t }\n\t\n\t // Trigger the queued “open” events.\n\t return P.trigger( 'open' )\n\t }, //open\n\t\n\t\n\t /**\n\t * Close the picker\n\t */\n\t close: function( giveFocus ) {\n\t\n\t // If we need to give focus, do it before changing states.\n\t if ( giveFocus ) {\n\t // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n\t // The focus is triggered *after* the close has completed - causing it\n\t // to open again. So unbind and rebind the event at the next tick.\n\t P.$root.off( 'focus.toOpen' ).eq(0).focus()\n\t setTimeout( function() {\n\t P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n\t }, 0 )\n\t }\n\t\n\t // Remove the “active” class.\n\t $ELEMENT.removeClass( CLASSES.active )\n\t aria( ELEMENT, 'expanded', false )\n\t\n\t // * A Firefox bug, when `html` has `overflow:hidden`, results in\n\t // killing transitions :(. So remove the “opened” state on the next tick.\n\t // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n\t setTimeout( function() {\n\t\n\t // Remove the “opened” and “focused” class from the picker root.\n\t P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n\t aria( P.$root[0], 'hidden', true )\n\t\n\t }, 0 )\n\t\n\t // If it’s already closed, do nothing more.\n\t if ( !STATE.open ) return P\n\t\n\t // Set it as closed.\n\t STATE.open = false\n\t\n\t // Allow the page to scroll.\n\t if ( IS_DEFAULT_THEME ) {\n\t $html.\n\t css( 'overflow', '' ).\n\t css( 'padding-right', '-=' + getScrollbarWidth() )\n\t }\n\t\n\t // Unbind the document events.\n\t $document.off( '.' + STATE.id )\n\t\n\t // Trigger the queued “close” events.\n\t return P.trigger( 'close' )\n\t }, //close\n\t\n\t\n\t /**\n\t * Clear the values\n\t */\n\t clear: function( options ) {\n\t return P.set( 'clear', null, options )\n\t }, //clear\n\t\n\t\n\t /**\n\t * Set something\n\t */\n\t set: function( thing, value, options ) {\n\t\n\t var thingItem, thingValue,\n\t thingIsObject = $.isPlainObject( thing ),\n\t thingObject = thingIsObject ? thing : {}\n\t\n\t // Make sure we have usable options.\n\t options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\t\n\t if ( thing ) {\n\t\n\t // If the thing isn’t an object, make it one.\n\t if ( !thingIsObject ) {\n\t thingObject[ thing ] = value\n\t }\n\t\n\t // Go through the things of items to set.\n\t for ( thingItem in thingObject ) {\n\t\n\t // Grab the value of the thing.\n\t thingValue = thingObject[ thingItem ]\n\t\n\t // First, if the item exists and there’s a value, set it.\n\t if ( thingItem in P.component.item ) {\n\t if ( thingValue === undefined ) thingValue = null\n\t P.component.set( thingItem, thingValue, options )\n\t }\n\t\n\t // Then, check to update the element value and broadcast a change.\n\t if ( thingItem == 'select' || thingItem == 'clear' ) {\n\t $ELEMENT.\n\t val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n\t trigger( 'change' )\n\t }\n\t }\n\t\n\t // Render a new picker.\n\t P.render()\n\t }\n\t\n\t // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n\t return options.muted ? P : P.trigger( 'set', thingObject )\n\t }, //set\n\t\n\t\n\t /**\n\t * Get something\n\t */\n\t get: function( thing, format ) {\n\t\n\t // Make sure there’s something to get.\n\t thing = thing || 'value'\n\t\n\t // If a picker state exists, return that.\n\t if ( STATE[ thing ] != null ) {\n\t return STATE[ thing ]\n\t }\n\t\n\t // Return the submission value, if that.\n\t if ( thing == 'valueSubmit' ) {\n\t if ( P._hidden ) {\n\t return P._hidden.value\n\t }\n\t thing = 'value'\n\t }\n\t\n\t // Return the value, if that.\n\t if ( thing == 'value' ) {\n\t return ELEMENT.value\n\t }\n\t\n\t // Check if a component item exists, return that.\n\t if ( thing in P.component.item ) {\n\t if ( typeof format == 'string' ) {\n\t var thingValue = P.component.get( thing )\n\t return thingValue ?\n\t PickerConstructor._.trigger(\n\t P.component.formats.toString,\n\t P.component,\n\t [ format, thingValue ]\n\t ) : ''\n\t }\n\t return P.component.get( thing )\n\t }\n\t }, //get\n\t\n\t\n\t\n\t /**\n\t * Bind events on the things.\n\t */\n\t on: function( thing, method, internal ) {\n\t\n\t var thingName, thingMethod,\n\t thingIsObject = $.isPlainObject( thing ),\n\t thingObject = thingIsObject ? thing : {}\n\t\n\t if ( thing ) {\n\t\n\t // If the thing isn’t an object, make it one.\n\t if ( !thingIsObject ) {\n\t thingObject[ thing ] = method\n\t }\n\t\n\t // Go through the things to bind to.\n\t for ( thingName in thingObject ) {\n\t\n\t // Grab the method of the thing.\n\t thingMethod = thingObject[ thingName ]\n\t\n\t // If it was an internal binding, prefix it.\n\t if ( internal ) {\n\t thingName = '_' + thingName\n\t }\n\t\n\t // Make sure the thing methods collection exists.\n\t STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\t\n\t // Add the method to the relative method collection.\n\t STATE.methods[ thingName ].push( thingMethod )\n\t }\n\t }\n\t\n\t return P\n\t }, //on\n\t\n\t\n\t\n\t /**\n\t * Unbind events on the things.\n\t */\n\t off: function() {\n\t var i, thingName,\n\t names = arguments;\n\t for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n\t thingName = names[i]\n\t if ( thingName in STATE.methods ) {\n\t delete STATE.methods[thingName]\n\t }\n\t }\n\t return P\n\t },\n\t\n\t\n\t /**\n\t * Fire off method events.\n\t */\n\t trigger: function( name, data ) {\n\t var _trigger = function( name ) {\n\t var methodList = STATE.methods[ name ]\n\t if ( methodList ) {\n\t methodList.map( function( method ) {\n\t PickerConstructor._.trigger( method, P, [ data ] )\n\t })\n\t }\n\t }\n\t _trigger( '_' + name )\n\t _trigger( name )\n\t return P\n\t } //trigger\n\t } //PickerInstance.prototype\n\t\n\t\n\t /**\n\t * Wrap the picker holder components together.\n\t */\n\t function createWrappedComponent() {\n\t\n\t // Create a picker wrapper holder\n\t return PickerConstructor._.node( 'div',\n\t\n\t // Create a picker wrapper node\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create a picker frame\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create a picker box node\n\t PickerConstructor._.node( 'div',\n\t\n\t // Create the components nodes.\n\t P.component.nodes( STATE.open ),\n\t\n\t // The picker box class\n\t CLASSES.box\n\t ),\n\t\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\t\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\t\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t } //createWrappedComponent\n\t\n\t\n\t\n\t /**\n\t * Prepare the input element with all bindings.\n\t */\n\t function prepareElement() {\n\t\n\t $ELEMENT.\n\t\n\t // Store the picker data by component name.\n\t data(NAME, P).\n\t\n\t // Add the “input” class name.\n\t addClass(CLASSES.input).\n\t\n\t // Remove the tabindex.\n\t attr('tabindex', -1).\n\t\n\t // If there’s a `data-value`, update the value of the element.\n\t val( $ELEMENT.data('value') ?\n\t P.get('select', SETTINGS.format) :\n\t ELEMENT.value\n\t )\n\t\n\t\n\t // Only bind keydown events if the element isn’t editable.\n\t if ( !SETTINGS.editable ) {\n\t\n\t $ELEMENT.\n\t\n\t // On focus/click, focus onto the root to open it up.\n\t on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n\t event.preventDefault()\n\t P.$root.eq(0).focus()\n\t }).\n\t\n\t // Handle keyboard event based on the picker being opened or not.\n\t on( 'keydown.' + STATE.id, handleKeydownEvent )\n\t }\n\t\n\t\n\t // Update the aria attributes.\n\t aria(ELEMENT, {\n\t haspopup: true,\n\t expanded: false,\n\t readonly: false,\n\t owns: ELEMENT.id + '_root'\n\t })\n\t }\n\t\n\t\n\t /**\n\t * Prepare the root picker element with all bindings.\n\t */\n\t function prepareElementRoot() {\n\t\n\t P.$root.\n\t\n\t on({\n\t\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\n\t\n\t // When something within the root is focused, stop from bubbling\n\t // to the doc and remove the “focused” state from the root.\n\t focusin: function( event ) {\n\t P.$root.removeClass( CLASSES.focused )\n\t event.stopPropagation()\n\t },\n\t\n\t // When something within the root holder is clicked, stop it\n\t // from bubbling to the doc.\n\t 'mousedown click': function( event ) {\n\t\n\t var target = event.target\n\t\n\t // Make sure the target isn’t the root holder so it can bubble up.\n\t if ( target != P.$root.children()[ 0 ] ) {\n\t\n\t event.stopPropagation()\n\t\n\t // * For mousedown events, cancel the default action in order to\n\t // prevent cases where focus is shifted onto external elements\n\t // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t // Also, for Firefox, don’t prevent action on the `option` element.\n\t if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\t\n\t event.preventDefault()\n\t\n\t // Re-focus onto the root so that users can click away\n\t // from elements focused within the picker.\n\t P.$root.eq(0).focus()\n\t }\n\t }\n\t }\n\t }).\n\t\n\t // Add/remove the “target” class on focus and blur.\n\t on({\n\t focus: function() {\n\t $ELEMENT.addClass( CLASSES.target )\n\t },\n\t blur: function() {\n\t $ELEMENT.removeClass( CLASSES.target )\n\t }\n\t }).\n\t\n\t // Open the picker and adjust the root “focused” state\n\t on( 'focus.toOpen', handleFocusToOpenEvent ).\n\t\n\t // If there’s a click on an actionable element, carry out the actions.\n\t on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\t\n\t var $target = $( this ),\n\t targetData = $target.data(),\n\t targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\t\n\t // * For IE, non-focusable elements can be active elements as well\n\t // (http://stackoverflow.com/a/2684561).\n\t activeElement = getActiveElement()\n\t activeElement = activeElement && ( activeElement.type || activeElement.href )\n\t\n\t // If it’s disabled or nothing inside is actively focused, re-focus the element.\n\t if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n\t P.$root.eq(0).focus()\n\t }\n\t\n\t // If something is superficially changed, update the `highlight` based on the `nav`.\n\t if ( !targetDisabled && targetData.nav ) {\n\t P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n\t }\n\t\n\t // If something is picked, set `select` then close with focus.\n\t else if ( !targetDisabled && 'pick' in targetData ) {\n\t P.set( 'select', targetData.pick )\n\t }\n\t\n\t // If a “clear” button is pressed, empty the values and close with focus.\n\t else if ( targetData.clear ) {\n\t P.clear().close( true )\n\t }\n\t\n\t else if ( targetData.close ) {\n\t P.close( true )\n\t }\n\t\n\t }) //P.$root\n\t\n\t aria( P.$root[0], 'hidden', true )\n\t }\n\t\n\t\n\t /**\n\t * Prepare the hidden input element along with all bindings.\n\t */\n\t function prepareElementHidden() {\n\t\n\t var name\n\t\n\t if ( SETTINGS.hiddenName === true ) {\n\t name = ELEMENT.name\n\t ELEMENT.name = ''\n\t }\n\t else {\n\t name = [\n\t typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n\t typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n\t ]\n\t name = name[0] + ELEMENT.name + name[1]\n\t }\n\t\n\t P._hidden = $(\n\t '<input ' +\n\t 'type=hidden ' +\n\t\n\t // Create the name using the original input’s with a prefix and suffix.\n\t 'name=\"' + name + '\"' +\n\t\n\t // If the element has a value, set the hidden value as well.\n\t (\n\t $ELEMENT.data('value') || ELEMENT.value ?\n\t ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n\t ''\n\t ) +\n\t '>'\n\t )[0]\n\t\n\t $ELEMENT.\n\t\n\t // If the value changes, update the hidden input with the correct format.\n\t on('change.' + STATE.id, function() {\n\t P._hidden.value = ELEMENT.value ?\n\t P.get('select', SETTINGS.formatSubmit) :\n\t ''\n\t })\n\t\n\t\n\t // Insert the hidden input as specified in the settings.\n\t if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n\t else $ELEMENT.after( P._hidden )\n\t }\n\t\n\t\n\t // For iOS8.\n\t function handleKeydownEvent( event ) {\n\t\n\t var keycode = event.keyCode,\n\t\n\t // Check if one of the delete keys was pressed.\n\t isKeycodeDelete = /^(8|46)$/.test(keycode)\n\t\n\t // For some reason IE clears the input value on “escape”.\n\t if ( keycode == 27 ) {\n\t P.close()\n\t return false\n\t }\n\t\n\t // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n\t if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\t\n\t // Prevent it from moving the page and bubbling to doc.\n\t event.preventDefault()\n\t event.stopPropagation()\n\t\n\t // If `delete` was pressed, clear the values and close the picker.\n\t // Otherwise open the picker.\n\t if ( isKeycodeDelete ) { P.clear().close() }\n\t else { P.open() }\n\t }\n\t }\n\t\n\t\n\t // Separated for IE\n\t function handleFocusToOpenEvent( event ) {\n\t\n\t // Stop the event from propagating to the doc.\n\t event.stopPropagation()\n\t\n\t // If it’s a focus event, add the “focused” class to the root.\n\t if ( event.type == 'focus' ) {\n\t P.$root.addClass( CLASSES.focused )\n\t }\n\t\n\t // And then finally open the picker.\n\t P.open()\n\t }\n\t\n\t\n\t // Return a new picker instance.\n\t return new PickerInstance()\n\t}", "createGradient(x, y, w, h, colors) {\n let gradient = this.ctx.createLinearGradient(x, y, x+w, y+h);\n for(let i in colors) {\n gradient.addColorStop(i/colors.length, colors[i]);\n }\n return gradient;\n }", "function Picker( ){}", "static fromObject(obj, cssGradient) {\n return new GradientSwatchRGB(obj.r, obj.g, obj.b, cssGradient);\n }", "function updateFromControl(input, target) {\n\t\t\n\t\tfunction getCoords(picker, container) {\n\t\t\t\n\t\t\tvar left, top;\n\t\t\tif( !picker.length || !container ) return null;\n\t\t\tleft = picker.offset().left;\n\t\t\ttop = picker.offset().top;\n\t\t\t\n\t\t\treturn {\n\t\t\t\tx: left - container.offset().left + (picker.outerWidth() / 2),\n\t\t\t\ty: top - container.offset().top + (picker.outerHeight() / 2)\n\t\t\t};\n\t\t\t\n\t\t}\n\t\t\n\t\tvar hue, saturation, brightness, x, y, r, phi,\n\t\t\t\n\t\t\thex = input.val(),\n\t\t\topacity = input.attr('data-opacity'),\n\t\t\t\n\t\t\t// Helpful references\n\t\t\tminicolors = input.parent(),\n\t\t\tsettings = input.data('minicolors-settings'),\n\t\t\tswatch = minicolors.find('.minicolors-swatch'),\n\t\t\t\n\t\t\t// Panel objects\n\t\t\tgrid = minicolors.find('.minicolors-grid'),\n\t\t\tslider = minicolors.find('.minicolors-slider'),\n\t\t\topacitySlider = minicolors.find('.minicolors-opacity-slider'),\n\t\t\t\n\t\t\t// Picker objects\n\t\t\tgridPicker = grid.find('[class$=-picker]'),\n\t\t\tsliderPicker = slider.find('[class$=-picker]'),\n\t\t\topacityPicker = opacitySlider.find('[class$=-picker]'),\n\t\t\t\n\t\t\t// Picker positions\n\t\t\tgridPos = getCoords(gridPicker, grid),\n\t\t\tsliderPos = getCoords(sliderPicker, slider),\n\t\t\topacityPos = getCoords(opacityPicker, opacitySlider);\n\t\t\n\t\t// Handle colors\n\t\tif( target.is('.minicolors-grid, .minicolors-slider') ) {\n\t\t\t\n\t\t\t// Determine HSB values\n\t\t\tswitch(settings.control) {\n\t\t\t\t\n\t\t\t\tcase 'wheel':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\tx = (grid.width() / 2) - gridPos.x;\n\t\t\t\t\ty = (grid.height() / 2) - gridPos.y;\n\t\t\t\t\tr = Math.sqrt(x * x + y * y);\n\t\t\t\t\tphi = Math.atan2(y, x);\n\t\t\t\t\tif( phi < 0 ) phi += Math.PI * 2;\n\t\t\t\t\tif( r > 75 ) {\n\t\t\t\t\t\tr = 75;\n\t\t\t\t\t\tgridPos.x = 69 - (75 * Math.cos(phi));\n\t\t\t\t\t\tgridPos.y = 69 - (75 * Math.sin(phi));\n\t\t\t\t\t}\n\t\t\t\t\tsaturation = keepWithin(r / 0.75, 0, 100);\n\t\t\t\t\thue = keepWithin(phi * 180 / Math.PI, 0, 360);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'saturation':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'brightness':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Update UI\n\t\t\t\t\tgrid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t// Adjust case\n\t\t\tinput.val( convertCase(hex, settings.letterCase) );\n\t\t\t\n\t\t}\n\t\t\n\t\t// Handle opacity\n\t\tif( target.is('.minicolors-opacity-slider') ) {\n\t\t\tif( settings.opacity ) {\n\t\t\t\topacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\n\t\t\t} else {\n\t\t\t\topacity = 1;\n\t\t\t}\n\t\t\tif( settings.opacity ) input.attr('data-opacity', opacity);\n\t\t}\n\t\t\n\t\t// Set swatch color\n\t\tswatch.find('SPAN').css({\n\t\t\tbackgroundColor: hex,\n\t\t\topacity: opacity\n\t\t});\n\t\t\n\t\t// Handle change event\n\t\tdoChange(input, hex, opacity);\n\t\t\n\t}", "function updateFromControl(input, target) {\n\n\t\tfunction getCoords(picker, container) {\n\n\t\t\tvar left, top;\n\t\t\tif( !picker.length || !container ) return null;\n\t\t\tleft = picker.offset().left;\n\t\t\ttop = picker.offset().top;\n\n\t\t\treturn {\n\t\t\t\tx: left - container.offset().left + (picker.outerWidth() / 2),\n\t\t\t\ty: top - container.offset().top + (picker.outerHeight() / 2)\n\t\t\t};\n\n\t\t}\n\n\t\tvar hue, saturation, brightness, x, y, r, phi,\n\n\t\t\thex = input.val(),\n\t\t\topacity = input.attr('data-opacity'),\n\n\t\t\t// Helpful references\n\t\t\tminicolors = input.parent(),\n\t\t\tsettings = input.data('minicolors-settings'),\n\t\t\tswatch = minicolors.find('.minicolors-swatch'),\n\n\t\t\t// Panel objects\n\t\t\tgrid = minicolors.find('.minicolors-grid'),\n\t\t\tslider = minicolors.find('.minicolors-slider'),\n\t\t\topacitySlider = minicolors.find('.minicolors-opacity-slider'),\n\n\t\t\t// Picker objects\n\t\t\tgridPicker = grid.find('[class$=-picker]'),\n\t\t\tsliderPicker = slider.find('[class$=-picker]'),\n\t\t\topacityPicker = opacitySlider.find('[class$=-picker]'),\n\n\t\t\t// Picker positions\n\t\t\tgridPos = getCoords(gridPicker, grid),\n\t\t\tsliderPos = getCoords(sliderPicker, slider),\n\t\t\topacityPos = getCoords(opacityPicker, opacitySlider);\n\n\t\t// Handle colors\n\t\tif( target.is('.minicolors-grid, .minicolors-slider') ) {\n\n\t\t\t// Determine HSB values\n\t\t\tswitch(settings.control) {\n\n\t\t\t\tcase 'wheel':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\tx = (grid.width() / 2) - gridPos.x;\n\t\t\t\t\ty = (grid.height() / 2) - gridPos.y;\n\t\t\t\t\tr = Math.sqrt(x * x + y * y);\n\t\t\t\t\tphi = Math.atan2(y, x);\n\t\t\t\t\tif( phi < 0 ) phi += Math.PI * 2;\n\t\t\t\t\tif( r > 75 ) {\n\t\t\t\t\t\tr = 75;\n\t\t\t\t\t\tgridPos.x = 69 - (75 * Math.cos(phi));\n\t\t\t\t\t\tgridPos.y = 69 - (75 * Math.sin(phi));\n\t\t\t\t\t}\n\t\t\t\t\tsaturation = keepWithin(r / 0.75, 0, 100);\n\t\t\t\t\thue = keepWithin(phi * 180 / Math.PI, 0, 360);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'saturation':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'brightness':\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// Calculate hue, saturation, and brightness\n\t\t\t\t\thue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);\n\t\t\t\t\tsaturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\n\t\t\t\t\thex = hsb2hex({\n\t\t\t\t\t\th: hue,\n\t\t\t\t\t\ts: saturation,\n\t\t\t\t\t\tb: brightness\n\t\t\t\t\t});\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tgrid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t// Adjust case\n\t\t\tinput.val( convertCase(hex, settings.letterCase) );\n\n\t\t}\n\n\t\t// Handle opacity\n\t\tif( target.is('.minicolors-opacity-slider') ) {\n\t\t\tif( settings.opacity ) {\n\t\t\t\topacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\n\t\t\t} else {\n\t\t\t\topacity = 1;\n\t\t\t}\n\t\t\tif( settings.opacity ) input.attr('data-opacity', opacity);\n\t\t}\n\n\t\t// Set swatch color\n\t\tswatch.find('SPAN').css({\n\t\t\tbackgroundColor: hex,\n\t\t\topacity: opacity\n\t\t});\n\n\t\t// Handle change event\n\t\tdoChange(input, hex, opacity);\n\n\t}", "function updateFromControl(input, target) {\r\n\t\t\r\n\t\tfunction getCoords(picker, container) {\r\n\t\t\t\r\n\t\t\tvar left, top;\r\n\t\t\tif( !picker.length || !container ) return null;\r\n\t\t\tleft = picker.offset().left;\r\n\t\t\ttop = picker.offset().top;\r\n\t\t\t\r\n\t\t\treturn {\r\n\t\t\t\tx: left - container.offset().left + (picker.outerWidth() / 2),\r\n\t\t\t\ty: top - container.offset().top + (picker.outerHeight() / 2)\r\n\t\t\t};\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tvar hue, saturation, brightness, rgb, x, y, r, phi,\r\n\t\t\t\r\n\t\t\thex = input.val(),\r\n\t\t\topacity = input.attr('data-opacity'),\r\n\t\t\t\r\n\t\t\t// Helpful references\r\n\t\t\tminicolors = input.parent(),\r\n\t\t\tsettings = input.data('minicolors-settings'),\r\n\t\t\tpanel = minicolors.find('.minicolors-panel'),\r\n\t\t\tswatch = minicolors.find('.minicolors-swatch'),\r\n\t\t\t\r\n\t\t\t// Panel objects\r\n\t\t\tgrid = minicolors.find('.minicolors-grid'),\r\n\t\t\tslider = minicolors.find('.minicolors-slider'),\r\n\t\t\topacitySlider = minicolors.find('.minicolors-opacity-slider'),\r\n\t\t\t\r\n\t\t\t// Picker objects\r\n\t\t\tgridPicker = grid.find('[class$=-picker]'),\r\n\t\t\tsliderPicker = slider.find('[class$=-picker]'),\r\n\t\t\topacityPicker = opacitySlider.find('[class$=-picker]'),\r\n\t\t\t\r\n\t\t\t// Picker positions\r\n\t\t\tgridPos = getCoords(gridPicker, grid),\r\n\t\t\tsliderPos = getCoords(sliderPicker, slider),\r\n\t\t\topacityPos = getCoords(opacityPicker, opacitySlider);\r\n\t\t\r\n\t\t// Handle colors\r\n\t\tif( target.is('.minicolors-grid, .minicolors-slider') ) {\r\n\t\t\t\r\n\t\t\t// Determine HSB values\r\n\t\t\tswitch(settings.control) {\r\n\t\t\t\t\r\n\t\t\t\tcase 'wheel':\r\n\t\t\t\t\t// Calculate hue, saturation, and brightness\r\n\t\t\t\t\tx = (grid.width() / 2) - gridPos.x;\r\n\t\t\t\t\ty = (grid.height() / 2) - gridPos.y;\r\n\t\t\t\t\tr = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\tphi = Math.atan2(y, x);\r\n\t\t\t\t\tif( phi < 0 ) phi += Math.PI * 2;\r\n\t\t\t\t\tif( r > 75 ) {\r\n\t\t\t\t\t\tr = 75;\r\n\t\t\t\t\t\tgridPos.x = 69 - (75 * Math.cos(phi));\r\n\t\t\t\t\t\tgridPos.y = 69 - (75 * Math.sin(phi));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsaturation = keepWithin(r / 0.75, 0, 100);\r\n\t\t\t\t\thue = keepWithin(phi * 180 / Math.PI, 0, 360);\r\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n\t\t\t\t\thex = hsb2hex({\r\n\t\t\t\t\t\th: hue,\r\n\t\t\t\t\t\ts: saturation,\r\n\t\t\t\t\t\tb: brightness\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update UI\r\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'saturation':\r\n\t\t\t\t\t// Calculate hue, saturation, and brightness\r\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width())), 0, 360);\r\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n\t\t\t\t\thex = hsb2hex({\r\n\t\t\t\t\t\th: hue,\r\n\t\t\t\t\t\ts: saturation,\r\n\t\t\t\t\t\tb: brightness\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update UI\r\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));\r\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase 'brightness':\r\n\t\t\t\t\t// Calculate hue, saturation, and brightness\r\n\t\t\t\t\thue = keepWithin(parseInt(gridPos.x * (360 / grid.width())), 0, 360);\r\n\t\t\t\t\tsaturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);\r\n\t\t\t\t\thex = hsb2hex({\r\n\t\t\t\t\t\th: hue,\r\n\t\t\t\t\t\ts: saturation,\r\n\t\t\t\t\t\tb: brightness\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update UI\r\n\t\t\t\t\tslider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));\r\n\t\t\t\t\tminicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Calculate hue, saturation, and brightness\r\n\t\t\t\t\thue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height())), 0, 360);\r\n\t\t\t\t\tsaturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);\r\n\t\t\t\t\tbrightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);\r\n\t\t\t\t\thex = hsb2hex({\r\n\t\t\t\t\t\th: hue,\r\n\t\t\t\t\t\ts: saturation,\r\n\t\t\t\t\t\tb: brightness\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update UI\r\n\t\t\t\t\tgrid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t// Adjust case\r\n\t \tinput.val( convertCase(hex, settings.letterCase) );\r\n\t \t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle opacity\r\n\t\tif( target.is('.minicolors-opacity-slider') ) {\r\n\t\t\tif( settings.opacity ) {\r\n\t\t\t\topacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);\r\n\t\t\t} else {\r\n\t\t\t\topacity = 1;\r\n\t\t\t}\r\n\t\t\tif( settings.opacity ) input.attr('data-opacity', opacity);\r\n\t\t}\r\n\t\t\r\n\t\t// Set swatch color\r\n\t\tswatch.find('SPAN').css({\r\n\t\t\tbackgroundColor: hex,\r\n\t\t\topacity: opacity\r\n\t\t});\r\n\t\t\r\n\t\t// Handle change event\r\n\t\tdoChange(input, hex, opacity);\r\n\t\t\r\n\t}", "makeGradient(name, color1, color2, color3) {\n const gradient = this.defs.append('linearGradient')\n .attr('id', name)\n .attr('x1', '0%')\n .attr('x2', '100%')\n .attr('y1', '0%')\n .attr('y2', '100%');\n\n gradient.append('stop')\n .attr('offset', '0%')\n .attr('stop-color', color1);\n\n gradient.append('stop')\n .attr('offset', '50%')\n .attr('stop-color', color2);\n\n gradient.append('stop')\n .attr('offset', '100%')\n .attr('stop-color', color3);\n }", "constructor() {\n this.gl = new Context('#glCanvas');\n this.controls = document.getElementById('controls');\n\n this.viewControl = new ViewControl(this.gl);\n this.controls.append(this.viewControl.element);\n\n this.lightControl = new LightControl(this.gl);\n this.controls.append(this.lightControl.element);\n\n this.picker = new Picker(this.gl);\n this.controls.append(this.picker.element);\n\n this.textureView = new TextureView(this.gl);\n this.controls.append(this.textureView.element);\n\n this.dlistViewer = new DlistViewer(this.gl.gx);\n this.controls.append(this.dlistViewer.element);\n }", "function onFillColorPicker(value) {\n $('#fillColorPicker').val(value);\n var hexColor = $('#fillColorPicker').val();\n annotationColorLabel.color.red = parseInt( hexColor.substring(1,3), 16 );\n annotationColorLabel.color.green = parseInt( hexColor.substring(3,5), 16);\n annotationColorLabel.color.blue = parseInt( hexColor.substring(5,7), 16);\n annotationColorLabel.alpha = $('#alphaSlider').val() / 100;\n\n updateAnnotationStyle();\n\n paper.view.draw();\n}", "function palette_init() {\n /* ini colorpicker */\n \n var _head = $('head');\n var _body= $('body');\n var _colorPrimary = $('#color-primary');\n var _colorSecondary = $('#color-secondary');\n var _colorBackground = $('#color-background');\n var _colorBackground = $('#color-background');\n var _colorTitles = $('#color-titles');\n var _colorSubTitles = $('#color-subtitles');\n var _colorTitlesPrimary = $('#color-titles-primary');\n var _colorTitlesSecondary = $('#color-titles-secondary');\n var _colorContent = $('#color-content');\n var _colorPrimary_class = $('.color-primary');\n var _bColorPrimary_class = $('.border-color-primary');\n var _ColorTopBarBg = $('#color-top-bar-bg');\n var _colorPrimaryBtn = $('#color-primary-btn');\n var _colorPrimaryBtnhover= $('#color-primary-btnhover');\n var _ColorTopBarBg = $('#color-top-bar-bg');\n \n _colorPrimary.colorpicker();\n if (_colorPrimary_class.css('background-color')) {\n _colorPrimary.colorpicker('setValue', _colorPrimary_class.css('background-color'));\n } else {\n _colorPrimary.colorpicker('setValue', '#da3743');\n }\n\n _colorSecondary.colorpicker();\n if ($('.color-secondary').css('background-color')) {\n _colorSecondary.colorpicker('setValue', $('.color-secondary').css('background-color'));\n } else {\n _colorSecondary.colorpicker('setValue', 'rgb(0,137,195)');\n }\n\n _colorBackground.colorpicker();\n _colorBackground.colorpicker('setValue', '#F8F8F8');\n \n _colorTitles.colorpicker();\n _colorTitles.colorpicker('setValue', '#252525');\n _colorSubTitles.colorpicker();\n _colorSubTitles.colorpicker('setValue', '#7b7b7b');\n _colorTitlesPrimary.colorpicker();\n _colorTitlesPrimary.colorpicker('setValue', '#4285f4');\n _colorTitlesSecondary.colorpicker();\n _colorTitlesSecondary.colorpicker('setValue', '#252525');\n _colorContent.colorpicker();\n _colorContent.colorpicker('setValue', '#353535');\n _ColorTopBarBg.colorpicker();\n _ColorTopBarBg.colorpicker('setValue', '#DA3743');\n \n _colorPrimaryBtn.colorpicker();\n _colorPrimaryBtn.colorpicker('setValue', '#DA3743');\n _colorPrimaryBtnhover.colorpicker();\n _colorPrimaryBtnhover.colorpicker('setValue', '#C5434D');\n \n /* end ini colorpicker */\n\n // close and open palette panel\n $('.custom-palette-btn').on('click', function () {\n $('.custom-palette').toggleClass('palette-closed');\n })\n\n // change primary color\n _colorPrimary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n\n _colorPrimary_class.css('cssText', 'background-color: ' + color + ' !important');\n _bColorPrimary_class.css('cssText', 'border-color: ' + color + ' !important');\n $('.text-color-primary').css('cssText', 'color: ' + color + ' !important');\n\n var style = '';\n style += ' .btn-custom-secondary, .owl-dots-local .owl-theme .owl-dots .owl-dot:hover span,\\n\\\n .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.dropdown-submenu:hover > a, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li>a:hover,\\n\\\n .c_purpose-tablet li.active, .c_purpose-tablet li:hover,.infobox-big .title,\\n\\\n .cluster div:after,\\n\\\n .google_marker:before,\\n\\\n .owl-carousel-items.owl-theme .owl-dots .owl-dot.active span,\\n\\\n .owl-carousel-items.owl-theme .owl-dots .owl-dot:hover span,\\n\\\n .hidden-subtitle,\\n\\\n .btn-marker:hover .box,\\n\\\n .affix-menu.affix.top-bar .default-menu .dropdown-menu>li>a:hover, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.active>a, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.dropdown.dropdown-submenu:hover > a,\\n\\\n .owl-nav-local .owl-theme .owl-nav [class*=\"owl-\"]:hover,\\n\\\n .color-mask:after,\\n\\\n .owl-dots-local .owl-theme .owl-dots .owl-dot.active span{\\n\\\n background-color: ' + color + ';\\n\\\n }';\n \n style += ' @media (min-width: 768px){.top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li>a:hover{\\n\\\n color: ' + color + ' !important;\\n\\\n }}';\n\n style += '.caption .date i,\\n\\\n .invoice-intro.invoice-logo a,\\n\\\n .commten-box .title a:hover,\\n\\\n .commten-box .action a:hover,\\n\\\n .author-card .name_surname a:hover,\\n\\\n p.note:before,\\n\\\n .location-box .location-box-content .title a:hover,\\n\\\n .list-navigation li.return a,\\n\\\n .filters .picker .pc-select .pc-list li:hover,\\n\\\n .mark-c,\\n\\\n .pagination>li a:hover, .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,\\n\\\n .infobox .content .title a:hover,\\n\\\n .thumbnail.thumbnail-type .caption .title a:hover,\\n\\\n .thumbnail.thumbnail-video .thumbnail-title a:hover,\\n\\\n .card.card-category:hover .badget.b-icon i,\\n\\\n .btn-marker:hover .title,\\n\\\n .btn-marker .box,\\n\\\n .thumbnail.thumbnail-property .thumbnail-title a:hover,\\n\\\n .rating-action,\\n\\\n .bootstrap-select .dropdown-menu > li > a:hover .glyphicon,\\n\\\n .grid-tile a:hover .title,\\n\\\n .grid-tile .preview i,\\n\\\n .lang-manu:hover .caret, \\n\\\n .lang-manu .dropdown-menu > li > a:hover, \\n\\\n .lang-manu.open .caret, \\n\\\n .top-bar .nav-items li.open>a >span, .top-bar .nav-items li> a:hover >span,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li.active>a:hover,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li>a:hover,\\n\\\n body:not(.navigation-open) .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.dropdown.dropdown-submenu.open > a, body:not(.navigation-open) .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.dropdown.dropdown-submenu:hover > a,\\n\\\n .scale-range .nonlinear-val,.top-bar .logo a, \\n\\\n .default-menu .dropdown-menu>li.active>a, .default-menu .dropdown-menu>li>a:hover \\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }';\n\n style += ' .custom_infowindow .gm-style-iw + div,.pagination>li a:hover, .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,\\n\\\n .infoBox > img, \\n\\\n .infobox-big, \\n\\\n .infobox:before,\\n\\\n .infobox-big:before,\\n\\\n .infobox{\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n style += '.top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, \\n\\\n [class*=\"icon-star-ratings\"]:after{\\n\\\n color: ' + color + ' !important;\\n\\\n }';\n \n \n style += '.primary-color{\\n\\\n background-color: ' + color + ';\\n\\\n }';\n \n style += '.primary-text-color, .primary-link:hover {\\n\\\n color: ' + color + ';\\n\\\n }';\n \n /*\n var geomap = $('#geo-map');\n if (geomap && geomap.length) {\n geomap.geo_map('set_config',{\n 'color_hover': color,\n 'color_active': color\n })\n }\n */\n if ($('#palette-styles-pr').length) {\n _head.find('#palette-styles-pr').html(style);\n } else {\n _head.append('<style id=\"palette-styles-pr\">' + style + '</style>');\n }\n });\n\n // change secondary color\n _colorSecondary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' \\n\\\n .btn-custom-primary {\\n\\\n background: ' + color + ';\\n\\\n }';\n style += ' .top-bar .nav-items > li> a.btn.btn-custom-primary, \\n\\\n .btn-custom-primary \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n style += ' /*.top-bar .nav-items > li> a.btn.btn-custom-primary:hover\\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }*/';\n \n if ($('#palette-styles-colorSecondary').length) {\n _head.find('#palette-styles-colorSecondary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorSecondary\">' + style + '</style>');\n }\n \n \n $('.color-secondary').css('cssText', 'background-color: ' + color + ' !important');\n $('.border-color-secondary').css('cssText', 'border-color: ' + color + ' !important');\n $('.text-color-secondary').css('cssText', 'color: ' + color + ' !important');\n });\n\n // change _colorTitles color\n _colorPrimaryBtnhover.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' \\n\\\n .search-tabs li.active .btn-special-primary:hover,\\n\\\n .btn-special-primary.fill:hover,\\n\\\n .btn-custom-secondary:hover {\\n\\\n background: ' + color + ';\\n\\\n }';\n style += ' .search-tabs li.active .btn-special-primary:hove, .btn-special-primary.fill:hover \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colorPrBtnhover').length) {\n _head.find('#palette-styles-colorPrBtnhover').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorPrBtnhover\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _colorPrimaryBtn.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .btn-special-primary:hover,.search-tabs li.active .btn-special-primary, .search-tabs li.active .btn-special-primary:hover, .btn-special-primary.fill {\\n\\\n background: ' + color + ';\\n\\\n }';\n \n style += ' .btn-special-primary \\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }';\n \n style += ' .btn-special-primary:hover,.search-tabs li.active .btn-special-primary,.search-tabs li.active .btn-special-primary:hover, .btn-special-primary.fill, .btn-special-primary \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colorPrBtn').length) {\n _head.find('#palette-styles-colorPrBtn').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorPrBtn\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _colorTitles.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .post-comments .post-comments-title,.reply-box .reply-title,.post-header .post-title .title,.widget-listing-title .options .options-body .title,\\n\\\n .widget-styles .caption-title h2, .widget-styles .caption-title, .widget .widget-title, .widget-styles .header h2, .widget-styles .header,\\n\\\n .header .title-location .location,.user-card .body .name,.section-title .title {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitles').length) {\n _head.find('#palette-styles-colorTitles').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitles\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _ColorTopBarBg.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .top-bar.top-bar-color {\\n\\\n background: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colortopBar').length) {\n _head.find('#palette-styles-colortopBar').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colortopBar\">' + style + '</style>');\n }\n });\n\n // change _colorSubTitles color\n _colorSubTitles.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .thumbnail.thumbnail-video .type,.caption .date,.thumbnail.thumbnail-property-list .header .right .address,.thumbnail.thumbnail-property .type,\\n\\\n .post-header .post-title .subtitle,.header .title-location .count,.section-title .subtitle {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorSubTitles').length) {\n _head.find('#palette-styles-colorSubTitles').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorSubTitles\">' + style + '</style>');\n }\n });\n\n // change colorTitlesPrimary color\n _colorTitlesPrimary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .post-social .hash-tags a,.user-card .body .contact .link,.thumbnail.thumbnail-property .thumbnail-title a {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitlesPrimary').length) {\n _head.find('#palette-styles-colorTitlesPrimary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitlesPrimary\">' + style + '</style>');\n }\n });\n\n // change _colorTitlesSecondary color\n _colorTitlesSecondary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .caption.caption-blog .thumbnail-title a,.list-category-item .title, .list-category-item .title a,.grid-tile .title,.btn-marker .title,.commten-box .title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .author-card .name_surname a {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitlesSecondary').length) {\n _head.find('#palette-styles-colorTitlesSecondary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitlesSecondary\">' + style + '</style>');\n }\n });\n\n // change _colorContent color\n _colorContent.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .thumbnail .caption,.thumbnail.thumbnail-type .caption .description,.author-card .author-body, \\n\\\n body,.author-card .author-body,.post-body,.thumbnail.thumbnail-type .caption .description {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorContent').length) {\n _head.find('#palette-styles-colorContent').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorContent\">' + style + '</style>');\n }\n });\n \n // change font-family color\n $('#font-family select').on('change', function (e) {\n var style = '';\n style += ' body {\\n\\\n font-family: \"' + $(this).val() + '\";\\n\\\n }';\n if ($('#palette-styles-font-family').length) {\n _head.find('#palette-styles-font-family').html(style);\n } else {\n _head.append('<style id=\"palette-styles-font-family\">' + style + '</style>');\n }\n });\n \n //font-size\n $('#font-size select').on('change', function (e) {\n var c = 0;\n switch ($(this).val()) {\n case '+1': c = 2;\n break;\n case '+2': c = 4;\n break;\n case '+3': c = 5;\n break;\n case '-1': c = -2;\n break;\n case '-2': c = -2;\n break;\n case '-3': c = -3;\n break;\n\n default:\n break;\n }\n var style = '';\n \n style += ' .owl-slider-content .item .title {\\n\\\n font-size: ' + (40+c) + 'px;\\n\\\n }';\n \n style += ' .widget-geomap .geomap-title,.h-area .title {\\n\\\n font-size: ' + (36+c) + 'px;\\n\\\n }';\n \n style += ' .widget-listing-title .options .options-body .title,.section-title .title {\\n\\\n font-size: ' + (32+c) + 'px;\\n\\\n }';\n \n style += ' .footer .logo a,.top-bar .logo a {\\n\\\n font-size: ' + (30+c) + 'px;\\n\\\n }';\n \n style += ' .h3, h3 {\\n\\\n font-size: ' + (24+c) + 'px;\\n\\\n }';\n \n style += ' .section-profile-box .content .title,.section.widget-recentproperties .header .title-location .location,.section-title.slim .title,.caption.caption-blog .thumbnail-title a {\\n\\\n font-size: ' + (20+c) + 'px;\\n\\\n }';\n \n style += ' .agent-box .title a, .thumbnail.thumbnail-offers .thumbnail-title a, .card.card-pricing .title, .list-category-item .title, .list-category-item .title a, .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a, .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a,\\n\\\n .thumbnail.thumbnail-offers .thumbnail-title a, .card.card-pricing .title, .list-category-item .title, .list-category-item .title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a {\\n\\\n font-size: ' + (18+c) + 'px;\\n\\\n }';\n \n style += ' .section-profile-box .content .options,.grid-tile .title,.h-area .subtitle,.f-box .title,.user-card .body .name,.section-title .subtitle {\\n\\\n font-size: ' + (16+c) + 'px;\\n\\\n }';\n \n style += ' .btn-custom,.header .title-location .location,.thumbnail.thumbnail-property-list .header .right .address {\\n\\\n font-size: ' + (15+c) + 'px;\\n\\\n }';\n \n style += ' .list-navigation li,.btn,body,.top-bar .nav-items li {\\n\\\n font-size: ' + (14+c) + 'px;\\n\\\n }';\n \n style += ' .card.card-pricing .price-box .notice,.list-suggestions li,.thumbnail.thumbnail-property-list .list-comment p,.thumbnail.thumbnail-type .caption .description,.thumbnail.thumbnail-video .type,\\n\\\n .section-search-area .tags ul li,.f-box .list-f a,.caption .date,.btn-marker .title,.thumbnail.thumbnail-property .typ {\\n\\\n font-size: ' + (13+c) + 'px;\\n\\\n }';\n \n if ($('#palette-styles-font-size').length) {\n _head.find('#palette-styles-font-size').html(style);\n } else {\n _head.append('<style id=\"palette-styles-font-size\">' + style + '</style>');\n }\n });\n\n // chose prepared color\n $('#palette-colors-prepared a').on('click', function (e) {\n e.preventDefault();\n var backgroundtopbar = '';\n backgroundtopbar = $(this).closest('li').attr('data-backgroundtopbar');\n if (backgroundtopbar)\n _ColorTopBarBg.colorpicker('setValue', backgroundtopbar);\n \n var primary = '';\n primary = $(this).closest('li').attr('data-primary-color');\n if (primary)\n _colorPrimary.colorpicker('setValue', primary);\n\n var secondary = '';\n secondary = $(this).closest('li').attr('data-secondary-color');\n if (secondary)\n _colorSecondary.colorpicker('setValue', secondary);\n \n var btnprimary = '';\n btnprimary = $(this).closest('li').attr('data-btnprimary');\n if (btnprimary)\n _colorPrimaryBtn.colorpicker('setValue', btnprimary);\n\n var btnprimaryhover = '';\n btnprimaryhover = $(this).closest('li').attr('data-btnprimaryhover');\n if (btnprimaryhover)\n _colorPrimaryBtnhover.colorpicker('setValue', btnprimaryhover);\n\n var titlescolor = '';\n titlescolor = $(this).closest('li').attr('data-titlescolor');\n if (titlescolor)\n _colorTitles.colorpicker('setValue', titlescolor);\n\n var subtitlescolor = '';\n subtitlescolor = $(this).closest('li').attr('data-subtitlescolor');\n if (subtitlescolor)\n _colorSubTitles.colorpicker('setValue', subtitlescolor);\n\n var titlesprimary = '';\n titlesprimary = $(this).closest('li').attr('data-titlesprimary');\n if (titlesprimary)\n _colorTitlesPrimary.colorpicker('setValue', titlesprimary);\n\n var titlesecondary = '';\n titlesecondary = $(this).closest('li').attr('data-titlesecondary');\n if (titlesecondary)\n _colorTitlesSecondary.colorpicker('setValue', titlesecondary);\n\n var contentcolor = '';\n contentcolor = $(this).closest('li').attr('data-contentcolor');\n if (contentcolor)\n _colorContent.colorpicker('setValue', contentcolor);\n })\n\n // change background color\n _colorBackground.colorpicker().on('changeColor.colorpicker', function (event) {\n _body.removeClass('bg-image');\n var color = event.color.toString();\n _body.css('background', color);\n });\n\n // choose preperad bg-color boxed\n $('#palette-backgroundimage-prepared a').on('click', function (e) {\n e.preventDefault();\n var bg;\n var style;\n bg = $(this).closest('li').attr('data-backgroundimage') || '';\n style = $(this).closest('li').attr('data-backgroundimage-style') || '';\n\n $('#palette-backgroundimage-prepared a').removeClass('active');\n $(this).addClass('active');\n _body.addClass('bg-image');\n\n if (bg && style) {\n if (style == 'fixed') {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n _body.css('background-size', 'cover');\n } else if (style == 'repeat') {\n _body.css('background', 'url(' + bg + ') repeat');\n _body.css('background-size', 'inherit');\n } else {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n }\n } else if (bg) {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n }\n })\n\n //type-site (full-width, wide)\n $('.custom-palette-box input[name=\"type-site\"]').on('change',function (e) {\n e.preventDefault();\n _body.removeClass('full-width')\n .removeClass('boxed');\n _body.addClass($('.custom-palette-box input[name=\"type-site\"]:checked').val());\n\n var _m = $('.widget-topmap');\n if ($(window).width() > 768 ){\n var _w;\n if($('body').hasClass('boxed')){\n _w = $('main.container .row-fluid .right-b.box').outerWidth();\n } else {\n _w = $('main.container .row-fluid .right-b.box').outerWidth()+(($(window).width() - $('main.container').outerWidth())/2)+15;\n }\n\n if(_w)\n _m.find('.flex .flex-right').attr('style','width: '+_w+'px;min-width:'+_w+'px');\n } else {\n _m.find('.flex .flex-right').attr('style','');\n }\n \n $(window).trigger('resize')\n })\n \n // top-bar type\n if($('.top-bar.top-bar-color').length) {\n $('.custom-palette-box #topbar-version select').val('color');\n $('.custom-palette-box #topbar-version select').selectpicker('refresh');\n $('#color-top-bar-bg').closest('.custom-palette-color').removeClass('hidden')\n }\n var defaultTopbarBg_classes ='';\n if($('.top-bar').length) {\n var defaultTopbarBg_classes = $('.top-bar').attr('class');\n }\n \n $('.custom-palette-box #topbar-version select').on('change', function (e) {\n $(this).val();\n \n switch ($(this).val()) {\n case 'white': $('.top-bar').removeClass('t-overflow')\n .removeClass('overflow')\n .removeClass('top-bar-white')\n .removeClass('top-bar-white')\n .removeClass('top-bar-color');\n $('#color-top-bar-bg').closest('.custom-palette-color').addClass('hidden')\n \n break;\n case 'color': $('.top-bar').removeClass('t-overflow')\n .removeClass('overflow')\n .addClass('top-bar-white')\n .addClass('top-bar-color');\n $('#color-top-bar-bg').closest('.custom-palette-color').removeClass('hidden')\n break;\n default:\n $('.top-bar').attr('class', defaultTopbarBg_classes);\n $('#color-top-bar-bg').closest('.custom-palette-color').addClass('hidden')\n break;\n }\n \n $(window).trigger('resize');\n })\n\n //reset \n $('#pallete-reset').on('click', function (e) {\n e.preventDefault();\n \n _body.attr('class', '');\n var type = $('input[name=\"type-site\"]').last().val();\n _body.attr('class', type);\n\n _body.attr('style', '');\n $('#custom_scheme').remove();\n _colorPrimary.colorpicker('setValue', '#da3743');\n _colorSecondary.colorpicker('setValue', 'rgb(0,137,195)');\n _colorBackground.colorpicker('setValue', '#F8F8F8');\n _colorTitles.colorpicker('setValue', '#252525');\n _colorSubTitles.colorpicker('setValue', '#7b7b7b');\n _colorTitlesPrimary.colorpicker('setValue', '#4285f4');\n _colorTitlesSecondary.colorpicker('setValue', '#252525');\n _colorContent.colorpicker('setValue', '#353535');\n _colorPrimaryBtn.colorpicker('setValue', '#DA3743');\n _colorPrimaryBtnhover.colorpicker('setValue', '#C5434D');\n \n $('#palette-backgroundimage-prepared a').removeClass('active');\n\n $('.custom-palette-box input[name=\"type-site\"]').removeAttr('checked')\n $('.custom-palette-box input[name=\"type-site\"][value=\"\"]').attr('checked', 'checked');\n\n _body.css('background', 'white')\n .css('background-size', 'cover');\n \n $('#palette-styles-font-size,#palette-styles-font-size, #palette-styles-font-family,#palette-styles-colorContent,#palette-styles-colorTitlesSecondary,palette-styles-colorTitlesPrimary, #palette-styles-colorSubTitles, #palette-styles-colorTitles').remove()\n \n $('.top-bar').attr('class', defaultTopbarBg_classes);\n\n })\n \n \n if($('#palette-colors-prepared a.active').length) {\n $('#palette-colors-prepared a.active').trigger('click');\n }\n\n /* End Palette */\n\n \n}", "_createElement() {\n const that = this;\n\n that.coerce = true;\n that.min = 0;\n that._drawMin = '0';\n that.startAngle = -270;\n that.endAngle = 90;\n that._angleDifference = that.endAngle - that.startAngle;\n that.ticksVisibility = 'none';\n that._tickIntervalHandler = {};\n that._tickIntervalHandler.labelsSize = {};\n that._distance = { majorTickDistance: 0, minorTickDistance: 0, labelDistance: 10 };\n that._measurements = {};\n\n that._validateInitialPropertyValues();\n that._applyInitialSettings();\n\n that._numericProcessor = new JQX.Utilities.DecimalNumericProcessor(that);\n that._draw = new JQX.Utilities.Draw(that.$.picker);\n\n\n if (!that._isVisible()) {\n that._renderingSuspended = true;\n return;\n }\n\n that._setPickerSize();\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._renderSVG();\n\n that._setFocusable();\n }", "function TargetPicker(){}", "function getGradient(c) {\n linearGradient.selectAll(\"stop\").remove();\n\n colorPick[c].forEach( function(v,k) {\n var offset = String(v*100)+\"%\";\n linearGradient.append(\"stop\") \n .attr(\"offset\", offset) \n .attr(\"stop-color\", primaryColors[k]);\n });\n}", "function initializeColorPicker() {\n if (global.params.selectedColor === undefined) {\n global.params.selectedColor = DefaultColor;\n }\n const colorPicker = new ColorPicker(new Color(global.params.selectedColor));\n main.append(colorPicker);\n const width = colorPicker.offsetWidth;\n const height = colorPicker.offsetHeight;\n resizeWindow(width, height);\n}", "function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) { // 3975\n // 3976\n // If there’s no element, return the picker constructor. // 3977\n if ( !ELEMENT ) return PickerConstructor // 3978\n // 3979\n // 3980\n var // 3981\n IS_DEFAULT_THEME = false, // 3982\n // 3983\n // 3984\n // The state of the picker. // 3985\n STATE = { // 3986\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) ) // 3987\n }, // 3988\n // 3989\n // 3990\n // Merge the defaults and options passed. // 3991\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {}, // 3992\n // 3993\n // 3994\n // Merge the default classes with the settings classes. // 3995\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ), // 3996\n // 3997\n // 3998\n // The element node wrapper into a jQuery object. // 3999\n $ELEMENT = $( ELEMENT ), // 4000\n // 4001\n // 4002\n // Pseudo picker constructor. // 4003\n PickerInstance = function() { // 4004\n return this.start() // 4005\n }, // 4006\n // 4007\n // 4008\n // The picker prototype. // 4009\n P = PickerInstance.prototype = { // 4010\n // 4011\n constructor: PickerInstance, // 4012\n // 4013\n $node: $ELEMENT, // 4014\n // 4015\n // 4016\n /** // 4017\n * Initialize everything // 4018\n */ // 4019\n start: function() { // 4020\n // 4021\n // If it’s already started, do nothing. // 4022\n if ( STATE && STATE.start ) return P // 4023\n // 4024\n // 4025\n // Update the picker states. // 4026\n STATE.methods = {} // 4027\n STATE.start = true // 4028\n STATE.open = false // 4029\n STATE.type = ELEMENT.type // 4030\n // 4031\n // 4032\n // Confirm focus state, convert into text input to remove UA stylings, // 4033\n // and set as readonly to prevent keyboard popup. // 4034\n ELEMENT.autofocus = ELEMENT == getActiveElement() // 4035\n ELEMENT.readOnly = !SETTINGS.editable // 4036\n ELEMENT.id = ELEMENT.id || STATE.id // 4037\n if ( ELEMENT.type != 'text' ) { // 4038\n ELEMENT.type = 'text' // 4039\n } // 4040\n // 4041\n // 4042\n // Create a new picker component with the settings. // 4043\n P.component = new COMPONENT(P, SETTINGS) // 4044\n // 4045\n // 4046\n // Create the picker root with a holder and then prepare it. // 4047\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot() // 4049\n // 4050\n // 4051\n // If there’s a format for the hidden input element, create the element. // 4052\n if ( SETTINGS.formatSubmit ) { // 4053\n prepareElementHidden() // 4054\n } // 4055\n // 4056\n // 4057\n // Prepare the input element. // 4058\n prepareElement() // 4059\n // 4060\n // 4061\n // Insert the root as specified in the settings. // 4062\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root ) // 4063\n else $ELEMENT.after( P.$root ) // 4064\n // 4065\n // 4066\n // Bind the default component and settings events. // 4067\n P.on({ // 4068\n start: P.component.onStart, // 4069\n render: P.component.onRender, // 4070\n stop: P.component.onStop, // 4071\n open: P.component.onOpen, // 4072\n close: P.component.onClose, // 4073\n set: P.component.onSet // 4074\n }).on({ // 4075\n start: SETTINGS.onStart, // 4076\n render: SETTINGS.onRender, // 4077\n stop: SETTINGS.onStop, // 4078\n open: SETTINGS.onOpen, // 4079\n close: SETTINGS.onClose, // 4080\n set: SETTINGS.onSet // 4081\n }) // 4082\n // 4083\n // 4084\n // Once we’re all set, check the theme in use. // 4085\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] ) // 4086\n // 4087\n // 4088\n // If the element has autofocus, open the picker. // 4089\n if ( ELEMENT.autofocus ) { // 4090\n P.open() // 4091\n } // 4092\n // 4093\n // 4094\n // Trigger queued the “start” and “render” events. // 4095\n return P.trigger( 'start' ).trigger( 'render' ) // 4096\n }, //start // 4097\n // 4098\n // 4099\n /** // 4100\n * Render a new picker // 4101\n */ // 4102\n render: function( entireComponent ) { // 4103\n // 4104\n // Insert a new component holder in the root or box. // 4105\n if ( entireComponent ) P.$root.html( createWrappedComponent() ) // 4106\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) ) // 4107\n // 4108\n // Trigger the queued “render” events. // 4109\n return P.trigger( 'render' ) // 4110\n }, //render // 4111\n // 4112\n // 4113\n /** // 4114\n * Destroy everything // 4115\n */ // 4116\n stop: function() { // 4117\n // 4118\n // If it’s already stopped, do nothing. // 4119\n if ( !STATE.start ) return P // 4120\n // 4121\n // Then close the picker. // 4122\n P.close() // 4123\n // 4124\n // Remove the hidden field. // 4125\n if ( P._hidden ) { // 4126\n P._hidden.parentNode.removeChild( P._hidden ) // 4127\n } // 4128\n // 4129\n // Remove the root. // 4130\n P.$root.remove() // 4131\n // 4132\n // Remove the input class, remove the stored data, and unbind // 4133\n // the events (after a tick for IE - see `P.close`). // 4134\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME ) // 4135\n setTimeout( function() { // 4136\n $ELEMENT.off( '.' + STATE.id ) // 4137\n }, 0) // 4138\n // 4139\n // Restore the element state // 4140\n ELEMENT.type = STATE.type // 4141\n ELEMENT.readOnly = false // 4142\n // 4143\n // Trigger the queued “stop” events. // 4144\n P.trigger( 'stop' ) // 4145\n // 4146\n // Reset the picker states. // 4147\n STATE.methods = {} // 4148\n STATE.start = false // 4149\n // 4150\n return P // 4151\n }, //stop // 4152\n // 4153\n // 4154\n /** // 4155\n * Open up the picker // 4156\n */ // 4157\n open: function( dontGiveFocus ) { // 4158\n // 4159\n // If it’s already open, do nothing. // 4160\n if ( STATE.open ) return P // 4161\n // 4162\n // Add the “active” class. // 4163\n $ELEMENT.addClass( CLASSES.active ) // 4164\n aria( ELEMENT, 'expanded', true ) // 4165\n // 4166\n // * A Firefox bug, when `html` has `overflow:hidden`, results in // 4167\n // killing transitions :(. So add the “opened” state on the next tick. // 4168\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 // 4169\n setTimeout( function() { // 4170\n // 4171\n // Add the “opened” class to the picker root. // 4172\n P.$root.addClass( CLASSES.opened ) // 4173\n aria( P.$root[0], 'hidden', false ) // 4174\n // 4175\n }, 0 ) // 4176\n // 4177\n // If we have to give focus, bind the element and doc events. // 4178\n if ( dontGiveFocus !== false ) { // 4179\n // 4180\n // Set it as open. // 4181\n STATE.open = true // 4182\n // 4183\n // Prevent the page from scrolling. // 4184\n if ( IS_DEFAULT_THEME ) { // 4185\n $html. // 4186\n css( 'overflow', 'hidden' ). // 4187\n css( 'padding-right', '+=' + getScrollbarWidth() ) // 4188\n } // 4189\n // 4190\n // Pass focus to the root element’s jQuery object. // 4191\n // * Workaround for iOS8 to bring the picker’s root into view. // 4192\n P.$root.eq(0).focus() // 4193\n // 4194\n // Bind the document events. // 4195\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) { // 4196\n // 4197\n var target = event.target // 4198\n // 4199\n // If the target of the event is not the element, close the picker picker. // 4200\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up. // 4201\n // Also, for Firefox, a click on an `option` element bubbles up directly // 4202\n // to the doc. So make sure the target wasn't the doc. // 4203\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling, // 4204\n // which causes the picker to unexpectedly close when right-clicking it. So make // 4205\n // sure the event wasn’t a right-click. // 4206\n if ( target != ELEMENT && target != document && event.which != 3 ) { // 4207\n // 4208\n // If the target was the holder that covers the screen, // 4209\n // keep the element focused to maintain tabindex. // 4210\n P.close( target === P.$root.children()[0] ) // 4211\n } // 4212\n // 4213\n }).on( 'keydown.' + STATE.id, function( event ) { // 4214\n // 4215\n var // 4216\n // Get the keycode. // 4217\n keycode = event.keyCode, // 4218\n // 4219\n // Translate that to a selection change. // 4220\n keycodeToMove = P.component.key[ keycode ], // 4221\n // 4222\n // Grab the target. // 4223\n target = event.target // 4224\n // 4225\n // 4226\n // On escape, close the picker and give focus. // 4227\n if ( keycode == 27 ) { // 4228\n P.close( true ) // 4229\n } // 4230\n // 4231\n // 4232\n // Check if there is a key movement or “enter” keypress on the element. // 4233\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) { // 4234\n // 4235\n // Prevent the default action to stop page movement. // 4236\n event.preventDefault() // 4237\n // 4238\n // Trigger the key movement action. // 4239\n if ( keycodeToMove ) { // 4240\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n } // 4242\n // 4243\n // On “enter”, if the highlighted item isn’t disabled, set the value and close. // 4244\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) { // 4245\n P.set( 'select', P.component.item.highlight ).close() // 4246\n } // 4247\n } // 4248\n // 4249\n // 4250\n // If the target is within the root and “enter” is pressed, // 4251\n // prevent the default action and trigger a click on the target instead. // 4252\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) { // 4253\n event.preventDefault() // 4254\n target.click() // 4255\n } // 4256\n }) // 4257\n } // 4258\n // 4259\n // Trigger the queued “open” events. // 4260\n return P.trigger( 'open' ) // 4261\n }, //open // 4262\n // 4263\n // 4264\n /** // 4265\n * Close the picker // 4266\n */ // 4267\n close: function( giveFocus ) { // 4268\n // 4269\n // If we need to give focus, do it before changing states. // 4270\n if ( giveFocus ) { // 4271\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :| // 4272\n // The focus is triggered *after* the close has completed - causing it // 4273\n // to open again. So unbind and rebind the event at the next tick. // 4274\n P.$root.off( 'focus.toOpen' ).eq(0).focus() // 4275\n setTimeout( function() { // 4276\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent ) // 4277\n }, 0 ) // 4278\n } // 4279\n // 4280\n // Remove the “active” class. // 4281\n $ELEMENT.removeClass( CLASSES.active ) // 4282\n aria( ELEMENT, 'expanded', false ) // 4283\n // 4284\n // * A Firefox bug, when `html` has `overflow:hidden`, results in // 4285\n // killing transitions :(. So remove the “opened” state on the next tick. // 4286\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 // 4287\n setTimeout( function() { // 4288\n // 4289\n // Remove the “opened” and “focused” class from the picker root. // 4290\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused ) // 4291\n aria( P.$root[0], 'hidden', true ) // 4292\n // 4293\n }, 0 ) // 4294\n // 4295\n // If it’s already closed, do nothing more. // 4296\n if ( !STATE.open ) return P // 4297\n // 4298\n // Set it as closed. // 4299\n STATE.open = false // 4300\n // 4301\n // Allow the page to scroll. // 4302\n if ( IS_DEFAULT_THEME ) { // 4303\n $html. // 4304\n css( 'overflow', '' ). // 4305\n css( 'padding-right', '-=' + getScrollbarWidth() ) // 4306\n } // 4307\n // 4308\n // Unbind the document events. // 4309\n $document.off( '.' + STATE.id ) // 4310\n // 4311\n // Trigger the queued “close” events. // 4312\n return P.trigger( 'close' ) // 4313\n }, //close // 4314\n // 4315\n // 4316\n /** // 4317\n * Clear the values // 4318\n */ // 4319\n clear: function( options ) { // 4320\n return P.set( 'clear', null, options ) // 4321\n }, //clear // 4322\n // 4323\n // 4324\n /** // 4325\n * Set something // 4326\n */ // 4327\n set: function( thing, value, options ) { // 4328\n // 4329\n var thingItem, thingValue, // 4330\n thingIsObject = $.isPlainObject( thing ), // 4331\n thingObject = thingIsObject ? thing : {} // 4332\n // 4333\n // Make sure we have usable options. // 4334\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {} // 4335\n // 4336\n if ( thing ) { // 4337\n // 4338\n // If the thing isn’t an object, make it one. // 4339\n if ( !thingIsObject ) { // 4340\n thingObject[ thing ] = value // 4341\n } // 4342\n // 4343\n // Go through the things of items to set. // 4344\n for ( thingItem in thingObject ) { // 4345\n // 4346\n // Grab the value of the thing. // 4347\n thingValue = thingObject[ thingItem ] // 4348\n // 4349\n // First, if the item exists and there’s a value, set it. // 4350\n if ( thingItem in P.component.item ) { // 4351\n if ( thingValue === undefined ) thingValue = null // 4352\n P.component.set( thingItem, thingValue, options ) // 4353\n } // 4354\n // 4355\n // Then, check to update the element value and broadcast a change. // 4356\n if ( thingItem == 'select' || thingItem == 'clear' ) { // 4357\n $ELEMENT. // 4358\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ). // 4359\n trigger( 'change' ) // 4360\n } // 4361\n } // 4362\n // 4363\n // Render a new picker. // 4364\n P.render() // 4365\n } // 4366\n // 4367\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`. // 4368\n return options.muted ? P : P.trigger( 'set', thingObject ) // 4369\n }, //set // 4370\n // 4371\n // 4372\n /** // 4373\n * Get something // 4374\n */ // 4375\n get: function( thing, format ) { // 4376\n // 4377\n // Make sure there’s something to get. // 4378\n thing = thing || 'value' // 4379\n // 4380\n // If a picker state exists, return that. // 4381\n if ( STATE[ thing ] != null ) { // 4382\n return STATE[ thing ] // 4383\n } // 4384\n // 4385\n // Return the submission value, if that. // 4386\n if ( thing == 'valueSubmit' ) { // 4387\n if ( P._hidden ) { // 4388\n return P._hidden.value // 4389\n } // 4390\n thing = 'value' // 4391\n } // 4392\n // 4393\n // Return the value, if that. // 4394\n if ( thing == 'value' ) { // 4395\n return ELEMENT.value // 4396\n } // 4397\n // 4398\n // Check if a component item exists, return that. // 4399\n if ( thing in P.component.item ) { // 4400\n if ( typeof format == 'string' ) { // 4401\n var thingValue = P.component.get( thing ) // 4402\n return thingValue ? // 4403\n PickerConstructor._.trigger( // 4404\n P.component.formats.toString, // 4405\n P.component, // 4406\n [ format, thingValue ] // 4407\n ) : '' // 4408\n } // 4409\n return P.component.get( thing ) // 4410\n } // 4411\n }, //get // 4412\n // 4413\n // 4414\n // 4415\n /** // 4416\n * Bind events on the things. // 4417\n */ // 4418\n on: function( thing, method, internal ) { // 4419\n // 4420\n var thingName, thingMethod, // 4421\n thingIsObject = $.isPlainObject( thing ), // 4422\n thingObject = thingIsObject ? thing : {} // 4423\n // 4424\n if ( thing ) { // 4425\n // 4426\n // If the thing isn’t an object, make it one. // 4427\n if ( !thingIsObject ) { // 4428\n thingObject[ thing ] = method // 4429\n } // 4430\n // 4431\n // Go through the things to bind to. // 4432\n for ( thingName in thingObject ) { // 4433\n // 4434\n // Grab the method of the thing. // 4435\n thingMethod = thingObject[ thingName ] // 4436\n // 4437\n // If it was an internal binding, prefix it. // 4438\n if ( internal ) { // 4439\n thingName = '_' + thingName // 4440\n } // 4441\n // 4442\n // Make sure the thing methods collection exists. // 4443\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || [] // 4444\n // 4445\n // Add the method to the relative method collection. // 4446\n STATE.methods[ thingName ].push( thingMethod ) // 4447\n } // 4448\n } // 4449\n // 4450\n return P // 4451\n }, //on // 4452\n // 4453\n // 4454\n // 4455\n /** // 4456\n * Unbind events on the things. // 4457\n */ // 4458\n off: function() { // 4459\n var i, thingName, // 4460\n names = arguments; // 4461\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) { // 4462\n thingName = names[i] // 4463\n if ( thingName in STATE.methods ) { // 4464\n delete STATE.methods[thingName] // 4465\n } // 4466\n } // 4467\n return P // 4468\n }, // 4469\n // 4470\n // 4471\n /** // 4472\n * Fire off method events. // 4473\n */ // 4474\n trigger: function( name, data ) { // 4475\n var _trigger = function( name ) { // 4476\n var methodList = STATE.methods[ name ] // 4477\n if ( methodList ) { // 4478\n methodList.map( function( method ) { // 4479\n PickerConstructor._.trigger( method, P, [ data ] ) // 4480\n }) // 4481\n } // 4482\n } // 4483\n _trigger( '_' + name ) // 4484\n _trigger( name ) // 4485\n return P // 4486\n } //trigger // 4487\n } //PickerInstance.prototype // 4488\n // 4489\n // 4490\n /** // 4491\n * Wrap the picker holder components together. // 4492\n */ // 4493\n function createWrappedComponent() { // 4494\n // 4495\n // Create a picker wrapper holder // 4496\n return PickerConstructor._.node( 'div', // 4497\n // 4498\n // Create a picker wrapper node // 4499\n PickerConstructor._.node( 'div', // 4500\n // 4501\n // Create a picker frame // 4502\n PickerConstructor._.node( 'div', // 4503\n // 4504\n // Create a picker box node // 4505\n PickerConstructor._.node( 'div', // 4506\n // 4507\n // Create the components nodes. // 4508\n P.component.nodes( STATE.open ), // 4509\n // 4510\n // The picker box class // 4511\n CLASSES.box // 4512\n ), // 4513\n // 4514\n // Picker wrap class // 4515\n CLASSES.wrap // 4516\n ), // 4517\n // 4518\n // Picker frame class // 4519\n CLASSES.frame // 4520\n ), // 4521\n // 4522\n // Picker holder class // 4523\n CLASSES.holder // 4524\n ) //endreturn // 4525\n } //createWrappedComponent // 4526\n // 4527\n // 4528\n // 4529\n /** // 4530\n * Prepare the input element with all bindings. // 4531\n */ // 4532\n function prepareElement() { // 4533\n // 4534\n $ELEMENT. // 4535\n // 4536\n // Store the picker data by component name. // 4537\n data(NAME, P). // 4538\n // 4539\n // Add the “input” class name. // 4540\n addClass(CLASSES.input). // 4541\n // 4542\n // Remove the tabindex. // 4543\n attr('tabindex', -1). // 4544\n // 4545\n // If there’s a `data-value`, update the value of the element. // 4546\n val( $ELEMENT.data('value') ? // 4547\n P.get('select', SETTINGS.format) : // 4548\n ELEMENT.value // 4549\n ) // 4550\n // 4551\n // 4552\n // Only bind keydown events if the element isn’t editable. // 4553\n if ( !SETTINGS.editable ) { // 4554\n // 4555\n $ELEMENT. // 4556\n // 4557\n // On focus/click, focus onto the root to open it up. // 4558\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) { // 4559\n event.preventDefault() // 4560\n P.$root.eq(0).focus() // 4561\n }). // 4562\n // 4563\n // Handle keyboard event based on the picker being opened or not. // 4564\n on( 'keydown.' + STATE.id, handleKeydownEvent ) // 4565\n } // 4566\n // 4567\n // 4568\n // Update the aria attributes. // 4569\n aria(ELEMENT, { // 4570\n haspopup: true, // 4571\n expanded: false, // 4572\n readonly: false, // 4573\n owns: ELEMENT.id + '_root' // 4574\n }) // 4575\n } // 4576\n // 4577\n // 4578\n /** // 4579\n * Prepare the root picker element with all bindings. // 4580\n */ // 4581\n function prepareElementRoot() { // 4582\n // 4583\n P.$root. // 4584\n // 4585\n on({ // 4586\n // 4587\n // For iOS8. // 4588\n keydown: handleKeydownEvent, // 4589\n // 4590\n // When something within the root is focused, stop from bubbling // 4591\n // to the doc and remove the “focused” state from the root. // 4592\n focusin: function( event ) { // 4593\n P.$root.removeClass( CLASSES.focused ) // 4594\n event.stopPropagation() // 4595\n }, // 4596\n // 4597\n // When something within the root holder is clicked, stop it // 4598\n // from bubbling to the doc. // 4599\n 'mousedown click': function( event ) { // 4600\n // 4601\n var target = event.target // 4602\n // 4603\n // Make sure the target isn’t the root holder so it can bubble up. // 4604\n if ( target != P.$root.children()[ 0 ] ) { // 4605\n // 4606\n event.stopPropagation() // 4607\n // 4608\n // * For mousedown events, cancel the default action in order to // 4609\n // prevent cases where focus is shifted onto external elements // 4610\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120). // 4611\n // Also, for Firefox, don’t prevent action on the `option` element. // 4612\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n // 4614\n event.preventDefault() // 4615\n // 4616\n // Re-focus onto the root so that users can click away // 4617\n // from elements focused within the picker. // 4618\n P.$root.eq(0).focus() // 4619\n } // 4620\n } // 4621\n } // 4622\n }). // 4623\n // 4624\n // Add/remove the “target” class on focus and blur. // 4625\n on({ // 4626\n focus: function() { // 4627\n $ELEMENT.addClass( CLASSES.target ) // 4628\n }, // 4629\n blur: function() { // 4630\n $ELEMENT.removeClass( CLASSES.target ) // 4631\n } // 4632\n }). // 4633\n // 4634\n // Open the picker and adjust the root “focused” state // 4635\n on( 'focus.toOpen', handleFocusToOpenEvent ). // 4636\n // 4637\n // If there’s a click on an actionable element, carry out the actions. // 4638\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() { // 4639\n // 4640\n var $target = $( this ), // 4641\n targetData = $target.data(), // 4642\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ), // 4643\n // 4644\n // * For IE, non-focusable elements can be active elements as well // 4645\n // (http://stackoverflow.com/a/2684561). // 4646\n activeElement = getActiveElement() // 4647\n activeElement = activeElement && ( activeElement.type || activeElement.href ) // 4648\n // 4649\n // If it’s disabled or nothing inside is actively focused, re-focus the element. // 4650\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) { // 4651\n P.$root.eq(0).focus() // 4652\n } // 4653\n // 4654\n // If something is superficially changed, update the `highlight` based on the `nav`. // 4655\n if ( !targetDisabled && targetData.nav ) { // 4656\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } ) // 4657\n } // 4658\n // 4659\n // If something is picked, set `select` then close with focus. // 4660\n else if ( !targetDisabled && 'pick' in targetData ) { // 4661\n P.set( 'select', targetData.pick ) // 4662\n } // 4663\n // 4664\n // If a “clear” button is pressed, empty the values and close with focus. // 4665\n else if ( targetData.clear ) { // 4666\n P.clear().close( true ) // 4667\n } // 4668\n // 4669\n else if ( targetData.close ) { // 4670\n P.close( true ) // 4671\n } // 4672\n // 4673\n }) //P.$root // 4674\n // 4675\n aria( P.$root[0], 'hidden', true ) // 4676\n } // 4677\n // 4678\n // 4679\n /** // 4680\n * Prepare the hidden input element along with all bindings. // 4681\n */ // 4682\n function prepareElementHidden() { // 4683\n // 4684\n var name // 4685\n // 4686\n if ( SETTINGS.hiddenName === true ) { // 4687\n name = ELEMENT.name // 4688\n ELEMENT.name = '' // 4689\n } // 4690\n else { // 4691\n name = [ // 4692\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', // 4693\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit' // 4694\n ] // 4695\n name = name[0] + ELEMENT.name + name[1] // 4696\n } // 4697\n // 4698\n P._hidden = $( // 4699\n '<input ' + // 4700\n 'type=hidden ' + // 4701\n // 4702\n // Create the name using the original input’s with a prefix and suffix. // 4703\n 'name=\"' + name + '\"' + // 4704\n // 4705\n // If the element has a value, set the hidden value as well. // 4706\n ( // 4707\n $ELEMENT.data('value') || ELEMENT.value ? // 4708\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' : // 4709\n '' // 4710\n ) + // 4711\n '>' // 4712\n )[0] // 4713\n // 4714\n $ELEMENT. // 4715\n // 4716\n // If the value changes, update the hidden input with the correct format. // 4717\n on('change.' + STATE.id, function() { // 4718\n P._hidden.value = ELEMENT.value ? // 4719\n P.get('select', SETTINGS.formatSubmit) : // 4720\n '' // 4721\n }) // 4722\n // 4723\n // 4724\n // Insert the hidden input as specified in the settings. // 4725\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden ) // 4726\n else $ELEMENT.after( P._hidden ) // 4727\n } // 4728\n // 4729\n // 4730\n // For iOS8. // 4731\n function handleKeydownEvent( event ) { // 4732\n // 4733\n var keycode = event.keyCode, // 4734\n // 4735\n // Check if one of the delete keys was pressed. // 4736\n isKeycodeDelete = /^(8|46)$/.test(keycode) // 4737\n // 4738\n // For some reason IE clears the input value on “escape”. // 4739\n if ( keycode == 27 ) { // 4740\n P.close() // 4741\n return false // 4742\n } // 4743\n // 4744\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement. // 4745\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) { // 4746\n // 4747\n // Prevent it from moving the page and bubbling to doc. // 4748\n event.preventDefault() // 4749\n event.stopPropagation() // 4750\n // 4751\n // If `delete` was pressed, clear the values and close the picker. // 4752\n // Otherwise open the picker. // 4753\n if ( isKeycodeDelete ) { P.clear().close() } // 4754\n else { P.open() } // 4755\n } // 4756\n } // 4757\n // 4758\n // 4759\n // Separated for IE // 4760\n function handleFocusToOpenEvent( event ) { // 4761\n // 4762\n // Stop the event from propagating to the doc. // 4763\n event.stopPropagation() // 4764\n // 4765\n // If it’s a focus event, add the “focused” class to the root. // 4766\n if ( event.type == 'focus' ) { // 4767\n P.$root.addClass( CLASSES.focused ) // 4768\n } // 4769\n // 4770\n // And then finally open the picker. // 4771\n P.open() // 4772\n } // 4773\n // 4774\n // 4775\n // Return a new picker instance. // 4776\n return new PickerInstance() // 4777\n} //PickerConstructor // 4778", "createColorPicker(title, colorCode, initialValue) {\n const container = document.createElement(\"div\");\n container.style.display = \"flex\";\n container.style.alignItems = \"center\";\n container.style.justifyContent = \"flex-end\";\n container.style.marginBottom = \"10px\";\n\n const colorName = document.createElement(\"p\");\n colorName.textContent = title;\n colorName.style.margin = \"0px 10px 0px 0px\";\n\n const colorPicker = document.createElement(\"input\");\n colorPicker.style.width = \"32px\";\n colorPicker.style.height = \"32px\";\n colorPicker.style.padding = \"2px\";\n colorPicker.setAttribute(\"type\", \"color\");\n colorPicker.setAttribute(\"value\", initialValue);\n\n colorPicker.onchange = () => {\n const newConfig = {\n ...this._config,\n customColors: { ...this._config.customColors },\n };\n newConfig.customColors[colorCode] = colorPicker.value;\n this.setConfiguration(newConfig);\n };\n\n // clear the config setting for this color code if we should use the event theme.\n const button = document.createElement(\"button\");\n button.textContent = \"Use Event Theme\";\n button.onclick = () => {\n const newConfig = {\n ...this._config,\n customColors: { ...this._config.customColors },\n };\n newConfig.customColors[colorCode] = undefined;\n this.setConfiguration(newConfig);\n };\n\n if (\n !this._config.customColors ||\n this._config.customColors[colorCode] === undefined\n ) {\n //style as selected\n button.style.border = \"2px solid #016AE1\";\n button.style.borderRadius = \"8px\";\n }\n\n button.style.margin = \"0px 0px 0px 10px\";\n\n container.append(colorName, colorPicker, button);\n return container;\n }", "_generateHueCircle() {\n if (this.generated === false) {\n let ctx = this.colorPickerCanvas.getContext('2d');\n if (this.pixelRation === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.colorPickerCanvas.clientWidth;\n let h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n\n // draw hue circle\n let x, y, hue, sat;\n this.centerCoordinates = {x: w * 0.5, y: h * 0.5};\n this.r = 0.49 * w;\n let angleConvert = (2 * Math.PI) / 360;\n let hfac = 1 / 360;\n let sfac = 1 / this.r;\n let rgb;\n for (hue = 0; hue < 360; hue++) {\n for (sat = 0; sat < this.r; sat++) {\n x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);\n y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);\n rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);\n ctx.fillStyle = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';\n ctx.fillRect(x - 0.5, y - 0.5, 2, 2);\n }\n }\n ctx.strokeStyle = 'rgba(0,0,0,1)';\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.stroke();\n\n this.hueCircle = ctx.getImageData(0,0,w,h);\n }\n this.generated = true;\n }", "createPicker(pickerConfig) {\n const me = this,\n { multiSelect, pickerWidth } = me,\n picker = new List(\n ObjectHelper.merge(\n {\n owner: me,\n floating: true,\n scrollAction: 'realign',\n itemsFocusable: false,\n activateOnMouseover: true,\n store: me.store,\n selected: me.valueCollection,\n multiSelect,\n cls: me.listCls,\n itemTpl: me.listItemTpl || ((item) => item[me.displayField]),\n forElement: me[me.pickerAlignElement],\n align: {\n align: 't-b',\n axisLock: true,\n matchSize: pickerWidth == null,\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n width: pickerWidth,\n navigator: {\n keyEventTarget: me.input\n },\n maxHeight: 324,\n scrollable: {\n overflowY: true\n },\n autoShow: false,\n focusOnHover: false\n },\n pickerConfig\n )\n );\n\n picker.element.dataset.emptyText = me.emptyText || me.L('No results');\n\n return picker;\n }", "function InnerPicker(props) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n _onKeyDown = props.onKeyDown,\n _onSelect = props.onSelect,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var inputRef = __WEBPACK_IMPORTED_MODULE_8_react__[\"useRef\"](null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time'; // ============================= State =============================\n\n var formatList = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__utils_miscUtil__[\"a\" /* toArray */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_17__utils_uiUtil__[\"a\" /* getDefaultFormat */])(format, picker, showTime, use12Hours)); // Panel ref\n\n var panelDivRef = __WEBPACK_IMPORTED_MODULE_8_react__[\"useRef\"](null);\n var inputDivRef = __WEBPACK_IMPORTED_MODULE_8_react__[\"useRef\"](null); // Real value\n\n var _useMergedState = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // Selected value\n\n\n var _React$useState = __WEBPACK_IMPORTED_MODULE_8_react__[\"useState\"](mergedValue),\n _React$useState2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1]; // Operation ref\n\n\n var operationRef = __WEBPACK_IMPORTED_MODULE_8_react__[\"useRef\"](null); // Open\n\n var _useMergedState3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1]; // ============================= Text ==============================\n\n\n var _useValueTexts = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__hooks_useValueTexts__[\"a\" /* default */])(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n\n var _useTextValueMapping = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_19__hooks_useTextValueMapping__[\"a\" /* default */])({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_dateUtil__[\"a\" /* parseValue */])(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2]; // ============================ Trigger ============================\n\n\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n\n if (onChange && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_dateUtil__[\"b\" /* isEqual */])(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_dateUtil__[\"c\" /* formatValue */])(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n\n triggerInnerOpen(newOpen);\n };\n\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_warning__[\"a\" /* default */])(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n\n var onInternalMouseUp = function onInternalMouseUp() {\n if (onMouseUp) {\n onMouseUp.apply(void 0, arguments);\n }\n\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n }; // ============================= Input =============================\n\n\n var _usePickerInput = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_18__hooks_usePickerInput__[\"a\" /* default */])({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_17__utils_uiUtil__[\"b\" /* elementsContains */])([panelDivRef.current, inputDivRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing; // ============================= Sync ==============================\n // Close should sync back with text value\n\n\n __WEBPACK_IMPORTED_MODULE_8_react__[\"useEffect\"](function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]); // Change picker should sync back with text value\n\n __WEBPACK_IMPORTED_MODULE_8_react__[\"useEffect\"](function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]); // Sync innerValue with control mode\n\n __WEBPACK_IMPORTED_MODULE_8_react__[\"useEffect\"](function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]); // ============================ Private ============================\n\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n }\n\n var _useHoverValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__hooks_useHoverValue__[\"a\" /* default */])(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2]; // ============================= Panel =============================\n\n\n var panelProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n\n var panelNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_12__PickerPanel__[\"a\" /* default */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({}, panelProps, {\n generateConfig: generateConfig,\n className: __WEBPACK_IMPORTED_MODULE_9_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onSelect: function onSelect(date) {\n _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date);\n setSelectedValue(date);\n },\n direction: direction,\n onPanelChange: function onPanelChange(viewDate, mode) {\n var onPanelChange = props.onPanelChange;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }));\n\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n\n var panel = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n\n var clearNode;\n\n if (allowClear && mergedValue && !disabled) {\n clearNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n } // ============================ Warning ============================\n\n\n if (process.env.NODE_ENV !== 'production') {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_warning__[\"a\" /* default */])(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n } // ============================ Return =============================\n\n\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_16__PanelContext__[\"a\" /* default */].Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_13__PickerTrigger__[\"a\" /* default */], {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"div\", {\n className: __WEBPACK_IMPORTED_MODULE_9_classnames___default()(prefixCls, className, (_classNames2 = {}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onInternalMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onClick\n }, /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"div\", {\n className: __WEBPACK_IMPORTED_MODULE_9_classnames___default()(\"\".concat(prefixCls, \"-input\"), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_8_react__[\"createElement\"](\"input\", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps, {\n size: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_17__utils_uiUtil__[\"c\" /* getInputSize */])(picker, formatList[0], generateConfig)\n }, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__utils_miscUtil__[\"b\" /* default */])(props), {\n autoComplete: autoComplete\n })), suffixNode, clearNode))));\n} // Wrap with class component to enable pass generic with instance method", "function initialize() {\n\tvar canvas = document.getElementById(\"gradientShapeCanvas\"); //get a reference to the canvas\n\tvar context = canvas.getContext(\"2d\"); //get the context of the canvas\n\tvar gradient = context.createLinearGradient(0, 50, 0, 250); //create a linear gradient\n\tcontext.beginPath(); //begin drawing the shape/path\n\tcontext.moveTo(50, 50); //move the origin to 50, 50\n\tcontext.lineTo(400, 200); //move the line\n\tcontext.lineTo(200, 250); //move the line\n\tcontext.lineTo(50, 250); //move the line\n\tcontext.closePath(); //close the path/shape\n\tcontext.lineWidth = 8; //set the line width to 8px\n\tcontext.lineJoin = \"round\"; //make the joins round\n\tcontext.stroke(); //actually draw the shape/path\n\tgradient.addColorStop(\"0\", \"green\"); //set the starting gradient color to green\n\tgradient.addColorStop(\"0.75\", \"blue\"); //set the middle gradient color to blue\n\tgradient.addColorStop(\"0.85\", \"violet\"); //set the end gradient color to violet\n\tcontext.fillStyle = gradient; //set the fill style to the gradient\n\tcontext.fill(); //actually add the fill style\n}", "function InnerPicker(props) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n _onKeyDown = props.onKeyDown,\n _onSelect = props.onSelect,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var inputRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time'; // ============================= State =============================\n\n var formatList = (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__.toArray)((0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.getDefaultFormat)(format, picker, showTime, use12Hours)); // Panel ref\n\n var panelDivRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null);\n var inputDivRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null); // Real value\n\n var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__.default)(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // Selected value\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_8__.useState(mergedValue),\n _React$useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1]; // Operation ref\n\n\n var operationRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null); // Open\n\n var _useMergedState3 = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__.default)(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1]; // ============================= Text ==============================\n\n\n var _useValueTexts = (0,_hooks_useValueTexts__WEBPACK_IMPORTED_MODULE_20__.default)(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n\n var _useTextValueMapping = (0,_hooks_useTextValueMapping__WEBPACK_IMPORTED_MODULE_19__.default)({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.parseValue)(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2]; // ============================ Trigger ============================\n\n\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n\n if (onChange && !(0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.isEqual)(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.formatValue)(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n\n triggerInnerOpen(newOpen);\n };\n\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__.default)(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n\n var onInternalMouseUp = function onInternalMouseUp() {\n if (onMouseUp) {\n onMouseUp.apply(void 0, arguments);\n }\n\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n }; // ============================= Input =============================\n\n\n var _usePickerInput = (0,_hooks_usePickerInput__WEBPACK_IMPORTED_MODULE_18__.default)({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !(0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.elementsContains)([panelDivRef.current, inputDivRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing; // ============================= Sync ==============================\n // Close should sync back with text value\n\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]); // Change picker should sync back with text value\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]); // Sync innerValue with control mode\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]); // ============================ Private ============================\n\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n }\n\n var _useHoverValue = (0,_hooks_useHoverValue__WEBPACK_IMPORTED_MODULE_21__.default)(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2]; // ============================= Panel =============================\n\n\n var panelProps = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__.default)({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n\n var panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PickerPanel__WEBPACK_IMPORTED_MODULE_12__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__.default)({}, panelProps, {\n generateConfig: generateConfig,\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()((0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onSelect: function onSelect(date) {\n _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date);\n setSelectedValue(date);\n },\n direction: direction,\n onPanelChange: function onPanelChange(viewDate, mode) {\n var onPanelChange = props.onPanelChange;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }));\n\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n\n var panel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n\n var clearNode;\n\n if (allowClear && mergedValue && !disabled) {\n clearNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n } // ============================ Warning ============================\n\n\n if (true) {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__.default)(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n } // ============================ Return =============================\n\n\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PanelContext__WEBPACK_IMPORTED_MODULE_16__.default.Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PickerTrigger__WEBPACK_IMPORTED_MODULE_13__.default, {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(prefixCls, className, (_classNames2 = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onInternalMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onClick\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(\"\".concat(prefixCls, \"-input\"), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"input\", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__.default)({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps, {\n size: (0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.getInputSize)(picker, formatList[0], generateConfig)\n }, (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__.default)(props), {\n autoComplete: autoComplete\n })), suffixNode, clearNode))));\n} // Wrap with class component to enable pass generic with instance method", "function set_gradient(json_gradient) {\r\n var obj = canvas.getActiveObject();\r\n if (obj) {\r\n if (obj.type == 'i-text') {\r\n obj.set('fill', new fabric.Gradient({\r\n type: 'linear',\r\n coords: {\r\n x1: 0,\r\n y1: 0,\r\n x2: obj.width,\r\n y2: obj.height,\r\n },\r\n colorStops: json_gradient\r\n }));\r\n canvas.renderAll();\r\n }\r\n }\r\n}", "function set_gradient(json_gradient) {\r\n var obj = canvas.getActiveObject();\r\n if (obj) {\r\n if (obj.type == 'i-text') {\r\n obj.set('fill', new fabric.Gradient({\r\n type: 'linear',\r\n coords: {\r\n x1: 0,\r\n y1: 0,\r\n x2: obj.width,\r\n y2: obj.height,\r\n },\r\n colorStops: json_gradient\r\n }));\r\n canvas.renderAll();\r\n }\r\n }\r\n}", "function set_gradient(json_gradient) {\r\n var obj = canvas.getActiveObject();\r\n if (obj) {\r\n if (obj.type == 'i-text') {\r\n obj.set('fill', new fabric.Gradient({\r\n type: 'linear',\r\n coords: {\r\n x1: 0,\r\n y1: 0,\r\n x2: obj.width,\r\n y2: obj.height,\r\n },\r\n colorStops: json_gradient\r\n }));\r\n canvas.renderAll();\r\n }\r\n }\r\n}", "function changePickerMode(target, newMode) {\n let maxRange;\n let colArray;\n let rgbTmp;\n let hexColour = colourValue.value.replace('#', '');\n\n currentPickerMode = newMode;\n document.getElementsByClassName(\"cp-selected-mode\")[0].classList.remove(\"cp-selected-mode\");\n target.classList.add(\"cp-selected-mode\");\n\n switch (newMode)\n {\n case 'rgb':\n maxRange = [255,255,255];\n sliders[0].getElementsByTagName(\"label\")[0].innerHTML = 'R';\n sliders[1].getElementsByTagName(\"label\")[0].innerHTML = 'G';\n sliders[2].getElementsByTagName(\"label\")[0].innerHTML = 'B';\n break;\n case 'hsv':\n maxRange = [360, 100, 100];\n sliders[0].getElementsByTagName(\"label\")[0].innerHTML = 'H';\n sliders[1].getElementsByTagName(\"label\")[0].innerHTML = 'S';\n sliders[2].getElementsByTagName(\"label\")[0].innerHTML = 'V';\n break;\n case 'hsl':\n maxRange = [360, 100, 100];\n sliders[0].getElementsByTagName(\"label\")[0].innerHTML = 'H';\n sliders[1].getElementsByTagName(\"label\")[0].innerHTML = 'S';\n sliders[2].getElementsByTagName(\"label\")[0].innerHTML = 'L';\n break;\n default:\n console.log(\"wtf select a decent picker mode\");\n break;\n }\n\n for (let i=0; i<sliders.length; i++) {\n let slider = sliders[i].getElementsByTagName(\"input\")[0];\n\n slider.setAttribute(\"max\", maxRange[i]);\n }\n\n // Putting the current colour in the new slider\n switch(currentPickerMode) {\n case 'rgb':\n colArray = hexToRgb(hexColour);\n colArray = [colArray.r, colArray.g, colArray.b];\n break;\n case 'hsv':\n rgbTmp = hexToRgb(hexColour);\n colArray = rgbToHsv(rgbTmp);\n\n colArray.h *= 360;\n colArray.s *= 100;\n colArray.v *= 100;\n\n colArray = [colArray.h, colArray.s, colArray.v];\n\n break;\n case 'hsl':\n rgbTmp = hexToRgb(hexColour);\n colArray = rgbToHsl(rgbTmp);\n\n colArray.h *= 360;\n colArray.s *= 100;\n colArray.l *= 100;\n\n colArray = [colArray.h, colArray.s, colArray.l];\n\n break;\n default:\n break;\n }\n\n for (let i=0; i<3; i++) {\n sliders[i].getElementsByTagName(\"input\")[0].value = colArray[i];\n }\n\n updateAllSliders();\n}", "renderBackgroundGradient(gradientImage, bounds) {\n let gradient;\n\n var scaleX = 1;\n let scaleY = 1;\n\n if (gradientImage instanceof LinearGradientContainer) {\n gradient = this.ctx.createLinearGradient(\n bounds.x + gradientImage.x0,\n bounds.y + gradientImage.y0,\n bounds.x + gradientImage.x1,\n bounds.y + gradientImage.y1\n );\n } else if (gradientImage instanceof RadialGradientContainer) {\n scaleX = gradientImage.scaleX || 1;\n scaleY = gradientImage.scaleY || 1;\n\n gradient = this.ctx.createRadialGradient(\n (bounds.x + gradientImage.x0) / scaleX,\n (bounds.y + gradientImage.y0) / scaleY,\n gradientImage.r,\n (bounds.x + gradientImage.x0) / scaleX,\n (bounds.y + gradientImage.y0) / scaleY,\n 0\n );\n }\n\n gradientImage.colorStops.forEach(colorStop => {\n gradient.addColorStop(colorStop.stop, colorStop.color.toString());\n });\n\n this.ctx.save();\n\n this.ctx.setTransform(\n scaleX * this.scale,\n 0,\n 0,\n scaleY * this.scale,\n 0,\n 0\n );\n\n this.rectangle(bounds.x / scaleX, bounds.y / scaleY, bounds.width, bounds.height, gradient);\n\n this.ctx.restore();\n }", "function initiateCaptionColorPicker() {\r\n var colorPickerInputArray = document.querySelectorAll(\r\n \"input.color-input\"\r\n );\r\n var red = document.getElementById(\"redCaptionColorSelector\").value;\r\n var green = document.getElementById(\"greenCaptionColorSelector\").value;\r\n var blue = document.getElementById(\"blueCaptionColorSelector\").value;\r\n colorPickerDisplay = document.getElementById(\"colorCaptionDisplay\");\r\n if (colorPickerDisplay && red && green && blue) {\r\n colorPickerDisplay.style.background = `rgba(${red}, ${green}, ${blue}, 1)`;\r\n }\r\n if (colorPickerInputArray && colorPickerInputArray.length > 0) {\r\n for (var i = 0; i < colorPickerInputArray.length; i++) {\r\n colorPickerInputArray[i].addEventListener(\"input\", function () {\r\n red = document.getElementById(\"redCaptionColorSelector\").value;\r\n green = document.getElementById(\"greenCaptionColorSelector\")\r\n .value;\r\n blue = document.getElementById(\"blueCaptionColorSelector\").value;\r\n colorPickerDisplay = document.getElementById(\r\n \"colorCaptionDisplay\"\r\n );\r\n if (colorPickerDisplay && red && green && blue) {\r\n colorPickerDisplay.style.background = `rgba(${red}, ${green}, ${blue}, 1)`;\r\n currentColorRGBValues = {\r\n red: red,\r\n green: green,\r\n blue: blue,\r\n alpha: \"1\"\r\n };\r\n }\r\n });\r\n }\r\n }\r\n currentColorRGBValues = {\r\n red: red,\r\n green: green,\r\n blue: blue\r\n };\r\n }", "function addSpectrum(obj,target){\n $('#prop-color-group-'+obj+'').spectrum({\n color:target.fill,\n change:function(color){\n target.fill = color.toHexString();\n canvas.renderAll();\n },\n move:function(color){\n target.fill = color.toHexString();\n canvas.renderAll();\n }\n });\n $('#prop-color-grad-1-'+obj+'').spectrum({\n color:color1,\n change:function(color){\n target.setGradient('fill',{\n x1: 0,\n y1: 0,\n x2: 0,\n y2: target.height,\n colorStops: {\n 0: color.toHexString(),\n 1: color2\n }\n });\n color1 = color.toHexString();\n canvas.renderAll();\n },\n move:function(color){\n target.setGradient('fill',{\n x1: 0,\n y1: 0,\n x2: 0,\n y2: target.height,\n colorStops: {\n 0: color.toHexString(),\n 1: color2\n }\n });\n color1 = color.toHexString();\n canvas.renderAll();\n }\n });\n $('#prop-color-grad-2-'+obj+'').spectrum({\n color:color2,\n change:function(color){\n target.setGradient('fill',{\n x1: 0,\n y1: 0,\n x2: 0,\n y2: target.height,\n colorStops: {\n 0: color1,\n 1: color.toHexString()\n }\n });\n color2 = color.toHexString();\n canvas.renderAll();\n },\n move:function(color){\n target.setGradient('fill',{\n x1: 0,\n y1: 0,\n x2: 0,\n y2: target.height,\n colorStops: {\n 0: color1,\n 1: color.toHexString()\n }\n });\n color2 = color.toHexString();\n canvas.renderAll();\n }\n });\n }", "function createGradient(ctx) {\n var num = threat_metadata.length - 1;\n var grd = ctx.createLinearGradient(-radius_elements_title, 0, radius_elements_title, 0);\n\n for (var i = 0; i <= num; i++) {\n grd.addColorStop(i / num, threat_metadata[i].color);\n }\n\n return grd;\n } //function createGradient" ]
[ "0.6408844", "0.59213406", "0.58637923", "0.58365434", "0.58052385", "0.5804588", "0.5787539", "0.576824", "0.5745963", "0.56734824", "0.56734824", "0.56734824", "0.56734824", "0.56734824", "0.56693137", "0.5643128", "0.5642134", "0.5618394", "0.56100994", "0.55595106", "0.554446", "0.55295646", "0.5495665", "0.5466919", "0.5438494", "0.54285055", "0.5394004", "0.53246105", "0.5302049", "0.52717537", "0.5245827", "0.52297145", "0.52207184", "0.520795", "0.51197016", "0.5104056", "0.51015127", "0.508138", "0.5063355", "0.50521857", "0.50512666", "0.503979", "0.50378376", "0.50378376", "0.50363207", "0.5034983", "0.5027619", "0.5020749", "0.5017119", "0.49903715", "0.49838722", "0.49780682", "0.49780682", "0.49780682", "0.49780682", "0.49780682", "0.49743906", "0.49743906", "0.49743906", "0.49705955", "0.49529493", "0.49417004", "0.49382502", "0.4936312", "0.4925376", "0.49144247", "0.4910003", "0.48992503", "0.4895094", "0.48821244", "0.48708445", "0.48531002", "0.4844648", "0.4837665", "0.48149082", "0.48061973", "0.4803784", "0.47951528", "0.47801113", "0.47767484", "0.4775871", "0.47614825", "0.47608984", "0.4747106", "0.4744622", "0.47227165", "0.47212076", "0.47055143", "0.47047216", "0.47043893", "0.46992743", "0.46900678", "0.46756673", "0.46756673", "0.46756673", "0.46739691", "0.46733025", "0.46511865", "0.46301147", "0.46287692" ]
0.7124908
0
remove todo by id
function removeTodoById(id, li) { connection.remove({ from: 'tasks', where: { id: id } }).then(() => { li.remove() // alert('Todo removed') }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTodo(id){\n console.log(id);\n document.getElementById(id).remove();\n }", "deleteTodo(id) {\r\n this.todos = this.todos.filter(todo => todo.id !== id);\r\n this._changeList(this._currentTab);\r\n }", "function removeTodo(id) {\n setTodos(todos.filter((todo) => todo.id !== id));\n }", "delTodo( id ) {\n /**\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n * filter: devuelve un array quitando el id que recibe\n * la funcion \n */\n this.todos = this.todos.filter( todo => todo.id != id );\n\n this.saveTodosToLS();\n }", "removeTodo(todoID) {\r\n const todoIndex = todos.findIndex(todo => todo.id === todoID)\r\n\r\n if (todoIndex > -1) todos.splice(todoIndex, 1)\r\n }", "function deleteToDoFromArr(id) {\n removeItem('toDoArray', id);\n}", "function removeTodo(todo) {\n const clickedId = todo.data('id');\n const deleteUrl = `${api}${clickedId}`;\n $.ajax({\n type: \"DELETE\",\n url: deleteUrl\n }).then(() => {\n todo.remove();\n }).catch((err) => {\n console.log(err);\n })\n }", "function deleteTodo(id) {\n\n //mengupdate data todos , dengan memfilter idnya\n todos = todos.filter(function (item) {\n // datanya adalah todo dengan id yang tidak dipilih\n return item.id != id\n })\n\n // update data, simpan dan masukan ke LS\n addToLocalStorage(todos)\n}", "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 remove(id) {\n $.ajax({\n url: base_url + `todos/${id}`,\n method: \"DELETE\",\n headers: {\n token: localStorage.getItem(\"access_token\")\n }\n })\n .done(response => {\n aut()\n })\n .fail((xhr, text) => {\n console.log(xhr, text)\n })\n }", "removeTodo(todoId) {\n TodoService.removeTodoAsync(todoId);\n }", "function deleteToDo( id ) {\n\n return fetch( `${postToDoURL}` + '/' + `${id}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n }\n } ).then( response => response.json() );\n }", "function removeTodo(todo) {\n\t//pull the mongo _id from the id key stored\n\t//in jQuery variable\n\tvar clickedId = todo.data('id');\n\t//prep for API request\n\tvar deleteUrl = '/api/todos/' + clickedId; \n\t//send delete request\n\t$.ajax({\n\t\tmethod: 'DELETE',\n\t\turl: deleteUrl\n\t})\n\t.then(function(data){\n\t\t//remove the li from the DOM\n\t\ttodo.remove();\n\t})\n\t.catch(function(err){\n\t\tconsole.log(err);\n\t});\n}", "function removeTodo (todoID) {\n const todoIndex = todos.findIndex(todoEl => todoEl.id === todoID)\n\n if (todoIndex > -1) {\n todos.splice(todoIndex, 1)\n saveTodos()\n }\n}", "function remove () {\n var id= this.getAttribute('id');\n var todos = get_todos();\n todos.splice(id, 1);\n localStorage.setItem('todo', JSON.stringify(todos));\n \n show();\n \n return false;\n }", "function deleteTodo(id) {\n // filters out the <li> with the id and updates the todos array\n todos = todos.filter(function(item) {\n // use != not !==, because here types are different. One is number and other is string\n return item.id != id;\n });\n\n // update the localStorage\n addToLocalStorage(todos);\n}", "[TOGGLE_TODO](state, id){\r\n const index = state.todoList.findIndex(item => item._id === id);\r\n\r\n state.todoList.splice(index, 1);\r\n }", "function deleteItem(id) {\n\tfor (let i = 0; i < todoArr.length; i++) {\n\t\tif (todoArr[i].id == id) {\n\t\t\ttodoArr.splice(i, 1);\n\t\t\t// localStorage.removeItem(id);\n\t\t}\n\t}\n\tinsertItem();\n}", "function deleteTask(id) {\n listTask = listTask.filter(function(item) {\n return item.id != id;\n });\n\n addToLocalStorage(listTask);\n}", "function removeTodo(todo) {\n const id = todo.data('id');\n $.ajax({\n method: 'DELETE',\n url: '/api/todos/' + id\n })\n .then((data) => {\n todo.remove();\n })\n .catch((err) => {\n console.log(err);\n });\n}", "todo_delete(todo){\n todosRef.child(todo['.key']).remove();\n this.activity_add(\"Todo with text \" + todo.task + \" removed\");\n var index = this.todos.indexOf(todo);\n if(index > -1){\n this.todos.splice(index, 1);\n }\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}", "remove(id) {\n TaskApi.remove(id)\n .then((response) => {\n if (response.data && response.data._id) {\n const indexToRemove = this.state.todos.findIndex(todo => todo._id === response.data._id);\n this.setState((state) => ({\n ...state,\n todos: state.todos.slice(0, indexToRemove).concat(state.todos.slice(indexToRemove + 1, state.todos.length)),\n }));\n }\n })\n .catch(error => {\n this.setState((state) => ({ ...state, error }));\n });\n }", "function deleteTodo(id){\n\tconsole.log(\"delete todo : \" + id)\n\t\n\tvar count = readCount();\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\t\n\tvar found_id = -1;\n\t\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\tfound_id = index;\n\t\t}\n\t\tif(found_id!=-1){\n\t\t\tlistArr[index][ID]--;\n\t\t}\n\t}\n\t\n\tif(found_id==-1){\n\t\treturn -1;\n\t}\n\n\tlistArr.splice(found_id, 1);\n\tconsole.log(\"count \" + readCount());\n\twriteTodosArray(readCount() - 1, listArr);\n\tconsole.log(\"count \" + readCount());\n\t\n\treturn 0;\n\t\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(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}", "remove(todo) {\n this.todoItems = this.todoItems\n .filter(item => item !== todo);\n }", "function remove(todo) {\n let state = dataHub.getState();\n state.todos = state.todos.filter((aTodo) => {\n return aTodo.id !== todo.id;\n });\n dataHub.setTodos(state.todos);\n return todosResource.deleteTodo(todo).then((data) => {\n return data\n });\n }", "static deleteTodoFromLocalStorage(id){\r\n const todo = Store.getDataFromLocalStorage()\r\n todo.forEach((ele,index) => {\r\n if(ele.id === id){\r\n todo.splice(index,1)\r\n }\r\n localStorage.setItem('todo',JSON.stringify(todo))\r\n });\r\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 deleteTodo(e) {\n // delete the todo item from DOM\ne.target.parentNode.remove();\n\n // delete the todo element from todos array\n console.log(e.target.parentNode.id)\n let index = e.target.parentNode.id\n todos.splice(index, 1)\n console.log(todos)\n}", "static removeItem(id, e) {\n //if we get the id\n //we only have to search for the pos\n var pos;\n var li;\n var lu = document.getElementById(\"listTask\");\n if(id === undefined || id === null){\n var items = e.parentElement.parentNode.parentElement;\n var li = items.parentElement;\n\n //get the input, it is placed \n //in the 4 position\n var hiddenInput = items.childNodes[2];\n pos = getPositionStored(hiddenInput.value);\n }\n else{\n pos = getPositionStored(id);\n li = lu.childNodes[pos];\n }\n\n if (pos !== -1) {\n storedTask.data.splice(pos, 1);\n //update data in Local Storage\n localStorage.setItem(\"task\", JSON.stringify(storedTask));\n }\n lu.removeChild(li);\n }", "function deleteToDo(event){\n //console.log(event.target);\n const btn = event.target;\n const li = btn.parentNode;\n toDoList.removeChild(li);\n// filter는 해당 함수가 toDos의 모든 items들에게 실행하도록 하여 treu인 item으로 다시 배열 구성\n// ex. 클릭하여 제거된 버튼의 부모 요소인 li의 id 값이 3일 경우, 나머지 id 들은 다시 배열 정렬 \n const cleanToDos = toDos.filter(function(toDo){\n //toDo.id 는 integer, li.id 는 string\n console.log(toDo);\n console.log(toDo.id, li.id);\n/*필터함수는 각 항목을 확인하면서( 어떻게 확인 할지는 function으로 만들었죠?) return값이 true인 항목만 모아서 반환합니다.\n\ntoDos에 6개의 항목이 있다고 가정하면 id가 1부터 6까지 있겠죠?\n4번째 삭제버튼을 누르면, 삭제버튼의 parentNode (삭제버튼이 있는 li태그) 의 id값은 4겠죠?\n\n그러면 toDos가 가진 아이템들(6개)을 하나씩 확인하면서 각 아이템의 id와 삭제버튼 (li.id) 의 아이디인 4를 비교해서 return 합니다.\n그럼 return 이 총 6번 이루어지는데 이때 리턴값이 false이면 필터함수가 걸러냅니다.\nreturn toDo.id !== parseInt(li.id)\n조건식이 toDos의 id와 삭제버튼의 parentNode인 li의 id와 달라야지 true 이므로\n하나씩 돌면서 toDos의 id가 4일때 li.id의 id가 4이면 같으므로 false를 리턴합니다.\n\n그러면 id값이 4인 항목만 건너뛰고 cleanToDos 에 5개의 아이템으로 이루어진 배열이 반환되어 할당됩니다.\n*/\n\n\n return toDo.id != parseInt(li.id);\n });\n //cleanToDos는 지우고 나서 남은애들이 저장되어있음.\n console.log(cleanToDos);\n \n toDos = cleanToDos;\n saveToDos();\n}", "function deleteToDo(event) {\n const btn = event.target; /* (어떤 버튼을 선택했는지 타겟지정) */\n const liTargeted = btn.parentNode;\n toDoList.removeChild(liTargeted);\n const cleanToDos = toDos.filter(function(toDo) {\n console.log(toDo);\n console.log(toDo.id, liTargeted.id); //toDo.id는 숫자, li.id는 문자열\n return toDo.id !== parseInt(liTargeted.id); //parseInt()로 정수형 숫자로 형변환해줌\n });\n toDos = cleanToDos; // 먼저 원소가 지워진 cleanToDos 배열을 toDos 배열로 바꿔주고\n saveToDos(); // 그 다음 저장한다.\n\n /* 선택된 버튼의 부모가 뭔지 몰라.. -console.log()로 띄워서 확인해보면\n 버튼마다 클릭했을 때 전부 <button>X</button>이라고 뜬다.\n 그래서 우리는 그 버튼의 부모 선택자인 li에 부여되었던 id값을 이용할 거야.\n console.dir로 확인하여서... 해당 태그의 모든 속성을 살펴보다..\n parentNode가 li인 것을 확인! console.log로 다시 확인\n 나누어서 로직을 짜준다.\n\n 한번 실행은 되지만 페이지 새로고침하면 삭제된 리스트가 다시 떠있다.ㅠ\n 해결해야겠지?\n */\n\n // filterFn()이 toDos 배열 안의 모든 원소에 통함\n // toDos.filter(filterFn)의 의미; filterFn()에 걸러져서 값이 true인 원소만 return한다.\n // AGAIN; .filter() runs a function through every item of the array\n // and then makes a new array only with the items that are 'true'.\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 deleteTodo(todo){\n self.todos.$remove(todo);\n }", "function deletetodo(todo) {\n const id = todo.children[1].childNodes[1].value;\n $.ajaxSetup({\n headers: {\n \"X-CSRF-TOKEN\": $('meta[name=\"csrf-token\"]').attr(\"content\"),\n },\n });\n $.ajax({\n type: \"delete\",\n url: \"/deleteTask/\" + id,\n data: { id: id },\n success: function (response) {\n getTodolist();\n },\n });\n}", "removeToDo(indexToDo) {\n this.todos.splice(indexToDo, 1);\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}", "removeTodo({ commit }, id) {\n console.log(\"commit\", commit, id);\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 deleteItem(id){\r\n $.ajax(\r\n {\r\n url: 'http://157.230.17.132:3019/todos/' + id,\r\n method: 'DELETE',\r\n success: function(dataResponse){\r\n getList();\r\n },\r\n error: function(){\r\n alert(\"Non è possibile cancellare l'elemento!\")\r\n }\r\n }\r\n );\r\n }", "function removeTodos(todo){\n checksaveTodos();\n const todoIndex = todos.indexOf(todo.innerText);\n console.log(todoIndex);\n todos.splice(todoIndex, 1);\n localStorage.setItem(\"todos\",JSON.stringify(todos));\n pendingItem(todos);\n}", "del(_id) {\n const _elem = this._elements[_id];\n const i = this._elemTodo.indexOf(_id);\n if (i !== -1) {\n this._elemTodo.splice(i, 1);\n }\n delete this._styleCache[_id];\n delete this._elemTodoH[_id];\n delete this._elements[_id];\n this._freeElemIds.push(_id);\n const _parent = _elem.parentNode;\n if (_parent) {\n _parent.removeChild(_elem);\n }\n else {\n console.warn('ELEM.del(', _id,\n '): Invalid parent: ', _parent,\n 'for elem:', _elem);\n }\n }", "del(_id) {\n const _elem = this._elements[_id];\n const i = this._elemTodo.indexOf(_id);\n if (i !== -1) {\n this._elemTodo.splice(i, 1);\n }\n delete this._styleCache[_id];\n delete this._elemTodoH[_id];\n delete this._elements[_id];\n this._freeElemIds.push(_id);\n const _parent = _elem.parentNode;\n if (_parent) {\n _parent.removeChild(_elem);\n }\n else {\n console.warn('ELEM.del(', _id,\n '): Invalid parent: ', _parent,\n 'for elem:', _elem);\n }\n }", "function remove(id){\n return db('trips').where('id',id).del();\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteNote(id) {\r\n console.log(\"deleted id: \" + id);\r\n\r\n setListNote((prevList) => {\r\n return prevList.filter((note, index) => {\r\n return index !== id;\r\n });\r\n });\r\n }", "function removeHandler(e) {\n const removeId = e.target.parentElement.getAttribute(\"data-task-id\");\n\n if (confirm(\"Are you sure ?!\")) {\n const foundIndex = toDoList.findIndex((el) => {\n return el.idNum === removeId;\n });\n\n toDoList.splice(foundIndex, 1);\n\n commitToLocalStorage(toDoList);\n reRender();\n }\n}", "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}", "deleteTodo(todo) {\r\n this.todos.splice(todo, 1);\r\n // console.log(todo);\r\n }", "function deleteTask(id) {\n const updatedTasks = tasks.filter((task) => task.taskId !== id);\n setTasks(updatedTasks);\n }", "function deleteTodo(todo) {\n $(todo).parent().remove();\n}", "function deleteItem(elem) {\r\n var id = elem.parent().attr(\"id\");\r\n firebase\r\n .database()\r\n .ref(\"/todos/\" + id)\r\n .remove();\r\n }", "function deleteItem(id){\n \n setTodoList((prev) =>{\n return prev.filter((eachItem , index) => {\n return index !== id;\n })\n })\n}", "function removeToDo(element){\r\n element.parentNode.parentNode.removeChild(element.parentNode);\r\n SIDELIST[activeid].list[element.id].trash = true;\r\n}", "removeToDo(item) {\n Meteor.call('todos.removeToDo', item);\n }", "function deleteNote(id) {\n setNotesList(prevList => {\n return (prevList.filter(\n (value, index) => index !== id))\n });\n }", "static async removeTask(id) {\n let result = await Task.findOneAndDelete({id}).exec()\n return result\n }", "handleRemove(todo) {\n\t\t// para exclusao ou alteracao, precisamos chamar o id na URL\n\t\taxios.delete(`${URL}/${todo._id}`)\n\t\t\t\t\t// sempre que remove um item na lista, ele chama o metodo refresh para atualizar.\n\t\t\t\t\t.then(resp => this.refresh(this.state.description))\n\t}", "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 }", "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}", "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 deleteTaskFromToDoList(event) {\n event.target.parentElement.remove();\n}", "function removeTodo(e) {\n if(!e.target.matches('#remove')) return\n e.target.parentNode.parentNode.remove()\n el = e.target\n const index = el.dataset.index\n items.splice(index, 1)\n localStorage.setItem('items', JSON.stringify(items))\n populateList(items, todoList)\n }", "function remove(id) {\n return db('tickets').where({ id }).del();\n}", "function removeItem(){\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var value = item.innerText;\n \n \n data.todo.splice(data.todo.indexOf(value),1);\n \n \n dataObjectUpdated();\n \n parent.removeChild(item);\n}", "function removal(){\n let list = document.getElementById(\"todoList\")\n list.removeChild(list.childNodes[0]);\n}", "function removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "function clearTask(id) {\n \"use strict\";\n tasks.splice(id, 1);\n displayTasks.tasksReload();\n }", "removeNote(id) {\n // use get notes function to acess array of notes\n return this.getNotes()\n // filter through notes array to get all notes besides the one with the matching ID\n .then(notes => this.write(notes.filter(note => note.id != id)))\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 }", "remove(id) {\n\t\tconsole.log('removing item at', id)\n\t\tthis.setState(prevState => ({\n\t\t\tnotes: prevState.notes.filter(note => note.id !== id)\n\t\t}))\n\t}", "function removeTodoListItemFromDatabase(todoID) {\n\n \tvar defer = $q.defer();\n\n \t$http({\n\n \t\tmethod: \"DELETE\",\n \t\turl: todoApiUrl + todoID\n \t})\n \t.then(function(response) {\n\n \t\t// check the DELETE response to see if we got an object or not\n \t\tif (typeof response.data === 'object') {\n\n \t\t\t\tdefer.resolve(response.data);\n\n \t\t} else {\n\n \t\t\tdefer.reject(response);\n\n \t\t}\n\n \t},\n \t// error handling of server generated error responses\n \tfunction(error) {\n\n \t\tdefer.reject(error);\n\n \t});\n\n \treturn defer.promise;\n }", "function deleteTask(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/task/\"+id\n })\n .then(function() {\n viewData();\n });\n }", "function removeNote(id) {\n // find object (note) for which id equals the argument\n const noteIndex = notes.findIndex(function(note) {\n return note.id === id;\n });\n if (noteIndex > -1) {\n // delete that one object\n notes.splice(noteIndex, 1);\n }\n}", "function remove_item(id) {\n var deleting = $.post('dlt-todo.php',{\n delete_id: id\n });\n\n deleting.done(function(){\n $('#'+id).remove();\n $('.alert-delete').show();\n setTimeout(function(){ $('.alert-delete').hide(); }, 3000);\n })\n\n\n }", "function removeItem() {\n let value = this.parentNode.lastChild.textContent;\ntodo.splice(todo.indexOf(value), 1);\n this.parentNode.parentNode.removeChild(this.parentNode);\n saveTodos();\n}", "removeTodo ({ commit }, todo) {\n commit('removeTodo', todo)\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 }", "function removeItem() {\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var text = item.innerText.trim();\n\n if (id === 'todo') {\n data.todo.splice(data.todo.indexOf(text), 1);\n } else if (id === 'done') {\n data.done.splice(data.done.indexOf(text), 1);\n }\n parent.removeChild(item);\n\n dataObjectUpdated();\n \n}", "function deleteItem(id, tag) {\n\t\tconst updated = [...todo].filter((current) => current.id !== id) //used for category purposes\n\t\tconst updatedCategory = [...categories]\n\n\t\tif (updated.length < 1) {\n\t\t\tconst first = updatedCategory.filter((current) => current !== tag) //makes sure deletion of categories when less than 1 item. Had this bug for a while...\n\t\t\tsetCategories(first)\n\t\t}\n\t\telse {\n\t\t\tupdated.map((item) => { //deletes tag when there are no more items with said tag\n\t\t\t\tif (tag !== item.tag) {\n\t\t\t\t\tconsole.log('item.tag')\n\t\t\t\t\tconst final = updatedCategory.filter((current) => current !== tag)\n\t\t\t\t\tsetCategories(final)\n\t\t\t\t}\n\t\t\t\treturn item\n\t\t\t})\n\t\t}\n\t\tfetch(`http://127.0.0.1:3010/tasks/${id}`, { //deletes item from db \n\t\t\tmethod: 'DELETE'\n\t\t})\n\t\twindow.location.reload()\n\n\t}", "async removeTodo(todoId) {\n // console.log(\"working\", todoId);\n try {\n await TodoService.removeTodoAsync(todoId);\n } catch (error) {\n debugger;\n console.error(\"[ERROR]:\", error);\n }\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "removeTravel(id) {\n if (confirm(\"Deseja mesmo remover a viagem?\")) {\n this.travels = this.travels.filter(\n (travel) => travel.id !== id\n )\n }\n\n }", "static deleteById(req, res) {\n\t\t//delete referensi di user dulu\n\t\tUser.findByIdAndUpdate(req.headers.userId, {\n\t\t\t$pull: { userTodos: { $in: ObjectId(req.params.todoId) } }\n\t\t})\n\t\t\t.exec()\n\t\t\t.then(deleteResponse => {\n\t\t\t\tres.json(deleteResponse);\n\t\t\t\t///return Todo.findByIdAndRemove(ObjectId(req.params.todoId));\n\t\t\t})\n\t\t\t.then(response => {\n\t\t\t\tres.status(200).json({\n\t\t\t\t\tmessage: \"Todo Deleted\"\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tres.status(400).json({\n\t\t\t\t\tmessage: err.message,\n\t\t\t\t\tdata: err\n\t\t\t\t});\n\t\t\t});\n\t}", "function removeTodo(event) {\n var todoIndex = parseInt(event.target.parentElement.getAttribute(\"data-index\"));\n todos.splice(todoInput,1);\n updateLocalStorage();\n renderTodos();\n}", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "deleteById(id) {\n let sqlRequest = \"DELETE FROM taskItem WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "removeTask(target) {\n if (!target.classList.contains(\"todo-list__btn-remove\")) return;\n let li = target.parentElement;\n if (li.classList.contains(\"todo-list__item--done\")) {\n let index = [...li.parentElement.children].indexOf(li);\n this.doneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n li.remove();\n } else {\n let index = [...li.parentElement.children].indexOf(li);\n this.undoneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n li.remove();\n }\n }", "function delToDo(e){\n const clickI = e.target;\n const clickBtn = clickI.parentNode;\n const clickLi = clickBtn.parentNode;\n // delete from ONGOING LIST\n if(clickLi.parentNode === ongoList){\n ongoList.removeChild(clickLi);\n const removeOngo = ONGOING.filter(function(something){\n // console.log(toDo.id, clickLi.id);\n return something.id !== parseInt(clickLi.id);\n });\n ONGOING = removeOngo;\n saveOngo();\n }else{\n // delete from FINISHED LIST\n finList.removeChild(clickLi);\n const removeFinished = FINISHED.filter(function(toDo){\n // console.log(toDo.id, clickLi.id);\n return toDo.id !== parseInt(clickLi.id);\n });\n FINISHED = removeFinished;\n saveFin();\n }\n}", "function deleteToDo() {\n //I want my list toDos to be filled with filtered items that are not\n //filter is a built in function for lists, which runs a function against your lists\n //item is creating another anonomys function (instead of function ()) and\n //alternative to write [after .filter( ] this could be: function(item){ } item => {return item !== toDos;}\n toDos = toDos.filter(item => {\n return item.id !== toDo.id;\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 }", "delete() { all = all.filter(task => task.id !== this.id) }", "function deleteTask($scope, todoToDelete) {\n $http.delete(`/todos/${todoToDelete._id}`).success(response => {\n getLists($scope);\n });\n }", "function deleteTodo ({todoID}) {\n return knex(\"todos\")\n .del()\n .where({\n id: todoID\n })\n}", "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 deleteTodo(id){\n $('#todoModal').modal('toggle');\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function(){\n if (xhr.readyState == 4 && xhr.status == 200){\n var parent = document.getElementById('todosList');\n\t\t\tvar enfant = document.getElementById('todo_'+id);\n\t\t\tparent.removeChild(enfant);\n }else{\n }\n }\n xhr.open('POST','./ajax/todo.delete.php');\n\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n var data = 'id=' +id;\n\txhr.send(data);\n}", "function deleteTodo(key) {\n //Retrieve the index of the todo entry in the collection. \n const index = todoItems.findIndex((item) => item.id === Number(key));\n //Set delete attribute to true for todo entry\n const todo = {\n deleted: true,\n ...todoItems[index],\n\n };\n todoItems = todoItems.filter((item) => item.id !== Number(key));\n // console.table(todoItems)\n //trigger page update by invoking renderTodo function.\n renderTodo(todo);\n}", "function deleteTask(id){\n API.deleteTask(id)\n .then(()=>{\n getTasks();\n }).catch();\n }" ]
[ "0.8605196", "0.8281466", "0.8218897", "0.8181986", "0.80951536", "0.80237436", "0.7956088", "0.79301983", "0.7841629", "0.7789171", "0.77714443", "0.7763824", "0.7742939", "0.7712732", "0.77099705", "0.7707687", "0.765229", "0.76473784", "0.76441395", "0.763017", "0.76299906", "0.7584358", "0.7582334", "0.7557448", "0.75337946", "0.75236803", "0.751593", "0.7469281", "0.7467514", "0.7456536", "0.74546087", "0.7423731", "0.73948896", "0.73912495", "0.7364606", "0.7363777", "0.73594517", "0.73497754", "0.73326737", "0.729345", "0.726786", "0.7267488", "0.7260585", "0.7252377", "0.7252377", "0.72460634", "0.7238947", "0.7225168", "0.72207445", "0.7206562", "0.72053033", "0.71977246", "0.7182692", "0.71809345", "0.7173346", "0.7171247", "0.71695495", "0.7143097", "0.71412843", "0.71324706", "0.71151376", "0.71113396", "0.7106474", "0.7102244", "0.71005136", "0.7089302", "0.70871586", "0.70694554", "0.7067694", "0.706598", "0.7048672", "0.7048549", "0.70458114", "0.70443153", "0.70374554", "0.7032499", "0.7024925", "0.7011078", "0.69868594", "0.69866705", "0.69830984", "0.69822246", "0.69815946", "0.69791925", "0.6961421", "0.6960467", "0.69571453", "0.6950776", "0.6948733", "0.694106", "0.69349754", "0.6923485", "0.69132966", "0.6901167", "0.68986446", "0.6895701", "0.6890017", "0.6888533", "0.6888302", "0.68855876" ]
0.83325195
1
Create the object called cashRegister and initialize its total property
function cashRegister(){ this.total = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(cash, balance) {\n this.cash = cash;\n this.balance = balance;\n this.stocks = [];\n }", "function SalaryCalculator(){\n this.basic = 0;\n this.hra = 0;\n this.da = 0;\n this.tax = 0;\n}", "constructor () {\n\t\tthis.coins = 0;\n\t}", "function SalaryCalculator(){\n this.basic = 0;\n this.hra = 0;\n this.da = 0;\n this.tax = 0;\n this.__salary = 0;\n}", "init() {\n this.coinsCollected = 0\n }", "function checkCashRegister2(price, cash, cid) {\n\n const denominations = [\n {name: 'ONE HUNDRED', value: 100},\n {name: 'TWENTY', value: 20},\n {name: 'TEN', value: 10},\n {name: 'FIVE', value: 5},\n {name: 'ONE', value: 1},\n {name: 'QUARTER', value: 0.25},\n {name: 'DIME', value: 0.10},\n {name: 'NICKEL', value: 0.05},\n {name: 'PENNY', value: 0.01}\n ];\n\n let change = +(cash - price).toFixed(2);\n\n const register = cid.reduce(function(acc, curr) {\n acc.total += curr[1];\n acc.total = +acc.total.toFixed(2);\n acc[curr[0]] = curr[1];\n return acc;\n }, {total: 0});\n\n const returnChange = denominations.reduce((acc, curr) => {\n let value = 0;\n while(register[curr.name] > 0 && change >= curr.value) {\n change -= curr.value;\n register[curr.name] -= curr.value;\n value += curr.value;\n\n change = Math.round(change * 100) / 100;\n }\n\n if(value > 0) {\n acc.push([curr.name, value]);\n }\n\n return acc;\n\n }, []);\n\n if (register.total < change) {\n return \"Insufficient Funds\";\n } else if(register.total === change) {\n return \"Closed\";\n } else {\n return returnChange;\n }\n\n}", "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "function sumarAlCarrito(){\n numeroDeClases = numeroDeClases + 1;\n totalClase = valorClase * numeroDeClases;\n console.log(\"El valor de las clases reservadas es de $\" + totalClase + \". Reservo \" + numeroDeClases + \" clases\");\n }", "afficherTotalPayer() {\r\n\r\n let elmH4 = document.createElement('h4');\r\n let elmH3 = document.createElement('h3');\r\n\r\n let texteContenu = this.total ;\r\n let titreTextContenu = \" Total : \" \r\n\r\n let texte = document.createTextNode(texteContenu);\r\n let titreTexte = document.createTextNode(titreTextContenu);\r\n\r\n elmH4.appendChild(texte);\r\n elmH3.appendChild(titreTexte);\r\n\r\n document.getElementById('iTotal').appendChild(elmH3);\r\n document.getElementById('iTotal').appendChild(elmH4);\r\n }", "calculateAutoBudgetCost() {\n this.cost = parseInt( parseInt(this.monthlyRentCost) + parseInt(this.homeInsuranceCost) + parseInt(this.utilitiesCost));\n }", "function createTotal(cost) {\n let total_container = document.querySelector(\".cart\");\n total_container.innerHTML += `<div class=\"total-div\">\n <p class=\"total-p\">Total : R${cost}.00</p>\n </div>`;\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 }", "constructor(name, cost) {\n this.name = name;\n this.shares = 0;\n this.cost = cost;\n this.totSharesBought = 0;\n this.totSharesSold = 0;\n }", "constructor(initialBalance) {\n this.balance = initialBalance;\n this.lastBalance = initialBalance;\n }", "function checkCashRegister(price, cash, cid) {\n let moneyBack = cash - price;\n let change = null;\n let finalArr = [];\n let finalResult = {};\n\n let acc = 0;\n cid.forEach((item) => (acc += item[1]));\n\n if (acc === moneyBack) {\n return {\n status: 'CLOSED',\n change: [\n ['PENNY', 0.5],\n ['NICKEL', 0],\n ['DIME', 0],\n ['QUARTER', 0],\n ['ONE', 0],\n ['FIVE', 0],\n ['TEN', 0],\n ['TWENTY', 0],\n ['ONE HUNDRED', 0],\n ],\n };\n }\n\n return getTheMoney(moneyBack, change, cid, finalArr);\n}", "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "static initialize(obj, fee, burn) { \n obj['fee'] = fee;\n obj['burn'] = burn;\n }", "constructor() {\n this.storage = {};\n this.amount = 0;\n }", "constructor() {\n\t\tthis.counterFactualContracts = {};\n\t}", "static initialize(obj, companyName, companyAddress, companyBranch, contactName, publishedOn, subTotal, totalAfterDiscount, grandTotal) { \n obj['companyName'] = companyName;\n obj['companyAddress'] = companyAddress;\n obj['companyBranch'] = companyBranch;\n obj['contactName'] = contactName;\n obj['publishedOn'] = publishedOn;\n obj['subTotal'] = subTotal;\n obj['totalAfterDiscount'] = totalAfterDiscount;\n obj['grandTotal'] = grandTotal;\n }", "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "function totalCalculate(){\n const firstClassCount = getInput('firstClassTicket');\n const economyClassCount = getInput('economyClassTicket');\n var totalTicket = firstClassCount + economyClassCount;\n const totalPrice = firstClassCount * 150 + economyClassCount * 100;\n document.getElementById('subTotal').innerText = '$' + totalPrice;\n const tax = Math.round(totalPrice * 0.1);\n document.getElementById('tax-amount').innerText = '$' + tax;\n const grandTotal = totalPrice + tax;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n document.getElementById('firstClassQuantity').innerText = firstClassCount;\n document.getElementById('firstClassPrice').innerText ='$' + firstClassCount * 150;\n document.getElementById('economyClassQuantity').innerText = economyClassCount;\n document.getElementById('economyClassPrice').innerText ='$' + economyClassCount * 100;\n document.getElementById('totalTicket').innerText = totalTicket;\n document.getElementById('totalTicketPrice').innerText ='$' + totalPrice;\n}", "function checkCashRegister(price, cash, cid) {\n\n console.log(\"price:\", price);\n console.log(\"cash:\", cash);\n // console.log(\"cid:\\n \", cid);\n \n let total = 0;\n \n for (let i=0; i<cid.length; i++) {\n for (let j=1;j<cid[i].length; j++) {\n console.log(\"cid[i][1]:\", cid[i][1]);\n total += cid[i][1];\n }\n }\n console.log(\"total:\", total);\n \n \n \n \n }", "calculateTotal() {\n\t\t//Réinitialise le total\n\t\tthis.total = 0\n\t\tfor (let product of this.products) {\n\t\t\tthis.total += product.price * product.number\n\t\t}\n\t}", "static get ACCOUNT_CREATION_PRICE() { return 10 * (10 ** 8); }", "function _init () {\t\t\n\t \t\t \t\n\t\t\tvar r = $scope.local;\n\t\t\t_getPricePerson();\n\t\t\tr.pax=$scope.totalPax;\n\t\t\t\n\t\t\t//(neto dmc)\t\t\t\n\t\t\tr.subtotalpax = $scope.booking.breakdown.agency.payment;\n\t\t\tr.total = r.subtotalpax;\n\t\t\tr.topay = r.subtotalpax;\n\t\t\t\n\t\t\t// calcular en base al vat seleccionado en la pantalla\n\t\t\tr.subtotal = r.topay / (1 +(parseInt(r.dmcvat)/100));\n\t\t\tr.subtotal = r.subtotal.toFixed(2);\n\t\t\t\n\t\t\t// regla del porcentaje amount/(1+(tax/100));\n\t\t\tr.vat = r.subtotal * (parseInt(r.dmcvat)/100);\n r.vat = r.vat.toFixed(2);\n\n var inv = recoverInvoice();\n (inv != null) ? $scope.invoice = inv : null;\n//\t\t\t//rellenar la fecha de la factura con la fecha actual (dd-mm-yyy)\n//\t\t\tvar fec = new Date();\n//\t\t\t$scope.local.invoiceDate = fec.getDate() + \"-\" + (fec.getMonth()+1) + \"-\" + fec.getFullYear();\n\t\t}", "async totalRegistration() {\n const total = await privateTokenSale.methods.totalRegistration().call();\n return total;\n }", "function totalCalculate(){\n const firstClassQuantityNumber = getQuantityValue('firstClass');\n const economyQuantityNumber = getQuantityValue('economy');\n\n //Sub-total Price\n const subTotalPrice = firstClassQuantityNumber * 150 + economyQuantityNumber * 100;\n document.getElementById('sub-total').innerText = subTotalPrice;\n\n //Total Tax\n const totalTax = Math.round(subTotalPrice * 0.1);\n document.getElementById('tax-amount').innerText = totalTax;\n \n //Total Amount\n const totalAmount = subTotalPrice + totalTax;\n document.getElementById('total-amount').innerText = totalAmount;\n \n //Total Fare\n const ticketFare = totalAmount;\n document.getElementById('total-fare').innerText = ticketFare;\n \n //Total Ticket\n const totalTicket = firstClassQuantityNumber + economyQuantityNumber;\n document.getElementById('total-ticket').innerText = totalTicket;\n}", "function BarbershopCustomer() {\n this.number = BarbershopCustomer.count\n this.hair_todo = true\n BarbershopCustomer.count += 1\n}", "get total(){\n debugger;\n return this.sum + Number(this.expense);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x40699cd0;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.currency = args.currency;\n this.totalAmount = args.totalAmount;\n }", "function Account() {\n\treturn {\n\t\taccountName: '',\n\t\tdomElement: $,\n\t\tbalance: 0,\n\t\tdeposit: function(amt) {\n\t\t\tthis.balance += amt;\n\t\t\tthis.refreshBalance();\n\t\t\tthis.logTransaction(amt, 'deposit');\n\t\t},\n\t\twithdraw: function(amt, type) {\n\t\t\tthis.balance -= amt;\n\t\t\tthis.refreshBalance();\n\t\t\tif (type ==='overdraw') {\n\t\t\t\tthis.logTransaction(amt, type);\n\t\t\t} else {\n\t\t\t\tthis.logTransaction(amt, 'withdraw');\n\t\t\t}\n\t\t},\n\t\ttransfer: function(amt, toAccount) {\n\t\t\tthis.balance -= amt;\n\t\t\ttoAccount.balance += amt;\n\t\t\tthis.refreshBalance();\n\t\t\ttoAccount.refreshBalance();\n\t\t\tvar type = 'transfer';\n\t\t\tif (this.accountName === 'checking') {\n\t\t\t\tthis.logTransaction(amt, type);\n\t\t\t\tthis.logTransaction(amt, type, 'savings');\n\t\t\t} else if (this.accountName === 'savings') {\n\t\t\t\tthis.logTransaction(amt, type);\n\t\t\t\tthis.logTransaction(amt, type, 'checking');\n\t\t\t}\n\t\t},\n\t\trefreshBalance: function() {\n\t\t\tvar roundedBalance = parseFloat(Math.round(this.balance * 100) / 100).toFixed(2);\n\t\t\tthis.domElement.find('.balance').html('$' + roundedBalance);\n\t\t},\n\t\tlogTransaction: function(amt, type, account) {\n\t\t\tvar transaction = new Transaction();\n\t\t\ttransaction.date = getDate();\n\t\t\tif (account) {\n\t\t\t\ttransaction.account = account;\n\t\t\t} else {\n\t\t\t\ttransaction.account = this.accountName;\n\t\t\t}\n\t\t\ttransaction.type = type;\n\t\t\ttransaction.amount = amt;\n\t\t\ttransaction.newBalance = this.balance;\n\t\t\t// Log transaction\n\t\t\ttransactionLog.push(transaction);\n\t\t\t// Print transaction\n\t\t\tprintTransaction(transaction);\n\t\t}\n\t}\n}", "createAccount(title, initialAmount)\n {\n let account = new Account(\n this.getNewAccountId(),\n title,\n initialAmount\n )\n\n this.accounts.push(account)\n\n return account\n }", "function Salad() {\n this.size = 0;\n this.additions = 0;\n this.deliveryfee = 0;\n this.totalcost = 0;\n this.type = \"Salad\";\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "function createData(cost, amount, total) {\n return { cost, amount, total };\n}", "constructor() {\r\n this.wallet = {\r\n bitcoin: {},\r\n ethereum: {}\r\n };\r\n this.crypto = '';\r\n }", "constructor() { \n \n CreditReportSummaryReport.initialize(this);\n }", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "constructor(props) {\n super(props);\n this.state = {\n stockDay: undefined,\n stocks: [],\n userCash: {\n cashValue: undefined,\n accountTotal: undefined,\n cashPercentage: undefined,\n },\n }\n }", "charge(payee,atm){\nif(this.balance()>= atm){\n let charge = new transaction((amt * -1), payee)\n this.transactions.push(charge)\n} else {\n console.log(\"insufficient funds\")\n}\n}", "function Data()\n{\n //parameters\n this.total = 0;\n this.domestic = 0;\n this.transborder = 0;\n this.other = 0;\n}", "static initialize(obj, transactionId, totalTransactionCost) {\n obj['transaction_id'] = transactionId;\n obj['total_transaction_cost'] = totalTransactionCost;\n }", "constructor(){\n this.balance = 0;\n this.observers = [];\n }", "payment(data, actions) {\n return actions.payment.create({\n transactions: [{\n amount: {\n total: paymentDetails.total(),\n currency: 'HKD'\n }\n }]\n });\n }", "constructor(accountNum, accOwner, transactions) {\n this.accountNum = accountNum;\n this.accOwner = accOwner;\n this.transactions = [];\n}", "addTransaction({ transactionData, cashCommissionFees }) {\n const newTransaction = new Transaction(transactionData);\n newTransaction.calculateCommission({\n userType: this.type,\n transactionsHistory: this.getTransactionsByCurrentWeek(newTransaction),\n cashCommissionFees,\n });\n this.transactionsHistory.push(newTransaction);\n }", "function IndicadorTotal () {}", "function checkCashRegister(price, cash, cid) {\n\n console.log(\"price:\", price);\n console.log(\"cash:\", cash);\n console.log(\"cid:\\n \", cid);\n \n \n \n \n }", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function Store(name, minHr, maxHr, avgCups, pounds) {\n this.loc = name;\n this.minHr = minHr;\n this.maxHr = maxHr;\n this.avgCups = avgCups;\n this.pounds = pounds;\n this.hourlyCust = [];\n this.hourlyCups = [];\n this.cupsBeansLbs = [];\n this.totalBeans = [];\n this.go = [];\n this.combined = 0;\n this.hourlyCustomers = function() {\n for (var i = 0; i < timeHr.length; i++){\n this.hourlyCust[i] = (Math.floor((Math.random() * (this.maxHr - this.minHr + 1)) + this.minHr));\n console.log(this.hourlyCust[i] + ' customers this hour.');\n }\n };\n\n this.generateHourlyCups = function() {\n this.hourlyCustomers();\n for (var i = 0; i < timeHr.length; i++) {\n this.hourlyCups[i] = Math.floor(this.avgCups * this.hourlyCust[i]);\n //console.log(this.hourlyCups[i] + ' cups needed per hour');\n this.cupsBeansLbs[i] = (this.hourlyCups[i] / 20);\n //console.log(this.cupsBeansLbs[i] + ' pounds for cups');\n this.go[i] = this.hourlyCust[i] * this.pounds;\n //console.log(this.go[i] + ' pounds needed to-go');\n //console.log(this.cupsBeansLbs[i] + ' Lbs of customer')\n this.totalBeans[i] = this.go[i] + this.cupsBeansLbs[i];\n //console.log(this.totalBeans[i] + ' total');\n }\n };\n this.totalTotals = function() {\n for ( var i = 0; i < timeHr.length; i++) {\n this.combined += this.totalBeans[i];\n }\n } //TOAL BEANS FOR GRAPH\n\n }", "function CalculateDeposit(percent_In_Year, mount, capitalization, first_payment, add_summ) {\r\n var percent_In_Mount = percent_In_Year / 12;\r\n var total = first_payment;\r\n var total_interest = 0;\r\n var all_made = first_payment;\r\n\r\n var result = {};\r\n console.log(\"Сумма на момент открытия вклада: \", total, \" процент по вкладу: \", percent_In_Year, \"%\", \"Ежемесячная процентная ставка:\", percent_In_Mount, \"%\", \"капитализация :\", capitalization);\r\n result.pay_percents = [];\r\n result.pay_percents.push({\r\n 'mount': 0,\r\n 'total': first_payment.toFixed(2)\r\n });\r\n for (var i = 1; i <= mount; i++) {\r\n var pay_percent = (capitalization ? total : first_payment) / 100 * percent_In_Mount;\r\n total_interest += pay_percent;\r\n total = total + pay_percent;\r\n console.log(\"Платеж по процентам в \", i, \" месяце равен \", pay_percent)\r\n\r\n if (mount > 1) {\r\n total += add_summ;\r\n all_made += add_summ;\r\n }\r\n result.pay_percents.push({\r\n 'mount': i,\r\n 'total': total.toFixed(2)\r\n });\r\n }\r\n var effectiv_percent = (total - all_made) / (all_made * 0.01);\r\n console.log(\"Сумма на момент закрытия вклада:\", total)\r\n console.log(\"Прибыль:\", total_interest)\r\n console.log(\"Сумма выросла на\", effectiv_percent + \"%\")\r\n result.total = total.toFixed(2);\r\n result.effectiv_percent = effectiv_percent.toFixed(2);\r\n result.total_interest = total_interest.toFixed(2);\r\n return result;\r\n}", "function AccountingStatistics() {\r\n let AccountingNumbers = {\r\n MarketCapitalizationRate = 0,\r\n CashOnCashReturn = 0,\r\n MonthlyROI = 0\r\n }\r\n let incomeCalc = IncomeCalculations()\r\n let userInputs = UserDefinedInputs()\r\n let initialInvestment = FirstYearOutOfPocket()\r\n\r\n //MarketCapitalizationRate -> YearlyNetOperatingIncome / subtotal\r\n AccountingNumbers.MarketCapitalizationRate = incomeCalc.NetYearlyIncome / userInputs.SubTotal\r\n //CashOnCashReturn -> initialInvestment / YearlyNetOperatingIncome\r\n AccountingNumbers.CashOnCashReturn = initialInvestment / incomeCalc.NetYearlyIncome\r\n //Monthly ROI -> Net Monthly Income/first year out of pocket\r\n AccountingNumbers.MonthlyROI = incomeCalc.NetMonthlyIncome / initialInvestment\r\n \r\n return AccountingNumbers\r\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "constructor () {\n this.accounts = [];\n this.nextNumber = 1;\n\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 Crystal() {\n this.value = Math.floor(Math.random() * 12) + 1;\n }", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function createCashier(req, res) {\n\n}", "function Customer() {\n this.number = Customer.count;\n Customer.count += 1;\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "addSavingsAccount(interest) {\n let acctNo = Bank.nextNumber;\n let savings = new SavingsAccount(acctNo);\n Bank.nextNumber++;\n savings.setInterest(interest);\n this.bankAccounts.push(savings);\n return savings.getNumber();\n\n }", "constructor(name, nr, cost){ // call the properties\r\n super(name, nr) // now to use the properties\r\n this.cost = cost\r\n }", "function BankAccount(balance) {\n this.balance = balance;\n this.el = undefined;\n}", "total(){\n return this.contador1 + this.contador2 + this.contador3;\n }", "constructor() { \n \n GetDealsSummaryDataWeightedValuesTotal.initialize(this);\n }", "function Person(first,last,age) {\n this.firstname = first;\n this.lastname = last;\n this.age = age;\n var bankBalance = 7500;\n \n this.getBalance = function() {\n // your code should return the bankBalance\n return bankBalance;\n };\n}", "function billsTotal(){\n totally = totalCall + totalSms;\n }", "function returnOftotals () {\n return {\n billCallTotal,\n billSMSTotal,\n billTotalTotal,\n currentValueOfCall,\n currentValueOfSMS,\n costWarning,\n costCritical,\n levels\n\n }\n }", "function addAccount(){\n\tvar accountTotal = \"0\"\n\tvar dollars = accountTotalDollars.val();\n\tvar cents = accountTotalCents.val();\n\n\tif (cents.length == 1){\n\t\tvar revAccountTotalCents = \"0\" + cents;\n\t\taccountTotal = dollars.toString() + revAccountTotalCents.toString();\n\t}\n\telse{\n\t\taccountTotal = dollars.toString() + cents.toString();\n\t}\n\n\tdb.accounts.add({name:accountName.val(),total:accountTotal,type:accountType.val(),notes:accountNotes.val()});\n\trefreshAccountTable();\n\tdialog.dialog(\"close\");\n\treturn true;\n}", "function checkCashRegister(price, cash, cid) {\n\n console.log(\"price:\", price);\n console.log(\"cash:\", cash);\n // console.log(\"cid:\\n \", cid);\n \n let cashInDrawer = 0;\n \n for (let i=0; i<cid.length; i++) {\n for (let j=1;j<cid[i].length; j++) {\n // console.log(\"cid[i][1]:\", cid[i][1]);\n cashInDrawer += cid[i][1];\n }\n }\n console.log(\"cashInDrawer:\", cashInDrawer);\n \n let hash = {};\n let changeDue = cash - price;\n console.log(\"changeDue:\", changeDue);\n \n if (cashInDrawer < changeDue) {\n hash.status = \"INSUFFICIENT_FUNDS\";\n hash.change = []; \n } \n console.log(\"hash:\", hash) \n return hash;\n \n }", "function checkCashRegister(price, cash, cid) {\n\n console.log(\"price:\", price);\n console.log(\"cash:\", cash);\n // console.log(\"cid:\\n \", cid);\n \n let cashInDrawer = 0; \n \n for (let i=0; i<cid.length; i++) {\n for (let j=1;j<cid[i].length; j++) {\n // console.log(\"cid[i][1]:\", cid[i][1]);\n cashInDrawer += cid[i][1];\n }\n }\n console.log(\"cashInDrawer:\", cashInDrawer);\n \n let hash = {};\n let changeDue = cash - price;\n console.log(\"changeDue:\", changeDue);\n \n if (cashInDrawer < changeDue) {\n hash.status = \"INSUFFICIENT_FUNDS\";\n hash.change = []; \n } else if (cashInDrawer === changeDue) {\n hash.status = \"CLOSED\";\n hash.change = cid;\n }\n console.log(\"hash:\", hash) \n return hash;\n \n }", "function totalCalculation() {\n const firstClassTicketCount = getTicketInput('firstClass');\n const economyTicketCount = getTicketInput('economy');\n const subTotal = firstClassTicketCount * 150 + economyTicketCount * 100;\n document.getElementById('subTotal').innerText = subTotal;\n const vat = subTotal / 10;\n document.getElementById('vat').innerText = vat;\n const total = subTotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('confirmAmount').innerText = total;\n}", "function getTotalRegisterProduct() {\r\n return PRC.at(prcAddress).then(function(instance) {\r\n prcInstance = instance;\r\n return prcInstance.getNumberOfProducts.call()\r\n }).then(function(total) {\r\n return total;\r\n });\r\n}", "function createNewProductTotalCost() {\n var newItemProductTotalCostDiv = document.createElement(\"div\");\n var newItemProductTotalCostSpan = document.createElement(\"span\");\n newItemProductTotalCostSpan.setAttribute(\"class\",\"cost-product-total\");\n newItemProductTotalCostDiv.innerHTML = \"$\";\n newItemProductTotalCostSpan.innerHTML = \"0.00\";\n newItemProductTotalCostDiv.appendChild(newItemProductTotalCostSpan);\n return newItemProductTotalCostDiv;\n }", "static get INITIAL_SUPPLY ()\n {\n return new BN(TOTAL_TOKENS.toString());\n }", "function Person(first,last,age) {\n this.firstname = first;\n this.lastname = last;\n this.age = age;\n var bankBalance = 7500;\n\n this.getBalance = function() {\n // your code should return the bankBalance\n return bankBalance;\n };\n}", "function Account(){\n let accNumber = 100057892234;\n this.getAccountNumber = function(){\n return accNumber;\n }\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 }", "constructor(){\n this.balance = -100000\n //count down or up from 8 minutes\n this.timer = 0;\n }", "function calculateTotal() {\n const firstClassCount = getInputValue(\"first-class\");\n const economyCount = getInputValue(\"economy\");\n\n // Calculating subtotal\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal-amount\").innerText = '$' + subTotal;\n\n // Calculating VAT\n const vat = Math.round(subTotal * 0.1);\n document.getElementById(\"vat-amount\").innerText = '$' + vat;\n\n // Calculating Total\n const Total = subTotal + vat;\n document.getElementById(\"total-amount\").innerText = '$' + Total;\n}", "deposit({account,amount}) {\n if (this.ledger[account] === undefined) {\n throw new Error(`${account} is not a registered customer of the bank`);\n }\n this.ledger[account] += amount;\n }", "add() {\n return {\n regNo: this.regNo,\n section: this.section,\n food: this.food,\n house: this.house\n }\n }", "function initSpent() {\n\tif (localStorage.spentVerpflegung === undefined) {\n\t\tlocalStorage.spentVerpflegung = Number(0);\n\t\t}\n\tif (localStorage.spentEinkaufen === undefined) {\n\t\tlocalStorage.spentEinkaufen = Number(0);\n\t\t}\n\tif (localStorage.spentAuto === undefined) {\n\t\tlocalStorage.spentAuto = Number(0);\n\t\t}\n\tif (localStorage.spentWohnung === undefined) {\n\t\tlocalStorage.spentWohnung = Number(0);\n\t\t}\n\tif (localStorage.spentShopping === undefined) {\n\t\tlocalStorage.spentShopping = Number(0);\n\t\t}\n\tif (localStorage.spentAndere === undefined) {\n\t\tlocalStorage.spentAndere = Number(0);\n\t\t}\n}", "constructor() {\n this.value = {};\n this.num = 0;\n }", "constructor(quantity, productPrice, productTitle, sum) {\n this.quantity = quantity;\n this.productPrice = productPrice;\n this.productTitle = productTitle;\n this.sum = sum;\n }", "function init() {\n self = {};\n fBalance = 0;\n if ( fAddress === undefined && fCryptPrivateKey === undefined ) {\n createNewAddress();\n }\n }", "function categoryTotal(name, amount) {\r\n var self = this;\r\n self.name = name;\r\n self.amount = amount;\r\n}", "function categoryTotal(name, amount) {\r\n var self = this;\r\n self.name = name;\r\n self.amount = amount;\r\n}", "function addMonthlyCost() {\n console.log('in addDollars');\n\n console.log('getMonthlySalaries(employeesList)', getMonthlySalaries(employeesList) );\n \n // let monthlyCost = [];\n // monthlyCost.push(getMonthlySalaries(employeesList));\n // console.log('monthlySalaryList', monthlyCost);\n \n // let total = 0;\n // for (let i = 0; i < monthlyCost.length; i++) {\n // console.log('monthlyCost[i]:', monthlyCost[i]);\n \n // total += monthlyCost[i];\n // console.log('total:', total);\n // }\n\n // console.log('total:', total);\n \n \n \n //$('#totalMonthlyCost').text(` $${total}`);\n\n} // end addMonthlySalary", "constructor(month, budget, list) {\n // Properties of budget items.\n let time;\n let maxBudget;\n let expenses = [];\n\n\n\n // setter for time.\n this.setTime = function(t) {\n time = t;\n }\n\n // set max budget.\n this.setMaxBudget = function (m) {\n maxBudget = m;\n }\n // set expenses.\n this.setExp = function (e) {\n\n expenses = e;\n }\n\n\n // Getter function returns the month of the budget item.\n this.getTime = function () {\n return time;\n }\n // Getter function returns the max value of the budget item.\n this.getMaxBudget = function () {\n return maxBudget;\n }\n // Getter function returns the expenses array of the budget item.\n this.getExp = function () {\n return expenses;\n }\n\n\n // Setting all passed values from constructor.\n this.setTime(month);\n this.setMaxBudget(budget);\n this.setExp(list);\n\n }", "function addPrToCarrt() {\n var model = { prid: prid, total: parseInt($(\"#numb\").text()) };\n addToCart(model);\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 totalAmount_Zuweisung() {\n totalAmount = this.value;\n}", "function buy10() {\n const credit = 1100;\n addCredit(credit);\n return credit;\n}", "function Account(accountHolder, accountPassword, initialDeposit) {\n this.name = accountHolder,\n this.password = accountPassword,\n this.balance = parseInt(initialDeposit)\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}", "getTotals(interfaceAdapter) {\n const gas = this.currentGasTotal.toString(10);\n const cost = interfaceAdapter.displayCost(this.currentCostTotal);\n this.finalCostTotal = this.finalCostTotal.add(this.currentCostTotal);\n\n this.currentGasTotal = new web3Utils.BN(0);\n this.currentCostTotal = new web3Utils.BN(0);\n\n return {\n gas,\n cost,\n finalCost: interfaceAdapter.displayCost(this.finalCostTotal),\n deployments: this.deployments.toString()\n };\n }", "setup() {\n this.bank = new Bank()\n this.bank.addExchangeRate('EUR', 'USD', 1.2)\n this.bank.addExchangeRate('USD', 'KRW', 1100)\n }" ]
[ "0.6317211", "0.5981754", "0.59598035", "0.5766497", "0.57234746", "0.5703512", "0.5618086", "0.5594363", "0.55786014", "0.5568819", "0.555426", "0.55496466", "0.5545485", "0.5476828", "0.547584", "0.546053", "0.54487026", "0.5436227", "0.5430639", "0.5393035", "0.5389929", "0.5389728", "0.5384135", "0.5375985", "0.53757036", "0.5372676", "0.5369482", "0.5355123", "0.5352408", "0.53434974", "0.5336566", "0.53355265", "0.53318834", "0.5322009", "0.5321999", "0.5321685", "0.5312905", "0.53030986", "0.53010845", "0.5294554", "0.52898943", "0.5289213", "0.52838576", "0.52799124", "0.52793485", "0.52760637", "0.5274372", "0.5268762", "0.5261387", "0.5256404", "0.52492964", "0.5236766", "0.5235075", "0.52344155", "0.52330816", "0.5229875", "0.5221111", "0.5220849", "0.5211915", "0.52094823", "0.52081263", "0.52048695", "0.5197195", "0.51836884", "0.5179108", "0.51712185", "0.5170033", "0.5168147", "0.51544785", "0.5153837", "0.5146609", "0.5119161", "0.5118267", "0.51091516", "0.5108737", "0.5107005", "0.5098369", "0.5090185", "0.5090139", "0.50756896", "0.5065936", "0.50648266", "0.50645363", "0.50644743", "0.5063198", "0.50606567", "0.50590104", "0.5051507", "0.5050067", "0.5050067", "0.505002", "0.50492257", "0.50414944", "0.50366485", "0.5030073", "0.50280476", "0.5022671", "0.5021619", "0.5021031", "0.5017658" ]
0.84139043
0
load partners for selection
function partnersLoad(){ function makePartner(num, title){ $('#partner_wrapper #scroll_wrapper').append('<div id="'+num+'" class="partner" data-title="'+title+'"><img src="/images/logos/'+num+'.jpg" /><div class="selectPartner"><span></span>SELECT<div></div></span></div></div>'); }; //loop through each partner and place it on page $.each(App.Partners.all, function(i, v){ makePartner(v[0], v[1]); }); //bind click event to each partner logo $('.partner').bind('click', function(){ var partnerId = $(this).attr("id"); if($(this).hasClass('checked')){ $(this).removeClass('checked'); $(this).children("div").children("span").css({ 'backgroundPosition' : 0+'px' }); $('li#p_'+partnerId).fadeOut(300, function(){ $(this).remove(); }); }else { $(this).addClass('checked'); $(this).children("div").children("span").css({ 'backgroundPosition' : -22+'px' }); $('#pickedWrapper').append('<li id="p_'+partnerId+'" style="display:none;"><img src="/images/logos/'+partnerId+'.jpg" /></li>'); $('li#p_'+partnerId).fadeIn(300); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPartner() {\n \tGisMap.Util.MAX_APP_FILES = application.partner_sources.length;\n \tGisMap.Util.LOADED_APP_FILES = 0;\n if (application.partner_sources.length == 0) {\n GisMap.Core.injectHtml(STARTAPPLICATION);\n return;\n }\n for (var file in application.partner_sources) {\n var load = GisMap.Util.loadPartnerFile(application.partner_sources[file], function (complete) {\n if (complete)\n GisMap.Core.injectHtml(STARTAPPLICATION);\n \n \n })\n }\n }", "function loadPartnerships() {\n\tvar requestType;\n\tif (window.XMLHttpRequest) {\n\t\trequestType = new XMLHttpRequest();\n\t} else {\n\t\trequestType = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\trequestType.open(\"GET\", \"Library/PHP/Universal/getPartnerships.php\", true);\n\trequestType.send();\n\n\trequestType.onreadystatechange = function() {\n\t\tif (requestType.readyState == 4 && requestType.status == 200) {\n\t\t\tvar storeResponce = requestType.responseText;\n\n\t\t\tif (storeResponce == \"TBC\") { /*Table is successfully created.*/ }\n\t\t\telse { //Parsed partners\n\t\t\t\tif (storeResponce.indexOf(\",\") > -1) { \n\t\t\t\t\tstorePartners = storeResponce.split(\",\"); \n\n\t\t\t\t\tfor (i = 0; i <= storePartners.length; i++) {\n\t\t\t\t\t\tstorePartnerInfo = storePartners[i].split(\"|\");\n\t\t\t\t\t\tbuildPartner(storePartnerInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\tstorePartners = storeResponce; \n\t\t\t\t\tstorePartnerInfo = storePartners.split(\"|\");\n\t\t\t\t\tbuildPartner(storePartnerInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function loadPartners(count) {\r\n var items = $('.load_partners_box');\r\n\r\n items.filter(':hidden').slice(0, count).fadeIn().css('display', 'flex');\r\n var visible = items.filter(':visible').length;\r\n if (items.length === visible) {\r\n $('.partners_load_more').fadeOut('slow');\r\n }\r\n }", "function loadParts() {\n SRPurchaseService.RetrieveSRParts().then(function (result) {\n $scope.SRParts = result.data.DataList;\n });\n }", "loadSelections() {\n this.$state.go('textStorageRoot.selectionList', {\n topic: this.currentTopic,\n domain: this.currentDomain\n });\n }", "function loadSelection()\n{\n\tflagIndex = localStorage.getItem(\"chosenFlag\");\n\tcarbodyIndex = localStorage.getItem(\"chosenCarbody\");\n\tcolourIndex = localStorage.getItem(\"chosenColour\");\n\twheelIndex = localStorage.getItem(\"chosenWheel\");\n\n\tonBodyChanged();\n}", "function refreshTable() {\n\t\tvar partners = [\"piston\", \"plumgrid\"];\n\t\tfor (var i = 0; i < partners.length; i++) {\n\t\t\tdoAjaxSelects(partners[i])\n\t\t}\n\t\tsetTimeout(refreshTable, 1000);\n\t}", "function loadChoices(){\n\t\tfor(i=0;i<questions[questionNumber].a.length; i++){\n\t\t\t$(\"#choices_list\").append(\"<li class='choice'>\"+questions[questionNumber].a[i]);\t\n\t\t}\n\t}", "function loadData() {\n $scope.loading.inc();\n $scope.selectedComparison = [];\n APIEvalService.getAllAPIs().then(function (apis) {\n $scope.apis = apis;\n }).catch(function (error) {\n console.error(error);\n }).finally(function () {\n $scope.loading.dec();\n });\n }", "function _loadRemoteData() {\n $scope.isLoading = true;\n\n QueryService.getAvailableQueries(\"offers\")\n .then(function(result) {\n serveResult(result);\n })\n .catch(function(error) {\n console.log(error);\n alert('wystąpil błąd...');\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n }", "function getAllParties(){\n btnFeedback('all')\n resultParties = parties;\n}", "function load_dependent()\n {\n var thislocation = $('#thislocation').val(); \n var depid = $('#learning_level').val();\n if(depid == '0')\n {\n $('#subject').find('option').remove().end() .append('<option value=\"0\">Select Learning Level First</option>');\n $('#class').find('option').remove().end() .append('<option value=\"0\">Select Learning Level First</option>');\n\n }\n else\n {\n $('#subject').find('option').remove().end().append('<option value=\"0\">Select One</option>');\n $('#class').find('option').remove().end().append('<option value=\"0\">Select One</option>');\n load_classes('GET',thislocation+'/resources/api_classes.php',depid);\n load_subjects('GET',thislocation+'/resources/api_subjects.php',depid);\n }\n }", "function loadSelection()\r\n{\r\n\theadIndex = localStorage.getItem(\"chosenHead\");\r\n\ttorsoIndex = localStorage.getItem(\"chosenTorso\");\r\n\t\r\n\t\r\n\r\n\tonBodyChanged();\r\n}", "function LoadSelections(selection) {\n if (selection.waypoints && selection.waypoints.length > 0) {\n _.each(selection.waypoints, function (array) {\n PathSelection(array, function () {\n var bboxes = GetDrawLayerBBoxes();\n GetDataByBBox(bboxes);\n });\n });\n }\n if (selection.data) {\n if (selection.data.searchLayer) {\n $rootScope.toggleLayer(selection.data.searchLayer, true);\n }\n L.geoJson(selection.data, {\n onEachFeature: function (feature) {\n if (selection.data.search && selection.data.search.searchType === 'radius')\n {\n var startPoint = L.GeoJSON.coordsToLatLng(feature.geometry.coordinates);\n var radius = feature.properties.radius;\n var circle = L.circle(startPoint, radius, {\n opacity: 0.0,\n fill: false,\n });\n\n circle.addTo(drawLayer);\n\n var bboxes = GetDrawLayerBBoxes();\n\n var rds = (bboxes[0].getNorthWest().lat - bboxes[0].getSouthWest().lat) / 2;\n var polyCrcl = plygonFromCircle(startPoint.lat, startPoint.lng, rds)\n\n L.polygon([polyCrcl, [[90, -180], [90, 180], [-90, 180], [-90, -180]]], {\n weight: 3,\n color: '#00CFFF',\n opacity: 0.9,\n fillColor: '#0C2638',\n fillOpacity: 0.4\n }).addTo(bgLayer);\n circle.addTo(drawLayer);\n } else if (selection.data.search && selection.data.search.searchType === 'path')\n {\n\n var lineLatlngs = _.map(selection.data.search.vertices, function (item) {\n var LatLng = item.split(\",\");\n return {\n lat: LatLng[0],\n lng: LatLng[1]\n }; //item.latLng;\n });\n\n L.polyline(lineLatlngs, {color: 'red', smoothFactor: 1}).addTo(bgLayer);\n\n _.each(feature.geometry.coordinates, function (coords) {\n var points = L.GeoJSON.coordsToLatLngs(coords);\n L.polygon([points, [[90, -180], [90, 180], [-90, 180], [-90, -180]]], {\n weight: 3,\n color: '#00CFFF',\n opacity: 0.9,\n fillColor: '#0C2638',\n fillOpacity: 0.4\n }).addTo(bgLayer);\n\n L.polygon(points, {\n opacity: 0.0,\n fill: false\n }).addTo(drawLayer);\n });\n $rootScope.routeInterpolated = [];\n\n $rootScope.mapSelectionProps = {vertices: []};\n $rootScope.mapSearchType = 'path';\n _.each(lineLatlngs, function (value, index) {\n ($rootScope.mapSelectionProps.vertices).push([value.lat, value.lng].join(','));\n $rootScope.routeInterpolated.push({latLng: {lat: value.lat, lng: value.lng}});\n });\n } else\n {\n _.each(feature.geometry.coordinates, function (coords) {\n var points = L.GeoJSON.coordsToLatLngs(coords);\n //[[[90, 180],[90, -180],[-90, -180],[-90, 180]], polyLatlngs]\n L.polygon([points, [[90, -180], [90, 180], [-90, 180], [-90, -180]]], {\n weight: 3,\n color: '#00CFFF',\n opacity: 0.9,\n fillColor: '#0C2638',\n fillOpacity: 0.4\n }).addTo(bgLayer);\n\n L.polygon(points, {\n opacity: 0.0,\n fill: false\n }).addTo(drawLayer);\n });\n }\n }\n });\n }\n if (selection.data.search)\n {\n setFiltersData(selection.data.search);\n }\n var bboxes = GetDrawLayerBBoxes();\n $timeout(function () {\n GetDataByBBox(bboxes, true);\n }, 100);\n }", "function cargarChosenCliente() {\n\n $(\"#idCliente\").chosen({ placeholder_text_single: \"Buscar Cliente\", no_results_text: \"No se encontró Cliente\" }).on('chosen:showing_dropdown', function (evt, params) {\n \n });\n\n $(\"#idCliente\").ajaxChosen({\n dataType: \"json\",\n type: \"GET\",\n minTermLength: 5,\n afterTypeDelay: 300,\n cache: false,\n url: \"/GrupoCliente/SearchClientes\"\n }, {\n loadingImg: \"Content/chosen/images/loading.gif\"\n }, { placeholder_text_single: \"Buscar Cliente\", no_results_text: \"No se encontró Cliente\" }); \n }", "function loadMultiGP() {\r\n\t$(\"#gp\").show();\r\n\t$(\"#gp_multi\").show();\r\n\t$(\"#gp_multi\").html(\"<div class='components'><nav class='options'><button></button></nav></div>\");\r\n\t$(\"#gp_multi .options button\").bind(\"click\", function() {\r\n\t\tloadOptions(\"MULTI\");\r\n\t});\r\n\tsetTimeout(function() {\r\n\t\tloadMultiGPResults();\r\n\t}, 5000);\r\n}", "function formPreRequisits(){\n $.get({\n async: false,\n url: '\\getbus',\n dataType: 'JSON'\n }).done((response)=>{\n let checkBoxHtml = '';\n const checkBoxes = response.bus;\n $.each(checkBoxes, (checkBox, key)=>{\n checkBoxHtml += '<input type=\"checkbox\" class=\"chk-col-blue checkall\" name=\"buid[]\" id=\"' + key + '\" value=\"'+ key +'\" /><label for=\"' + key + '\">' + checkBox + '</label>';\n });\n $('.bus').html(checkBoxHtml);\n });\n \n $.get({\n async: false,\n url: '\\getusers',\n dataType: 'JSON'\n }).done((response)=>{\n var selectOpts = response.users;\n var optionsCount, pointer;\n optionsCount = pointer = response.users.length;\n if (users.children().length > 1) {\n users.children().first().siblings().remove();\n }\n while (pointer > 0) {\n var index = optionsCount - pointer;\n users.append('<option value=\"' + selectOpts[index] + '\">' + selectOpts[index] + '</option>');\n pointer--;\n }\n }).then(()=>{\n users.chosen('destroy');\n users.chosen({no_results_text: \"Oops, nothing found!\"});\n });\n}", "function seleccionar_parroquias(identificador){\n\t$(identificador).on('change', function(e){\n\t\t$('#id_parroquia option').remove();\n\t\t$('#id_parroquia').prop('disabled', true);\n\t\te.preventDefault();\n\t\tvar url = '/api/ciudades/select/';\n\t\tvar canton = $(identificador + ' option:selected').text();\n\t\tvar ctx = {'canton': canton}\n\n\t\t$.get(url, ctx, function(data){\n\t\t\tconsole.log(data.parroquias)\n\t\t\t$.each(data.parroquias, function(index, element){\n\t\t\t\t$('#id_parroquia').prop('disabled', false);\n\t\t\t\t$('#id_parroquia').append(element.option)\n\t\t\t});\n\t\t});\n\t})\n}", "function loadChooseOrder () {\n\tresetChooseOrder();\n\n\tfor (let num = 1; num < 5; num++) {\n\t\tchangeCharacterIcon( 'assistChooseP' + num, characters[num]);\n\t\tchangeCharacterIcon('nv_assistChooseP' + num, characters[num]);\n\t}\n\n\tvar boards = copyVar(assist_getBoardList());\n\tfor (let num = 0; num < boards.length; num++) {\n\t\tboards[num] = '<option value=' + boards[num] + '>' + boards[num] + '</option>';\n\t}\n\teditInner( 'assistStageSelect', boards.join());\n\teditInner('nv_assistStageSelect', boards.join());\n}", "function populateChoices()\n{\n if (section_id_selected != '' &&\n topic_id_selected != '')\n {\n jQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/section/1?jsoncallback=?',\n {},\n function(data){\n populateSelect('section_id', data);\n jQuery('#section_id option[value=' + section_id_selected + ']').attr('selected', 'selected');\n });\n jQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/topic/' + section_id_selected + '?jsoncallback=?',\n {},\n function(data){\n populateSelect('topic_id', data);\n jQuery('#topic_id option[value=' + topic_id_selected + ']').attr('selected', 'selected'); \n });\n jQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/category/' + topic_id_selected + '?jsoncallback=?',\n {},\n function(data){\n populateSelect('category_id', data);\n jQuery('#category_id option[value=' + category_id_selected + ']').attr('selected', 'selected'); \n }); \n }\n else\n {\n // Choices haven't been made yet.\n // Hide everything but step 1, and clear previous values.\n jQuery('.step-2,.step-3,.step-4,.step-5').hide();\n jQuery('#author-account').val('');\n }\n \n \tjQuery('.step-1').live('change', function(e){\n \t\tif (validProfileURL(jQuery('#author-account').val()))\n \t\t{\n\t\t\t\t// Valid profile URL so clear errors.\n\t\t\t\tjQuery('#profile-url-errors').html('');\n\t\t\t\t\n \t\t\t// Re-populate only if there aren't current selections\n \t\t\tif (section_id_selected == '' &&\n \t\t\t\ttopic_id_selected == '')\n \t\t\t{\n \t\t\t\t// Populate next step, and display.\n \t\t\t\tjQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/section/1?jsoncallback=?',\n \t\t '',\n \t\t function(data){\n \t\t populateSelect('section_id', data);\n \t\t\t\t});\n \t \t\t jQuery('.step-2').show(); \t\t\t\t\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t// Show everything since we already have selections\n \t\t\t\tjQuery('.step-2,.step-3,.step-4,.step-5').show();\n \t\t\t}\n\n \t\t}\n \t\telse\n \t\t{\n\t\t\t\t// Profile URL is invalid\n\t\t\t\tjQuery('#profile-url-errors').html('Please enter in the full URL of your profile page.');\n \t\t\t// We don't have enough data yet, so hide everything else.\n \t\t\tjQuery('.step-2,.step-3,.step-4,.step-5').hide();\n \t\t}\n \t});\n \n jQuery('.step-2').live('change',function(e){\n jQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/topic/' + jQuery('#section_id option:selected').val() + '?jsoncallback=?',\n {},\n function(data){\n populateSelect('topic_id', data);\n jQuery('.step-1,.step-2,.step-3').show();\n jQuery('.step-4,.step-5').hide();\n });\n });\n \n jQuery('.step-3').live('change',function(e){\n jQuery.getJSON(jsonp_base_url + 'api/choices-jsonp/category/' + jQuery('#topic_id option:selected').val() + '?jsoncallback=?',\n {},\n function(data){\n populateSelect('category_id', data);\n jQuery('.step-1,.step-2,.step-3,.step-4,.step-5').show();\n //jQuery('.step-5').hide();\n });\n });\n \n jQuery('.step-4').live('change', function(e){\n jQuery('.step-1,.step-2,.step-3,.step-4,.step-5').show();\n });\n \n jQuery('#widget-create').live('submit', function(e){\n // If they've already created a widget, update. Otherwise, create.\n var jsonp_url = jsonp_base_url + 'api/widget/';\n if (section_id_selected != '' &&\n topic_id_selected != '')\n {\n jsonp_url = jsonp_url + 'update?' + (jQuery(this).serialize()).replace(/ww_/g, '').replace(/&rss_uri=.+&?/g, '') + '&jsoncallback=?';\n }\n else\n {\n jsonp_url = jsonp_url + 'create?' + (jQuery(this).serialize()).replace(/ww_/g, '').replace(/&rss_uri=.+&?/g,'') + '&with_security_code=1&jsoncallback=?';\n }\n\t\t\t\n\t\t\t// Don't perform the update/create unless the profile URL is valid and there\n\t\t\t// is at least a section and topic chosen.\n\t\t\tif (isReadyForSubmission())\n\t\t\t{\n\t\t\t\tjQuery.getJSON(jsonp_url,\n '',\n function(data){\n // Populate the rss url and security code hidden fields, and post changes.\n if (data['url'] != '' && data['security_code'] != '')\n {\n jQuery('#rss_uri').val(data['url']);\n jQuery('#security_code').val(data['security_code']);\n jQuery('#widget_config_id').val(data['widget_config_id']);\n jQuery.post(jQuery('#widget-create').attr('action'),\n jQuery(\"#widget-create\").serialize(),\n function(e){\n section_id_selected = jQuery('#section_id option:selected').val();\n topic_id_selected = jQuery('#topic_id option:selected').val();\n category_id_selected = jQuery('#category_id option:selected').val(); \n });\n jQuery('#ww-message').html('Your widget has been successfully udpated/created! ' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Now <a href=\"/wp-admin/widgets.php\">click here</a> ' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'and drag the Suite101 Writer\\'s Widget to your sidebar.');\n }\n else\n {\n jQuery('#ww-message').html('There was a problem updating/creating your widget. Please ' +\n \t \t \t\t\t\t\t 'ensure that you have entered your member ID, and made ' +\n \t\t\t \t\t\t\t 'selections for Section and Topic.');\n }\n });\n\t\t\t}\n\t\t\tjQuery('#preview-pane').html('');\n return false;\n });\n}", "function getAllParties() {\n checkSelectParty('all')\n topParties = [];\n topParties = parties;\n}", "function comboParceiro() {\r\n\r\n //Criar o HTML (option) para todos os parceiros\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < partners.length; i++) {\r\n strHtml += `<option value='${partners[i]._id}'>${partners[i]._name}</option>`\r\n }\r\n let selParceiro = document.getElementById(\"idSelParc\")\r\n selParceiro.innerHTML = strHtml\r\n}", "function loadOffers() { // ohne alerts funktionierts nicht =( ... wieso??\n\t// reset selectedID (account could have been deleted in meantime)\n\t// selectedOffer = null;\n\tconnect(\"/hiwi/Provider/js/loadOffers\", \"\", handleLoadOffersResponse);\n}", "function loadPreProcessors(){\n\tconsole.log(\"attempting to load preprocessors\");\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'PreProcessors'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tpreprocessors=data;\n\t\t\t\n\t\t\tvar x = document.getElementById(\"preprocessor-select\");\n\t\t\t\n\t\t\tfor(var i=0;i<preprocessors.length;i++)\n\t\t\t{\n\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\toption.text = preprocessors[i].pre_processor_name;\n\t\t\t\toption.value = preprocessors[i].pre_processor_id;\n\t\t\t\tx.add(option);\n\t\t\t}\n\t\t}\n\t});\n}", "function populateCandidates(){\n //TODO: fill in logic for what displays where\n \n $.getJSON('/candidates/candidates', function(data){\n $.each(data, function(){\n //candidateListData = data;\n showCandidateInfo(data);\n });\n });\n}", "function loadLists() {\n\tloadEquipmentSlots();\n\tloadNpcList();\n}", "function loadProducts(){\n productService.products().then(function(data){\n all_products = data;\n setOptions();\n setupListeners();\n })\n}", "function loadSelector() {\n for (var i = 0; i < core.n_; i++) {\n $('#page-selector').append(\n [\"<option value='\", i, \"'>\", i + 1, '</option>'].join('')\n );\n }\n}", "function loadPlayerList() {\n Player_v.all({order: 'id'}, function(err, results) {\n var players = [];\n var player = {};\n player.player_name = 'Not Selected';\n player.id = \"\";\n players[0] = player;\n\n if(results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // create a brand new instance of player object for every record. One cannot reuse the same player variable.\n var player = { player_name: results[i].first_name + \" \" + results[i].last_name + \"-\" + results[i].city + \"/\" + results[i].state_or_province,\n id: results[i].id};\n players.push(player);\n }\n } // end of if.\n\n this.player_list = players;\n\n next(); // process the next tick.\n }.bind(this));\n}", "function subscribePsetSelected() {\n sc.subscribe(\"psetSelected\", (err, data) => {\n onCallback(\"Subscribe\", \"psetSelected\", err, data);\n });\n\n setListener(\"psetSelected\");\n}", "function loadLookUps() {\n var baseFilter = {\n filter: 'active'\n };\n\n\n function getTaskTypeData(data, params) {\n var result = dataAPIService.applyFilters(data, params);\n $scope.all_task_type = _.keyBy(result, 'id');\n return result;\n }\n\n var loadTables = [\n {\n name: 'subbie',\n params: {\n filter: [\n 'active'\n ]\n },\n callback: dataAPIService.applyFilters,\n scope: 'subcontractors'\n },\n {\n name: 'code_task_type',\n params: baseFilter,\n callback: getTaskTypeData,\n scope: 'task_types'\n },\n {\n name: 'client',\n params: baseFilter,\n callback: dataAPIService.applyFilters,\n scope: 'clients'\n }\n ];\n models = _.map(loadTables, 'name');\n models.push('job', 'tasks');\n dataCacheService.processLoadTables(loadTables, $scope, 'query');\n }", "function getListOfDistrict_scene() {\n $(\"#districs_id\").empty();\n $(\"#districs_id_reg\").empty();\n\n loadingDistrictsMaster();\n var selectfirst = \"<option value='0'>Select District</option>\";\n $('#districs_id').append(selectfirst);\n $('#districs_id_reg').append(selectfirst);\n $.each(district, function (i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districs_id');\n $(districts).appendTo('#districs_id_reg');\n\n });\n $('#districs_id').trigger(\"chosen:updated\");\n $('#districs_id_reg').trigger(\"chosen:updated\");\n $('#districs_id').chosen();\n $('#districs_id_reg').chosen();\n}", "function loadList() {\n\t\t// Display an error message if error code is not 410 or 200 (okay)\n\t\tif (this.status != 200 && this.status != 410) {\n\t\t\tdisplayError();\n\t\t}\n\t\tvar list = document.getElementById(\"allnames\");\n\t\tvar lines = this.responseText.split(\"\\n\");\n\t\t// Add each name into select box\n\t\tfor (var i = 0; i < lines.length; i++) {\n\t\t\taddName(lines[i]);\n\t\t}\n\t\tlist.disabled = false;\n\t\tdocument.getElementById(\"loadingnames\").style.display = \"none\";\n\t}", "function load(participants$) {\n //participants$.subscribe(participants => {}\n }", "async loadPlans() {\n const plansResponse = await fetch('/plans');\n const plans = (await plansResponse.json()).data;\n plans.forEach(plan => {\n let product = this.products[plan.product];\n if (product) {\n if (!product.plans) {\n product.plans = [];\n }\n product.plans.push(plan);\n }\n this.plans[plan.id] = plan;\n });\n const url = window.location.href;\n const prod_id = getParameterByName('id',url);\n this.plans = plans.filter(plan=> plan.product===prod_id)\n }", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function init() {\n listar();\n //cargamos los items al select cliente\n $.post(\"Controllers/Product.php?op=selectArticulo\", function (r) {\n $(\"#idarticulo\").html(r);\n //$(\"#idarticulo\").selectpicker(\"refresh\");\n });\n}", "fetchDataStart(){\n this.hideDropDown();\n this.showLoader();\n }", "function loadEmployeeSelect(){\n\t//First, get a list of all the workers who are currently on this shift..\n\tvar currentEmployees = []\n\tvar employeeList = document.getElementById(\"employeeList\").childNodes; //the element employeeList is a <ul> with each child <li> being an employee's info.\n\tfor (i = 0; i < employeeList.length; i++){\n\t\tcurrentEmployees.push(employeeList[i].id)\n\t}\n\t\n\t//next, get a list of all possible employees.\n\t$.get('/getAllWorkers', function(allWorkers){\n\t\n\t//Once all the workers have been got, we proceed to modify the box.\n\tvar selectionBox = document.createElement('select')\n\tselectionBox.id = \"employeeSelect\";\n\tselectionBox.classList.add(\"chosen-select\");\n\t\n\n\tselectionBox.multiple = true;\n\tObject.keys(allWorkers).forEach(function(key){\n\t\t\n\t\tvar selection = document.createElement('option');\n\t\tselection.value=key;\n\t\tselection.textContent = allWorkers[key];\n\t\tvar keyStr = key.toString;\t\n\t\tif (currentEmployees.includes(key)){ //Random, kinda relevant reading for the intrigued soul. Your question is: \"Why can't you just use \"if key in currentEmployees?\"\n\t\tselection.selected = true;\n\t\t}\n\t\tselectionBox.appendChild(selection);\t\n\t\n\t\t\t\t});\n\n\t//remove all children from employeeInfoDiv....\n\tvar employeeInfoDiv = document.getElementById(\"employeeInfoDiv\");\n\twhile (employeeInfoDiv.firstChild){\n\t\temployeeInfoDiv.removeChild(employeeInfoDiv.firstChild);\n\t}\n\t\n\t//Append selection box.\n\t\n\temployeeInfoDiv.appendChild(selectionBox);\n\t//Apply Chosen UI\n\t\n\t$(\".chosen-select\").chosen();\n\n\t//create the button that will call the addUnAdd worker. And the checkbox.\n\t\n\tvar followingCheckBox = document.createElement('input');\n\tfollowingCheckBox.type = \"checkbox\";\n\tfollowingCheckBox.id = \"followingCheckBox\";\n\t\n\tvar checkBoxLabel = document.createElement(\"label\");\n\tcheckBoxLabel.textContent = \"Update for all following.\";\n\tcheckBoxLabel.for = \"followingCheckBox\";\n\t\n\tvar updateButton = document.createElement('button');\n\tupdateButton.textContent = \"Update\";\n\tupdateButton.id = \"updateButton\";\n\tupdateButton.onclick = function(){\n\t\tvar prevEmployees = currentEmployees;\n\t\tupdateShifts(prevEmployees)\n\n\t}\n\n\tvar cancelButton = document.createElement('button');\n\tcancelButton.textContent = \"Cancel\";\n\tcancelButton.id = \"cancelButton\";\n\tcancelButton.onclick= function(){\n\n\tvar idPara = document.getElementById(\"idPara\").textContent.split(\" \");\n\tvar shiftID = idPara[1];\n\tgetShiftDetails(shiftID);\n}\n\temployeeInfoDiv.appendChild(checkBoxLabel);\n\temployeeInfoDiv.appendChild(followingCheckBox);\n\temployeeInfoDiv.appendChild(updateButton);\n\temployeeInfoDiv.appendChild(cancelButton);\t\n\t\n\n\t\n\t})\t\n\n}", "function loadOperatorsInSelectBox(results){\t \n\t$(\".pop-modal-content\").find(\".operators_select_box\").each(function(){\n \t$(this).ddslick({\n \t data : results,\n \t width : 170\n \t});\n });\n}", "function loadSelection() {\n var selElem = document.getElementById('sel');\n var imgElem = document.getElementById('preloaded');\n\n fetch(url)\n .then(response => response.json())\n .then(data => {\n for (var i = 0; i < data.length; i++) {\n selElem.innerHTML += \"<option value='\"+data[i].id + \"'>\"+data[i].name+\"</option>\";\n imgElem.innerHTML += \"<img src='images/\"+data[i].images+\"'>\";\n }\n })\n .catch(err => alert(err));\n}", "function loadgroupbuttons(findings){\n\n $('.selector').change(function () {\n //Show loading text\n $('.loading', window.parent.frames[0].document).css(\"display\", \"block\");\n /*Switch to findings view*/\n if ($('.package_explorer').is(\":visible\")){\n $('.package_explorer').hide();\n }\n $('.findings').hide();\n jQuery.jstree._reference('.findings').destroy(); //Destroy the jstree\n $('.findings').empty(); //Clear the DOM\n display_all(findings, $(this).prop('value'));\n });\n\n}", "function loadOfficersList() {\n\t\t\treportsService\n\t\t\t\t.getOfficersList()\n\t\t\t\t.$promise.then(function (data) {\n\t\t\t\t\t$scope.officers = data;\n\t\t\t\t});\n\t\t}", "function load() {\n if(vm.document._id !== -1) {\n backendService.getDocumentById(vm.document._id).success(function(data) {\n\n // got the data - preset the selection\n vm.document.title = data.title;\n vm.document.fileName = data.fileName;\n vm.document.amount = data.amount;\n vm.document.senders = data.senders;\n vm.document.tags = data.tags;\n vm.document.modified = data.modified;\n vm.document.created = data.created;\n\n vm.selectedSenders = data.senders;\n vm.selectedTags = data.tags;\n\n })\n .error( function(data, status, headers) {\n\n if(status === 403) {\n $rootScope.$emit('::authError::');\n return;\n }\n\n alert('Error: ' + data + '\\nHTTP-Status: ' + status);\n return $location.path('/');\n\n\n });\n } else {\n vm.selectedSenders = [];\n vm.selectedTags = [];\n }\n\n }", "function loadSelection () {\n\tvar eventtype = $xml.find('event').attr('eventtype');\n\tvar description = $xml.find('description').text();\n\tvar container = $('.selectionContainer');\t\n\tvar descriptionContainer = container.find('.selectionTitleText');\n\tvar imgContainer = container.find('.selectionPicture');\n\tvar textContainer = container.find('.selectionText');\n\tvar button = container.find('.selectionButton');\n\n\n\tdescriptionContainer.text(description);\n\t\n\t$xml.find('option').each(function(index){\n\t\tvar text = $xml.find('option').eq(index).text();\n\t\tvar href = $xml.find('option').eq(index).attr('href');\n\t\t\n\t\ttextContainer.eq(index).text(text);\n\t\tbutton.eq(index).bind('click', function(){\n\t\t\t$('.selectionContainer').hide();\n\t\t\tgetXml(href);\t\t\t\t\t\t\t\t \n\t });\t\t\n\t\t\n\t\tif (eventtype == 15){\n\t\t\tvar img = 'images/' + $xml.find('option').eq(index).attr('img');\n\t\t\timgContainer.eq(index).attr('src', img);\n\t\t\t$('.selectionContainer').find('.fancybox').eq(index).attr('href', img);\n\t\t\t$('.selectionContainer').find('.fancybox').fancybox();\n\t\t}\n\t});\n\tif (eventtype == 15){\n\t\timgContainer.show();\n\t}\t\t\t\t\t\t\t\t\n\tshowSelection();\n}", "function getAmbulance_scene(baseLocation) {\n\t $(\"#Ambulance_Id\").empty();\n // here calling masterdata ajax call\n loadingAmbulanceMaster(baseLocation);\n var selectfirst = \"<option value='0'>Select Ambulance</option>\";\n $('#Ambulance_Id').append(selectfirst);\n $.each(ambulances, function (i, resData) {\n var ambulances = \"<option value=\" + resData.vehicleID + \">\" + resData.vehicleName + \"</option>\";\n $(ambulances).appendTo('#Ambulance_Id');\n });\n\n $('#Ambulance_Id').trigger(\"chosen:updated\");\n $(\"#Ambulance_Id\").chosen();\n}", "function loadMedalsAndScoreboards()\r\n{\r\n\tngio.queueComponent(\"Medal.getList\", {}, onMedalsLoaded);\r\n\tngio.queueComponent(\"ScoreBoard.getBoards\", {}, onScoreboardsLoaded);\r\n\tngio.executeQueue();\r\n}", "function doneFetch() {\n var sublists = createSublists(candidates);\n\n createStudentGenderChart('.student-gender-chart', sublists['genderList']);\n createStudentEthnicityChart('.student-enthnicty-chart', sublists['ethnicityList']);\n createStudentScoresChart('.student-scores-chart', sublists['satScoresList']);\n createStudentDepartmentsChart('.student-departments-chart', sublists['departmentCandidateList']);\n createDepartmentGenderChart('.department-gender-chart', sublists['departmentGenderList']);\n\n d3.select('.main').style('z-index', '1');\n d3.select('.loading').style('display', 'none');\n }", "function myInit() {\r\n neighborhoods_select = document.getElementById('neighborhoods-select');\r\n cuisines_select = document.getElementById('cuisines-select');\r\n ul = document.getElementById('restaurants-list');\r\n if (window.Worker) {\r\n self.selectWorker = new Worker(\"js/worker-min.js\");\r\n self.selectWorker.postMessage({method:'Neighborhoods'});\r\n requestAnimationFrame(()=>{self.selectWorker.onmessage = function(e) {\r\n var res = JSON.parse(e.data);\r\n switch(res.method) {\r\n case 'Neighborhoods': \r\n fetchNeighborhoods(res.data);\r\n self.selectWorker.postMessage({method:'Cuisines',data:res.N});\r\n self.allRestaurants =res.N;\r\n break;\r\n case 'Cuisines':\r\n fetchCuisines(res.data);\r\n break;\r\n case 'Both':\r\n resetRestaurants(res.data);\r\n fillRestaurantsHTML();\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n}", "function loadView() {\n\t\tvar srv1 = comc.requestLiteList('HCONLTTIPO', $scope.cntx);\n\t\tvar srv2 = comc.requestLiteList('ANUALIDAD', $scope.cntx);\n\t\tvar srv3 = comc.requestLiteList('MES', $scope.cntx); \n\t\tvar srv4 = comc.request('cate/list', $scope.cntx);\n\t\tvar srv5 = comc.request('conc/full', $scope.cntx);\n\t\t\n\t\t$q.all([srv.stResp(true, srv1,srv2,srv3,srv4,srv5)]).then(function() {\n\t\t\tview();\n\t\t});\n\t}", "function loadOffers() {\n var offers_select = document.getElementById(\"deposit_offers\")\n for (var i = 0; i < offers.length; i++) {\n var option = document.createElement(\"option\");\n option.value = (offers[i]);\n option.innerHTML = \"Issuing Institute: \" + String(offers[i].issuingInstitute) + \"\\nValid Till: \"+\n String(offers[i].validTill) + \"\\nDuration: \"+ String(offers[i].duration) + \"\\nInterest: \"+\n String(offers[i].interest);\n offers_select.appendChild(option);\n }\n }", "function loadPresets() {\n fetchAllPresets(function (data) {\n $(\"#preset-list\").empty();\n var count = 0;\n var previousID = 0;\n $(data).each(function () {\n // Use first preset as standard favorite\n if (count <= 0) {\n if ((typeof favoritePresetID[address] === 'undefined')\n || favoritePresetID[address] === null) {\n favoritePresetID[address] = this.id;\n saveLocalSettings();\n }\n centerPresetID = this.id;\n }\n\n // Save all unused preset IDs\n for (var i = previousID + 1; i < this.id; i++) {\n emptyPresetIDs.push(i);\n }\n previousID = parseInt(this.id);\n\n // Construct preset entry\n var root = $(document.createElement(\"li\"))\n .addClass(\"list-group-item\")\n .attr('data-id', this.id)\n .click(function (evt) {\n if ($(evt.target).hasClass(\"preset-name\")\n || $(evt.target).hasClass(\"list-group-item\")) {\n console.log(\"Go To Preset #\" + $(this).attr('data-id'));\n gotoPreset($(this).attr('data-id'));\n }\n })\n .append($(document.createElement('span')).addClass('preset-name').text(this.name));\n $(root).append(\"<div class='pull-right'>\\n\\\n <a class='preset-options'><span class='glyphicon glyphicon-cog text-muted'></span></a>\\n\\\n </div>\");\n $(\"#preset-list\").append(root);\n\n // Set favorite\n if (favoritePresetID[address] === this.id) {\n $(root).find('.preset-fav')\n .removeClass('glyphicon-star-empty')\n .addClass('glyphicon-star');\n }\n\n count++;\n });\n\n $(\".preset-options\").click(function (evt) {\n var parent = $(this).parent().parent();\n var id = parent.attr('data-id');\n var name = parent.find('.preset-name').html();\n\n preset.id = id;\n preset.name = name;\n preset.parent = parent;\n\n if (favoritePresetID[address] === id) {\n $(\"#preset-options-modal-favorite\").addClass(\"active\");\n $(\"#preset-options-modal-favorite-addon\")\n .addClass(\"text-gold\")\n .removeClass(\"glyphicon-star-empty\")\n .addClass(\"glyphicon-star\");\n } else {\n $(\"#preset-options-modal-favorite\").removeClass(\"active\");\n $(\"#preset-options-modal-favorite-addon\")\n .removeClass(\"text-gold\")\n .removeClass(\"glyphicon-star\")\n .addClass(\"glyphicon-star-empty\");\n }\n\n $(\"#preset-options-modal-empty-name-alert\").hide();\n $(\"#preset-options-modal-override\").removeAttr('disabled');\n $(\"#preset-options-modal-title\").html(name);\n $(\"#preset-options-modal-name\").val(name);\n $(\"#preset-options-modal\").modal('show');\n });\n });\n}", "function init()\n{\n mostrarfrom(false);\n listado();\n\n $(\"#formulario1\").on(\"submit\",function(e)\n {\n guardaryeditar(e);\n });\n\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectarea\", function(r){\n $(\"#idarea\").html(r);\n // $('#idarea').selectpicker('refresh');\n });\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectpersona\", function(r){\n $(\"#idpersona\").html(r);\n // $('#idpersona').selectpicker('refresh');\n });\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectipoEquipo\", function(r){\n $(\"#IPtipoequipo\").html(r);\n // $('#idordenador').selectpicker('refresh');\n });\n\n $(\"select[name=IPtipoequipo]\").change(function () {\n \n var id = $('select[name=IPtipoequipo]').val(); \n $.post(\"../../ajax/xips.php?op=selecEquipos&id=\"+id, function(r){\n $(\"#idequipos\").html(r);\n // $('#idordenador').selectpicker('refresh');\n });\n //alert(id_aula)\n });\n //Cargamos los items al select tipocodigo\n // $.post(\"../../ajax/xips.php?op=selectlaptop\", function(r){\n // $(\"#idlaptop\").html(r);\n // $('#idlaptop').selectpicker('refresh');\n // });\n\n //Cargamos los items al select tipocodigo\n // $.post(\"../../ajax/xips.php?op=selectimpresora\", function(r){\n // $(\"#idimpresora\").html(r);\n // $('#idimpresora').selectpicker('refresh');\n // });\n}", "async function loadOffBlockSelection()\n{\n checkboxes = []\n checkboxesDisabled = false\n\n selectedOffBlockSemester = \"0\"\n selectedOffBlockNumber = \"0\"\n\n setupOffBlockSelectionElements()\n\n console.log(selectedTeachers)\n\n var updateSelectedOffBlocks = offBlockArraysEmpty()\n console.log(updateSelectedOffBlocks)\n\n var firstSemesterCourseCount = await getCourseCount(firstSemesterID)\n var secondSemesterCourseCount = await getCourseCount(secondSemesterID)\n\n addOffBlockDivs(firstSemesterCourseCount, firstSemesterID, updateSelectedOffBlocks)\n addOffBlockDivs(secondSemesterCourseCount, secondSemesterID, updateSelectedOffBlocks)\n\n addOffBlockArrays(updateSelectedOffBlocks, firstSemesterID-1, firstSemesterCourseCount)\n addOffBlockArrays(updateSelectedOffBlocks, secondSemesterID-1, secondSemesterCourseCount)\n\n if (offBlockArraysEmpty())\n {\n generateSchedules()\n return\n }\n\n reloadMyOffBlocks()\n\n selectedOffBlockSemester = \"1\"\n selectedOffBlockNumber = \"1\"\n selectOffBlock(\"#offBlock1\")\n selectedItem = \"1\"\n itemToMoveFrom = \"1\"\n moveSelectionBox(\"#offBlock\", 1, true)\n\n $(\"#instructions\").html(\"Choose any off blocks you would like to have and then click \\\"Next\\\"\")\n}", "function bindResources() {\n sortbySelectedValue = $(\".sortby\").val();\n viewtypeSelectedValue = $(\".viewtype\").val();\n\n if (sortbySelectedValue !== undefined) {\n $.ajax({\n type: \"POST\",\n url: \"ressplan_2017.aspx/SortByTypeSelected\",\n data: '{sortby: \"' + sortbySelectedValue + '\" }',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (response) {\n var olivereoption = '';\n olivereoption = response.d;\n if (olivereoption != \"0\") {\n\n $(\".oliver\").empty().append(olivereoption);\n $(\".oliver\").multiselect('rebuild');\n\n if (oliverSelectedValue !== \"\" && oliverSelectedValue !== null) {\n $('.oliver').multiselect('select', oliverSelectedValue);\n }\n }\n else {\n $(\".oliver\").empty();\n $(\".oliver\").multiselect('rebuild');\n }\n\n resourceChange();\n },\n });\n }\n}", "function selectPickers()\n\t{\n\t\tselectPicker.locations('.location-0', \"\", \"\", 0, 'location_text');\n\t\tselectPicker.industries('.industry-0', \"\", \"\", 0, 'industry_text');\n\t\tselectPicker.currencies('.currency-0', \"\", \"\", 0, 'currency_text');\n\t}", "function obtenerEquiposParticipantes(){\n wizardFactory.equiposParticipantes(vm.torneoSelected.tor_id)\n .success(function (data) {\n vm.equiposParticipantes = data;\n obtenerEquiposDisponibles();\n })\n .error( errorHandler );\n }", "function loadOffices() {\n vm.model.offices = [];\n Issues.getOffices().then(\n function(offices) {\n $scope.$apply(function() {\n vm.model.offices = offices;\n });\n },\n function(error) {\n messageError(error);\n }\n )\n }", "function loadPlayerList() {\n playerArray.forEach(addPlayerToUIList);\n }", "function loadWholeQuestion(){\n\t\tloadQuestion();\n\t\tloadChoices();\n\t\tloadHint();\n\t\tshowQuestionNumber();\n\t}", "function getProducerSelect() {\n\tajax('GET', 'producers', null, createProducerSelect);\n}", "function chooseIds( sLetter ) {\n\n Element.show( \"nlUpdateSpinner\" );\n $( \"domainSearchForm\" ).disable();\n \n new Ajax.Updater( \"idSelectionWrapper\",\n queryURI,\n {\n method: 'get',\n parameters: \"list=1&browse=\" + sLetter,\n onComplete: function () {\n Element.hide(\"nlUpdateSpinner\");\n $( \"domainSearchForm\" ).enable();\n }\n } );\n}", "function load_GUI_all_sensors_actuators(){\n\tlista = document.getElementById(\"sensor_list\");\n\tlista.innerHTML = \"\";\t\n\tfor(var z in sensors){\n\t\tlista.innerHTML = lista.innerHTML + \"<option value='\"+sensors[z].id+\"'>\"+sensors[z].description+\"</option>\";\n\t}\n\n\tlist = document.getElementById(\"actuator_list\");\n\tlist.innerHTML = \"\";\n\tfor(var z in actuators){\n\t\tlist.innerHTML = list.innerHTML + \"<option value='\"+actuators[z].id+\"'>\"+actuators[z].description+\"</option>\";\n\t}\n\n\t//hide \"loader\" gif in room_config page\n\t$('.box').hide();\n}", "_initLoaders () {\n this.options = this.ControllerHelper.request.getArrayLoader({\n loaderFunction: () => this.LogsOptionsService.getOptions(this.serviceName)\n });\n this.currentOptions = this.ControllerHelper.request.getArrayLoader({\n loaderFunction: () => this.LogsOptionsService.getSubscribedOptionsMapGrouped(this.serviceName)\n });\n this.selectedOffer = this.ControllerHelper.request.getHashLoader({\n loaderFunction: () => this.LogsOptionsService.getOffer(this.serviceName)\n });\n\n this.service = this.ControllerHelper.request.getHashLoader({\n loaderFunction: () => this.LogsDetailService.getServiceDetails(this.serviceName)\n .then(service => {\n if (service.state !== this.LogsConstants.SERVICE_STATE_ENABLED) {\n this.goToHomePage();\n } else {\n this.options.load();\n this.currentOptions.load();\n this.selectedOffer.load();\n }\n return service;\n })\n });\n this.service.load();\n }", "function loadTrainers() {\n fetch(TRAINERS_URL)\n .then(res => res.json())\n .then(json => json.forEach(trainer => displayTrainer(trainer)))\n}", "function initSelectionLists() {\n vm.selectionLists.defendantRole = [\n { label: \"Primary Defendant\", value: \"prime\" },\n { label: \"Secondary Defendant\", value: \"secondary\" },\n { label: \"3rd Party Defendant \", value: \"tertiary\" },\n { label: \"Discontinued Defendant\", value: \"quaternary\" }\n ];\n\n vm.selectionLists.gender = [\n { label: \"Male\", value: \"male\" },\n { label: \"Female\", value: \"female\" },\n { label: \"Other\", value: \"other\" },\n { label: \"Not Specified\", value: \"Not Specified\" }\n ];\n\n }", "function populatelawyers(comp_id){\n if (comp_id==\"\"){\n jQuery('#productdiv').html(\"\");\n jQuery('#empdiv').html(\"\");\n return false\n }\n loader.prependTo(\"#empdiv\");\n jQuery.ajax({\n type: \"GET\",\n url: \"/assign_licence/\"+comp_id,\n dataType: 'script',\n data: {\n 'comp_id' : comp_id,\n 'populate' : \"employees\"\n },\n success: function(){\n loader.remove();\n }\n });\n}", "function loadOldData()\n {\n // recipient types\n var recipientTypesEl = $('.recipient-types');\n var selected_types = recipientTypesEl.data('selected_types') || [];\n _.each(selected_types, function(t) {\n recipientTypesEl.find('[value=\"'+t+'\"]').prop('checked', true).trigger('change');\n });\n\n // recipient groups\n var groupsEl = $('.recipient-groups');\n var selected_groups = groupsEl.data('selected_groups') || [];\n _.each(selected_groups, function(t) {\n groupsEl.find('[value=\"'+t+'\"]').prop('checked', true).trigger('change');\n });\n }", "function LoadDistributionByAnswer(){\n\t\n\tfor (var i = 0; i < answers.length;i++){\n\t\tif (answers[i].SelectedAnswer != null)\n\t\t{\n\t\t\tvar answerid = answers[i].SelectedAnswer.Id;\n\t\t\t\n\t\t\t$.get( \"datalayer.php\", { task: \"LoadDistributionByAnswer\", id: answerid,language: SystemLanguage} )\n\t\t\t\t.done(function( data ) {\t\n\t\t\t\t\tvar obj = JSON.parse(data);\n\t\t\t\t\tfor (var x = 0; x < obj.length;x++){\n\t\t\t\t\t\tvar found = false;\n\t\t\t\t\t\tfor (var y = 0; y < distros.length;y++){\n\t\t\t\t\t\t\tif (distros[y].Name == obj[x].Name){\n\t\t\t\t\t\t\t\tdistros[y].ChoosedBy++;\n\t\t\t\t\t\t\t\tif (distros[y].ChoosedByQuestion.length == 0){\n\t\t\t\t\t\t\t\t\tdistros[y].ChoosedByQuestion = [];\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\tdistros[y].ChoosedByQuestion.push(answers[i]);\n\t\t\t\t\t\t\t\tfound = true;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tobj[x].ChoosedBy = 1;\n\t\t\t\t\t\t\tif (obj[x].ChoosedByQuestion.length == 0){\n\t\t\t\t\t\t\t\t\tobj[x].ChoosedByQuestion = [];\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tobj[x].ChoosedByQuestion.push(answers[i]);\n\t\t\t\t\t\t\tdistros.push(obj[x]);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\tSortDistributionsByRank();\n\t\t\t\t\tDisplayDistributions();\n\t\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\t\n}", "initList() {\n this.loadedMinTime = true;\n this.postLoadState = STATE_OK;\n this.timeoutId = setTimeout(this.connectionTimedOut, TIME_TIMEOUT);\n this.props.communication.requestInstances(this);\n }", "function loadOffer() {\n $rootScope.local_load = true;\n\n $scope.offer_id = $stateParams.offer;\n\n offerService.getSingleOffer($stateParams.offer, function (offer) {\n companyService.getCompanyInformation(offer.company, function (company) {\n prepareMappedComparisons(offer, company, function (err, criteria) {\n $scope.criteria = criteria;\n if (err) return console.log(err);\n\n $scope.offer = offer;\n $scope.company = company;\n $scope.offer_count = 0;\n\n $scope.getProductsForThisInsuranceType();\n $scope.number_of_eligible_products = $scope.offer.products ? Object.keys($scope.offer.products).length : 0;\n\n $scope.tree = {};\n\n if (offer.comparisons) {\n\n $scope.comparison_keys = Object.keys($scope.offer.comparisons);\n $scope.offer_count = $scope.comparison_keys.length;\n\n $scope.compare_insurance_types = [];\n $scope.general={};\n\n $scope.tree = {\n specific: {},\n additional: {}\n };\n\n $scope.branch_keys = Object.keys($scope.tree);\n $scope.obsolete_criteria = {};\n\n //iterate offer comparisons\n $scope.comparison_keys.forEach(comparison_key => {\n const comparison = offer.comparisons[comparison_key];\n\n //iterate comparison insurance types\n for (let insurance_type_key in comparison.insurance_types) {\n if (comparison.insurance_types.hasOwnProperty(insurance_type_key)) {\n const insurance_type = comparison.insurance_types[insurance_type_key];\n\n if (typeof insurance_type === 'object') { //Dev.purposes mostly: we don't expect this to be false in real life\n\n /**\n * Additional & Specific\n */\n\n const comparison_type = insurance_type_key === offer.subject ? 'specific' : 'additional';\n\n //Combining criteria from comparison object with industry/insurance criteria mapping\n const related_criteria = [...new Set((criteria[insurance_type_key] || []).concat(Object.keys(insurance_type.specific || {})))];\n\n if (related_criteria.length) { //There're applicable criteria for this insurance/industry\n if (!$scope.tree[comparison_type][insurance_type_key]) $scope.tree[comparison_type][insurance_type_key] = {};\n\n related_criteria.forEach(criterion_key => {\n if (!$scope.tree[comparison_type][insurance_type_key][criterion_key]) $scope.tree[comparison_type][insurance_type_key][criterion_key] = {};\n $scope.tree[comparison_type][insurance_type_key][criterion_key][comparison_key] = insurance_type.specific ? insurance_type.specific[criterion_key] : false;\n\n // Checking for the \"obsolete\" criteria. I.e. the criteria that exist in the offer, but have been removed from the mapping\n if (criteria[insurance_type_key].indexOf(criterion_key) === -1) {\n if (!$scope.obsolete_criteria[insurance_type_key]) $scope.obsolete_criteria[insurance_type_key] = {};\n $scope.obsolete_criteria[insurance_type_key][criterion_key] = true;\n }\n });\n } else { //Empty insurance type has no applicable criteria\n $scope.tree[comparison_type][insurance_type_key] = false;\n } //if (related_criteria.length)\n } //if (typeof insurance_type === 'object')\n } //if (comparison.insurance_types.hasOwnProperty(insurance_type_key))\n }\n\n });\n }\n $rootScope.local_load = null;\n $scope.adding_comparison = false;\n $scope.copying_comparison = false;\n $scope.CheckModel();\n console.log($scope.tree);\n console.log($scope.offer.comparisons);\n $scope.safeApply();\n }); //prepareMappedComparisons(offer, company, function (err, criteria)\n }); //companyService.getCompanyInformation(offer.company, function (company)\n }); //offerService.getSingleOffer($stateParams.offer, function (offer)\n }", "function getWinners(){\n $scope.errorMessage='';\n graphApi.getWinners()\n .success(function(data){\n getNodes(data, null);\n renderAgain();\n $scope.winners=data;\n })\n .error(function () {\n $scope.errorMessage=\"Unable to load winners: Database request failed\";\n });\n }", "function loadView() {\n\t\tvar srv1 = comc.requestLiteList('ANUALIDAD', $scope.cntx);\n\t\tvar srv2 = comc.requestLiteList('MES', $scope.cntx); \n\t\tvar srv3 = comc.requestLiteList('PRESESTA', $scope.cntx);\n\t\tvar srv4 = comc.request('cate/list', $scope.cntx);\n\t\tvar srv5 = comc.request('conc/full', $scope.cntx);\n\t\t\n\t\t$q.all([srv.stResp(true, srv1,srv2,srv3,srv4,srv5)]).then(function() {\n\t\t\tvar srv6 = comc.requestParaGet('I', 'PERIPRESUP', '', $scope.cntx);\n\t\t\t\n\t\t\t$q.all([srv.stResp(false, srv6)]).then(function() {\n\t\t\t\tif ($scope.cntx.data.get('prPeripresup').pval.anac !== 'undefined' &&\n\t\t\t\t\t$scope.cntx.data.get('prPeripresup').pval.anac > 0) {\n\t\t\t\t\tif ($scope.cntx.form.get('anua').data === 0) {\n\t\t\t\t\t\t$scope.cntx.form.get('anua').data = $scope.cntx.data.get('prPeripresup').pval.anac;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar srv7 = comc.request('pres/anua', $scope.cntx);\n\t\t\t\t\n\t\t\t\t$q.all([srv.stResp(true, srv7)]).then(function() {\n\t\t\t\t\tview();\n\t\t\t\t\tpresAnuaChart();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function initSelectionHandler(){\n $('button#select').on('click', function(e){\n var $filelist = $('#filelist');\n // clear the list and add the new selections\n $filelist.find('tr[data-source=\"config-browser\"]').each(function(idx, tr){\n var selection = getSelectionFromTR(tr);\n $filelist.trigger({type: 'config:removed', source: 'config-browser', selection: selection});\n });\n $(selections).each(function(idx, selection){\n $filelist.trigger({type: 'config:added', source: 'config-browser', selection: selection});\n });\n selections = [];\n });\n }", "function selection() {\n $(\"#start\").hide();\n $(\"#selectionArea\").fadeIn(\"slow\");\n //Get list of all categories and append to the selectionArea\n $.getJSON(\"https://icanhazdadjoke.com/\").done(function(result) {\n dadjoke = result.joke;\n document.getElementById(\"joke2\").innerHTML = dadjoke;\n });\n\n fetch(\"https://opentdb.com/api_category.php\")\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n var list = data.trivia_categories;\n list.forEach(function(quiz){\n var categoryList = document.getElementById(\"quizList\");\n var listElement = document.createElement(\"li\");\n var name = document.createTextNode(quiz.name);\n\n listElement.appendChild(name);\n listElement.setAttribute(\"id\", quiz.id);\n listElement.setAttribute(\"class\", \"quiz\");\n categoryList.appendChild(listElement);\n });\n\n //Adding eventListeners to trigger next page\n document.querySelectorAll(\".quiz\").forEach(function(quiz) {\n quiz.addEventListener(\"click\", function() {\n toSpecification(quiz.id);\n });\n });\n })\n .catch(function(error) {\n handleFetchError(error);\n });\n}", "function getAmbulance_reg(baseLocation) {\n $('#reg_statutory_ambulanceID').empty();\n // here calling masterdata ajax call\n loadingAmbulanceMaster(baseLocation);\n var selectfirst = \"<option value='0'>Select Ambulance</option>\";\n $('#reg_statutory_ambulanceID').append(selectfirst);\n $.each(ambulances, function(i, resData) {\n var ambulances = \"<option value=\" + resData.vehicleID +\",\"+resData.vehicleName+\">\" + resData.vehicleName + \"</option>\";\n $(ambulances).appendTo('#reg_statutory_ambulanceID');\n\n\n });\n\n $('#reg_statutory_ambulanceID').trigger(\"chosen:updated\");\n $('#reg_statutory_ambulanceID').chosen();\n}", "function loadChoiceSet(event, mID, data) {\n // First, reset movies list on-screen\n resetMovies();\n\n // Filter the new recommendation set\n data = data.map(function(movie) {\n return movie.itemid;\n });\n data.shift();\n\n // Load the new recommendation set\n var promises = [];\n for(var i in data) {\n var mID = data[i];\n promises.push(loadMovieInfo(i, mID, 'movieid'));\n }\n\n // Save the movie selected\n postChoices(mID);\n\n // Update choice number\n postChoiceNumber(function() {\n // Log choice set load event\n postEvent(event, choiceNumber+1);\n });\n\n // When movie info is loaded for all movies\n $.when.apply($, promises).done(function() {\n // Update the movies list on the backend for the user\n postMovies();\n });\n}", "function uresponsable() {\n $(\"#empleados\").load(\"consultas_cpu.php?combo=responsable\");\n}", "function party_load(){\n var parties = [{value: \"party\", text: \"Party\"},\n {value: \"Democrat\", text: \"Democrat\"},\n {value: \"Independent\", text: \"Independent\"},\n {value: \"Republican\", text: \"Republican\"},\n {value: \"NA\", text: \"NA\"}]\n \n var elm = document.getElementById('party'); // get the select\n for(i=0; i< parties.length; i++){\n var option = document.createElement('option'); // create the option element\n option.value = parties[i].value; // set the value property\n option.appendChild(document.createTextNode(parties[i].text)); // set the textContent in a safe way.\n if(elm != null){\n elm.append(option);\n } \n }\n }", "function init() {\n listar();\n\n $.post(\"../ajax/venta.php?op=selectCliente\", function (r) {\n $(\"#idcliente\").html(r);\n $(\"#idcliente\").selectpicker('refresh');\n });\n}", "function areasLoaded(e) {\n // Clear all the choices and the saved areas\n clearChoices();\n areaNums.length = 0;\n\n let obj = JSON.parse(e.target.responseText);\n\n // Total possible areas\n let possibleAreas = obj.results.length;\n // Array to save refrences to areas selected\n let displayAreas = [];\n\n // Randomly get new area and save their index\n for (let index = 0; index < 3; index++) {\n let randomPossibleArea = Math.floor((Math.random() * possibleAreas));\n\n while (displayAreas.includes(randomPossibleArea) == true) {\n randomPossibleArea = Math.floor((Math.random() * possibleAreas));\n }\n\n displayAreas[index] = randomPossibleArea;\n }\n\n // itteration index for the for loop\n let addId = 0;\n\n // get all the choices and divs\n let choiceContent = document.querySelectorAll(\".choiceDIV\");\n let choiceIMG = document.querySelectorAll(\".choiceMedia\");\n let choiceButton = document.querySelectorAll(\".choiceButton\");\n\n // change the slection heading\n document.querySelector(\"#functionHeading\").innerHTML = \"<h2>Pokémon are in these areas!</h2>\";\n\n // for each saved area assign data about them in the Search and catch div, also save an index to those area for encounters\n displayAreas.forEach(area => {\n\n let areaName = obj.results[area].name;\n let capsName = capFirstLetter(areaName);\n\n choiceContent[addId].innerHTML = \"<p><b>\" + capsName + \"</b></p>\";\n\n choiceIMG[addId].innerHTML = \"<img src='images/\" + areaName + \".png' alt='\" + capsName + \" Image'>\";\n //project2\\images\\pond.png\n choiceButton[addId].innerHTML = \"<button>Explore Here!</button>\";\n\n areaNums.push((area + 1));\n\n addId += 1;\n });\n\n // Add the get encouter event lisnter for users to encount pokemon in a slected area\n document.querySelectorAll(\".choiceButton\").forEach(button => {\n button.removeEventListener('click', getAreas);\n button.removeEventListener('click', addPokemonToTeam);\n button.addEventListener('click', getEncounters);\n });\n\n}", "function loadProducts() {\n\t\tnewRecipe();\n RecipesService.getProducts().then(\n function(response) {\n $scope.products = response.data;\n\n $timeout(function() {\n $scope.loading = false;\n }, 100);\n },\n function(error) {\n \tconsole.warn(error);\n }\n );\n }", "$onInit() {\n\n \tPromise.all([\n \t\tthis.loadLocations(),\n \t\tthis.loadCategories(), \n \t\tthis.loadCollections()\n \t]).then(() => this.loadFeatures(this.filter))\n }", "function loadPanels() {\n\t\t\tloadMonthlyCelebrants();\n\t\t\t//loadNewlyBaptized();\n\t\t}", "function getDisciplines() {\n $('#disciplines').multiselect({\n includeSelectAllOption: true,\n buttonText: function(options, select) {\n return 'Select one or more';\n },\n onChange: function(option, checked, select) {\n $(option).each(function(index, id) {\n let i = disciplineArr.indexOf(id.value);\n if (i === -1) {\n disciplineArr.push(id.value); \n } else {\n disciplineArr.splice(i, 1);\n if (disciplineArr.length === 0) {\n disciplineArr.push(0);\n }\n }\n });\n searchBooksObj.tagIds = disciplineArr;\n }\n });\n fetch(baseUrl + 'tag')\n .then(disciplineResponse => disciplineResponse.json())\n .then(disciplines => {\n let data = disciplines.map(discipline => {\n return {label: discipline.name, title: discipline.name, value: discipline.id};\n });\n // programmatically add data to select list using multiselect library\n $('#disciplines').multiselect('dataprovider', data);\n })\n .catch(error => console.error(error));\n}", "function loadSelectedOfferEdit() {\n\n\tofferToUpdate = getURLParameter(\"aid\");\n\t// alert(offerToUpdate);\n\tconnect(\"/hiwi/Provider/js/getOffer\", \"aid=\" + offerToUpdate,\n\t\t\thandleLoadEditOfferResponse);\n}", "function populateSampleList(data) {\n\n data = data.sort();\n\n $.each(data, function(key, value) {\n $('#zz')\n .append($(\"<option></option>\")\n .attr(\"value\", value)\n .on(\"click\", addToList)\n .text(value));\n });\n\n\n\n $(\"#zz\").val('-- select projectRun --').trigger(\"chosen:updated\");\n $(\"#loading\").hide();\n\n}", "function selectNextActivitiesAndParties(command, method) {\n\tvar Url = L5.webPath + \"/jsp/workflow/help/selectnextactivitiesandparties.jsp?assignmentId=\"\n\t+ getProcessInfoFromContext(\"assignmentId\");\n\tUIFrame(command, method, Url, \"Next\");\n}", "function loadRequests(){\n var result = RequestsService.get({param:AuthService.getId()}, function() {\n $scope.requests = result.requests;\n }, function(){\n Loading.showText('No se pudo cargar las solicitudes favoritas.');\n Loading.hideTimeout();\n });\n }", "function loadDataWp(){\n $.getJSON(feedURL, function(json) {\n parseDataWp(json, false);\n if(setKeys.length>1){selectedSetNum=1;}\n dataLoaded=true;\n populateSelect();\n updateSet();\n }).fail( function(d, textStatus, error) {\n if(setKeys.length>1){selectedSetNum=1;}\n populateSelect();\n updateSet();\n dataLoaded=false;\n });\n }", "loadData() {\n this.hvacData = HVACDataLoader.getHVACData(this);\n if (this.hvacData.getBuildingList().length > 0) this.selectBuilding(this.hvacData.getBuildingList()[0]);\n }", "function loadClients(){\n\tconsole.log(\"attempting to load clients\");\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Clients'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tservers=data;\n\t\t\t\t\n\t\t\tvar x = document.getElementById(\"client-select\");\n\t\t\t\n\t\t\tfor(var i=0;i<servers.length;i++)\n\t\t\t{\n\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\toption.text = servers[i].client_name;\n\t\t\t\toption.value = servers[i].client_id;\n\t\t\t\tx.add(option);\n\t\t\t}\n\t\t}\n\t});\n}", "function _loadController() {\n // pageService.getPagData(contactPageId).then(\n // _getPageDataSuccessResult, _getPageDataErrorResult);\n pageService.getAllSelect(columnIds).then(_getAllSelectSuccessResult, _getAllSelectErrorResult)\n function _getAllSelectSuccessResult(result) {\n\n $scope.dropDownLists = result;\n\n $scope.entity.Current = param.Current;\n if (param.Current != undefined) {\n if (!param.Current.IsSameAsPermanent) {\n $scope.entity.Permanent = param.Permanent;\n }\n }\n\n }\n function _getAllSelectErrorResult(err) {\n\n }\n }", "function load(participants$, conferenceDetails$) {\n\n\n window.PEX.actions$.ofType('[Conference] Connect Success').subscribe((action) => { \n \n this.vmr = action.payload.alias; \n this.displayname = action.payload.displayName;\n\n });\n\n }", "function refreshPie() {\n\t\tvar partners = [\"piston\", \"plumgrid\"];\n\t\tfor (var i = 0; i < partners.length; i++) {\n\t\t\tgetData(partners[i])\n\t\t}\n\t\tsetTimeout(refreshPie, 1000);\n\t}", "function reload_followers_select() {\n $.get(admin_url + 'tasks/reload_followers_select/' + taskid, function(response) {\n $('select[name=\"select-followers\"]').html(response);\n $('select[name=\"select-followers\"]').selectpicker('refresh');\n });\n}", "function getFormData(alias_name) {\r\n\r\n $(\"#loading\").show();\r\n $(\"#formData\").load(\"/users/\" + alias_name, function () {\r\n $(\"#loading\").hide();\r\n $(\"#register\").find('.errorMsg').html('');\r\n \r\n $('.profession_type_element_destination .profession_type_element').remove();\r\n $(\".profession_type_element\").appendTo(\".profession_type_element_destination\");\r\n //custom select\r\n custonSelect();\r\n });\r\n\r\n}", "function loadLists() {\r\n\t\tlistItems();\r\n\t\taddCheckButtonEvents();\r\n\t\taddDeleteButtonEvents();\r\n\t}", "loadAddons() {\n\t\t// load muti select dropdowns\n\t\t$(`#${this.formId} #roleIds`).multiSelect({\n\t\t\tselectableHeader: \"All Roles\",\n\t\t\tselectionHeader: \"Selected Roles\",\n\t\t});\n\n\t\tRequest.send(\"/api/roles\", \"GET\")\n\t\t\t.then((response) => {\n\t\t\t\tlet roles = response.data;\n\t\t\t\t// populate muti selects\n\t\t\t\troles.forEach((role) => {\n\t\t\t\t\t$(`#${this.formId} #roleIds`).multiSelect(\"addOption\", {\n\t\t\t\t\t\tvalue: role.id,\n\t\t\t\t\t\ttext: role.name,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((e) => {\n\t\t\t\tconsole.log(e);\n\t\t\t});\n\t}" ]
[ "0.64359224", "0.6208802", "0.6164785", "0.61607283", "0.6020295", "0.5882443", "0.5869283", "0.58347934", "0.57876337", "0.57861394", "0.577068", "0.57621163", "0.5759205", "0.5743609", "0.57420623", "0.573382", "0.5720121", "0.5719845", "0.5706663", "0.56966305", "0.5693122", "0.5649917", "0.56368303", "0.56347597", "0.56196654", "0.5618463", "0.56104076", "0.5607638", "0.56027204", "0.5589546", "0.55449086", "0.5530723", "0.54943097", "0.5487092", "0.5476831", "0.5470717", "0.5470717", "0.54696953", "0.5466919", "0.54664075", "0.5454188", "0.5451779", "0.5448088", "0.5443842", "0.543367", "0.5431312", "0.5408834", "0.54060006", "0.5396195", "0.53951436", "0.53934896", "0.5384897", "0.53829056", "0.53825545", "0.5382126", "0.53815967", "0.5371085", "0.5369254", "0.5364132", "0.5360703", "0.5360675", "0.53599846", "0.5356095", "0.5351092", "0.53505284", "0.5341799", "0.5337299", "0.53365874", "0.5333582", "0.5332423", "0.5331752", "0.53292054", "0.5328948", "0.5322038", "0.53169626", "0.5314743", "0.5312314", "0.5309005", "0.5304533", "0.529955", "0.52971655", "0.5290802", "0.5287805", "0.5287008", "0.5276667", "0.5275078", "0.5270848", "0.5269767", "0.52676976", "0.5267178", "0.52621645", "0.5255838", "0.52546114", "0.5251943", "0.5251288", "0.52508974", "0.5245637", "0.5239653", "0.52358305", "0.52330786" ]
0.75619054
0
Fade in Cells randomly
function gridTransition() { $('#game_board').each(function(){ var $cell = $(this).find('.open'); var cell_amount = $cell.length; var random_cell = $cell.eq(Math.floor(cell_amount*Math.random())); random_cell.animate({'color': jQuery.Color('#fff')}, 100, function(){ $(this).animate({'color': jQuery.Color('#bd727b')}, 100); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorFade() {\n var color = [];\n\n for (var i = 0; i < 3; i++) {\n var pickNum = Math.floor(Math.random() * 255);\n color.push(pickNum);\n }\n\n $(\"body\").css({\n backgroundColor: \"rgb(\" + color[0] + \", \" + color[1] + \", \" + color[2] + \")\"\n });\n }", "function mozaicShow(time){\n panel.each(function(index){\n $(this).css('z-index', '1');\n var delayTime = Math.floor((Math.random() * basicAnimationTime) + 100);\n var colors = Math.floor((Math.random() * colorsArray.length) + 0);\n if (index < (panel.length-4)) {\n $(this).delay(delayTime).animate({\n backgroundColor: colorsArray[colors],\n },function(){\n });\n }\n });\n}", "function fadeIn(ms) {\n\t// array of random steps\n\tsteps = [];\n\tvar rows = cipherblock.length;\n\tvar cols = cipherblock[0].length;\n\tfor (var row=0; row<rows; row++) {\n\t\tsteps[row] = [];\n\t\tfor (var col=0; col<cols; col++) {\n\t\t\tsteps[row][col] = Math.max(Math.random()/20, 0.02);\n\t\t\tcipherblock[row][col].style.opacity = 0;\n\t\t}\n\t}\n\t\n\tvar total = cipherblock.length * cipherblock[0].length;\n\tvar completed = 0;\n\t\n\tvar id = setInterval(frame, ms);\n\tvar count = 0;\n\tvar opacity;\n\tfunction frame() {\n\t\tfor (var row=0; row<rows; row++) {\n\t\t\tfor (var col=0; col<cols; col++) {\n\t\t\t\topacity = parseFloat(cipherblock[row][col].style.opacity);\n\t\t\t\tif (opacity >= 1) continue; // already finished this one\n\t\t\t\topacity += steps[row][col];\n\t\t\t\tif (opacity >= 1) {\n\t\t\t\t\topacity = 1;\n\t\t\t\t\tcompleted++;\n\t\t\t\t}\n\t\t\t\tcipherblock[row][col].style.opacity = opacity;\n\t\t\t}\n\t\t}\n\t\tif (completed == total) {\n\t\t\tclearInterval(id);\n\t\t}\n\t}\n}", "function repeat(){\n blinkingPartners\n .attr('r',\".1vh\")\n .style('opacity',1)\n .transition()\n .duration(2000)\n .ease(d3.easeLinear)\n .attr('r',\"2.5vh\")\n .style('opacity',0)\n .on(\"end\", repeat)\n \n }", "function flicker () {\n\tfor (let i = 0; i < allStars.length; i++) {\n\t\tlet animDuration = Math.floor(Math.random() * 8);\n\t\tif (i%20 == 0) {\n\t\t\t//allStars[i].style.animation = \"flicker \"+animDuration+\"s infinite\";\n\t\t}\n\t}\n}", "function shading() {\n var $cells = $('.grid-cell');\n $cells.each(function () {\n if ((columns % 2) == 0) {\n if ((Math.floor($i / columns) + $i) % 2 == 1) $(this).addClass('black')\n else $(this).addClass('white');\n $i++;\n } else {\n if (($i % 2) == 1) $(this).addClass('black')\n else $(this).addClass('white');\n $i++;\n }\n\n });\n $i = 0;\n }", "function bgChanger() {\n var colorArr = ['red', 'blue', 'yellow', 'gold', 'pink']\n var colorIndex = Math.floor(Math.random() * 6)\n var $body = $('body')\n\n var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';\n\n $body.css('backgroundColor', hue)\n $body.css('transition', 'all, 0.5s ease-out')\n\n}", "function showRow(){\n $(\".row\").fadeIn(5000,showTable);\n}", "function _changeBg(index, arrayEl, time){\n\t\tif(index===0)\n\t\t\t$(arrayEl[0]).fadeIn(2000);\n\t\tsetTimeout(function(){\n $(arrayEl[index]).fadeOut(2000);\n if(index+1 < arrayEl.length)\n \t$(arrayEl[index+1]).fadeIn(2000);\n\n return index+1 === arrayEl.length ? _changeBg(0, arrayEl, time): _changeBg(index+1, arrayEl, time);\n }, time);\n\t}", "function applesBackOnTree() {\r\n $(\".apple\").hide().each(function () {\r\n $(this).css({\r\n top: (treePosTop + (Math.random() * 30)) + \"%\",\r\n left: (treePosLeft + (Math.random() * 30)) + \"%\",\r\n }).fadeIn(3000);\r\n })\r\n}", "function fadeIn(g, i) {\n\t \n\t chart.selectAll(\".circles\")\n\t \t.transition()\n\t .style(\"opacity\", .25);\n\t \n\t chart.selectAll(\".circles-text\")\n\t \t.transition()\n\t .style(\"opacity\", 1);\n\t \n\t chart.selectAll(\".nz\")\n\t \t.transition()\n\t .style(\"opacity\", .85);\n\t \n\t tooltip.style(\"visibility\", \"hidden\");\n\t \n\t}", "function randfill() {\n let numfill = parseInt(document.querySelector(\"#rand\").value);\n let cells = colnum * rownum;\n numfill = cells * numfill / 100; //calck the number of cells to change\n for (let k = 0; k <= numfill; k++) {\n let i = Math.floor(Math.random() * colnum);\n let j = Math.floor(Math.random() * rownum);\n if (document.querySelector(`#id${i}_${j}`).className === \"alive\") //if the cell is alredy alive rand again\n k--;\n else\n document.querySelector(`#id${i}_${j}`).className = \"alive\";\n }\n}", "function showGrid() {\n\tg.selectAll('.count-title')\n\t .transition()\n\t .duration(0)\n\t .attr('opacity', 0);\n\t\n\tg.selectAll('.square')\n\t .transition()\n\t .duration(0)\n\t //.delay(function (d) {\n\t //\treturn 5 * d.row;\n\t //})\n\t .attr('opacity', 1.0)\n\t .attr('fill', '#ddd');\n }", "function tileAnimate(tile) {\n $(tile).fadeToggle(250);\n $(tile).fadeToggle(500);\n }", "function myBoton3() {\n //En este caso nos posicionamos en todos loa td indiferentemente de la fila\n var cubo = document.getElementsByTagName(\"td\");\n for(var i = 0; i < cubo.length; i++ ){\n for(var j = 0; j < cubo.length; j++ ){\n if(i != j){\n if(cubo[i].style.backgroundColor == \"\" ){\n var cambio = Math.floor(Math.random() * (color.length));\n cubo[i].style.backgroundColor = color[cambio];\n }\n if(cubo[j].style.backgroundColor == \"\" ){\n var cambio = Math.floor(Math.random() * (color.length));\n cubo[j].style.backgroundColor = color[cambio];\n }\n while(cubo[i].style.backgroundColor == cubo[j].style.backgroundColor){\n \n var cambio = Math.floor(Math.random() * (color.length));\n cubo[j].style.backgroundColor = color[cambio]; \n } \n }\n }\n }\n}", "function fadeAll() {\n window.grid = document.getElementById(\"grid\");\n grid.className = \"fade\";\n}", "function fadeOutRandom(ms) {\n\thideButtons();\n\t// array of random steps (delta y, delta x)\n\tsteps = [];\n\tpositions = [];\n\tblurs = [];\n\tsizes = [];\n\tvar rows = cipherblock.length;\n\tvar cols = cipherblock[0].length;\n\tvar slope;\n\tvar centerx = cols*sizex/2 + startx;\n\tvar centery = rows*sizey/2 + starty;\n\tvar d;\n\tvar dx, dy;\n\tfor (var row=0; row<rows; row++) {\n\t\tsteps[row] = [];\n\t\tpositions[row] = [];\n\t\tblurs[row] = [];\n\t\tsizes[row] = [];\n\t\tfor (var col=0; col<cols; col++) {\n\t\t\tx = parseInt(cipherblock[row][col].style.left);\n\t\t\ty = parseInt(cipherblock[row][col].style.top);\n\t\t\tif (centerx-x == 0) slope = 1;\n\t\t\telse slope = (centery-y)/(centerx-x);\n\t\t\tdx = 0;\n\t\t\tdy = 0;\n\t\t\twhile (Math.abs(dx+dy) < 1) {\n\t\t\t\tdx = parseInt(Math.random()*9)-4;\n\t\t\t\tdy = parseInt(Math.random()*9)-4;\n\t\t\t}\n\t\t\tsteps[row][col] = [dy, dx];\n\t\t\tpositions[row][col] = [y, x];\n\t\t\tblurs[row][col] = 0;\n//\t\t\tsizes[row][col] = 1+parseInt(Math.random()*7);\n\t\t\t\n\t\t\tcipherblock[row][col].style.color = \"transparent\";\n\t\t\tcipherblock[row][col].style.textShadow = \"0 0 0px black\";\n\t\t}\n\t}\n\tconsole.log(\"got here\");\n\tvar id = setInterval(frame, ms);\n\tvar count = 0;\n\tvar opacity; var blur;\n\tvar factor1 = 0.25;\n\tvar factor2 = 1.11;\n\tvar color = 0;\n\tfunction frame() {\n\t\tfor (var row=0; row<rows; row++) {\n\t\t\tfor (var col=0; col<cols; col++) {\n\t\t\t\tvar y = positions[row][col][0];\n\t\t\t\tvar x = positions[row][col][1];\n\t\t\t\tdy = steps[row][col][0]*factor1;\n\t\t\t\tdx = steps[row][col][1]*factor1;\n\t\t\t\ty += dy;\n\t\t\t\tx += dx;\n\t\t\t\t\n//\t\t\t\tblurs[row][col] = Math.min(30, blurs[row][col]+Math.random()/2);\n\t\t\t\tblurs[row][col] = Math.min(50, blurs[row][col]+0.75);\n\t\t\t\t//sizes[row][col]+=Math.random()*4;\n\t\t\t\t\n//\t\t\t\tconsole.log(y+\",\"+x+\",\"+row+\",\"+col+\",\"+steps[row][col]+\",\"+factor1+\",\"+factor2);\n\t\t\t\tcipherblock[row][col].style.top = y + \"px\";\n\t\t\t\tcipherblock[row][col].style.left = x + \"px\";\n\t\t\t\tpositions[row][col] = [y, x];\n\t\t\t\tcipherblock[row][col].style.textShadow = \"0 0 \"+blurs[row][col]+\"px rgb(\"+color+\",\"+color+\",\"+color+\")\";\n//\t\t\t\tcipherblock[row][col].style.fontSize = (parseInt(cipherblock[row][col].style.fontSize) + sizes[row][col])+\"px\";\n\t\t\t}\n\t\t}\n\t\tif (factor1 >= 1.0) {\n\t\t\tfactor1 = 1.0;\n\t\t} else {\n\t\t\tfactor1 *= factor2;\n\t\t}\n\t\tcolor+=1.25;\n\t}\n}", "randomize() {\n for (var column = 0; column < this.numberOfColumns; column ++) {\n for (var row = 0; row < this.numberOfRows; row++) {\n var value = floor(random(2));\n this.cells[column][row].setIsAlive(value);\n }\n }\n }", "function fadeLetters() {\n\tvar $letters_length = $('#letters span').length + 1;\n\tvar $random = Math.floor(Math.random() * $letters_length);\n\t$('#letters span:nth-child(' + $random + ')').css({'display': 'none', 'visibility': 'visible'}).fadeTo('slow', 100, function(){$(this).contents().unwrap();});\n\t$letters_timer = setTimeout('fadeLetters()', 55);\n}", "fireFade() {\n Meteor.setTimeout(() => {\n Meteor.setTimeout(() => {\n $(\".fade-first\").addClass(\"fire\")\n Meteor.setTimeout(() => {\n $(\".fade-second\").addClass(\"fire\")\n })\n })\n })\n }", "function randomBackground () {\n let arr = Array.from(document.querySelectorAll('td'))\n let redBack = []\n console.log(redBack)\n for(let i = 0; i < arr.length; i++){\n console.log(i)\n function getRandom(){\n return Math.random();\n }\n if(getRandom() >= 0.5){\n document.querySelectorAll('td')[i].classList.add('red')\n redBack.push(i)\n\n }else if(getRandom() <= 0.5){\n 0\n }\n }\n let summ = document.createElement('div');\n document.body.append(summ)\n summ.innerHTML = `процент закрашеных: ${(redBack.length * 100) / arr.length}%`\n // alert(`процент закрашеных: ${(redBack.length * 100) / arr.length}%`)\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 myBoton2() {\n var fila = document.getElementById(\"fila2\");\n var cubo = fila.getElementsByTagName(\"td\");\n for(var i = 0; i < cubo.length; i++ ){\n for(var j = 0; j < cubo.length; j++ ){\n if(i != j){\n if(cubo[i].style.backgroundColor == \"\" ){\n var cambio = Math.floor(Math.random() * (color.length));\n cubo[i].style.backgroundColor = color[cambio];\n }\n if(cubo[j].style.backgroundColor == \"\" ){\n var cambio = Math.floor(Math.random() * (color.length));\n cubo[j].style.backgroundColor = color[cambio];\n }\n while(cubo[i].style.backgroundColor == cubo[j].style.backgroundColor){\n var cambio = Math.floor(Math.random() * (color.length));\n cubo[j].style.backgroundColor = color[cambio];\n } \n }\n }\n }\n}", "function flash() {\n for (var i = 0; i < 81; i++) {\n let red = (Math.floor(Math.random() * 256)).toString();\n let green = (Math.floor(Math.random() * 256)).toString();\n let blue = (Math.floor(Math.random() * 256)).toString();\n body.children[i].style.backgroundColor = \"rgb(\" + red + \", \" + green + \", \" + blue + \")\"\n }\n}", "function runIt() {\n\n var startPos = Math.floor(Math.random() * 50) + '%' // random start position 0 - 50%\n var endPos = Math.floor(Math.random() * 50) + '%' // random end position 0 - 50%\n var width = Math.floor(Math.random() * (150-20) + 20) + 'px' // random width 20 - 150px\n var duration = Math.floor(Math.random() * (7000 - 2000) + 2000) // random duration 2000 - 7000ms\n\n // $(this).css('transform','translate('+startPos+')');\n // $(this).css('transform','translate('+endPos+')');\n \n $(this).stop(true).animate({\n opacity: 1,\n left: startPos,\n width: width\n }, duration, function() {\n $(this).animate({\n opacity: 0,\n left: endPos,\n width: width\n }, duration, runIt); // callback to loop animation\n });\n\n }", "function alternateColors(){\n effectInterval = setInterval(function(){\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n var color =\"rgba(\" + red + \", \" + green + \", \" + blue + \", 100)\";\n drawScreen(color);\n }, 1500);\n}", "function revealcells(focalpoint)\n{\n\tvar originalFocalPoint = focalpoint;\n\tvar revealnumber = Math.floor(Math.random() * 10) + 1;\n\tvar cells = Array.from(document.getElementsByClassName(\"cell\"));\n\tvar directions = [\"northwest\",\"north\",\"northeast\",\"east\",\"southeast\",\"south\",\"southwest\",\"west\"];\n\tvar direction = directions[Math.floor(Math.random() * 8)];\n\n\t\n\t\tvar numberofcells = 10;\n\t\n\t\n\t\tvar firstcloumn = [0,10,20,30,40,50,60,70,80,90];\n\t\tvar lastcolumn = [9,19,29,39,49,59,69,79,89,99];\n\n\t\n\n\tfor(var x = 1; x < revealnumber; x++)\n\t{\n\t\ttry\n\t\t{\n\t\t\t\tif($(cells[focalpoint]).attr(\"class\") !== \"cell mine\" && $(cells[focalpoint]).css(\"background-color\") !== \"yellow\")\n\t\t\t{\n\t\t\t\tif(direction === \"northwest\" && !firstcloumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint -= numberofcells -1;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"north\")\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint -= numberofcells;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"northeast\" && !lastcolumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint -= numberofcells + 1;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"east\" && !lastcolumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint += 1;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"southeast\" && !lastcolumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint += numberofcells + 1;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"south\")\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint += numberofcells;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"southwest\" && !firstcloumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint += numberofcells - 1;\n\t\t\t\t}\n\t\t\t\telse if (direction === \"west\" && !firstcloumn.includes(focalpoint))\n\t\t\t\t{\n\t\t\t\t\tvar minenumber = $(cells[focalpoint]).val();\n\t\t\t\t\t$(cells[focalpoint]).css(\"box-shadow\",\"none\");\n\t\t\t\t\t$(cells[focalpoint]).css(\"background-color\",\"white\");\n\t\t\t\t\t$(cells[focalpoint]).html(`<p>${minenumber}</p>`);\n\t\t\t\t\tfocalpoint -= 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdirection = directions[Math.floor(Math.random() * 8)];\n\t\t\t\t\tfocalpoint = originalFocalPoint;\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = directions[Math.floor(Math.random() * 8)];\n\t\t\t\tfocalpoint = originalFocalPoint;\n\t\t\t}\n\t\t}\n\t\tcatch\n\t\t{\n\t\t\tdirection = directions[Math.floor(Math.random() * 8)];\n\t\t\tfocalpoint = originalFocalPoint;\n\t\t}\n\t\t\n\t}\n}", "function elem (n, color) {\n\tfor (var i = 1; i <= n; i++) {\n\t\tsetCell(getRandomInt(1, cell-2), getRandomInt(1, cell-2), color);\t\n\t}\n}", "function fadeOut()\n{\n TweenMax.to(title, { duration: 2, opacity: 0}); \n TweenMax.to(bar, { duration: 2, opacity: 0});\n \n for(let i = 0; i < cols.length; i++)\n {\n TweenLite.to(cols[i], { duration: 5, opacity: 0}); \n }\n\n}", "function randomizeTable() {\n\tif (lockBoard) {\n\t\treturn;\n\t}\n\tresetGrids();\n\tfor (var i = 0; i < rows; i++) {\n\t\tfor (var j = 0; j < cols; j++) {\n\t\t\tgrid[i][j] = Math.floor(Math.random() * 2);\n\t\t\tif (grid[i][j] == 1) {\n\t\t\t\tvar cell = document.getElementById(i + \"_\" + j).setAttribute(\"class\", \"live\");\n\t\t\t}\n\t\t}\n\t}\n}", "function fadeInWithBlur(ms, startBlur) {\n\t// array of random steps\n\tsteps = [];\n\tvar rows = cipherblock.length;\n\tvar cols = cipherblock[0].length;\n\tfor (var row=0; row<rows; row++) {\n\t\tsteps[row] = [];\n\t\tfor (var col=0; col<cols; col++) {\n\t\t\tsteps[row][col] = Math.max(Math.random()/30, 0.01);\n\t\t\tcipherblock[row][col].style.opacity = 0;\n\t\t\tif (row<50){\n\t\t\t\tcipherblock[row][col].style.color = \"transparent\";\n\t\t\t\tcipherblock[row][col].style.textShadow = \"0 0 \" + startBlur + \"px black\";\n\t\t\t}\n\t\t}\n\t}\n\tvar total = cipherblock.length * cipherblock[0].length;\n\tvar completed = 0;\n\tconsole.log(\"got here\");\n\tvar id = setInterval(frame, ms);\n\tvar count = 0;\n\tvar opacity; var blur;\n\tfunction frame() {\n\t\tfor (var row=0; row<rows; row++) {\n\t\t\tfor (var col=0; col<cols; col++) {\n\t\t\t\tconsole.log(row+\",\"+col);\n\t\t\t\topacity = parseFloat(cipherblock[row][col].style.opacity);\n\t\t\t\tif (opacity >= 1) continue; // already finished this one\n\t\t\t\topacity += steps[row][col];\n\t\t\t\tif (opacity >= 1) {\n\t\t\t\t\topacity = 1;\n\t\t\t\t\tcompleted++;\n\t\t\t\t}\n\t\t\t\tcipherblock[row][col].style.opacity = opacity;\n\t\t\t\t// blur radius is in range [0,startBlur]\n\t\t\t\tif (row<50){\n\t\t\t\t\tcipherblock[row][col].style.textShadow = \"0 0 \" + (startBlur-opacity*startBlur) + \"px black\";\n//\t\t\t\t\tconsole.log(row+\",\"+col+\",\"+cipherblock[row][col].style.textShadow);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (completed == total) {\n\t\t\tclearInterval(id);\n\t\t\tdocument.getElementById(\"b2\").innerHTML = \"Done\";\n\t\t}\n\t}\n}", "function showMole() {\r\n var x = Math.floor((Math.random() * 12) + 0)\r\n tableElements[x].className = \"moleOn\"\r\n}", "function ChangeBGRow(index)\n{\n setTimeout(function() {\n $(\"tbody tr:nth-child(\" + index + \")\").effect(\"highlight\", {}, 2000);\n }, 500);\n}", "function getHex() {\n let hexCol=\"#\";\n for (let i=0; i<6;i++){\n let random=Math.floor(Math.random()*hexNumbers.length);\n hexCol +=hexNumbers[random];\n }\n bodyBcg.style.backgroundColor= hexCol;\n hex.innerHTML=hexCol;\n}", "function startBoard(){\n\tvar baseRandom = Math.floor((Math.random() * (boardHeight * 4)) + 1);\n\tfor (i = 0; i <baseRandom; i++){\n\t\tvar choiceRandom1 = Math.floor((Math.random() * ((boardHeight*boardHeight) - 1)) + 1);\n\t\tvar holdcell = ($('#row' + choiceRandom1));\n\t\tholdcell.addClass(\"alive\");\n\t}\n\n}", "function showTable(){\n $(\"table\").fadeIn(5000);\n}", "function draw() {\n\tif (rowRemoved && soundIsOn) {\n\t\trowPopAudio.play()\n\t\trowRemoved = false\n\t}\n\tfor (let y = 0; y < playField.length; y++) {\n\t\tfor (let x = 0; x < playField[y].length; x++) {\n\t\t\tif (playField[y][x] === 1) {\n\t\t\t\tmainCellArr[y][x].style.opacity = '1'\n\t\t\t} else if (playField[y][x] === 2) {\n\t\t\t\tmainCellArr[y][x].style.opacity = '1'\n\t\t\t} else {\n\t\t\t\tmainCellArr[y][x].style.opacity = '0.25'\n\t\t\t}\n\t\t}\n\t}\n}", "function init()\n{\n for (var y = 0; y < dimen; y++) {\n for (var x = 0; x < dimen; x++) {\n setAlive( cells, x, y, Math.random() < 0.3 );\n }\n }\n}", "function addRedorYellow() {\n\t\tvar $dropCell = $(this);\n\t\tvar $boxes = $('td');\n\t\tvar $colHead = $('th');\n\t\tvar index = $dropCell[0].cellIndex;\n\t\tvar $box1 = $($boxes[index+20]);\n\t\tvar $box2 = $($boxes[index+15]);\n\t\tvar $box3 = $($boxes[index+10]);\n\t\tvar $box4 = $($boxes[index+5]);\n\t\tvar $box5 = $($boxes[index+0]);\n\n\t\tif ($box1.hasClass(\"\")) {\n\t\t\tsetBoxRedOrYellow($box1);\n\t\t\taudio.play();\n\t\t\t} else if ($box2.hasClass(\"\")) {\n\t\t\t\taudio.play();\n\t\t\t\tsetBoxRedOrYellow($box2)\n\t\t\t} else if ($box3.hasClass(\"\")) {\n\t\t\t\taudio.play();\n\t\t\t\tsetBoxRedOrYellow($box3)\n\t\t\t} else if ($box4.hasClass(\"\")) {\n\t\t\t\taudio.play();\n\t\t\t\tsetBoxRedOrYellow($box4)\n\t\t\t} else if ($box5.hasClass(\"\")) {\n\t\t\t\taudio.play();\n\t\t\t\tsetBoxRedOrYellow($box5)\n\t\t\t}\n\t\t}", "function animatePeopleColor() {\n for (var i = 0; i < elementsToColor.length; i++) {\n var animDelay = delayNumber * i;\n TweenMax.to(elementsToColor[i], 0.75, { fill: \"#F4777C\", ease: Back.easeOut.config(1.7), delay: animDelay, onComplete: countdown_forPeopleFinished });\n }\n }", "function nextSequence() {\n $('h1').text('Level ' + level);\n var randomNumberRange = Math.random() * 4;\n var randomNumber = Math.floor(randomNumberRange);\n var randomChosenColor = buttonColours[randomNumber];\n gamePattern.push(randomChosenColor);\n $('#' + randomChosenColor) //animation\n .fadeOut(100)\n .fadeIn(100)\n .fadeOut(100)\n .fadeIn(100);\n playSound(randomChosenColor);\n i++;\n level++;\n}", "function randomBg(){\n\t\tsetInterval(function(){\n\t\t\tvar rand = Math.round(100 + Math.random() * (999 - 100));\n\t\t\tvar hex = rand.toString(16);\n\t\t\t$(\"body\").css(\"background-color\", \"#\" + hex);\n\t\t}, 5000);\n\t}", "randomize() {\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n this.cells[this.currentBufferIndex][h][w] = Math.random() * MODULO | 0;\n }\n }\n }", "function opacityRest(){\n for (let i = 1; i < (gridSize + 1); i++) { \n const gridNum = document.querySelector(`#grid${i}`);\n gridNum.style.opacity = 1;\n }\n}", "function randomGhost() {\n $('#ghost').css(\"left\",(Math.floor(Math.random() * 15+1))*64);\n $('#ghost').css(\"top\",(Math.floor(Math.random() * 7+1))*64);\n $('#ghost').toggleClass('hidden');\n}", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "function animBgdFadeAuto($element, $colors) {\n var count = 0;\n\n setInterval(function() {\n if (count == 0) {\n $element.css({\n 'background-color': $colors[count],\n 'transition': '2s'\n });\n count++;\n } else if (count == 1) {\n $element.css({\n 'background-color': $colors[count],\n 'transition': '2s'\n });\n count++\n } else if (count == 2) {\n $element.css({\n 'background-color': $colors[count],\n 'transition': '2s'\n });\n count = 0;\n }\n }, 5000);\n}", "function randomColor() {\n var randomNumber = Math.floor(Math.random() * 9);\n //IF NUMBER <= 2 IT WILL REFER TO RED SQUARE\n if (randomNumber <= 2) {\n computerSequence.push('#red');\n // animate($('#red'));\n // IF NUMBER <= 4 IT WILL REFER TO GREEN SQUARE\n }else if (randomNumber <= 4) {\n computerSequence.push('#green');\n // animate($('#green'));\n // IF NUMBER <= 6 IT WILL REFER TO BLUE SQUARE\n }else if (randomNumber <= 6) {\n computerSequence.push('#blue');\n // animate($('#blue'));\n // IF NUMBER <= 8 IT WILL REFER TO YELLOW SQUARE\n }else {\n computerSequence.push('#yellow');\n // animate($('#yellow'));\n }\n }", "function gameBoardIn() {\n setTimeout(function() {\n $('.board').fadeIn(1500, 'swing');\n }, 300);\n}", "function revealCell(i, j) {\n let elCover = document.querySelector(`.cell-${i}-${j} .cover`);\n elCover.style.display = 'none';\n let elSurface = document.querySelector(`.cell-${i}-${j} .surface`);\n elSurface.style.display = 'flex';\n}", "function randomColorMode(){\n $('.square').hover(function(){\n var r = Math.floor(Math.random()*256);\n var g = Math.floor(Math.random()*256);\n var b = Math.floor(Math.random()*256);\n var opa = Math.random();\n $(this).css(\"background-color\", \"rgb(\" + r +\",\" + g + \",\" + b +\")\");\n $(this).css(\"opacity\", opa+.2);\n });\n}", "function raffleAnimation() {\n var seats = $('.material-icons');\n seats.removeClass('selected');\n pos = Math.floor(Math.random()*seats.length);\n seats[pos].classList.add('selected');\n}", "function appear() {\n setTimeout(function() {\n if (Math.random() > 0.5) {\n box.style.borderRadius = \"100px\";\n } else {\n box.style.borderRadius = 0;\n }\n box.style.display = \"block\";\n var left = Math.random()*500+\"px\";\n box.style.left = left;\n changeBoxColor();\n createdTime = Date.now(); \n }, time);\n }", "function fade(opacity) {\n return function(g, i) {\n\n console.log(\"Test\");\n\n svg.selectAll(\".chord path\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"fill\", \"#FF0000\");\n };\n}", "function refresh(evt) {\n\t$(\".notShowed\").attr(\"class\",\"currentlyShowed\");\n\t$(\".showed\").attr(\"class\",\"notShowed\");\n\t$(\".currentlyShowed\").attr(\"class\",\"showed\");\n\t$(\".showed\").css(\"background-image\",\"url(../img/current.jpg\" + \"?\" + Math.random()+\")\");\n\t\n\tsetTimeout(refresh,TimeBtwTwoImg);\n\t\n\t$(\".showed\").css(\"opacity\",\"1.0\").css(\"display\",\"block\")\n\t$(\".notShowed\").fadeOut(\"FadingTimeImages\",function() {\n\t\t$(\".notShowed\").css(\"z-index\",\"-1\");\n\t\t$(\".showed\").css(\"z-index\",\"1\");\n\t});\n}", "function blinkAnimate(){\r\n\t\t\tif (gameState.currentState != states.gameover \r\n\t\t\t\t&& gameState.currentState != states.demo){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tel.style.opacity = Tween.easeInOutQuad(t,start,change,dur);\r\n\t\t\tt++;\r\n\t\t\t\r\n\t\t\tt = t % (dur*2);\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tblinkAnimate();\r\n\t\t\t},20)\r\n\t\t}", "function discoParty() {\n for (i = 0; i < 30; i++) {\n setTimeout(function() {\n var randIdx = Math.floor(Math.random() * tjColors.length);\n var randColor = tjColors[randIdx];\n tj.shine(randColor);\n }, i * 250);\n }\n}", "function timedReveal(){\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[0].style.opacity=\"1\"},6000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[1].style.opacity=\"1\"},11000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[2].style.opacity=\"1\"},12000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[3].style.opacity=\"1\"},18000);\r\n }", "function updateTiles() {\n forEachTile(function update(row, col) {\n setTimeout(function () {\n tileColor = jQuery.Color().hsla({\n hue: (tileColor.hue() + (Math.random() * tileMaxHueShift)) % 360,\n saturation: tileMinSaturation + (Math.random() * tileSaturationSpread),\n lightness: tileMinLightness + (Math.random() * tileLightnessSpread),\n alpha: tileOpacity\n });\n\n var currentColor = jQuery.Color($(\"#\" + row + \"-\" + col), \"backgroundColor\");\n\n // when to update the Tiles\n if (currentColor.lightness() < tileLightnessDeadZoneLowerBound() ||\n currentColor.lightness() > tileLightnessDeadZoneUpperBound() ||\n currentColor.lightness() == 1) {\n $(\"#\" + row + \"-\" + col).animate({\n backgroundColor: tileColor\n }, tileFadeDuration);\n }\n }, getTileDelayTime(row, col));\n });\n }", "function fadeHitBlocks(){\n for(var i = 0; i < numberOfDifferentNotes; i++){\n var hitBlock = \"hitBlock\" + i;\n if(document.getElementById(hitBlock).style.opacity > 0){\n document.getElementById(hitBlock).style.opacity = \" \" + (document.getElementById(hitBlock).style.opacity - .03);\n\n }\n }\n}", "function dotInterval() {\n const dotsArray = [\n \".dot-one\",\n \".dot-two\",\n \".dot-three\",\n \".dot-four\",\n \".dot-five\",\n ];\n let randomDot = Math.floor(Math.random() * dotsArray.length);\n changeDotOpacity(dotsArray[randomDot]);\n setTimeout(dotInterval, 1000);\n }", "function changeCellColour(){\n let cellID = this.id;\n console.log(cellID);\n this.style.backgroundColor = \"rgb(\"+Math.random()*255+\",\"+Math.random()*255+\",\"+Math.random()*255+\")\";\n}", "startFade(){\n this.last_update = Date.now();\n this.color = \"#f4d742\";\n this.fade_rate = .2; //fades 20% every 100 ms\n this.transparency = 1;\n }", "function Effect() {\n for (var i = 0; i < nrImg; i++) {\n Vect[i].style.opacity = \"0\"; //to add the fade effect\n Vect[i].style.visibility = \"hidden\";\n }\n Vect[nrShown].style.opacity = \"1\";\n Vect[nrShown].style.visibility = \"visible\";\n}", "function changeBackground(){\n const colourIndex= parseInt(Math.random()*colours.length)\n body.style.backgroundColor = colours[colourIndex];\n}", "function colourRandom(el){\n el.style.backgroundColor=generateRandomColour();\n}", "function mozaicHide(time){\n panel.each(function(index){\n var delayTime = Math.floor((Math.random() * basicAnimationTime) + 100);\n if (index < (panel.length-4)) {\n $(this).delay(delayTime).animate({backgroundColor: 'transparent'},function(){\n $(this).css('z-index', '0');\n });\n }\n });\n}", "function paintRandom(e) {\n e.target.style.backgroundColor = rgbRandom();\n}", "function crossfade() {\n\t\tif (cow.randomBiomesActive == false) {\n\t\t\tif (biome == cow.currentBiome && preventSecondFadeIn == false) {// If the biome is the same as when the bgSquare spawned..\n\t\t\t\tbgSquare.alpha = Math.sin(q);\t\t\t\t\t\t\t\t// calculate alpha with a sinewave\n\t\t\t\tq += (1/lifespan)/76;\t\t\t\t\t\t\t\t\t\t// increment. lifespan is tuned to be in minutes\n\t\t\t}\n\n\t\t\tif (biome != cow.currentBiome) {\t\t\t\t\t\t\t\t// If the biome has changed..\n\t\t\t\tbgSquare.alpha -= lifespan/20000;\t\t\t\t\t\t\t// Fade out\n\t\t\t\tpreventSecondFadeIn = true;\n\t\t\t}\n\t\t} else {\n\t\t\tbgSquare.alpha = Math.sin(q);\t\t\t\t\t\t\t\t// skip most of the logic for randomBiomes and just animate\n\t\t\tq += (1/lifespan)/76;\n\t\t}\n\n\t\tif (q > 3.2 || bgSquare.alpha <= 0.01) {\t\t\t\t\t\t// if gradient has faded out.. (3.14 is one sinwave cycle)\n\t\t\tbgSquare.destroy(true);\t\t\t\t\t\t\t\t\t\t// kill it\n\t\t} else { setTimeout(function() { window.requestAnimationFrame(crossfade); }, 250) } // Throttled to 4FPS\n\t}", "function changeRandomColor() {\n backColor = \"blue\";\n let divs = document.querySelectorAll(\"#grid div\");\n divs.forEach(div =>\n div.addEventListener(\"mouseover\", e => {\n let randomColor = Math.floor(Math.random() * 16777215).toString(16);\n e.currentTarget.style.background = `#${randomColor}`;\n })\n );\n}", "function scrollFade() {\n\n\t$(window).scroll( function(){\n\n\t\t$('.content-row').each( function(i){\n\t \n\t bottom = $(this).position().top;\n\t win = $(window).scrollTop() + $(window).height();\n\t \n\t // If the object is visible in the window, fade it it\n\t if ( win > bottom ) {\n\n\t $(this).find('> div').animate({'opacity':'1'},1000);\n\t $(this).find('.clock-arm').addClass('animate');\n\t }\n\t \n\t }); \n\n\t});\n\n}", "function showColor(target,index,arr){ \n\tsetTimeout(function(){\n\t\t$('.' + target).css('opacity', '0.5');\n\t\t// beep function\n\t\tbeep.play();\n\t\tsetTimeout(function(){\n\t\t\t$('.' + target).css('opacity','1');\n\t\t\tif (index === arr.length){\n\t\t\t\tcolorTiles.forEach(function(tile,index){ //turn click function on add beep and display and hide tiles.\n\t\t\t\t\ttile.click(function(){\t\t\t//delay on click as well in order to display and hide pieces.\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\ttile.css('opacity','0.5');\n\t\t\t\t\t\t\tbeep.play();\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\ttile.css('opacity','1');\n\t\t\t\t\t\t},100)\n\t\t\t\t\t\t},100);\n\t\t\t\t\t\tcompare(colorArray[index]); //each click calls compare function. Adds string of \n\t\t\t\t\t\t\t\t\t\t//color value that corresponds to piece that was clicked\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t}, 1000)\n\t},index * 1500);\n}", "function fadeIn(element) {\n var op = 0.1; // initial opacity\n var timer = setInterval(function () {\n if (op >= 1){\n clearInterval(timer);\n }\n element.style.opacity = op; // image\n document.body.style.backgroundColor.opacity = op; // background\n op += 0.05;\n }, 50);\n}", "function fadeIn(listItem) {\n listItem.style.opacity = 0;\n // listItem.style.backgroundColor = '#99C262';\n\n\n var tick = function() {\n listItem.style.opacity = +listItem.style.opacity + 0.05;\n\n if (+listItem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16)\n }\n\n };\n\n tick();\n listItem.style.backgroundColor = 'hsl(75, 100%, 1%)';\n var d = 1;\n for (var i = 75; i <= 100; i = i + 0.05) { //i represents the lightness\n d += 4.75;\n (function(ii, dd) {\n setTimeout(function() {\n listItem.style.backgroundColor = 'hsl(220, 100%, ' + ii + '%)';\n }, dd);\n })(i, d);\n }\n }", "function blink(){\n // Setup of a random selektor\n let startID = Math.floor((Math.random() * 100) + 1);\n // Selekting random star\n let selection = document.querySelector( \"#\" + setStargazer[\"generateItemClass\"] + \"-\"+ startID);\n // Adding blink-classs to selektion\n selection.classList.add(setStargazer[\"setMorphClass\"]);\n setTimeout(function(){ \n // Removing Blink-class after timeout\n selection.classList.remove(setStargazer[\"setMorphClass\"]);\n }, setStargazer[\"setMorphSpeed\"]/2);\n }", "function fade(opacity) {\n return function(g, i) {\n svg.selectAll(\".chord path\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"opacity\", opacity);\n };\n }", "function fade(opacity) {\n return function(g, i) {\n svg.selectAll(\".chord path\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"opacity\", opacity);\n };\n }", "function randomGrid(v) {\n const content = document.createElement(\"div\");\n content.classList.add(\"box\");\n container.appendChild(content);\n for(var i = 0; i < v; i++){ \n var row = document.createElement(\"div\"); \n row.className = \"row\"; \n for(var j = 1; j <=v; j++){ \n var cell = document.createElement(\"div\"); \n cell.className = \"gridsquare\"; \n cell.addEventListener(\"mouseover\", changeColor);\n function changeColor(e) {\n const thisCell = e.target;\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n thisCell.style.backgroundColor = color;\n thisCell.style.borderColor = color;\n }\n row.appendChild(cell); \n }\n content.appendChild(row); \n }\n}", "function animateLogo() {\n let random;\n random = Math.floor((Math.random() * 3)+ 1);\n $('#wave').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#erase').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#blur').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n }, 40);}, 40);\n}", "function randomBackgrounds(){\n //Goes through each hex element using the ID stored in the array of objects and assign a random terrain tile to it\n for(var i = 0; i < hexs.length; i++){\n document.getElementById(hexs[i].hex).src = ('Assets/Tiles/Empty/' + findTile() + '.png');\n }\n }", "CrossFade() {}", "function reveal(_index) \n{\n if (!$cell[_index].classList.contains('cell-bomb')) \n {\n $cell[_index].classList.add('secure');\n _index = parseInt($cell[_index].getAttribute('data-index')) - 1;\n if (!$cell[_index + 1].classList.contains('cell-bomb')) {\n $cell[_index + 1].classList.add('secure');\n if (bombArounds[_index + 1] > 0) $cell[_index + 1].innerHTML = bombArounds[_index + 1];\n }\n if (!$cell[_index - 1].classList.contains('cell-bomb')) {\n $cell[_index - 1].classList.add('secure');\n if (bombArounds[_index - 1] > 0) $cell[_index - 1].innerHTML = bombArounds[_index - 1];\n }\n if (!$cell[(_index - cols)].classList.contains('cell-bomb')) {\n $cell[_index - cols].classList.add('secure');\n if (bombArounds[_index - cols] > 0) $cell[_index - cols].innerHTML = bombArounds[_index - cols];\n\n }\n if (!$cell[(_index - cols) + 1].classList.contains('cell-bomb')) {\n $cell[(_index - cols) + 1].classList.add('secure');\n if (bombArounds[(_index - cols) + 1] > 0) $cell[(_index - cols) + 1].innerHTML = bombArounds[_index - cols + 1];\n\n }\n if (!$cell[(_index - cols) - 1].classList.contains('cell-bomb')) {\n $cell[(_index - cols) - 1].classList.add('secure');\n if (bombArounds[(_index - cols) - 1] > 0) $cell[(_index - cols) - 1].innerHTML = bombArounds[_index - cols + 1];\n }\n if (!$cell[(_index + cols)].classList.contains('cell-bomb')) {\n $cell[(_index + cols)].classList.add('secure');\n if (bombArounds[(_index + cols)] > 0) $cell[(_index + cols)].innerHTML = bombArounds[_index + cols];\n\n }\n if (!$cell[(_index + cols) + 1].classList.contains('cell-bomb')) {\n $cell[(_index + cols) + 1].classList.add('secure');\n if (bombArounds[(_index + cols) + 1] > 0) $cell[(_index + cols) + 1].innerHTML = bombArounds[_index + cols + 1];\n }\n if (!$cell[(_index + cols) - 1].classList.contains('cell-bomb')) {\n $cell[(_index + cols) - 1].classList.add('secure');\n if (bombArounds[(_index + cols) - 1] > 0) $cell[(_index + cols) - 1].innerHTML = bombArounds[_index + cols - 1];\n }\n }\n}", "function updateSpan() {\n let randomNum = Math.random();\n if (randomNum < revealTime) {\n $(this).removeClass(\"redacted\");\n $(this).addClass(\"revealed\");\n }\n}", "function showTile(i, j, num) {\n // append the number to its corresponding position in the table in HTML\n var item = $(\"tr:eq(\" + i + \")\").children(\"td:eq(\" + j + \")\")\n .append(\"<p>\" + num + \"</p>\").children(\"p\");\n // set its properties\n item.css(\"background-color\", getBackgroundColorByNumber(num));\n item.css(\"color\", getWordColorByNumber(num));\n item.fadeIn(\"normal\");\n}", "function colorFieldes() {\n fields.map(field => {\n field.style.backgroundColor =\n colors[Math.floor(Math.random() * colors.length)];\n });\n}", "function randomFood() {\n var fRow = Math.floor(Math.random() * 19);\n var fCol = Math.floor(Math.random() * 19);\n var foodCell = $('#cell_'+fRow+'_'+fCol);\n if (!foodCell.hasClass('snake-cell')) {\n foodCell.addClass(\"food-cell\");\n food='_'+fRow+'_'+fCol;\n }\n else randomFood();\n }", "function myFun2(){\n var randcol2= \"\";\n for(var i=0; i<6; i++){\n randcol2 += allchar[Math.floor(Math.random()*16)];\n }\n \n document.getElementById('result').style.backgroundColor= \"#\"+randcol2;\n \n \n \n }", "function level1() {\n \tvar interval1 = setInterval(function() {\n \t\t$(square[getRandomIndex(square)]).children().attr('src', showRandomEmployee()).fadeIn(700, function(){\n \t\t\t$(this).fadeOut(700);\n \t\t});\n \t}, 1500);\n \t\n \tsetTimeout(function() {\n \t clearInterval(interval1);\t\n \t}, 15000);\n }", "function massFadeIn(){\n $(\"#question, #timer, #picture, #question, #answers, #gameMessage, #tryAgain\").fadeIn();\n}", "randomize() {\n // !!!! IMPLEMENT ME !!!!\n for (let height = 0; height < this.height; height++) {\n for (let width = 0; width < this.width; width++) {\n this.cells[this.currentBufferIndex][height][width] = (Math.random() * 2) | 0;\n }\n }\n }", "function resetOpacity() {\n for (let i = 0; i < dice.length; i++) {\n let element = document.getElementById(\"dice\" + i);\n dice[i].locked = false;\n element.style.opacity = \"1\";\n }\n}", "function fade(opacity) {\n return function(g, i) {\n svg.selectAll(\".chord path\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"opacity\", opacity);\n };\n }", "function fade(opacity, d, i) {\n\t\tsvg.selectAll('path.chord')\n\t\t\t\t.filter(d => d.source.index != i && d.target.index != i)\n\t\t\t\t.transition()\n\t\t\t\t.duration(70)\n\t\t\t\t.style('stroke-opacity', opacity)\n\t\t\t\t.style('fill-opacity', opacity)\n\t}", "function delayFigure() {\n\t\t\t\tsetTimeout(showFigure, Math.random() * 2000);\n\t\t\t\t\n\t\t\t}", "function randomizeGemColor(gem) {\n items++;\n $(\"#gems\").text(items);\n\n gem.frame = game.rnd.integerInRange(0, gem.animations.frameTotal - 1);\n\n}", "function fade(opacity) {\r\n\t return function(d,i) {\r\n\t \tsvg.selectAll(\".chord path\")\r\n\t \t\t.filter(function(d) { return d.source.index != i && d.target.index != i; })\r\n\t \t\t.transition()\r\n\t \t.style(\"opacity\", opacity);\r\n\t };\r\n\t}", "function drawRandom() {\n\t$('div.box').hover(function() {\n\t\t$(this).css('background', randomColor());\n\t});\n}", "function fadeIn(elem) {\n setTimeout(function () {\n var op = 0;\n var timer = setInterval(function () {\n if (op >= 1) {\n clearInterval(timer);\n } else {\n elem.style.opacity = op;\n elem.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op += 0.1;\n }\n }, 10);\n }, 200);\n }", "function nextSequence() {\n userClickedPattern = [];\n level += 1;\n $(\"#level-title\").text(\"Level \" + level);\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColour = buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n\n for (let i =0; i<gamePattern.length;i++ ){\n setTimeout(function(){\n $(\"#\" + gamePattern[i]).fadeToggle(200).fadeToggle(200);\n playSound(gamePattern[i]);\n },i*800)\n\n }\n\n\n\n\n\n}" ]
[ "0.6749497", "0.6607842", "0.6536754", "0.6503139", "0.63221365", "0.6300223", "0.62297064", "0.62213385", "0.6210899", "0.6200453", "0.6169167", "0.6161667", "0.6135734", "0.6128716", "0.6114257", "0.61134255", "0.61133355", "0.6091899", "0.608283", "0.60579175", "0.6050929", "0.6049232", "0.6041845", "0.6020114", "0.59794915", "0.59707505", "0.59706855", "0.59697163", "0.59647506", "0.5962398", "0.5960288", "0.5959528", "0.595827", "0.59170574", "0.59158033", "0.5907839", "0.5904759", "0.58975446", "0.586972", "0.5869089", "0.58536536", "0.5852693", "0.58517164", "0.58509755", "0.58508885", "0.58493173", "0.58493173", "0.5843915", "0.58405864", "0.58353233", "0.5833838", "0.5822784", "0.5820976", "0.58196735", "0.58139336", "0.5808161", "0.5801004", "0.57930756", "0.57841474", "0.5781606", "0.57704276", "0.57701814", "0.57629234", "0.5749339", "0.57335496", "0.5731865", "0.57315284", "0.57283586", "0.5723466", "0.57202035", "0.5720153", "0.57177734", "0.57167304", "0.57095754", "0.5704652", "0.5701911", "0.56919664", "0.56919664", "0.56879264", "0.56737804", "0.5666411", "0.5665869", "0.5665621", "0.5665488", "0.5665309", "0.5661534", "0.5655627", "0.56541425", "0.565095", "0.56426305", "0.5642027", "0.56373304", "0.56353194", "0.56319493", "0.56269747", "0.56255794", "0.56200814", "0.56187683", "0.56095004", "0.5605347" ]
0.7135088
0
Bind Events for ajax calls
function bindEvents(){ //Move to next page button click $('.btn_continue').bind('click', function(){ var nameVal = $(this).attr("name"); loadnextpage(nameVal); return false; }); $('.entertowin, #sorryRegister').bind('click', function(){ loadnextpage('register'); return false; }); //Select Partners on Partners page $('#selectSix').bind('click', function(){ partnersSelect(); return false; }); $('#double_down').bind('click', function(){ loadnextpage('doubledown'); return false; }); $('#keep_offer').bind('click', function(){ loadnextpage('register'); return false; }); $('.reset').bind('click', function(){ resetGame(); return false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindEvents(){\n //Shows spinner loader on AJAX calls\n $(document).on({\n ajaxStart: function(){\n $('#loader').removeClass('hidden');\n $('body').addClass('loading');\n },\n ajaxStop: function(){ \n $('#loader').addClass('hidden');\n $('body').removeClass('loading');\n } \n });\n //bind events to the edit button.\n $('.btn-edit').on('click',(e) => {\n var data = JSON.parse($(e.currentTarget).parent().find('.inp_data').val());\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemEditDialog(dialogOptions, data);\n dialog.open();\n });\n //bind events to the delete button.\n $('.btn-delete').on('click', (e) => {\n var data = JSON.parse($(e.currentTarget).parent().find('.inp_data').val());\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemDeleteDialog(dialogOptions, data);\n dialog.open();\n });\n //binds events to the add button\n $('#btn_add').on('click', (e) => {\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemAddDialog(dialogOptions);\n dialog.open();\n });\n }", "function hookAjaxEvents() {\n\n\t$(document).ajaxSend(function(event, request, settings) {\n\t\t$('#overlay').show();\n\t});\n\t$(document).ajaxComplete(function(event, request, settings) {\n\t\t$('#overlay').hide();\n\t});\n}", "function bindClassEvents() {\n var resHandlr = this.responseHandler;\n this.on('ajaxable:on-ajax-before', resHandlr.beforeSend.bind(resHandlr), this);\n this.on('ajaxable:on-ajax-success', resHandlr.onSuccess.bind(resHandlr), this);\n this.on('ajaxable:on-ajax-error', resHandlr.onError.bind(resHandlr), this);\n this.on('ajaxable:on-ajax-complete', resHandlr.onComplete.bind(resHandlr), this);\n this.on('ajaxable:on-ajax-abort', resHandlr.onAbort.bind(resHandlr), this);\n this.on('ajaxable:on-ajax-timeout', resHandlr.onTimeout.bind(resHandlr), this);\n}", "onAfterAjax() {\n }", "function IAjaxHttpHook() { }", "function enable() {\n $(document)\n .on('ajax:error', handleError)\n .on('ajax:success', handleSuccess);\n }", "function handleLoadEvent() {\n\t$.ajax({ \n\t url: \"../userCake/EventSettings.php\", \n\t type: \"POST\",\n\t datatype: \"json\",\n\t data: { \"action\": \"GET_OPTIONS\"},\n\t success: function(result) {\n\t \tloadOptionsList(result);\n\t }\n\t});\n\t$.ajax({ \n\t url: \"../userCake/EventSettings.php\", \n\t type: \"POST\",\n\t datatype: \"json\",\n\t data: { \"action\": \"GET_USERS\"},\n\t success: function(result) {\n\t \tloadUserList(result);\n\t }\n\t});\n}", "function bindElementEvents() {\n var _this2 = this;\n\n var ctx = this;\n var element = this.element; // Fire ajax after certain time\n\n var bindTimedAjax = function bindTimedAjax() {\n ctx.requestTimerId = setTimeout(function () {\n return _this2.startAjaxRequest();\n }, ctx.options.requestTimeout);\n }; // Fire ajax on particular interval\n\n\n var bindIntervalAjax = function bindIntervalAjax() {\n ctx.requestIntervalId = setInterval(function () {\n return _this2.startAjaxRequest();\n }, ctx.options.requestInterval);\n }; // Fire ajax on click\n\n\n var bindClickAjax = function bindClickAjax() {\n ctx.clickAjaxHandler = function (event) {\n event.preventDefault();\n ctx.startAjaxRequest();\n };\n\n element.addEventListener('click', ctx.clickAjaxHandler, false);\n }; // Fire ajax on hover\n\n\n var bindHoverAjax = function bindHoverAjax() {\n ctx.hoverAjaxHandler = function (event) {\n event.preventDefault();\n ctx.startAjaxRequest();\n };\n\n element.addEventListener('hover', ctx.hoverAjaxHandler, false);\n }; // Fire ajax on submit\n\n\n var bindSubmitAjax = function bindSubmitAjax() {\n ctx.submitAjaxHandler = function (event) {\n event.preventDefault();\n ctx.startAjaxRequest();\n };\n\n element.addEventListener('submit', ctx.submitAjaxHandler, false);\n };\n\n if (element.nodeName === 'FORM') {\n bindSubmitAjax();\n }\n\n switch (ctx.options.triggerType) {\n case 'timeout':\n bindTimedAjax();\n break;\n\n case 'interval':\n bindIntervalAjax();\n break;\n\n case 'click':\n bindClickAjax();\n break;\n\n case 'hover':\n bindHoverAjax();\n break;\n\n default:\n break;\n }\n}", "function bindEvents() {\n\t\t\teManager.on('showForm', function() {\n\t\t\t\tshowForm();\n\t\t\t});\n\t\t\teManager.on('csvParseError', function() {\n\t\t\t\tshowError();\n\t\t\t});\n\t\t}", "function triggerAjax(e){\n $(e).trigger('click');\n}", "function registerEvents() {\n $(\"#ddl_request\").on(\"change\", loadRequests);\n}", "function _setupAJAXHooks() {\n requests = [];\n\n if (typeof jQuery === 'undefined') {\n return;\n }\n\n jQuery(document).on('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).on('ajaxComplete', decrementAjaxPendingRequests);\n }", "function bindEvents(){\n\t\t\n\t\t$(document).on(\"click\",\".item_tag\",function(e){\n\t\t\n\t\t\tdisplayItems($(e.target));\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\taddItem($(e.target));\n\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".selected_item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tremoveItem($(e.target));\n\t\t\n\t\t});\n\t}", "function wirejQueryInterceptor() {\n $(document).ajaxStart(function () { processRequest(); });\n $(document).ajaxComplete(function () { processResponse(); });\n $(document).ajaxError(function () { processResponse(); });\n }", "function button_click_fn() {\n\t//call ajax\n\tajax_handler.request({\n url: '/query/end_point',\n async: false,\n method: 'GET',\n response_type: 'json',\n data: { id_value = document.getElementById('el_id').value },\n on_success: function (data) { \n\t\t/*Do things with data*/ \n\t },\n\t on_error: function (status, error_msg) {\n\t if(console) console.log('status:' + status + ' || error msg:' + error_msg);\n\t }\n \t});\n}", "function registerEvents() {\n $(\"#ddl_request\").on(\"change\", loadApprovals);\n}", "function bindEvents() {\n $(document).on('ready', onDocumentReady);\n }", "function ajaxBindCallback() {\n if (ajaxRequest.readyState == 4) {\n if (ajaxRequest.status == 200) {\n if (ajaxCallback) {\n ajaxCallback(ajaxRequest.responseText);\n } else {\n alert('no callback defined');\n }\n } else {\n alert(\"There was a problem retrieving the xml data:\\n\" + ajaxRequest.status + \":\\t\" + ajaxRequest.statusText + \"\\n\" + ajaxRequest.responseText);\n }\n }\n }", "function _bindEvents() {\r\n el.form.on('submit', _formHandler);\r\n el.email_input.on('focus', _resetErrors);\r\n }", "function ajax_Load() {\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">ajax_Load() event starting.</div>');\n \n if (helm.alreadyInitialized && helm.RefreshHelmDataAfterUpdatePanelPostBack) {\n helm.jQueryBindEvents();\n helm.Initialize(true); //true -> because this is after ajax request\n } else {\n //reset the refresh overrides\n helm.alreadyInitialized = true;\n helm.RefreshHelmDataAfterUpdatePanelPostBack = true;\n }\n \n }", "function _cjEventListener()\n{\n if (typeof(jQuery) !== 'undefined') {\n $.post('transferevents.php', {'action': 'listen_for_event'}, function (data) {_cjEventHandler(data)});\n } else if (typeof(Prototype) !== 'undefined') {\n new Ajax.Request('transferevents.php', {'method': 'post', 'parameters' : {'action': 'raise_event'},\n onSuccess: function (data) {_cjEventHandler(data.responseJSON);}\n });\n } else {\n alert('You need JQuery or Prototype to use this library!');\n }\n}", "function BindAjaxForm() {\n IObserver.call(this);\n}", "function ajaxForVehicles(){\n\t\tcreateDropDown(maxNumberOfVehicles, $dropDownVehicles);\n\t\thideTheRestDropDowns($dropDownVehicles);\n\t\t$spanInfo.text(\"Number of Vehicles\");\n\t\t$divContent.show();\n\t\t//initial value when link is clicked\n\t\tgenerateVehicles(initialNumberDisplayed);\n\t\t// get the ajax request\n\t\t$.get(\"http://swapi.co/api/vehicles/\", {\t\n\t\t}).done(function(data) {\n\t\t\t$dropDownVehicles.on( \"change\", function(){\n\t\t\t\tgenerateVehicles($(this).val());\n\t\t\t});\n\t\t\t$table.show();\t\n\t\t}).fail(function() {\n\t\t\talert('something went wrong in the ajaxForVehicles()! FIRST');\n\t\t});\n\t\t//end of ajax request\n\t}", "bindEvents() {\n }", "@autobind\n initEvents() {\n $(document).on('intro', this.triggerIntro);\n $(document).on('instructions', this.triggerInstructions);\n $(document).on('question', this.triggerQuestion);\n $(document).on('submit_query', this.triggerSubmitQuery);\n $(document).on('query_complete', this.triggerQueryComplete);\n $(document).on('bummer', this.triggerBummer);\n }", "function ajaxBindCallback(){\n\t\tif(ajaxRequest.readyState == 0) { window.status = \"Waiting...\"; }\n\t\tif(ajaxRequest.readyState == 1) { window.status = \"Loading Page...\"; }\n\t\tif(ajaxRequest.readyState == 2) { window.status = \"Data Received...\";}\n\t\tif(ajaxRequest.readyState == 3) { window.status = \"Interactive...\"; }\n\t\tif(ajaxRequest.readyState == 4) {\n\t\t\twindow.status = \"Transaction Complete...\";\n\n // STOP TIMER AND FIND DIFFERENCE\n // MUST CREATE NEW TIMER INSTANCE :)\n var timer2 = new Date();\n var t_end = timer2.getTime();\n var t_diff = t_end - t_start;\n\n // TEST HTTP STATUS CODE - DISPLAY IN DUBUGGER AND STATUS\n switch (ajaxRequest.status.toString()) {\n case \"200\" :\n window.status = \"Page Loaded Sucessfully\";\n document.getElementById(pageElement).innerHTML = ajaxRequest.responseText;\n debugEvent(url, \"got\", ajaxRequest.responseText, t_diff);\n break;\n case \"403\" :\n window.status = \"Forbidden...\";\n debugEvent(url, \"error_403\", ajaxRequest.responseText, t_diff);\n break;\n case \"404\" :\n window.status = \"File Not Found...\";\n debugEvent(url, \"error_404\", ajaxRequest.responseText, t_diff);\n break;\n case \"500\" :\n window.status = \"File Not Found...\";\n debugEvent(url, \"error_500\", ajaxRequest.responseText, t_diff);\n break;\n default :\n window.status = \"Unknown Ajax Error...\"+ajaxRequest.status.toString();\n }\n\t\t\t}\n\t}", "function ajaxBindCallback(){\n\t\tif(ajaxRequest.readyState == 0) { window.status = \"Waiting...\"; }\n\t\tif(ajaxRequest.readyState == 1) { window.status = \"Loading Page...\"; }\n\t\tif(ajaxRequest.readyState == 2) { window.status = \"Data Received...\";}\n\t\tif(ajaxRequest.readyState == 3) { window.status = \"Interactive...\"; }\n\t\tif(ajaxRequest.readyState == 4) {\n\t\t\twindow.status = \"Transaction Complete...\";\n\n // STOP TIMER AND FIND DIFFERENCE\n // MUST CREATE NEW TIMER INSTANCE :)\n var timer2 = new Date();\n var t_end = timer2.getTime();\n var t_diff = t_end - t_start;\n\n // TEST HTTP STATUS CODE - DISPLAY IN DUBUGGER AND STATUS\n switch (ajaxRequest.status.toString()) {\n case \"200\" :\n debugEvent(url, \"got\", ajaxRequest.responseText, t_diff);\n break;\n case \"403\" :\n debugEvent(url, \"error_403\", ajaxRequest.responseText, t_diff);\n break;\n case \"404\" :\n debugEvent(url, \"error_404\", ajaxRequest.responseText, t_diff);\n break;\n case \"500\" :\n debugEvent(url, \"error_500\", ajaxRequest.responseText, t_diff);\n break;\n }\n\t\t\t}\n\t}", "function HtmlData() {\n var uri = '/ajax/Data'\n\n //var xmlHttp = new XMLHttpRequest();\n //xmlHttp.addEventListener(\"click\", callbackFunction);\n //xmlHttp.open('GET', uri);\n //xmlHttp.send();\n\n $.ajax({\n url: uri,\n type: 'GET',\n success: function (response) {\n $('#content').html(response);\n },\n error: function (jqXHR) {\n $('#content').append(jqXHR.status + \" \" + jqXHR.statusText);\n }\n });\n}", "function ajaxLinks(){\n $('.ajaxForm').submitWithAjax();\n $('a.get').getWithAjax();\n $('a.post').postWithAjax();\n $('a.put').putWithAjax();\n $('a.delete').deleteWithAjax();\n}", "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "perform() {\r\n $.ajax(this.REQUEST)\r\n }", "function _bindEvents() {\n _$sort.on(CFG.EVT.CLICK, _setSort);\n _$navbar.on(CFG.EVT.CLICK, _SEL_BUTTON, _triggerAction);\n _$search.on(CFG.EVT.INPUT, _updateSearch);\n _$clear.on(CFG.EVT.CLICK, _clearSearch);\n }", "function ajax_pagination(onclick_field, paginate_class, container, address, div_loader, div_on_click, input_class_name_for_selecting_all, input_class_name_for_selecting_each, delete_something ){\n\n\t\t$(onclick_field).on('click', paginate_class, function (e){\n\t\t\te.preventDefault(); \n\t\t\tvar page = $(this).attr('rel');\n\t\t\t//alert(page);\n\t\t\t$(container).load(address + page + div_loader, function(){\n\t\t\t\tajax_select_all_boxes(div_on_click, input_class_name_for_selecting_all, input_class_name_for_selecting_each);\n\t\t\t\tdelete_something_pagination(delete_something);\n\t\t\t});\t\t\n\t\t});\n\t}", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "initAJAX() {\n this.apiList.eventbrite = new Eventbrite(this.userPositionLat, this.userPositionLong, this.addLocationClickHandler);\n this.apiList.yelp = new Yelp(this.userPositionLat, this.userPositionLong, this.addLocationClickHandler);\n this.apiList.weather = new WeatherData(this.userPositionLat, this.userPositionLong);\n\n this.apiList.weather.getWeatherData();\n\n this.apiList.eventbrite.retrieveData().then(data => this.apiList.map.addEvents(data.events))\n .catch(data => console.log(data));\n\n this.apiList.yelp.retrieveData().then(data => {\n this.apiList.map.addBiz(data.businesses);\n this.loadScreenHandler();\n })\n .catch(data => console.log(data));\n }", "function ajaxAction(e, pathname) {\n if (e !== undefined) {\n var eventType = e.type;\n }\n var $this = $(this);\n if (!pathname) {\n var pathname = window.location.pathname,\n url = eventType == 'popstate' ? pathname : $this.attr('href'); //check browser button click\n } else {\n var url = pathname;\n //console.log(pathname);\n }\n\n var minDelay = 600; //время минимальной задержки\n var startTime = new Date();\n\n $.ajax({\n url: url,\n type: 'POST',\n beforeSend: function() {\n $ajaxContainer.empty();\n $ajaxContainer.append($loading); // бегунок загрузки\n }\n })\n .done(function(response) {\n\n if (url != window.location && e.type != 'popstate') {\n window.history.pushState({\n path: url\n }, '', url);\n }\n\n $('.active').removeClass('active');\n\n if ($this.parents('.header-links').length > 0) {\n //$('.header-links a').removeClass('active');\n $this.addClass('active');\n } else if ($this.parents('.side-menu').length > 0) {\n //$('.side-menu-block li').removeClass('active');\n $this.parent().addClass('active');\n }\n\n var endTime = new Date();\n var time = endTime - startTime;\n\n if (time < minDelay) {\n setTimeout(function() {\n ajaxRender(response, eventType);\n }, minDelay - time);\n } else {\n ajaxRender(response, eventType);\n }\n\n })\n .fail(function() {\n //console.log(\"error\");\n })\n .always(function() {\n //console.log(\"complete\");\n });\n\n return false;\n\n }", "function ajax2() {\n\n }", "function ajaxLoad(env) {\n\t\t// insert loader\n\t\tenv.$elts.carousel.prepend(env.$elts.loader);\n\t\t\n\t\t// ajax call\t\t\t\t\n\t\t$.ajax({\n\t\t\turl: env.params.ajaxUrl,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(data) {\n\t\t\t\t// set if the last item of the carousel have been loaded and add items to the carousel\n\t\t\t\tenv.lastItemsToLoad = data.bLastItemsToLoad;\n\t\t\t\t$(env.$elts.content).append(data.shtml);\n\t\t\t\t\n\t\t\t\t// reinit count (number of items have changed after ajax call)\n\t\t\t\tenv.steps = {\n\t\t\t\t\tfirst: env.steps.first + env.params.dispItems,\n\t\t\t\t\tcount: env.$elts.content.children().length\n\t\t\t\t};\n\t\t\t\tenv.steps.last = env.steps.count - 1;\n\t\t\t\t\n\t\t\t\t// rewrite carousel dimensions\n\t\t\t\tinitCarousel(env);\n\t\t\t\t// rewrite/append pagination\n\t\t\t\taddPage(env,env.steps.first);\n\t\t\t\t\n\t\t\t\t// slide to next page\n\t\t\t\tgoToStep( env, env.steps.first );\n\t\t\t\tif(env.params.stopSlideBtn == true){\n\t\t\t\t\tenv.$elts.stopSlideBtn.trigger('pause');\n\t\t\t\t} else {\n\t\t\t\t\tstopAutoSlide(env);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// remove loader\n\t\t\t\tenv.$elts.loader.remove();\n\t\t\t}\n\t\t});\t\t\n\t}", "function event_getActivePipes(){\n $.ajax({\n type: 'GET',\n url: '/activePipe',\n dataType: 'json',\n async: true,\n success: function(data){\n loadActivePipes(data);\n },\n error: function(msg){\n console.log('error getting Pipes requestedFile: pipes.json, script:home.js');\n }\n });\n}", "function ajax(e) {\n if (e) {\n e.preventDefault();\n }\n\n // gets the POST params\n var data = t.serialize();\n\n // adds the button field\n data += '&' + escape('action[subscribe]') + '=Send';\n\n // ajax request\n $.ajax({\n type: 'POST',\n url: opts.url,\n data: data,\n dataType: 'json',\n success: function (data) {\n if (!data.error && data['@attributes'] && data['@attributes'].result == 'success') {\n if (data['@attributes'].result) {\n\n if ($.isFunction(opts.complete)) {\n opts.complete.call(t, data);\n }\n }\n } else if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n } ,\n error: function (data) {\n if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n }\n });\n\n return false;\n }", "function initAjax() {\r\n\r\n var container = jQuery(\"#container\"),\r\n loader = jQuery(\"#loader\");\r\n\r\n jQuery.ajaxSetup({\r\n type: \"POST\",\r\n contentType: \"application/json; charset=utf-8\",\r\n dataType: \"json\"\r\n });\r\n\r\n jQuery(document).ajaxStart(function () {\r\n\r\n if (loader.length > 0) {\r\n\r\n loader.show();\r\n\r\n }\r\n\r\n }).ajaxStop(function () {\r\n\r\n if (loader.length > 0) {\r\n\r\n loader.hide();\r\n\r\n }\r\n });\r\n\r\n}", "function bindAddHandlers() {\n $(\".add-button\").bind(\"click\", function(event) {\n $(this).attr(\"disabled\", \"disabled\");\n $(this).closest('li').hide('blind', { direction: 'vertical' }, ANIMATION_TIMEOUT);\n var url = ('/playlists/edit/' + encodeURIComponent(playlistId) +\n '/add_playlist_entry?video_id=' + encodeURIComponent(event.target.id) +\n '&uuid=' + encodeURIComponent(uuid));\n $.ajax({ type: 'POST', url: url });\n });\n }", "function initAjaxLoadingListener() {\n // Ajax started\n $(document).ajaxStart(function () {\n // Show loading gif\n $.mobile.loading(\"show\", {\n text: \"loading...\",\n textVisible: false\n });\n\n // Put info about ajax starting into console.\n console.log(\"Ajax: START\");\n });\n\n // Ajax was successfull and completed.\n $(document).ajaxComplete(function () {\n // Hide the loading gif.\n $.mobile.loading(\"hide\");\n console.log(\"Ajax: Complete\");\n });\n\n // Something went wrong\n $(document).ajaxError(function (e, xhr, options, error) {\n // Show that an error occured to the user.\n $.mobile.loading(\"show\", {\n text: \"error...\",\n textVisible: true\n });\n\n // Print error message in console.\n console.log(\"\\n\\nAjax: Error BEGIN \\n>>>>>>>>>>>>>>>>>\\n\\n\" + error + \"\\n\");\n console.log(e);\n console.log(xhr);\n console.log(options);\n console.log(\"\\n\\n<<<<<<<<<<<<<<< \\nAjax: Error END\\n\\n\");\n\n // Wait 5seconds until the error message dissapears.\n window.setTimeout(function () {\n $.mobile.loading(\"hide\");\n }, 5000);\n\n });\n }", "function ajaxLoaded(data) {\r\n\t\tdebug('AjaxLoaded: '+this.url);\r\n\t\tmodal.tmp.html(currentSettings.selector\r\n\t\t\t?filterScripts($('<div>'+data+'</div>').find(currentSettings.selector).contents())\r\n\t\t\t:filterScripts(data));\r\n\t\tif (modal.tmp.html()) {\r\n\t\t\tmodal.dataReady = true;\r\n\t\t\tshowContentOrLoading();\r\n\t\t} else\r\n\t\t\tloadingError();\r\n\t}", "function bindEulaModalEvents(){\n\n\t$('#acceptAndDownloadCheckBox').click(function(event){\n\t\thandleEulaModalCheckBoxEvent();\n\t});\n\n\thandleEulaModalCheckBoxEvent();\t\n}", "function makeAjaxCalls() {\n $.ajax({\n url: 'Home/WeatherUpdate',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: weatherUpdate,\n error: errorFunc\n });\n\n $.ajax({\n url: 'Home/RssUpdate',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: newsUpdate,\n error: errorFunc\n });\n}", "function ajaxLoaded(data) {\n debug('AjaxLoaded: '+this.url);\n modal.tmp.html(currentSettings.selector\n ?filterScripts($('<div>'+data+'</div>').find(currentSettings.selector).contents())\n :filterScripts(data));\n if (modal.tmp.html()) {\n modal.dataReady = true;\n showContentOrLoading();\n } else\n loadingError();\n }", "function bindEvents () {\n var Modal = $('#modalEditTrack');\n\n // EDIT Track in Modal Window\n $('body').delegate('.btn-edit', 'click', function (e) {\n var trackId = $(e.currentTarget).data('id');\n // console.log('trackId =', trackId);\n loadTrackData(trackId);\n });\n\n // SAVE Track metadata\n $('body').delegate('.btn-save', 'click', function (e) {\n saveTrackData();\n });\n\n // RESET Track Edit form\n Modal.on('hidden.bs.modal', function (e) {\n resetForm();\n });\n\n }", "function updateEventsList(){\n$.ajax({\n type: 'GET',\n url: 'php/getEvents.php',\n complete: $.proxy(function (msg, status) {\n try {\n if (status == \"success\") {\n var res = $.parseJSON(msg.responseText);\n $('#lastEvent').append(res.Date.substr(0,10));\n } else {\n throw \"Bad response: status= \" + status;\n }\n } catch (err) {\n alert(\"Si e' verificato un errore durante la richiesta della lista giocatori. [\" + err + \"]\");\n }\n\n }, this)\n });\n}", "function setCreateButton(){ \n $(\"#create_contact_form\").on('ajax:success', createContactResponse) \n }", "_bindEvents () {\n this.listenTo(this, 'sync', this._syncModels.bind(this))\n this.listenTo(this, 'request', this._requestModels.bind(this))\n }", "function bindUIactions() {\n s.avatarUploadButton.on('click', function() {\n selectFilePrompt();\n });\n s.avatarInput.on('change', function() {\n submitAvatarUpload();\n $('body').css({'cursor' : 'wait'});\n });\n }", "function doAjax(formData, action){\n\t//TODO: doAjax callback function form showList/modifyList\n}", "function initialize() {\n\t/*\n\t * Bind event to add button.\n\t */\n\t$(\"a#add\").click(function(event) {\n\t\t// Prevent default action.\n\t\tevent.preventDefault();\n\t\tvar paramUrl = $(this).attr(\"href\");\n\t\tdoAjaxGet(paramUrl);\n\t});\n\n\t/*\n\t * Bind event to edit button.\n\t */\n\t$(\"a.edit\").click(function(event) {\n\t\t// Prevent default action.\n\t\tevent.preventDefault();\n\t\tvar paramUrl = $(this).attr(\"href\");\n\t\tdoAjaxGet(paramUrl);\n\t});\n\n\t/*\n\t * Bind event to delete button.\n\t */\n\t$(\"a.delete\").click(function(event) {\n\t\t// Prevent actual form submit and page reload\n\t\tevent.preventDefault();\n\t\tvar paramUrl = $(this).attr(\"href\");\n\t\tdoAjaxGet(paramUrl);\n\t});\n\n\t/*\n\t * Bind event to pagination link.\n\t */\n\t$(\"ul.pagination a\").each(function() {\n\t\tif ($('[name=\"_cid\"]').length) {\n\t\t\tvar cid = $('[name=\"_cid\"]').val();\n\t\t\tvar url = $(this).attr('href');\n\t\t\t$(this).attr('href', url + \"&_cid=\" + cid);\n\t\t}\n\t});\n}", "function init_calendar_ajax()\r\n {\r\n // Calendar AJAX.\r\n $('.calendar header a').on('click', function(e) {\r\n var url = $(this).attr('href');\r\n var calendar = $(this).parents('.calendar');\r\n\r\n $.ajax({\r\n type: 'GET',\r\n url: url,\r\n dataType: 'html',\r\n success: function (html) {\r\n $(calendar).fadeOut(function() {\r\n $(this).replaceWith(html).fadeIn();\r\n init_calendar_ajax();\r\n });\r\n\r\n },\r\n beforeSend: function() {\r\n $(calendar).fadeOut(function() {\r\n $(this).html('<div class=\"ajax-loader\"><i class=\"fa fa-cog fa-spin\"></i> ' + Translator.trans('ajax.wait') + '</div>').fadeIn();\r\n });\r\n }\r\n });\r\n\r\n e.preventDefault();\r\n return false;\r\n });\r\n\r\n // Calendar tooltips.\r\n $('.calendar .day-bookings .booking').tooltip({\r\n trigger: 'click hover focus',\r\n placement: 'bottom',\r\n container: 'body',\r\n title: function() {\r\n var translation = 'booking';\r\n if ($(this).hasClass('booking-red')) {\r\n translation = translation + '.red';\r\n } else if ($(this).hasClass('booking-green')) {\r\n translation = translation + '.green';\r\n } else {\r\n translation = translation + '.blue';\r\n }\r\n\r\n if ($(this).hasClass('validated')) {\r\n translation = translation + '.validated';\r\n } else {\r\n translation = translation + '.unconfirmed';\r\n }\r\n\r\n return Translator.trans(translation);\r\n }\r\n });\r\n }", "function attachAjaxOpener() {\n\t\t$('.ajax-trigger').click(function(e) {\n\t\t\tif (!$.support.ajax) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\t$(this).toggleClass('active');\n\t\t\t$panel = $(this).parents('.trigger-container').find('.panel');\n\t\t\tif ($(this).hasClass('active')) {\n\t\t\t\t// Opening\n\t\t\t\tlink = getLink(this);\n\t\t\t\tvar time = getHiddenElementHeight ($panel) * 2;\n\t\t\t\tattachLoading($panel, 'dark');\n\t\t\t\t$panel.stop(true, true).slideToggle(time, function() {\n\t\t\t\t\t\t$.ajax(link, {\n\t\t\t\t\t\t\tcontext: $panel,\n\t\t\t\t\t\t\tdataType: 'html',\n\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\t$panel = $(this);\n\t\t\t\t\t\t\t\tif ($(this).parents('.trigger-container').find('.ajax-trigger').hasClass('active')) {\n\t\t\t\t\t\t\t\t\tremoveLoading(400, function() {\n\t\t\t\t\t\t\t\t\t\t$panel.css({opacity:'0'});\n\t\t\t\t\t\t\t\t\t\t$panel.html(innerShiv(data)).animate({opacity: '1'}, 500);\n\t\t\t\t\t\t\t\t\t\tpngFix();\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});\n\t\t\t} else {\n\t\t\t\t// Closing\n\t\t\t\tvar time = $('.panel').height();\n\n\t\t\t\t$panel.stop(true, true).slideToggle(time, function() {\n\t\t\t\t\tif (!$('.ajax-trigger').hasClass('active')) {\n\t\t\t\t\t\t$panel.empty();\n\t\t\t\t\t\t$panel.removeAttr('style');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function ajaxResult(address, search) {\n//alert(\"ready to lauch...\");\n var request = getRequestObject();\n request.onreadystatechange = \n function() { showResponseText(request, search); };\n request.open(\"GET\", address, true);\n request.send(null);\n//alert(\"lauched...\");\n}", "bindEvents() {\n let _this = this;\n this.$blogPost.on(\"click\", \"a\", () => {\n event.preventDefault();\n this.loadContent(event.target);\n });\n }", "function bindEvents() {\n\t\t\tif(options.selection.mode != null){\n\t\t\t\toverlay.observe('mousedown', mouseDownHandler);\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t\toverlay.observe('mousemove', mouseMoveHandler)\n\t\t\toverlay.observe('click', clickHandler)\n\t\t}", "function bindAjaxSubmission() {\n\tvar msgidfromcontroller = \"\";\n\tvar options = {\n\t\ttarget : \"#reviews\",\n\t};\n\t$(\"#new_review\").submit(function() {\n\t\t$(this).ajaxSubmit(options);\n\t\treturn false;\n\t});\n}", "function prepareAjaxRequestData() {\n this.emit('ajaxable:on-ajax-before', this.options.ajaxData);\n}", "events() {\n \t\tthis.openButton.on(\"click\", this.openOverlay.bind(this));\n\t\tthis.closeButton.on(\"click\", this.closeOverlay.bind(this));\n\t\t// search window will be open by keybaord. \n\t\t $(document).on(\"keydown\", this.keyPressDispatcher.bind(this));\n\t\t// when use input data in search window, typingLogic method is called. \n\t\t// searchField is defined by constructor of this class.\n\t\t/* we can use $('#search-term), but accessing DOM is much slower than\n\t\t JavaScript(jQuery). So, we use a property of this class object. which is\n\t\t 'searchField'. This is same as #Search-term and defined by constructor. */\n \t\tthis.searchField.on(\"keyup\", this.typingLogic.bind(this));\n \t}", "function loadContent () {\n $.ajax({\n method: \"post\",\n url: \"/spellbook/spells\",\n data: {\n class_inc: getClassesString(true).join(\" \"),\n class_exc: getClassesString(false).join(\" \"),\n rit: $(\"#rit-btn\").val(),\n con: $(\"#con-btn\").val(),\n com_v: $(\"#v-btn\").val(),\n com_s: $(\"#s-btn\").val(),\n com_m: $(\"#m-btn\").val(),\n search: $(\"#search-input\").val(),\n },\n success: function(data){\n $(\"#spell-block\").html(data);\n setSpellDetailListener()\n setSpellLevelListener()\n }\n });\n}", "function performInitAjaxes() {\n fetchOrganizations();\n fetchFieldTypes();\n fetchDataTypes();\n }", "function getProductAjaxCall(){\n //Check if the view already exist\n clearview();\n\n loadshow();\n\n $.ajax({\n type: \"GET\",\n url: \"getallproducts\",\n success: function (response) {\n productListView(response)\n\n },\n error: function (e){\n console.log(\"error1\" , e)\n }\n });\n}", "function onFunction(){\n\t$.post('/on');\n}", "function ajaxForFilms(){\n\t\tcreateDropDown(maxNumberOfFilms, $dropDownFilms);\n\t\thideTheRestDropDowns($dropDownFilms);\n\t\t$spanInfo.text(\"Number of Films\");\n\t\t$divContent.show();\n\t\t//initial value when link is clicked\n\t\tgenerateFilms(initialNumberDisplayed);\n\t\t// get the ajax request\n\t\t$.get(\"http://swapi.co/api/films/\", {\t\n\t\t}).done(function(data) {\n\t\t\t$dropDownFilms.on( \"change\", function(){\n\t\t\t\tgenerateFilms($(this).val());\n\t\t\t});\n\t\t\t$table.show();\t\n\t\t}).fail(function() {alert('something went wrong in the ajaxForFilms()!');});\n\t\t//end of ajax request\n\t}", "success(data){\n //insiro os dados do arquivo(data) que a url indicou no html do wm-include(e)\n //que esta na pagina index.html\n $(e).html(data)\n //agora excluo o atributo para que nao aja nehuma nova \n //interpretacao dela.\n //se caso eu clicar no botao da pagina e chamar novamente \n //essa funcao o wm-include nao existira e entao nao sera chamada\n //novamente para abrir denovo na pagina, pois ja estara aberta\n $(e).removeAttr('wm-include')\n\n //Quando faco uma chamada ajax ele nao executa arquivos JS da pagina que\n //o ajax esta montando dentro do body. Portanto por exemplo, para que \n // o arquivo cityButtons.js seja executado e para que os botoes sejam inseridos dentro\n //do arquivo galery.html, é preciso que a chamada de criacao dos botoes sejam\n //feitas dentro deste ajax, porque por padrao o ajax nao deixa um outro arquivo JS ser executado\n //pelo arquivo que o ajax esta querendo montar. Por este motivo que esta sendo feito a chamada\n //das funcoes(callback) abaixo.\n\n //Aqui estou passando como parametro os dados(data) pra todas as funcoes(callback)\n //que tem no array 'loadHtmlSuccessCallbacks' e fazendo a chamada delas.\n loadHtmlSuccessCallbacks.forEach(callback => callback(data))\n\n //faco a chamada recursiva, porque pode existir um wm-include dentro\n //dentro deste wm-include(e), entao passo ele como parametro pra funcao\n //para executar esse wm-include que esta dentro do outro\n loadIncludes(e)\n\n }", "_loadXhr() {\n // // if unset, determine the value\n // if (typeof this.xhrType !== 'string') {\n // this.xhrType = this._determineXhrType();\n // }\n // var xhr = this.xhr = new XMLHttpRequest();\n // // set the request type and url\n // xhr.open('GET', this._request.url, true);\n // xhr.timeout = this.timeout;\n // // load json as text and parse it ourselves. We do this because some browsers\n // // *cough* safari *cough* can't deal with it.\n // if (this.xhrType === ResourceLoader.XHR_RESPONSE_TYPE.JSON || this.xhrType === ResourceLoader.XHR_RESPONSE_TYPE.DOCUMENT) {\n // xhr.responseType = <any>ResourceLoader.XHR_RESPONSE_TYPE.TEXT;\n // } else {\n // xhr.responseType = this.xhrType;\n // }\n // xhr.addEventListener('error', this._boundXhrOnError, false);\n // xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n // xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n // xhr.addEventListener('progress', this._boundOnProgress, false);\n // xhr.addEventListener('load', this._boundXhrOnLoad, false);\n // xhr.send();\n }", "function ajaxDescProject(e) {\n \n}", "function watchTargets() {\n jQuery(document).ajaxComplete(processResponse);\n }", "initEvents() {\n var self = this;\n\n $('#import-nodes-lists').on('click', 'li.import-node', self.nodeClicked.bind(self));\n $('#import-nodes-lists').on('click', '.import-node-remove', self.nodeRemoved.bind(self));\n $('#import-nodes-lists').on('click', '.import-node-edit', self.nodeEdit.bind(self));\n $('#import-nodes-lists').on('submit', '.import-node-form', self.nodeEdited.bind(self));\n $('#import-nodes-lists').on('focusout', '.import-node-form input', self.nodeEdited.bind(self));\n $('#import_send').click(self.submitNodes.bind(self));\n }", "function ajaxForPeople(){\n\t\tcreateDropDown(maxNumberOfPeople, $dropDownPeople);\n\t\thideTheRestDropDowns($dropDownPeople);\n\t\t$spanInfo.text(\"Number of Characters\");\n\t\t$divContent.show();\n\t\t//initial value when link is clicked\n\t\tgeneratePeople(initialNumberDisplayed);\n\t\t// get the ajax request\n\t\t$.get(\"http://swapi.co/api/people/\", {\t\n\t\t}).done(function(data) {\n\t\t\t$dropDownPeople.on( \"change\", function(){\n\t\t\t\tgeneratePeople($(this).val());\n\t\t\t});\n\t\t\t$table.show();\t\n\t\t}).fail(function() {alert('something went wrong in the ajaxForPeople()!');});\n\t\t//end of ajax request\n\t}", "function ajaxCallToDo($status) {\n\t\t$.ajax({\n\t\t\turl: 'php/widget-ajax.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tbeforeSend: function(){\n\t\t\t\t$status.find('.loading').fadeIn(300);\n\t\t\t},\n\t\t\tsuccess: function( data, textStatus, XMLHttpRequest ) {\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t$status.find('span').hide();\n\t\t\t\t\t$status.find('.saved').fadeIn(300);\n\t\t\t\t\tconsole.log(\"AJAX SUCCESS\");\n\t\t\t\t}, 1000 );\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t$status.find('.saved').fadeOut(300);\n\t\t\t\t}, 2000 );\n\t\t\t\t/* all setTimeout is used for demo purpose only */\n\n\t\t\t},\n\t\t\terror: function( XMLHttpRequest, textStatus, errorThrown ) {\n\t\t\t\t$status.find('span').hide();\n\t\t\t\t$status.find('.failed').addClass('active');\n\t\t\t\tconsole.log(\"AJAX ERROR: \\n\" + errorThrown);\n\t\t\t}\n\t\t});\n\t}", "function loadServices()\n{\n var url = \"../../controller/AdminAjax.php\";\n\n ajax.onreadystatechange = serviceList\n ajax.open(\"POST\",url,true);\n ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n ajax.send('number=5');\n}", "done() {\n const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;\n AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);\n }", "function load(){\n\t\t$.ajax('/exp/init',{data:{},dataType:'json',success:function(a,b,c){loadHandler(a,b,c)},error:function(a,b,c){console.log('Error:',a,b,c)}});\n\n}", "function handleAjaxSetup() {\n jQuery.ajaxSetup(Object.create(null, {\n // Don't worry about the GET request, this option will be ignored by jQuery when using HTTP GET method.\n 'contentType': { value: 'application/json; charset=UTF-8', enumerable: true, writable: true },\n 'headers': { value: csrfToken, enumerable: true, writable: true },\n 'dataType': { value: 'json', enumerable: true, writable: true },\n 'dataFilter': { value: filterAjaxData, enumerable: true, writable: true },\n }));\n }", "function bindInputEvents(){\n bindHeaderEvents();\n bindLoginModalEvents();\n}", "function LoadViaAjax() {\t\t\r\n\t\t\r\n\t\tFirstLoad();\t\t\r\n\t\tLazyLoad();\t\t\r\n\t\tHeroSection();\r\n\t\tFitThumbScreen();\r\n\t\tPortfolio();\t\t\r\n\t\tBackToTop();\r\n\t\tPageShare();\r\n\t\tSliders();\r\n\t\tJustifiedGrid();\r\n\t\tLightbox();\r\n\t\tAppearIteam();\r\n\t\tContactMap();\r\n\t\tContactForm();\t\t\r\n\t\r\n\t}//End Load Via Ajax\t\t\t\t", "ready(){super.ready();this.addEventListener(\"ajax-response\",e=>this._loginStatus(e))}", "function ajax(messageTarget, reload, url, async, reqType, cbS, cbE, data){\n\tif (async == undefined) async = true;\n\tif (reqType == undefined) reqType = 'GET';\n\tvar rData\n\n\tonApiData = function( data, ajaxStatus, xhr) {\n\t\tvar statusCode = xhr.status;\n\t\tvar statusText = xhr.statusText;\n\t\t//precess & display ajax messages\n\t\tvar jsonMessage = getMessages(xhr, $(messageTarget))\n\t\talertFade()//display and fade messages\n\t\t//if callback exicute call back\n\t\tif (cbS){\n\t\t\tcbS(data, ajaxStatus, xhr)\n\t\t//if one object is returned return the object\n\t\t}else if(statusText != \"NO CONTENT\" && data.objects.length==1){\n\t\t\t\tconsole.log('one one object returned below:')\n\t\t\t\tconsole.log(data.objects[0])\n\t\t\t\trData = data.objects[0]\n\t\t//return all data\n\t\t}else{\n\t\t\trData = data\n\t\t\tconsole.log('streight data returned below:')\n\t\t\tconsole.log(rData)\n\t\t}\n\t\t//TODO: im not sure what the below if was for but everyting seems to be ok without it.\n\t\t//if (authUserO && authUserO.id == aProfileO.id || !aProfileO.id){\n\t\tif (reload){\n\t\t\tconsole.log('--TODO:eliminate need for this--reloading data after ajax')\n\t\t\tloadData(undefined, undefined, true)//reloads page & data\n\t\t}\n\t\t//}\n\t}\n\tfunction onApiError(xhr, settings, what) {\n\t\t//TODO: may wnat to change tastypie form field error responce if possible to success.....\n\t\tvar jsonMessage = getMessages(xhr, $(messageTarget))\n\t\talertFade()//set messages to fade out\n\t\tif (cbE){cbE(xhr, settings, what)}else{console.warn('ajax()error: ',xhr, settings, what)};\n\t}\n\tconsole.log('-ajax - 1 custom ajax()');\n\n\t$.ajax({//1 custom ajax function\n\t\tcontext: messageTarget,\n\t\turl: url,\n\t\ttype: reqType,\n\t\tcontentType: 'application/json',\n\t\tdata: data,\n\t\t//dataType: 'json', \n\t\tprocessData: false,\n\t\theaders: {\n\t\t\t//'x-requested-with' : 'XMLHttpRequest' //// add header for django form.is_valid() \n\t\t},\n\t\txhrFields: {\n\t\t\t//withCredentials: true //// add credentials to the request\n\t\t},\n\t\t/* //CSRF token handled by ajax setup function.\n\t\tbeforeSend: function(jqXHR, settings) {\n\t\t\t//jqXHR.setRequestHeader('X-CSRFToken', $('input[name=csrfmiddlewaretoken]').val());\n\t\t}, */\n\t\t//TODO: what is getApiData doing???? i don't think its used any more. test!\n\t\tsuccess: onApiData,\n\t\terror: onApiError,\n\t\tasync: async,\n\t});\n\tif (!cbS) return rData;\n}", "bindEvents() {\n $(document).on('submit', 'form.doggy-purchase', App.handlePurchase);\n }", "function performRequest() {\n $.ajax({\n type: 'GET',\n url: generateUrl(ajaxUrl),\n dataType: 'html',\n delay: 400,\n beforeSend: function() {\n if (processing) {\n return false;\n } else {\n processing = true;\n }\n },\n success: function (html) {\n $('#filtered-list').replaceWith(html);\n processing = false;\n }\n });\n }", "function callAjax(calls, extra, onProgress, onDone) {\n var dfds = calls.map(function (a) {\n return $.ajax($.extend({}, a, extra));\n });\n if (dfds.length === 0) {\n onDone();\n } else {\n dfds.map(function (d) { d.done(onProgress); });\n $.when.apply(null, dfds).done(onDone);\n }\n }", "xhrResultsHandler(data,textStatus,jqXHR) {\n \n }", "_statusChanged(e){// we are in loading state so go load data and let the response\n// dictate what state we reach after that\nif(\"loading\"==e.target.status){if(typeof this.items[this.active].metadata.dataUrl!==typeof void 0&&!this.disableAjaxCalls){this.$.ajax.url=this.items[this.active].metadata.dataUrl;this.$.ajax.generateRequest()}else{setTimeout(()=>{this.items[this.active].metadata.status=\"available\";this.set(\"items.\"+this.active+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");this._responseList[this.active]={};this.activeNodeResponse=this._responseList[this.active]},1500)}}else if(\"complete\"==e.target.status&&this.items.length===this.active+1){setTimeout(()=>{this.items[this.active].metadata.status=\"finished\";this.set(\"items.\"+this.active+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+this.active+\".metadata.status\")},100)}}", "function bindEventHandlers () {\n $('#createHaiku').on('click', createHaiku);\n $('#clearOutput').on('click', clearOutput);\n }", "function setEvents(){\n var date = createDateStrForDBRequest(new Date());\n $.ajax({\n url: '/events?fromDate=' + date,\n type: 'GET',\n dataType: 'json',\n success: (data) => { \n if(data.length>0){ setEventsToPage(data) }\n else { setEventsToPage(staticData) }\n }\n });\n}", "function bindUIactions() {\n $('body').on('click', '.subtasks__more-link', showCompletedSubtasks);\n }", "function defaultAjaxCallback(response, status, xhr, options){\n\t\tconsole.log(\"ajax callback \" + status);\n\t\tif(status === \"error\"){\n\t\t\t$(\"#\" + options.ajaxLoadDiv).html(\"Could not load the requested resource, double check so that the id etc. is correct and that the resource exist\");\n\t\t}\n\t}", "function handleMenuAjax(options, $this, event){\n\t\tevent.preventDefault();\n\t\tvar imgElement, imgSrc;\n\t\t\n\t\tconsole.log(\"handling ajax request: \" + options.divId);\n\t\t// checks if the id contains a prefix/postfix aswell.... for older browsers that don't support HTML5\n\t\tif($this.data(\"clickable\") != options.nonItem && !startsOrEndsWith($this.attr(\"id\"), options.nonItem)){ // checks if clickable element\n\t\t\t$(\"#\" + options.divId + \".\" + options.divClass + \" li a,#\" + options.divId + \".\" + options.divClass + \" li img\").removeClass(\"selected\");\n\t\t\t$this.addClass(\"selected\");\n\t\t\t\n\t\t\t// if $this.data(\"url\") is undefined then try to use $this.attr(\"id\") instead, possibly even try to use src if the other two are unavailable\n\t\t\tif($this.data(\"url\") != undefined && $this.data(\"url\") != null){\n\t\t\t\tif(options.pageExtension != \"\"){\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load($this.data(\"url\") + \".\" + options.pageExtension, function(response, status, xhr){\n\t\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t\t});\n\t\t\t\t} else{\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load($this.data(\"url\"), function(response, status, xhr){\n\t\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if($this.attr(\"id\") != undefined && $this.attr(\"id\") != null){\n\t\t\t\tif(options.pageExtension != \"\"){\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load($this.attr(\"id\") + \".\" + options.pageExtension, function(response, status, xhr){\n\t\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t\t});\n\t\t\t\t} else{\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load($this.attr(\"id\"), function(response, status, xhr){\n\t\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if($this.attr(\"href\") != undefined && $this.attr(\"href\") != null && !startsWith($this.attr(\"href\"), \"javascript:void(0)\")){\n\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load($this.attr(\"href\"), function(response, status, xhr){\n\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t});\n\t\t\t}else if($this.attr(\"src\") != undefined && $this.attr(\"src\") != null){ // TODO: CHECK SRC BEFORE ID?\n\t\t\t\timgSrc = $this.attr(\"src\");\n\t\t\t\t\n\t\t\t\t// checks so no img element with this id already exists\n\t\t\t\tif(document.getElementById(\"dynamicImageId\" + options.divId) != null){\n\t\t\t\t\t// if it exist check if the src attribute is the same\n\t\t\t\t\tif($(\"#dynamicImageId\" + options.divId).attr(\"src\") != imgSrc){\n\t\t\t\t\t\t$(\"#dynamicImageId\" + options.divId).attr(\"src\", imgSrc);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t// clear the ajaxLoadDiv before appending image so that previous page is not lingering\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).empty();\n\t\t\t\t\t\n\t\t\t\t\timgElement = $(\"<img></img>\").attr({id:\"dynamicImageId\" + options.divId, src:imgSrc});\n\t\t\t\t\t$(\"#\" + options.ajaxLoadDiv).append(imgElement);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$(\"#\" + options.ajaxLoadDiv).load(options.defaultMissingPageUrl, function(response, status, xhr){\n\t\t\t\t\t\toptions.ajaxCallbackFunction(response, status, xhr, options);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.log(\"NOTE: that item is set as non clickable\");\n\t\t}\n\t}", "function getAllData() {\n $.ajax({\n url: '/refresh_data/',\n beforeSend: function () {\n // Not yet implemented\n // glyphicon.spin()\n console.log('refresh data called');\n },\n success: function () {\n //pass\n console.log('Sweet success')\n },\n error: function () {\n //pass\n },\n complete: function () {\n console.log('Complete!')\n //pass\n },\n })\n}", "function callAjaxJson(call_back_func, method, url, field_id, form_id, loading_func, field_element_id) {\n\t\n\t\tvar requester \t= createXmlObject();\n\t\t\tmethod \t\t= method.toUpperCase();\n\n\t\t// Event handler for an event that fires at every state change,\n\t\t// for every state , it will run callback function.\n\t\t// Set the event listener\n\t\trequester.onreadystatechange = \tfunction() { stateHandlerJson(requester, url, call_back_func, field_id, loading_func, field_element_id)}\n\n\t\tswitch (method) {\n\t\t\tcase 'GET':\n\t\t\tcase 'HEAD':\n\t\t\t\trequester.open(method, url);\n\t\t\t\trequester.send(null);\n\t\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\tquery = generate_query(form_id);\n\t\t\t\trequester.open(method, url);\n\t\t\t\t// In order to get the request body values to show up in $_POST \n\t\t\t\trequester.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n\t\t\t\trequester.send(query);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\talert('Error: Unknown method or method not supported');\n\t\t\t\tbreak;\n\t\t}\n\t}", "function genericAjaxCall(url, mydata, successhandler, errhandler) {\n $(\"body\").css(\"cursor\", \"progress\");\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n mydata.property_id = window.propertyid;\n\n var paramObj = {\n url: url,\n data: mydata,\n type:'post',\n error:function(response){\n showDBError(hseError['ajax']);\n errhandler(response);\n },\n success:function(response){\n successhandler(response);\n\n }\n }; \n \n if (url.indexOf('creative') != -1 && url.indexOf('search') == -1) {\n paramObj.processData = false;\n paramObj.contentType = false;\n }\n\n $.ajax(paramObj).done(function( response ) {\n $(\"body\").css(\"cursor\", \"default\");\n }\n );\n}", "function bindSearchHandler() {\n $(\"#search-form\").submit(function() {\n var q = $(\"#q\").val();\n if (q !== \"\") {\n $.ajax({\n dataType: 'html',\n url: '/search?q=' + encodeURIComponent(q),\n \n // Show the user his search results.\n success: function(response) {\n $(\"#search-results\").html(response); \n bindSearchResultHandlers();\n }\n });\n }\n \n return false;\n });\n }", "function ajaxCallBack(opt,a) {\n\tif (opt.ajaxCallback==undefined || opt.ajaxCallback==\"\" || opt.ajaxCallback.length<3)\n\t\treturn false;\n\n\tvar splitter = opt.ajaxCallback.split(')'),\n\t\tsplitter = splitter[0].split('('),\n\t\tcallback = splitter[0],\n\t\targuments = splitter.length>1 && splitter[1]!=\"\" ? splitter[1]+\",\" : \"\",\n\t\tobj = new Object();\n\n\ttry{\n\t\tobj.containerid = \"#\"+opt.ajaxContentTarget,\n\t\tobj.postsource = a.data('ajaxsource'),\n\t\tobj.posttype = a.data('ajaxtype');\n\n\t\tif (opt.ajaxCallbackArgument == \"on\")\n\t\t\teval(callback+\"(\"+arguments+\"obj)\");\n\t\telse\n\t\t\teval(callback+\"(\"+arguments+\")\");\n\t\t} catch(e) { console.log(\"Callback Error\"); console.log(e)}\n}", "function callAjax(calls, extra, onProgress, onDone) {\n var dfds = calls.map(function (a) {\n return $.ajax($.extend({}, a, extra));\n });\n if (dfds.length === 0) {\n onDone();\n } else {\n dfds.map(function (d) { d.done(onProgress); });\n $.when.apply(null, dfds).done(onDone);\n }\n }", "function bindUIactions() {\n $('body').on('click', '.comment__settings-button', showSettings);\n $('body').on('click', '.comment__settings-close', hideSettings);\n $('body').on('click', '.comments__new-link', showCommentForm);\n }" ]
[ "0.7103751", "0.7096981", "0.70443255", "0.668868", "0.65920866", "0.6562029", "0.65329397", "0.6457068", "0.63906914", "0.6384853", "0.63636196", "0.63054353", "0.6236459", "0.6146691", "0.6144744", "0.6115682", "0.61021787", "0.61001533", "0.6050454", "0.604859", "0.60341555", "0.6018905", "0.6016283", "0.5991206", "0.59872764", "0.5961126", "0.5946989", "0.5944889", "0.5927809", "0.5896048", "0.5890075", "0.58877546", "0.5870932", "0.5855675", "0.5855675", "0.5852424", "0.58482873", "0.58344966", "0.5833478", "0.5831569", "0.5827398", "0.5826787", "0.58210856", "0.5804529", "0.5800785", "0.5791984", "0.5790817", "0.57742125", "0.57666177", "0.5760423", "0.5753195", "0.5751487", "0.57471967", "0.5740238", "0.573906", "0.5738996", "0.57333905", "0.5721946", "0.57135946", "0.57004523", "0.5689672", "0.56835824", "0.5677514", "0.567373", "0.5672733", "0.5666571", "0.5659559", "0.5644752", "0.5644509", "0.56440395", "0.5636685", "0.5634652", "0.56269187", "0.5626776", "0.56231326", "0.5615687", "0.56155705", "0.560687", "0.5605158", "0.56022817", "0.5594412", "0.55936706", "0.55905443", "0.55883557", "0.55870163", "0.5585824", "0.5582408", "0.55739224", "0.5569328", "0.55670005", "0.55648136", "0.55477047", "0.55453557", "0.5542976", "0.5541531", "0.5538239", "0.55353814", "0.5532972", "0.5527993", "0.5525638" ]
0.5991899
23
Left mouse button controls the orbit itself. The right mouse button allows to move the camera and the point it's looking at in the XY plane. The scroll moves the camera forward and backward.
function setupCamera(scene) { let canvas = scene.viewer.canvas; let camera = scene.camera; let MOVE_SPEED = 2; let ZOOM_SPEED = 30; let ROTATION_SPEED = 1 / 200; let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0}; let right = vec3.create(); let up = vec3.create(); let horizontalAngle = -Math.PI / 2; let verticalAngle = -Math.PI / 4; let cameraTarget = vec3.create(); // What the camera orbits. // Initial setup, go back a bit and look forward. camera.move([0, -400, 0]); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); // Move the camera and the target on the XY plane. function move(x, y) { let dirX = camera.directionX; let dirY = camera.directionY; // Allow only movement on the XY plane, and scale to MOVE_SPEED. vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED); vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED); camera.move(right); camera.move(up); // And also move the camera target to update the orbit. vec3.add(cameraTarget, cameraTarget, right); vec3.add(cameraTarget, cameraTarget, up); } // Rotate the camera around the target. function rotate(dx, dy) { // Update rotations, and limit the vertical angle so it doesn't flip. // Since the camera uses a quaternion, flips don't matter to it, but this feels better. horizontalAngle += dx * ROTATION_SPEED; verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01)); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); } // Zoom the camera by moving forward or backwards. function zoom(factor) { // Get the forward vector. let dirZ = camera.directionZ; camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED)); } /* // Resize the canvas automatically and update the camera. function onResize() { let width = canvas.clientWidth; let height = canvas.clientHeight; canvas.width = width; canvas.height = height; camera.viewport([0, 0, width, height]); camera.perspective(Math.PI / 4, width / height, 8, 100000); } window.addEventListener("resize", function(e) { onResize(); }); onResize(); */ // Track mouse clicks. canvas.addEventListener("mousedown", function(e) { e.preventDefault(); mouse.buttons[e.button] = true; }); // And mouse unclicks. // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas. window.addEventListener("mouseup", (e) => { e.preventDefault(); mouse.buttons[e.button] = false; }); // Handle rotating and moving the camera when the mouse moves. canvas.addEventListener("mousemove", (e) => { mouse.x2 = mouse.x; mouse.y2 = mouse.y; mouse.x = e.clientX; mouse.y = e.clientY; let dx = mouse.x - mouse.x2; let dy = mouse.y - mouse.y2; if (mouse.buttons[0]) { rotate(dx, dy); } if (mouse.buttons[2]) { move(-dx * 2, dy * 2); } }); // Handle zooming when the mouse scrolls. canvas.addEventListener("wheel", (e) => { e.preventDefault(); let deltaY = e.deltaY; if (e.deltaMode === 1) { deltaY = deltaY / 3 * 100; } zoom(deltaY / 100); }); // Get the vector length between two touches. function getTouchesLength(touch1, touch2) { let dx = touch2.clientX - touch1.clientX; let dy = touch2.clientY - touch1.clientY; return Math.sqrt(dx * dx + dy * dy); } // Touch modes. let TOUCH_MODE_INVALID = -1; let TOUCH_MODE_ROTATE = 0; let TOUCH_MODE_ZOOM = 1; let touchMode = TOUCH_MODE_ROTATE; let touches = []; // Listen to touches. // Supports 1 or 2 touch points. canvas.addEventListener('touchstart', (e) => { e.preventDefault(); let targetTouches = e.targetTouches; if (targetTouches.length === 1) { touchMode = TOUCH_MODE_ROTATE; } else if (targetTouches.length == 2) { touchMode = TOUCH_MODE_ZOOM; } else { touchMode = TOUCH_MODE_INVALID; } touches.length = 0; touches.push(...targetTouches); }); canvas.addEventListener('touchend', (e) => { e.preventDefault(); touchMode = TOUCH_MODE_INVALID; }); canvas.addEventListener('touchcancel', (e) => { e.preventDefault(); touchMode = TOUCH_MODE_INVALID; }); // Rotate or zoom based on the touch mode. canvas.addEventListener('touchmove', (e) => { e.preventDefault(); let targetTouches = e.targetTouches; if (touchMode === TOUCH_MODE_ROTATE) { let oldTouch = touches[0]; let newTouch = targetTouches[0]; let dx = newTouch.clientX - oldTouch.clientX; let dy = newTouch.clientY - oldTouch.clientY; rotate(dx, dy); } else if (touchMode === TOUCH_MODE_ZOOM) { let len1 = getTouchesLength(touches[0], touches[1]); let len2 = getTouchesLength(targetTouches[0], targetTouches[1]); zoom((len1 - len2) / 50); } touches.length = 0; touches.push(...targetTouches); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function controlLeftAction() {\n xCoord -= (357 + 30);\n let limiteIzquierdo = 0;\n if (xCoord < limiteIzquierdo){\n xCoord = limiteIzquierdo;\n }\n containterTrending.scroll(xCoord, yCoord);\n}", "function onMouseMove(event) {\n // store the mouseX and mouseY position \n event.preventDefault();\n\n if ( isMouseDown ) {\n theta = - ( ( event.clientX - onMouseDownPosition.x ) * 0.5 )\n + onMouseDownTheta;\n phi = ( ( event.clientY - onMouseDownPosition.y ) * 0.5 )\n + onMouseDownPhi;\n\n phi = Math.min( 180, Math.max( 0, phi ) );\n\n camera.position.x = radius * Math.sin( theta * Math.PI / 360 )\n * Math.cos( phi * Math.PI / 360 );\n camera.position.y = radius * Math.sin( phi * Math.PI / 360 );\n camera.position.z = radius * Math.cos( theta * Math.PI / 360 )\n * Math.cos( phi * Math.PI / 360 );\n camera.lookAt( scene.position );\n }\n render();\n }", "function onBtnLeftClick() {\n console.log('click');\n cityIndex -= 1; \n if (cityIndex < 0) {\n cityIndex = 2;\n }\n\n setAstronaut();\n setCityPos();\n changeCity();\n}", "moveRight() {\n this.point.x += this.scrollSpeed;\n }", "moveLeft() {\n this.point.x -= this.scrollSpeed;\n }", "function wheel(ev, gl, canvas){\r\n var scroll = ev.deltaY;\r\n \r\n if(buttonE && currPick!=null){\r\n scaleObj(scroll);\r\n }else if(buttonE && currPick===null){\r\n if(lastButton===2){ //right mouse click\r\n moveCamera(scroll);\r\n }else{\r\n zoom(scroll);\r\n }\r\n }\r\n \r\n return false;\r\n}", "function onMouseMove( event ) {\n\t\tif (isMouseDown)\n\t\t{\n\t\t\tvar canvasSize = 200;\n\t\t\t\n\t\t\tmouseX = event.clientX-(window.innerWidth-spinMenuRight-canvasSize);\n\t\t\tmouseY = event.clientY-spinMenuTop;\n\t\t\t\n\t\t\tcanvX = mouseX/canvasSize*2-1;\n\t\t\tcanvY = 1-mouseY/canvasSize*2;\n\t\t\t\n\t\t\t\n\t\t\tif (pressedO) {\n\t\t\t\tif (!selectedXZ) \n\t\t\t\t{\n\t\t\t\t\tdirVecXZ = new THREE.Vector(1,0,0);\n\t\t\t\t\tangleX = 0;\n\t\t\t\t}\n\t\t\t\tremoveArrows();\n\t\t\t\tif (dirVecXZ.getComponent(0) > 0)\n\t\t\t\t\tdirVecXY = new THREE.Vector3(-canvX, canvY,0);\n\t\t\t\telse\n\t\t\t\t\tdirVecXY = new THREE.Vector3(canvX, canvY,0);\n\t\t\t\tdirVecXY.applyAxisAngle(new THREE.Vector3(0,1,0), angleX);\n\t\t\t\tdirVecXY.normalize();\n\t\t\t\tarrowSpinXY = new THREE.ArrowHelper(dirVecXY, new THREE.Vector3(0,0,0),2, 0x29A3CC,3.5,0.5);\n\t\t\t\tscene.add(arrowSpinXY);\n\t\t\t\tselectedXY = true;\n\t\t\t\tdirVec.set(dirVecXY.getComponent(0),dirVecXY.getComponent(1),dirVecXY.getComponent(2))\n\t\t\t} else {\n\t\t\t\tremoveArrows();\n\t\t\t\tif (selectedXY){\n\t\t\t\t\tvar X = -canvX;\n\t\t\t\t\tvar Y = dirVecXY.getComponent(1);\n\t\t\t\t\tvar Z;\n\t\t\t\t\tif (canvY < 0)\n\t\t\t\t\t\tZ = Math.sqrt(1-X*X-Y*Y);\n\t\t\t\t\telse\n\t\t\t\t\t\tZ = -Math.sqrt(1-X*X-Y*Y);\n\t\t\t\t\tdirVecXZ = new THREE.Vector3(X, Y, Z);\n\t\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\tdirVecXZ = new THREE.Vector3(-canvX,0, canvY);\n\t\t\t\tdirVecXZ.normalize();\n\t\t\t\tarrowSpinXZ = new THREE.ArrowHelper(dirVecXZ, new THREE.Vector3(0,0,0),2, 0x29A3CC,3.5,0.5);\n\t\t\t\t\n\t\t\t\tscene.add(arrowSpinXZ);\n\t\t\t\tselectedXZ = true;\n\t\t\t\tdirVec.set(dirVecXZ.getComponent(0),dirVecXZ.getComponent(1),dirVecXZ.getComponent(2));\n\t\t\t}\n\t\t}\n\t\tif (selectedXY || selectedXZ || selectedForm)\n\t\t\tsetMenu(dirVec.getComponent(0),dirVec.getComponent(1),dirVec.getComponent(2));\n\t\t\tangularVelocity[0]=dirVec.x;\n\t\t\tangularVelocity[1]=dirVec.y;\n\t\t\tangularVelocity[2]=dirVec.z;\n\t\t\t//console.log(dirVec.getComponent(0)+\",\"+dirVec.getComponent(1)+\",\"+dirVec.getComponent(2));\n\t}", "function onMouseDown(event) {\n if (scope.enabled === false) return; // Prevent the browser from scrolling.\n\n event.preventDefault(); // Manually set the focus since calling preventDefault above\n // prevents the browser from setting it automatically.\n\n scope.domElement.focus ? scope.domElement.focus() : window.focus();\n\n switch (event.button) {\n case 0:\n switch (scope.mouseButtons.LEFT) {\n case three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].ROTATE:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n } else {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n }\n\n break;\n\n case three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].PAN:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n } else {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n }\n\n break;\n\n default:\n state = STATE.NONE;\n }\n\n break;\n\n case 1:\n switch (scope.mouseButtons.MIDDLE) {\n case three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].DOLLY:\n if (scope.enableZoom === false) return;\n handleMouseDownDolly(event);\n state = STATE.DOLLY;\n break;\n\n default:\n state = STATE.NONE;\n }\n\n break;\n\n case 2:\n switch (scope.mouseButtons.RIGHT) {\n case three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].ROTATE:\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n break;\n\n case three__WEBPACK_IMPORTED_MODULE_0__[\"MOUSE\"].PAN:\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n break;\n\n default:\n state = STATE.NONE;\n }\n\n break;\n }\n\n if (state !== STATE.NONE) {\n document.addEventListener('mousemove', onMouseMove, false);\n document.addEventListener('mouseup', onMouseUp, false);\n scope.dispatchEvent(startEvent);\n }\n }", "wheelHandler(event) {\n var direction = event.deltaY;\n if (direction > 0) {\n // Scroll down\n if (this._controlFocus === \"camera\") {\n this.CONTROLLABLES[this._controlFocus].matrixWorld.multiply(new THREE.Matrix4().makeTranslation(0, 0, 3 * this.zoomSpeed));\n } else {\n this.CONTROLLABLES[this._controlFocus].matrix.multiply(new THREE.Matrix4().makeTranslation(0, 0, 3 * this.zoomSpeed));\n }\n } else {\n // Scroll up\n if (this._controlFocus === \"camera\") {\n this.CONTROLLABLES[this._controlFocus].matrixWorld.multiply(new THREE.Matrix4().makeTranslation(0, 0, -3 * this.zoomSpeed));\n } else {\n this.CONTROLLABLES[this._controlFocus].matrix.multiply(new THREE.Matrix4().makeTranslation(0, 0, -3 * this.zoomSpeed));\n }\n }\n }", "function cameraEdgeTeleportControl() {\n\n if(controls.target.x > 90){\n controls.target.x = -395;\n camera.position.x = -395;\n\n }\n\n if(controls.target.x < -395){\n controls.target.x = 90;\n camera.position.x = 90;\n }\n\n if(controls.target.y > 90){\n controls.target.y = -150;\n camera.position.y = -150;\n }\n\n if(controls.target.y < -150){\n controls.target.y = 90;\n camera.position.y = 90;\n }\n\n}", "function onMouseWheel(event) {\n if (currentGameState === GameState.IN_GAME) {\n if (event.ctrlKey) {\n // The Trackballcontrol only works if Ctrl key isn't pressed\n scene.getCameraControls().enabled = false;\n } else {\n scene.getCameraControls().enabled = true;\n }\n }\n}", "function panToRight(){\n\tgainL.gain.value = 0;\n\tgainR.gain.value = 1;\n}", "function cameraControls(canvas) {\n var mouseIsDown = false;\n var lastPosition = {\n x: 0,\n y: 0\n };\n canvas.addEventListener(\"mousedown\", function (e) {\n mouseIsDown = true;\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n }, false);\n canvas.addEventListener(\"mousemove\", function (e) {\n if (mouseIsDown) {\n params.view.lambda += (e.clientX - lastPosition.x) / params.rotationSensitivity;\n params.view.lambda %= Math.PI * 2;\n params.view.phi += (e.clientY - lastPosition.y) / params.rotationSensitivity;\n params.view.phi %= Math.PI * 2;\n }\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n\n }, false);\n canvas.addEventListener(\"mouseup\", function () {\n mouseIsDown = false;\n }, false);\n}", "goToTheLeft() {\n this.lightBoxLeftButton.addEventListener('click', () => {\n this.switchLeft();\n });\n }", "function handleMouseDown(event) {\n mouseDown = true; // initiates camera rotation\n lastMouseX = event.clientX;\n lastMouseY = event.clientY;\n}", "goToTheRight() {\n this.lightBoxRightButton.addEventListener('click', () => {\n this.switchRight();\n });\n }", "function move_camera( event ){\n\tvar delta_x = event.clientX - previous_camera.x;\n\tvar delta_y = event.clientY - previous_camera.y;\n\n\tdirection = 1;\n\tangle_x += direction * delta_x/200;\n\tdirection = -1;\n\tangle_y += direction * delta_y/200;\n\n\t//restrict Y axis movement beyond 0 < y < 180 degrees\n\tangle_y = angle_y < 0.1 ? 0.1: angle_y;\n\tangle_y = angle_y > Math.PI-0.1 ? Math.PI-0.1: angle_y;\n\n\tvar x = 300 * Math.cos( angle_x ) * Math.sin( angle_y );\n\tvar z = 300 * Math.sin( angle_x ) * Math.sin( angle_y );\n\tvar y = 300 * Math.cos( angle_y );\n\n\tcamera.position.set( x, y, z );\n\tcamera.lookAt( board_base.position );\n}", "function onMouseDown(event) {\n if (scope.enabled === false) return; // Prevent the browser from scrolling.\n\n event.preventDefault(); // Manually set the focus since calling preventDefault above\n // prevents the browser from setting it automatically.\n\n scope.domElement.focus ? scope.domElement.focus() : window.focus();\n var mouseAction;\n\n switch (event.button) {\n case 0:\n mouseAction = scope.mouseButtons.LEFT;\n break;\n\n case 1:\n mouseAction = scope.mouseButtons.MIDDLE;\n break;\n\n case 2:\n mouseAction = scope.mouseButtons.RIGHT;\n break;\n\n default:\n mouseAction = -1;\n }\n\n switch (mouseAction) {\n case _threeModule.MOUSE.DOLLY:\n if (scope.enableZoom === false) return;\n handleMouseDownDolly(event);\n state = STATE.DOLLY;\n break;\n\n case _threeModule.MOUSE.ROTATE:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n } else {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n }\n\n break;\n\n case _threeModule.MOUSE.PAN:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n } else {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n }\n\n break;\n\n default:\n state = STATE.NONE;\n }\n\n if (state !== STATE.NONE) {\n scope.domElement.ownerDocument.addEventListener('mousemove', onMouseMove, false);\n scope.domElement.ownerDocument.addEventListener('mouseup', onMouseUp, false);\n scope.dispatchEvent(startEvent);\n }\n }", "function myMoveLeft() { //ad ogni click sulla freccia di sinistra\n scrollPosition = scrollPosition - scrollChange; //sottraggo alla posizione iniziale il valore di cambiamento settato \n carousel.scrollTo(scrollPosition, 0); //vado ad assegnare la posizione finale al contenitore sull'asse x\n}", "function AddRodMousePosi1(main){\n\t//if user not select the furniture component, return\n\tif (main.component == null){\n\t\treturn;\n\t}\n\tmain.mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n\tmain.mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n\tvar raycaster = new THREE.Raycaster();\n\traycaster.setFromCamera( main.mouse, main.camera );\n\tvar intersects = raycaster.intersectObject(main.component);\n\tif(intersects.length > 0){\n\t\tmain.intersectpoint = intersects[0];\n\t\tvar pos = intersects[0].point;\n\t\t//let the red point move to mouse position\n\t\tif(main.fixpointball==false){\n\t\t\tmain.pointball.position.set( pos.x, pos.y, pos.z );\n\t\t\t//set normal vector from local to world\n\t\t\tvar normalMatrix = new THREE.Matrix3().getNormalMatrix( main.intersectpoint.object.matrixWorld );\n\t\t\tvar normal = intersects[0].face.normal\n\t\t\tnormal = normal.clone().applyMatrix3( normalMatrix ).normalize();\n\t\t\t//rotate the point\n\t\t\tvar newDir = new THREE.Vector3().addVectors(pos, normal);\n\t\t\tmain.pointball.lookAt( newDir );\n\t\t\tmain.pointball.rotateX(90* Math.PI/180);\n\t\t\tvar radius = document.getElementById('InputRodRadius').value;\n\t\t\tif(radius == \"\")\n\t\t\t\tmain.pointball.scale.set(2.0, 1, 2.0);\n\t\t\telse\n\t\t\t\tmain.pointball.scale.set(parseFloat(radius), 1, parseFloat(radius));\n\t\t}\n\t\t//console.log(pos);\n\t}\n\telse{\n\t\t//console.log(\"miss\");\n\t}\n\t\n\n}", "mouseDown(x, y, _isLeftButton) {}", "function onKeyDown(e){\n 'use strict';\n\n switch (e.keyCode){\n case 37: //left\n Rot = - 1;\n //angle = -Math.PI/30; //sentido contrario ao dos ponteiros\n break;\n case 38: //up\n acc = -1;\n break;\n case 39: //right\n Rot = 1;\n //angle = Math.PT/30; //sentido dos ponteiros\n break;\n case 40: //down\n acc = 1;\n break;\n case 49: //1\n createCamera(50, 50, 50);\n break;\n case 50: //2\n createCamera(0, 100 ,0);\n break;\n case 51: //3\n createCamera(0, 50, 50);\n break;\n case 65: //A\n case 97: //a\n scene.traverse(function (node) {\n if (node instanceof THREE.Mesh) {\n node.material.wireframe = !node.material.wireframe;\n }\n });\n break;\n case 83: //S\n case 115: //s\n case 69: //E\n case 101: //e\n scene.traverse(function (node) {\n if (node instanceof THREE.AxisHelper) {\n node.visible = !node.visible;\n }\n });\n break;\n }\n}", "function onMouseDown(event) {\n\n if (scope.enabled === false) return;\n\n // Prevent the browser from scrolling.\n\n event.preventDefault();\n\n // Manually set the focus since calling preventDefault above\n // prevents the browser from setting it automatically.\n\n scope.domElement.focus ? scope.domElement.focus() : window.focus();\n\n switch (event.button) {\n\n case 0:\n\n switch (scope.mouseButtons.LEFT) {\n\n case MOUSE.ROTATE:\n\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n\n if (scope.enablePan === false) return;\n\n handleMouseDownPan(event);\n\n state = STATE.PAN;\n\n } else {\n\n if (scope.enableRotate === false) return;\n\n handleMouseDownRotate(event);\n\n state = STATE.ROTATE;\n\n }\n\n break;\n\n case MOUSE.PAN:\n\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n\n if (scope.enableRotate === false) return;\n\n handleMouseDownRotate(event);\n\n state = STATE.ROTATE;\n\n } else {\n\n if (scope.enablePan === false) return;\n\n handleMouseDownPan(event);\n\n state = STATE.PAN;\n\n }\n\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n\n break;\n\n\n case 1:\n\n switch (scope.mouseButtons.MIDDLE) {\n\n case MOUSE.DOLLY:\n\n if (scope.enableZoom === false) return;\n\n handleMouseDownDolly(event);\n\n state = STATE.DOLLY;\n\n break;\n\n\n default:\n\n state = STATE.NONE;\n\n }\n\n break;\n\n case 2:\n\n switch (scope.mouseButtons.RIGHT) {\n\n case MOUSE.ROTATE:\n\n if (scope.enableRotate === false) return;\n\n handleMouseDownRotate(event);\n\n state = STATE.ROTATE;\n\n break;\n\n case MOUSE.PAN:\n\n if (scope.enablePan === false) return;\n\n handleMouseDownPan(event);\n\n state = STATE.PAN;\n\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n\n break;\n\n }\n\n if (state !== STATE.NONE) {\n\n document.addEventListener('mousemove', onMouseMove, false);\n document.addEventListener('mouseup', onMouseUp, false);\n\n scope.dispatchEvent(startEvent);\n\n }\n\n }", "function moveCamera() {\n const current = document.body.getBoundingClientRect().top;\n // tours.rotation.x += current * 0.0001;\n // camera.position.x = current * 0.002;\n // camera.position.z = current * -0.04;\n // camera.position.x = current * 0.02;\n}", "make_control_panel(graphics_state)\r\n // Draw the scene's buttons, setup their actions and keyboard shortcuts, and monitor live measurement\r\n {\r\n let r = Math.PI/8.\r\n this.control_panel.innerHTML += \"Use these controls to <br> fly your rocket!<br>\";\r\n this.key_triggered_button( \"Rotate up\", [ \"w\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.rotation(r, Vec.of(1,0,0)))\r\n });\r\n this.key_triggered_button( \"Rotate left\", [ \"a\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.rotation(r, Vec.of(0,0,1)))\r\n\r\n });\r\n this.key_triggered_button( \"Rotate down\", [ \"s\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.rotation(-r, Vec.of(1,0,0)))\r\n });\r\n this.new_line();\r\n this.key_triggered_button( \"Rotate right\", [ \"d\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.rotation(-r, Vec.of(0,0,1)))\r\n });\r\n this.key_triggered_button( \"Fire Booster\", [ \"'\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.translation([0, 0.5, 0]))\r\n }); \r\n this.key_triggered_button( \"Fire Reverse Booster\", [ \"[\" ], () => {\r\n this.rocket_transform = this.rocket_transform.times(Mat4.translation([0, -0.5, 0]))\r\n }); this.key_triggered_button( \"Fire laser\", [ \";\" ], () => {\r\n //This shit don't work\r\n let laser_tf = this.rocket_transform;\r\n laser_tf = laser_tf.times(Mat4.translation([0,3,0])); //Current tip of rocket height\r\n laser_tf = laser_tf.times(Mat4.scale([1, 3, 1]));\r\n laser_tf = laser_tf.times(Mat4.translation([0,this.t,0]));\r\n this.shapes.box.draw(graphics_state, laser_tf, this.plastic.override({color: Color.of(57/255,1,20/255,1)}));\r\n });\r\n }", "function onMouseMove(event) {\n mouse = new THREE.Vector2();\n mouse.x = (event.clientX / window.innerWidth) * 2 - 1;\n mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;\n\n}", "function onDocumentMouseMove( event ) {\n event.preventDefault();\n\n mouse.x = ( event.clientX / renderer.domElement.clientWidth ) * 2 - 1;\n mouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1;\n\n raycaster.setFromCamera( mouse, camera );\n\n var intersects = raycaster.intersectObjects( [ mesh, mesh2, mesh3 ] );\n var canvas = document.body.getElementsByTagName( \"canvas\" )[0];\n\n if ( intersects.length > 0 ) {\n intersects[0].object.rotation.x += .005;\n canvas.style.cursor = \"pointer\";\n } else {\n canvas.style.cursor = \"default\";\n }\n\n }", "function initWindowEvents() {\n\n // Affects how much the camera moves when the mouse is dragged.\n var sensitivity = 1;\n\n // Additional rotation caused by an active drag.\n var newRotationMatrix;\n \n // Whether or not the mouse button is currently being held down for a drag.\n var mousePressed = false;\n \n // The place where a mouse drag was started.\n var startX, startY;\n\n canvas.onmousedown = function(e) {\n // A mouse drag started.\n mousePressed = true;\n // Check if the shift key is being pressed when the mouse is being pushed down\n if(e.shiftKey) {\n changeLight = 1; \n }\n // Remember where the mouse drag started.\n startX = e.clientX;\n startY = e.clientY;\n }\n\n canvas.onmousemove = function(e) {\n if (mousePressed) {\n // Handle a mouse drag by constructing an axis-angle rotation matrix\n var axis = vec3(e.clientY - startY, e.clientX - startX, 0.0);\n // Handles the amount to move the light when the user holds down shift\n var changeX = (e.clientX - startX)/100;\n var changeY = (e.clientY - startY)/100;\n var angle = length(axis) * sensitivity;\n if (angle > 0.0) {\n if(changeLight) // Check if shift was pressed when the mouse was clicked\n {\n if(e.shiftKey) // Check if the shift key is still pressed\n {\n lightPosition = add(lightPosition,vec4(changeX, changeY, 0, 0));\n // Bounds on the light movement. After +- 100 the difference is irrelavant\n if(lightPosition[0] > 100)\n {\n lightPosition[0] = 100;\n }\n if(lightPosition[0] < -100)\n {\n lightPosition[0] = -100;\n }\n if(lightPosition[1] > 100)\n {\n lightPosition[1] = 100;\n }\n if(lightPosition[1] < -100)\n {\n lightPosition[1] = -100;\n }\n updateLights();\n render();\n }\n \n }\n else // The shift key is not pressed so rotate the camera\n {\n // Update the temporary rotation matrix\n newRotationMatrix = mult(rotate(angle, axis), rotationMatrix);\n // Update the model-view matrix.\n updateModelView(mult(viewMatrix, newRotationMatrix));\n }\n }\n }\n }\n\n window.onmouseup = function(e) {\n // A mouse drag ended.\n mousePressed = false;\n if (newRotationMatrix) {\n // \"Lock\" the temporary rotation as the current rotation matrix.\n rotationMatrix = newRotationMatrix;\n }\n newRotationMatrix = null;\n }\n \n var speed = 0.1; // Affects how fast the camera pans and \"zooms\"\n window.onkeydown = function(e) {\n if (e.keyCode === 190) { // '>' key\n // \"Zoom\" in\n viewMatrix = mult(translate(0,0,speed), viewMatrix);\n }\n else if (e.keyCode === 188) { // '<' key\n // \"Zoom\" out\n viewMatrix = mult(translate(0,0,-speed), viewMatrix);\n }\n else if (e.keyCode === 37) { // Left key\n // Pan left\n viewMatrix = mult(translate(speed,0,0), viewMatrix);\n // Prevent the page from scrolling, which is the default behavior for the arrow keys\n e.preventDefault(); \n }\n else if (e.keyCode === 38) { // Up key\n // Pan up\n viewMatrix = mult(translate(0,-speed,0), viewMatrix);\n // Prevent the page from scrolling, which is the default behavior for the arrow keys\n e.preventDefault();\n }\n else if (e.keyCode === 39) { // Right key\n // Pan right\n viewMatrix = mult(translate(-speed,0,0), viewMatrix);\n // Prevent the page from scrolling, which is the default behavior for the arrow keys\n e.preventDefault();\n }\n else if (e.keyCode === 40) { // Down key\n // Pan down \n viewMatrix = mult(translate(0,speed,0), viewMatrix);\n // Prevent the page from scrolling, which is the default behavior for the arrow keys\n e.preventDefault();\n }\n else if (e.keyCode === 87) { // move light up\n // Pan down \n lightPosition = add(lightPosition,vec4(0, 0.5, 0, 0));\n updateLights();\n render();\n } \n else if (e.keyCode === 83) { // move light down\n // Pan down \n lightPosition = add(lightPosition,vec4(0, -0.5, 0, 0));\n updateLights();\n render();\n }\n else if (e.keyCode === 65) { // move light left\n // Pan down \n lightPosition = add(lightPosition,vec4(0.5, 0, 0, 0));\n updateLights();\n render();\n }\n else if (e.keyCode === 68) { // move light right\n // Pan down \n lightPosition = add(lightPosition,vec4(-0.5, 0, 0, 0));\n updateLights();\n render();\n }\n // Update the model-view matrix and render.\n updateModelView(mult(viewMatrix, rotationMatrix));\n continueRender = 1;\n render();\n }\n\n window.onkeyup = function(e) {\n if(e.keyCode === 16)\n {\n changeLight = 0;\n }\n }\n}", "_onRightClick() {\n this.move({\n x: -this.tabListScrollEl.clientWidth,\n force: true\n });\n this.stop({\n type: 'force'\n });\n }", "function leerMouse(){\n\n//--- Rueda del Mouse ---------------\nif(Math.abs(deltaRueda) > 0){\n\tvar kd = 0.05;\t\t\t\t//constante de ajuste\n\tvar x = camara.position.x;\n\tvar y = camara.position.y;\n\tvar z = camara.position.z;\n\tvar d0 = Math.sqrt(x*x + y*y + z*z);\t\t//Distancia inicial\n\tvar d1 = d0 + (deltaRueda * kd);\t\t\t\t//Nueva distancia\n\tvar fact = d1 / d0;\t\t\t\t\t\t\t\t//porcentaje de ajuste a cada eje\n\tcamara.position\t.x = x * fact;\n\tcamara.position\t.y = y * fact;\n\tcamara.position\t.z = z * fact;\n}\ndeltaRueda\t= 0;\n}", "function MouseEvent(event)\n{\n // Never show mouse cursor, if avatar camera is active and in first-person mode.\n var avatarCameraActiveInFps = false;\n var userAvatar = FindUserAvatar();\n var scene = framework.Scene().MainCameraScene();\n if (userAvatar && scene)\n {\n var avatarCamera = scene.EntityByName(\"AvatarCamera\");\n if (avatarCamera && avatarCamera.camera)\n avatarCameraActiveInFps = avatarCamera.camera.IsActive() && userAvatar.dynamicComponent.Attribute(\"cameraDistance\") < 0;\n }\n\n if (event.eventType == MouseEvent.MousePressed && event.button == MouseEvent.RightButton &&\n input.IsMouseCursorVisible())\n {\n input.SetMouseCursorVisible(false);\n }\n else if (event.eventType == MouseEvent.MouseReleased && event.button == MouseEvent.RightButton &&\n !input.IsMouseCursorVisible() && !avatarCameraActiveInFps)\n {\n input.SetMouseCursorVisible(true);\n }\n}", "function transition() {\r\n\r\n controls = new THREE.PointerLockControls(camera);\r\n controls.enabled = true;\r\n controls.getObject().position.y = 1000;\r\n scene.add(controls.getObject());\r\n\r\n var onKeyDown = function (event) {\r\n\r\n switch (event.keyCode) {\r\n case 87: // w\r\n moveForwardButton = true;\r\n break;\r\n case 83: // s\r\n moveBackwardButton = true;\r\n break;\r\n\r\n\r\n }\r\n\r\n };\r\n\r\n var onKeyUp = function (event) {\r\n\r\n switch(event.keyCode) {\r\n\r\n case 87: // w\r\n moveForwardButton = false;\r\n break;\r\n case 83: // s\r\n moveBackwardButton = false;\r\n break;\r\n\r\n\r\n }\r\n\r\n };\r\n\r\n document.addEventListener('keydown', onKeyDown, false);\r\n document.addEventListener('keyup', onKeyUp, false);\r\n}", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function onMouseDown(event3D) {\n var event = event3D.domEvent;\n event.preventDefault();\n\n switch (event.button) {\n case 0:\n state = STATE.ROTATE;\n rotateStart.set(event.clientX, event.clientY);\n break;\n case 1:\n state = STATE.MOVE;\n\n moveStartNormal = new THREE$1.Vector3(0, 0, 1);\n var rMat = new THREE$1.Matrix4().extractRotation(this.camera.matrix);\n moveStartNormal.applyMatrix4(rMat);\n\n moveStartCenter = that.center.clone();\n moveStartPosition = that.camera.position.clone();\n moveStartIntersection = intersectViewPlane(event3D.mouseRay,\n moveStartCenter,\n moveStartNormal);\n break;\n case 2:\n state = STATE.ZOOM;\n zoomStart.set(event.clientX, event.clientY);\n break;\n }\n\n this.showAxes();\n }", "function onMouseDown(e) {\r\n e.preventDefault();\r\n\r\n let [startX, startY] = [e.offsetX, e.offsetY];\r\n let start_rotation = rotation.slice();\r\n function onMouseMove(e2) {\r\n let x_rotation = (e2.offsetX - startX) / (this.width - 1) * 360;\r\n let y_rotation = (e2.offsetY - startY) / (this.height - 1) * 360;\r\n rotation[0] = start_rotation[0] + y_rotation;\r\n rotation[1] = start_rotation[1] + x_rotation;\r\n updateModelViewMatrix();\r\n }\r\n function onMouseUp() {\r\n this.removeEventListener('mousemove', onMouseMove);\r\n this.removeEventListener('mouseup', onMouseUp);\r\n }\r\n if (e.button === 0) {\r\n this.addEventListener('mousemove', onMouseMove);\r\n this.addEventListener('mouseup', onMouseUp);\r\n }\r\n}", "function onBtnRightClick() {\n console.log('click');\n cityIndex += 1; \n\n if (cityIndex > 2) {\n cityIndex = 0;\n }\n setAstronaut();\n setCityPos();\n changeCity();\n}", "function keyPressed() {\n if (keyCode === LEFT_ARROW) {\n mouseX -= 60;\n } else if (keyCode === RIGHT_ARROW) {\n mouseX += 60;\n }\n}", "function onMouseDown(event) {\n if (currentGameState === GameState.IN_GAME) {\n if (event.ctrlKey) {\n // The Trackballcontrol only works if Ctrl key is pressed\n scene.getCameraControls().enabled = true;\n } else {\n scene.getCameraControls().enabled = false;\n }\n }\n}", "goLeft() {\n gpio.write(this.motors.rightFront, true);\n }", "function moveCamera() {\n\n //where the user is currently scrolled to\n const t = document.body.getBoundingClientRect().top;\n\n moon.rotation.x += 0.05;\n moon.rotation.y += 0.075;\n moon.rotation.z += 0.05;\n\n ritam.rotation.z += 0.01\n ritam.rotation.y += 0.01 \n\n //changing the position of the actual camera\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.position.y = t * -0.0002;\n}", "function left2right() {\n if (_viewerLeft && _viewerRight && !_updatingRight) {\n _updatingLeft = true;\n transferCameras(true);\n setTimeout(function() { _updatingLeft = false; }, 500);\n }\n}", "update() {\n let mouse = createVector(mouseX - width / 2, mouseY - height / 2);\n mouse.setMag(this.mag);\n this.vel.lerp(mouse, this.velLerp);\n this.pos.add(this.vel);\n\n if (\n //boundaries of the map for movement\n this.pos.x <= MAP_WIDTH - this.r &&\n this.pos.x >= 0 + this.r &&\n this.pos.y > 0 + this.r &&\n this.pos.y < MAP_HEIGHT - this.r\n ) {\n mouse.setMag(this.mag);\n this.vel.lerp(mouse, this.velLerp);\n this.pos.add(this.vel);\n } else {\n mode = 2;\n }\n }", "function controls ()\n {\n function determineCollision(rayMaster, scene, camera, axis, operation) {\n // Cast a ray from the camera position in the direction of the intended movement, and check for any collision\n var origin = camera.position.clone(),\n environment = scene.children,\n ray = rayMaster,\n distance = null, // Vector for ray\n destination = camera.position.clone(); // The future position\n if (axis === \"x\") {\n if (operation === \"+\") {\n destination.setX( destination.x + 1 );\n } else {\n destination.setX( destination.x - 1 );\n }\n } else if (axis === \"y\") {\n if (operation === \"+\") {\n destination.setY( destination.y + 1 );\n } else {\n destination.setY( destination.y - 1 );\n }\n } else {\n if (operation === \"+\") {\n destination.setZ( destination.z + 1 );\n } else {\n destination.setZ( destination.z - 1 );\n }\n }\n console.log(`\n Origin z: ${origin.z},\n Destination z: ${destination.z}\n `);\n // Raycast from camera to camera target\n let directionVector = destination.sub( origin );\n rayMaster.set( origin, directionVector.clone().normalize() );\n scene.updateMatrixWorld();\n // calculate objects intersecting the picking ray\n var intersects = rayMaster.intersectObjects( scene.children, true );\n // Distance holder\n var distance = 15;\n var collisionDetected = false;\n if (intersects.length > 0) {\n distance = intersects[0].distance;\n console.log(distance);\n }\n if (Math.round(distance) <= 1) {\n collisionDetected = true;\n }\n return collisionDetected;\n }\n // Keyboard control function\n window.onkeyup = function(e) {\n // Read key\n let key = e.keyCode ? e.keyCode : e.which;\n // Get camera target\n let targetPositionZ = cameraTarget.z;\n let targetPositionX = cameraTarget.x;\n let cameraPositionZ = camera.position.z;\n let cameraPositionX = camera.position.x;\n var cameraDirection = '';\n // Figure out where the camera is pointing\n if (targetPositionZ > cameraPositionZ) {\n cameraDirection = \"behind\";\n } else if (targetPositionZ < cameraPositionZ) {\n cameraDirection = \"ahead\";\n } else {\n cameraDirection = \"side\";\n }\n // Keyboard actions\n switch (key) {\n case 16:\n // Load geometries for reference\n const doorA = retrieveFromScene(\"first door\");\n if ( (cameraPositionZ < doorA.position.z + 4) && ( cameraPositionZ > doorA.position.z - 4) ){\n // Only open door if it is closed\n if (isDoorClosed) {\n doorA.position.y += 4;\n createMaze();\n isDoorClosed = false;\n }\n }\n break;\n case 40:\n var collisionDetected = determineCollision(raycaster, scene, camera, \"y\", \"-\");\n if (!collisionDetected){\n camera.position.y -= 1;\n cameraTarget.y -= 1;\n }\n break;\n case 38:\n var collisionDetected = determineCollision(raycaster, scene, camera, \"y\", \"+\");\n if (!collisionDetected){\n camera.position.y += 1;\n cameraTarget.y += 1;\n }\n break;\n case 37:\n // Left arrow\n if (cameraDirection === \"ahead\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"-\");\n if (!collisionDetected){\n camera.position.x -= 1;\n cameraTarget.x -= 1;\n }\n } else if (cameraDirection === \"behind\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"+\");\n if (!collisionDetected){\n camera.position.x += 1;\n cameraTarget.x += 1;\n }\n } else {\n if (targetPositionX > cameraPositionX){\n // Looking x pos\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"-\");\n if (!collisionDetected){\n camera.position.z -= 1;\n cameraTarget.z -= 1;\n }\n } else {\n // Looking x neg\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"+\");\n if (!collisionDetected){\n camera.position.z += 1;\n cameraTarget.z += 1;\n }\n }\n }\n break;\n case 39:\n // Right arrow\n if (cameraDirection === \"ahead\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"+\");\n if (!collisionDetected){\n camera.position.x += 1;\n cameraTarget.x += 1;\n }\n } else if (cameraDirection === \"behind\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"-\");\n if (!collisionDetected){\n camera.position.x -= 1;\n cameraTarget.x -= 1;\n }\n } else {\n if (targetPositionX > cameraPositionX){\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"+\");\n if (!collisionDetected){\n // Looking x pos\n camera.position.z += 1;\n cameraTarget.z += 1;\n }\n } else {\n // Looking x neg\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"-\");\n if (!collisionDetected){\n camera.position.z -= 1;\n cameraTarget.z -= 1;\n }\n }\n }\n break;\n case 65:\n // A key (nominally \"forward\")\n if (cameraDirection === \"ahead\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"-\");\n if (!collisionDetected){\n camera.position.z -= 1;\n cameraTarget.z -= 1;\n }\n } else if (cameraDirection === \"behind\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"+\");\n if (!collisionDetected){\n camera.position.z += 1;\n cameraTarget.z += 1;\n }\n } else {\n if (targetPositionX > cameraPositionX){\n // Looking x pos\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"+\");\n if (!collisionDetected){\n camera.position.x += 1;\n cameraTarget.x += 1;\n }\n } else {\n // Looking x neg\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"-\");\n if (!collisionDetected){\n camera.position.x -= 1;\n cameraTarget.x -= 1;\n }\n }\n }\n break;\n case 90:\n // Z key (nominally \"reverse\")\n if (cameraDirection === \"ahead\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"+\");\n if (!collisionDetected){\n camera.position.z += 1;\n cameraTarget.z += 1;\n }\n } else if (cameraDirection === \"behind\") {\n var collisionDetected = determineCollision(raycaster, scene, camera, \"z\", \"-\");\n if (!collisionDetected){\n camera.position.z -= 1;\n cameraTarget.z -= 1;\n }\n } else {\n if (targetPositionX > cameraPositionX){\n // Looking x pos\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"-\");\n if (!collisionDetected){\n camera.position.x -= 1;\n cameraTarget.x -= 1;\n }\n } else {\n // Looking x neg\n var collisionDetected = determineCollision(raycaster, scene, camera, \"x\", \"+\");\n if (!collisionDetected){\n camera.position.x += 1;\n cameraTarget.x += 1;\n }\n }\n }\n break;\n case 81:\n // Rotate camera counterclockwise 90 degrees (Q)\n console.log(\"Counterclockwise\");\n if (cameraDirection === \"ahead\") {\n cameraTarget.z = cameraPositionZ;\n cameraTarget.x = cameraPositionX - 1;\n } else if (cameraDirection === \"behind\") {\n cameraTarget.z = cameraPositionZ;\n cameraTarget.x = cameraPositionX + 1;\n } else {\n if (targetPositionX > cameraPositionX){\n // Looking x pos\n cameraTarget.z = cameraPositionZ - 1;\n cameraTarget.x = cameraPositionX;\n } else {\n // Looking x neg\n cameraTarget.z = cameraPositionZ + 1;\n cameraTarget.x = cameraPositionX;\n }\n }\n break;\n case 87:\n // Rotate camera clockwise 90 degrees (W)\n console.log(\"Clockwise\");\n if (cameraDirection === \"ahead\") {\n cameraTarget.z = cameraPositionZ;\n cameraTarget.x = cameraPositionX + 1;\n } else if (cameraDirection === \"behind\") {\n cameraTarget.z = cameraPositionZ;\n cameraTarget.x = cameraPositionX - 1;\n } else {\n if (targetPositionX > cameraPositionX){\n // Looking right\n cameraTarget.z = cameraPositionZ + 1;\n cameraTarget.x = cameraPositionX;\n } else {\n // Looking left\n cameraTarget.z = cameraPositionZ - 1;\n cameraTarget.x = cameraPositionX;\n }\n }\n break;\n case 219:\n // Left bracket\n var maze = retrieveFromScene(\"maze\");\n if (maze !== undefined){\n maze.rotateY(0.5 * Math.PI);\n }\n break;\n case 221:\n // Right bracket\n var maze = retrieveFromScene(\"maze\");\n if (maze !== undefined){\n maze.rotateY(-0.5 * Math.PI);\n }\n break;\n default:\n console.log(`key code is :${key}`);\n break;\n }\n camera.lookAt(cameraTarget);\n // Move the light to the new camera position\n light.position.x = camera.position.x;\n light.position.y = camera.position.y;\n light.position.z = camera.position.z;\n }\n }", "function mouseButtonDown(x, y) {\r\n // change FoV by -1 or +1 depending on\r\n // which direction the mouse scrolls in\r\n var fovDist = 1.2;\r\n var quad = getQuad(x, y);\r\n // Prevent from calculating distance \r\n // When we already locked in the mouse\r\n if (mouseUp == true && quad != 1) {\r\n vec1 = returnVec(x, y, quad);\r\n mouseUp = false;\r\n }\r\n // Whenever the mouseButtonDown method is executed,\r\n // This statement will be true.\r\n mouseDown = true;\r\n if (mouseDown) {\r\n if (quad != 1) {\r\n computeOrigin(x, y, quad, vec1);\r\n } else {\r\n if (y > currentPosition) {\r\n fovY += fovDist;\r\n if (fovY > 90) {\r\n fovY = 90;\r\n }\r\n } else {\r\n fovY -= fovDist;\r\n if (fovY < 20) {\r\n fovY = 20;\r\n }\r\n }\r\n currentPosition = y;\r\n }\r\n }\r\n}", "function moveLeft() {\n robotLeft -= 10;\n robot.style.left = robotLeft + \"px\";\n }", "clickHandler(event) {\n let p = this.mouse.add(this.cartography._view);\n if (event.shiftKey) {\n this.state.player.data.input.fire = new Vector(p);\n } else {\n this.state.cursor.data.position.set(p);\n this.state.player.data.destination.set(p);\n }\n }", "function moveCamera(scroll){\r\n if(!orthoProj){\r\n if(scroll > 0){\r\n eyeZ-=1;\r\n }else{\r\n eyeZ+=1;\r\n }\r\n gl = main();\r\n drawObjects();\r\n }\r\n \r\n return false;\r\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function controls(){\n\tdocument.addEventListener(\"keydown\", onDocumentKeyDown, false);\n\tfunction onDocumentKeyDown(event) {\n\t var keyCode = event.which;\n\t \n\t if (keyCode == 40 && animating == false) {//down\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 37 && animating == false) {//left\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 38 && animating == false) {//up\n\t \tif(playerToMirrorPOV == true)\n \t\t{\n \t\t\tresetToPlayerPOV();\n \t\t}else{\n \t\t\tresetToMirrorPOV();\n \t\t}\n\t } else if (keyCode == 39 && animating == false) {//right\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 86) { //\"v\"\n\t \t//Top down view of the area\n\t \tif(animating == false){\n\t \t\tif(topDownPOV == true)\n\t \t\t{\n\t \t\t\tresetToPlayerPOV();\n\t \t\t}else{\n\t \t\t\tresetToTopDownPOV();\n\t \t\t}\n\t \t}\n\t } else if (keyCode == 32 && animating == false) { // spacebar\n\t \t//move player\n\t \tresetToPlayerPOV();\n\t \tdeterminePlayerMovement();\n\t }else if (keyCode == 81 && animating == false){ // q\n\t \t//cheat\n\t \tcurrentLevel++;\n\t\t\tif(currentLevel >= MAXLEVEL)\n\t\t\t{\n\t\t\t\tclearMap();\n\t\t\t\talert(\"Congratulations, you are officially rich (Not in your real dimension)\");\n\t\t\t}else{\n\t\t\t\tclearMap();\n\t\t\t\tgenerateMapLevel(currentLevel);\n\t\t\t\tcreateLevel(currentLevel);\n\t\t\t}\n\t }else if (keyCode == 68 && animating == false){ //d = drill\n\t \t//drill\n\t \tattemptDrill();\n\t }else if (keyCode == 82 && animating == false){ // r\n\t \t//reset level\n\t \talert(\"Another pay day has been lost\")\n\t\t\tclearMap();\n\t\t\tgenerateMapLevel(currentLevel);\n\t\t\tcreateLevel(currentLevel);\n\t }else if (keyCode == 8 && welcomePageUp == true){ // backspace\n\t \tscene.remove(welcomeObject);\n\t \twelcomeObject = null;\n\t \twelcomePageUp = false;\n\t }\n\t};\n}", "function onMoveLeft(evt){\n\t\t\troote.box.x -=20;\n\t\t}", "function mouseActionLocal(angleXY) {\n encoder.azim = angleXY[0];\n encoder.elev = angleXY[1];\n encoder.updateGains();\n}", "function mouseActionLocal(angleXY) {\n encoder.azim = angleXY[0];\n encoder.elev = angleXY[1];\n encoder.updateGains();\n}", "function mouse_button_callback(window, button, action, mods) {\n if (button == glfw.GLFW_MOUSE_BUTTON_LEFT) {\n if (action == glfw.GLFW_PRESS) {\n document.dispatchMouseEventLeftDown();\n } else if (action == glfw.GLFW_RELEASE) {\n document.dispatchMouseEventLeftUp();\n }\n }\n }", "function panToLeft(){\n\tgainL.gain.value = 1;\n\tgainR.gain.value = 0;\n}", "left() {\n // If the LEFT key is down, set the player velocity to move left\n this.sprite.body.velocity.x = -this.RUN_SPEED;\n //this.animate_walk();\n }", "function rightClickAction () {\r\n\r\n\t\tif (flag === 0) {\r\n\t\t\tclearInterval(refreshIntervalId);\t\t\t\t\t// --> Clears the accumulated time from refreshInterval Id\r\n\t\t\tCSSRightAdjustment ();\r\n\t\t\tclickCountSum (\"right\");\r\n\t\t\tmaxClicksCalc();\r\n\t\t\tmoveCarouselAbs(\"right\");\r\n\t\t\tinitPosRight ();\r\n\t\t\tcarouselDirection(direction, timeCounter);\t // --> Creates a new time set Interval\r\n\t\t}\r\n\r\n\t}", "function mousePressed() {\n camminatore.push(new Walker(mouseX, mouseY));\n}", "function scrollDisplayLeft() {\n command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);\n}", "function init() {\n\n container = document.createElement( 'div' );\n document.body.appendChild( container );\n\n camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );\n\n scene = new THREE.Scene();\n\n // controls\n controls = new PointerLockControls(camera);\n\n // change the starting position of the camera/controls\n goToAndLookAt(controls, new WorldAndScenePoint(0, 0, 0, false));\n\n scene.add(controls.getObject());\n\n // raycaster\n raycaster = new THREE.Raycaster();\n\n // cubes\n\n cubeGeo = new THREE.BoxGeometry( voxelSideLength, voxelSideLength, voxelSideLength );\n cubeMat = new THREE.MeshLambertMaterial({color: 0xfeb74c});\n\n rollOverGeo = new THREE.BoxGeometry( voxelSideLength, voxelSideLength, voxelSideLength );\n rollOverMaterial = new THREE.MeshBasicMaterial({ color: 0x0000ff, opacity: 0.5, transparent: true });\n\trollOverMesh = new THREE.Mesh(rollOverGeo, rollOverMaterial);\n prevRollOverMeshPos = rollOverMesh.position.clone();\n\tscene.add(rollOverMesh);\n\n // Lights\n\n var ambientLight = new THREE.AmbientLight( 0x606060 );\n scene.add( ambientLight );\n\n var directionalLight = new THREE.DirectionalLight( 0xffffff );\n directionalLight.position.set( 1, 0.75, 0.5 ).normalize();\n scene.add( directionalLight );\n\n renderer = new THREE.WebGLRenderer( { antialias: true } );\n renderer.setClearColor( 0xf0f0f0 );\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize( window.innerWidth, window.innerHeight );\n container.appendChild( renderer.domElement );\n\n window.addEventListener( 'resize', onWindowResize, false );\n\n document.addEventListener('keydown', (e)=>{\n const questionMarkCode = 191;\n const escCode = 27;\n if (e.altKey || e.ctrlKey) {e.preventDefault(); altOrCtrlKeyPressed = true;}\n else if (e.keyCode == questionMarkCode && e.shiftKey) {e.preventDefault(); $('#controlsDisplay').modal('toggle');}\n // electron doesn't make esc cancel pointerlock like most browsers do by default\n else if (e.keyCode == escCode) {e.preventDefault(); document.exitPointerLock();}\n });\n\n document.addEventListener('keyup', (e)=>{\n if (!(e.altKey || e.ctrlKey)) {altOrCtrlKeyPressed = false;}\n });\n\n // stop key events triggering inside text fields\n Array.from(document.querySelectorAll('input[type=text]')).map((elem)=>{\n elem.addEventListener('keydown', (e)=>{e.stopPropagation();});\n });\n\n selectedRobotMaterial = new THREE.MeshLambertMaterial({ color: 0xff9999, opacity: 0.9, transparent: true });\n\tselectedRobotMesh = new THREE.Mesh(cubeGeo, selectedRobotMaterial);\n scene.add(selectedRobotMesh);\n robotMaterial = new THREE.MeshLambertMaterial({color:0xffcccc});\n\n hardnessToColorMap = {\n // bedrock\n '-1': new THREE.MeshLambertMaterial({color:0x000000}),\n // leaves\n 0.2: new THREE.MeshLambertMaterial({color:0x00cc00}),\n // glowstone\n 0.3: new THREE.MeshLambertMaterial({color:0xffcc00}),\n // netherrack\n 0.4: new THREE.MeshLambertMaterial({color:0x800000}),\n // dirt or sand\n 0.5: new THREE.MeshLambertMaterial({color:0xffc140}),\n // grass block\n 0.6: new THREE.MeshLambertMaterial({color:0xddc100}),\n // sandstone\n 0.8: new THREE.MeshLambertMaterial({color:0xffff99}),\n // pumpkins or melons\n 1.0: new THREE.MeshLambertMaterial({color:0xfdca00}),\n // smooth stone\n 1.5: new THREE.MeshLambertMaterial({color:0xcfcfcf}),\n // cobblestone\n 2.0: new THREE.MeshLambertMaterial({color:0x959595}),\n // ores\n 3.0: new THREE.MeshLambertMaterial({color:0x66ffff}),\n // cobwebs\n 4.0: new THREE.MeshLambertMaterial({color:0xf5f5f5}),\n // ore blocks\n 5.0: new THREE.MeshLambertMaterial({color:0xc60000}),\n // obsidian\n 50: new THREE.MeshLambertMaterial({color:0x1f1f1f}),\n // water or lava\n 100: new THREE.MeshLambertMaterial({color:0x9900cc})\n };\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n\n}", "function move(x, y) {\n let dirX = camera.directionX;\n let dirY = camera.directionY;\n\n // Allow only movement on the XY plane, and scale to MOVE_SPEED.\n vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED);\n vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED);\n\n camera.move(right);\n camera.move(up);\n\n // And also move the camera target to update the orbit.\n vec3.add(cameraTarget, cameraTarget, right);\n vec3.add(cameraTarget, cameraTarget, up);\n }", "function mouseControls ( camera, minDist, maxDist ){\n \n // **** Mouse controls *********************\n // Setting controls for the trackball camera\n \n if ( isTouchDevice () ){\n controls = new THREE.TrackballControlsTouch( camera, renderer.domElement );\n }else{\n controls = new THREE.TrackballControls( camera, renderer.domElement );\n }\n controls.zoomSpeed = 0.3;\n controls.rotateSpeed = 0.1;\n controls.minDistance = minDist;\n controls.maxDistance = maxDist;\n \n // funciton to get the mouse position for the hover efect onthe pies\n $(document).mousemove(function(event) {\n\n event.preventDefault();\n\n mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n\n });\n\n // function to adjust the size of the canvas when resizing the window\n $(window).resize(function() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n });\n \n return controls;\n \n}", "function controlscene(){\n const t=document.body.getBoundingClientRect().top*0.0012;\n\n camera.position.x = 150* Math.cos(t);\n camera.position.z = 150* Math.sin(t); \n camera.position.y = t*140+600; \n //camera.target.position.copy( gltf.scene )\n var position = new THREE.Vector3(0,25,0);\n camera.lookAt( position );\n}", "_onLeftClick() {\n this.move({\n x: this.tabListScrollEl.clientWidth,\n force: true\n });\n this.stop({\n type: 'force'\n });\n }", "function mouseDown(x, y, button) {\r\n\tif (button == 0 || button == 2) {\t// If the user clicks the right or left mouse button...\r\n\t\tmouseClick = true;\r\n\t}\r\n\t//*** Your Code Here\r\n}", "moveLeft() { this.velX -= 0.55; this.dirX = -1; }", "function onKeyDown(keydown){\r\n\tkeydown = keydown || window.event;\r\n\t\r\n\tif(keydown.keyCode == '81'){//q; turns the doors\r\n\t\tdoorObj.rotation.y += Math.PI / 10;\r\n\t\trenderScene();\r\n\t}\r\n\tif(keydown.keyCode == '80'){//p; turns the walls\r\n\t\twallObj.rotation.y += Math.PI / 10;\r\n\t\trenderScene();\r\n\t}\r\n\tif(keydown.keyCode == '82'){//r; resets the wall and turnstile\r\n\t\twallObj.rotation.y = 0;\r\n\t\tdoorObj.rotation.y = 0;\r\n\t\trenderScene();\r\n\t}\r\n\tif(keydown.keyCode == '96'){//0; resets the camera\r\n\t\tnewCamera = new THREE.OrthographicCamera(-aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t viewLength/2, -viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t -1000, 1000);\r\n\t\tcamera = newCamera;\r\n\t\tcamera.position.set(300, 300, 300);\r\n\t\tcamera.lookAt(scene.position);\r\n\t\trenderScene();\r\n\t}\r\n\tif(keydown.keyCode == '97'){//1; moves the camera to the upper right corner\r\n\t\tnewCamera = new THREE.OrthographicCamera(-aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t viewLength/2, -viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t -1000, 1000);\r\n\t\tcamera = newCamera;\r\n\t\tcamera.position.set(300, 300, -300);\r\n\t\tcamera.lookAt(scene.position);\r\n\t\trenderScene();\r\n\r\n\t}\r\n\tif(keydown.keyCode == '98'){//2; moves the camera front and center\r\n\t\tnewCamera = new THREE.OrthographicCamera(-aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t viewLength/2, -viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t -1000, 1000);\r\n\t\tcamera = newCamera;\r\n\t\tcamera.position.set(0, 0, 300);\r\n\t\tcamera.lookAt(scene.position);\r\n\t\trenderScene();\r\n\t}\r\n}", "function appPanLeft() {\r\n DRAWAPP.pic.panLeft();\r\n reHighlight();\r\n }", "function control(e) {\n\t\tif (e.keyCode === 38) {\n\t\t\tjump();\n\t\t} else if (e.keyCode === 37) {\n\t\t\tslideLeft();\n\t\t} else if (e.keyCode === 39) {\n\t\t\tslideRight();\n\t\t}\n\t}", "function onDocumentMouseWheel(event) {\n \n\n if (event.deltaY < 0) { \n camera.zoom *= 1.25;\n };\n \n if (event.deltaY > 0) { \n if (camera.zoom > 0.1)\n camera.zoom /= 1.25;\n };\n camera.updateProjectionMatrix();\n\n}", "function camera(event) {\n if (Date.now() - lastUpdate > mspf) {\n const deltaX = (event.clientX - prevX) / c.width;\n const deltaY = (event.clientY - prevY) / c.height;\n\n cameraX += -1 * deltaX * 180;\n cameraY += deltaY * 180;\n\n prevX = event.clientX;\n prevY = event.clientY;\n\n requestAnimFrame(render);\n lastUpdate = Date.now();\n }\n}", "function down(event){//a key is released\r\n var cam = scn.getCamera();\r\n if(event.shiftKey) {\r\n switch(event.keyCode) {//determine the key pressed\r\n case 65://a key\r\n cam.setAngularVel([0,0,-0.001]);//roll the camera left\r\n break;\r\n case 37://left arrow\r\n cam.setAngularVel([0,0.001,0]);//yaw left\r\n break;\r\n case 68://d key\r\n cam.setAngularVel([0,0,0.001]);//roll the camera right\r\n break;\r\n case 39://right arrow\r\n cam.setAngularVel([0,-0.001,0]);//yaw right\r\n break;\r\n case 83://s key\r\n case 40://down arrow\r\n cam.setAngularVel([0.001,0,0]);//pitch down\r\n break;\r\n case 87://w key\r\n case 38://up arrow\r\n cam.setAngularVel([-0.001,0,0]);//pitch up\r\n break;\r\n }\r\n }\r\n else {\r\n var mov = [0,0,0];\r\n switch(event.keyCode) {//deterime the key pressed\r\n case 65://a key\r\n case 37://left arrow\r\n mov = c3dl.multiplyVector(cam.getLeft(),0.1,mov);\r\n break;\r\n case 68://d key\r\n case 39://right arrow\r\n mov = c3dl.multiplyVector(cam.getLeft(),-0.1,mov);\r\n break;\r\n case 83://s key\r\n mov = c3dl.multiplyVector(cam.getUp(),-0.1,mov);//move the camera down\r\n break;\r\n case 40://down arrow\r\n mov = c3dl.multiplyVector(cam.getDir(),-0.1,mov); //move the camera 'back' (towards the user)\r\n break;\r\n case 87://w key\r\n mov = c3dl.multiplyVector(cam.getUp(),0.1,mov); //move the camera up\r\n break;\r\n case 38://up arrow\r\n mov = c3dl.multiplyVector(cam.getDir(),0.1,mov);//move the camera 'forward' (into the scene)\r\n break;\r\n case 16://shift key, stop linear movement\r\n cam.setLinearVel([0,0,0]);\r\n break;\r\n }\r\n cam.setLinearVel(mov);\r\n }\r\n}", "function LateUpdate () {\n\t\n\tcameraRot.x += mouseY * camSpeed;\n\t\n\tcameraRot.x = Mathf.Clamp(cameraRot.x,minAngle, maxAngle);\t\n\t\n\tthisTransform.localEulerAngles = cameraRot;\n\n}", "function moveCube(e){\n //getting mouse coordinates\n let x = e.clientX,\n y = e.clientY;\n\n //mapping mouse coordinates to an angle in degrees\n function convertRange( value, r1, r2 ) {\n return ( value - r1[ 0 ] ) * ( r2[ 1 ] - r2[ 0 ] ) / ( r1[ 1 ] - r1[ 0 ] ) + r2[ 0 ];\n }\n\n currentRotateY = Math.round(convertRange(x, [0, window.innerWidth], [-180, 180])),\n currentRotateX = Math.round(convertRange(y, [0, window.innerHeight], [180, -180]));\n\n //only appliy rotation if mouse is pressed\n if(moveEnabled){\n cube.style.transform = `rotateY(${currentRotateY}DEG) rotateX(${currentRotateX}DEG)`;\n\n // document.querySelector('#debug').innerHTML = `currentRotateX : ${currentRotateX},currentRotateY : ${currentRotateY}`;\n\n // Sides content toggling\n if (currentRotateX > -30 && currentRotateX <30 && currentRotateY > -30 && currentRotateY <30){\n // animateNav(document.querySelector('#front-btn'));\n toggleContent('#front');\n setColors(['#4286f4', '#1b4b99', 'rgba(27, 75, 153,0.85)' ]);\n }\n if (currentRotateX > -20 && currentRotateX <20 && (currentRotateY > 150 && currentRotateY <210 ||\n currentRotateY < -150 && currentRotateY >-210 )){\n animateNav(document.querySelector('#back-btn'));\n toggleContent('#back');\n setColors(['#f48c41', '#a55113', 'rgba(165, 81, 19,0.85)' ]);\n }\n if (currentRotateX > -20 && currentRotateX <20 && currentRotateY > 60 && currentRotateY <120){\n // animateNav(document.querySelector('#left-btn'));\n toggleContent('#left');\n setColors(['#a054f7', '#6929b2', 'rgba(105, 41, 178,0.85)' ]);\n }\n if (currentRotateX > -20 && currentRotateX <20 && currentRotateY > -120 && currentRotateY <-60){\n // animateNav(document.querySelector('#right-btn'));\n toggleContent('#right');\n setColors(['#8ee24d', '#549125', 'rgba(84, 145, 37,0.85)' ]);\n }\n if (currentRotateX > -120 && currentRotateX <-60 && currentRotateY > -30 && currentRotateY <30){\n // animateNav(document.querySelector('#top-btn'));\n toggleContent('#top');\n setColors(['#e24852', '#a02028', 'rgba(160, 32, 40,0.85)' ]);\n }\n if (currentRotateX > 60 && currentRotateX <120 && currentRotateY > -30 && currentRotateY <30){\n // animateNav(document.querySelector('#bottom-btn'));\n toggleContent('#bottom');\n setColors(['#f2d848', '#96841e', 'rgba(150, 132, 30,0.85)']);\n }\n }\n}", "animate(dSec,vrHelper){\n\n if( this.control ) {\n this.control.animate(dSec,vrHelper);\n }\n\n var limit = 5000.0;\n var min = new BABYLON.Vector3(-limit,-limit,-limit);\n var max = new BABYLON.Vector3(+limit,+limit,+limit);\n this.speedPosition = BABYLON.Vector3.Clamp(this.speedPosition,min,max);\n\n this.root.locallyTranslate(this.speedPosition.scale(dSec)); // relatige to ship OR: this.root.translate(this.speedPosition, 1 , Space.LOCAL); // relatige to ship\n\n this.root.rotate(BABYLON.Axis.Y, this.speedRotation.y*dSec, BABYLON.Space.LOCAL); // not .WORLD\n\n // Does the VR-Helper do the mouse rotation?\n // Is there a way to disable it?\n // We have to UNDO it: Does not work that nice!\n var euler = this.root.rotationQuaternion.toEulerAngles();\n this.root.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(euler.y, 0, 0);\n\n // NO!: https://doc.babylonjs.com/resources/rotation_conventions#euler-angles-to-quaternions\n // thisroot.rotationQuaternion.addInPlace(BABYLON.Quaternion.RotationYawPitchRoll(speedRotation.y, speedRotation.x, speedRotation.z) );\n\n var cameraOffset = vrHelper.isInVRMode ? this.cameraOffset1 : this.cameraOffset3;\n\n var camPos = new BABYLON.AbstractMesh(\"camPos\");\n camPos.rotationQuaternion = this.root.rotationQuaternion;\n camPos.position = this.root.position.clone();\n camPos.locallyTranslate(cameraOffset);\n setCamera( camPos.position,\n camPos.rotationQuaternion,\n vrHelper );\n\n }", "function AddRodMousePosi2(main){\n\t\n\tmain.mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n\tmain.mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n\tvar raycaster = new THREE.Raycaster();\n\traycaster.setFromCamera( main.mouse, main.camera );\n\t//select the adding position from these two furnitures\n\tvar intersects = raycaster.intersectObjects(main.DistanceObj , true);\n\n\tif(intersects.length > 0){\n\t\tmain.intersectpoint = intersects[0];\n\t\tvar pos = intersects[0].point;\n\t\t//let the red point move to mouse position\n\t\tif(main.fixpointball==false){\n\t\t\tmain.pointball.position.set( pos.x, pos.y, pos.z );\n\t\t\t//set normal vector from local to world\n\t\t\tvar normalMatrix = new THREE.Matrix3().getNormalMatrix( main.intersectpoint.object.matrixWorld );\n\t\t\tvar normal = intersects[0].face.normal\n\t\t\tnormal = normal.clone().applyMatrix3( normalMatrix ).normalize();\n\t\t\t//rotate the point\n\t\t\tvar newDir = new THREE.Vector3().addVectors(pos, normal);\n\t\t\tmain.pointball.lookAt( newDir );\n\t\t\tmain.pointball.rotateX(90* Math.PI/180);\n\t\t\tvar radius = document.getElementById('InputRodRadius').value;\n\t\t\tif(radius == \"\")\n\t\t\t\tmain.pointball.scale.set(2.0, 1, 2.0);\n\t\t\telse\n\t\t\t\tmain.pointball.scale.set(parseFloat(radius), 1, parseFloat(radius));\n\t\t}\n\t\t//console.log(pos);\n\t}\n\telse{\n\t\t//console.log(\"miss\");\n\t}\n\t\n\n}", "function startCamera()\n{\n $('#camera_wrap').camera({fx: 'scrollLeft', time: 2000, loader: 'none', playPause: false, navigation: true, height: '35%', pagination: true});\n}", "function moveCamera(event) {\r\n\t\r\n\tswitch(event.keyCode){\r\n\t\tcase 87: // 'W' or 'w'\r\n\t\t\t// Move the camera forward\r\n\t\t\tlookEYE = add(lookEYE, mult(vec3(0.1, 0, 0.1), lookAT));\r\n\t\tbreak;\r\n\t\tcase 83: // 'S' or 's'\r\n\t\t\t// Move the camera backward\r\n\t\t\tlookEYE = subtract(lookEYE, mult(vec3(0.1, 0, 0.1), lookAT));\r\n\t\tbreak;\r\n\t\tcase 65: // 'A' or 'a'\r\n\t\t\t// Use rotate() to set the camera transformation matrix to rotate the camera left about the y-axis\r\n\t\t\tvar newXform = mat4();\r\n\t\t\tnewXform = rotateY(-2); \r\n\t\t\tcameraXform = mult(newXform, cameraXform);\r\n\t\t\t\r\n\t\t\t// Adjust where the camera is pointing\r\n\t\t\tvar direction = vec3(Math.cos( radians(-2)), 0, Math.sin( radians(-2) ));\r\n\t\t\tlookAT = add(direction, lookAT);\r\n\r\n\t\tbreak;\r\n\t\tcase 68: // 'D' or 'd'\r\n\t\t\t// Use rotate() to set the camera transformation matrix to rotate the camera right about the y-axis\r\n\t\t\tvar newXform = mat4();\r\n\t\t\tnewXform = rotateY(2); \r\n\t\t\tcameraXform = mult(newXform, cameraXform);\r\n\t\t\t\r\n\t\t\t// Adjust where the camera is pointing\r\n\t\t\tvar direction = vec3(Math.cos( radians(2)), 0, Math.sin( radians(2) ));\r\n\t\t\tlookAT = subtract(lookAT, direction);\r\n\t\tbreak;\r\n\t\tcase 81: // 'Q' or 'q'\r\n\t\t\talert(\"Program Exited. Refresh to restart!\");\r\n\t\t\texit = true;\r\n\t\tbreak;\r\n\t\tcase 82: // 'R' or 'r'\r\n\t\t\t// Reset camera variables\r\n\t\t \tlookEYE = vec3( -3, 3, -3 );\r\n\t\t \tlookAT = vec3( 6, 0, 6 );\r\n\t\t\tlookUP = vec3( 0, 1, 0);\r\n\t\t\tcameraXform = mat4( );\r\n\t\tbreak;\r\n\t\tdefault: // 'H' 'h' '?' or any undefined character\r\n\t\t\talert(\"Use [W] [A] [S] [D] to move. \\n[R] to reset.\\n[Q] to quit.\");\r\n\t\t\r\n\t}\r\n\r\n}", "function scrollLeft() {\n SidebarActions.scrollLeft()\n}", "function toggleLeft() {\n\tcontainer = calcContainer();\n\tcenter = calcCenter();\n\tleft = calcLeft();\n\tright = calcRight();\n\n\t$('#left').toggle(); // Toggle show/hide\n\tleftShow = !leftShow; // Toggle the boolean.\n\n\tmaximizeVideoPlayerResolution();\n\n\tif (leftShow && rightShow) {\n\t\tapplyResolutions();\n\t}\n}", "function keyReleased() {\n left.move(0);\n right.move(0);\n}", "function looper() {\n addX += mouseX\n TweenMax.to(carousel, 1, { rotationY: addX, rotationX: mouseY, ease: Quint.easeOut })\n TweenMax.set(carousel, { z: mouseZ })\n fps.text('Framerate: ' + counter.tick() + '/60 FPS')\n }", "function setDirection() {\n cameraVectorObj.rotation.x = params.upAndDown * Math.PI/180;\n widgetObj.rotation.y = Math.PI + (params.around * Math.PI/180);\n}", "goRight(){\n gpio.write(this.motors.leftFront, true);\n }", "click(x, y, _isLeftButton) {}", "function control(e) {\n switch(e.keyCode) {\n case 37:\n moveLeft()\n break\n case 38:\n rotate()\n break\n case 39:\n moveRight()\n break\n case 40:\n moveDown()\n break\n }\n }", "function moveToRight() {\n picture.animate(\n [\n { transform: 'translateX(10vh)', opacity: 0 },\n { transform: 'translateX(0)', opacity: 1 },\n ],\n {\n duration: 700,\n easing: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n fill: 'both',\n }\n );\n}", "function moveCamera(e) {\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementY * Math.PI) / 400, // amount to rotate in radians\r\n [1, 0, 0]\r\n ); // axis to rotate around (Z)\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementX * Math.PI) / 400, // amount to rotate in radians\r\n [0, 1, 0]\r\n );\r\n}", "function CameraUI_Move(x, y)\n{\n\t//update position\n\tthis.POINT.x += x;\n\tthis.POINT.y += y;\n\t//has controller?\n\tif (__CONTROLLER)\n\t{\n\t\t//change the camera coordinates\n\t\t__CONTROLLER.moveMouseTo(this.POINT.x, this.POINT.y);\n\t}\n}", "function checkTowerRightClick(xPosInDiv,yPosInDiv){\n\tvar projector = new THREE.Projector();\n\tvar vector = new THREE.Vector3( ( xPosInDiv / DIV_WIDTH ) * 2 - 1, - ( yPosInDiv / DIV_HEIGHT ) * 2 + 1, 0.5 );\n\tprojector.unprojectVector( vector, mainCamera );\n\tvar raycaster = new THREE.Raycaster( mainCamera.position, vector.sub( mainCamera.position ).normalize() );\n\tvar intersects = raycaster.intersectObjects( towerMeshList );\n\tif( intersects.length > 0 ){\n\t\tvar mesh = intersects[ 0 ].object;\n\t\ttowerRightClicked(mesh);\n\t\t//console.log(\"Tower right clicked!\");\n\t}\n\telse{\n\t\tif(CURRENT_HOVER_MODE == HOVER_DESTROY){\n\t\t\tCURRENT_HOVER_MODE = HOVER_ACTIVATE;\n\t\t}\n\t}\n}", "function control (e) {\n if (document.getElementById('pause-button')) {\n if (e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n } else if (e.keyCode === 39) {\n moveRight()\n } else if (e.keyCode === 40) {\n moveDown()\n }\n }\n }", "baseFrameAction(event) {\n // this.vLab.SceneDispatcher.currentVLabScene.interactables['baseFrame'].actionFunctionActivated = false;\n let currentActionInitialEventCoords = VLabUtils.getEventCoords(event.event);\n if (this.prevActionInitialEventCoords !== undefined) {\n this.baseFrameActionActivated = true;\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.disable();\n\n if (event.event.ctrlKey == true) {\n let shift = 0.02 * ((this.prevActionInitialEventCoords.x - currentActionInitialEventCoords.x > 0.0) ? -1 : 1);\n this.rotateBaseFrame(-shift);\n } else {\n this.vLab.WebGLRendererCanvas.style.cursor = 'move';\n let rect = this.vLab.WebGLRendererCanvas.getBoundingClientRect();\n let x = (currentActionInitialEventCoords.x - rect.left) / rect.width;\n let y = (currentActionInitialEventCoords.y - rect.top) / rect.height;\n var pointerVector = new THREE.Vector2();\n pointerVector.set((x * 2) - 1, -(y * 2) + 1);\n this.helperDragRaycaster.setFromCamera(pointerVector, this.vLab.SceneDispatcher.currentVLabScene.currentCamera);\n let intersections = this.helperDragRaycaster.intersectObjects([this.helperDragXZPlane], true);\n if (intersections[0]) {\n let intersectionPoint = intersections[0].point.clone();\n if (this.prevBaseFramePosition == undefined) {\n this.prevBaseFramePosition = new THREE.Vector3().copy(this.baseFrame.position.clone());\n this.prevBaseFrameOffest = new THREE.Vector3().copy(intersectionPoint);\n\n /**\n * Zoom to Valter on double click on baseFrame\n */\n if (this.prevActionInitialEventCoords.x - currentActionInitialEventCoords.x == 0) {\n if (this.clock.getElapsedTime() - this.baseFrameDoubleClickTime < 0.15) {\n this.zoomToValter();\n }\n }\n this.baseFrameDoubleClickTime = this.clock.getElapsedTime();\n\n } else {\n intersectionPoint.sub(this.prevBaseFrameOffest);\n let dragPosition = this.prevBaseFramePosition.clone();\n dragPosition.add(intersectionPoint);\n dragPosition.multiply(new THREE.Vector3(1.0, 0.0, 1.0));\n this.setBaseFramePosition(dragPosition);\n }\n }\n }\n }\n\n this.prevActionInitialEventCoords = new THREE.Vector2();\n this.prevActionInitialEventCoords.copy(currentActionInitialEventCoords);\n }", "function translateLeft() {\n console.log('translate left triggered');\n var m = new THREE.Matrix4();\n m.set( 1, 0, 0, -7.5,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "async function leftButton() {\n\tcreatePElement(warriorName + \" decides to walk left towards the \" + left + \".\");\n\tpathAction(left);\n\t\n\tpickedLeft = pickedLeft + 1;\n}", "function leftArrowKey(event) {\n if (event.key === 'ArrowLeft') {\n leftButtonClicked();\n }\n}", "function SceneEventManager () {\n\n var mouseX = 0, mouseY = 0, pmouseX = 0, pmouseY = 0;\n var pressX = 0, pressY = 0;\n\n var controller;\n\n // the mouse and raycaster is used to judge whether the mouse is clicked on the globe\n\n var mouse = new THREE.Vector2();\n var raycaster = new THREE.Raycaster();\n\n function onDocumentMouseMove ( event ) {\n\n pmouseX = mouseX;\n pmouseY = mouseY;\n\n mouseX = event.clientX - controller.container.clientWidth * 0.5 - Utils.getElementViewLeft( controller.container );\n mouseY = event.clientY - controller.container.clientHeight * 0.5 - Utils.getElementViewTop( controller.container );\n\n // if it is in a dragging state, let the RotationHandler to handlers the rotation of the globe\n\n if ( controller.rotationHandler.isDragging() ) {\n\n controller.rotationHandler.addRotateVY( ( mouseX - pmouseX ) / 2 * Math.PI / 180 * 0.3 );\n controller.rotationHandler.addRotateVX( ( mouseY - pmouseY ) / 2 * Math.PI / 180 * 0.3 );\n\n }\n\n }\n\n function onDocumentMouseDown ( event ) {\n\n if ( event.target.className.indexOf( 'noMapDrag' ) !== -1 ) {\n\n return;\n\n }\n\n // set the state to the dragging state\n\n controller.rotationHandler.setDragging( true );\n pressX = mouseX;\n pressY = mouseY;\n controller.rotationHandler.clearRotateTargetX();\n\n }\n\n function onDocumentMouseUp ( event ) {\n\n // When mouse up, the notify the RotatingHandler to set drag false\n\n controller.rotationHandler.setDragging( false );\n\n }\n\n function onMouseWheel ( event ) {\n\n var delta = 0;\n\n // calculate the mouse wheel delta in IE or Opera\n\n if ( event.wheelDelta ) {\n\n delta = event.wheelDelta / 120;\n\n }\n\n //\tcalculate the mouse wheel delta in firefox\n\n else if ( event.detail ) {\n\n delta = -event.detail / 3;\n\n }\n\n if ( delta ) {\n\n // use the WheelHandler to handle actual mouse wheel event, if we would like to do something\n\n controller.wheelHandler.handleMWheel(delta);\n\n }\n\n event.returnValue = false;\n\n }\n\n function onResize ( event ) {\n\n // use the ResizeHandler to handle the actual window resize event, if we would like to do something\n\n controller.resizeHandler.resizeScene();\n\n }\n\n function onClick ( event ) {\n\n //\tif the click is drag, do nothing\n\n if ( Math.abs( pressX - mouseX ) > 3 || Math.abs( pressY - mouseY ) > 3 ) {\n\n return;\n\n }\n\n // let the mouse and raycaster to judge whether the click is on the earth, if not do noting\n\n mouse.x = ( ( event.clientX - Utils.getElementViewLeft( controller.container ) ) / controller.container.clientWidth ) * 2 - 1;\n mouse.y = -( ( event.clientY - Utils.getElementViewTop( controller.container ) ) / controller.container.clientHeight ) * 2 + 1;\n\n raycaster.setFromCamera( mouse, controller.camera );\n\n var intersects = raycaster.intersectObjects( controller.scene.children, true );\n\n // intersects.length === 0 means that the mouse click is not on the globe\n\n if ( intersects.length === 0 ) {\n\n return;\n\n }\n\n // to get the color of clicked area on the globe's surface\n\n var pickColorIndex = controller.surfaceHandler.getPickColor( mouseX, mouseY );\n\n // for debug\n\n // console.log( pickColorIndex );\n\n /**\n * on a specific condition will let the SwitchCountryHandler to execute switch\n * condition:\n * 1. the picked color is actually a color to represent a country\n * 2. the picked color is not 0 (0 represents ocean)\n * 3. if the user want only the mentioned countries can be clicked, it will judge whether the picked country is mentioned\n */\n\n if ( CountryColorMap[ pickColorIndex ] !== undefined &&\n pickColorIndex !== 0 &&\n ( ( controller.configure.control.disableUnmentioned &&\n controller.mentionedCountryCodes.indexOf( pickColorIndex ) !== -1 ) ||\n !controller.configure.control.disableUnmentioned ) ) {\n\n controller.switchCountryHandler.executeSwitch( pickColorIndex )\n\n }\n\n }\n\n function onTouchStart ( event ) {\n\n\t\tif ( event.target.className.indexOf( 'noMapDrag' ) !== -1 ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// set the state to the dragging state\n\n\t\tcontroller.rotationHandler.setDragging( true );\n\t\tpressX = mouseX;\n\t\tpressY = mouseY;\n\t\tcontroller.rotationHandler.clearRotateTargetX();\n\n }\n\n function onTouchEnd ( event ) {\n\n\t\t// When touch up, the notify the RotatingHandler to set drag false\n\n\t\tcontroller.rotationHandler.setDragging( false );\n\n }\n\n function onTouchMove ( event ) {\n\n\t\tpmouseX = mouseX;\n\t\tpmouseY = mouseY;\n\n\t\t// get clientX and clientY from \"event.touches[0]\", different with onmousemove event\n\n\t\tmouseX = event.touches[0].clientX - controller.container.clientWidth * 0.5 - Utils.getElementViewLeft( controller.container );\n\t\tmouseY = event.touches[0].clientY - controller.container.clientHeight * 0.5 - Utils.getElementViewTop( controller.container );\n\n\t\t// if it is in a dragging state, let the RotationHandler to handlers the rotation of the globe\n\n\t\tif ( controller.rotationHandler.isDragging() ) {\n\n\t\t\tcontroller.rotationHandler.addRotateVY( ( mouseX - pmouseX ) / 2 * Math.PI / 180 * 0.3 );\n\t\t\tcontroller.rotationHandler.addRotateVX( ( mouseY - pmouseY ) / 2 * Math.PI / 180 * 0.3 );\n\n\t\t}\n\n }\n\n /**\n * bind all event handlers to the dom of the scene, the resize event will be bind to window.\n * This function will be called when InitHandler's init() function be called\n */\n\n function bindEvent ( controllerPara ) {\n\n controller = controllerPara;\n\n controller.renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, true );\n controller.renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, true );\n controller.renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );\n controller.renderer.domElement.addEventListener( 'click', onClick, true );\n controller.renderer.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n controller.renderer.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false );\n\n\t\tcontroller.renderer.domElement.ontouchstart = onTouchStart;\n\t\tcontroller.renderer.domElement.ontouchend = onTouchEnd;\n\t\tcontroller.renderer.domElement.ontouchmove = onTouchMove;\n\n window.addEventListener( 'resize', onResize, false );\n\n }\n\n return {\n\n bindEvent: bindEvent\n\n }\n\n}", "function moveLeft() {\n\n if (document.querySelector('.frame').classList.contains('right')) showMiddle();\n else showLeft();\n }", "function moveLeft(){\n if (current != 1){\n current--;\n }\n smlImage();\n norm('#image', .3, 1);\n\n if ($('#image').hasClass('pixPerf')){\n $('.leftButt').css('visibility','hidden');\n }\n $('.rightButt').css('visibility','visible');\n moveCirc(current+1, current);\n}", "function start()\n{\n show = document.getElementById(\"image\");\n var leftButton = document.getElementById(\"buttonLeft\");\n var rightButton = document.getElementById(\"buttonRight\");\n leftButton.addEventListener(\"click\", moveLeft, false);\n rightButton.addEventListener(\"click\", moveRight, false);\n}", "function control(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n }", "function slider(e)\n{\n\t//determine the exact location of the slider div from the left of the screen\n\tleftOffset=document.querySelector('#sliderContainer').offsetLeft+document.querySelector('#remoteContainer').offsetLeft;\n\t//get the position of the mosue form the left of the screen \n\t \tmouseX = e.pageX;\n\t//calculating the difference to determine mouse position relative to the left of the slider\n\tleftPos=mouseX-leftOffset;\n\tif(leftPos<=236)\n\t{\n\t//removing slow move class to make it look it is following but still animating\n\tdocument.querySelector('#rollerFill').className='';\n\tdocument.querySelector('#roller').className='';\n\t//defining the width of the rollerFill according to the postion of the pointer\n\tdocument.querySelector('#rollerFill').style.width=leftPos+5+'px';\n\t//defining the left position of the roller according to the postion of the pointer\n\tdocument.querySelector('#roller').style.left=leftPos-5+'px';\n\t}\n\t//if get continueFollow=='stop' stop following (ON MOUSE OUT)\n\tif(continueFollow=='stop')\n\t{\n\t\t\n\t\treturn false;\n\t}\n}" ]
[ "0.6669174", "0.617785", "0.61591494", "0.61524904", "0.6122603", "0.6096839", "0.6057147", "0.6028616", "0.60280967", "0.59993976", "0.5987891", "0.5983427", "0.5970282", "0.595384", "0.59290147", "0.5928145", "0.5846607", "0.5831137", "0.5822703", "0.580224", "0.5734582", "0.573009", "0.57271504", "0.5721533", "0.5715885", "0.57064784", "0.570599", "0.56861585", "0.56859374", "0.5685695", "0.56808674", "0.56735015", "0.56707233", "0.5667793", "0.566533", "0.5661536", "0.5650449", "0.5646888", "0.5646705", "0.56434023", "0.5637154", "0.56343645", "0.5616956", "0.5608289", "0.5607006", "0.5605033", "0.5604334", "0.55990386", "0.55912703", "0.55871964", "0.5580582", "0.5580582", "0.5564725", "0.55509806", "0.55418", "0.5539103", "0.5529096", "0.5525791", "0.5522134", "0.55026245", "0.54949737", "0.5491008", "0.5488391", "0.54762864", "0.5476053", "0.5460318", "0.545983", "0.5455158", "0.5446593", "0.5444787", "0.54422355", "0.5440361", "0.54401565", "0.5436854", "0.5434068", "0.5421899", "0.54209924", "0.5419219", "0.54183716", "0.5417542", "0.53984666", "0.53979474", "0.53955024", "0.5391456", "0.5390009", "0.5387561", "0.53856415", "0.5377418", "0.5369205", "0.5361164", "0.5360241", "0.5358368", "0.5356504", "0.5346425", "0.534483", "0.534252", "0.53413224", "0.5338705", "0.53376746", "0.53362113" ]
0.612916
4
Move the camera and the target on the XY plane.
function move(x, y) { let dirX = camera.directionX; let dirY = camera.directionY; // Allow only movement on the XY plane, and scale to MOVE_SPEED. vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED); vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED); camera.move(right); camera.move(up); // And also move the camera target to update the orbit. vec3.add(cameraTarget, cameraTarget, right); vec3.add(cameraTarget, cameraTarget, up); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n\n style.transform =\n \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px, 0)\";\n }", "function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n style.transform = \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px, 0)\";\n }", "function CameraUI_Move(x, y)\n{\n\t//update position\n\tthis.POINT.x += x;\n\tthis.POINT.y += y;\n\t//has controller?\n\tif (__CONTROLLER)\n\t{\n\t\t//change the camera coordinates\n\t\t__CONTROLLER.moveMouseTo(this.POINT.x, this.POINT.y);\n\t}\n}", "function move_camera( event ){\n\tvar delta_x = event.clientX - previous_camera.x;\n\tvar delta_y = event.clientY - previous_camera.y;\n\n\tdirection = 1;\n\tangle_x += direction * delta_x/200;\n\tdirection = -1;\n\tangle_y += direction * delta_y/200;\n\n\t//restrict Y axis movement beyond 0 < y < 180 degrees\n\tangle_y = angle_y < 0.1 ? 0.1: angle_y;\n\tangle_y = angle_y > Math.PI-0.1 ? Math.PI-0.1: angle_y;\n\n\tvar x = 300 * Math.cos( angle_x ) * Math.sin( angle_y );\n\tvar z = 300 * Math.sin( angle_x ) * Math.sin( angle_y );\n\tvar y = 300 * Math.cos( angle_y );\n\n\tcamera.position.set( x, y, z );\n\tcamera.lookAt( board_base.position );\n}", "function CameraUI_MoveTo(x, y)\n{\n\t//update position\n\tthis.POINT.x = x;\n\tthis.POINT.y = y;\n\n\t//has controller\n\tif (__CONTROLLER)\n\t{\n\t\t//change the camera coordinates\n\t\t__CONTROLLER.moveMouseTo(this.POINT.x, this.POINT.y);\n\t}\n}", "function moveCamera() {\n const current = document.body.getBoundingClientRect().top;\n // tours.rotation.x += current * 0.0001;\n // camera.position.x = current * 0.002;\n // camera.position.z = current * -0.04;\n // camera.position.x = current * 0.02;\n}", "function moveCamera() {\n\n //where the user is currently scrolled to\n const t = document.body.getBoundingClientRect().top;\n\n moon.rotation.x += 0.05;\n moon.rotation.y += 0.075;\n moon.rotation.z += 0.05;\n\n ritam.rotation.z += 0.01\n ritam.rotation.y += 0.01 \n\n //changing the position of the actual camera\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.position.y = t * -0.0002;\n}", "cameraMove() {\n if (this.x > state.canvas.width - GAME_CONFIG.CAMERA_PADDING) {\n state.cameraX = this.x - state.canvas.width + GAME_CONFIG.CAMERA_PADDING;\n } else {\n state.cameraX = 0;\n }\n }", "moveToCamera() {\r\n const [position, rotation] = this.camera.toCamera(this);\r\n if (this.mesh.position.manhattanDistanceTo(position) < Number.EPSILON) return;\r\n \r\n this.moveTransition(position, rotation);\r\n this.atOriginalPosition = false;\r\n }", "function moveCamera(x, y) {\n\tvar disX = Math.abs(w / 2 - x);\n\tvar disY = Math.abs(h / 2 - y);\n\n\tif (x < w * boundaryPct && camera.position.x >= -horizBoundary + w/2) {\n\t\tcamSpeedX = map_range(disX, w * boundaryPct, w/2, 0, -panMaxSpeed);\n\t}\n\telse if (x > w - w * boundaryPct && camera.position.x <= horizBoundary - w/2) {\n\t\tcamSpeedX = map_range(disX, w * boundaryPct, w/2, 0, panMaxSpeed);\n\t}\n\t\n\tif (y < h * boundaryPct && camera.position.y >= -vertBoundary + h/2) {\n\t\tcamSpeedY = map_range(disY, h * boundaryPct, h/2, 0, panMaxSpeed);\n\t}\n\telse if (y > h - h * boundaryPct && camera.position.y <= vertBoundary - h/2) {\n\t\tcamSpeedY = map_range(disY, h * boundaryPct, h/2, 0, -panMaxSpeed);\n\t}\n}", "move() {\r\n this.x += this.vX;\r\n this.y += this.vY;\r\n }", "move() {\n\n // Horizontal movement\n this.x_location += this.delta_x;\n\n // Vertical movement\n this.y_location += this.delta_y;\n\n }", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\n }", "move() {\n this.posX += this.deltaX;\n this.posY += this.deltaY;\n }", "function updateCamera(x,y){\n cameraX += x-canvas.width/2;\n cameraY += y-canvas.height/2;\n}", "function Update () \n\t{\n\t\t//Get the position\n\t\ttargetPos = this.transform.position;\n\t\ttargetPos.y = target.position.y;\n\t\ttargetPos.x = target.position.x - 12;\n\t\t//Go to the position\n\t\tthis.transform.position = targetPos;\n\t}", "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n }", "@action setMoveTarget() {\n this.act = (nextLocation) => {\n this.clearHit()\n this.moveXAndY(nextLocation.x, nextLocation.y)\n this.handleEffects()\n }\n if (this.movementId) { // if already moving, continue in a new direction\n this.startMovement()\n }\n }", "function moveCamera(e) {\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementY * Math.PI) / 400, // amount to rotate in radians\r\n [1, 0, 0]\r\n ); // axis to rotate around (Z)\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementX * Math.PI) / 400, // amount to rotate in radians\r\n [0, 1, 0]\r\n );\r\n}", "move() {\n this.x += this.xdir * .5;\n this.y += this.ydir * .5;\n }", "function moveToOrigin() {\n if (visible) {\n ctx.translate(-((width / 2) - x(viewCenter.x)), -(-y(viewCenter.y) + (height / 2)));\n }\n }", "move() {\n this.center.x += this.speed.x;\n this.center.y += this.speed.y;\n \n wrapAround(this.center);\n }", "moveTo(x, y) {\n this.ctx.moveTo(this.WorldToScreenX(x), this.WorldToScreenY(y));\n }", "move() {\n // To update the position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "function moveCamera() {\n // calculate where the user is currently\n const t = document.body.getBoundingClientRect().top;\n\n me.rotation.y += 0.01;\n me.rotation.x =+ 0.01;\n\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.rotation.y = t * -0.0002;\n \n}", "setTarget(x, y) {\n // Don't update if the coords are the same as the last update.\n if (this.x === x && this.y === y) return;\n this.x = x;\n this.y = y;\n this.dirty = true;\n this.hitBox = this.hitBox.moveCenterTo(this.x, this.y);\n }", "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "move() {\n this.x += this.vx;\n this.y += this.vy;\n }", "moveTo(x, y) {\n this.params.x = x\n this.params.y = y\n this.updateParams()\n }", "updateCameraPosition() {\n this.camera.position.x = this.position[0] + Math.sin(this.angleY) * Math.cos(this.angleX) * 0.1;\n this.camera.position.y = this.position[1] + Math.sin(this.angleX) * 0.1;\n this.camera.position.z = this.position[2] + Math.cos(this.angleY) * Math.cos(this.angleX) * 0.1;\n this.target.x = this.position[0];\n this.target.y = this.position[1];\n this.target.z = this.position[2];\n this.camera.lookAt( this.target );\n for (let i = 0; i < this.posChangedCallback.length; i++)\n this.posChangedCallback[i]();\n }", "move() {\n if (this._y - Ball_Radius <= 0) {\n this._reverseY();\n } else if (this._x - Ball_Radius <= 0 || this._x + Ball_Radius >= Scene_Width) {\n this._reverseX();\n }\n this._x = this._x + this._dx;\n this._y = this._y + this._dy;\n }", "move() {\n this.x += 3;\n this.y += 0;\n if (this.x > 50) {\n this.x += 0;\n this.y += 4;\n }\n if (this.x > 1200) {\n this.y = this.dy;\n this.x = this.dx;\n }\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "setWCCenter(xPos, yPos) {\r\n let p = vec2.fromValues(xPos, yPos);\r\n this.mCameraState.setCenter(p);\r\n }", "moveTo() {\r\n this.move();\r\n if(this.position.x+this.width/2 > this.movingTo.x) {\r\n this.movement.x = -this.speed;\r\n this.side = false;\r\n } if(this.position.x+this.width/2 < this.movingTo.x) {\r\n this.movement.x = this.speed;\r\n this.side = true;\r\n }\r\n if(this.position.y+this.height/2 > this.movingTo.y) {\r\n this.movement.y = -this.speed;\r\n } if(this.position.y+this.height/2 < this.movingTo.y) {\r\n this.movement.y = this.speed;\r\n }\r\n }", "move(...args) {\n const p = vec2(...args);\n const dx = p.x * dt();\n const dy = p.y * dt();\n\n this.pos.x += dx;\n this.pos.y += dy;\n }", "move(xMovement, yMovement) {\n this.x = this.x + xMovement;\n this.y = this.y + yMovement;\n this.refillOptions();\n canvas.redrawCanvas();\n }", "function movePlayerCamera(dx,dy,dz) {\r\n\t\t_playerCamera.moveCamera(dx, dy, dz);\r\n\t}", "move() {\n let frameTime = fc.Loop.timeFrameGame / 1000;\n let distance = fc.Vector3.SCALE(this.velocity, frameTime);\n this.translate(distance);\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n // Handle wrapping\n this.handleWrapping();\n }", "function moveCameraToBoard() {\n\tfor(var i=movements.length;i--;) {\n\t\tif(isMoveCameraTo(movements[i],camera.position.getComponent(i),positionFinal[i])) {\n\t\t\tadd = delta * movements[i] * speedTranslation[i];\n\t\t\tcamera.position.setComponent(i,camera.position.getComponent(i) + add);\n\t\t} else {\n\t\t\tpositionReached[i] = true;\n\t\t}\n\t\tif(isMoveCameraTo(rotation[i],camera.rotation.toVector3().getComponent(i),rotationFinal[i])) {\n\t\t\tadd = delta * rotation[i] * speedRotation[i];\t\t\t\n\t\t\tcamera.rotation[ABSCISSA[i]] = camera.rotation.toVector3().getComponent(i) + add;\n\t\t} else {\n\t\t\trotationReached[i] = true;\n\t\t}\n\t}\n}", "function positionCameraToBuilding(object, controls, camera) {\n camera.position.copy(getCameraPositionBasedOnObject(object));\n controls.target.copy(getObjectCenter(object));\n // controls.update() must be called after any manual changes to the camera's transform\n controls.update();\n}", "move(x,y){\n this.position.x += x;\n this.position.y += y;\n }", "function positionCamera(obj)\r\n{\r\n camera.lookAt(obj.position);\r\n camera.updateProjectionMatrix();\r\n}", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "function move_camera(){\n if (!mouse_down){\n if (track_obj){\n if (track_obj === 'home'){\n // code that moves camera to center\n offset_x = Math.abs(offset_x) > 0.1 ? offset_x * (1-CAMERA_SPEED) : 0;\n offset_y = Math.abs(offset_y) > 0.1 ? offset_y * (1-CAMERA_SPEED) : 0;\n if (zoom > 1.1){\n zoom *= (1-CAMERA_SPEED);\n } else if (zoom < 0.9){\n let diff = 1/zoom;\n zoom *= (1+CAMERA_SPEED);\n } else {\n zoom = 1.0;\n }\n } else if (Math.abs(track_obj['x'] - c.width/2) > 0.1 || Math.abs(track_obj['y'] - c.height/2) > 0.1){\n offset_x -= (track_obj['x'] - c.width/2) * CAMERA_SPEED/(Math.sqrt(zoom));\n offset_y -= (track_obj['y'] - c.height/2) * CAMERA_SPEED/(Math.sqrt(zoom));\n }\n } else {\n // code that slowly stops moving camera\n camera_move_amt.x = Math.abs(camera_move_amt.x) > 0.1 ? camera_move_amt.x * CAMERA_SPEED*8 : 0;\n camera_move_amt.y = Math.abs(camera_move_amt.y) > 0.1 ? camera_move_amt.y * CAMERA_SPEED*8 : 0;\n offset_x = Math.abs(offset_x) > 1 ? offset_x + camera_move_amt.x : offset_x;\n offset_y = Math.abs(offset_y) > 1 ? offset_y + camera_move_amt.y : offset_y;\n }\n }\n}", "moveTo(x, y, deltaX, deltaY) {\r\n if (!deltaX || !deltaY || this.paused) return;\r\n if (this.position.x !== x) {\r\n this.speed.x = (x - this.position.x) * (deltaX / 1000);\r\n }\r\n if (this.position.y !== y) {\r\n this.speed.y = (y - this.position.y) * (deltaY / 1000);\r\n }\r\n this.position.x += this.speed.x;\r\n this.position.y += this.speed.y;\r\n }", "updateCamera() {\r\n this.actual = {\r\n x: this.position.x - this.game.camera.position.x,\r\n y: this.position.y - this.game.camera.position.y\r\n };\r\n }", "move(delta) {\n // this helper function converts from input space to camera space\n const lookAtMovement = this._convertToCameraSpace(this._lookAtInput);\n vec3.scaleAndAdd(this._lookAtPoint, this._lookAtPoint, lookAtMovement, delta * this._movementSpeed);\n // just so we keep the objects in view\n this._constrain(this._lookAtPoint, 4, 4, 0);\n\n let eyeMovement = this._convertToCameraSpace(this._movementInput);\n vec3.scaleAndAdd(this._eye, this._eye, eyeMovement, delta * this._movementSpeed);\n // keeps the user within a reasonable distance of the objects\n this._constrain(this._eye, 20, 0, 20);\n }", "moveToObject (destination){\n this.scene.physics.moveToObject(this, destination, this.speed);\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function setupCamera(scene) {\n let canvas = scene.viewer.canvas;\n let camera = scene.camera;\n let MOVE_SPEED = 2;\n let ZOOM_SPEED = 30;\n let ROTATION_SPEED = 1 / 200;\n let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0};\n let right = vec3.create();\n let up = vec3.create();\n let horizontalAngle = -Math.PI / 2;\n let verticalAngle = -Math.PI / 4;\n let cameraTarget = vec3.create(); // What the camera orbits.\n\n // Initial setup, go back a bit and look forward.\n camera.move([0, -400, 0]);\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n\n // Move the camera and the target on the XY plane.\n function move(x, y) {\n let dirX = camera.directionX;\n let dirY = camera.directionY;\n\n // Allow only movement on the XY plane, and scale to MOVE_SPEED.\n vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED);\n vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED);\n\n camera.move(right);\n camera.move(up);\n\n // And also move the camera target to update the orbit.\n vec3.add(cameraTarget, cameraTarget, right);\n vec3.add(cameraTarget, cameraTarget, up);\n }\n\n // Rotate the camera around the target.\n function rotate(dx, dy) {\n // Update rotations, and limit the vertical angle so it doesn't flip.\n // Since the camera uses a quaternion, flips don't matter to it, but this feels better.\n horizontalAngle += dx * ROTATION_SPEED;\n verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01));\n\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n }\n\n // Zoom the camera by moving forward or backwards.\n function zoom(factor) {\n // Get the forward vector.\n let dirZ = camera.directionZ;\n\n camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED));\n }\n\n /*\n // Resize the canvas automatically and update the camera.\n function onResize() {\n let width = canvas.clientWidth;\n let height = canvas.clientHeight;\n\n canvas.width = width;\n canvas.height = height;\n\n camera.viewport([0, 0, width, height]);\n camera.perspective(Math.PI / 4, width / height, 8, 100000);\n }\n\n window.addEventListener(\"resize\", function(e) {\n onResize();\n });\n\n onResize();\n */\n\n // Track mouse clicks.\n canvas.addEventListener(\"mousedown\", function(e) {\n e.preventDefault();\n\n mouse.buttons[e.button] = true;\n });\n\n // And mouse unclicks.\n // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas.\n window.addEventListener(\"mouseup\", (e) => {\n e.preventDefault();\n\n mouse.buttons[e.button] = false;\n });\n\n // Handle rotating and moving the camera when the mouse moves.\n canvas.addEventListener(\"mousemove\", (e) => {\n mouse.x2 = mouse.x;\n mouse.y2 = mouse.y;\n mouse.x = e.clientX;\n mouse.y = e.clientY;\n\n let dx = mouse.x - mouse.x2;\n let dy = mouse.y - mouse.y2;\n\n if (mouse.buttons[0]) {\n rotate(dx, dy);\n }\n\n if (mouse.buttons[2]) {\n move(-dx * 2, dy * 2);\n }\n });\n\n // Handle zooming when the mouse scrolls.\n canvas.addEventListener(\"wheel\", (e) => {\n e.preventDefault();\n\n let deltaY = e.deltaY;\n\n if (e.deltaMode === 1) {\n deltaY = deltaY / 3 * 100;\n }\n\n zoom(deltaY / 100);\n });\n\n // Get the vector length between two touches.\n function getTouchesLength(touch1, touch2) {\n let dx = touch2.clientX - touch1.clientX;\n let dy = touch2.clientY - touch1.clientY;\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // Touch modes.\n let TOUCH_MODE_INVALID = -1;\n let TOUCH_MODE_ROTATE = 0;\n let TOUCH_MODE_ZOOM = 1;\n let touchMode = TOUCH_MODE_ROTATE;\n let touches = [];\n\n // Listen to touches.\n // Supports 1 or 2 touch points.\n canvas.addEventListener('touchstart', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (targetTouches.length === 1) {\n touchMode = TOUCH_MODE_ROTATE;\n } else if (targetTouches.length == 2) {\n touchMode = TOUCH_MODE_ZOOM;\n } else {\n touchMode = TOUCH_MODE_INVALID;\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n\n canvas.addEventListener('touchend', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n canvas.addEventListener('touchcancel', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n // Rotate or zoom based on the touch mode.\n canvas.addEventListener('touchmove', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (touchMode === TOUCH_MODE_ROTATE) {\n let oldTouch = touches[0];\n let newTouch = targetTouches[0];\n let dx = newTouch.clientX - oldTouch.clientX;\n let dy = newTouch.clientY - oldTouch.clientY;\n\n rotate(dx, dy);\n } else if (touchMode === TOUCH_MODE_ZOOM) {\n let len1 = getTouchesLength(touches[0], touches[1]);\n let len2 = getTouchesLength(targetTouches[0], targetTouches[1]);\n\n zoom((len1 - len2) / 50);\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n}", "move(){\n this.x = this.x+this.vx;\n this.y = this.y+this.vy;\n if(this.x > width || this.x < 0){\n this.vx *= -1;\n }\n if(this.y>height || this.y<0){\n this.vy *= -1;\n }\n var v = createVector(this.x, this.y);\n this.history.push(v);\n //Only trace 200 positions prior \n if(this.history.length > 200){\n this.history.splice(0,1);\n }\n }", "function moveCar() {\n currentLatLng = panoMetaData.latlng;\n carMarker.setLatLng(currentLatLng);\n map.panTo(currentLatLng);\n\n /* Now retrieve the links for this panorama so we can\n * work out where to go next.\n */\n svClient.getNearestPanorama(panoMetaData.latlng, function(svData) {\n if (svData.code == 500) {\n /* Server error. Retry once a second */\n setTimeout(\"moveCar()\", 1000);\n } else if (svData.code == 600) {\n /* No panorama. Should never happen as we have\n * already loaded this panorama in the Flash viewer.\n */\n jumpToVertex(nextVertexId);\n } else {\n panoMetaData.links = svData.links;\n checkDistanceFromNextVertex();\n if (driving) {\n advanceTimer = setTimeout(\"advance()\", advanceDelay * 1000);\n }\n }\n });\n }", "setPos(xWorld, yWorld) {\n this.x = xWorld\n this.y = yWorld\n // Update the transformation matrix\n this.tModelToWorld.setTranslation(xWorld, yWorld)\n }", "function cameraMove() {\n if (camera.L) {\n sX -= camera.speed;\n }\n if (camera.R) {\n sX += camera.speed;\n }\n if (camera.T) {\n sY -= camera.speed;\n }\n if (camera.B) {\n sY += camera.speed;\n }\n if (sX < 0) {\n sX = 0;\n }\n if (sX > canvas.width - window.innerWidth) {\n sX = canvas.width - window.innerWidth;\n }\n if (sY < 0) {\n sY = 0;\n }\n if (sY > canvas.height - window.innerHeight) {\n sY = canvas.height - window.innerHeight;\n }\n if (camera.zoomOut) {\n id(\"zoomer\").value--;\n zoomChange();\n } else if (camera.zoomIn) {\n id(\"zoomer\").value++;\n zoomChange();\n }\n scroll(sX, sY);\n}", "function LateUpdate() \n{\n\n\t\t// Drop out if no target set ..\n\tif (!target)\n\t\treturn;\n\t\t// store our current camera position ... (after moving the target away)\n\toldPos = target.InverseTransformPoint(transform.position);\t\t\t\t\t// get the current position of the camera in the target's local space ...\n\tcamPos = targetPos;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// on every update we move the camera into the local target Position ... but we smooth into this position ...\n\t\n\t\t// introduce damping ... -> calculate the correct coordinates for the Camera in the targets local space ...\n\t// var newSide : float = Mathf.Lerp(oldPos.x, targetPos.x, camSideDamp * Time.deltaTime);\n\t// camPos.x = newSide;\t\n\t// var newHeight : float = Mathf.Lerp(oldPos.y, targetPos.y, camHeightDamp * Time.deltaTime);\n\t// camPos.y = newHeight;\t \n\t//var newDist : float = Mathf.Lerp(oldPos.z, targetPos.z, camDistDamp * Time.deltaTime);\n\t// camPos.z = newDist;\t\n\t camPos = targetPos;\n\t\t// now get the camera working directly (without drag) first ....\n\t camPos = target.TransformPoint(camPos);\t\t\t\t\t\t\t\t// now convert the local coordinates back into world space ...\n\n\n\ttransform.position = camPos;\n\n\ttransform.LookAt(target);\n\n}", "move() {\n if (this.isAvailable) {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n // Handle wrapping\n this.handleWrapping();\n }\n }", "move() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.in.X = this.position.X - this.geometricMidpoint.X;\n this.in.Y = this.position.Y - this.geometricMidpoint.Y;\n }", "function setupMouseMove(){\n\t\tcanvas.addEventListener('mousemove', function(e){\n\t\t\t\tdocument.body.style.backgroundImage = \"url('')\";\n\t\t\t\t\n\t\t\t\tvar currentXMovement = e.movementX;\n\t\t\t\tcurrentRotateY += currentXMovement + prevX;\n\t\t\t\tprevX = currentXMovement;\n\t\t\t\tyaw = currentRotateY * rotateSpeed;\n\t\t\t\t\n\t\t\t\tvar currentYMovement = e.movementY;\n\t\t\t\tcurrentRotateX += currentYMovement + prevY;\n\t\t\t\tprevY = currentYMovement;\n\t\t\t\tpitch = -currentRotateX * rotateSpeed;\n\t\t\t\t\n\t\t\t\t// Stops the camera sticking to the bottom/top of scene\n\t\t\t\tif(pitch > 70){\n\t\t\t\t\tpitch = 70;\n\t\t\t\t\tcurrentRotateX = -850;\n\t\t\t\t}\n\t\t\t\tif(pitch < -70){\n\t\t\t\t\tpitch = -70;\n\t\t\t\t\tcurrentRotateX = 850;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Should be in radians first\n\t\t\t\tvar pitchInRadians = utility.toRadians(pitch);\n\t\t\t\tvar yawInRadians = utility.toRadians(yaw);\n\n\t\t\t\tcameraTarget[0] = Math.cos(pitchInRadians) * Math.cos(yawInRadians);\n\t\t\t\tcameraTarget[1] = Math.sin(pitchInRadians);\n\t\t\t\tcameraTarget[2] = Math.cos(pitchInRadians) * Math.sin(yawInRadians);\n\n\t\t\t\tm4.normalize(cameraTarget);\n\t\t});\t\t\n\t}", "@action moveXAndY(finalX, finalY) {\n if (this.x === finalX && this.y === finalY) {\n return true\n }\n\n const actualSpeed = this.speed / (1000 / GAME_REFRESH_RATE)\n\n // use polar coordinates to generate X and Y given target destination\n const deltaX = finalX - this.x\n const deltaY = finalY - this.y\n let distance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2))\n distance = Math.min(actualSpeed, distance)\n const angle = this.getAngleToPoint(finalX, finalY)\n\n const xMovement = distance * Math.cos(angle)\n const yMovement = distance * Math.sin(angle)\n\n // round current position coordinate to two decimals\n this.x = Math.round((this.x + xMovement) * 100) / 100\n this.y = Math.round((this.y + yMovement) * 100) / 100\n }", "pan(deltaX, deltaY) {\n const offset = new T.Vector3()\n const element = this.domElement === document ? this.domElement.body : this.domElement\n if (this.object instanceof T.PerspectiveCamera) {\n const position = this.object.position\n offset.copy(position).sub(this.target)\n let targetDistance = offset.length()\n targetDistance *= Math.tan((this.object.fov/2)*Math.PI/180.0 )\n this.panLeft(2*deltaX*targetDistance/element.clientHeight, this.object.matrix)\n this.panUp(2 * deltaY * targetDistance / element.clientHeight, this.object.matrix)\n } else if (this.object instanceof T.OrthographicCamera) {\n this.panLeft(deltaX * (this.object.right - this.object.left) / this.object.zoom / element.clientWidth, this.object.matrix )\n this.panUp( deltaY * (this.object.top - this.object.bottom) / this.object.zoom / element.clientHeight, this.object.matrix )\n } else this.enablePan = false\n }", "move(elapsed_time) {\n\t\tthis.coordinates.x += this._vx * elapsed_time;\n\t\tthis.coordinates.y += this._vy * elapsed_time;\n\t}", "autoMove() {\n this.x += this.dx * this.dxv;\n if( this.x > 535) {\n this.x += -540;\n } else if (this.x < -40) {\n this.x =+ 500;\n }\n this.y += this.dy * this.dyv;\n }", "function cameraEdgeTeleportControl() {\n\n if(controls.target.x > 90){\n controls.target.x = -395;\n camera.position.x = -395;\n\n }\n\n if(controls.target.x < -395){\n controls.target.x = 90;\n camera.position.x = 90;\n }\n\n if(controls.target.y > 90){\n controls.target.y = -150;\n camera.position.y = -150;\n }\n\n if(controls.target.y < -150){\n controls.target.y = 90;\n camera.position.y = 90;\n }\n\n}", "move(p5) {\n let prevX, prevY;\n if (this.x != null && this.y != null) {\n prevX = this.x;\n prevY = this.y;\n\n //position and destination are different, move\n if (this.x !== this.destinationX || this.y !== this.destinationY) {\n //a series of vector operations to move toward a point at a linear speed\n\n // create vectors for position and dest.\n let destination = p5.createVector(this.destinationX, this.destinationY);\n let position = p5.createVector(this.x, this.y);\n\n // Calculate the distance between your destination and position\n let distance = destination.dist(position);\n\n // this is where you actually calculate the direction\n // of your target towards your rect. subtraction dx-px, dy-py.\n let delta = destination.sub(position);\n\n // then you're going to normalize that value\n // (normalize sets the length of the vector to 1)\n delta.normalize();\n\n // then you can multiply that vector by the desired speed\n let increment = delta.mult((this.speed * p5.deltaTime) / 1000);\n\n /*\n IMPORTANT\n deltaTime The system variable deltaTime contains the time difference between \n the beginning of the previous frame and the beginning of the current frame in milliseconds.\n the speed is not based on the client framerate which can be variable but on the actual time that passes\n between frames. \n */\n\n position.add(increment);\n //update x and y value\n this.x = p5.round(position.x);\n this.y = p5.round(position.y);\n }\n }\n }", "setPosition(x, y) {\n if (x instanceof p5.Vector) this.position.set(x.x, x.y);\n else this.position.set(x, y);\n }", "move() {\n let xDiff = this.xTarget - this.x + 5; // Blumenmitte\n let yDiff = this.yTarget - this.y;\n if (Math.abs(xDiff) < 1 && Math.abs(yDiff) < 1)\n this.setRandomFlowerPosition();\n else {\n this.x += xDiff * this.speed;\n this.y += yDiff * this.speed;\n }\n }", "function setupCamera() {\r\n\t\r\n\t\t// Rotate along temp in world coordinates\t\r\n\t\tvar yAxisInModelSpace = vec3.fromValues(mwMatrix[1], mwMatrix[5], mwMatrix[9]);\r\n\t\tmat4.rotate(mwMatrix, mwMatrix, -rotX/180*Math.PI, yAxisInModelSpace); \r\n\t\trotX = 0;\r\n\t\t\r\n\t\t// Rotate along the (1 0 0) in world coordinates\r\n\t\tvar xAxisInModelSpace = vec3.fromValues(mwMatrix[0], mwMatrix[4], mwMatrix[8]);\r\n\t\tmat4.rotate(mwMatrix, mwMatrix, -rotY/180*Math.PI, xAxisInModelSpace);\r\n\t\trotY = 0;\t\t\t\t\r\n\t}", "updateXY() {\n this.boundsCheck();\n\n this.rotation += this.vr * Math.PI / 180;\n\n if (this.rotation < -6.283185) {\n this.rotation = 0;\n }\n\n if (this.rotation > 6.283185) {\n this.rotation = 0;\n }\n\n console.log(this.rotation);\n\n this.moveVector = this.velocity.scalarMultiplyNew(0.0);\n\n this.velocity.x += Math.cos(this.rotation) * this._thrust;\n this.velocity.y += Math.sin(this.rotation) * this._thrust;\n\n this.position.x += this.velocity.x;\n this.position.y += this.velocity.y;\n }", "function teleport(x,y){\n player.x = x;\n player.y = y;\n cameraX = 0;\n cameraY = 0;\n speedY = 0;\n speedX = 0;\n}", "public function act(){\n\t\tmodel.transform.localPosition = relativePosition;\n\t\t//Does nothing\n\t}", "setTarget(x, y) {\n this.targetX = x;\n this.targetY = y;\n //Check if the distance is a lot (40 min)\n //console.log(x - this.x);\n // this.setPosition(x, y);\n }", "move() {\r\n this.x = this.x + this.v;\r\n }", "move(direction) {\n const d = direction === 'right' ? 1 : -1;\n const dx = this.x + d * this.speed;\n // limit the x coordinate to the canvas plus minus the size of the tank\n this.x = constrain(\n dx,\n -CANVAS_WIDTH / 2 + this.width / 2,\n CANVAS_WIDTH / 2 - this.width / 2\n );\n }", "function moveX(){\n if (isMovingRight) {\n megamanXSpeed = (4*xScaler);\n megamanDirection = 1;\n }\n if (isMovingLeft) {\n megamanXSpeed = (-4*xScaler);\n megamanDirection = -1\n }\n }", "move() {\n this.x = mouseX;\n this.y = mouseY;\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n\n if (this.x + this.vx < 0 + this.size / 2 || this.x + this.vx > width - this.size / 2) {\n this.vx = -this.vx;\n }\n\n if (this.y + this.vy < 0 + this.size || this.y + this.vy > cockpitVerticalMask - this.size) {\n //this.speed = -this.speed;\n this.vy = -this.vy;\n }\n\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n //increases enemy's size every frame,\n this.size += this.speed / 10;\n //constrain enemies on screen\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, 0, height * 75 / 100);\n }", "move() {\n // if (!this.noClip)\n // for (let i in gameObjects) {\n // \tlet a = gameObjects[i];\n // \tif (this.collider.isOverlap(a.collider)) \n // \t\treturn;\n // }\n if (this.canMoveX()) {\n this.position.x += this.velocity.x;\n }\n if (this.canMoveY()) {\n this.position.y += this.velocity.y;\n }\n }", "Move (x, y) {\n this.previous_position = this.copy\n this.vel.x = x \n }", "function Move () {\n\t//Debug.Log(GameObject.position.x);\n\t// Move avatar forward constantly\n\t\n\t// Call in Update()\n\tif (isMoving == true) {\n\t\t//Debug.Log(\"Moving\");\n\t\ttransform.position.x += 0.05;\n\t\t}\n\telse {\n\t\tStop();\n\t\t}\n}", "move(){\r\n this.x += this.dx;\r\n this.y += this.dy;\r\n\r\n }", "moveForward() {\n this._currentLinearSpeed = this._linearSpeed;\n this._currentAngularSpeed = 0;\n }", "moveTo(x, y) {\n\n this.tr.x = x;\n this.tr.y = y;\n }", "move(dx, dy, canvasWidth, canvasHeight) {\n this.x = clamp(this.x + dx, 0, canvasWidth - this.WIDTH);\n this.y = clamp(this.y + dy, 0, canvasHeight - this.HEIGHT);\n }", "function movePlayer(direction) {\n player.move(direction);\n updateActionCam();\n}", "lookAt(x, y, z) {\n this.controls.target.x = x;\n this.controls.target.y = y;\n this.controls.target.z = z;\n this.controls.update();\n }", "move() \n\t{\n\t\tthis.raindrop.nudge(0,-1,0);\n\n\t\tif (this.raindrop.getY() <= this.belowplane ) \n\t\t{\n\t\t\t//setting the y value to a certain number\n\t\t\tthis.raindrop.setY(random(200,400))\n\t\t}\n\t}", "move() {\n this.position = Utils.directionMap[this.orientation].move(this.position)\n this.log(`I moved and now at x: ${this.position.x} y: ${this.position.y}`)\n }", "_cameraChange(coords) {\n const positionX = coords.cameraTransform.position[0];\n const positionY = coords.cameraTransform.position[1];\n const positionZ = coords.cameraTransform.position[2];\n const forwardX = coords.cameraTransform.forward[0];\n const forwardY = coords.cameraTransform.forward[1];\n const forwardZ = coords.cameraTransform.forward[2];\n this.setState({\n force: [forwardX * 10, forwardY * 10, forwardZ * 10]\n })\n if (this.ball) {\n this.ball.setNativeProps({\n position: [positionX, positionY, positionZ]\n })\n }\n }", "setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n this.scene.add(this.camera.container);\r\n\r\n // update camera position per frame\r\n this.time.on('update', () => {\r\n if (this.world && this.world.car) { // if car is on the scene\r\n this.camera.target.x = this.world.car.chassis.object.position.x;\r\n this.camera.target.y = this.world.car.chassis.object.position.y;\r\n this.camera.target.z = this.world.car.chassis.object.position.z;\r\n this.camera.direction.x = this.world.car.movement.direction.x;\r\n this.camera.direction.y = this.world.car.movement.direction.y;\r\n }\r\n });\r\n }", "function CameraCommand_Scroll_Moving()\n{\n\t//in touch mode?\n\tif (__BROWSER_IS_TOUCH_ENABLED)\n\t{\n\t\t//copy the target area\n\t\tvar newArea = new Position_GetPosition(this.ScrollTarget);\n\t\t//while the Parents are different\n\t\tfor (var theHTML = Get_ParentForScrollCrop(this.ScrollTarget); theHTML != document.body; theHTML = Get_ParentForScrollCrop(theHTML))\n\t\t{\n\t\t\t//Iframes require scrolling into their body, not the frame itself\n\t\t\tvar scrollableHTML = Get_ScrollingElement(theHTML);\n\t\t\t//adjust the target area\n\t\t\tnewArea.left += Browser_GetLeft(theHTML) - scrollableHTML.scrollLeft;\n\t\t\tnewArea.top += Browser_GetTop(theHTML) - scrollableHTML.scrollTop;\n\t\t\tnewArea.width = Math.min(newArea.width, Browser_GetOffsetWidth(theHTML) + theHTML.scrollLeft - newArea.left);\n\t\t\tnewArea.height = Math.min(newArea.height, Browser_GetOffsetHeight(theHTML) + theHTML.scrollTop - newArea.top);\n\t\t}\n\t\tswitch (this.ScrollDirection)\n\t\t{\n\t\t\tcase __CAMERA_CMD_SCROLL_UP:\n\t\t\tcase __CAMERA_CMD_SCROLL_DOWN:\n\t\t\t\t//trigger a scroll animation (remember first in last out)\n\t\t\t\tthis.Camera.Commands.push(new CameraCommand_Animation(this.Camera, __CAMERA_UI_TYPE_SCROLL_VERT));\n\t\t\t\tbreak;\n\t\t\tcase __CAMERA_CMD_SCROLL_LEFT:\n\t\t\tcase __CAMERA_CMD_SCROLL_RIGHT:\n\t\t\t\t//trigger a scroll animation (remember first in last out)\n\t\t\t\tthis.Camera.Commands.push(new CameraCommand_Animation(this.Camera, __CAMERA_UI_TYPE_SCROLL_HORZ));\n\t\t\t\tbreak;\n\t\t}\n\t\t//notify the target area\n\t\tthis.Camera.NotifyTargetArea(newArea);\n\t\t//move to its center\n\t\tthis.Camera.Commands.push(new CameraCommand_Move(this.Camera, newArea.left + newArea.width / 2, newArea.top + newArea.height / 2));\n\t}\n\telse\n\t{\n\t\t//transform the scroll area to camera parent\n\t\tvar targetArea = this.TransformToParent(document.body);\n\t\t//notify the target area\n\t\tthis.Camera.NotifyTargetArea(targetArea);\n\t\t//move to its center\n\t\tthis.Camera.Commands.push(new CameraCommand_Move(this.Camera, (targetArea.left + targetArea.width / 2), (targetArea.top + targetArea.height / 2)));\n\t}\n\t//advance to scrolling\n\tthis.State = __CAMERA_CMD_STATE_SCROLLING;\n}", "movePosition() {\n const toX = (this.destination.x - this.position.x) * this.ease;\n const toY = (this.destination.y - this.position.y) * this.ease;\n\n this.isPanning = (Math.abs(toX) > this.treshold || Math.abs(toY) > this.treshold);\n\n this.position.x += toX;\n this.position.y += toY;\n \n // Round up the values to 2 decimals\n this.position.x = Math.round(this.position.x * 100) / 100;\n this.position.y = Math.round(this.position.y * 100) / 100;\n\n // How much has it moved form it's initial position ?\n this.offsetFromOrigin.x = ~~(.5 * this.size.offsetX - this.position.x);\n this.offsetFromOrigin.y = ~~(.5 * this.size.offsetY - this.position.y);\n }", "moveBall() {\n this.ball.X += this.ball.dx;\n this.ball.Y += this.ball.dy;\n }", "function animate() { \n rotate(system);\n revolve(system);\n requestAnimationFrame(animate); //Get frame \n renderer.render(scene, camera); //Render\n controls.target = controls.objectToFollow.getWorldPosition(ORIGIN);\n controls.update();\n}", "moveTo(x, y) {\n this.x = x;\n this.y = y;\n }", "lookAtCenter() {\n if (this.viewport) {\n this.viewport.update();\n }\n if (this.controls) {\n this.controls.reset();\n }\n this.updateScene();\n }", "updatePosition() {\n this.xOld = this.x;\n this.yOld = this.y;\n \n this.velX *= this.friction;\n this.velY *= this.friction;\n\n if (Math.abs(this.velX) > this.velMax)\n this.velX = this.velMax * Math.sign(this.velX);\n \n if (Math.abs(this.velY) > this.velMax)\n this.velY = this.velMax * Math.sign(this.velY);\n \n this.x += this.velX;\n this.y += this.velY;\n }", "animate(){\n\n this.jump();\n\n this.move();\n\n this.applyGravity();\n\n this.applyCollisions();\n\n this.controlAnimations();\n\n this.checkSkyboxBounds();\n\n this.directionalLightObject.position.set(\n this.scene.crosshair.position.x+1,\n this.scene.crosshair.position.y+1,\n this.scene.crosshair.position.z+1\n )\n\n //}\n\n }", "function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}" ]
[ "0.7103392", "0.70698553", "0.7021567", "0.690013", "0.6737478", "0.6677076", "0.6602707", "0.65754235", "0.653087", "0.65242475", "0.6485809", "0.6482012", "0.64480805", "0.6418192", "0.6376169", "0.6369993", "0.63421035", "0.63374376", "0.6336548", "0.63209236", "0.63131386", "0.62962574", "0.6255745", "0.62521803", "0.6231516", "0.62072724", "0.6192729", "0.6189053", "0.6175501", "0.6168167", "0.61587226", "0.61501145", "0.61281765", "0.612417", "0.6123852", "0.61177295", "0.61081797", "0.6107671", "0.61043656", "0.6098957", "0.60876983", "0.6075766", "0.6057676", "0.60380363", "0.60283977", "0.60262305", "0.60221595", "0.60128736", "0.6012352", "0.599682", "0.5989505", "0.5985119", "0.5968224", "0.59600115", "0.5958732", "0.5955628", "0.5946736", "0.5940916", "0.59308", "0.5925087", "0.5921471", "0.5920831", "0.59179515", "0.5913355", "0.59126526", "0.58970165", "0.5896319", "0.5892615", "0.58807313", "0.58789945", "0.5875344", "0.5868054", "0.58529955", "0.5841398", "0.5830947", "0.5830373", "0.582665", "0.5820241", "0.58173865", "0.58154386", "0.58088636", "0.58060956", "0.5800246", "0.5787662", "0.5784997", "0.57656956", "0.5763146", "0.57589626", "0.57563984", "0.57513803", "0.5741681", "0.57388574", "0.5733017", "0.5719094", "0.57090294", "0.57044166", "0.5700156", "0.56949246", "0.56809044", "0.5679413" ]
0.74697953
0
Rotate the camera around the target.
function rotate(dx, dy) { // Update rotations, and limit the vertical angle so it doesn't flip. // Since the camera uses a quaternion, flips don't matter to it, but this feels better. horizontalAngle += dx * ROTATION_SPEED; verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01)); camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rotate() {\n if (!this.rotation) {\n return;\n }\n this.ctx.translate(this.x - state.cameraX + this.width / 2, this.y);\n this.ctx.rotate(this._degToRad(this.rotation + 90));\n this.ctx.translate(-this.x + state.cameraX - this.width / 2, -this.y);\n }", "rotate() {\n\t\tthis.scene.rotate(-Math.PI / 2, 1, 0, 0);\n\t}", "function MoveAndRotate(targetPosition:Vector3) {\n\tvar thisPosition:Vector3 = transform.position; // create a local variable to hold this info since we access it often and we need to change it slightly\n\ttargetPosition = Vector3(targetPosition.x,thisPosition.y,targetPosition.z);// set y to us for no moving up/ pointing up\n\n\ttransform.position = Vector3.SmoothDamp(thisPosition,targetPosition,velocity,smoothTime,maxSpeed);// move closer to target\n\n\tvar toRotation:Quaternion;\n\tif (targetPosition - thisPosition != Vector3.zero) {// as long as the view change is not zero\n\t\ttoRotation = Quaternion.LookRotation(targetPosition - thisPosition);// set a target rotation\n\t}\n\ttransform.rotation = Quaternion.RotateTowards(transform.rotation,toRotation,maxRotationSpeed);// rotate towords target max rotation speed controls how fast we rotate\n\t//////////\n\n}", "function moveCamera() {\n\n //where the user is currently scrolled to\n const t = document.body.getBoundingClientRect().top;\n\n moon.rotation.x += 0.05;\n moon.rotation.y += 0.075;\n moon.rotation.z += 0.05;\n\n ritam.rotation.z += 0.01\n ritam.rotation.y += 0.01 \n\n //changing the position of the actual camera\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.position.y = t * -0.0002;\n}", "function moveCamera() {\n // calculate where the user is currently\n const t = document.body.getBoundingClientRect().top;\n\n me.rotation.y += 0.01;\n me.rotation.x =+ 0.01;\n\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.rotation.y = t * -0.0002;\n \n}", "function moveCamera(e) {\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementY * Math.PI) / 400, // amount to rotate in radians\r\n [1, 0, 0]\r\n ); // axis to rotate around (Z)\r\n mat4.rotate(\r\n globalModelMatrix, // destination matrix\r\n globalModelMatrix, // matrix to rotate\r\n (-e.movementX * Math.PI) / 400, // amount to rotate in radians\r\n [0, 1, 0]\r\n );\r\n}", "rotate(rdelta) {\n this.rotation += rdelta\n this.tModelToWorld.setRotation(this.rotation)\n }", "function RotateTo(targetRotation: Quaternion, speed: float) { //set the rotation (by steps). Angular speed in degrees per sec. No limit of time.\n\tyield StartMoving(speed);\n\t\n\tvar step = speed * Time.deltaTime; //Need for be independt of frame rate. speed in m/s. The step size is equal to speed times frame time\n\t\n\twhile (true) {\n\t\ttransform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, step); //linear interpolattion. print(\"euler = \" + transform.eulerAngles);\n\t\tif (Quaternion.Angle(transform.rotation, targetRotation) < angleLookAt) { //difference between rotations\n\t\t\t//print(\"rotateTo tagetRotation breakk\");\n\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\tyield;\n\t}\n\t\n\tyield EndMoving();\n}", "rotate(azimuthAngle, polarAngle, enableTransition) {\n \n this.rotateTo(\n this._sphericalEnd.theta + azimuthAngle,\n this._sphericalEnd.phi + polarAngle,\n enableTransition\n )\n \n }", "function moveCamera() {\n const current = document.body.getBoundingClientRect().top;\n // tours.rotation.x += current * 0.0001;\n // camera.position.x = current * 0.002;\n // camera.position.z = current * -0.04;\n // camera.position.x = current * 0.02;\n}", "set rotation(value) {\n if (this._freezeRotation !== undefined) {\n this._freezeRotation = deg2rad(value);\n }\n if (this.isNone()) {\n this.target.rotation = value;\n } else {\n let pos = this._worldPosition.get();\n this.rigidBody.setRotation(deg2rad(value));\n this._worldPosition.setPoint(pos);\n }\n }", "rotate(direction) {\n this.turret.rotate(direction);\n this.thruster.rotate(direction);\n }", "setRotation(rotation) {\n this.rotation = rotation\n this.tModelToWorld.setRotation(rotation)\n }", "smooth_camera()\n {\n this.camera_angle = this.camera_angle + (this.target_angle - this.camera_angle) * .2;\n }", "function Start() {\n\t// transform.Rotate(-90,0,0);\n}", "function setOrientation(orientation){\n if(orientation)\n camera.rotation.z=Math.PI/2; ///=+\n else\n camera.rotation.z=0;\n}", "animate() {\n this.graphics.rotation = this.rotateClockwise\n ? this.graphics.rotation + this.rotateSpeed\n : this.graphics.rotation - this.rotateSpeed\n }", "onUpdateRotation() {\n this.wall.setRotationFromEuler(new THREE.Euler().setFromVector3(this.rotation.clone()));\n }", "rotate(angleInRadians) {\n this.rotation = angleInRadians;\n }", "rotate() {\n const now = Date.now();\n const delta = now - this.lastUpdate;\n this.lastUpdate = now;\n\n this.setState({rotation: this.state.rotation + delta / 20});\n this.frameHandle = requestAnimationFrame(this.rotate);\n }", "rotateAbout (origin, theta) {\n let tempOrigin = this.tempPosition.minus(origin);\n tempOrigin = tempOrigin.xyz1times(new Mat4().set().rotate(theta));\n tempOrigin.add(origin);\n this.position = tempOrigin;\n this.orientation = this.tempOrientation + theta;\n }", "function rotateunit(unit,target){\n\n // This will probably be moved out later\n if (movecommand.x < 0) {return};\n if ((Math.abs(unit.x-target.x) > 15) || (Math.abs(unit.y-target.y) > 15)) {\n moveunit(unit);\n } else {\n return\n }\n var rotation = unit.direction - Math.atan2(target.x-unit.x,target.y-unit.y);\n\n\n if (rotation > Math.PI) {\n rotation -= Math.PI*2\n } else if (rotation < Math.PI * -1) {\n rotation += Math.PI*2\n }\n\n if (unit.direction > Math.PI) {\n unit.direction -= Math.PI*2\n } else if (unit.direction < Math.PI * -1) {\n unit.direction += Math.PI*2\n }\n\n if (rotation > 0.2) {\n unit.direction -= 0.2;\n }\n else if (rotation < -0.2) {\n unit.direction += 0.2;\n }\n}", "function camRot(angle) {\n if (angle !== undefined) {\n game.cam.angle = angle;\n }\n return game.cam.angle;\n }", "lookAt(target) {\n let orientation = (target.x - this.x < 0) ? 'left' : 'right';\n this.setOrientation(orientation);\n }", "function FixedUpdate () {\n // Camera rotation with step 2 * time.deltaTime:\n mainCamera.transform.Rotate(0, 2 * time.deltaTime, 0);\n}", "setRotation(angle){\n this.rotation = angle;\n }", "_rotate() {\n this.attachmentViewer.update({ angle: this.attachmentViewer.angle + 90 });\n }", "function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "moveToTarget() {\n // Adjust heading using steering wheel\n if (this.targetHeading) {\n let rotationNeeded = this.targetHeading - this.heading;\n if (rotationNeeded > PI) rotationNeeded -= TWO_PI;\n if (rotationNeeded < -PI) rotationNeeded += TWO_PI;\n \n console.log(degrees(rotationNeeded));\n \n this.steeringWheel = max(-1, min(1, this.steeringWheel + rotationNeeded * 0.12));\n \n // Lose target if no rotation is needed\n if (abs(rotationNeeded) < 0.002 ) {\n this.targetHeading = null;\n }\n }\n }", "rotateTo(azimuthAngle, polarAngle, enableTransition) {\n \n const theta = Math.max(this.minAzimuthAngle, Math.min(this.maxAzimuthAngle, azimuthAngle))\n const phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, polarAngle))\n \n this._sphericalEnd.theta = theta\n this._sphericalEnd.phi = phi\n this._sphericalEnd.makeSafe()\n \n if (!enableTransition) {\n \n this._spherical.theta = this._sphericalEnd.theta\n this._spherical.phi = this._sphericalEnd.phi\n \n }\n \n this._hasUpdated = true\n \n }", "function LateUpdate () {\n\t\n\tcameraRot.x += mouseY * camSpeed;\n\t\n\tcameraRot.x = Mathf.Clamp(cameraRot.x,minAngle, maxAngle);\t\n\t\n\tthisTransform.localEulerAngles = cameraRot;\n\n}", "_applyRotation() {\n this.quaternion.setFromVec3(this.rotation);\n // we should update the plane mvMatrix\n this._updateMVMatrix = true;\n }", "setRotate(rq) {\nE3Vec.setRotateV3(this.xyz, rq.xyzw);\nreturn this;\n}", "function Update (){\n\ttransform.Rotate(Vector3(0,rotationSpeed * 10,0) * Time.deltaTime);\n}", "rotateCamera(){\n\t\tif(this.state.rotationIndex==1){\n\t\t\tdocument.getElementById('on1').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 2, in: 87, out: 83, left: 65, right: 68});\n\t\t}else if(this.state.rotationIndex==2){\n\t\t\tdocument.getElementById('on2').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 3, in: 65, out: 68, left: 83, right: 87});\n\t\t}else if(this.state.rotationIndex==3){\n\t\t\tdocument.getElementById('on3').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 4, in: 83, out: 87, left: 68, right: 65});\n\t\t}else if(this.state.rotationIndex==4){\n\t\t\tdocument.getElementById('on4').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 1, in: 68, out: 65, left: 87, right: 83});\n\t\t}\n\t}", "function CameraController() {\n\n //Specifying if camera shall rotate around its own axis or around the scenes zero point\n var rotateAroundZero = true;\n\n /**\n * translating the camera in z-direction, to zoom in odr out the scene\n * @param camera {THREE.Camera} is the camera which will be translated\n * @param value how far the translation shall be\n */\n this.zoomCamera = function(camera, value) {\n camera.translateZ(value);\n }\n\n /**\n * Rotation the camera. Two options are possible depending on the class-value:\n * The camera can be rotated around its own zero-point, or around the worlds zero-point.\n * @param camera to rotate{THREE.Camera}\n * @param rotateVector the avis to rotate around\n */\n this.rotateCamera = function(camera, rotateVector) {\n\n // Rotation-vector needs to be normalized\n rotateVector = rotateVector.normalize();\n\n var up = new THREE.Vector3(0, 1, 0);\n var left = new THREE.Vector3(1, 0, 0);\n\n console.log(\"RotateVector.x: \" + rotateVector.x + \" RotateVector.y: \" + rotateVector.y);\n\n // Calculating the distance to the scenes center\n var distance = camera.position.length();\n\n var cameraDirection = new THREE.Vector3(0, 0, 1);\n\n if(rotateAroundZero) {\n // If rotate around scenes center camera shall always look in this direction\n camera.lookAt(new THREE.Vector3(0, 0, 0));\n\n // Translating the camera to the scenes center\n var vector = new THREE.Vector3();\n vector.copy(cameraDirection);\n vector.multiplyScalar(-distance);\n camera.translateOnAxis(cameraDirection, -distance);\n }\n\n // Rotate the camera around the rotateVector. Rotation around view-direction of camera is not allowed.\n camera.rotateOnAxis(up, rotateVector.x * 0.02);\n camera.rotateOnAxis(left, rotateVector.y * 0.02);\n\n // if camera shall rotate around scene centre, camera needs to be translated back around the same distance\n // along cameras, z-axis.\n if(rotateAroundZero) {\n camera.translateOnAxis(cameraDirection, distance);\n console.log(\"Camera.position: \" + vectorToString(camera.position))\n }\n\n }\n\n /**\n * Move camera on viewplane\n * @param camera to move\n * @param moveVector the vector the camera shall moved on.\n */\n this.moveCamera = function (camera, moveVector) {\n camera.translateX(moveVector.x);\n camera.translateY(-moveVector.y);\n\n }\n\n /**\n * Specify if camera shall rotate around scene centre.\n * @param shallRotateAroundZero true if shall around zero. false if shall rotate around own axis.\n */\n this.setRotateAroundZero = function(shallRotateAroundZero) {\n rotateAroundZero = shallRotateAroundZero;\n }\n\n\n\n}", "updateAnimation() {\n var translateToOrigin = new Matrix4 ();\n var rotateInPlace = new Matrix4 ();\n var translateBack = new Matrix4 ();\n\n translateToOrigin.setTranslate(-this.x[0], -this.y[0], 0);\n rotateInPlace.setRotate(4, 0, 0, 1);\n translateBack.setTranslate(this.x[0], this.y[0], 0);\n\n this.modelMatrix = translateToOrigin.multiply(this.modelMatrix);\n this.modelMatrix = rotateInPlace.multiply(this.modelMatrix);\n this.modelMatrix = translateBack.multiply(this.modelMatrix);\n \n //this.modelMatrix.setLookAt(0, -1, 1, 0, 0, 0, 0, 0, 1.903);\n }", "function setupCamera() {\r\n\t\r\n\t\t// Rotate along temp in world coordinates\t\r\n\t\tvar yAxisInModelSpace = vec3.fromValues(mwMatrix[1], mwMatrix[5], mwMatrix[9]);\r\n\t\tmat4.rotate(mwMatrix, mwMatrix, -rotX/180*Math.PI, yAxisInModelSpace); \r\n\t\trotX = 0;\r\n\t\t\r\n\t\t// Rotate along the (1 0 0) in world coordinates\r\n\t\tvar xAxisInModelSpace = vec3.fromValues(mwMatrix[0], mwMatrix[4], mwMatrix[8]);\r\n\t\tmat4.rotate(mwMatrix, mwMatrix, -rotY/180*Math.PI, xAxisInModelSpace);\r\n\t\trotY = 0;\t\t\t\t\r\n\t}", "setRotation(r) {\n // console.log('setrotation', r)\n this.a = Math.cos(r)\n this.b = -Math.sin(r)\n this.d = Math.sin(r)\n this.e = Math.cos(r)\n // console.log(this)\n }", "function UpdateRotateTo(targetPos: Vector3, speed : float) {\n\tif (Mathf.Abs(AngleToPosition(targetPos)) <= angleLookAt) {\n\t\tmoveSpeed = 0;\n\t\treturn false;\n\t}\n\t\n\tmoveSpeed = speed;\n\tvar targetRotation = Quaternion.LookRotation(targetPos - transform.position);\n\ttargetRotation.x = transform.rotation.x; //we only want to change the y component, so x and z will be no modified\n\ttargetRotation.z = transform.rotation.z;\n\ttransform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, speed * Time.deltaTime);\n\treturn true;\n}", "rotate(angle, x, y, z){\n return this.multiply(new Matrix4().setRotate(angle, x, y, z));\n }", "function animate() { \n rotate(system);\n revolve(system);\n requestAnimationFrame(animate); //Get frame \n renderer.render(scene, camera); //Render\n controls.target = controls.objectToFollow.getWorldPosition(ORIGIN);\n controls.update();\n}", "function draw() {\n background(\"white\");\n translate(300, 300);\n rotate(rotateBy);\n makeArm(rotateBy);\n rotateBy += 2; // I thought this was controlling the speed of the rotation, but this still confuses me.\n}", "function move_camera( event ){\n\tvar delta_x = event.clientX - previous_camera.x;\n\tvar delta_y = event.clientY - previous_camera.y;\n\n\tdirection = 1;\n\tangle_x += direction * delta_x/200;\n\tdirection = -1;\n\tangle_y += direction * delta_y/200;\n\n\t//restrict Y axis movement beyond 0 < y < 180 degrees\n\tangle_y = angle_y < 0.1 ? 0.1: angle_y;\n\tangle_y = angle_y > Math.PI-0.1 ? Math.PI-0.1: angle_y;\n\n\tvar x = 300 * Math.cos( angle_x ) * Math.sin( angle_y );\n\tvar z = 300 * Math.sin( angle_x ) * Math.sin( angle_y );\n\tvar y = 300 * Math.cos( angle_y );\n\n\tcamera.position.set( x, y, z );\n\tcamera.lookAt( board_base.position );\n}", "function resetCamera() {\n mainCamera.setAttribute(\"rotation\", \"0 0 0\");\n mainCamera.setAttribute(\"position\", \"0 1.6 0\");\n}", "rotate(angle) {\n this.heading += angle;\n let index = 0;\n for (let a = -this.fov; a < this.fov; a += 1) {\n this.rays[index].setAngle(radians(a) + this.heading);\n index++;\n }\n }", "function setupCamera(scene) {\n let canvas = scene.viewer.canvas;\n let camera = scene.camera;\n let MOVE_SPEED = 2;\n let ZOOM_SPEED = 30;\n let ROTATION_SPEED = 1 / 200;\n let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0};\n let right = vec3.create();\n let up = vec3.create();\n let horizontalAngle = -Math.PI / 2;\n let verticalAngle = -Math.PI / 4;\n let cameraTarget = vec3.create(); // What the camera orbits.\n\n // Initial setup, go back a bit and look forward.\n camera.move([0, -400, 0]);\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n\n // Move the camera and the target on the XY plane.\n function move(x, y) {\n let dirX = camera.directionX;\n let dirY = camera.directionY;\n\n // Allow only movement on the XY plane, and scale to MOVE_SPEED.\n vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED);\n vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED);\n\n camera.move(right);\n camera.move(up);\n\n // And also move the camera target to update the orbit.\n vec3.add(cameraTarget, cameraTarget, right);\n vec3.add(cameraTarget, cameraTarget, up);\n }\n\n // Rotate the camera around the target.\n function rotate(dx, dy) {\n // Update rotations, and limit the vertical angle so it doesn't flip.\n // Since the camera uses a quaternion, flips don't matter to it, but this feels better.\n horizontalAngle += dx * ROTATION_SPEED;\n verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01));\n\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n }\n\n // Zoom the camera by moving forward or backwards.\n function zoom(factor) {\n // Get the forward vector.\n let dirZ = camera.directionZ;\n\n camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED));\n }\n\n /*\n // Resize the canvas automatically and update the camera.\n function onResize() {\n let width = canvas.clientWidth;\n let height = canvas.clientHeight;\n\n canvas.width = width;\n canvas.height = height;\n\n camera.viewport([0, 0, width, height]);\n camera.perspective(Math.PI / 4, width / height, 8, 100000);\n }\n\n window.addEventListener(\"resize\", function(e) {\n onResize();\n });\n\n onResize();\n */\n\n // Track mouse clicks.\n canvas.addEventListener(\"mousedown\", function(e) {\n e.preventDefault();\n\n mouse.buttons[e.button] = true;\n });\n\n // And mouse unclicks.\n // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas.\n window.addEventListener(\"mouseup\", (e) => {\n e.preventDefault();\n\n mouse.buttons[e.button] = false;\n });\n\n // Handle rotating and moving the camera when the mouse moves.\n canvas.addEventListener(\"mousemove\", (e) => {\n mouse.x2 = mouse.x;\n mouse.y2 = mouse.y;\n mouse.x = e.clientX;\n mouse.y = e.clientY;\n\n let dx = mouse.x - mouse.x2;\n let dy = mouse.y - mouse.y2;\n\n if (mouse.buttons[0]) {\n rotate(dx, dy);\n }\n\n if (mouse.buttons[2]) {\n move(-dx * 2, dy * 2);\n }\n });\n\n // Handle zooming when the mouse scrolls.\n canvas.addEventListener(\"wheel\", (e) => {\n e.preventDefault();\n\n let deltaY = e.deltaY;\n\n if (e.deltaMode === 1) {\n deltaY = deltaY / 3 * 100;\n }\n\n zoom(deltaY / 100);\n });\n\n // Get the vector length between two touches.\n function getTouchesLength(touch1, touch2) {\n let dx = touch2.clientX - touch1.clientX;\n let dy = touch2.clientY - touch1.clientY;\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // Touch modes.\n let TOUCH_MODE_INVALID = -1;\n let TOUCH_MODE_ROTATE = 0;\n let TOUCH_MODE_ZOOM = 1;\n let touchMode = TOUCH_MODE_ROTATE;\n let touches = [];\n\n // Listen to touches.\n // Supports 1 or 2 touch points.\n canvas.addEventListener('touchstart', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (targetTouches.length === 1) {\n touchMode = TOUCH_MODE_ROTATE;\n } else if (targetTouches.length == 2) {\n touchMode = TOUCH_MODE_ZOOM;\n } else {\n touchMode = TOUCH_MODE_INVALID;\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n\n canvas.addEventListener('touchend', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n canvas.addEventListener('touchcancel', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n // Rotate or zoom based on the touch mode.\n canvas.addEventListener('touchmove', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (touchMode === TOUCH_MODE_ROTATE) {\n let oldTouch = touches[0];\n let newTouch = targetTouches[0];\n let dx = newTouch.clientX - oldTouch.clientX;\n let dy = newTouch.clientY - oldTouch.clientY;\n\n rotate(dx, dy);\n } else if (touchMode === TOUCH_MODE_ZOOM) {\n let len1 = getTouchesLength(touches[0], touches[1]);\n let len2 = getTouchesLength(targetTouches[0], targetTouches[1]);\n\n zoom((len1 - len2) / 50);\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n}", "function rotate(img) {\n img.target.src = 'img/rear.png';\n }", "rotateZ(angleInRadians) {\n const m = this.getCurrentMatrix();\n this.setCurrentMatrix(m4.rotateZ(m, angleInRadians));\n }", "rotate(theta, x, y, z){\n\t\tvar axis = new GFX.Vector(x,y,z);\n\t\tthis.rotation = this.rotation.mult(GFX.Quaternion.AxisAngle(axis.unit(), theta));\n\t}", "setRotationMatrix4(rotationMatrix4) {\n this.rotator.setRotationMatrix4(rotationMatrix4);\n }", "setRotationMatrix4(rotationMatrix4) {\n this.rotator.setRotationMatrix4(rotationMatrix4);\n }", "function RotateComponent(_ref) {\n var owner = _ref.owner;\n\n _classCallCheck(this, RotateComponent);\n\n var _this = _possibleConstructorReturn(this, (RotateComponent.__proto__ || Object.getPrototypeOf(RotateComponent)).call(this, { owner: owner }));\n\n _this.__rotation = _glMatrix.vec3.create();\n return _this;\n }", "changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }", "function Update() {\n transform.LookAt(target);\n}", "function animate() {\n if (rotate) {\n cube.rotation.x += rotateX;\n cube.rotation.y += rotateY;\n }\n\n // allow for controls to update. controls.update() must be called after any manual changes to the camera's transform\n controls.update();\n\n //call render\n renderer.render(scene, camera);\n\n // call animate again \n requestAnimationFrame(animate);\n}", "function Camera(game, target) {\n\tthis.game = game;\n\tthis.target = target;\n\tthis.origX = this.target.x;\n\tthis.curX = this.origX;\n\tthis.origY = this.target.y;\n\tthis.curY = this.origY;\n\tthis.cameraLock = false;\n}", "function rotatePano(){\n if(panoGo){\n heading-=0.0625;\n if(heading<0){\n heading+=360;\n }\n panorama.setPov({heading:heading,pitch:0});\n setTimeout(rotatePano,100);\n }\n}", "function Camera(x,y,z, yaw, pitch, roll) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y; \r\n\t\tthis.z = z;\r\n\r\n\t\t// Create Rotation Matrix\r\n\t\trotMatrix = mat4.create();\r\n\t\tmat4.identity(rotMatrix);\r\n\t\tmat4.rotate(rotMatrix, -degToRad(pitch), [1, 0, 0]);\r\n\t\tmat4.rotate(rotMatrix, -degToRad(yaw), [0, 1, 0]);\r\n\t\tmat4.rotate(rotMatrix, -degToRad(roll), [0, 0, 1]);\r\n\t\tthis.rotationMatrix = rotMatrix;\r\n\r\n\t\tthis.setRotation= setRotation; \r\n\t\tthis.rotateCamera = rotateCamera;\r\n\t\tthis.moveCamera = moveCamera;\r\n\t\tthis.moveCameraZX = moveCameraZX;\r\n\t\tthis.setCamera = setCamera;\r\n\t\tthis.rotation = rotation;\r\n\t\tthis.transform = transform;\r\n\t\tthis.reverseRotation = reverseRotation;\r\n\t\tthis.reverseTransform = reverseTransform;\r\n\r\n\t\tfunction setRotation(yaw, pitch, roll) {\r\n\t\t\t// Sets Rotation Matrix in Global Y P R\r\n\t\t\tmat4.identity(this.rotationMatrix);\r\n\t\t\tmat4.rotate(this.rotationMatrix, -degToRad(pitch), [1, 0, 0]);\r\n\t\t\tmat4.rotate(this.rotationMatrix, -degToRad(yaw), [0, 1, 0]);\r\n\t\t\tmat4.rotate(this.rotationMatrix, -degToRad(roll), [0, 0, 1]);\r\n\t\t}\r\n\t\tfunction rotateCamera(dyaw, dpitch, droll) {\r\n\t\t\t// Rotates around local axes\r\n\t\t\tvar newRotation = mat4.create();\r\n\t\t\tmat4.identity(newRotation);\r\n\t\t\tmat4.rotate(newRotation, -degToRad(dpitch), [1, 0, 0]);\r\n\t\t\tmat4.rotate(newRotation, -degToRad(dyaw), [0, 1, 0]);\r\n\t\t\tmat4.rotate(newRotation, -degToRad(droll), [0, 0, 1]);\r\n\t\t\tmat4.multiply(newRotation, this.rotationMatrix, this.rotationMatrix);\r\n\t\t}\r\n\t\tfunction moveCamera(dx,dy,dz) {\r\n\t\t\t/* \r\n\t\t\t* The transpose of the rotation matrix corresponds to:\r\n\t\t\t* LocalX.x \tLocalX.y \tLocalX.z \t0\r\n\t\t\t* LocalY.x \tLocalY.y \tLocalY.z \t0\r\n\t\t\t* LocalZ.x \tLocalZ.y \tLocalZ.z \t0\r\n\t\t\t* 0\t\t\t0\t\t\t0\t\t\t1\r\n\t\t\t*/\r\n\t\t\tthis.x += this.rotationMatrix[0]*dx + this.rotationMatrix[1]*dy + this.rotationMatrix[2]*dz;\r\n\t\t\tthis.y += this.rotationMatrix[4]*dx + this.rotationMatrix[5]*dy + this.rotationMatrix[6]*dz;\r\n\t\t\tthis.z += this.rotationMatrix[8]*dx + this.rotationMatrix[9]*dy + this.rotationMatrix[10]*dz;\r\n\t\t}\r\n\t\tfunction moveCameraZX(dx,dy,dz) {\r\n\t\t\t// Moves Camera clamps to x-z axis\r\n\t\t\tthis.x += this.rotationMatrix[0]*dx + this.rotationMatrix[2]*dz; // Probably need to normalise these\r\n\t\t\tthis.y += dy;\r\n\t\t\tthis.z += this.rotationMatrix[8]*dx + this.rotationMatrix[10]*dz; // Probably need to normalise these\r\n\t\t}\r\n\t\tfunction setCamera(x,y,z) {\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t\tthis.z = z;\r\n\t\t}\r\n\t\tfunction rotation(vector) {\r\n\t\t\tmat4.multiplyVec3(this.rotationMatrix, vector, vector);\r\n\t\t}\r\n\t\tfunction transform(vector) { // Converts from Global to Camera Coordinates\r\n\t\t\tvar cameraTransform = mat4.create(this.rotationMatrix);\r\n\t\t\tmat4.translate(cameraTransform, [-this.x, -this.y, -this.z]);\r\n\t\t\tmat4.multiplyVec3(cameraTransform, vector, vector);\r\n\t\t}\r\n\t\tfunction reverseRotation(vector) {\r\n\t\t\tvar cameraRotation = mat4.create(this.rotationMatrix);\r\n\t\t\tmat4.transpose(cameraRotation);\r\n\t\t\tmat4.multiplyVec3(cameraRotation, vector, vector);\r\n\t\t}\r\n\t\tfunction reverseTransform(vector) { // Converts from Camera to Global Coordinates\r\n\t\t\tvar cameraTranslation = mat4.create();\r\n\t\t\tmat4.identity(cameraTranslation);\r\n\t\t\tmat4.translate(cameraTranslation, [this.x, this.y, this.z]);\r\n\t\t\tvar cameraRotation = mat4.create(this.rotationMatrix);\r\n\t\t\tmat4.transpose(cameraRotation);\r\n\t\t\tvar cameraTransform = mat4.create();\r\n\t\t\tmat4.multiply(cameraTranslation, cameraRotation, cameraTransform);\r\n\t\t\tmat4.multiplyVec3(cameraTransform, vector, vector);\r\n\t\t}\r\n\t}", "function animate() {\n var timeNow = new Date().getTime();\n if(lastTime!=0){\n var elapsed = timeNow - lastTime;\n if(speed != 0) {\n camera.eyeX -= Math.sin(degToRad(yaw)) * speed * elapsed;\n camera.eyeZ -= Math.cos(degToRad(yaw)) * speed * elapsed;\n }\n camera.lapX = Math.sin(degToRad(yaw))*1000;\n camera.lapZ = Math.cos(degToRad(yaw))*1000;\n yaw += yawRate*elapsed;\n\n }\n lastTime = timeNow;\n angle = chosenSpeed * (45.0 * lastTime) / 1000.0;\n // angle %= 360;\n}", "apply(){\n var transform = mat4.create();\n mat4.identity(transform);\n\n mat4.translate(transform, transform, [this.x_center,this.y_center,this.z_center]);\n mat4.rotate(transform, transform, this.elapsedAngle, [0, 1, 0]);\n\n mat4.translate(transform,transform,[this.radius,0,0]);\n\n if(this.direction == 1){\n mat4.rotate(transform,transform,Math.PI,[0,1,0]);\n }\n return transform;\n }", "function animate() {\n //tells the browser to \n requestAnimationFrame(animate)\n\n torus.rotation.x += 0.01;\n torus.rotation.y += 0.005;\n torus.rotation.z += 0.01;\n\n //controls.update();\n moon.rotation.x += 0.005;\n renderer.render(scene,camera)\n}", "function playerRotate() {\n const pos = player.pos.x;\n let offset = 1;\n rotate(player.matrix);\n while (collide(arena, player)) {\n player.pos.x += offset;\n offset = -(offset + (offset > 0 ? 1 : -1));\n if (offset > player.matrix[0].length) {\n rotate(player.matrix);\n player.pos.x = pos;\n return;\n }\n }\n}", "renderArmRotation( arm ) {\n var upperArm = this.skeleton.bones[arm.upper];\n var lowerArm = this.skeleton.bones[arm.lower];\n if ( ! this.animateArms ) {\n upperArm.getTransformNode().rotationQuaternion = arm.upperRot;\n lowerArm.getTransformNode().rotationQuaternion = arm.lowerRot;\n return;\n }\n if ( !arm.animation ) {\n var armName = this.folder.name+'-'+arm.side;\n var group = new BABYLON.AnimationGroup(armName+'ArmAnimation');\n \n var upper = this._createArmAnimation(armName+\"-upper\");\n var lower = this._createArmAnimation(armName+\"-lower\");\n \n group.addTargetedAnimation(upper, this.skeleton.bones[arm.upper].getTransformNode());\n group.addTargetedAnimation(lower, this.skeleton.bones[arm.lower].getTransformNode());\n arm.animation = group;\n }\n this._updateArmAnimation(upperArm, arm.animation.targetedAnimations[0], arm.upperRot);\n this._updateArmAnimation(lowerArm, arm.animation.targetedAnimations[1], arm.lowerRot);\n if ( arm.animation.isPlaying ) {\n arm.animation.stop();\n }\n arm.animation.play(false);\n }", "function setPreviewRotation() {\r\n var previewVidTag = document.getElementById(\"cameraPreview\");\r\n if (oDisplayOrientation == DisplayOrientations.portrait) {\r\n previewVidTag.style.height = \"100%\";\r\n previewVidTag.style.width = \"\";\r\n } else {\r\n previewVidTag.style.width = \"100%\";\r\n previewVidTag.style.height = \"\";\r\n }\r\n\r\n var videoRotation = convertDisplayOrientationToVideoRotation(oDisplayOrientation);\r\n return oMediaCapture.setPreviewRotation(videoRotation);\r\n }", "function setmvMatrix0()\n{\n\tmat4.identity(mvMatrix0);\n mat4.translate(mvMatrix0, camerapos);\n\tmat4.rotate(mvMatrix0, degToRad(yrot), [1, 0, 0]);\n\tmat4.rotate(mvMatrix0, degToRad(xrot), [0, 1, 0]);\n}", "rotate() {\r\n let originX = this.pivotCube[0];\r\n let originY = this.pivotCube[1];\r\n let tempCubes = [[0, 0], [0, 0], [0, 0], [0, 0]];\r\n this.cubes.forEach(rotateCube)\r\n\r\n function rotateCube(item, index) {\r\n let x = item[0];\r\n let y = item[1];\r\n tempCubes[index][0] = Math.round(originY - y + originX);\r\n tempCubes[index][1] = Math.round(x - originX + originY);\r\n }\r\n\r\n return new Tetromino(tempCubes, this.pivotCube, this.material);\r\n }", "rotation() {\n // Map mouse location (horizontal)\n let distX = map(mouseX, width / 2, 2, 0, width);\n // Making it rotate according to mouseX\n let rotationValue = (frameCount * this.rotationSpeed * distX);\n\n // Making it rotate across each axis\n rotateY(rotationValue);\n rotateX(rotationValue);\n rotateZ(rotationValue);\n }", "moveToCamera() {\r\n const [position, rotation] = this.camera.toCamera(this);\r\n if (this.mesh.position.manhattanDistanceTo(position) < Number.EPSILON) return;\r\n \r\n this.moveTransition(position, rotation);\r\n this.atOriginalPosition = false;\r\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function FollowCamera(name, position, scene, lockedTarget) {\n if (lockedTarget === void 0) { lockedTarget = null; }\n var _this = _super.call(this, name, position, scene) || this;\n /**\n * Distance the follow camera should follow an object at\n */\n _this.radius = 12;\n /**\n * Minimum allowed distance of the camera to the axis of rotation\n * (The camera can not get closer).\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.lowerRadiusLimit = null;\n /**\n * Maximum allowed distance of the camera to the axis of rotation\n * (The camera can not get further).\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.upperRadiusLimit = null;\n /**\n * Define a rotation offset between the camera and the object it follows\n */\n _this.rotationOffset = 0;\n /**\n * Minimum allowed angle to camera position relative to target object.\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.lowerRotationOffsetLimit = null;\n /**\n * Maximum allowed angle to camera position relative to target object.\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.upperRotationOffsetLimit = null;\n /**\n * Define a height offset between the camera and the object it follows.\n * It can help following an object from the top (like a car chaing a plane)\n */\n _this.heightOffset = 4;\n /**\n * Minimum allowed height of camera position relative to target object.\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.lowerHeightOffsetLimit = null;\n /**\n * Maximum allowed height of camera position relative to target object.\n * This can help limiting how the Camera is able to move in the scene.\n */\n _this.upperHeightOffsetLimit = null;\n /**\n * Define how fast the camera can accelerate to follow it s target.\n */\n _this.cameraAcceleration = 0.05;\n /**\n * Define the speed limit of the camera following an object.\n */\n _this.maxCameraSpeed = 20;\n _this.lockedTarget = lockedTarget;\n _this.inputs = new FollowCameraInputsManager(_this);\n _this.inputs.addKeyboard().addMouseWheel().addPointers();\n return _this;\n // Uncomment the following line when the relevant handlers have been implemented.\n // this.inputs.addKeyboard().addMouseWheel().addPointers().addVRDeviceOrientation();\n }", "function gRotate(theta,x,y,z) {\n modelMatrix = mult(rotate(theta,[x,y,z]), modelMatrix) ;\n}", "function animate(){\n requestAnimationFrame(animate);\n\n // torus.rotation.y += 0.01\n object.rotation.y += 0.02\n\n\n renderer.render(scene, camera);\n}", "animate(dSec,vrHelper){\n\n if( this.control ) {\n this.control.animate(dSec,vrHelper);\n }\n\n var limit = 5000.0;\n var min = new BABYLON.Vector3(-limit,-limit,-limit);\n var max = new BABYLON.Vector3(+limit,+limit,+limit);\n this.speedPosition = BABYLON.Vector3.Clamp(this.speedPosition,min,max);\n\n this.root.locallyTranslate(this.speedPosition.scale(dSec)); // relatige to ship OR: this.root.translate(this.speedPosition, 1 , Space.LOCAL); // relatige to ship\n\n this.root.rotate(BABYLON.Axis.Y, this.speedRotation.y*dSec, BABYLON.Space.LOCAL); // not .WORLD\n\n // Does the VR-Helper do the mouse rotation?\n // Is there a way to disable it?\n // We have to UNDO it: Does not work that nice!\n var euler = this.root.rotationQuaternion.toEulerAngles();\n this.root.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(euler.y, 0, 0);\n\n // NO!: https://doc.babylonjs.com/resources/rotation_conventions#euler-angles-to-quaternions\n // thisroot.rotationQuaternion.addInPlace(BABYLON.Quaternion.RotationYawPitchRoll(speedRotation.y, speedRotation.x, speedRotation.z) );\n\n var cameraOffset = vrHelper.isInVRMode ? this.cameraOffset1 : this.cameraOffset3;\n\n var camPos = new BABYLON.AbstractMesh(\"camPos\");\n camPos.rotationQuaternion = this.root.rotationQuaternion;\n camPos.position = this.root.position.clone();\n camPos.locallyTranslate(cameraOffset);\n setCamera( camPos.position,\n camPos.rotationQuaternion,\n vrHelper );\n\n }", "function rotateScene(e) {\r\n\tif(rX>0){rX=0;}\r\n\tif(rX<-35){rX=-35;}\r\n\trY += e.originalEvent.movementX / 4; /*For rotation around the Y-axis, we add the horizontal movement*/\r\n\trX -= e.originalEvent.movementY / 4;\r\n\t/*for rotation around the X-axis, subtract the vertical movement distance:\r\n\t */\r\n\t$scene.css('transform', 'rotateX(' + rX + 'deg) rotateY(' + rY + 'deg) translate3d( -25px, 205px, 25px )')\r\n\t;\r\n\t/* This applies a transform property to the scene with the appropriate X and Y-axis rotations*/\r\n}", "updateAnimation() {\n\t\t// console.log(this.centerX, this.centerY);\n\t\tlet translateMatrix1 = new Matrix4();\n\t\tlet rotateMatrix = new Matrix4();\n\t\tlet translateMatrix2 = new Matrix4();\n\n\t\t//T\n\t\ttranslateMatrix1.setTranslate(-this.centerX, -this.centerY, 0);\n\n\t\t\tthis.modelMatrix = translateMatrix1.multiply(this.modelMatrix);\n\t\t\t\n\t\t//R\n\t\trotateMatrix.setRotate(this.currentAngle, 0, 0, 1);\n\n\t\t\tthis.modelMatrix = rotateMatrix.multiply(this.modelMatrix);\n\n\t\t//T\n\t\ttranslateMatrix2.setTranslate(this.centerX, this.centerY, 0);\n\n\t\t\tthis.modelMatrix = translateMatrix2.multiply(this.modelMatrix);\n\n\t\t// Pass the rotation matrix to the vertex shader\n\t\tgl.uniformMatrix4fv(u_ModelMatrix, false, this.modelMatrix.elements);\n\t\tthis.render();\n\t}", "setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n this.scene.add(this.camera.container);\r\n\r\n // update camera position per frame\r\n this.time.on('update', () => {\r\n if (this.world && this.world.car) { // if car is on the scene\r\n this.camera.target.x = this.world.car.chassis.object.position.x;\r\n this.camera.target.y = this.world.car.chassis.object.position.y;\r\n this.camera.target.z = this.world.car.chassis.object.position.z;\r\n this.camera.direction.x = this.world.car.movement.direction.x;\r\n this.camera.direction.y = this.world.car.movement.direction.y;\r\n }\r\n });\r\n }", "rotateBase() {\n var me = this.localDonutRender;\n if (me == null) {\n return;\n }\n var deltaX = this.pointing.x - me.donutData.x;\n var deltaY = this.pointing.y - me.donutData.y;\n var baseAngle = Math.atan2(deltaY, deltaX) * 180 / Math.PI;\n baseAngle += 90;\n\n this.client.emit('rotate', { pid: this.playerId, rid: this.roomId, alpha: baseAngle });\n }", "rotate(rotateAmount, rotateAround) {\n if (!rotateAround) {\n rotateAround = this.center;\n }\n let vectorsRelativeToCenter = [];\n\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, rotateAround));\n }\n\n for (let v of vectorsRelativeToCenter) {\n v.rotate(rotateAmount);\n }\n\n for (var i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i] = p5.Vector.add(vectorsRelativeToCenter[i], rotateAround);\n }\n this.setCenter();\n this.setShape();\n this.resetFixture();\n\n }", "updateLookingAngles() {\n this.resetRotMatrices();\n if (this.rotationMode === MFWebGLCamera.TWO_ANGLE_ROTATION) {\n if (this.lookAt[1] != this.position[1]) {\n let cdir = vec3.create();\n vec3.sub(cdir, this.lookAt, this.position);\n let angle = Math.abs(vec3.angle(cdir, [0, 1, 0])) - Math.PI/2;\n this.lookAt[1] = this.position[1];\n this.angleX = angle;\n mat4.rotateX(this.angleXRotation, mat4.create(), this.angleX);\n mat4.mul(this.cameraRotation, this.angleXRotation, this.angleYRotation);\n }\n }\n }", "transform(e3v) {\nreturn (this._r.rotate(e3v)).setAdd(this._t);\n}", "constructor() {\n // The name of the camera.\n this.name = \"Chase Camera\";\n\n // Instructions to display on the screen when this camera is active.\n this.instructions = \"\";\n\n //The horizontal distance from the target.\n this.distance = 5.0;\n\n // The height above the ground.\n this.height = 2.5;\n\n // The initial position and rotation.\n this.eye = vec3(0, 0, 0);\n this.at = vec3(1, 0, 0);\n this.target = null;\n this.rotationX = 0;\n this.rotationY = 0;\n\n // The limits for looking up/down.\n this.minRotationY = -70;\n this.maxRotationY = 70;\n\n // Projection settings.\n this.near = 0.5;\n this.far = 1000;\n this.fieldOfViewY = 70;\n\n this.aspect = 1;\n // variables to store the matrices in.\n this.projection = null;\n this.view = null;\n this.viewProjection = null;\n }", "animateCameraTo(camera, id, position, rotation, time, onFinish = null) {\n\t\tlet cameraControls = this._camerasControls[camera._uuid];\n\n\t\tif (cameraControls != null) {\n\t\t\tcameraControls.animateTo(id, position, rotation, time, onFinish);\n\t\t}\n\t\telse {\n\t\t\tconsole.warn(\"Cannot execute camera animation. Controls for the given camera do not exist.\")\n\t\t}\n\t}", "function RotateTo(targetPos : Vector3, speed : float) { \n\tyield StartMoving(speed);\n\n\tvar step = speed * Time.deltaTime;\t\n\t\n\tvar targetRotation = Quaternion.LookRotation(targetPos - transform.position);\n\ttargetRotation.x = transform.rotation.x; //we only want to change the y component, so x and z will be no modified\n\ttargetRotation.z = transform.rotation.z;\n\t\n\twhile (true) {\n\t\ttransform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, step);\n\t\tif (Mathf.Abs(AngleToPosition(targetPos)) <= angleLookAt) { //relative position with enough angle. note that is a different checking\n\t\t\t//print(\"rotateTo targetPosition breakk\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tyield;\n\t}\n\t\n\tyield EndMoving();\n}", "resetRotMatrices() {\n this.angleX = 0.0;\n this.angleY = 0.0;\n this.angleXRotation = mat4.create();\n this.angleYRotation = mat4.create();\n mat4.identity(this.cameraRotation);\n }", "updateAnimation() {\n\n this.modelMatrix.rotate(1,0,1,0)\n }", "function gRotate(theta, x, y, z) {\n modelMatrix = mult(modelMatrix, rotate(theta, [x, y, z]));\n}", "function gRotate(theta, x, y, z) {\n modelMatrix = mult(modelMatrix, rotate(theta, [x, y, z]));\n}", "moveL() {\n\n this.rotation -= (Math.PI / 180);\n\n }", "function rotateObject(angleOffset) {\n\t\tvar t1 = canvas.getActiveObject()\n\t\tif(t1 == null){\n\t\t\talert(\"There are no active image. Please select a image over Canvas for rotate.\");\n\t\t}\n\t\telse{\n\t\t\tvar obj = canvas.getActiveObject(),\n\t\t\t\tresetOrigin = false;\n\n\t\t\tif (!obj) return;\n\n\t\t\tvar angle = obj.getAngle() + angleOffset;\n\n\t\t\tif ((obj.originX !== 'center' || obj.originY !== 'center') && obj.centeredRotation) {\n\t\t\t\tobj.setOriginToCenter && obj.setOriginToCenter();\n\t\t\t\tresetOrigin = true;\n\t\t\t}\n\n\t\t\tangle = angle > 360 ? 90 : angle < 0 ? 270 : angle;\n\n\t\t\tobj.setAngle(angle).setCoords();\n\n\t\t\tif (resetOrigin) {\n\t\t\t\tobj.setCenterToOrigin && obj.setCenterToOrigin();\n\t\t\t}\n\n\t\t\tcanvas.renderAll();\n\t\t}\n\t}", "rotateTurtle(x, y, z) {\n x = x * this.angle;\n y = 45;\n z = z * this.angle ;\n var e = new THREE.Euler(\n x * 3.14/180,\n\t\t\t\ty * 3.14/180,\n\t\t\t\tz * 3.14/180);\n this.state.dir.applyEuler(e);\n }", "rotationInRadians() {\n return VrMath.getRotation(this.headMatrix);\n }", "setRotation(theta) {\n this.m = [[Math.cos(theta), -Math.sin(theta)], [Math.sin(theta), Math.cos(theta)]];\n return this;\n }", "function setDirection() {\n cameraVectorObj.rotation.x = params.upAndDown * Math.PI/180;\n widgetObj.rotation.y = Math.PI + (params.around * Math.PI/180);\n}", "function rotate(direction) {\n player.stop();\n display.rotate(direction > 0 ? ROTATE_STEP : -ROTATE_STEP);\n }", "function rotateY() {\n console.log('rotate about y triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( cosA, 0, sinA, 0,\n 0, 1, 0, 0,\n -sinA, 0, cosA, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function camera_top_view() {\n camera.rotation.x += Math.PI/2;\n camera.position.y = 6;\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "rotate() {\n if (!this.disabled) {\n this.elem.style.transform = [\n this.initialTransform,\n `rotateX(${this.mousePos.y * this.rotmax}deg)`,\n `rotateY(${-this.mousePos.x * this.rotmax}deg)`,\n ].join(' ');\n }\n }", "initCamera() {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 10, 1000);\n this.camera.position.y = 400;\n this.camera.position.z = 400;\n this.camera.rotation.x = .70;\n }", "function Camera() {\n this.armLocation = new Point3d();\n this.armRotation = {};\n this.armRotation.horizontal = 0;\n this.armRotation.vertical = 0;\n this.armLength = 1.7;\n this.cameraOffset = new Point3d();\n this.offsetMultiplier = 0.6;\n\n this.cameraLocation = new Point3d();\n this.cameraRotation = new Point3d(0.5 * Math.PI, 0, 0);\n\n this.calculateCameraOrientation();\n}" ]
[ "0.72759056", "0.68382436", "0.6835041", "0.672158", "0.6593706", "0.6376184", "0.6355608", "0.63428843", "0.6310431", "0.62964314", "0.62236065", "0.6218251", "0.6201183", "0.61812794", "0.6181065", "0.6172513", "0.6157836", "0.6143725", "0.6143454", "0.61164904", "0.6116165", "0.6104198", "0.6095083", "0.60755926", "0.60732335", "0.60600156", "0.60408705", "0.5979212", "0.596488", "0.5936449", "0.5908788", "0.5834879", "0.58290094", "0.5803134", "0.5801601", "0.5797113", "0.57945776", "0.5785931", "0.57774895", "0.5747002", "0.5738902", "0.57339853", "0.5733647", "0.57279015", "0.5713026", "0.5702439", "0.57007045", "0.5691332", "0.5690149", "0.5686149", "0.56692564", "0.56692564", "0.5657061", "0.5656705", "0.56558216", "0.56488883", "0.56314474", "0.5628368", "0.5625536", "0.56145686", "0.5605318", "0.5600027", "0.55954975", "0.55841875", "0.5581804", "0.55643946", "0.55463964", "0.55327225", "0.55321985", "0.55313754", "0.5530369", "0.5522254", "0.5517307", "0.55148196", "0.5494421", "0.5491173", "0.5482183", "0.5479732", "0.5473128", "0.5467896", "0.54655135", "0.5463805", "0.5452982", "0.5452636", "0.54517424", "0.5451063", "0.54502654", "0.54502654", "0.544863", "0.5448521", "0.5441493", "0.5439419", "0.5428527", "0.54258794", "0.54185766", "0.5414589", "0.5409656", "0.5409103", "0.5400444", "0.5394808" ]
0.55552334
66
Zoom the camera by moving forward or backwards.
function zoom(factor) { // Get the forward vector. let dirZ = camera.directionZ; camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoom() {\n const speed = 2;\n if (Date.now() - lastUpdate > mspf) {\n let e = window.event || e; // old IE support\n let delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n cameraDistance += delta * speed;\n cameraDistance = Math.min(Math.max(cameraDistance, cameraMinDistance), cameraMaxDistance);\n cameraPosition = vec4(cameraDistance, 0., 0., 0.);\n upPosition = add(cameraPosition, vec4(0., 1., 0., 0.));\n\n requestAnimFrame(render);\n lastUpdate = Date.now();\n }\n}", "#updateZoom() {\n\n const size = this.#getSize();\n \n var zoom = -this.#diffwheel;\n zoom /= size.y;\n zoom *= this.zoompower;\n \n const ray = this.raycaster.ray.direction;\n\n this.camera.position.x += zoom * ray.x;\n this.camera.position.y += zoom * ray.y;\n this.camera.position.z += zoom * ray.z;\n\n this.#diffwheel = 0;\n }", "zoomToValter() {\n new TWEEN.Tween(this.vLab.SceneDispatcher.currentVLabScene.currentCamera.position)\n .to({x: this.baseFrame.position.x - 1.5, y: 3.0, z: this.baseFrame.position.z + 1.5}, 1000)\n .easing(TWEEN.Easing.Quadratic.InOut)\n .onComplete(() => {\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.update();\n })\n .start();\n let target = this.baseFrame.position.clone().setY(1.0);\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.setTarget(target);\n }", "function zoomIn() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.ratio / c.settings(\"zoomingRatio\")\n });\n}", "function Update () {\n\tif(Input.GetKeyDown(KeyCode.Z)){ //This function toggles zoom capabilities by pressing the mouse 2 button. If it's zoomed in, it will zoom out\n \t\tzoomedIn = !zoomedIn;\n\t}\n \n\tif(zoomedIn == true){ //If \"zoomedIn\" is true, then it will not zoom in, but if it's false (not zoomed in) then it will zoom in.\n\t\tGetComponent.<Camera>().fieldOfView = Mathf.Lerp(GetComponent.<Camera>().fieldOfView,zoom,Time.deltaTime*smooth);\n\t}\n \n\telse {\n \t\tGetComponent.<Camera>().fieldOfView = Mathf.Lerp(GetComponent.<Camera>().fieldOfView,normal,Time.deltaTime*smooth);\n\t}\n \n}", "setZoom(value,add,speed=3) {\n const memZ = this._zoom;\n const target = this._target || {x:this.camToMapX,y:this.camToMapY};\n this._zoom = add? memZ+value : value;\n this.updateProjection();\n const to = this._target ? this.getLocalTarget(target) :\n {\n x:this.pivot.x+(target.x-this.camToMapX), //+ (target.x-this.camToMapX),\n y:this.pivot.y+(target.y-this.camToMapY), //+ (target.y+this.camToMapY)\n };\n // back to origin\n this._zoom = memZ;\n this.updateProjection();\n // zoom only\n TweenLite.to(this, speed, {\n _zoom:add? memZ+value : value,\n ease: Elastic.easeOut.config(0.4, 0.4),\n });\n }", "autoZoom(){\n let sphereRadius = this.theObject.geometry.boundingSphere.radius;\n const factor = 1.25;\n let angle = this.camera.fov / 2 * Math.PI/180;\n let distance = sphereRadius * factor / Math.tan(angle);\n this.camera.position.z = distance;\n }", "function performCameraZoom(cameraScope : Camera, endpoint : float, t : float) {\n if (isOrthographic) {\n cameraScope.orthographicSize = Mathf.Lerp(cameraScope.orthographicSize, endpoint, t);\n } else {\n cameraScope.fieldOfView = Mathf.Lerp(cameraScope.fieldOfView, endpoint, t);\n }\n}", "function initZoom() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.settings(\"zoomingRatio\")\n });\n}", "function zoomIn() {\n _zoomLevel = _krpano().get('view.fov') - 20;\n _krpano().call('zoomto(' + _zoomLevel + ',smooth())');\n _krpano().set('view.fov', _zoomLevel);\n }", "function cameraMove() {\n if (camera.L) {\n sX -= camera.speed;\n }\n if (camera.R) {\n sX += camera.speed;\n }\n if (camera.T) {\n sY -= camera.speed;\n }\n if (camera.B) {\n sY += camera.speed;\n }\n if (sX < 0) {\n sX = 0;\n }\n if (sX > canvas.width - window.innerWidth) {\n sX = canvas.width - window.innerWidth;\n }\n if (sY < 0) {\n sY = 0;\n }\n if (sY > canvas.height - window.innerHeight) {\n sY = canvas.height - window.innerHeight;\n }\n if (camera.zoomOut) {\n id(\"zoomer\").value--;\n zoomChange();\n } else if (camera.zoomIn) {\n id(\"zoomer\").value++;\n zoomChange();\n }\n scroll(sX, sY);\n}", "function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\r\n var sign = dy < 0 ? -1 : +1\r\n dy = Math.pow(Math.abs(dy), 1.4) * sign\r\n\r\n if (timeWindow + dy > 10 * 1000) {\r\n timeWindow += dy\r\n } else {\r\n timeWindow = 10 * 1000\r\n }\r\n }\r\n step()\r\n }", "function zoom(event) \r\n {\r\n\r\n let delta = Math.sign(event.deltaY);\r\n\r\n if (delta > 0)\r\n {\r\n if (width <= 240)\r\n width += scale;\r\n\r\n if (height <= 260)\r\n height += scale;\r\n }\r\n\r\n if (delta < 0)\r\n {\r\n if (width >= 40)\r\n width -= scale;\r\n\r\n if (height >= 60)\r\n height -= scale;\r\n }\r\n\r\n\r\n lens.style.width = width + \"px\";\r\n lens.style.height = height + \"px\";\r\n }", "centerCam()\n {\n this.camPos.x = -this.camOffset.x;\n this.camPos.y = -this.camOffset.y;\n this.zoom = 1.5;\n }", "function animate() \r\n{\r\n\trequestAnimationFrame( animate );\t\r\n\r\n\tcameraZoomTopLoop();\t\r\n\tmoveCameraToNewPosition();\r\n\t\r\n\tupdateKeyDown();\r\n}", "function moveCamera() {\n\n //where the user is currently scrolled to\n const t = document.body.getBoundingClientRect().top;\n\n moon.rotation.x += 0.05;\n moon.rotation.y += 0.075;\n moon.rotation.z += 0.05;\n\n ritam.rotation.z += 0.01\n ritam.rotation.y += 0.01 \n\n //changing the position of the actual camera\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.position.y = t * -0.0002;\n}", "function zoom(direction, x, y) {\n player.stop();\n display.zoom(direction > 0 ? SCALE_FACTOR : 1 / SCALE_FACTOR, x, y);\n }", "function zoomOut() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.ratio * c.settings(\"zoomingRatio\")\n });\n}", "slideZoom() {\n this.map.setZoom(this.slider);\n }", "function zoom(x, y, isZoomIn) {\n\tvar direction = (isZoomIn) ? 1 : -1,\n\t\tfactor = (1 + direction * 0.1),\n\t\tlocal_pt = new PIXI.Point(),\n\t\tpoint = new PIXI.Point(x, y);\n\t\t\n\tvar stage = p.stage;\n\t\n\tPIXI.interaction.InteractionData.prototype.getLocalPosition(stage, local_pt, point);\n\t\n\tstage.scale.x *= factor;\n\tstage.scale.y *= factor;\n\tstage.pivot = local_pt;\n\tstage.position = point;\n}", "function resetCamera() {\r\n var w = container.width(),\r\n h = container.height(),\r\n iw = bgCanvas[0].width,\r\n ih = bgCanvas[0].height;\r\n\r\n if(iw === 0) {\r\n setTimeout(resetCamera, 100);\r\n } else {\r\n zoomLevel = minZoom = Math.min( w / iw, h / ih );\r\n drawingCenter[0] = w/2;\r\n drawingCenter[1] = h/2;\r\n redrawImage();\r\n }\r\n }", "function camera(event) {\n if (Date.now() - lastUpdate > mspf) {\n const deltaX = (event.clientX - prevX) / c.width;\n const deltaY = (event.clientY - prevY) / c.height;\n\n cameraX += -1 * deltaX * 180;\n cameraY += deltaY * 180;\n\n prevX = event.clientX;\n prevY = event.clientY;\n\n requestAnimFrame(render);\n lastUpdate = Date.now();\n }\n}", "function setCameraZoomed(){\n camera.position.set( 5.275489271607287,14.650010427656056,-13.235869197100351);\n camera.lookAt(duck.position);\n}", "function move_camera(){\n if (!mouse_down){\n if (track_obj){\n if (track_obj === 'home'){\n // code that moves camera to center\n offset_x = Math.abs(offset_x) > 0.1 ? offset_x * (1-CAMERA_SPEED) : 0;\n offset_y = Math.abs(offset_y) > 0.1 ? offset_y * (1-CAMERA_SPEED) : 0;\n if (zoom > 1.1){\n zoom *= (1-CAMERA_SPEED);\n } else if (zoom < 0.9){\n let diff = 1/zoom;\n zoom *= (1+CAMERA_SPEED);\n } else {\n zoom = 1.0;\n }\n } else if (Math.abs(track_obj['x'] - c.width/2) > 0.1 || Math.abs(track_obj['y'] - c.height/2) > 0.1){\n offset_x -= (track_obj['x'] - c.width/2) * CAMERA_SPEED/(Math.sqrt(zoom));\n offset_y -= (track_obj['y'] - c.height/2) * CAMERA_SPEED/(Math.sqrt(zoom));\n }\n } else {\n // code that slowly stops moving camera\n camera_move_amt.x = Math.abs(camera_move_amt.x) > 0.1 ? camera_move_amt.x * CAMERA_SPEED*8 : 0;\n camera_move_amt.y = Math.abs(camera_move_amt.y) > 0.1 ? camera_move_amt.y * CAMERA_SPEED*8 : 0;\n offset_x = Math.abs(offset_x) > 1 ? offset_x + camera_move_amt.x : offset_x;\n offset_y = Math.abs(offset_y) > 1 ? offset_y + camera_move_amt.y : offset_y;\n }\n }\n}", "function moveCamera() {\n const current = document.body.getBoundingClientRect().top;\n // tours.rotation.x += current * 0.0001;\n // camera.position.x = current * 0.002;\n // camera.position.z = current * -0.04;\n // camera.position.x = current * 0.02;\n}", "function zoomInHere(x,y) {\r\n\r\n var transform = d3.zoomIdentity\r\n .translate(width / 2, height / 2)\r\n .scale(8)\r\n .translate(-x,-y);\r\n\r\n focus.transition().ease(d3.easeLinear).duration(1000).call(\r\n zoom.transform,\r\n transform\r\n //d3.zoomIdentity.translate(width / 2, height / 2).scale(8).translate(-x, -y),\r\n )\r\n\r\n }", "update(scene){\n\n // Zoom controls\n if(Keyboard.keyPressed(Keyboard.KEY.ZOOMIN) && this.zoom * 100 > 50){\n this.zoomIn();\n }\n\n if(Keyboard.keyPressed(Keyboard.KEY.ZOOMOUT) && this.zoom * 100 < 100){\n this.zoomOut();\n }\n\n // Follow target if set.\n if(this.target){\n\n // Update Camera Position\n this.position.x = this.target.body.position.x - ((this.size.x / 2) * this.zoom) + ((this.target.body.size.x) * this.zoom);\n this.position.y = this.target.body.position.y - ((this.size.y / 2) * this.zoom) + ((this.target.body.size.y) * this.zoom);\n\n // Ensure camera remains within scene bounds.\n if(this.position.x < 0){ this.position.x = 0; }\n if(this.position.x + (this.size.x * this.zoom) > scene.renderingCanvas.width){ this.position.x = scene.renderingCanvas.width - this.size.x * this.zoom; }\n if(this.position.y < 0){ this.position.y = 0; }\n if(this.position.y + (this.size.y * this.zoom) > scene.renderingCanvas.height){ this.position.y = scene.renderingCanvas.height - this.size.y * this.zoom; }\n }\n }", "function resetCamera() {\n zoom = 45;\n dolly = 325;\n}", "function zoom(){\n\t//NOT YET\n\t/*var rect = canvas.getBoundingClientRect();\n var mx = panX + (panX - rect.left) / zooms;\n var my = panY + (panY - rect.top) / zooms;\n zooms = document.getElementById(\"za\");\n panX = mx - ((panX - rect.left) / zooms);\n panY = my - ((panY - rect.top) / zooms);\n */\n zooms = document.getElementById(\"za\").value; \n mx = ((panX + (a-1)/zooms) - panX) / 2;\n panX -= mx;\n my = ((panY + (b-1)/zooms) - panY) / 2;\n panY -= mx;\n \n show();\n abortRun();\n startRun();\n}", "function onDocumentMouseWheel(event) {\n \n\n if (event.deltaY < 0) { \n camera.zoom *= 1.25;\n };\n \n if (event.deltaY > 0) { \n if (camera.zoom > 0.1)\n camera.zoom /= 1.25;\n };\n camera.updateProjectionMatrix();\n\n}", "function moveCamera() {\n // calculate where the user is currently\n const t = document.body.getBoundingClientRect().top;\n\n me.rotation.y += 0.01;\n me.rotation.x =+ 0.01;\n\n camera.position.z = t * -0.01;\n camera.position.x = t * -0.0002;\n camera.rotation.y = t * -0.0002;\n \n}", "function zoom(scroll){\r\n if(!orthoProj){\r\n if(scroll > 0){\r\n fov-=1;\r\n }else{\r\n fov+=1;\r\n }\r\n gl = main();\r\n drawObjects();\r\n }\r\n \r\n return false;\r\n}", "zoomIn(x, y){ return this.zoom(x, y, this.Scale.current + this.Scale.factor) }", "function zoomClick() {\n var direction = -1,\n factor = 0.2,\n target_zoom = 1,\n center = [mapWidth / 2, mapHeight / 2],\n extent = zoom.scaleExtent(),\n translate = zoom.translate(),\n translate_temp = [],\n l = [],\n view = {x: translate[0], y: translate[1], k: zoom.scale()};\n\n if (arguments[0] == 0) { zoomReset(); }\n else if (arguments[0] == 1) { direction = arguments[0]; }\n\n target_zoom = zoom.scale() * (1 + factor * direction);\n\n if (target_zoom < extent[0] || target_zoom > extent[1]) { return false; }\n\n translate_temp = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];\n view.k = target_zoom;\n l = [translate_temp[0] * view.k + view.x, translate_temp[1] * view.k + view.y];\n\n view.x += center[0] - l[0];\n view.y += center[1] - l[1];\n\n interpolateZoom([view.x, view.y], view.k);\n}", "zoomIn () {}", "updateZoomVelocity() {\n const zoom = this.commands.zoom;\n if ((zoom.in ^ zoom.out) && Math.abs(this.zoom.vel.value) < this.zoom.vel.max) {\n if (zoom.in && this.zoom.value < this.zoom.max)\n this.zoom.vel.value += this.zoom.vel.change.key;\n if (zoom.out && this.zoom.value > this.zoom.min)\n this.zoom.vel.value -= this.zoom.vel.change.key;\n }\n }", "updateCamera() {\n\n this.#updateRaycaster();\n\n // Implement translation\n if (this.#ismousedown)\n this.#updateTranslate();\n\n // Implement zoom\n if (this.#iswheel)\n this.#updateZoom();\n }", "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "moveToCamera() {\r\n const [position, rotation] = this.camera.toCamera(this);\r\n if (this.mesh.position.manhattanDistanceTo(position) < Number.EPSILON) return;\r\n \r\n this.moveTransition(position, rotation);\r\n this.atOriginalPosition = false;\r\n }", "function sinusoidalZoom(min, max) {\n delta = clock.getDelta();\n theta += delta * 0.2;\n //theta += 0.01;\n camera.position.z = Math.abs((max-min)*Math.sin(theta))+min;\n}", "function zoom(event) {\n event.preventDefault();\n \n scale += event.deltaY * -0.01;\n \n // Restrict scale\n scale = Math.min(Math.max(.5, scale), 4);\n \n // Apply scale transform\n busImage.style.transform = `scale(${scale})`;\n }", "function setupCamera(scene) {\n let canvas = scene.viewer.canvas;\n let camera = scene.camera;\n let MOVE_SPEED = 2;\n let ZOOM_SPEED = 30;\n let ROTATION_SPEED = 1 / 200;\n let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0};\n let right = vec3.create();\n let up = vec3.create();\n let horizontalAngle = -Math.PI / 2;\n let verticalAngle = -Math.PI / 4;\n let cameraTarget = vec3.create(); // What the camera orbits.\n\n // Initial setup, go back a bit and look forward.\n camera.move([0, -400, 0]);\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n\n // Move the camera and the target on the XY plane.\n function move(x, y) {\n let dirX = camera.directionX;\n let dirY = camera.directionY;\n\n // Allow only movement on the XY plane, and scale to MOVE_SPEED.\n vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED);\n vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED);\n\n camera.move(right);\n camera.move(up);\n\n // And also move the camera target to update the orbit.\n vec3.add(cameraTarget, cameraTarget, right);\n vec3.add(cameraTarget, cameraTarget, up);\n }\n\n // Rotate the camera around the target.\n function rotate(dx, dy) {\n // Update rotations, and limit the vertical angle so it doesn't flip.\n // Since the camera uses a quaternion, flips don't matter to it, but this feels better.\n horizontalAngle += dx * ROTATION_SPEED;\n verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01));\n\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n }\n\n // Zoom the camera by moving forward or backwards.\n function zoom(factor) {\n // Get the forward vector.\n let dirZ = camera.directionZ;\n\n camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED));\n }\n\n /*\n // Resize the canvas automatically and update the camera.\n function onResize() {\n let width = canvas.clientWidth;\n let height = canvas.clientHeight;\n\n canvas.width = width;\n canvas.height = height;\n\n camera.viewport([0, 0, width, height]);\n camera.perspective(Math.PI / 4, width / height, 8, 100000);\n }\n\n window.addEventListener(\"resize\", function(e) {\n onResize();\n });\n\n onResize();\n */\n\n // Track mouse clicks.\n canvas.addEventListener(\"mousedown\", function(e) {\n e.preventDefault();\n\n mouse.buttons[e.button] = true;\n });\n\n // And mouse unclicks.\n // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas.\n window.addEventListener(\"mouseup\", (e) => {\n e.preventDefault();\n\n mouse.buttons[e.button] = false;\n });\n\n // Handle rotating and moving the camera when the mouse moves.\n canvas.addEventListener(\"mousemove\", (e) => {\n mouse.x2 = mouse.x;\n mouse.y2 = mouse.y;\n mouse.x = e.clientX;\n mouse.y = e.clientY;\n\n let dx = mouse.x - mouse.x2;\n let dy = mouse.y - mouse.y2;\n\n if (mouse.buttons[0]) {\n rotate(dx, dy);\n }\n\n if (mouse.buttons[2]) {\n move(-dx * 2, dy * 2);\n }\n });\n\n // Handle zooming when the mouse scrolls.\n canvas.addEventListener(\"wheel\", (e) => {\n e.preventDefault();\n\n let deltaY = e.deltaY;\n\n if (e.deltaMode === 1) {\n deltaY = deltaY / 3 * 100;\n }\n\n zoom(deltaY / 100);\n });\n\n // Get the vector length between two touches.\n function getTouchesLength(touch1, touch2) {\n let dx = touch2.clientX - touch1.clientX;\n let dy = touch2.clientY - touch1.clientY;\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // Touch modes.\n let TOUCH_MODE_INVALID = -1;\n let TOUCH_MODE_ROTATE = 0;\n let TOUCH_MODE_ZOOM = 1;\n let touchMode = TOUCH_MODE_ROTATE;\n let touches = [];\n\n // Listen to touches.\n // Supports 1 or 2 touch points.\n canvas.addEventListener('touchstart', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (targetTouches.length === 1) {\n touchMode = TOUCH_MODE_ROTATE;\n } else if (targetTouches.length == 2) {\n touchMode = TOUCH_MODE_ZOOM;\n } else {\n touchMode = TOUCH_MODE_INVALID;\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n\n canvas.addEventListener('touchend', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n canvas.addEventListener('touchcancel', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n // Rotate or zoom based on the touch mode.\n canvas.addEventListener('touchmove', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (touchMode === TOUCH_MODE_ROTATE) {\n let oldTouch = touches[0];\n let newTouch = targetTouches[0];\n let dx = newTouch.clientX - oldTouch.clientX;\n let dy = newTouch.clientY - oldTouch.clientY;\n\n rotate(dx, dy);\n } else if (touchMode === TOUCH_MODE_ZOOM) {\n let len1 = getTouchesLength(touches[0], touches[1]);\n let len2 = getTouchesLength(targetTouches[0], targetTouches[1]);\n\n zoom((len1 - len2) / 50);\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n}", "function handleOrigin(){\n\tvar newZoom = DEFAULT_SIZE / blob.r*5; //Precalculate the new zoom.\n\tzoom = lerp(zoom, newZoom, ZOOM_ACC); //Slowly 'lerp' to the new zoom from the old zoom.\n\t\n\ttranslate(width/2, height/2); //Center the view.\n\tscale(zoom); //Scale the view.\n\ttranslate(-blob.pos.x, -blob.pos.y); //Translate view with respect to player movement.\n}", "function updateCameraView() {\n\texmaple.autoAdjustCamera();\n}", "function zoom(scale,isZ)\n{\n\tif(!isZ)\n\t{\n\t\tscale=scale.clamp(0.10,10);\t\n\t\tviewBox.z/=scale;\t\t\n\t}\t\n\tvar oldw=viewBox.w;\n\tvar oldh=viewBox.h;\t\n\tif(isZ)\n\t{\n\t\tviewBox.z=scale;\n\t\t\n\t}\n\tviewBox.z=viewBox.z.clamp(viewBox.zMin,viewBox.zMax);\n\tviewBox.w=DEFWIDTH*viewBox.z;\t\n\tviewBox.h=viewBox.w;\t\n\t\n\t\n\tviewBox.x-=(viewBox.w-oldw)/2;\n\tviewBox.y-=(viewBox.h-oldh)/2;\t\n\t\n\tupdateViewBox();\n\tif(!isZ)\n\t{\n\t\tupdateZoomSlider();\n\t}\n}", "function zoomed() {\n draw();\n circlesTranslate();\n }", "function ReScale(){\n\twhile(mapping){\n\t\tyield;\n\t}\n\tmymap.localScale.x=multiplier*100532.244/(Mathf.Pow(2,zoom));\n\tmymap.localScale.z=transform.localScale.x;\n\t\n\tif(fixPointer){\n\t\tuser.localScale.x=initPointerSize*65536/(Mathf.Pow(2,zoom));\n\t\tuser.localScale.z=user.localScale.x;\n\t}\n\t\n\t//3D View \n\tif(triDView){\n\t\t\tfixPointer=false;\n\t\t\tcam.localPosition.z=-(65536*camDist*Mathf.Cos(camAngle*Mathf.PI/180))/Mathf.Pow(2,zoom);\n\t\t\tcam.localPosition.y=65536*camDist*Mathf.Sin(camAngle*Mathf.PI/180)/Mathf.Pow(2,zoom);\n\t}\n\t//2D View \n\telse{\n\t\tcam.localEulerAngles=Vector3(90,0,0);\n\t\tcam.position.y=(65536*camDist)/(Mathf.Pow(2,zoom));\n\t\tcam.position.z=user.position.z;\n\t\t//Correct the camera's near and far clipping distances according to its new height.\n\t\t//Introduced to avoid the player and plane not being rendered under some circunstances.\n\t\tmycam.nearClipPlane=cam.position.y/10;\n\t\tmycam.farClipPlane= cam.position.y+1;\n\t\t//Small correction to the user's height according to zoom level to avoid similar camera issues.\n\t\tuser.position.y=10*Mathf.Exp(-zoom)+0.01;\n\t}\n}", "smooth_camera()\n {\n this.camera_angle = this.camera_angle + (this.target_angle - this.camera_angle) * .2;\n }", "zoomAtCoords(zoom, x, y) {\n if (!this.containerRect || !this.videoRect) return;\n const oldScale = this.scale;\n this.scale *= zoom;\n this.scale = clamp(this.scale, 1, MAX_ZOOM);\n zoom = this.scale / oldScale;\n x = x - this.containerRect.x - this.containerRect.width / 2;\n y = y - this.containerRect.y - this.containerRect.height / 2;\n const dx = x - this.x * this.videoRect.width;\n const dy = y - this.y * this.videoRect.height;\n this.move(dx * (1 - zoom), dy * (1 - zoom));\n }", "function onZoomPlotFrame() {\n if (map.graphics.graphics.length > 0) {\n var extentOfAllPlotFrames = getExtentOfAllPlotFrames();\n var extentOfCurrentPlotFrame = getExtentOfCurrentPlotFrame();\n var deltaX = (extentOfCurrentPlotFrame.xmax - extentOfCurrentPlotFrame.xmin) / 2;\n var deltaY = (extentOfCurrentPlotFrame.ymax - extentOfCurrentPlotFrame.ymin) / 2;\n zoomToExtent(extentOfAllPlotFrames.xmin - deltaX,\n extentOfAllPlotFrames.ymin - deltaY,\n extentOfAllPlotFrames.xmax + deltaX,\n extentOfAllPlotFrames.ymax + deltaY);\n }\n onMovePlotFrame();\n}", "function changeZoom(event, frame) {\n // create a frame based on the event\n const [x, y] = relativeMousePosition(event);\n const mouseFrame = { worldMatrix: [[1, 0, x], [0, -1, y], [0, 0, 1]] };\n\n // get the scale of the transformation from the event\n const scale = Math.pow(1.1, -event.deltaY);\n\n // return a scaled frame based off of the event\n return scaledFrame(frame, [scale, scale], mouseFrame);\n}", "zoomIn() {\n this.zoom *= 1.25;\n }", "function updateZoomSlider()\n{\n\tvar zf=viewBox.z/(viewBox.zMax-viewBox.zMin);\n\tzf=zf.clamp(0,1);\n\t//'linear' maping (so the slider changes linearly)\t\n\tzf=ZOOMMAPPINGB*Math.log(zf)+ZOOMMAPPINGA;\n\tvar zoomSliderPos=zoomTop+((zoomBottom-zoomTop)*zf);\n\tzoomSlider.attr(\"y\",zoomSliderPos);\n\t\n}", "function zoom() {\n var translate = d3.event.translate,\n scale = d3.event.scale;\n svg.attr(\"transform\", \"translate(\" + translate + \")scale(\" + d3.event.scale + \")\");\n }", "function changeCamera() \r\n{\r\n if (overview)\r\n {\r\n overview = false;\r\n camera.position.set(0, 5, 80);\r\n camera.rotation.x = -Math.PI/10; //camera looks down a bit\r\n camera.lookAt( 0, 3, 0 )\r\n }\r\n else\r\n {\r\n overview = true;\r\n camera.position.set(0, 600, 0);\r\n camera.lookAt(0, 0, 0);\r\n }\r\n}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "function Camera(startPos, wView, hView, ctx) {\n this.direction = {x: 0, y: 0};\n this.x = startPos.x;\n this.y = startPos.y;\n this.width = wView;\n this.height = hView;\n this.scale = 1;\n\n this.toWorld = function(clientX, clientY) {\n return [\n clientX/this.scale - ((wView/this.scale/2) - this.x),\n clientY/this.scale - ((hView/this.scale/2) - this.y)\n ]\n };\n\n this.zoom = function() {\n if (this.scale == 1) {\n this.scale = 0.75;\n } else {\n this.scale = 1;\n }\n };\n\n this.update = function(mod) {\n if (this.direction.x == 1) {\n this.x += 5;\n }\n if (this.direction.x == -1) {\n this.x -= 5;\n }\n if (this.direction.y == 1) {\n this.y += 5;\n }\n if (this.direction.y == -1) {\n this.y -= 5;\n }\n };\n\n this.render = function() {\n // Apply the scale first\n ctx.scale(this.scale, this.scale);\n // Move the scene, in relation to the middle of the viewport ()\n ctx.translate(this.width/this.scale/2 - this.x, (this.height/this.scale/2) - this.y);\n };\n\n this.inside = function(x, y, width, height) {\n // target x + 1/2 width of target should be great than left bound\n // left bound = camera.x (center) - width/2\n // width should be / by scale\n if (x + width/2/this.scale > this.x - ((this.width/this.scale)/2)\n && x - width/2/this.scale < this.x + ((this.width/this.scale)/2)) {\n if (y + height/2/this.scale > this.y - ((this.height/this.scale)/2)\n && y - height/2/this.scale < this.y + ((this.height/this.scale)/2)) {\n return true\n }\n }\n return false\n };\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function zoom(event) {\n event.preventDefault();\n scale += event.deltaY * -0.001;\n scale = Math.min(Math.max(.5, scale), 2);\n wheel.style.transform = `scale(${scale})`;\n }", "function zoom(factor){\n var newZoom = currentZoom * factor;\n if (newZoom >= zoomLimits[0] && newZoom <= zoomLimits[1]){\n currentZoom = newZoom;\n offset[0]*=factor;\n offset[1]*=factor;\n initPosition=[0, 0];\n move(0, 0);\n draw();\n }\n }", "moveCameraToFitBounds(){\n console.log('ShowMap - moveCamera');\n if (!this.props.src || !this.props.dest || !this.state.mapboxGL) {\n return;\n }\n\n console.log('ShowMap - moveCamera');\n this.state.mapboxGL.fitBounds(this.props.src, this.props.dest, 50);\n \n\n }", "function zoom(event) {\n   event.preventDefault();\n \n   scale += event.deltaY * -0.01;\n \n   // Restrict scale\n   scale = Math.min(Math.max(.125, scale), 4);\n \n   // Apply scale transform\n   el.style.transform = `scale(${scale})`;\n }", "changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }", "function zoom() {\n // console.log(d3.event.scale);\n if ($scope.xAxisIsLocked && $scope.yAxisIsLocked) return;\n if ($scope.xAxisIsLocked) {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cy\", function(d) { return x(d[\"y_category\"]); });\n d3.select('.y.axis').call(yAxis);\n } else if ($scope.yAxisIsLocked) {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cx\", function(d) { return x(d[\"x_category\"]); });\n d3.select('.x.axis').call(xAxis);\n } else {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cx\", function(d) { return x(d[\"x_category\"]); })\n .attr(\"cy\", function(d) { return y(d[\"y_category\"]); });\n d3.select('.x.axis').call(xAxis);\n d3.select('.y.axis').call(yAxis);\n }\n }", "function setCurrentZoom(){ \n var limit = getLimits();\n var countriesWidth = limit[\"maxX\"] - limit[\"minX\"];\n var canvasWidth=getCanvasSize(0);\n var canvasHeight=getCanvasSize(1);\n var zoomX=canvasWidth/countriesWidth;\n \n var countriesHeight = limit[\"maxY\"] - limit[\"minY\"];\n var zoomY=canvasHeight/countriesHeight;\n \n currentZoom = Math.min(zoomX, zoomY)*0.90;\n \n zoomLimits[0] = currentZoom;\n zoomLimits[1] = currentZoom*2048;\n offsetInit = [(canvasWidth-(limit[\"maxX\"]+limit[\"minX\"]))/2, (canvasHeight-(limit[\"maxY\"]+limit[\"minY\"]))/2]\n }", "function zoomed() {\n\n var zoom_x = d3.event.scale,\n zoom_y = d3.event.scale,\n trans_x = d3.event.translate[0] - params.viz.clust.margin.left,\n trans_y = d3.event.translate[1] - params.viz.clust.margin.top;\n\n // apply transformation\n apply_transformation(trans_x, trans_y, zoom_x, zoom_y);\n }", "function Simulator_ForwardZoomPixels(distPx)\n{\n\t__GESTURES.OnZoomPixels(distPx);\n}", "function move_screen()\r\n{\r\n\tzoomClicked = true;\r\n\tzoomCount++;\r\n\r\n}", "function zoomOut() {\n _zoomLevel = _krpano().get('view.fov') + 20;\n _krpano().call('zoomto(' + _zoomLevel + ',smooth())');\n _krpano().set('view.fov', _zoomLevel);\n }", "function transformHandler(e) {\n if (transitioning)\n return;\n\n currentFrame.zoom(e.detail.relative.scale,\n e.detail.midpoint.clientX,\n e.detail.midpoint.clientY);\n}", "function Zoom(low, high, delta) {\n this.low = low\n this.high = high\n this.delta = delta\n this.clock = CLOCK++\n}", "function mousewheel() {\n start.apply(this, arguments);\n if (!d3_behavior_zoomZooming) d3_behavior_zoomZooming = d3_behavior_zoomLocation(d3.svg.mouse(d3_behavior_zoomTarget));\n d3_behavior_zoomTo(d3_behavior_zoomDelta() + xyz[2], d3.svg.mouse(d3_behavior_zoomTarget), d3_behavior_zoomZooming);\n }", "function zoomIn() {\n svgElementRef.current.transition().call(svgZoomRef.current.scaleBy, 2);\n setSelectedFocusView(null);\n resetSelectedUnits();\n }", "@autobind\n cameraLookAtCenter(event) {\n this.camera.lookAt(new THREE.Vector3(0,-220 * this.tweenContainer.time,0));\n }", "function zoom(direction)\n{\n\tif(!animating){\n\t\tvar xi = (screenWidth/2) - circleWrapper.origin.real;\n\t\tvar yi = (screenHeight/2) - circleWrapper.origin.img;\n\n\t\tvar xRatio = xi / circleWrapper.diameter;\n\t\tvar yRatio = yi / circleWrapper.diameter;\n\n\t\tif(direction == \"zoomIn\"){\n\t\t\tcircleWrapper.radius = circleWrapper.radius * 1.15;\n\t\t}\n\t\telse if(direction == \"zoomOut\"){\n\t\t\tcircleWrapper.radius = circleWrapper.radius * .85;\n\t\t}\n\n\t\tvar xf = circleWrapper.diameter * xRatio;\n\t\tvar yf = circleWrapper.diameter * yRatio;\n\n\t\tdeltaX = xf - xi;\n\t\tdeltaY = yf - yi;\n\n\t\tcircleWrapper.origin.real -= deltaX;\n\t\tcircleWrapper.origin.img -= deltaY;\n\n\t\tcircleWrapper.updateCSS();\n\t\tupdateBuffer(direction);\n\t}\n}", "function ZoomTheMap(action) {\n var zoom = geeMap.zoom;\n var newZoom;\n if ((action == 'out') && (zoom > 1)) {\n if (zoom == null || zoom == undefined) {\n zoom = 1;\n }\n newZoom = zoom - 1;\n geeMap.setZoom(newZoom);\n }\n if ((action == 'in') && (zoom < 24)) {\n if (zoom == null || zoom == undefined) {\n zoom = 24;\n }\n newZoom = zoom + 1;\n geeMap.setZoom(newZoom);\n }\n}", "function zoomin(){\n map.flyTo(center, zoom,{\n animate: true,\n duration: 2 /*in seconds*/\n }); \n }", "function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "function mousewheel() {\n start.apply(this, arguments);\n if (!d3_v3_behavior_zoomZooming) d3_v3_behavior_zoomZooming = d3_v3_behavior_zoomLocation(d3_v3.svg.mouse(d3_v3_behavior_zoomTarget));\n d3_v3_behavior_zoomTo(d3_v3_behavior_zoomDelta() + xyz[2], d3_v3.svg.mouse(d3_v3_behavior_zoomTarget), d3_v3_behavior_zoomZooming);\n }", "function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n\t var target = controllerHost.target;\n\t var zoomLimit = controllerHost.zoomLimit;\n\t var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n\t newZoom *= zoomDelta;\n\t\n\t if (zoomLimit) {\n\t var zoomMin = zoomLimit.min || 0;\n\t var zoomMax = zoomLimit.max || Infinity;\n\t newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n\t }\n\t\n\t var zoomScale = newZoom / controllerHost.zoom;\n\t controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\t\n\t target.x -= (zoomX - target.x) * (zoomScale - 1);\n\t target.y -= (zoomY - target.y) * (zoomScale - 1);\n\t target.scaleX *= zoomScale;\n\t target.scaleY *= zoomScale;\n\t target.dirty();\n\t }", "function zoomPreview(zf, xoff, yoff, visData) {\n //console.log(arguments.callee.name);\n visData.contextOcean.clearRect(0, 0, visData.displaySize[0], visData.displaySize[1]);\n visData.contextArrows.clearRect(0, 0, visData.displaySize[0], visData.displaySize[1]);\n zf = Number(zf);\n if (zf < 1) {\n zf = 1;\n }\n\n //Maintain the center of the landmap\n var parentSize = [$('#Map').width(), $('#Map').height()];\n\n // Calculate relative distance to center of image\n var distTop = (parentSize[1] / 2) - visData.previewPosition[1];\n var distLeft = (parentSize[0] / 2) - visData.previewPosition[0];\n distTop = distTop / visData.previewSize[1];\n distLeft = distLeft / visData.previewSize[0];\n\n // Calculate new width and height for the LandMap\n var newWidth = visData.landImageSize[0] * zf;\n var newHeight = visData.landImageSize[1] * zf;\n\n // Calculate distance to left in pixels\n var newLeft = newWidth * distLeft;\n var newTop = newHeight * distTop;\n // Subtract half the width of the parent container\n newLeft = -(newLeft - parentSize[0] / 2);\n newTop = -(newTop - parentSize[1] / 2);\n // Calculate new left and top in order to maintain the center\n\n $('#LandMap').width((newWidth) + 'px');\n $('#LandMap').height((newHeight) + 'px');\n $('#LandMap').css({ \"left\": newLeft + 'px' });\n $('#LandMap').css({ \"top\": newTop + 'px' });\n\n}", "function recenterCamera() {\n\tvar old_up = [\n\t\tviewerParams.camera.up.x,\n\t\tviewerParams.camera.up.y,\n\t\tviewerParams.camera.up.z,\n\t];\n\tif (viewerParams.useTrackball) initControls();\n\t// handle fly controls-- just want to look at the center\n\telse viewerParams.camera.lookAt(viewerParams.center);\n\t// maintain orientation as best we can\n\tviewerParams.camera.up.set(old_up[0],old_up[1],old_up[2]);\n\tsendCameraInfoToGUI(null, true);\n}", "function zoomToTileset() {\n boundingSphere = tileset.boundingSphere;\n viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0, -2.0, 0));\n viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);\n\n //changeHeight(0);\n}", "function setZoom() {\n if(zoom == 2.0) {\n\t\tzoom = 1.0;\n\t} else {\n\t\tzoom = 2.0;\n\t}\n}", "function zoomClipped(geo, projection) {\n var view = {r: projection.rotate(), k: projection.scale()},\n zoom = initZoom(geo, projection),\n event = d3_eventDispatch(zoom, 'zoomstart', 'zoom', 'zoomend'),\n zooming = 0,\n zoomOn = zoom.on;\n\n var zoomPoint;\n\n zoom.on('zoomstart', function() {\n d3.select(this).style(zoomstartStyle);\n\n var mouse0 = d3.mouse(this),\n rotate0 = projection.rotate(),\n lastRotate = rotate0,\n translate0 = projection.translate(),\n q = quaternionFromEuler(rotate0);\n\n zoomPoint = position(projection, mouse0);\n\n zoomOn.call(zoom, 'zoom', function() {\n var mouse1 = d3.mouse(this);\n\n projection.scale(view.k = d3.event.scale);\n\n if(!zoomPoint) {\n // if no zoomPoint, the mouse wasn't over the actual geography yet\n // maybe this point is the start... we'll find out next time!\n mouse0 = mouse1;\n zoomPoint = position(projection, mouse0);\n }\n // check if the point is on the map\n // if not, don't do anything new but scale\n // if it is, then we can assume between will exist below\n // so we don't need the 'bank' function, whatever that is.\n else if(position(projection, mouse1)) {\n // go back to original projection temporarily\n // except for scale... that's kind of independent?\n projection\n .rotate(rotate0)\n .translate(translate0);\n\n // calculate the new params\n var point1 = position(projection, mouse1),\n between = rotateBetween(zoomPoint, point1),\n newEuler = eulerFromQuaternion(multiply(q, between)),\n rotateAngles = view.r = unRoll(newEuler, zoomPoint, lastRotate);\n\n if(!isFinite(rotateAngles[0]) || !isFinite(rotateAngles[1]) ||\n !isFinite(rotateAngles[2])) {\n rotateAngles = lastRotate;\n }\n\n // update the projection\n projection.rotate(rotateAngles);\n lastRotate = rotateAngles;\n }\n\n zoomed(event.of(this, arguments));\n });\n\n zoomstarted(event.of(this, arguments));\n })\n .on('zoomend', function() {\n d3.select(this).style(zoomendStyle);\n zoomOn.call(zoom, 'zoom', null);\n zoomended(event.of(this, arguments));\n sync(geo, projection, syncCb);\n })\n .on('zoom.redraw', function() {\n geo.render();\n });\n\n function zoomstarted(dispatch) {\n if(!zooming++) dispatch({type: 'zoomstart'});\n }\n\n function zoomed(dispatch) {\n dispatch({type: 'zoom'});\n }\n\n function zoomended(dispatch) {\n if(!--zooming) dispatch({type: 'zoomend'});\n }\n\n function syncCb(set) {\n var _rotate = projection.rotate();\n set('projection.rotation.lon', -_rotate[0]);\n set('projection.rotation.lat', -_rotate[1]);\n }\n\n return d3.rebind(zoom, event, 'on');\n}", "function zoomed() {\n map.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n meteorites.attr('transform', 'translate(' + d3.event.translate + ')scale(' + d3.event.scale + ')');\n }", "function _autoView(component, sele, duration) {\n component.stage.animationControls.zoomMove(\n component.getCenter( sele ),\n component.getZoom( sele ) * 0.5,\n duration\n );\n}", "function move() {\n\n var t = d3.event.translate;\n var s = d3.event.scale;\n\n zoom.translate(t);\n g.style(\"stroke-width\", 1 / s).attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\n\n }", "function canvasZoomImage() {\n // move image left top corner to 0,0\n this.image.raster.position = this.image.raster.bounds.size.multiply(1 / 2); // set view to the center of image\n\n this.scope.view.center = this.image.raster.position; // derive zoom, so the image fits into the view\n\n var page_width_ratio = this.image.raster.width / this.image.raster.height;\n var view_width_ratio = this.scope.view.bounds.width / this.scope.view.bounds.height;\n var end_zoom;\n\n if (view_width_ratio > page_width_ratio) {\n end_zoom = this.scope.view.bounds.height / this.image.raster.height * this.scope.view.zoom;\n } else {\n end_zoom = this.scope.view.bounds.width / this.image.raster.width * this.scope.view.zoom;\n }\n\n var page_fraction_in_view = 0.75;\n this.scope.view.zoom = end_zoom * page_fraction_in_view; // scale view, so the image fits\n\n if (!this.scope.view.zoom_animation.on && !this.scope.view.translate_animation.on) {\n this.scope.view.zoom_animation.reset();\n this.scope.view.zoom_animation.start_zoom = this.scope.view.zoom;\n this.scope.view.zoom_animation.end_zoom = end_zoom;\n this.scope.view.zoom_animation.p = 3;\n this.scope.view.zoom_animation.total_time = 0.5;\n this.scope.view.zoom_animation.on = true;\n }\n}", "zoomInOrOut() {\n //console.log('Muhahahaha');\n let vm = this;\n let {$document} = vm.DI();\n //Mouse wheel event\n let lens = $document[0].getElementById(\"lens\");\n angular.element(lens).on(\"wheel\", function (e) {\n e.preventDefault();\n //console.log(\"V M : \", vm);\n //console.log(\"Mouse Wheeled ..........................!!!!!!!!!!!!!!!!!!!!!!!1\", e.deltaX, e.deltaY);\n //console.log(\"z index before :\", vm.zoomIndex);\n if (e.deltaY > 0) {\n vm.zoomIndex++;\n //console.log(\"z index :\", vm.zoomIndex);\n } else {\n vm.zoomIndex--;\n //console.log(\"z index :\", vm.zoomIndex);\n }\n vm.enlarge();\n });\n /*if (lens.addEventListener) {\n // IE9, Chrome, Safari, Opera\n lens.addEventListener(\"mousewheel\", vm._mouseWheelHandler(vm), false);\n // Firefox\n lens.addEventListener(\"DOMMouseScroll\", vm._mouseWheelHandler, false);\n }\n // IE 6/7/8\n else lens.attachEvent(\"onmousewheel\", vm._mouseWheelHandler);*/\n }", "function move() {\r\n\r\n var t = d3.event.translate;\r\n var s = d3.event.scale;\r\n\r\n zoom.translate(t);\r\n g.style(\"stroke-width\", 1 / s).attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\r\n }", "function ZoomIn()\n {\n var zoomLevel = map.getZoom() + 1;\n map.setView({ zoom: zoomLevel });\n }", "function ZoomButton() {\n\tif(gridZoom == 10) {\n\t\tgridZoom = 3;\n\t}\n\telse {\n\t\tgridZoom = 10;\n\t\tUpdateGraphicsZoomMap();\n\t}\n\tUpdateTileMap();\n\tUpdateNoteGrid();\n}", "function zoom() {\n $scope.svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "zoom(factor) {\n this.transformationMatrix = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"transform\"])(this.transformationMatrix, Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"scale\"])(factor, factor));\n this.zoomChange.emit(this.zoomLevel);\n this.updateTransform();\n }", "resetZoom() {\n this.simcirWorkspace.zoom(false, 1);\n }", "zoomTo(level) {\n this.transformationMatrix.a = isNaN(level) ? this.transformationMatrix.a : Number(level);\n this.transformationMatrix.d = isNaN(level) ? this.transformationMatrix.d : Number(level);\n this.zoomChange.emit(this.zoomLevel);\n this.updateTransform();\n this.update();\n }", "function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\n target.x -= (zoomX - target.x) * (zoomScale - 1);\n target.y -= (zoomY - target.y) * (zoomScale - 1);\n target.scaleX *= zoomScale;\n target.scaleY *= zoomScale;\n target.dirty();\n}" ]
[ "0.75529623", "0.75270426", "0.7071705", "0.6874714", "0.68658197", "0.68371975", "0.6793753", "0.678613", "0.6686939", "0.6658725", "0.6653342", "0.66445583", "0.6642654", "0.6589087", "0.6584138", "0.6579761", "0.65435493", "0.6541787", "0.6522788", "0.6514777", "0.64044493", "0.6391011", "0.6388407", "0.63840514", "0.6377962", "0.6375128", "0.6359341", "0.63508224", "0.63503236", "0.63309515", "0.63084453", "0.6301643", "0.630134", "0.627084", "0.626866", "0.62209874", "0.62099504", "0.6199916", "0.61869764", "0.6186312", "0.61861956", "0.61719245", "0.6157384", "0.6136609", "0.61335546", "0.61277664", "0.6116857", "0.6112446", "0.6105001", "0.60945976", "0.6084534", "0.6076923", "0.60709554", "0.60642815", "0.6063178", "0.60618556", "0.60618556", "0.6060581", "0.6057774", "0.6057774", "0.60461456", "0.6044537", "0.60248315", "0.60211885", "0.6018693", "0.6016352", "0.6005081", "0.60014045", "0.59982514", "0.5993033", "0.59903824", "0.5984897", "0.59838825", "0.5982265", "0.5979078", "0.5977884", "0.5975595", "0.59752226", "0.59717387", "0.59703314", "0.5970244", "0.5969002", "0.5961377", "0.59586823", "0.5958364", "0.5953411", "0.59485364", "0.59424204", "0.59423476", "0.59373546", "0.5933134", "0.59299034", "0.59288955", "0.59286165", "0.5928215", "0.59244204", "0.59232795", "0.5915096", "0.5914978", "0.5907935" ]
0.7447297
2
Get the vector length between two touches.
function getTouchesLength(touch1, touch2) { let dx = touch2.clientX - touch1.clientX; let dy = touch2.clientY - touch1.clientY; return Math.sqrt(dx * dx + dy * dy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLength() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n return Math.hypot(x1 - x2, y1 - y2);\n }", "function len (p1, p2) {\n return Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y))\n }", "getDistanceBetweenTouches(e) {\n if (e.targetTouches.length < 2) return 1;\n const x1 = e.targetTouches[0].pageX;\n const y1 = e.targetTouches[0].pageY;\n const x2 = e.targetTouches[1].pageX;\n const y2 = e.targetTouches[1].pageY;\n const distance = Math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2));\n return distance;\n }", "length() {\n return Math.hypot(this.x, this.y);\n }", "static distance(_v1, _v2) {\r\n return Vector2D.direction(_v1, _v2).length();\r\n }", "function getDistanceBetweenTouches(ev) {\n if (ev.targetTouches.length < 2)\n return 1;\n var x1 = ev.targetTouches[0].pageX, y1 = ev.targetTouches[0].pageY, x2 = ev.targetTouches[1].pageX, y2 = ev.targetTouches[1].pageY;\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "get length () {\n /**\n * length() is implemented here as a getter, so you can just call `vec.length`\n * makes it feel more native (like an array or a string)\n * simply calculates the magnitude of the vector based on the following equation:\n * length^2 = x^2 + y^2\n */\n return Math.sqrt(this.coordsArray.reduce((acc, cur) => acc + cur ** 2, 0))\n }", "function ptsLength( src, tgt ) { \n\t\treturn Math.sqrt( Math.pow( src.x - tgt.x, 2) + Math.pow( src.y - tgt.y, 2) );\n\t}", "get length() {\n return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));\n }", "function touchDistance(t1, t2) {\n var dx = t2.screenX - t1.screenX;\n var dy = t2.screenY - t1.screenY;\n return sqrt(dx * dx + dy * dy);\n }", "function getTouchDistance(){\n const ballPos = ball.body.position;\n return getDistance(touchX, touchY, ballPos.x, ballPos.y); \n }", "function distance(p1, p2) { return length_v2(diff_v2(p1, p2)); }", "function getLength(a, b) {\n return Math.sqrt((Math.pow(b[0] - a[0], 2) + Math.pow(b[1] - a[1], 2) + Math.pow(b[2] - a[2], 2)));\n}", "get length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "function get_vectorlen(v, newLength){\n\tlet length = Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n\treturn [(v[0] / length) * newLength, (v[1] / length) * newLength];\n}", "dist(vector) {\n return vector\n .copy()\n .sub(this)\n .getLength();\n }", "updateLength() {\n this._len = tempVec3.sub(this.p1, this.p0).len();\n }", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "dragVelocity() {\n const deltaCount = this.touchPositions.length - 1;\n if (deltaCount < 1) {\n return 0;\n }\n\n let velocitySum = 0;\n // Don't loop to zero, as we'll always be comparing the current index to the previous\n for (let i = deltaCount; i > 0; i--) {\n const curr = this.touchPositions[i];\n const last = this.touchPositions[i-1];\n velocitySum += (curr.x - last.x) / ((curr.time - last.time) / 1000);\n }\n\n return velocitySum / deltaCount;\n }", "length() { return this.end-this.start }", "function vectorDist(a, b) {\n return Math.sqrt(\n Math.pow(a[0]-b[0], 2) +\n Math.pow(a[1]-b[1], 2) +\n Math.pow(a[2]-b[2], 2)\n );\n}", "get len() { // added to normailze the speed of the ball when it starts\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}", "function length_v2(v) { return Math.sqrt(v[0] * v[0] + v[1] * v[1]); }", "function calculate_the_length(x1,y1,x2,y2){\n let length_AB = Math.sqrt ((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));\n console.log(length_AB)\n}", "function vectorLen(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n}", "function computeVectorDistance(x1, x2) {\n\tconst D = x1.length;\n\tlet d = 0;\n\tfor (let i = 0; i < D; i++) {\n\t\tconst x1i = x1[i];\n\t\tconst x2i = x2[i];\n\t\td += (x1i - x2i) * (x1i - x2i);\n\t}\n\treturn d;\n}", "function length(a,b) {\n return a.length - b.length\n}", "function facePosDist(pos1, pos2) {\n var dx = pos2[0] - pos1[0];\n var dy = pos2[1] - pos1[1];\n return Math.sqrt((dx * dx) + (dy * dy));\n}", "function calculateLengthAbsolute( point1, point2){\r\n return Math.abs(point1-point2);\r\n}", "function length(point) {\n return Math.sqrt(point.x * point.x + point.y * point.y);\n }", "function traveledDistance() {\n if (data.mousetrackingX !== undefined) {\n if (data.mousetrackingX.length === data.mousetrackingY.length) {\n return data.mousetrackingX.length;\n }\n }\n return -1;\n }", "get length () {\n return this.end-this.start;\n }", "static distance(a, b) {\n const dx = a.x - b.x;\n const dy = a.y - b.y;\n return Math.hypot(dx, dy);\n // Math.hypot(3, 4);\n // 5\n }", "function computeLineLength( x1, y1, x2, y2 ) {\n let xdiff = subtract( x2, x1 );\n let ydiff = subtract( y2, y1 );\n let total = add( square( xdiff ), square( ydiff ) );\n return Math.sqrt( total );\n}", "function getLineLength(x1, y1, x2, y2) {\n var res = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2));\n return res;\n}", "intersectionLength(circle) {\n let radSum = circle.r + this.r;\n let distanceBetweenPoints = vec3(this.x - circle.x, this.y - circle.y, 0).length();\n\n return radSum - distanceBetweenPoints;\n }", "function sc_vectorLength(v) {\n return v.length;\n}", "getLineLengthBetweenPoints (x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n }", "function calcTouchDistance(touchData) {\n if (touchData.count < 2) { \n return 0; \n } // if\n \n var xDist = touchData.x - touchData.next.x,\n yDist = touchData.y - touchData.next.y;\n \n // return the floored distance to keep math in the realm of integers...\n return ~~Math.sqrt(xDist * xDist + yDist * yDist);\n } // touches", "length(){ return this.end-this.start }", "_distance(vectorOne, vectorTwo) {\n var distance = Math.sqrt(((vectorTwo[0] - vectorOne[0]) * (vectorTwo[0] - vectorOne[0])) + ((vectorTwo[1] - vectorOne[1]) * (vectorTwo[1] - vectorOne[1])) + ((vectorTwo[2] - vectorOne[2]) * (vectorTwo[2] - vectorOne[2])));\n return distance;\n }", "function vDist(u,v){\r\n\treturn vLen(uToV(u,v));\r\n}", "function distBetweenPoints(a,b){\r\n return Math.sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));\r\n}", "length() {\n return Math.sqrt(this.w * this.w + this.xyz.clone().lengthSq() );\n }", "function distanceBetweenPoints(a, b) {\n \n return Math.hypot(a.x-b.x, a.y-b.y)\n}", "function ptDist(pt1, pt2) {\n var dx = pt1[2] - pt2[2],\n dy = pt1[3] - pt2[3];\n return Math.sqrt(dx * dx + dy * dy);\n}", "function distanceBetween(p1, p2){\n var a = Math.abs(p1.x-p2.x)%size.width;\n var b = Math.abs(p1.y-p2.y);\n a = Math.min(a, size.width-a);\n return Math.sqrt(Math.pow(a,2)+Math.pow(b,2));\n }", "Magnitude() {\n return Vec2.Magnitude(this);\n }", "get length() { return this.to - this.from; }", "get Width() { return this.x2 - this.x1; }", "get Width() { return this.x2 - this.x1; }", "function dist (pos1, pos2){\n const diffX = Math.abs(pos1[0] - pos2[0])\n const diffY = Math.abs(pos1[1] - pos2[1])\n console.log(diffX, diffY)\n return Math.max(diffX, diffY)\n}", "perimeterDistance(v1, v2) {\n return this.distance(this.tracePerimeter(v1, v2, true))\n }", "static distance(p1, p2) {\n const dx = (p1.x - p2.x);\n const dy = (p1.y - p2.y);\n return Math.sqrt(dx * dx + dy * dy);\n }", "function length(v) {\n return sqrt(v[0] * v[0] + v[1] * v[1]);\n}", "static distance(start, end) {\n return Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2));\n }", "function distanceTo(vector, vector1) {\n\treturn Math.pow( Math.pow(vector[0]-vector1[0], 2) + Math.pow(vector[1]-vector1[1], 2) , 0.5);\n}", "dist (pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "function vector(P1, P2) {\n var x1 = P1[0];\n var y1 = P1[1];\n var x2 = P2[0];\n var y2 = P2[1];\n var v = [x2-x1, y2-y1];\n return v;\n}", "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "function calculateVelocity() {\n velocity_of_x = bullet_moving_velocity * Math.cos(bullet_moving_theta * Math.PI / 200);\n velocity_of_y = bullet_moving_velocity * Math.sin(bullet_moving_theta * Math.PI / 200);\n}", "totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n pts = [ p5.Vector.add(this.cpts[idx], this.cpts[idx+1]).mult(0.5),\n this.cpts[idx+1],\n this.cpts[idx+2],\n p5.Vector.add(this.cpts[idx+2], this.cpts[idx+3]).mult(0.5)\n ];\n \n clen += this.segmentLength(pts);\n }\n\n return clen;\n\n }", "function _delaunay_distance(v1, v2) {\n\treturn Math.sqrt(Math.pow(v2.x - v1.x, 2) + Math.pow(v2.y - v1.y, 2));\n}", "function dist(p1, p2)\n{\n return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);\n}", "dist (pos1, pos2) {\n\t return Math.sqrt(\n\t Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n\t );\n\t }", "dist(vector) \r\n {\r\n if(vector instanceof Vector2D)\r\n return vector.copy().sub(this.copy()).mag();\r\n \r\n console.warn(`- Vector2D.dist : ${this.toString()} tried to get distance to ${vector.toString()}.\\n\r\n Operation Failed, you need to provide a Vector2D as argument.`);\r\n return false;\r\n }", "function vectorDiff(a, b) {\r\n return [b[0] - a[0], b[1] - a[1]];\r\n}", "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "function lineLength(x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n}", "function touchDirection(t1, t2) {\n return atan2(t2.screenY - t1.screenY,\n t2.screenX - t1.screenX) * 180 / PI;\n }", "function distance(pt1, pt2) { \n\n return Math.sqrt(Math.pow((pt1.x - pt2.x), 2) + Math.pow((pt1.y - pt2.y), 2));\n}", "getMagnitude() {\n // use pythagoras theorem to work out the magnitude of the vector\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "function dist(p1,p2) {\n return Math.hypot(p2.x-p1.x, p2.y-p1.y);\n}", "function dist2(a, b)\n{\n var dx = (a.x - b.x);\n var dy = (a.y - b.y);\n\n return dx * dx + dy * dy;\n}", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "function distanceBetweenEnemies(a, b){\n return ((a.pos.x - b.pos.x) ^ 2 + (a.pos.y - b.pos.y) ^ 2) ^ 0.5;\n}", "function distBetween(a, b) {\n //return Math.abs(a.x - b.x) * Math.abs(a.x - b.x) + Math.abs(a.y - b.y) * Math.abs(a.y - b.y);\n return Math.round(1.5 * Math.sqrt((a.x - b.x) * (a.x - b.x) +\n (a.y - b.y) * (a.y - b.y)));\n}", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "distance (a, b) {\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }", "function getVector(a, b) {\n const distance = distanceBetweenPoints(a,b);\n return {\n x: (b.x - a.x) / distance,\n y: (b.y - a.y) / distance,\n };\n}", "xyzLength() {\nreturn E3Vec.lengthV3(this.xyz);\n}", "get numVertices() {\n return this._coords.length / 2\n }", "function calculateNormalVector(source, target, length) {\n var dx = target.x - source.x,\n dy = target.y - source.y,\n nx = -dy,\n ny = dx,\n vlength = Math.sqrt(nx * nx + ny * ny),\n ratio = length / vlength;\n\n return { x: nx * ratio, y: ny * ratio };\n }", "function longitud(vector) {\n return Math.sqrt(Math.pow(vector.x, 2) + Math.pow(vector.y, 2))\n}", "getDistance(obj1, obj2) \n {\n return Phaser.Math.Distance.Between(obj1.x, obj1.y, obj2.x, obj2.y);\n }", "function distance(a, b) {\n // a^2 + b^2 = c^2\n return Math.sqrt(Math.abs((a.ox - b.ox) * (a.ox - b.ox) + (a.oy - b.oy) * (a.oy - b.oy)));\n }", "length(): number {\n return Math.max(0, this.stop - this.start + 1);\n }", "function dist(p1, p2) {\n var dx = p1.x - p2.x;\n var dy = p1.y - p2.y;\n return Math.sqrt(dx*dx + dy*dy);\n}", "get verticalSpeed () {\n if (this.pointers.length > 0)\n return this.pointers.reduce((sum, pointer) => { return sum+pointer.verticalSpeed}, 0) / this.pointers.length;\n else \n return 0;\n }", "function distance(point1, point2) {\n return Math.hypot(point1.x-point2.x, point1.y-point2.y);\n}", "function Vector2_distance(vector1, vector2) {\n var squareSum = 0;\n squareSum += (vector1.x - vector2.x) * (vector1.x - vector2.x);\n squareSum += (vector1.y - vector2.y) * (vector1.y - vector2.y);\n return Math.sqrt(squareSum);\n}", "function getsnakelength() {\r\n var length = 0;\r\n for (var i = 0; i < this.snake.length; i++) {\r\n var cur = this.snake[i];\r\n var next = this.snake[(i + 1) % this.snake.length];\r\n length += distance(cur, next);\r\n }\r\n return length;\r\n }", "get length() {\n return this.points.length;\n }", "function distance(pos1, pos2) {\n\t\tvar xy1 = pos2xy(pos1);\n\t\tvar xy2 = pos2xy(pos2);\n\t\tvar dx = xy2[0] - xy1[0];\n\t\tvar dy = xy2[1] - xy1[1];\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}", "function PathLength(points) {\n let length = 0.0;\n for (let i = 1; i < points.length - 1; i += 1) {\n length += EuclideanDistance(points[i - 1], points[i]);\n }\n return length;\n }", "function dist(x1,y1,x2,y2) {\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\n}", "function getDistance(a, b) {\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }", "static distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);\n }" ]
[ "0.6841312", "0.6699425", "0.6670049", "0.6597115", "0.6594384", "0.6546013", "0.65313715", "0.64357984", "0.6395281", "0.63648415", "0.6281862", "0.62077695", "0.6207016", "0.618117", "0.6129951", "0.61223197", "0.61141026", "0.60874313", "0.60874313", "0.59573007", "0.59410965", "0.5928656", "0.58868307", "0.58847195", "0.58713955", "0.58339554", "0.5788969", "0.5778532", "0.5758415", "0.57360864", "0.5699528", "0.56963813", "0.56962913", "0.56833375", "0.5665434", "0.5652778", "0.5641933", "0.5611598", "0.56102765", "0.5594156", "0.55711436", "0.5529182", "0.5524695", "0.5521915", "0.5512759", "0.5509547", "0.5505166", "0.5504112", "0.5502926", "0.5501764", "0.5475037", "0.5475037", "0.5470803", "0.54499966", "0.54336727", "0.54312414", "0.5420276", "0.54110277", "0.5405582", "0.540323", "0.53931177", "0.53787535", "0.53787315", "0.5370897", "0.5349939", "0.5342674", "0.5336163", "0.5332951", "0.5327049", "0.53200835", "0.5316198", "0.53063834", "0.53000355", "0.52961063", "0.5289605", "0.5276179", "0.5272166", "0.5266309", "0.5264534", "0.5264534", "0.5262345", "0.5258728", "0.5250919", "0.5248942", "0.5246616", "0.5241959", "0.52285415", "0.5226238", "0.52226025", "0.5221225", "0.5209584", "0.52062804", "0.51984346", "0.51938313", "0.5193321", "0.51838374", "0.5179074", "0.5178567", "0.51781785", "0.51740885" ]
0.7707527
0
Create "factory factory" function that returns a constructor function. The factory factory takes in one parameter, "type". Each created factory needs to create objects with this given type. Each created factory needs to take in three parameters and save them to the created objects: make model Use your factory factory to create at least five factories, such as bicycle factory car factory boat factory blimp factory train factory Lastly, use those factories to create some vehicles. Store all your created vehicles inside one array, loop over that array and print out each vehicle. Question: Check the type of your factories and of the objects that your factories create what is the type of a factory and what is the type of a created object? Add your answer as comments into into your solution file.
function factoryFactory(type){ return function Factory(make, model){ this.type = type; this.make = make; this.model = model; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory(){}", "function Factory(){}", "function Factory() {\r\n this.createProduct = function(type) {\r\n let product;\r\n if (type === \"Phone\") {\r\n product = new Phone();\r\n } else if (type === \"Smartphone\") {\r\n product = new Smartphone();\r\n } else if (type === \"Tablet\") {\r\n product = new Tablet();\r\n } else if (type === \"Notebook\") {\r\n product = new Notebook();\r\n } else if (type === \"Desktop\") {\r\n product = new Desktop();\r\n }\r\n product.type = type\r\n product.info = function () {\r\n return this.type + \" will be build in \" + this.hours + \" hours.\"\r\n }\r\n return product\r\n }\r\n}", "function VehicleFactory() { }", "function VehicleFactory() { }", "function CarFactory(make, model) {\n this.make = make;\n this.model = model;\n}", "function factory() {}", "function factory() {}", "function Factory(n){\r\n\r\n }", "function Factory (name) {\n\tthis.name = name\n}", "function compileFactoryFunction(meta){var t=variable('t');var statements=[];// The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n// this type is always created by constructor invocation, then this is the type-to-create\n// parameter provided by the user (t) if specified, or the current type if not. If there is a\n// delegated factory (which is used to create the current type) then this is only the type-to-\n// create parameter (t).\nvar typeForCtor=!isDelegatedMetadata(meta)?new BinaryOperatorExpr(BinaryOperator.Or,t,meta.type):t;var ctorExpr=null;if(meta.deps!==null){// There is a constructor (either explicitly or implicitly defined).\nctorExpr=new InstantiateExpr(typeForCtor,injectDependencies(meta.deps,meta.injectFn));}else{var baseFactory=variable(\"\\u0275\"+meta.name+\"_BaseFactory\");var getInheritedFactory=importExpr(Identifiers$1.getInheritedFactory);var baseFactoryStmt=baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE,[StmtModifier.Exported,StmtModifier.Final]);statements.push(baseFactoryStmt);// There is no constructor, use the base class' factory to construct typeForCtor.\nctorExpr=baseFactory.callFn([typeForCtor]);}var ctorExprFinal=ctorExpr;var body=[];var retExpr=null;function makeConditionalFactory(nonCtorExpr){var r=variable('r');body.push(r.set(NULL_EXPR).toDeclStmt());body.push(ifStmt(t,[r.set(ctorExprFinal).toStmt()],[r.set(nonCtorExpr).toStmt()]));return r;}if(isDelegatedMetadata(meta)&&meta.delegateType===R3FactoryDelegateType.Factory){var delegateFactory=variable(\"\\u0275\"+meta.name+\"_BaseFactory\");var getFactoryOf=importExpr(Identifiers$1.getFactoryOf);if(meta.delegate.isEquivalent(meta.type)){throw new Error(\"Illegal state: compiling factory that delegates to itself\");}var delegateFactoryStmt=delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE,[StmtModifier.Exported,StmtModifier.Final]);statements.push(delegateFactoryStmt);retExpr=makeConditionalFactory(delegateFactory.callFn([]));}else if(isDelegatedMetadata(meta)){// This type is created with a delegated factory. If a type parameter is not specified, call\n// the factory instead.\nvar delegateArgs=injectDependencies(meta.delegateDeps,meta.injectFn);// Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\nvar factoryExpr=new(meta.delegateType===R3FactoryDelegateType.Class?InstantiateExpr:InvokeFunctionExpr)(meta.delegate,delegateArgs);retExpr=makeConditionalFactory(factoryExpr);}else if(isExpressionFactoryMetadata(meta)){// TODO(alxhub): decide whether to lower the value here or in the caller\nretExpr=makeConditionalFactory(meta.expression);}else{retExpr=ctorExpr;}return{factory:fn([new FnParam('t',DYNAMIC_TYPE)],Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(body,[new ReturnStatement(retExpr)]),INFERRED_TYPE,undefined,meta.name+\"_Factory\"),statements:statements};}", "function TruckFactory(){}", "function TruckFactory() {}", "function TruckFactory() {}", "function compileFactoryFunction(meta) {\n var t = variable('t');\n var statements = [];\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n var typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n var ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn));\n }\n else {\n var baseFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n var baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n var ctorExprFinal = ctorExpr;\n var body = [];\n var retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n var r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n body.push(ifStmt(t, [r.set(ctorExprFinal).toStmt()], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n var delegateFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(\"Illegal state: compiling factory that delegates to itself\");\n }\n var delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n }\n else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n var delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(body, [new ReturnStatement(retExpr)]), INFERRED_TYPE, undefined, meta.name + \"_Factory\"),\n statements: statements,\n };\n}", "function compileFactoryFunction(meta) {\n var t = variable('t');\n var statements = [];\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n var typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n var ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn));\n }\n else {\n var baseFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n var baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n var ctorExprFinal = ctorExpr;\n var body = [];\n var retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n var r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n body.push(ifStmt(t, [r.set(ctorExprFinal).toStmt()], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n var delegateFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(\"Illegal state: compiling factory that delegates to itself\");\n }\n var delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n }\n else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n var delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(body, [new ReturnStatement(retExpr)]), INFERRED_TYPE, undefined, meta.name + \"_Factory\"),\n statements: statements,\n };\n}", "function compileFactoryFunction(meta) {\n var t = variable('t');\n var statements = [];\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n var typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n var ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn));\n }\n }\n else {\n var baseFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n var baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n var ctorExprFinal = ctorExpr;\n var body = [];\n var retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n var r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n var ctorStmt = null;\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n }\n else {\n ctorStmt = makeErrorStmt(meta.name);\n }\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n var delegateFactory = variable(\"\\u0275\" + meta.name + \"_BaseFactory\");\n var getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(\"Illegal state: compiling factory that delegates to itself\");\n }\n var delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n }\n else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n var delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n }\n else {\n body.push(makeErrorStmt(meta.name));\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, meta.name + \"_Factory\"),\n statements: statements,\n };\n}", "function AutoFactory() {}", "function registerFactory(data){\n\treturn {\n\t\t\tarr: data.split(', '),\n\t\t\tdrawer: 0,\n\t\t\ttotal: function(){\n\t\t\t\tthis.drawer = this.arr.reduce(function(acc,val){\n\t\t\t\t\treturn parseFloat(acc) + parseFloat(val);\n\t\t\t\t},0);\n\t\t\t\tconsole.log(this.drawer.toFixed(2));\n\t\t\t},\n\t\t\tdeposit: function(funds){\n\t\t\t\tfs.appendFile('bank.txt', `, ${funds}` , 'utf8', function(error){\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\twithdraw: function(funds){\n\t\t\t\tfs.appendFile('bank.txt', `, -${funds}`, 'utf8', function(error){\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\tlotto: function(){\n\t\t\t\tfs.appendFile('bank.txt', `, -${0.25}`, 'utf8', function(error){\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t\tvar myPick = Math.floor((Math.random() * 2) + 1);\n\t\t\t\t\tif(myPick === 1){\n\t\t\t\t\t\tfs.appendFile('bank.txt', `, -${((Math.random()*2)+1).toFixed(2)}`, 'utf8', function(error){\n\t\t\t\t\t\t\tif(error){\n\t\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfs.appendFile('bank.txt', `, ${((Math.random()*2)+1).toFixed(2)}`, 'utf8', function(error){\n\t\t\t\t\t\t\tif(error){\n\t\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t};\n\n\t}", "function MemberFactory(){\n // this.memberKeeper = [];\n this.createMember = function(name, type){\n let member;\n if(type==='simple'){\n member = new SimpleMember(name);\n // this.memberKeeper.push({username:name, status: type, cost:'5$'});\n console.log(`${name} added`);\n }else if(type==='standart'){\n member = new StandartMember(name);\n // this.memberKeeper.push({username:name, status: type, cost:'15$'});\n console.log(`${name} added`);\n }else if(type==='super'){\n member = new SuperMember(name);\n // this.memberKeeper.push({username:name, status: type, cost:'25$'});\n console.log(`${name} added`);\n }else{\n console.log(`${type} does not exist`);\n }\n return member;\n }\n}", "function compileFactoryFunction(meta) {\n var t = variable('t');\n var statements = [];\n var ctorDepsType = NONE_TYPE; // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n\n var typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.internalType) : t;\n var ctorExpr = null;\n\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn, meta.target === R3FactoryTarget.Pipe));\n ctorDepsType = createCtorDepsType(meta.deps);\n }\n } else {\n var baseFactory = variable(\"\\u0275\".concat(meta.name, \"_BaseFactory\"));\n var getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n var baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.internalType],\n /* sourceSpan */\n undefined,\n /* pure */\n true)).toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(baseFactoryStmt); // There is no constructor, use the base class' factory to construct typeForCtor.\n\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n\n var ctorExprFinal = ctorExpr;\n var body = [];\n var retExpr = null;\n\n function makeConditionalFactory(nonCtorExpr) {\n var r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n var ctorStmt = null;\n\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n } else {\n ctorStmt = importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt();\n }\n\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n var delegateFactory = variable(\"\\u0275\".concat(meta.name, \"_BaseFactory\"));\n var getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n\n if (meta.delegate.isEquivalent(meta.internalType)) {\n throw new Error(\"Illegal state: compiling factory that delegates to itself\");\n }\n\n var delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n } else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n var delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn, meta.target === R3FactoryTarget.Pipe); // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n\n var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ? InstantiateExpr : InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n } else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n } else {\n retExpr = ctorExpr;\n }\n\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n } else {\n body.push(importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt());\n }\n\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, \"\".concat(meta.name, \"_Factory\")),\n statements: statements,\n type: expressionType(importExpr(Identifiers$1.FactoryDef, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]))\n };\n}", "function compileFactoryFunction(meta) {\n const t = variable('t');\n const statements = [];\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n let ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn));\n }\n }\n else {\n const baseFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n const baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n const ctorExprFinal = ctorExpr;\n const body = [];\n let retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n const r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n let ctorStmt = null;\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n }\n else {\n ctorStmt = makeErrorStmt(meta.name);\n }\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n const delegateFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(`Illegal state: compiling factory that delegates to itself`);\n }\n const delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n }\n else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n }\n else {\n body.push(makeErrorStmt(meta.name));\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`),\n statements,\n };\n}", "function compileFactoryFunction(meta) {\n const t = variable('t');\n const statements = [];\n let ctorDepsType = NONE_TYPE;\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedMetadata(meta) ?\n new BinaryOperatorExpr(BinaryOperator.Or, t, meta.internalType) :\n t;\n let ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn, meta.target === R3FactoryTarget.Pipe));\n ctorDepsType = createCtorDepsType(meta.deps);\n }\n }\n else {\n const baseFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n const baseFactoryStmt = baseFactory\n .set(getInheritedFactory.callFn([meta.internalType], /* sourceSpan */ undefined, /* pure */ true))\n .toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n const ctorExprFinal = ctorExpr;\n const body = [];\n let retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n const r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n let ctorStmt = null;\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n }\n else {\n ctorStmt = importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt();\n }\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn, meta.target === R3FactoryTarget.Pipe);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n }\n else {\n body.push(importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt());\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`),\n statements,\n type: expressionType(importExpr(Identifiers$1.FactoryDef, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]))\n };\n}", "function compileFactoryFunction(meta) {\n const t = variable('t');\n const statements = [];\n let ctorDepsType = NONE_TYPE;\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedMetadata(meta) ?\n new BinaryOperatorExpr(BinaryOperator.Or, t, meta.internalType) :\n t;\n let ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn, meta.target === R3FactoryTarget.Pipe));\n ctorDepsType = createCtorDepsType(meta.deps);\n }\n }\n else {\n const baseFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n const baseFactoryStmt = baseFactory\n .set(getInheritedFactory.callFn([meta.internalType], /* sourceSpan */ undefined, /* pure */ true))\n .toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n const ctorExprFinal = ctorExpr;\n const body = [];\n let retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n const r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n let ctorStmt = null;\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n }\n else {\n ctorStmt = importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt();\n }\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn, meta.target === R3FactoryTarget.Pipe);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n }\n else {\n body.push(importExpr(Identifiers$1.invalidFactory).callFn([]).toStmt());\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`),\n statements,\n type: expressionType(importExpr(Identifiers$1.FactoryDef, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]))\n };\n}", "function factory (name,age,hoby,gender){\n\treturn {\n\t\tname:name,\n\t\tage:age,\n\t\thoby:hoby,\n\t\tgender:gender\n\t};\n}", "function newCar(make, model, color, type, tires, mode, gasoline) {\n this.make = make;\n this.model = model;\n this.color = color;\n this.type = type;\n this.tires = tires;\n this.mode = mode;\n this.gasoline = gasoline;\n }", "function compileFactoryFunction(meta, isPipe = false) {\n const t = variable('t');\n const statements = [];\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n let ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr =\n new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn, isPipe));\n }\n }\n else {\n const baseFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n const baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(baseFactoryStmt);\n // There is no constructor, use the base class' factory to construct typeForCtor.\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n const ctorExprFinal = ctorExpr;\n const body = [];\n let retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n const r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n let ctorStmt = null;\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n }\n else {\n ctorStmt = makeErrorStmt(meta.name);\n }\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n const delegateFactory = variable(`ɵ${meta.name}_BaseFactory`);\n const getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(`Illegal state: compiling factory that delegates to itself`);\n }\n const delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [\n StmtModifier.Exported, StmtModifier.Final\n ]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n }\n else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn, isPipe);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ?\n InstantiateExpr :\n InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n }\n else {\n body.push(makeErrorStmt(meta.name));\n }\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`),\n statements,\n };\n}", "function FoodFactory(board, height, width, color) {\n this.board = board;\n this.height = height;\n this.width = width;\n this.color = color;\n}", "function drawFactories() {\r\n let factorySVG = svg.selectAll('.factory').data(factories);\r\n let offset = kiviatSize * 0.125;\r\n factorySVG.exit().remove(); //remove excess\r\n\r\n //create new as necessary\r\n let newFactories = factorySVG.enter();\r\n newFactories.each(function (d, i) {\r\n let curFactory = d3.select(this);\r\n if (d.shape === 'square') {\r\n curFactory = curFactory.append('rect')\r\n .attr('width', offset).attr('height', offset)\r\n .attr('x', function (d) { return scales.xPixelToSVG(d.location[0]) - offset / 2; })\r\n .attr('y', function (d) { return scales.yPixelToSVG(d.location[1]) - offset / 2; })\r\n } else if (d.shape === 'circle') {\r\n curFactory = curFactory.append('circle')\r\n .attr('r', offset / 2).attr('cx', function (d) { return scales.xPixelToSVG(d.location[0]) - offset / 2; })\r\n .attr('cy', function (d) { return scales.yPixelToSVG(d.location[1]) - offset / 2; })\r\n } else { //shape is text character\r\n curFactory = curFactory.append('text').text(d.shape).attr('font-size', offset * 3)\r\n .attr('x', function (d) { return scales.xPixelToSVG(d.location[0]) - offset / 2; })\r\n .attr('y', function (d) { return scales.yPixelToSVG(d.location[1]); })\r\n }\r\n\r\n curFactory.classed('factory', true);\r\n });\r\n }", "function compileFactoryFunction(meta) {\n var isPipe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var t = variable('t');\n var statements = []; // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n\n var typeForCtor = !isDelegatedMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type) : t;\n var ctorExpr = null;\n\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.injectFn, isPipe));\n }\n } else {\n var baseFactory = variable(\"\\u0275\".concat(meta.name, \"_BaseFactory\"));\n var getInheritedFactory = importExpr(Identifiers$1.getInheritedFactory);\n var baseFactoryStmt = baseFactory.set(getInheritedFactory.callFn([meta.type])).toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(baseFactoryStmt); // There is no constructor, use the base class' factory to construct typeForCtor.\n\n ctorExpr = baseFactory.callFn([typeForCtor]);\n }\n\n var ctorExprFinal = ctorExpr;\n var body = [];\n var retExpr = null;\n\n function makeConditionalFactory(nonCtorExpr) {\n var r = variable('r');\n body.push(r.set(NULL_EXPR).toDeclStmt());\n var ctorStmt = null;\n\n if (ctorExprFinal !== null) {\n ctorStmt = r.set(ctorExprFinal).toStmt();\n } else {\n ctorStmt = makeErrorStmt(meta.name);\n }\n\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n\n if (isDelegatedMetadata(meta) && meta.delegateType === R3FactoryDelegateType.Factory) {\n var delegateFactory = variable(\"\\u0275\".concat(meta.name, \"_BaseFactory\"));\n var getFactoryOf = importExpr(Identifiers$1.getFactoryOf);\n\n if (meta.delegate.isEquivalent(meta.type)) {\n throw new Error(\"Illegal state: compiling factory that delegates to itself\");\n }\n\n var delegateFactoryStmt = delegateFactory.set(getFactoryOf.callFn([meta.delegate])).toDeclStmt(INFERRED_TYPE, [StmtModifier.Exported, StmtModifier.Final]);\n statements.push(delegateFactoryStmt);\n retExpr = makeConditionalFactory(delegateFactory.callFn([]));\n } else if (isDelegatedMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n var delegateArgs = injectDependencies(meta.delegateDeps, meta.injectFn, isPipe); // Either call `new delegate(...)` or `delegate(...)` depending on meta.useNewForDelegate.\n\n var factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ? InstantiateExpr : InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n } else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n } else {\n retExpr = ctorExpr;\n }\n\n if (retExpr !== null) {\n body.push(new ReturnStatement(retExpr));\n } else {\n body.push(makeErrorStmt(meta.name));\n }\n\n return {\n factory: fn([new FnParam('t', DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, \"\".concat(meta.name, \"_Factory\")),\n statements: statements\n };\n }", "function buildEvtsForSpecificSimFactory(params) {\n var createNewInstance = params.createNewInstance;\n return function buildForSpecificSim(userSimEvts, userSim, keys) {\n var out = (function () {\n var out = createNewInstance();\n if (keys === undefined) {\n return out;\n }\n objectKeys_1.objectKeys(out)\n .filter(function (eventName) { return id_1.id(keys).indexOf(eventName) < 0; })\n .forEach(function (eventName) { return delete out[eventName]; });\n return out;\n })();\n objectKeys_1.objectKeys(out).forEach(function (eventName) {\n var evt = evt_1.Evt.factorize(out[eventName]);\n evt_1.Evt.factorize(userSimEvts[eventName]).attach(function (data) {\n if (UserSim.match(data)) {\n if (data !== userSim) {\n return;\n }\n assert_1.assert(typeGuard_1.typeGuard(evt));\n evt.post();\n return;\n }\n else {\n var _a = id_1.id(data), userSim_ = _a.userSim, rest = __rest(_a, [\"userSim\"]);\n assert_1.assert(UserSim.match(userSim_));\n if (userSim_ !== userSim) {\n return;\n }\n evt.post(rest);\n }\n });\n });\n return out;\n };\n}", "function foodFactory() {\n\n\t\t//generate food randomly with 1/10 chance\n\t\tif (Math.floor((Math.random() * 25) + 1) === 3) {\n\n\t\t\t//randomly position it on the field\n\t\t\tvar randomX = Math.floor((Math.random() * size) );\n\t\t\tvar randomY = Math.floor((Math.random() * size) );\n\n\t\t\t//if selected field is empty create food here\n\t\t\tif (game[randomY][randomX] === 0) {\n\t\t\t\tgame[randomY][randomX] = 2;\n\t\t\t}\n\t\t}\n\t}", "function shapeFactory(){\r\n}", "function robotFactory(model, mobile){\n return {\n model: model,\n mobile: mobile,\n beep() {\n console.log('Beep Boop');\n }\n }\n}", "static create (name,type){\n return new Vehicle2(name,type)\n }", "function createList(factoryName, count) {\n if (count === void 0) { count = 10; }\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var _a = processArgs(args), traits = _a.traits, context = _a.context;\n var arrayWithIndexes = Array(count)\n .fill(0)\n .map(function (_, index) { return index; });\n return arrayWithIndexes.map(function (index) {\n return renderFactory(registry, factoryName, traits, \n // @ts-expect-error: how to fix this?\n // Error:\n // This expression is not callable.\n // Not all constituents of type 'Context' are callable.\n // Type 'FactorySchema' has no call signatures.ts(2349)\n isFunction(context) ? context(index) : context);\n });\n}", "function make() {\n\n // Return Model (singleton) if not a function\n if (!isFunction(Model)) {\n // throw new Error('Factory registered must be a function.');\n return Model;\n } else {\n var args = Array.prototype.slice.call(arguments);\n var obj = createObject(Model.prototype);\n Model.apply(obj, args);\n return obj;\n }\n }", "function MemberFactory (){\n this.createMember = function(name, type){\n let member;\n\n // create object with type\n if (type === 'simple'){\n member = new SimpleMembership(name);\n } else if(type === 'standard'){\n member = new StandardMembership(name);\n } else if( type === 'super'){\n member = new SuperMembership(name);\n }\n\n // add a type in member object\n member.type = type;\n\n member.define = function(){\n console.log(`${this.name} (${this.type}) : ${this.cost}`);\n }\n\n return member;\n }\n}", "function generateShape(type, func){\n //here happens part of the magic!\n //do as many computations, API calls and database calls as you wish\n var theType = \"i am generating the following shape type: \" + type\n var randNumber = func()\n \n //function as an expression\n var shapeGenerator \n\n if (randNumber > .5) {\n //here depending on the 50% of possibilities, we decide the f's implementation\n shapeGenerator = function () {\n console.log(\"Implementation type I\")\n console.log(theType)\n console.log(randNumber)\n }\n } else {\n shapeGenerator = function () {\n console.log(\"Implementation type II\")\n console.log(randNumber)\n console.log(theType)\n }\n }\n return shapeGenerator\n}", "function saveNew(res, req, type){\n var newFactory = {\n name: req.body.name,\n email: req.body.email,\n phone_number: req.body.phone_number,\n city: req.body.city,\n state: req.body.state,\n company_type: type\n };\n factoryStore.add(newFactory, function(err) {\n if (err) throw err;\n\n res.json(newFactory);\n });\n}", "function CarMaker(){}", "function CarMaker() {}", "createTypes(){\n }", "function factory(name){\n return {\n name:name\n };\n}", "function CreateVehicle(make, model, year){\n return {make,model, year,\n getFullDescription() {\n return `${this.year} ${this.make} ${this.year}`\n }\n }\n}", "function generate (type ,num) {\n let result = [];\n let faculty = \"\";\n let amount = 0;\n for (let index = 0; index < num; index++) {\n\n faculty = faculties[Math.round(Math.random() * (faculties.length - 1))];\n amount = Math.round(Math.random() * (capacityLimits[1] - capacityLimits[0]) + capacityLimits[0]);\n\n result.push(\n newObj(type + index, faculty, amount)\n );\n }\n\n return result;\n}", "function vehicleConstructor(name, wheels, numberPassengers){\n\n\tvar vehicle = {};\n\n\tvehicle.name = name || \"unicycle\";\n\tvehicle.wheels = wheels || 1;\n\tvehicle.numberPassengers = numberPassengers || 1;\n\n\n\tvehicle.introduce = function(){\n\t\tconsole.log(\"Hi I am a \" + vehicle.name + \". I have \" + vehicle.wheels + \" wheels\" + \", and I can carry \" + vehicle.numberPassengers + \" people\");\n\t}\n\n\n\tvehicle.makeNoise = function(noise){\n\t\tvar noise = noise || \"pip pip\"; \n\t\tconsole.log(noise);\n\t}\n\n\treturn vehicle;\n\n}", "function createPlanet() {\n //This randomizes a single planet. Maybe one could give parameters\n //to instruct what kind of planet it will be. parameters could be\n //in key=>value array.\n }", "function createDetectors(numberOfDetectors) {\n const dtrs = [];\n for (let i = 0; i < numberOfDetectors; i++) {\n dtrs.push({\n function: 'mean',\n field_name: `foo${i}`,\n partition_field_name: 'instance'\n });\n }\n return dtrs;\n }", "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= 7}, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 70) { ///Loops speed increment until it reaches 70\n this.accelerate();\n };\n },\n emergencyBrake: function() {\n while(speed <= 70 && speed > 0) { /////loops decrement until it reaches 0\n this.brake();\n };\n }\n }\n}", "createFactoryByContent(factoryContent) {\n if (!factoryContent) {\n return;\n }\n this.isImporting = true;\n\n let promise = this.codenvyAPI.getFactory().createFactoryByContent(factoryContent);\n\n promise.then((factory) => {\n this.isImporting = false;\n this.codenvyNotification.showInfo('Factory successfully created.');\n this.$location.path('/factory/' + factory.id);\n }, (error) => {\n this.isImporting = false;\n this.codenvyNotification.showError(error.data.message ? error.data.message : 'Create factory failed.');\n console.log('error', error);\n });\n }", "function robotFactory(model, mobile) {\n return {\n model,\n mobile,\n beep() {\n console.log(\"Hello human\");\n },\n };\n}", "function create(factoryName) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var _a = processArgs(args), traits = _a.traits, context = _a.context;\n if (!registry[factoryName]) {\n throw new Error(\"Factory \" + factoryName + \" does not exists.\");\n }\n return renderFactory(registry, factoryName, traits, context);\n}", "function createHotels() {\n\tvar chain = [];\n\t//create objects for the hotels\n\tvar theGrandHotel = new Hotel(\"The Grand Hotel\", 221, 398);\n\tvar theSeaViewHotel = new Hotel(\"The Seaview Hotel\", 222, 189);\n\tvar theQuaySideHotel = new Hotel(\"The Quayside Hotel\", 84, 36);\n\t//Use console.table to view and check the the object contents \n\t//return an array containing the three hotels in the chain\n\tchain.push(theGrandHotel);\n\tchain.push(theSeaViewHotel);\n\tchain.push(theQuaySideHotel);\n\t//console.log(theGrandHotel);\n\t//console.log(chain[0]);\n\t//console.log(chain[1]);\n\t//console.log(chain[2]);\n\t//console.table(chain);\n\treturn chain;\n}", "function robotFactory(model, mobile){\n return {\n model,\n mobile,\n beep() {\n console.log('Beep Boop');\n }\n }\n}", "function robotFactory(model, mobile){\n return {\n model,\n mobile,\n beep() {\n console.log('Beep Boop');\n }\n }\n}", "function robotFactory(model, mobile) {\n return {\n model,\n mobile,\n beep() {\n console.log(\"Beep Boop\");\n }\n };\n}", "function criarObjetoFis(_objeto) {\n var objeto = _objeto;\n switch (objeto) {\n case \"Esfera\":\n {\n try {\n if (document.getElementById(\"MassaEsfera\").value === \"\" || document.getElementById(\"MassaEsfera\").value <= 0) {\n alert(\"O valor da da massa não pode ser vazio nem menor que zero!\");\n } else {\n objetoAtual = new ObjetoFisica(document.getElementById(\"NomeEsfera\").value,\n parseInt(document.getElementById(\"Raio\").value),\n \"Esfera\",\n document.getElementById(\"MaterialEsfera\").value,\n indice,\n getVector3(\"posEsfera\"),\n getVector3(\"vEsfera\"),\n document.getElementById(\"MassaEsfera\").value,\n document.getElementById(\"amortce_Linear_Esfera\").value,\n document.getElementById(\"amortce_Angular_Esfera\").value,\n getVector3(\"rotEsfera\"),\n getVector3(\"acEsfera\"),\n getQuaternion(\"oEsfera\"),\n colisao('esfera'),\n true);\n objetoAtual.CriaEsfera();//Colocar como parametro a cena.\n listaObjetosFis.push(objetoAtual);\n console.log(objetoAtual.getOrientacao());\n //console.log(objetoAtual.teste());\n document.getElementById(\"listaObjetos\").appendChild(objetoAtual.getDiv());\n document.getElementById(\"listaDeObjetos_Efera\").appendChild(objetoAtual.addLista('esfera'));\n document.getElementById(\"listaDeObjetos_Cubo\").appendChild(objetoAtual.addLista('cubo'));\n document.getElementById(\"listaDeObjetos_Alvo\").appendChild(objetoAtual.addLista('alvo'));\n indice++;\n }\n } catch (e) {\n alert(e);\n }\n break;\n }\n case \"Cubo\":\n {\n try {\n if (document.getElementById(\"MassaCubo\").value === \"\" || document.getElementById(\"MassaCubo\").value <= 0) {\n alert(\"O valor da da massa não pode ser vazio nem menor que zero!\");\n } else {\n objetoAtual = new ObjetoFisica(document.getElementById(\"NomeCubo\").value,\n parseInt(document.getElementById(\"TamanhoCubo\").value),\n \"Cubo\",\n document.getElementById(\"MaterialCubo\").value,\n indice,\n getVector3(\"posCubo\"),\n getVector3(\"vCubo\"),\n document.getElementById(\"MassaCubo\").value,\n document.getElementById(\"amortce_Linear_Cubo\").value,\n document.getElementById(\"amortce_Angular_Cubo\").value,\n getVector3(\"rotCubo\"),\n getVector3(\"acCubo\"),\n getQuaternion(\"oCubo\"),\n colisao('cubo'),\n true);\n objetoAtual.CriaCubo();\n listaObjetosFis.push(objetoAtual);\n //alert(objetoAtual.teste());\n document.getElementById(\"listaObjetos\").appendChild(objetoAtual.getDiv());\n document.getElementById(\"listaDeObjetos_Efera\").appendChild(objetoAtual.addLista('esfera'));\n document.getElementById(\"listaDeObjetos_Cubo\").appendChild(objetoAtual.addLista('cubo'));\n document.getElementById(\"listaDeObjetos_Alvo\").appendChild(objetoAtual.addLista('alvo'));\n indice++;\n }\n } catch (e) {\n alert(e);\n }\n break;\n }\n case \"Alvo\":\n {\n try {\n objetoAtual = new ObjetoFisica(document.getElementById(\"NomeAlvo\").value,\n parseInt(document.getElementById(\"TamanhoAlvo\").value),\n \"Alvo\",\n null,\n indice,\n getVector3(\"posAlvo\"),\n getVector3(\"vAlvo\"),\n document.getElementById(\"MassaAlvo\").value,\n document.getElementById(\"amortce_Linear_Alvo\").value,\n document.getElementById(\"amortce_Angular_Alvo\").value,\n getVector3(\"rotAlvo\"),\n getVector3(\"acAlvo\"),\n getQuaternion(\"oAlvo\"),\n colisao('alvo'),\n false);\n objetoAtual.CriaAlvo();\n listaObjetosFis.push(objetoAtual);\n //alert(objetoAtual.teste());\n document.getElementById(\"listaObjetos\").appendChild(objetoAtual.getDiv());\n document.getElementById(\"listaDeObjetos_Efera\").appendChild(objetoAtual.addLista('esfera'));\n document.getElementById(\"listaDeObjetos_Cubo\").appendChild(objetoAtual.addLista('cubo'));\n document.getElementById(\"listaDeObjetos_Alvo\").appendChild(objetoAtual.addLista('alvo'));\n indice++;\n } catch (e) {\n alert(e);\n }\n break;\n }\n }\n}", "function MemberFactory() {\n this.createMember = function (name, type) {\n let member;\n //checking the type that are passd. let we have three types of memberships, a simple membership, a standard membership and a super membership\n // it may be a web hosting application\n\n if (type === 'simple') {\n member = new SimpleMembership(name);\n\n } else if (type === 'standard') {\n member = new StandardMembership(name);\n } else if (type === 'super') {\n member = new SuperMembership(name);\n }\n member.type = type\n\n member.define = function () {\n console.log(`${this.name} ${this.type} : ${this.cost} `)\n }\n return member;\n }\n // now we have to create our constructors for our membership types(subclasses)\n\n}", "function buildModel(cars, capacity, chargeRate, iterations){\n var count;\n var carCount;\n carCount = 0;\n var timeCount;\n var carsList = [];\n var carsTimeList = [];\n //populates the carsTimeList with a 0 for each time period\n for (timeCount = 0; timeCount < numberOfPeriods; timeCount++){\n carsTimeList.push(0);\n }\n //increments values in the array. E.g. a value of 3 at index 25 means 3 cars will spawn during time period 25.\n for(carCount = 0; carCount < cars; carCount++){\n period = createStartTime();\n carsTimeList[period]++;\n }\n //Creates a set of cars with electricity needs and maximum waiting time, based on charge rate and the time at which they arrive.\n for(carCount = 0; carCount < carsTimeList.length; carCount++){\n for (temp = 0; temp < carsTimeList[carCount]; temp++){\n var car = createCar(chargeRate, carCount);\n carsList.push(car);\n }\n }\n\n //for each algorithm, runs a number of simulations based on the number of iterations required.\n var algorithmType;\n for(algorithmType = 0; algorithmType < 3; algorithmType++){\n tempResultsLine = [];\n tempResultsPie = [];\n for (count = 0; count < iterations; count++){\n var carsListClone = JSON.parse(JSON.stringify(carsList)); //Performs a deep clone of the cars list so each simulation gets an independent list.\n runModel(carsTimeList, capacity, chargeRate, carsListClone, algorithmType);\n }\n averageResults(algorithmType);\n }\n\n}", "function mainFactory() {\n\t return {\n\t \"say\": function () {\n\t console.log(\"Main Hello World!!!\");\n\t }\n\t };\n\t}", "function VMFactory() {}", "function createComponentFactory(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors){return new ComponentFactory_(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors);}", "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= Math.floor(Math.random()* (speed/2)) + 1; }, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n this.brake(); ///we are directly using the brake function\n // };\n\n }\n }\n}", "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= 7}, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n while(speed <= 85 && speed > 1) { /////Loops (decreased)speed until speed reaches 1\n this.brake();\n };\n if (speed = 1 ){\n speed-- //////once speed is 1 this decreases speed by 1\n };\n }\n }\n}", "createModule(factory) {\n try {\n if (!factory) {\n new Message(faust.getErrorMessage());\n Utilitary.hideFullPageLoading();\n return;\n }\n var module = new ModuleClass(Utilitary.idX++, this.tempModuleX, this.tempModuleY, this.tempModuleName, document.getElementById(\"modules\"), (module) => { this.removeModule(module); }, this.compileFaust);\n module.moduleFaust.setSource(this.tempModuleSourceCode);\n module.createDSP(factory, () => {\n module.patchID = this.tempPatchId;\n if (this.tempParams) {\n for (var i = 0; i < this.tempParams.sliders.length; i++) {\n var slider = this.tempParams.sliders[i];\n module.addInterfaceParam(slider.path, parseFloat(slider.value));\n }\n }\n module.moduleFaust.recallInputsSource = this.arrayRecalScene[0].inputs.source;\n module.moduleFaust.recallOutputsDestination = this.arrayRecalScene[0].outputs.destination;\n this.arrayRecalledModule.push(module);\n module.recallInterfaceParams();\n module.setFaustInterfaceControles();\n module.createFaustInterface();\n module.addInputOutputNodes();\n if (factory.isMidi) {\n module.isMidi = true;\n module.addMidiControlNode();\n }\n this.addModule(module);\n //next module\n this.arrayRecalScene.shift();\n this.launchModuleCreation();\n });\n }\n catch (e) {\n console.log(e);\n new Message(Utilitary.messageRessource.errorCreateModuleRecall);\n //next module\n this.arrayRecalScene.shift();\n this.launchModuleCreation();\n }\n }", "function DUPairFactory() {\n}", "crearNave(ejercito, cantidad, tipo) {\n for (let index = 1; index <= cantidad; index++) {\n let empiezanave;\n switch (tipo) {\n case \"Nave1\":\n empiezanave = new Nave1();\n break;\n case \"Nave2\":\n empiezanave = new Nave2();\n break;\n case \"Nave3\":\n empiezanave = new Nave3();\n break;\n\n default:\n break;\n }\n\n ejercito.anadirNave(empiezanave);\n }\n }", "function functionFactory()\n{\n var arr=[];\n for(var i=0;i<5;i++)\n {\n arr.push(function (){\n console.log('function no '+i)\n });\n }\n\n return arr;\n}", "static get creators() {\n return {\n /**\n * @param {String} deviceMode\n */\n deviceChanged: (deviceMode) => ({\n type: this.types.DEVICE_CHANGED,\n payload: { deviceMode }\n }),\n\n /**\n * @param {String} searchMode\n */\n searchChanged: (searchMode) => ({\n type: this.types.SEARCH_CHANGED,\n payload: { searchMode }\n }),\n };\n }", "function makeComputer(type, color, weight, RAM , Storage) {\n // TODO: Your code here\n return{\n type: type,\n color: color,\n weight: weight,\n RAM: RAM,\n Storage: Storage \n\n }\n}", "function camSetFactories(factories)\n{\n\tfor (var flabel in factories)\n\t{\n\t\tcamSetFactoryData(flabel, factories[flabel]);\n\t}\n}", "static createInstances(objects) {\n if(objects.length < 1) \n return console.warn(\"The array you provided is empty.\");\n if(!objects.every(object => object instanceof Object)) \n return console.warn(\"All the elements in the array must be objects.\")\n let newObjects = []\n for (let object of objects) {\n newObjects.push(new Movie(object));\n }\n return newObjects;\n }", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}", "function GoalFactory() {\n\n}", "function FaseFactory(canvas){\n\t//Criando singleton\n\tif (arguments.callee._singletonInstance) {\n\t\treturn arguments.callee._singletonInstance;\n\t}\n\targuments.callee._singletonInstance = this;\n\n\t//Guarda as classes de sprite\n\tthis.fases = {};\n\n\t//Funcao que copia um objeto (deep copy)\n\tthis.copiaProfunda = function(obj){\t\n\t return jQuery.extend(true, {}, obj);\n\t};\n\n\t//============================================================\n\t//============================================================\n\n\t//Funcoes de factory\n\tthis.newFase = function(tipo){\n\t\tswitch(tipo){\n\t\t\tcase \"Animacao\":\n\t\t\t\treturn this.copiaProfunda(this.fases.Animacao);break;\n\t\t\tcase \"Menu\":\n\t\t\t\treturn this.copiaProfunda(this.fases.Menu);break;\n\t\t\tcase \"Fase1\":\n\t\t\t\treturn this.copiaProfunda(this.fases.Fase1);break;\n\t\t\t\t//return new Fase1(canvas);break;\n\t\t\tcase \"Fase2\":\n\t\t\t\treturn this.copiaProfunda(this.fases.Fase2);break;\n\t\t}\n\t};\n\n\t//Carregar todas as classes finais de sprite\n\tthis.fases.Animacao = new Animacao(canvas);\n\tthis.fases.Menu = new Menu(canvas);\n\tthis.fases.Fase1 = new Fase1(canvas);\n\tthis.fases.Fase2 = new Fase2(canvas);\n}", "function createCircle(radius) {\n return {\n radius,\n draw: function() {\n console.log('drawing from Factory Circle');\n }\n }; \n}", "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= Math.floor(Math.random()* (speed/2)) + 1; }, // This will call random number to be decrease per brake\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n var counter = 0\n while(speed <= 85 && speed > 0) { /////Loops (decreased)speed until speed reaches 0\n this.brake(); // this will call brake fucntion\n counter ++ // increase 1 per cycle of loop\n console.log(counter) // print the number of counter value\n };\n }\n}\n}", "function multiResolve(factories, result) {\n for (var i = 0; i < factories.length; i++) {\n var factory = factories[i];\n result.push(factory());\n }\n\n return result;\n }", "function makeCar(features) {\n let car = new Car();\n\n const featureList = {\n powerwindows: false,\n powerLocks: false,\n ac: false\n }\n\n // If they specified some features then add them\n if (features && features.length) { \n // iterate over all the features and add them\n\n for (i = 0; i < features.length; i++) {\n // mark the feature in the featureList as a feature\n // that will be included. This way we only get one of\n // each feature.\n featureList[features[i]] = true; \n }\n\n // Now we add the features on in a specific order\n if (featureList.powerwindows) {\n car = new PowerWindowsDecorator(car);\n }\n if (featureList.powerlocks) {\n car = new PowerLocksDecorator(car);\n }\n if (featureList.ac) {\n car = new ACDecorator(car);\n }\n\n }\n return car;\n}", "function VehicleConstructor(name, num_of_wheels, num_of_passengers){\n\t/* object that will be returned */\n\tvar vehicle = {};\n\n\t/* private properties of vehicle object */\n\tvehicle.name = name;\n\tvehicle.num_of_wheels = num_of_wheels;\n\tvehicle.num_of_passengers =num_of_passengers;\n\n\t/* private methods*/\n\tvehicle.makeNoise = function(){\n\t\tconsole.log(\"Vroom vroom!\"); // default makeNoise\n\t}\n\n\treturn vehicle;\n}", "function Shape(get_type){\n\tthis.get_type = function(){\n\t\treturn this.constructor;\n\t\tconsole.log(this.constructor);\n\t\t// return get_type;\n\t\t// console.log(get_type);\n\t}\n\treturn get_type;\n\tconsole.log(\"get\");\n\tconsole.log(get_type);\n\t}", "static createInstance(issuer, carNumber, carModel, issueDateTime, maturityDateTime, faceValue,carType) {\n return new Car({ issuer, carNumber, carModel, issueDateTime, maturityDateTime, faceValue,carType });\n }", "function AppFactory()\n {\n person1 = \n {\n name : 'Sebastian',\n job : 'Software'\n }\n return person1;\n // } console.log(AppFactory().person1.name);\n }", "function mf_constructors(){\n\t\tfunction plain(mf_string){\t\t\t //mf definition using point specification\t\n\t\t\tvar mf_object=new Object();\n\t\t\tmf_object.temporary=mf_string.split(',');\n\t\t\tif(mf_object.temporary.length<2)logerror({type:6,termname:termname});\t\t\t\t\t\n\t\t\tvar number_of_defined_points=set.mf_string.split(',').length;\t\t\t\t\t\t\n\t\t\tfor(var j=0;j<number_of_defined_points;j++){\t\t\t\t\t\t\n\t\t\t\tif(mf_object.temporary[j].split('/').length>2)logerror({type:6,termname:termname});\n\t\t\t\t\tvar x;\n\t\t\t\t\tif(!isNaN(parseFloat(mf_object.temporary[j].split('/')[1]))){\n\t\t\t\t\t\tx=mf_object.temporary[j].split('/')[1];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tx=logerror({type:6,termname:termname});\n\t\t\t\t\t}\t\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\tmf_object.temporary=null; //garbage clearance\t\t\t\n\t\t}", "function getFactory() {\n\t\t\t\tvar f, factory;\n\n\t\t\t\tfor (f in factories) {\n\t\t\t\t\tif (spec.hasOwnProperty(f)) {\n\t\t\t\t\t\tfactory = factories[f];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Intentionally returns undefined if no factory found\n\t\t\t\treturn factory;\n\t\t\t}", "function getFactory() {\n\t\t\t\tvar f, factory;\n\n\t\t\t\tfor (f in factories) {\n\t\t\t\t\tif (spec.hasOwnProperty(f)) {\n\t\t\t\t\t\tfactory = factories[f];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Intentionally returns undefined if no factory found\n\t\t\t\treturn factory;\n\t\t\t}", "function obtieneTipoFacturacion() {\n\t\tgenerarArrayDiasSemana();\n\t\tgenerarArrayMeses();\n\t\tset('frmGenerarCronograma.accion', 'obtieneTiposFacturacion');\n\t\tset('frmGenerarCronograma.conectorAction', 'LPMantieneCronograma');\n\t\tset('frmGenerarCronograma.hMarca', get('frmGenerarCronograma.cbMarcas'));\n\t\tset('frmGenerarCronograma.hCanal', get('frmGenerarCronograma.cbCanales'));\n\t\tset('frmGenerarCronograma.hCodPeriodo', get('frmGenerarCronograma.txtCodPeriod'));\n\t\tset('frmGenerarCronograma.hlblActiFija',GestionarMensaje('1002'));\n\t\tset('frmGenerarCronograma.hlblActiRefe',GestionarMensaje('1003'));\n\t\t//if (get('frmGenerarCronograma.casoDeUso') != 'Fase 2')\n\t\t\teval(\"frmGenerarCronograma.oculto = 'N'\");\n\t\tenviaSICC('frmGenerarCronograma');\n\t}", "function create(o) {\n console.log(\"Creating object:=\", o);\n}", "function MemberFactory() {\n this.createMember = function (name, type) {\n let member;\n\n // Checks membership choice\n if (type === \"simple\") {\n member = new SimpleMembership(name);\n } else if (type === \"standard\") {\n member = new StandardMembership(name);\n } else if (type === \"super\") {\n member = new SuperMembership(name);\n }\n\n // assigns membership to new member\n member.type = type;\n\n member.define = function () {\n console.log(`${this.name} (${this.type}): ${this.cost}`);\n };\n\n return member;\n };\n}", "function newGame(){\n\tvar create1 = new genQuestion(question1);\n\tvar create2 = new genQuestion(question2);\n\tvar create3 = new genQuestion(question3);\n\tvar create4 = new genQuestion(question4);\n\tvar create5 = new genQuestion(question5);\n}", "function create() {\n\n}" ]
[ "0.6904147", "0.6904147", "0.6904147", "0.68390626", "0.67700315", "0.6756162", "0.67426604", "0.67426604", "0.65748215", "0.6492375", "0.6492375", "0.613752", "0.6054911", "0.5903043", "0.5883048", "0.5813172", "0.5813172", "0.57693833", "0.57693833", "0.57452667", "0.57320803", "0.57260776", "0.5683922", "0.5663505", "0.5656244", "0.56427556", "0.56427556", "0.562459", "0.55953115", "0.5585631", "0.5583888", "0.55581546", "0.5554312", "0.5527792", "0.5505757", "0.54811347", "0.5440642", "0.5426507", "0.5419884", "0.54009473", "0.53993773", "0.5397913", "0.53817195", "0.5371358", "0.53706074", "0.5355163", "0.5321494", "0.531399", "0.52941144", "0.5286088", "0.5282077", "0.5259532", "0.5253233", "0.5248936", "0.5247532", "0.5241783", "0.5238881", "0.5218243", "0.5218243", "0.52105814", "0.5210032", "0.51989657", "0.51869774", "0.5179283", "0.5154325", "0.5146786", "0.5144137", "0.5139318", "0.51321757", "0.5124607", "0.5123028", "0.51070505", "0.5106183", "0.50876623", "0.5083464", "0.50827366", "0.5078045", "0.5078045", "0.5078045", "0.5078045", "0.5078045", "0.5078045", "0.5069021", "0.50662833", "0.50650334", "0.5061037", "0.5057825", "0.50557077", "0.5052736", "0.5051499", "0.50498104", "0.5035316", "0.502996", "0.50255084", "0.50255084", "0.50132716", "0.5009335", "0.50060624", "0.49977902", "0.4988578" ]
0.7566754
0
on click, show example
function showExample(img, btn) { 'use strict'; console.log("clicked " + btn + " to show " + img); var a, gif_class, btns_class; a = 0; gif_class = document.getElementsByClassName(img); btns_class = document.getElementsByTagName('button'); //identify which button was pressed for (a; a < btns_class.length; a++) { //---SHARE BUTTON--- if (btn === "share-btn") { console.log("share btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } //set attribute with prototype file gif_class[1].setAttribute("src", "share-gif02.gif"); //make visible document.getElementsByClassName(img)[1].style.visibility = "visible"; return; //---HOME BUTTON--- } else if (btn === "home-btn") { console.log("home btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED BUTTON--- } else if (btn === "feed-btn") { console.log("feed btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---UPLOAD BUTTON--- } else if (btn === "upload-btn") { console.log("upload btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---EVENTS BUTTON--- } else if (btn === "events-btn") { console.log("events btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---SETTINGS BUTTON--- } else if (btn === "settings-btn") { console.log("settings btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---CONTACTS BUTTON--- } else if (btn === "contacts-btn") { console.log("contacts btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---MESSAGING BUTTON--- } else if (btn === "messaging-btn") { console.log("messaging btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED:UPLOAD TRANSITION--- } else if (btn === "feed-upload") { console.log("feed:upload btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---FEED:SETTINGS TRANSITION--- } else if (btn === "feed-settings") { console.log("feed:settings btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; //---CONTACTS:MESSAGING--- } else if (btn === "contacts-msg") { console.log("contacts:messaging btn clicked"); //make active activeClass(btn, btns_class); //check for visible imgs if (visibleCheck('storyboard')) { //hide if visible if (document.getElementsByTagName("img").length > 0) { document.getElementsByClassName(img)[1].style.visibility = "hidden"; } } alert("prototype has not been created yet"); return; } console.log("showExample() complete"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n\n }", "show() {}", "async show() {\n \n }", "function showX() {\n\t\t$(\".ex\").show();\n\t}", "function onShowDemo() {\n resetPageState();\n var demoCon = document.querySelector('.demo_con');\n demoCon.innerHTML = generateClickimageSource();\n\n var img = demoCon.querySelector('img');\n img.src = document.querySelector('.image_wrap .image_con img').src;\n\n // from clickimage.js\n try {\n clickimagePins(img); //eslint-disable-line\n } catch(e) {\n // ignore\n }\n\n document.querySelector('.page').classList.add('demo');\n }", "async onShow() {\n\t}", "function show() {\n $( \"#target\" ).show(1000);}", "onShow() {}", "onShow() {}", "onShow() {}", "onShow() {}", "onShow(e) {\n // this.showShort('onShow')\n }", "function showQ() {\n\t$question.show();\n}", "function show_on_click(){\t\n\t\t$('.version').bind('click', function(){\n\t\t\t\t$('.version').not(this).closest('div').find('.version-changes').slideUp();\n\t\t\t\t$(this).closest('div').find('.version-changes').slideToggle();\n\t\t});\n}", "function showMe() {\n\tdocument.getElementById(\"clicker\").innerHTML = \"OMG Why?!\";\n\n}", "function showcase(section) {\n var sectionShowcase = section.target.innerHTML;\n outputEl.innerHTML = 'You clicked on the ' + sectionShowcase + ' section!'\n}", "onLoad(evt) {\n show(evt, option);\n }", "function showSpeck() {\n showContent();\n\n $image.show();\n $image.attr('src', 'img/speck.jpg');\n\n $quoteText.text('This is a speck');\n $quoteAuthor.text('Somebody of the public');\n }", "function show(event){\n display.innerHTML += event.target.id;\n}", "function showData()\n {\n console.log('hello world');\n }", "function startFunction() {\n displayTest.show();\n next.show();\n $(\"#instructions\").show();\n $(\"#beginTest\").hide();\n }", "function listenDemo() {\n $('.open-demo').on('click', event => {\n $('.demo-container').removeClass('hidden');\n $('.open-demo').addClass('hidden');\n closeDemo();\n });\n}", "function viewSomething() {\n\t if ( action == 1 ) {\n\t \t// Call the make it rain function\n\t\t\tmakeItRain();\n\t \taction = 2;\n\t } else {\n\t //Hide all the rain drops\n\t $('.drop').hide();\n\t action = 1;\n\t }\n\t}", "function show(id){\n $(id).show();\n }", "function show(id){\n $(id).show();\n }", "show() { return this.tellModule(\"show\") }", "function display(){\r\n\r\n \r\n}", "function DisplayInfo(){\n\t$(\"#content\").html('');\n\t\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Hints\"]+\"</h1></div>\");\n\tif (Debug)\n\t\tAddWarning();\n\t$(\"#content\").append(Language[\"WelcomeText\"]);\n\t$(\"#content\").append(\"<a id='startTestButton' class='btn btn-primary btn-lg' role='button'>\"+Language[\"StartTest\"]+\"</a>\");\n\t$(\"#content\").fadeIn();\n\t$(\"#startTestButton\").click(function(){\n\t\tLoadQuestion(-1);\n\t});\n;}", "displayExamples() {\r\n this.parent.menuPG.removeAllOptions();\r\n\r\n var scripts = this.parent.main.scripts;\r\n\r\n if (!this.examplesLoaded) {\r\n\r\n \r\n function sortScriptsList(a, b) {\r\n if (a.title < b.title) return -1;\r\n else return 1;\r\n }\r\n\r\n for (var i = 0; i < scripts.length; i++) {\r\n scripts[i].samples.sort(sortScriptsList);\r\n\r\n var exampleCategory = document.createElement(\"div\");\r\n exampleCategory.classList.add(\"categoryContainer\");\r\n\r\n var exampleCategoryTitle = document.createElement(\"p\");\r\n exampleCategoryTitle.innerText = scripts[i].title;\r\n exampleCategory.appendChild(exampleCategoryTitle);\r\n\r\n for (var ii = 0; ii < scripts[i].samples.length; ii++) {\r\n var example = document.createElement(\"div\");\r\n example.classList.add(\"itemLine\");\r\n example.id = ii;\r\n\r\n var exampleImg = document.createElement(\"img\");\r\n exampleImg.setAttribute(\"data-src\", scripts[i].samples[ii].icon.replace(\"icons\", \"https://doc.babylonjs.com/examples/icons\"));\r\n exampleImg.setAttribute(\"onClick\", \"document.getElementById('PGLink_\" + scripts[i].samples[ii].PGID + \"').click();\");\r\n\r\n var exampleContent = document.createElement(\"div\");\r\n exampleContent.classList.add(\"itemContent\");\r\n exampleContent.setAttribute(\"onClick\", \"document.getElementById('PGLink_\" + scripts[i].samples[ii].PGID + \"').click();\");\r\n\r\n var exampleContentLink = document.createElement(\"div\");\r\n exampleContentLink.classList.add(\"itemContentLink\");\r\n\r\n var exampleTitle = document.createElement(\"h3\");\r\n exampleTitle.classList.add(\"exampleCategoryTitle\");\r\n exampleTitle.innerText = scripts[i].samples[ii].title;\r\n var exampleDescr = document.createElement(\"div\");\r\n exampleDescr.classList.add(\"itemLineChild\");\r\n exampleDescr.innerText = scripts[i].samples[ii].description;\r\n\r\n var exampleDocLink = document.createElement(\"a\");\r\n exampleDocLink.classList.add(\"itemLineDocLink\");\r\n exampleDocLink.innerText = \"Documentation\";\r\n exampleDocLink.href = scripts[i].samples[ii].doc;\r\n exampleDocLink.target = \"_blank\";\r\n\r\n var examplePGLink = document.createElement(\"a\");\r\n examplePGLink.id = \"PGLink_\" + scripts[i].samples[ii].PGID;\r\n examplePGLink.classList.add(\"itemLinePGLink\");\r\n examplePGLink.innerText = \"Display\";\r\n examplePGLink.href = scripts[i].samples[ii].PGID;\r\n examplePGLink.addEventListener(\"click\", function () {\r\n location.href = this.href;\r\n location.reload();\r\n });\r\n\r\n exampleContentLink.appendChild(exampleTitle);\r\n exampleContentLink.appendChild(exampleDescr);\r\n exampleContent.appendChild(exampleContentLink);\r\n exampleContent.appendChild(exampleDocLink);\r\n exampleContent.appendChild(examplePGLink);\r\n\r\n example.appendChild(exampleImg);\r\n example.appendChild(exampleContent);\r\n\r\n exampleCategory.appendChild(example);\r\n }\r\n\r\n exampleList.appendChild(exampleCategory);\r\n }\r\n }\r\n this.examplesLoaded = true;\r\n\r\n\r\n this.isExamplesDisplayed = true;\r\n this.exampleList.style.display = 'block';\r\n document.getElementsByClassName('wrapper')[0].style.width = 'calc(100% - 400px)';\r\n\r\n this.fpsLabel.style.display = 'none';\r\n this.toggleExamplesButtons.call(this, true);\r\n this.exampleList.querySelectorAll(\"img\").forEach(function (img) {\r\n if (!img.src) {\r\n img.src = img.getAttribute(\"data-src\");\r\n }\r\n })\r\n }", "static showButton() {\n\t\tlet content = document.querySelector('#content').style.display = 'block';\n\t}", "function clickMethod() {\n\t$(function() {\n\t\t$(\"p\").show();\n\t\t$(\"p\").on(\"click\", function() {\n\t\t\tconsole.log(\"paraghraph is clicked\");\n\t});\n});\n}", "show() {\n this.visible = true;\n }", "show() {\n return true;\n }", "function showPreview(){\n\t$('#ce-side-event_date, #ce-side-time, #ce-side-title, #ce-side-speaker, #ce-side-bio, #ce-side-prelude, #ce-side-article, #ce-side-postlude, #ce-side-location, #ce-img-preview').show();\n}", "#buildhowToPlayButton() {\n this.howToPlayButton.addEventListener('click', () => {\n this.howToPlayText.style.display = 'block';\n this.aboutText.style.display = 'none';\n });\n }", "function show()\n{\n update();\n}", "function display(i,event,k) {\n if($(event.target).attr('class') == 'square stop'){\n return\n }\n $(event.target).css('color', 'blue')\n $(event.target).css('text-shadow', '3px 3px #0000FF')\n $(event.target).addClass('stop')\n $('.modal').css('display','block')\n const $div = $('<div>').text(question[k][i].toUpperCase()).addClass('question')\n const $ul = $('<ul>').addClass('qList')\n \n for(let j = 0; j < answers[k][i].length; j++){\n const $li = $('<li>').text(answers[k][i][j].name.toUpperCase())\n $li.on('click',() => checkAnswer(i,j,k))\n $ul.append($li)\n }\n $('.text_box').append($div)\n $('.text_box').append($ul)\n \n }", "showDescription() {\n ui.toggleDescription();\n }", "function showtableau() {\n console.log(\"showing viz\");\n viz.show();\n}", "function show() {\n const toShow = document.querySelector(\".show\");\n const showBlock = document.querySelector(\".currentDisplay\");\n showBlock.innerHTML = (toShow.innerHTML)\n}", "function startDemo() {\n View.set('Demo');\n }", "function display() {\n\n doSanityCheck();\n initButtons();\n}", "function displayInitialSample(){\n\t\t//probably call it when starwars is clicked\n\t\tclearInfo();\n\t\t$spanInfo.html(\"<h4><b>Sample piece of data from each class on the API</b></h4>\");\n\t\t// $spanInfo.append(\"<h4 class='label label-info lb-md'>Starships, Vehicles, Species, Films, Planets, People</h4>\");\n\t\t$spanInfo.append(\"<table class='table tableHeaderHome label-default lb-sm'><th>Starships</th><th>Vehicles</th><th>Species</th><th>Films</th><th>Planets</th><th>People</th></table>\");\n\t\t$table.show();\n\t\t//print out the sample 1 per each.\n\t\tgenerateStarships(2);//no values on 1\n\t\tgenerateVehicles(4);//no values on first 3\n\t\tgenerateSpecies(1);\n\t\tgenerateFilms(1);\n\t\tgeneratePlanets(1);\n\t\tgeneratePeople(1);\t\t\t\t\t\t\n\t}", "function setupShow(){\n\tif (lastclicked == \"setup\"){\n\t\t$(\"#setupInfos\").toggle(\"blind\");\n\t}else{\n\t\thideAll();\n\t\tlastclicked=\"setup\";\n\t\tsetupShow();\n\t}\n}", "show() {\n if (this.curriculum === Curriculum.QUICK_ORIENTATION ||\n this.curriculum === Curriculum.TOUCH_ORIENTATION) {\n // If opening the tutorial from the OOBE, automatically show the first\n // lesson.\n this.updateIncludedLessons_();\n this.showLesson_(0);\n } else {\n this.showMainMenu_();\n }\n this.isVisible = true;\n }", "function addTodoBtn() {\n $('#')\n $('#add-todo-item').show('fast', function() {\n\n });\n console.log ('add item clicked')\n }", "function showItems() {\n\n}", "function run() {\n\t$(\"#smart-collections > h3\").after(\"<div style='height:30px;'><a id='hide-sc' href='#' style='float:left;padding:10px;'>Hide</a><a id='show-sc' href='#' style='float:left;padding:10px;'>Show</a></div>\");\n\t$(\"#smart-collections > table\").css('display', 'none');\n\t$(\"#smart-collections > div#pagination\").css('display', 'none');\t\n\t\n\t$(\"#hide-sc\").click(function() {\n\t\t$(\"#smart-collections > table\").css('display', 'none');\n\t\t$(\"#smart-collections > div#pagination\").css('display', 'none');\n\t});\n\t$(\"#show-sc\").click(function() {\n\t\t$(\"#smart-collections > table\").css('display', '');\n\t\t$(\"#smart-collections > div#pagination\").css('display', '');\n\t});\n}", "function show() {\n window.extensions.KJSLINT.KomodoAdaptor.showCommandPanel();\n }", "function showDemographics() {\n \n hideElements();\n $('#demographics').show();\n $('#demographics').load('html/demographics.html');\n $('#next').show();\n $('#next').click(validateDemographics);\n}", "show() {\n this.view.show();\n }", "show() {\n this.switchToTitlePage();\n }", "show (args){ this.transitioner.show(args) }", "function showElement(e) {\n e.style.display = \"block\";\n }", "onBeforeShow(data) {}", "function showJoke(btnIDName, callback) {\n // btnIDName = the name of the id in index.html that triggers the show joke action\n document.getElementById(btnIDName).addEventListener(\"click\", callback);\n}", "function display(question, target) {\n\tvar d = new Date(question.timestamp);\n\t$(target).append(\"<div class='question click_option' onclick='redirect(\"+question.question_id+\");'>\" +\n\t\t\t\"<p class='qtitle'>\"+question.question_title+\"</p><span class='qauthor'><a href='user_profile.php?id=\"+\n\t\t\tquestion.auth+\"'>\"+question.screenName+\"</a></span><span class='qexcerpt'><pre>\"+excerpt(question.q)+\"</pre></span>\"+\n\t\t\t\"<span class='qstats'>\"+d.toLocaleDateString()+\" | \"+replies(question.replies)+\n\t\t\t\"<span class='tags'>\"+tagLinks(question.tags)+\"</span></span></div>\");\n}", "function displayOptions(e){ \n e.show(); \n}", "function showPreview(){\n\t$('#ne-side-title, #ne-side-article').show();\n\t$('.ne-side-label, #ne-title-edit, #ne-intro-edit, #ne-article-edit, #ne-img-edit, #ne-sdate-edit, #ne-edate-edit, #ne-img-edit').hide();\n}", "function addShow(event) {\n // prevent default method to avoid submit form default\n event.preventDefault();\n // Get value of the user's input and save to var\n var input = $(\"#tv-input\").val().trim();\n // Clearing values in input field\n $(\"#tv-input\").val(\"\");\n // push new value into the topics array\n topics.push(input);\n // rerun function to populate buttons\n renderButtons();\n }", "function show(index){\n //simple function to show the quiz according to the choice of user\n Quizfact.getbyid(index); //Get the data by category of quiz\n\n\n}", "function show1() {\r\n console.log(\"I am Show function\");\r\n}", "function setup_showInfo() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"none\";\n\tdocument.getElementById(\"source\").style.display = \"none\";\n\tdocument.getElementById(\"info\").style.display = \"block\";\n}", "function display(event) {\n \n $(event.currentTarget).css(\"background-color\", \"#FAFF7E\");\n $(event.currentTarget).next().toggle(\"slow\");\n $(event.currentTarget).next().children().css(\"background-color\", \"#51FF0D\");\n \n \n\n}//end of display", "function show(e) {\n\tif(openedCards.length >= 2 || e.target.classList.contains('open','show') || e.target.classList.contains('match')) {\n\t\treturn;\n\t}\n\n\te.target.classList.add('open','show','disable');\n\topenedCards.push(e.target);\n\tif(openedCards.length === 2) {\n\t\tmoveCounter++;\n\t\tmoves.textContent=moveCounter;\n\t\tmatchCard();\n\t\tratings();\n\t}\n}", "function showQuestion() {\n $('main').html(generateQuestion());\n}", "function showsimple(){\r\n\t//show div\r\n\tdocument.querySelector(\".easy-sharing\").style.display=\"none\";\r\n\tdocument.querySelector(\".speedy-searching\").style.display=\"none\";\r\n\tdocument.querySelector(\".simple-bookmarking\").style.display=\"block\";\r\n\tdocument.querySelector(\".simple-bookmarking\").style.WebkitAnimationPlayState= \"running\"; \r\n\t\r\n\t//color of a\r\n\tdocument.querySelector(\".easy-lign\").style.color=\"hsl(229, 8%, 60%)\";\r\n\tdocument.querySelector(\".speedy-lign\").style.color=\"hsl(229, 8%, 60%)\";\r\n\tdocument.querySelector(\".simple-lign\").style.color=\"black\";\r\n\t// lign of a\r\n\tdocument.querySelector(\".easy-lign\").style.borderBottom=\"0px solid\";\r\n\tdocument.querySelector(\".speedy-lign\").style.borderBottom=\"0px solid\";\r\n\tdocument.querySelector(\".simple-lign\").style.borderBottom=\"4px solid hsl(0, 94%, 66%)\";\r\n\t\r\n\r\n\t\r\n}", "on_button(evt)\n\t{\n\t\tlet i = parseInt(evt.currentTarget.getAttribute(\"data-slide-idx\"));\n\t\t(i == this.current) || this.show(i);\n\t}", "function exampleCode(id, text) {\n /* fill examples into the editor */\n $(id).click(function(e) {\n editor.setValue(text);\n editor.focus(); // so that F5 works, hmm\n });\n}", "displayInfo() {\n clear(dogInfo())\n\n let image = document.createElement('img')\n image.src = this.image\n\n let h2 = document.createElement('h2')\n h2.innerText = this.name\n\n let button = document.createElement('button')\n button.innerText = this.buttonText()\n button.id = `toggle${this.id}`\n \n dogInfo().appendChild(image)\n dogInfo().appendChild(h2)\n dogInfo().appendChild(button)\n }", "function show(el){\n\t\tel.style.display = 'block';\n\t}", "show() {\n this.$modal.show(\"hello-world\", {\n title: \"Alert!\",\n text: \"You are too awesome\",\n buttons: [\n {\n title: \"Deal with it\",\n handler: () => {\n alert(\"Woot!\");\n }\n },\n {\n title: \"\", // Button title\n default: true, // Will be triggered by default if 'Enter' pressed.\n handler: () => {} // Button click handler\n },\n {\n title: \"Close\"\n }\n ]\n });\n }", "function show(){\r\n // change display style from none to block\r\n details.style.display='block';\r\n}", "function showIt() {\n\t\t\t\tshowBlogEntry();\n\t\t\t}", "function showBoy(){\n //console.log useful for debugging(writes to the console)\n console.log(\"Boy Fucntion\");\n title.innerHTML=\"Boy Stuff\";\n item1.innerHTML=\"Trucks\";\n item2.innerHTML=\"Trains\";\n item3.innerHTML=\"Tools\";\n}", "function setup_showSource() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"none\";\n\tdocument.getElementById(\"source\").style.display = \"block\";\n\tdocument.getElementById(\"info\").style.display = \"none\";\n}", "function bindExamples() {\n $('#l-examples > li > a').click(function(evt) {\n var elId = $(this)[0].id;\n // find elID from exs.id\n // load corresponding url\n for(var i = 0, l = exs.length; i < l; i++) {\n if (exs[i].id == elId) {\n loadExample(exs[i].url);\n return;\n }\n }\n // switch (elId) {\n // case 'a-menu-ex-default':\n // loadExample('../examples/hellowaax.html');\n // break;\n // case 'a-menu-ex-thx':\n // loadExample('../examples/waax-thx.html');\n // break;\n // case 'a-menu-ex-rezobass':\n // loadExample('../examples/rezobass.html');\n // break;\n // case 'a-menu-ex-samplr':\n // loadExample('../examples/samplr.html');\n // break;\n // case 'a-menu-ex-visualizer':\n // loadExample('../examples/visualizer.html');\n // break;\n // case 'a-menu-ex-devmode':\n // loadExample('../examples/devmode.html');\n // break;\n // case 'a-menu-ex-uimanager':\n // loadExample('../examples/uimanager.html');\n // break;\n // case 'a-menu-ex-itrain':\n // loadExample('../examples/take-i-train.html');\n // break;\n // }\n });\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "function showInstructions() {\n \n hideElements();\n $('#instructions').show();\n $('#instructions').load('html/instructions.html');\n $('#next').show();\n $('#next').click(showInstructionChecks);\n}", "function view(){\n\tvar click = document.getElementById('imgs').src;\n\tviw = window.open(click,'viw','height=300,witdth=450, top=250, screenY=350,cursor=pointer');\n}", "async show({ params, request, response, view }) {\n }", "function showSuccess() {\n transitionSteps(getCurrentStep(), $('.demo-success'));\n }", "function show(id){\n $(id).show();\n}", "function displayToolInfoEvent() {\r\n\t$(\".mif-question\").click(function(){\r\n\r\n\t\tevent.stopPropagation(); //Stops more onclick-events from triggering\r\n\r\n\t\tvar url = \"about/\" + $(this).parents(\"[data-info]\").data(\"info\");\r\n\t\tvar toolTitle = $(this).parent().find(\".tile-label\").text();\r\n\t\t$(\"#help-title\").text(toolTitle);\r\n\r\n\t $.get(url, function(respnose) {\r\n\t $(\"#tool-help-info\").html(respnose);\r\n\t\t});\r\n\r\n\t $(\"#tool-help\").modal(); //Opening the Help-modal\r\n\r\n\t});\r\n}", "function show() {\n\tcontainer.html(handlebars.templates['newDoc.html']({}));\n\t\n\tcontainer.show();\n\t\n\tcontainer.find('.close').click(function(event) {\n\t\tevent.preventDefault();\n\t\tcontainer.empty();\n\t});\n\t\n\t$('#btnSaveNewDoc').click(function(event) {\n\t\tevent.preventDefault();\n\t\tsave();\n\t});\n\t\n\t$('#newDocPutTemplate').click(function(event) {\n\t\tevent.preventDefault();\n\t\t$('#newDocBib').val(\"@inproceedings{IDENTIFIER,\\nauthor = {Names},\\ntitle = {towardsABetterBib},\\nyear = {2007}\\n}\");\n\t});\n}", "function prepareToShow() {}", "function showNext(){\r\n\t$(\"#liveDemo-show\").html(\"\");//empty the box, to show the next slide\r\n\t$(\"#liveDemo-message\").hide();//hide the message box\r\n\t\r\n\tif(i<liveDemo.length){//make sure that we don't go further than number of slides\r\n\t\tif( typeof liveDemo[i][1] == 'number') liveDemo[i][1]= $('*').eq(liveDemo[i][1]);\r\n\t\t\r\n\t\tswitch(liveDemo[i][0]){//get the type of slide\r\n\t\t\t/***** COMMENT *****/\r\n\t\t\tcase \"comment\":\r\n\t\t\t\t$(\"#liveDemo-message\")//add the message to message box\r\n\t\t\t\t\t.show()\r\n\t\t\t\t\t.html(liveDemo[i][1]);\r\n\t\t\t\tcallNext(liveDemo[i][2]);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** TAGGING *****/\r\n\t\t\tcase \"tag\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tvar element = clone(original,true);//copy the element\r\n\t\t\t\tvar offset = element.offset();//get original element's offset\r\n\t\t\t\tvar midPage= $(document).width()/2; ///get centre of page\r\n\t\t\t\t//place the message box according to position of\r\n\t\t\t\t//element relative to middle of page\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+original.innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t//add the tag\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html(liveDemo[i][2]);\r\n\t\t\t\tcallNext(liveDemo[i][3]);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** CLICK *****/\r\n\t\t\tcase \"click\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tvar href = original.attr('href');\r\n\t\t\t\tvar element = clone(original);//copy the element\r\n\t\t\t\tvar offset = original.offset();//get original element's offset\r\n\t\t\t\tvar height = element.innerHeight();\r\n\t\t\t\tvar width = element.innerWidth();\r\n\t\t\t\t//position of the mouse\r\n\t\t\t\tvar cx = offset.left+width/2;\r\n\t\t\t\tvar cy = offset.top + height/2;\r\n\t\t\t\t//add the mouse\r\n\t\t\t\t$(\"#liveDemo-show\")\r\n\t\t\t\t\t.append('<img style=\"position:absolute; left:'+cx+'px; top:'+cy+'px\"'+\r\n\t\t\t\t\t\t\t'src=\"'+host+'icons/cursor.png\" />');\r\n\t\t\t\tsetTimeout(\"window.location = '\"+href+\"'\",1000)\r\n\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** TYPE *****/\r\n\t\t\tcase \"type\":\r\n\t\t\t\tvar original = $(liveDemo[i][1])\r\n\t\t\t\tvar element = clone(original);//copy the element\r\n\t\t\t\telement.val('');//empty it\r\n\t\t\t\tvar offset = original.offset();//get original element's offset\r\n\t\t\t\tvar textArray = liveDemo[i][2].split('');//make an array from input text\r\n\t\t\t\tvar text = '';\r\n\t\t\t\tvar j =0;//j is number of characters from text showed on the box\r\n\t\t\t\t$(\"#liveDemo-show\").append(element);\r\n\t\t\t\telement\r\n\t\t\t\t\t.css(offset)\r\n\t\t\t\t\t.css({\"position\":\"absolute\",\"margin\":0});\r\n\t\t\t\t//typeWord function\r\n\t\t\t\tfunction typeWord(){\r\n\t\t\t\t\tif(j!=textArray.length){//if there's any character left, add it to the box\r\n\t\t\t\t\t\ttext+=textArray[j];\r\n\t\t\t\t\t\telement.val(text);\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\tsetTimeout(typeWord,150);//show next character in 150 ms\r\n\t\t\t\t\t}else{//if no character left go to next slide\r\n\t\t\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttypeWord();//call the function\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** SCROLL *****/\r\n\t\t\tcase \"scroll\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tif(original.get(0).tagName==undefined){\r\n\t\t\t\t\t//if tagName is undefined, it means we've scrolled on the actual page\r\n\t\t\t\t\t//and not it's elements, so we set element as body\r\n\t\t\t\t\telement = $('html, body');\r\n\t\t\t\t\t$(\"#liveDemo-blind\").hide();//so we show the whole page, to show scrolling\r\n\t\t\t\t\tsetTimeout(\"$('#liveDemo-blind').show();\",2001);//and show the blind again after scrolling is finished\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement = clone(original);\r\n\t\t\t\t}\r\n\t\t\t\tvar top = liveDemo[i][2];//get the new position for scrolling to\r\n\t\t\t\telement.animate({scrollTop: top}, 2000);//animate scrolling for 2 seconds\r\n\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** USER CLICK *****/\r\n\t\t\tcase \"userClick\":/***** EXPERIMENTAL *****/\r\n\t\t\t\tvar element = clone(liveDemo[i][1]);\r\n\t\t\t\tvar offset = liveDemo[i][1].offset();\r\n\t\t\t\tvar midPage= $(document).width()/2;\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+$(liveDemo[i][1]).innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html('please click here');\r\n\t\t\t\tcallNext(element);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** USER TYPE *****/\r\n\t\t\tcase \"userType\":/***** EXPERIMENTAL *****/\r\n\t\t\t\tvar element = clone(liveDemo[i][1]);\r\n\t\t\t\tvar offset = liveDemo[i][1].offset();\r\n\t\t\t\tvar midPage= $(document).width()/2;\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+$(liveDemo[i][1]).innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html('please type here');\r\n\t\t\t\tcallNext('mouse');\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}else{\r\n\t\t//if there's no slide left, remove all boxs and reset iterator\r\n\t\t$(\"#liveDemo-show,#liveDemo-blind,#liveDemo-message\").remove();\r\n\t\t$(\"#liveDemo-toolbar\").show();\r\n\t\ti = 0;\r\n\t}\r\n}", "function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"<h1 id='title' style='position:relative;top:20px;left:-40px;width:500px;'>Sheep's Snake</h1><p style='position:absolute;top:250px;left:-50px;font-size:1.1em;' id='playA'>Press A to play!</p><p style='position:absolute;top:280px;left:-50px;font-size:1.1em;' id='playB'>Press B for some help !</p>\");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function startQuiz() {\n $('#start').on('click', function (event) {\n displayQuestion();\n }\n );\n}", "function showHelp() {\n\t$(\"#info\").html(`Search for an artist that has live shows <i>(albums with a full date in the title)</i> available on Spotify, e.g. <a href=\"index.html?q=grateful-dead\">Grateful Dead</a> or <a href=\"index.html?q=the-allman-brothers-band\">The Allman Brothers Band</a>, to see their live shows in chronological order. Looks best on Chrome or Firefox, and designed to work on mobile and tablets as well.`);\n}", "static show(id, ...args) {\n const component = this.get(id, \"show\");\n if (component) component.show(...args);\n }", "onShow(instance) {\n\t\t\t\tinstance.setContent(instance.reference.dataset.tippyContent);\n\t\t\t}", "function idShow(id){ $('#'+id ).show(); }", "clicked(panel) {\n\t}", "function showAndHide(plan) {\n var features = document.querySelector(\".features-\" + plan);\n var showLink = document.querySelector(\"#show-\" + plan);\n var hideLink = document.querySelector(\"#hide-\" + plan);\n showLink.addEventListener(\"click\", function() {\n features.style.display = \"block\";\n showLink.style.display = \"none\";\n });\n hideLink.addEventListener(\"click\", function() {\n features.style.display = \"none\";\n showLink.style.display = \"block\";\n });\n}" ]
[ "0.7264848", "0.69415605", "0.6569241", "0.63958585", "0.634904", "0.63241345", "0.630526", "0.6298256", "0.6298256", "0.6298256", "0.6298256", "0.62970984", "0.6265472", "0.62434703", "0.6214603", "0.62052023", "0.618148", "0.61746895", "0.61584914", "0.6116763", "0.61167103", "0.60925514", "0.60851777", "0.60703486", "0.60703486", "0.6043952", "0.6043929", "0.60396165", "0.60368556", "0.60352445", "0.60345924", "0.60295016", "0.6026291", "0.60162324", "0.6016009", "0.5998927", "0.5996009", "0.59773433", "0.597575", "0.5974599", "0.59713686", "0.5962445", "0.59597385", "0.59584624", "0.5954801", "0.5944068", "0.59315264", "0.59308785", "0.59284806", "0.59205145", "0.59094036", "0.59077597", "0.59030503", "0.5900581", "0.59002054", "0.5894603", "0.58919287", "0.58876956", "0.5887402", "0.58868825", "0.5881098", "0.5878223", "0.5878061", "0.58696204", "0.58662385", "0.586463", "0.5864212", "0.5863787", "0.58635443", "0.58634496", "0.5851909", "0.5848743", "0.58485705", "0.5842626", "0.58396065", "0.58258516", "0.58184236", "0.5817104", "0.5817104", "0.5817104", "0.5817104", "0.5817104", "0.5817104", "0.5817104", "0.5804761", "0.58037966", "0.5801437", "0.5800079", "0.57965416", "0.5791784", "0.5782739", "0.57821727", "0.5782068", "0.5777132", "0.5777102", "0.57735085", "0.5768585", "0.5765977", "0.57658297", "0.5755114", "0.57547146" ]
0.0
-1
Initialise the Ffau instance in the document
constructor(){ console.log("========================="); console.log('%c Ffau Editor ', 'background: #00d1b2; color: white;'); console.log("A Blockly-based HTML editor made by the CodeDdraig organisation."); console.log("https://github.com/codeddraig/ffau"); console.log("=========================\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HATSTFInit(HTInfo, useTF, focusFieldName, hatsportletid){}", "function init(fe) {\n\n // Receive from parameters received as arguments.\n formElements = fe;\n\n // Add mask for CPF field.\n formElements.cpfField.mask('000.000.000-00', {reserve: true});\n\n // Add mask and internationalization for phoneNumber field.\n if (formElements.phoneNumberField && formElements.phoneNumberInput) {\n var options = {\n onKeyPress: function(telephone, e, field, options) {\n var masks = ['(00) 00000-0000', '(00) 0000-0000'];\n var mask = (telephone.length > 13) ? masks[0] : masks[1];\n formElements.phoneNumberInput.mask(mask, options);\n }\n };\n formElements.phoneNumberInput.mask('(00) 00000-0000', options);\n }\n\n // Add click handler for issueButton to submit form and perform\n // validations.\n formElements.issueButton.click(issue);\n\n // Generate random value for SubjectName and CPF fields.\n formElements.subjectNameField.val('Pierre de Fermat');\n formElements.cpfField.val('673.644.483-73');\n }", "function initalLoadOfFornaContainer() {\n \tif (typeof(fornaStructureContainer) === 'undefined' || fornaStructureContainer === null) {\n \t\tfornaStructureContainer = new FornaContainer(\"#fornaInputStructure\", {'applyForce': false});\n }\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(ref, afs) {\n this.ref = ref;\n this.afs = afs;\n }", "function initAF() {\n\t\t// remove conflicting elements\n\t\t$('.wordmark audio, style.AF17, #fegelFlop, #fegelDebug').remove();\n\t\t// add keyframe styles\n\t\tvar keyframeCSS = '\\\n\t\t\t@keyframes bgScrollLeft {\\\n\t\t\t\tfrom {background-position: center right}\\\n\t\t\t\tto {background-position: center left}\\\n\t\t\t} @keyframes bgScrollRight {\\\n\t\t\t\tfrom {background-position: center left}\\\n\t\t\t\tto {background-position: center right}\\\n\t\t\t} @keyframes bgScrollUp {\\\n\t\t\t\tfrom {background-position: bottom center}\\\n\t\t\t\tto {background-position: top center}\\\n\t\t\t} @keyframes bgScrollDown {\\\n\t\t\t\tfrom {background-position: top center}\\\n\t\t\t\tto {background-position: bottom center}\\\n\t\t\t} @keyframes bgZoomIn {\\\n\t\t\t\tfrom {background-size: cover}\\\n\t\t\t\tto {background-size: 130% !important}\\\n\t\t\t} @keyframes bgZoomOut {\\\n\t\t\t\tfrom {background-size: 130% !important}\\\n\t\t\t\tto {background-size: cover}\\\n\t\t\t}';\n\t\t$('<style class=\"AF17\">').text(keyframeCSS).appendTo(document.body);\n\t\t\n\t\t// add FegelFlop\n\t\t$fegelFlop = $('<div>').prop({id: 'fegelFlop'}).css({\n\t\t\tdisplay: 'inline-block',\n\t\t\tbackground: 'url(https://vignette.wikia.nocookie.net/hitlerparody/images/b/b3/FegelFlop.gif)',\n\t\t\tposition: 'fixed',\n\t\t\tleft: '50%', top: '50%',\n\t\t\twidth: '320px', height: '180px',\n\t\t\ttransform: 'translate(-50%, -50%)'\n\t\t}).hide().prependTo('body');\n\t\t$fegelDebug = $('<span>').prop({id:'fegelDebug'}).css({position: 'fixed', left: 0, bottom: '27px', \"z-index\":9000}).hide().appendTo('body');\n\t\t\n\t\t// add audio \n\t\tvar $au = $('<audio>').prop({\n\t\t\t\tid: 'ShootingStars',\n\t\t\t\tcontrols: true,\n\t\t\t\t//src: 'https://vignette.wikia.nocookie.net/communitytest/images/e/e9/AF17.ogg'\n\t\t\t\t src: 'https://vignette.wikia.nocookie.net/hitlerparody/images/e/e9/AF17.ogg/revision/latest'\n\t\t});\n\t\t$au.on('ended', function (e) {\n\t\t\t// when audio ended\n\t\t\t// seek back to 10.96s and play\n\t\t\tthis.currentTime = 10.96;\n\t\t\tthis.play();\n\t\t}).on('pause', function (e) {\n\t\t\t// when paused\n\t\t\t// move back to start\n\t\t\t// animating=false;\n\t\t\tthis.currentTime = 0;\n\t\t}).on('play', function (e) {\n\t\t\t// start playing\n\t\t\t// rmv bg and preload images\n\t\t\tif (this.currentTime > 9) return;\n\t\t\t$('body.skin-oasis').css({ // default bg here\n\t\t\t\t\"background-image\": 'url(https://vignette.wikia.nocookie.net/hitlerparody/images/6/63/AF17_default.png)',\n\t\t\t\t\"background-size\" : 'auto auto',\n\t\t\t\t\"background-repeat\": \"repeat\",\n\t\t\t\t\"animation\" : \"none\"\n\t\t\t});\n\t\t\t$('.wordmark img').get(0).src = 'https://vignette.wikia.nocookie.net/hitlerparody/images/6/6e/Wordmark_blank.png' // blank wordmark here\n\t\t\tanimating = false;\n\t\t\t$fegelFlop.hide();\n\t\t\tpreloadBgs();\n\t\t}).appendTo($('.wordmark'));\n\t\n\t\t// cue track\n\t\tvar track = $au.get(0).addTextTrack('metadata');\n\t\ttrack.mode = 'showing';\n\t\ttrack.default = true;\n\t\tfor (var i=0; i<bgChgCues.length; i++) {\n\t\t\tvar cue = new VTTCue(bgChgCues[i], bgChgCues[i]+0.02, \"\");\n\t\t\tif (i===0) {\n\t\t\t\tcue.onenter = function() { \n\t\t\t\t\trandBg();\n\t\t\t\t\t//console.log('first!')\n\t\t\t\t\tanimating = true;\n\t\t\t\t\tanimate();\n\t\t\t\t\tanimId = setInterval(function () { animate() }, timeStep);\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tcue.onenter = function() { randBg(); }\n\t\t\t}\n\t\t\ttrack.addCue(cue);\n\t\t}\n\t}", "function init_fabu_box() {\n\n\t// reusable variable definition\n\tvar fabuBoxDom = $('#fabu-wrapper .fabu-box');\n\tvar fabuSubjectDom = $('#fabu-wrapper .fabu-subject');\n\tvar fabuDescriptionDom = $('#fabu-wrapper .fabu-description');\n\tvar fabuTagDom = $('#fabu-wrapper .fabu-tag');\n\tvar fabuLocationDom = $('#fabu-wrapper .fabu-location');\n\tvar fabuPriceDom = $('#fabu-wrapper .fabu-price');\n\tvar fabuSubjectLength = 20;\n\tvar fabuDescriptionLength = 160;\n\tvar fabuSubjectDefaultVal = fabuSubjectDom.attr('placeholder');\n\tvar fabuDescriptionDefaultVal = fabuDescriptionDom.attr('placeholder');\n\tvar fabuTagDefaultVal = fabuTagDom.attr('placeholder');\n\tvar fabuLocationDefaultVal = fabuLocationDom.attr('placeholder');\n\tvar fabuPriceDefaultVal = fabuPriceDom.attr('placeholder');\n\n\t// fabu module activate responses\n\tfabuSubjectDom.focus(function() {\n\t\t// fabu-media reposition\n\t\t$('#fabu-media').css('margin-top', 0);\n\t\t$('#fabu-media').removeClass('inside');\n\t\t// expand and show the rest fabu sections\n\t\tfabuDescriptionDom.slideDown(200);\n\t\t$('.fabu-tools').slideDown(200);\n\t\t$('#step-one-next-btn').show().addClass('active');\n\t\t$('#fabu-submission').slideDown(200);\n\t});\n\n\t// fabu module deactivate responses\n\t$('#doc').click(function() {\n\t\t// if ($('#fabu-content-one').is(':hidden')) {\n\t\t\t// $('.fabu-content').fadeOut(200, function() {\n\t\t\t\t// $('#fabu-content-one').show();\n\t\t\t\t// $('.fabu-btn').hide().removeClass('active');\n\t\t\t// });\n\t\t// }\n\t\tif ($('#fabu-content-one').is(':visible')) {\n\t\t\trevokeFabuBox();\n\t\t}\n\t});\n\t$('#fabu-wrapper').click(function(e) {\n\t\te.stopPropagation();\n\t});\n\n\t// fabu-box onfocus event\n\tfabuBoxDom.focus(function() {\n\t\t// add focused class to the corresponding action object\n\t\tif (!$(this).hasClass('focused')) {\n\t\t\t$(this).addClass('focused');\n\t\t}\n\t\t// character counters toggle and display\n\t\tif ($(this).hasClass('fabu-subject')) {\n\t\t\t$('#description-letter-count').hide().removeClass('active');\n\t\t\t$('#subject-letter-count').show().addClass('active');\n\t\t} else if ($(this).hasClass('fabu-description')) {\n\t\t\t$('#subject-letter-count').hide().removeClass('active');\n\t\t\t$('#description-letter-count').show().addClass('active');\n\t\t} else {\n\t\t}\n\t\t// remove fabu-box input default value\n\t\tif ($(this).val() === this.defaultValue) {\n\t\t\t$(this).val('');\n\t\t}\n\t\t// remove fabu-box placeholder value\n\t\t$(this).attr('placeholder', '');\n\t});\n\n\t// fabu-box onblur event\n\tfabuBoxDom.blur(function() {\n\t\t// remove focused class to the corresponding action object\n\t\tif ($(this).hasClass('focused')) {\n\t\t\t$(this).removeClass('focused');\n\t\t}\n\t\t// reset fabu-box input default value\n\t\tvar inputDefaultVal = (function() {\n\t\t\tif ($(this).hasClass('fabu-subject')) {\n\t\t\t\treturn fabuSubjectDefaultVal;\n\t\t\t} else if ($(this).hasClass('fabu-description')) {\n\t\t\t\treturn fabuDescriptionDefaultVal;\n\t\t\t} else if ($(this).hasClass('fabu-tag')) {\n\t\t\t\treturn fabuTagDefaultVal;\n\t\t\t} else if ($(this).hasClass('fabu-location')) {\n\t\t\t\treturn fabuLocationDefaultVal;\n\t\t\t} else if ($(this).hasClass('fabu-price')) {\n\t\t\t\treturn fabuPriceDefaultVal;\n\t\t\t} else {\n\t\t\t}\n\t\t});\n\t\tif ($(this).val() === this.defaultValue) {\n\t\t\t$(this).val(inputDefaultVal);\n\t\t}\n\t\t// reset fabu-box placeholder value\n\t\t$(this).attr('placeholder', inputDefaultVal);\n\t});\n\n\t// fabu-box step-one next-btn activation & keyup character count and input validation\n\tfabuSubjectDom.charCount($('.fabu-tools .counter'), null, fabuSubjectLength);\n\tfabuDescriptionDom.charCount($('.fabu-tools .counter'), null, fabuDescriptionLength);\n\tfabuDescriptionDom.focus(function() {\n\t\tif (fabuSubjectDom.val().replace(/[^x00-xff]/g, 'xx').length / 2 > fabuSubjectLength) {\n\t\t\tfabuSubjectDom.focus();\n\t\t}\n\t});\n\t$('.fabu-subject, .fabu-description').keyup(function() {\n\t\tvar val_length = $(this).val().replace(/[^x00-xff]/g, 'xx').length / 2;\n\t\tif (val_length > ($(this).hasClass('fabu-subject') ? fabuSubjectLength : fabuDescriptionLength)) {\n\t\t\t$(this).css('background', '#FFF3EF');\n\t\t} else {\n\t\t\t$(this).css('background', '#FFFFFF');\n\t\t}\n\t\tif (fabuSubjectDom.val() != fabuSubjectDefaultVal && fabuDescriptionDom.val() != fabuDescriptionDefaultVal && fabuSubjectDom.val().length > 0 && fabuDescriptionDom.val().length > 0) {\n\t\t\t$('#step-one-next-btn').removeAttr('disabled').removeClass('disabled');\n\t\t} else {\n\t\t\t$('#step-one-next-btn').attr('disabled', 'disabled').addClass('disabled');\n\t\t}\n\t});\n\n\t// fabu-box step-two next-btn activation\n\t$('#fabu-content-two .fabu-box').change(function() {\n\t\tif ($('#new-event-category').val() != 0) {\n\t\t\t$('#step-two-next-btn').removeAttr('disabled');\n\t\t} else {\n\t\t\t$('#step-two-next-btn').attr('disabled', 'disabled');\n\t\t}\n\t});\n\t\n\t// fabu-box step-three submit-btn activation\n\t$('#fabu-content-three .fabu-box').keyup(function() {\n\t\tif (fabuLocationDom.val() != fabuLocationDefaultVal && fabuLocationDom.val().length > 0) {\n\t\t\t$('#step-three-submit-btn').removeAttr('disabled');\n\t\t} else {\n\t\t\t$('#step-three-submit-btn').attr('disabled', 'disabled');\n\t\t}\n\t});\n\n\t// fabu-box .fabu-%-trigger click event\n\t$('.fabu-trigger').click(function(e) {\n\t\tfabuSubjectDom.focus();\n\t\tif ($(this).hasClass('photo-trigger')) {\n\t\t\t$('#review_image').click();\n\t\t} else if ($(this).hasClass('video-trigger')) {\n\t\t\t$('#review_video').click();\n\t\t} else if ($(this).hasClass('link-trigger')) {\n\t\t\t$('#review_link').click();\n\t\t} else {\n\t\t}\n\t});\n\n\t// fabu-box fabu-media actions\n\t$(\"#fabu-submission img.preview\").mouseover(function() {\n\t\tif ($(this).is(\":visible\") && !$('.fabu-content').is(':animated')) {\n\t\t\t$(\"#fabu-submission img.delete_preview\").fadeIn();\n\t\t}\n\t});\n\t$(\"#fabu-submission img.delete_preview\").mouseout(function() {\n\t\tif ($(this).is(\":visible\") && !$('.fabu-content').is(':animated')) {\n\t\t\t$(this).fadeOut();\n\t\t}\n\t});\n\t$(\"#fabu-submission img.delete_preview\").click(function() {\n\t\tif ($(this).is(\":visible\")) {\n\t\t\t$('#review_image').val(null);\n\t\t\t$(this).hide();\n\t\t\t$('#fabu-submission img.preview').hide();\n\t\t}\n\t});\n\n\t// fabu-content slider control button actions\n\t$('#step-one-next-btn').click(function() {\n\t\tif (!$('.fabu-content').is(':animated')) {\n\t\t\t$(this).hide().removeClass('active');\n\t\t\t$('#step-two-previous-btn').removeAttr('disabled').show().addClass('active');\n\t\t\t$('#step-two-next-btn').show().addClass('active');\n\t\t\t$('#fabu-content-one').fadeOut(200, function() {\n\t\t\t\t$('#fabu-content-two').fadeIn(400);\n\t\t\t});\n\t\t}\n\t});\n\t$('#step-two-previous-btn').click(function() {\n\t\tif (!$('.fabu-content').is(':animated')) {\n\t\t\t$(this).hide().removeClass('active');\n\t\t\t$('#step-two-next-btn').hide().removeClass('active');\n\t\t\t$('#step-one-next-btn').show().addClass('active');\n\t\t\t$('#fabu-content-two').fadeOut(200, function() {\n\t\t\t\t$('#fabu-content-one').fadeIn(400);\n\t\t\t});\n\t\t}\n\t});\n\t$('#step-two-next-btn').click(function() {\n\t\tif (!$('.fabu-content').is(':animated')) {\n\t\t\t$('#step-two-previous-btn').hide().removeClass('active');\n\t\t\t$(this).hide().removeClass('active');\n\t\t\t$('#step-three-previous-btn').removeAttr('disabled').show().addClass('active');\n\t\t\t$('#step-three-reset-btn').removeAttr('disabled').show().addClass('active');\n\t\t\t$('#step-three-submit-btn').show().addClass('active');\n\t\t\t$('#fabu-content-two').fadeOut(200, function() {\n\t\t\t\t$('#fabu-content-three').fadeIn(400, function() {\n\t\t\t\t\tloadMap();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n\t$('#step-three-previous-btn').click(function() {\n\t\tif (!$('.fabu-content').is(':animated')) {\n\t\t\t$(this).hide().removeClass('active');\n\t\t\t$('#step-three-reset-btn').hide().removeClass('active');\n\t\t\t$('#step-three-submit-btn').hide().removeClass('active');\n\t\t\t$('#step-two-previous-btn').show().addClass('active');\n\t\t\t$('#step-two-next-btn').show().addClass('active');\n\t\t\t$('#fabu-content-three').fadeOut(200, function() {\n\t\t\t\t$('#fabu-content-two').fadeIn(400);\n\t\t\t});\n\t\t}\n\t});\n\t$('#step-three-reset-btn').click(function() {\n\t\t$('.next-btn, .submit-btn').attr('disabled', 'disabled');\n\t\t$('#review_image').val(null);\n\t\t$('#fabu-submission img.delete_preview').hide();\n\t\t$('#fabu-submission img.preview').hide();\n\t\t$('.fabu-content').fadeOut(200, function() {\n\t\t\t$('#fabu-content-one').show();\n\t\t\t$('.fabu-btn').hide().removeClass('active');\n\t\t\t$('#step-one-next-btn').attr('disabled', 'disabled').show();\n\t\t\t$('#new-event-subject').focus();\n\t\t});\n\t});\n\n\t// Bind normal submission with ajax submission\n\tbindAjaxSubmission();\n\t//what does this do?\n\t// Normal submission\n\t$(\"#step-three-submit-btn\").click(function() {\n\t\tnewStreamSubmission();\n\t});\n}", "function Fa(){this.kb=this.root=null;this.ia=!1;this.G=this.ca=this.xa=this.assignedSlot=this.assignedNodes=this.L=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.U=void 0;this.rb=this.Ka=!1;this.Z={}}", "async init () {\n await super.init();\n this._doc.location = {\n timestamp: 0,\n mocked: false,\n coords: {\n latitude: 0,\n longitude: 0,\n heading: 0,\n speed: 0,\n altitude: 37.5,\n accuracy: 0\n }\n };\n }", "function init() {\n // connect to the taco database\n dbRef = firebase.database();\n\n // wire up the taco eaters collection\n tacoEatersRef = dbRef.ref('tacoEaters');\n tacoEatersCollection = $firebaseArray(tacoEatersRef);\n tacoEatersRef.on('value', function (snapshot) {\n var eaters = snapshotToArray(snapshot);\n service.users = _.map(eaters, mapUsers);\n $rootScope.$broadcast('firebase.usersUpdated');\n\n // set up activity and leaderboard\n service.activity = getActivityFeed(service.users);\n console.log(service.activity);\n service.leaderboard = getLeaderBoard(service.users);\n });\n\n // set up the user ref if we can\n addUserRef();\n }", "function init(fe) {\n\n formElements = fe;\n\n // Wireup of button clicks\n formElements.signButton.click(sign);\n formElements.refreshButton.click(refresh);\n\n // Block the UI while we get things ready\n $.blockUI({ message: 'Initializing ...' });\n\n // Get an instance of the LacunaWebPKI object. If a license was set on Web.config, the _Layout.cshtml master\n // view will have placed it on the global variable _webPkiLicense, which we pass to the class constructor.\n pki = new LacunaWebPKI(_webPkiLicense);\n\n // Call the init() method on the LacunaWebPKI object, passing a callback for when\n // the component is ready to be used and another to be called when an error occurrs\n // on any of the subsequent operations. For more information, see:\n // https://webpki.lacunasoftware.com/#/Documentation#coding-the-first-lines\n // http://webpki.lacunasoftware.com/Help/classes/LacunaWebPKI.html#method_init\n pki.init({\n ready: loadCertificates, // as soon as the component is ready we'll load the certificates\n defaultError: onWebPkiError // generic error callback on Content/js/app/site.js\n });\n }", "function init () {\n\t\t//Get the unique [charity] userId so we know \n\t\t//which url to used for the server-side API\n\t\tvar userId = $('[data-event-config=\"userId\"]').val();\n\t\t\n\t\t//Initialise events collection\n\t\tfunction initCollection () {\n\t\t\tvar evts = new Evts({\n\t\t\t\tuserId: userId\n\t\t\t});\n\n\t\t\tinitFormView(evts);\n\t\t\tinitEventsBoard(evts);\n\t\t}\n\n\t\t//Initialise event form view\n\t\tfunction initFormView (evts) {\n\t\t\tvar $el = $('[data-event=\"configure\"]');\n\t\t\tnew EventForm({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Initialise events board with persisted events\n\t\tfunction initEventsBoard (evts) {\n\t\t\tvar $el = $('[data-events-board]');\n\t\t\tnew EventBoard({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Start up everything\n\t\tinitCollection();\n\t}", "constructor() { \n \n ExpenseSimpleDocumentAllOf.initialize(this);\n }", "init(){}", "function Fh(a){Fh.$.constructor.call(this,a);this.yd()}", "function init() {\n self.phonecontactForm = {\n uploadedFile: null,\n isImporting: false,\n hasBeenImported: false,\n };\n }", "function init() {\n\t \t\n\t }", "constructor(aof) {\n\n\t\tthis.aof = aof\n\t\tthis.center = new Vector()\n\t\tthis.bodyColor = 0\n\t\tthis.bodyWidth = 0\n\t\tthis.pocketClipLength = 0\n\t\tthis.gripLength = 0\n\t\tthis.eraserLength = 0\n\t\tthis.rotation = 0\n\t\tthis.paused = false\n\n\t}", "function Fsa() {\n\tthis.endState = \"\";\n\tthis.epsilonState = \"*e*\";\n\tthis.transitionStates = [];\n\tthis.utilities = new Utilities();\n}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "init() {\n }", "function init() {\n \n newUser()\n\n}", "function init() {\n let meiFileURL = containerNode.attr('data-mei');\n createVerovioObject(meiFileURL); // TODO: this actually loads all the views, etc. Very confusing!\n }", "function initializeDocument() {\n\t\tconverterLabel.append(temperatureInput);\n\t\tconverterDocument.append(converterLabel);\n\t\tconverterLabel.after(documentSpaceBreak);\n\t\tdocumentSpaceBreak.after(converterResult);\n\t\tdocumentSpaceBreak.after(fahrenheitToCelsiusBtn);\n\t\tdocumentSpaceBreak.after(celsiusToFahrenheitBtn);\n\t\tdocument.querySelector('h3').after(converterDocument);\n\t\treturn;\n\t}", "function Scene_SumEvoFus() {\n this.initialize.apply(this, arguments);\n }", "constructor(ref, query, afs) {\n this.ref = ref;\n this.query = query;\n this.afs = afs;\n }", "function init () {\n // Here below all inits you need\n }", "function initMegaFolio() {\n\t\tvar api=jQuery('.megafolio-container').megafoliopro(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfilterChangeAnimation:\"pagebottom\",\n\t\t\t\t\t\t\tfilterChangeSpeed:400,\n\t\t\t\t\t\t\tfilterChangeRotate:99,\n\t\t\t\t\t\t\tfilterChangeScale:0.6,\n\t\t\t\t\t\t\tdelay:20,\n\t\t\t\t\t\t\tdefaultWidth:980,\n\t\t\t\t\t\t\tpaddingHorizontal:10,\n\t\t\t\t\t\t\tpaddingVertical:10,\n\t\t\t\t\t\t\tlayoutarray:[9,11,5,3,7,12,4,6,13]\n\t\t\t\t\t\t});\n\n\t}", "constructor(aof) {\n\t\t\n\t\tthis.aof = aof;\n\t\tthis.center = new Vector();\n this.offset = new Vector();\n \n\t}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init () {}", "init () {}", "init() {\n this.isUpdating = false;\n this.errors = {};\n this.copied = null;\n this.isLoading = false;\n this.tracks = [];\n this.einsteinCategories = [];\n\n this.tempUserName = this.user.lastName;\n\n if (!this.user.firstName) {\n this.user.firstName = this.user.name;\n }\n\n this.currentInput = {\n name: null,\n value: null,\n };\n }", "initalizeForm() {\n const self = this;\n\n self.annotonPresentation = self.getAnnotonPresentation(this.annoton);\n\n }", "static async init () {\n if (!collections.DOCUMENT_COLL) {\n throw new Error('Missing env variable');\n }\n Document.COLLECTION = collections.DOCUMENT_COLL;\n Document.validator = new SchemaValidator();\n const instance = Mongo.instance();\n\n await Document.validator.init({ schemas: [schema] });\n\n Document.db = instance.getDb();\n }", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "onload() {\n this.init();\n }", "constructor() {\n super();\n this._init();\n }", "initialize() {\n\t\tthis.updateFaves();\n\t\tthis.CALCULATOR.initialize();\n\t\t\n\t\t// initialize unit converter\n\t\tthis.populateCategories();\n\t\tthis.populateUnitMenus();\n\t\tthis.switchToFaveConv();\n\t\tthis.convertHandler();\n\t\t\n\t\t// initialize constants\n\t\tthis.populateConstants();\n\t\tif(this.m_faves.constant === \"\") {\n\t\t\tthis.constChange();\n\t\t\tthis.constHandler();\n\t\t}\n\t\telse {\n\t\t\tthis.switchToFaveConst();\n\t\t}\n\t\t\n\t\t// initialize formulas\n\t\tthis.populateFormulas();\n\t\tif(this.m_faves.formula === \"\") {\n\t\t\tthis.populateFormulaFields();\n\t\t}\n\t\telse {\n\t\t\tthis.switchToFaveFormula();\n\t\t}\n\t\t\n\t\tthis.setUnloadListener();\n\t}", "init () {\n /** Microphone stuff **/\n // Number of samples to store in the frequency spectrum\n this.samples = 1024;\n // Hz per sample (first index = 20, last index = 20000)\n this.sampleResolution = 19980/this.samples;\n // Fast Fourier Transform\n this.fft = new p5.FFT(0.8, this.samples);\n this.spectrum = [];\n this.frequency = 0;\n // Microphone input\n this.microphone = new p5.AudioIn();\n // Activate microphone input\n this.microphone.start();\n\n // Game world dimensions\n this.worldHeight = 2400;\n this.worldWidth = 864;\n\n // Game stuff\n this.score = 0;\n this.playerDirectionX = 1;\n\n // Activate HUD\n this.scene.manager.start(\"HUD\");\n }", "function _init() {\n }", "constructor() { \n \n DocumentWithoutSegments.initialize(this);\n }", "function init() {\n\t//TODO\n}", "async init(){}", "function init() { }", "function init() { }", "init() {\n this.setResolver();\n this.setValidationAndBehaviour();\n }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "static initialize(obj, fee, burn) { \n obj['fee'] = fee;\n obj['burn'] = burn;\n }", "function initializeDocument(doc)\n\t{\t\t\n\t\tdocToSend = doc;\n\t\tnewNodeId = 1;\n\t\t\n\t\tinitializeNodeMap(docToSend.documentElement);\n\t\tvar xmlDocument = docToSend.implementation.createDocument('http://www.w3.org/1999/xhtml','HTML', null);\n\t\tvar xmlPayload = createXMLPayload(xmlDocument, docToSend.documentElement);\n\t\tlistener.onDOMInit(obj , xmlPayload, tabId);\n\t\t\n\t\t//observer for the root document\n\t\tobserver = new MutationSummary({\n\t\t\t callback: handleChanges,\n\t\t\t rootNode: docToSend,\n\t\t\t queries: [{all:true}]\n\t\t\t});\n\t}", "init(){\n \n }", "function init() {\n\n\n\n\t}", "initialise () {}", "function init() {\r\n\r\n }", "function init() {\n\n }", "function init() {\n\n }", "init(){\n this.initFunctional();\n }", "function init() {\n initDomElement();\n\n audioMonoIO = new AudioMonoIO(FFT_SIZE, BUFFER_SIZE);\n audioMonoIO.setVolume(0.1);\n audioMonoIO.setSampleInHandler(sampleInHandler);\n initFirFilter();\n zoomBuffer = new Queue(ZOOM_SIZE);\n\n onLocalOscillatorFrequencyChange();\n}", "function Spoofer() {\n\tthis.init();\n} //end Spoofer constructor", "function init() {\n populateFeautured();\n populateFaq();\n id(\"logo\").addEventListener(\"click\", function() {\n directView(\"featured-view\");\n });\n id(\"men\").addEventListener(\"click\", populateMain);\n id(\"women\").addEventListener(\"click\", populateMain);\n id(\"sale\").addEventListener(\"click\", populateMain);\n id(\"all\").addEventListener(\"click\", populateMain);\n id(\"cart\").addEventListener(\"click\", function() {\n directView(\"cart-view\");\n });\n id(\"contact-us\").addEventListener(\"click\", contactView);\n id(\"faq\").addEventListener(\"click\", faqView);\n id(\"submit-btn\").addEventListener(\"click\", function(event) {\n event.preventDefault();\n storeFeedback();\n });\n }", "init () {\n }", "function init() {\n }", "_init() {\n\t\tthis.life.init();\n\t\tthis.render.init();\n\n\t\tthis.emission.init();\n\t\tthis.trail.init(this.node);\n\n\t\tthis.color.init();\n\t}", "function Froogaloop(iframe) {\n // The Froogaloop object is actually just the init constructor\n return new Froogaloop.fn.init(iframe);\n }", "function Froogaloop(iframe) {\n // The Froogaloop object is actually just the init constructor\n return new Froogaloop.fn.init(iframe);\n }", "function Froogaloop(iframe) {\n // The Froogaloop object is actually just the init constructor\n return new Froogaloop.fn.init(iframe);\n }", "function Froogaloop(iframe) {\n // The Froogaloop object is actually just the init constructor\n return new Froogaloop.fn.init(iframe);\n }", "init() {\n }", "init() {\n }", "init() {\n }", "function mkdfOnDocumentReady() {\n mkdfPropertyAddToWishlist();\n mkdfShowHideEnquiryForm();\n mkdfSubmitEnquiryForm();\n mkdfAddEditProperty();\n mkdfMortgageCalculator();\n mkdfDeleteProperty();\n }" ]
[ "0.58653635", "0.58578366", "0.5785591", "0.5705894", "0.5705894", "0.5705894", "0.5705894", "0.5705894", "0.56884736", "0.5678361", "0.565527", "0.56455743", "0.55984324", "0.55343485", "0.54911584", "0.5489732", "0.54860723", "0.54712754", "0.5467892", "0.53741926", "0.5371159", "0.5328304", "0.5327334", "0.53264284", "0.53220433", "0.53220433", "0.53220433", "0.53220433", "0.53220433", "0.5319769", "0.53148395", "0.53136283", "0.5312483", "0.5303819", "0.52863103", "0.52855575", "0.52795523", "0.52775514", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52644384", "0.52588654", "0.52588654", "0.5251923", "0.5249277", "0.5249018", "0.5231164", "0.5229153", "0.5217475", "0.52119595", "0.5209847", "0.5191907", "0.519055", "0.51894957", "0.5183451", "0.51762486", "0.51762486", "0.51691186", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5167929", "0.5161232", "0.51601076", "0.51596135", "0.51395404", "0.5139168", "0.5131878", "0.5128645", "0.5128645", "0.51252764", "0.5107164", "0.5104442", "0.51010746", "0.5097899", "0.50964874", "0.5096313", "0.5095851", "0.5095851", "0.5095851", "0.5095851", "0.5084883", "0.5084883", "0.5084883", "0.50778496" ]
0.0
-1
Clears all blocks from the workspace without further confirmation
clearWorkspace(){ this.ffauWorkspace.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function discard() {\n var count = Blockly.mainWorkspace.getAllBlocks().length;\n if (count < 2 || window.confirm(\"Remove all blocks?\")) {\n Blockly.mainWorkspace.clear();\n window.location.hash = '';\n }\n}", "function removeAllBlocks() {\n\tblocks.innerHTML = '';\n\tsetScriptNumber('');\n}", "function removeAllBlocks() {\n\tblocks.innerHTML = ''\n}", "function removeAllBlocks() {\n\tblocks.innerHTML = ''\n}", "function discard() {\n var count = Blockly.mainWorkspace.getAllBlocks().length;\n if (count < 2 ||\n window.confirm(BlocklyApps.getMsg('discard').replace('%1', count))) {\n Blockly.mainWorkspace.clear();\n window.location.hash = '';\n }\n}", "function discard() {\n var count = Blockly.mainWorkspace.getAllBlocks().length;\n if (count < 2 ||\n window.confirm(MSG.discard.replace('%1', count))) {\n Blockly.mainWorkspace.clear();\n window.location.hash = '';\n }\n}", "clear() {\n this.sendAction('clear');\n }", "function clearDebugBlocks() {\n const blocks = Blockly.mainWorkspace.getAllBlocks();\n if (Blockly.selected) {\n Blockly.selected.unselect();\n }\n for (let i = 0; i < blocks.length; i += 1) {\n if (blocks[i].type === 'debug') {\n blocks[i].setColour(345);\n }\n }\n}", "clearAll() {\n this.clearGraphic()\n this.clearData()\n }", "function clearCheckBlock(clearButton){\n\tvar checkForClick = confirm('Are you sure to clear the data for Check Request Block');\n\tif (checkForClick) {\n\t\tvar buttonBlk = j(clearButton).parents(\".acc-content\");\n\t\tclearInputs(buttonBlk);\n\t\tj(\".invalidFieldDesc\").remove();\n\t\tj(\"label\").removeClass(\"validationError\");\n\t\tdisplayFeeAmount();\n\t}\n}", "function clearBoard() {\n\tfor (i = 0; i < blockArr.length; i++) {\n\t\tfor (j = 0; j < blockArr[i].length; j++) {\n\t\t\tfor (k = 0; k < blockArr[i][j].length; k++) {\n\t\t\t\tblockArr[i][j][k] = 0;\n\t\t\t}\n\t\t\tblockArr[i][j][5] = -5;\n\t\t\tmechArr[i][j] = 0;\n\t\t\talchArr[i][j] = 0;\n\t\t}\n\t}\n}", "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "function clearWorkspace() {\n setNodes([]);\n setLines([]);\n }", "function clearAll() {\n CURRENT_STATE = STATES.READY;\n nodesArrays = Array.from(Array(GRID_SIZE_Y), () => new Array(GRID_SIZE_X));\n Graph.clearGraph();\n NodeHandler.createNodeGrid();\n}", "function clearAll() {\n recipeArea.empty();\n recipeTitle.empty();\n }", "clear() {\n this.rows.forEach(row => {\n row.forEach(algedonode => {\n algedonode.clear()\n })\n })\n this.dials.forEach(dial => {\n dial.clear()\n })\n }", "function clearAll() {\n opChain = [0];\n display.innerHTML = \"0\";\n displaySub.innerHTML = \"\";\n}", "function clear () {\n reloadList(\"W\");\n clearList(wltmp);\n writeList(\"W\");\n\n reloadList(\"B\");\n clearList(bltmp);\n writeList(\"B\");\n}", "function rmblocks(){\n\tvar i;\n\tfor(i=0; i<blocks.length; i++) blocks[i].remove();\n\tblocks = [];\n}", "function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}", "function onClickClearAll() {\n strDisplay = \"\";\n opHidden = [];\n opHiddenIndex = 0;\n operandoType = 0;\n openParIndex = 0;\n closeParIndex = 0;\n refreshDisplay();\n}", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "function clearTree() {\n\n // ******* TODO: PART VII *******\n \n\n}", "function clearAll(){\r\n\tb1.textContent='';\r\n\tb2.textContent='';\r\n\tb3.textContent='';\r\n\tb4.textContent='';\r\n\tb5.textContent='';\r\n\tb6.textContent='';\r\n\tb7.textContent='';\r\n\tb8.textContent='';\r\n\tb9.textContent='';\r\n}", "function resetGame() {\n const blocksToRemove = document.querySelectorAll('.new-block')\n for (let i = 0; i < blocksToRemove.length; i++) {\n blocksToRemove[i].remove()\n }\n currentScore = 0\n}", "clearTree() {\n // ******* TODO: PART VII *******\n\n // You only need two lines of code for this! No loops! \n }", "clear(clearHistory=true) {\n if(clearHistory) Hub.history.clear();\n \n // deselect anything\n ActorSelection.deselectAll();\n GraphSelection.deselect();\n \n // close the brain graph if opened\n BrainGraph.close();\n\n // close any opened browser if any\n this.closeBrowser();\n // TODO: save activity before destroy?\n this.activity.destroy();\n this.stage.clear();\n this.removeAllListeners();\n\n // close any modal\n Modal.close();\n store.commit('resetEditorState');\n console.log('clear')\n }", "function clear() {\n context.clear();\n }", "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "close() {\n // Remove blockchain buttons and nodes - full reset\n wallets.page.boxes.c2.buttonRanges.inputControls.removeButtons();\n }", "_resetBlocks(){\n if(MainGameScene.isInputActive) {\n this.physicsSpawner.removeAllSpawnables();\n }\n }", "clear() {\n if (this.active) {\n this.active = false\n this.algedonodes.forEach(algedonode => algedonode.clear())\n this.activationSource = ActivationSources.NONE\n }\n }", "function clearAll() {\n while (taskContainer.firstChild) {\n taskContainer.removeChild(taskContainer.firstChild);\n }\n browser.storage.local.clear();\n}", "function clear() {\n\t\tcontext.clear();\n\t}", "function clear() {\n\t\tcontext.clear();\n\t}", "clearAll()\r\n { \r\n this.selectedItems=[];\r\n this.display = null;\r\n this.value = null;\r\n this.results = null;\r\n this.error = null;\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n this.source.forEach(function (item) {\r\n item.invisible = false;\r\n });\r\n\r\n this.$emit(\"clear\");\r\n \r\n }", "function allClear () {\n calcDisplay.displayValue = '0';\n calcDisplay.firstOperand = null;\n calcDisplay.waitForSecondOperand = false;\n calcDisplay.operator = null;\n console.log('All Cleared');\n}", "function clear() {\r\n\t\tcontext.clear();\r\n\t}", "function clear() {\r\n context.clear();\r\n }", "function clearAll()\n\t{\n\t\tif (connected){\n\t\tcontext.clearRect(-300,-300,2000,6000);\n\t\t}\t\n\t}", "function clearAllFiles(){\n sbolFiles = [];\n $('#sbol-filenames').empty();\n $(\"#operationMenu\").attr(\"disabled\", true);\n $(\"#toleranceMenu\").attr(\"disabled\", true);\n}", "function resetGame() {\n game.lives = 1;\n game.score = 0;\n game.blockCount = ROWS*COLS;\n \n //remove everything\n scene.remove(baseBlock.mesh);\n scene.remove(ball.mesh);\n for (var i = 0; i < ROWS; i++)\n\t for (var j = 0; j < COLS; j++)\n\t scene.remove(blocks[i][j].object);\n //anddddd then reinitialize it all, i tried to just reinitialize and not remove and had some issues\n initGame();\n}", "function clear() {\r\n\t\t\t\tself.confirm_title ='Clear' ;\r\n\t\t\t\tself.confirm_type = BootstrapDialog.TYPE_WARNING;\r\n\t\t\t\tself.confirm_msg = self.confirm_title + ' the data?';\r\n\t\t\t\tself.confirm_btnclass = 'btn-warning';\r\n\t\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type,self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\t\t\tself.save = \"saveclose\";\r\n\t\t\t\t\t\t\t\t\treset();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t );\r\n\t\t\t}", "disposeAll() {\n let tilesBlocks = this.scene.getMeshesByTags('tilesBlock');\n\n for (let index = 0; index < tilesBlocks.length; index++) {\n tilesBlocks[index].dispose();\n }\n }", "function clearLS(){\n if(confirm(\"Are you sure you want to clear all saved cities?\")){\n localStorage.clear()\n cities.splice(0, cities.length)\n $(\".list-group\").empty()\n }\n }", "clear() {\n this._exec(CLEAR);\n return this._push(CLEAR);\n }", "clearWorkspace() {\n // REMOVE THE ITEMS\n for (let i = 0; i < 5; i++) {\n let item = document.getElementById(\"item-\" + (i+1));\n item.innerHTML = \"\";\n\n // When there's no items, they shouldn't be draggable\n item.draggable = false;\n }\n }", "function reset() {\n generateBlocks();\n active = false;\n changeSpeed(speed_modes.NORMAL);\n}", "static clearAll() {\n const manager = FocusRingManager.instance;\n manager.rings_.forEach(ring => {\n ring.rects = [];\n });\n manager.updateFocusRings_(null, null);\n }", "function clearBoard(){\n sendChatMessage(\"Clearing game board...\");\n lives = 1;\n current = 0;\n modifiers = [];\n board = [];\n sendChatMessage(\"Everything cleared! Ready for new game... Please rechoose tags.\");\n}", "function resetOnBlockChange() {\n var thereIsCode = mv.codeGen() == mv.CodeGen.blockly ? workspace.getAllBlocks().length > 0\n : codespace.getValue().length > 0;\n if (mv.curMode() == mv.modes.goal && !thereIsCode) return;\n // curPlaying is preview when there is no block.\n resetAll(mv, workspace, runnerObj);\n mv.changeStatus(mv.status.readyForRun); \n if (mv.curMode() == mv.modes.goal && thereIsCode) {\n mv.changeMode(mv.modes.program);\n }\n runnerObj.runner = setTimeout(autoRun, 1000);\n // Generate JavaScript code and parse it.\n }", "function cleanBlock(editor) {\n\t\tvar cm = editor.codemirror;\n\t\t_cleanBlock(cm);\n\t}", "function resetAll(){\n suicideCreeps();\n suicideInvader();\n resetMemory();\n return 'Reset all creeps, invaders and memory';\n}", "function cleanBlock(editor) {\n var cm = editor.codemirror;\n _cleanBlock(cm);\n}", "function cleanBlock(editor) {\n var cm = editor.codemirror;\n _cleanBlock(cm);\n}", "function reset(cb) {\n\tdel( 'build/**/*' ).then( function( paths ) {\n\t\tconsole.log( 'Deleted files and folders:\\n', paths.join( '\\n' ) );\n\t});\n\tcb();\n}", "function clear_all_data() {\n chrome.storage.sync.clear();\n}", "function cleanBlock(editor) {\n\tvar cm = editor.codemirror;\n\t_cleanBlock(cm);\n}", "function cleanBlock(editor) {\n\tvar cm = editor.codemirror;\n\t_cleanBlock(cm);\n}", "function cleanBlock(editor) {\n\tvar cm = editor.codemirror;\n\t_cleanBlock(cm);\n}", "function clearAll() {\n context.clearRect(-10, -10, 20, 20);\n}", "function clearAll() {\n \"use strict\";\n var clear_inputs = confirm( \"Are you sure you want clear all fields?\" );\n if ( clear_inputs ){\n first_num.value = null;\n second_num.value = null;\n symbol.value = null;\n result_num.value = null;\n sign_used = 0;\n\n }\n}", "function cleanBlock(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\t_cleanBlock(cm);\n\t\t}", "function clearAll () {\n\n heldValue = null;\n heldOperation = null;\n nextValue = null;\n\n}", "clearWorkspace() {\n this.ffauWorkspace.clear();\n }", "function clearList() {\n store.clearAll();\n output = \"All course registration are removed.\";\n document.getElementById('showInfo').innerHTML = output;\n}", "function clearAll() {\n\tdocument.getElementById(\"r1c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r1c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r1c3\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r2c3\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c1\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c2\").innerHTML = \"\";\n\tdocument.getElementById(\"r3c3\").innerHTML = \"\";\n}", "function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }", "function cleanBlock(editor) {\n _cleanBlock(editor.codemirror);\n}", "async clear() {\n if (this._store) await this._store.clear(this.name);\n this._undos = {};\n this._cells = {};\n }", "clear() {\n\n }", "clear() {\n\n }", "function forget(block) {\n\t// Existence filter\n\tif (!block) return;\n\n\t// Otherwise forget block\n\tBlockly.Events.disable();\n\tblock.dispose(true);\n\tworkspace.undoStack_ = workspace.undoStack_.filter((e) => e.blockId !== block.id);\n\tworkspace.redoStack_ = workspace.redoStack_.filter((e) => e.blockId !== block.id);\n\tBlockly.Events.enable();\n}", "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false;\n isFlagged = false;\n isMarked = false;\n isQuestion = false;\n neighborBombs = 0; } } } }", "static clearWorkspace() {\n Gamepad.workspace.clear();\n }", "function reset_all() {\n\t// Global variables\n\tactive_atom = null;\n\tatoms = [];\n\tbonds = [];\n\tformula_dict = {};\n\tformula = \"\";\n\n\t// Canvas stuff\n\tclear_canvas();\n\n\t// Right sidebar properties\n\t$(\"#prop\").find(\"section\").empty();\n\t// $(\"#neighbors\").empty();\n\t// $(\"#factor\").empty();\n\t// $(\"#formula\").empty();\n\n\t// Left selection sidebar\n\t$(\"input\").val(\"\");\n\t$(\"select\").val(\"default\");\n\t$(\"#bondBtn\").html(\"Add to canvas!\");\n\t$(\"#newAtom\").addClass(\"hidden\");\n\t$(\"#newGroup\").addClass(\"hidden\");\n\t$(\"#newRing\").addClass(\"hidden\");\n\t// Because the first atom doesn't need a bond\n\t$(\"#boSelect\").addClass(\"hidden\");\n\t$(\"#boSelectLabel\").addClass(\"hidden\");\n\n\t// Top toolbar\n\tdisable_pick_atom_to_erase();\n\tdisable_pick_bond();\n\tdisable_pick_ring_base();\n\tdisable_pick_atom_to_change();\n\tdisable_pick_atom_to_move();\n\n}", "clearList() {\n this.selection.owner.editorModule.onApplyList(undefined);\n }", "function clearWorkspace(){\n var len = 0;\n dashWorkspace.content = '';\n if(columns){\n len = columns.length;\n while(len--){\n dashWorkspace.remove(columns[len]);\n }\n }\n if(conditionals){\n len = conditionals.length;\n while(len--){\n dashWorkspace.remove(conditionals[len]);\n }\n }\n screen.render();\n}", "function ClearAll() {\n\tlocalStorage.clear();\n\tdoShowAll();\n}", "function ClearAll() {\n\tlocalStorage.clear();\n\tdoShowAll();\n}", "clear() {}", "clear() {}", "clear() {}", "function clearAll() {\n if (activeHighlight && activeHighlight.applied) {\n activeHighlight.cleanup();\n }\n activeHighlight = null;\n }", "function reset() {\n if (ref_div_main.children.length != 0) {\n for (let i = 0; i < (cant_bloques); i++) {\n ref_div_main.children[0].remove()\n }\n }\n blocksPositions = {}\n objArray = []\n first_row_index = []\n last_row_index = []\n ref_div_main.style.display = 'none'\n}", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "clear () { }", "function remBlock() {\n usedColors.splice(usedColors.length - 1);\n $(\".blockdisplay\").children().last().remove();\n fixAdd();\n findColor();\n}", "function clearComTasks() {\r\n //CLEAR TASKS FROM THE DOM\r\n while (completed.firstChild) {\r\n completed.removeChild(completed.firstChild);\r\n }\r\n //CLEAR TASKS FROM LOCAL STORAGE\r\n clearAllLS();\r\n}", "clear() {\n let count = this.tree.mTaskArray.length;\n if (count > 0) {\n this.tree.mTaskArray = [];\n this.tree.mHash2Index = {};\n this.tree.rowCountChanged(0, -count);\n this.tree.view.selection.clearSelection();\n }\n }", "function reset() {\n self.taskActionList([]);\n self.selectedTasklist([]);\n self.isTaskSelected(false);\n self.actionName('');\n self.actionComments('');\n self.showConfirmation('none');\n }", "clear() {\n this.$menu.html('');\n this.$form.html('');\n this.$preview.html(this.$empty);\n }", "function clearGame() {\n disableButton();\n clearForms();\n removeBunny();\n}", "function clearAll() {\n var tableBody = document.getElementById(\"historyTableBody\");\n tableBody.innerHTML = '';\n storageLocal.removeItem('stopWatchData');\n historyData = [];\n cachedData = [];\n stopButtonsUpdate();\n}", "function WipeBlocks() {\n blocks = new Uint8Array(cols * rows).fill(0);// contains all blocks\n movedAlready = new Uint8Array(cols * rows).fill(0);// skips over already moved through blocks\n}", "clearGridCoins({ commit }) {\n commit(CLEAR_GRID_COINS);\n }", "function clearOpChain() {\n opChain.length = 0;\n}", "function delete_storage(){\n\tsimact.Algebrite.run(\"clearall\");\n\tfilloutputarea();\n}", "function clearScreen() {\n\tlocs = [];\n\tnames = [];\n\tparentBonds = [];\n\tchildBonds = [];\n\tlastAction = [];\n\tundo();\n\tclearXY();\n}" ]
[ "0.7357635", "0.70252275", "0.692244", "0.692244", "0.6804593", "0.66938204", "0.6484614", "0.6483334", "0.6264242", "0.6258153", "0.6250678", "0.62446827", "0.6239094", "0.62057793", "0.6192085", "0.6157075", "0.61457103", "0.61273205", "0.61059386", "0.60769105", "0.6063118", "0.6047601", "0.59832597", "0.5982107", "0.5954166", "0.59243655", "0.59217626", "0.5890982", "0.58902436", "0.5884396", "0.5875353", "0.5874118", "0.58732283", "0.58718276", "0.58718276", "0.58710045", "0.58691657", "0.58668727", "0.58484334", "0.58481073", "0.5845399", "0.5839229", "0.5821797", "0.58204293", "0.5817619", "0.5816825", "0.581221", "0.58061016", "0.58042175", "0.5801489", "0.5798002", "0.578734", "0.5778388", "0.5774238", "0.5774238", "0.5773041", "0.57603586", "0.5759837", "0.5759837", "0.5759837", "0.57531065", "0.5752319", "0.5750913", "0.574996", "0.5749137", "0.5720086", "0.5707837", "0.5696492", "0.5695229", "0.5692074", "0.5686125", "0.5686125", "0.5685637", "0.56854934", "0.5685493", "0.5683471", "0.5677084", "0.56759197", "0.56743973", "0.56743973", "0.56724995", "0.56724995", "0.56724995", "0.5669724", "0.5668271", "0.5658976", "0.5658308", "0.56500375", "0.5648167", "0.56474584", "0.5647064", "0.5643842", "0.56415224", "0.56395555", "0.5638403", "0.563002", "0.56299967", "0.56251645", "0.5624264", "0.5622437" ]
0.58823514
30
compare function for args of type int
function compareTo(x, y) { x = parseInt(x, 10); y = parseInt(y, 10); if (x < y) return -1; else if (x > y) return 1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exComparator( int1, int2){\r\n if (int1 > int2){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function exComparator( int1, int2){\r\n if (int1 > int2){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function exComparator( int1, int2){\n if (int1 > int2){\n return true;\n } else {\n return false;\n }\n}", "function exComparator( int1, int2){\n if (int1 > int2){\n return true;\n } else {\n return false;\n }\n}", "function exComparator( int1, int2){\n if (int1 > int2){\n return true;\n } else {\n return false;\n }\n}", "function exComparator( int1, int2){\n if (int1 > int2){\n return true;\n } else {\n return false;\n }\n}", "function exComparator(int1, int2) {\n if (int1 > int2) {\n return true;\n } else {\n return false;\n }\n}", "function compareIntegers(value1, value2) {\n\treturn parseInt(value1) - parseInt(value2);\n} //end function compareIntegers", "function compareIntegers( value1, value2 ) \n{ \n return parseInt( value1 ) - parseInt( value2 );\n} // end function compareIntegers ", "function compareNumbers(x, y) {\n if (x < y) {\n return -1;\n }\n if (x > y) {\n return 1;\n }\n return 0;\n}", "function compareIntegers(a, b) {\n if (parseInt(a) < parseInt(b)) {\n return 'Less';\n } else if (parseInt(a) > parseInt(b)) {\n return 'Greater';\n } else {\n return 'Equal';\n }\n}", "function compareNumbers(a, b)\n{\n return a - b;\n}", "function compareIntegers(a, b) {\n return parseInt(a) > parseInt(b) ? 'greater' : parseInt(a) < parseInt(b) ? 'less' : 'equal'\n}", "function sc_lessEqual(x, y) {\n for (var i = 1; i < arguments.length; i++) {\n\tif (x > arguments[i])\n\t return false;\n\tx = arguments[i];\n }\n return true;\n}", "function compareNumbers(a, b){\n return a - b;\n }", "function compareNumbers(a, b) {\n return a - b;\n}", "function compareNumeric(a, b) {\n if (a > b) return 1;\n if (a < b) return -1;\n}", "function compareNumber(a, b) {\r\n return a - b;\r\n}", "function compareNumeric(a,b) {\n if (a > b) return 1;\n if (a == b) return 0;\n if (a < b) return -1;\n}", "function compareNumbers(a, b) {\n return a - b;\n}", "function compareNumbers(a, b) {\n return a - b;\n}", "function compareNumbers(a, b) {\n return a - b;\n}", "function compareFunc(a, b) {\n return a - b;\n }", "function compareNumbers(a, b) {\n return a - b;\n }", "function compareNumbers(a, b)\n {\n return a - b;\n }", "function numberCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compareNumbers(a, b) {\n\treturn a - b;\n}", "function compare(param1,param2){\n\tif(param1<param2){\n\t\treturn -1;\n\t}else if(param1>param2){\n\t\treturn 1;\n\t}else{\n\t\treturn 0;\n\t}\n}", "function CheckNums(num1,num2) { \r\n\r\n // code goes here \r\n if(num2>num1){\r\n return true;\r\n }else if(num2==num1){\r\n return -1;\r\n }else{\r\n return false;\r\n }\r\n \r\n}", "function checknumbers(x, y) { return x - y; }", "function compareNumeric(a, b) {\r\n return b - a;\r\n}", "function compareNumeric(a, b) {\n if (a > b) return 1;\n if (a < b) return -1;\n }", "function compare(a, b) {\n var aIsNum = typeof(a.ordinal) == 'number';\n var bIsNum = typeof(b.ordinal) == 'number';\n if (aIsNum && bIsNum) {\n return a.ordinal < b.ordinal ? -1 : (a.ordinal > b.ordinal ? 1 : 0);\n }\n else if(aIsNum) {\n return -1;\n }\n else if(bIsNum) {\n return 1;\n }\n else {\n return 0;\n }\n }", "function CompareNumbers(a, b){\n return a - b;\n }", "function comparenum(a,b)\n{\n if(a==b)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function CheckNums(num1,num2) {\n\nif ( num2 > num1 ) {\n return true\n}\n\nelse if (num1 == num2 ){\n return -1\n}\nelse\n\nreturn false\n\n}", "function CheckNums(num1,num2) { \n\n // code goes here \n \n var rtn = num2 > num1 ? true : num1 == num2 ? -1 : false; \n \n return rtn; \n \n}", "function compare(val1,val2){\n\treturn val1 - val2;\n}", "function NumberComparer(x, y) {\n return x - y;\n}", "function isEqualTo(number , compare = 10){\n instance.log(number + \" == \" + compare);\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}", "function compare(a,b) {\n return a - b;\n}", "function compare(a,b) {\n return a - b;\n}", "function compare(x, y) {\n if (x < y) return '-1';\n if (x === y) return '0';\n if (x > y) return '1';\n}", "function compareNumbersAsc(a, b) {\n \t\treturn a - b;\n\t}", "function m_compareN(a, b)\n{\n if(a>b)\n return a;\n else\n return b;\n}", "function compare(x, y) {\n return x - y;\n}", "function numberCompare(a, b) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}", "function numberCompare(a, b) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}", "function numberCompare(a, b) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}", "function sc_greaterEqual(x, y) {\n for (var i = 1; i < arguments.length; i++) {\n\tif (x < arguments[i])\n\t return false;\n\tx = arguments[i];\n }\n return true;\n}", "function compare (a, b) {\n if (a > b) {\n return 1\n }\n else if (a < b) {\n return -1\n }\n return 0\n \n }", "function myFunction( num1, num2){\n if (num1 < num2 ){\n console.log(num1)\n }\n else if (num1 > num2 ){\n console.log(num2)\n }\n }", "function numCompare(a, b) {\n return a - b;\n }", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}", "function compare(a, b) {\n if (a < b) {\n return -1\n } else if (b < a) {\n return 1\n } else {\n return 0\n }\n}", "function numberCompare(num1, num2){\n return num1 - num2\n}", "function checkNums(num1, num2) {\n\tif (num2 === num1) {\n\t\treturn '-1';\n\t} else {\n\t\treturn num2 > num1;\n\t}\n}", "function comp(_func, args) {\n\t \n let t = $math.chain($math.bignumber(args[0]));\n for (let i=1; i<args.length; i++) {\n t = t[_func]($math.bignumber(args[i]))\n\t\n }\n // 防止超过6位使用科学计数法\n return parseFloat(t.done()).toFixed(2)\n}", "function compare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}", "function comparisonNum(a, b) {\n\tif (a === b) { return true;}\n\t else if(a != b){ return false;}\n}", "function compare (a, b){\n return a > b;\n}", "function compare(a, b) {\n if (a>b) return 1;\n if (a<b) return -1;\n }", "function compare(n1, n2) {\n return n1 < n2 ? -1 : n1 == n2 ? 0 : 1;\n}", "function compare_asc(a, b) {\n return a - b;\n}", "function CheckNums(num1,num2) {\n\tif num1 < num2 {\n\t\treturn true;\n\t} else if num1 > num2 {\n\t\treturn false;\n\t} else {\n\t\treturn -1\n\t}\n}", "function compare(a, b) {\n return a - b;\n }", "function compare(a, b) {\n\t return a < b ? -1 : a > b ? 1 : 0;\n\t}", "function compare(a, b) {\n\t return a < b ? -1 : a > b ? 1 : 0;\n\t}", "function compare(value1, value2) {\n switch (value1 < value2) {\n case true:\n return -1;\n\n case false:\n return 1;\n\n default:\n return 0;\n\n }\n}", "function myFunction( num1,num2){\n if (num1<num2){\n console.log (\"number 1 is less then number 2\")\n }\n else {\n console.log (\" number 1 is not less then number 2\")\n }\n}", "function CheckNums(num1, num2) {\n if (num2 > num1) {\n return true;\n }\n else if (num2 < num1) {\n return false;\n }\n else {\n return -1;\n }\n}", "function CheckNums(num1, num2) {\n\n // We check if the first number is less than the second...\n if (num1 < num2) {\n // ...if so, we return true\n return true;\n // If the first number is greater than the second...\n } else if (num1 > num2) {\n // ...we return false\n return false;\n // If neither of the above conditions are true, we know that the numbers are equal...\n } else {\n // ...and so we return the string -1.\n return \"-1\";\n }\n\n}", "function myFunction( num1, num2){\n if (num1 > num2 ){\n console.log(num1)\n }\n else if (num1 < num2 ){\n console.log(num2)\n }\n }", "function compare(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n // a must be equal to b\n return 0;\n }", "function compare(a, b) {\n return b - a;\n}", "function match(a,b) { //creating a function to compare two numbers to see if they match\n if (a == b)\n return true;\n else\n return false;\n }", "function isInt(x) {\n var y=parseInt(x); \n if (isNaN(y)) return false; \n return x==y && x.toString()==y.toString(); \n }", "function greaterNum(int1, int2){\n if (int1, int2){\n alert(int1 + \" is the greater number!\")\n } else{\n alert(int2 + \" is the greater number!\")\n }\n}", "function compare(value1 ,value2)\n{\n if (value1.count<value2.count)\n {\n return 1;\n }\n else if (value1.count> value2.count)\n {\n return -1;\n }\n else{\n return 0;\n }\n \n}", "function equalsInt(x, y) {\n var i;\n if (x[0] != y)\n return 0;\n for (i = 1; i < x.length; i++)\n if (x[i])\n return 0;\n return 1;\n }", "function largerInteger(x,y) {\n if (x > y) {\n console.log(x + \" is larger than \" + y);\n } else {\n console.log(x + \" is less than \" + y);\n }\n return;\n}", "function compare(a, b) {\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n}", "function compare(a, b) {\n if (a.type !== 'InteractionSimple' || b.type !== 'InteractionSimple') {\n if (a.type === \"InteractionNative\" && b.type === \"InteractionNative\") {\n return ((_.isEqual(a.code, b.code)) ? (0) : (1));\n }\n return -1;\n }\n if (a.operator > b.operator) {\n return 1;\n } else {\n if (a.operator < b.operator) {\n return -1;\n } else {\n if (a.operand===undefined || a.operand===null || b.operand===undefined || b.operand===null) {\n if ((a.operand===undefined || a.operand===null) && (b.operand===undefined || b.operand===null)) {\n return 0;\n } else {\n return -1;\n }\n } else {\n if ((a.operand.length - b.operand.length) !== 0) {\n return (a.operand.length - b.operand.length);\n } else {\n var x = _.zip(a.operand, b.operand);\n var f = _.spread(compare);\n for (var i = 0; i < x.length; i++) {\n var res = f(x[i]);\n if (res !== 0) return res;\n }\n return 0;\n }\n }\n }\n }\n}" ]
[ "0.69550085", "0.69550085", "0.69342357", "0.69342357", "0.69342357", "0.69342357", "0.6898179", "0.64595217", "0.6458621", "0.6303674", "0.6269464", "0.6155361", "0.6142284", "0.6130069", "0.61173993", "0.6084174", "0.60786366", "0.607372", "0.60731894", "0.6064328", "0.6064328", "0.6064328", "0.60517555", "0.60510236", "0.60419506", "0.6031652", "0.6020447", "0.6016225", "0.6000128", "0.59841955", "0.5954949", "0.5931866", "0.59299463", "0.59116083", "0.59032655", "0.5883876", "0.58804065", "0.58415", "0.58404505", "0.5818097", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.581279", "0.58081037", "0.58081037", "0.57945836", "0.57941526", "0.57890886", "0.57843393", "0.57820964", "0.57820964", "0.57820964", "0.57803506", "0.5776508", "0.5768442", "0.5766677", "0.5763553", "0.5763553", "0.5763553", "0.5763553", "0.5763553", "0.57626516", "0.575939", "0.57566977", "0.57435644", "0.57375187", "0.572768", "0.5723198", "0.57211494", "0.5714003", "0.5710453", "0.57088846", "0.5706174", "0.57050174", "0.57050174", "0.57043266", "0.56974274", "0.5693015", "0.56838816", "0.56811714", "0.5677056", "0.56737334", "0.56678194", "0.56659025", "0.5664701", "0.5646421", "0.5644592", "0.56429493", "0.5637245", "0.5630411" ]
0.0
-1
put keyvalue pair into BST
put(key, val) { this.root = this.putHelper( this.root, key, val, this.rootX, this.rootY, this.rootDeltaX, this.rootDeltaY ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insert (key, value) {\n value = value || key;\n\n //leafs need to insert the value at themself and make new leaf children\n if(this.height == 0) {\n this.key = key;\n this.value = value || key;\n this.left = new BinarySearchTree(this);\n this.right = new BinarySearchTree(this);\n this.height = 1;\n this.numLeftChildren = 1;\n this.numRightChildren = 1;\n return;\n }\n\n if(key == this.key) return;\n\n if(key < this.key) {\n this.numLeftChildren++;\n this.left.insert(key);\n this.height = Math.max(this.height, 1 + this.left.height);\n }\n if(key >= this.key) {\n this.numRightChildren++;\n this.right.insert(key);\n this.height = Math.max(this.height, 1 + this.right.height);\n }\n\n this.rebalance();\n }", "insert(key, value) {\n this.root = this._insert(key, value, this.root);\n }", "insert(key, value) {\n //if the tree is empty => then key being inserted is the root node of the tree\n if (this.key == null) {\n this.key = key; \n this.value = value; \n }\n //if tree already exists => start at the root & compare it to key you want to insert\n //if new key is less than node's key then new node need to live in the left-hand branch\n else if (key < this.key) {\n if (this.left == null) {\n this.left = new BinarySearchTree(key, value, this);\n }\n else {\n //if node has existing left child => recursively call `insert` method\n //so node is added futher down the tree\n this.left.insert(key, value);\n }\n }\n //if new key is > than nodes' key => put it on the right side \n else {\n if (this.right == null) {\n this.right = new BinarySearchTree(key, value, this);\n }\n else {\n this.right.insert(key, value)\n }\n }\n }", "insert (key, value) {\n const newTree = this.tree.insert(key, value)\n\n // If newTree is undefined, that means its structure was not modified\n if (newTree) { this.tree = newTree }\n }", "insert(key, value) {\n if (this.key == null) {\n this.key = key;\n this.value = value;\n // If tree already exists, start at the root, and compare it to the key you want to insert.\n } else if (key < this.key) {\n // If the existing node does not have a left child (`left` pointer is empty), then instantiate and insert the new node as the left child of that node, passing `this` as the parent\n if (this.left == null) {\n this.left = new BinarySearchTree(key, value, this);\n // If the node has an existing left child, recursively call the `insert` method so the node is added further down the tree\n } else {\n this.left.insert(key, value);\n }\n // if the new key is greater than the node's key, recursively call the `insert` method so the node is added further down the tree, but on the right-hand side\n } else {\n this.right.insert(key, value);\n }\n }", "insert(key, value) {\n // if the tree is empty then this key being inserted is the root node of the tree\n if (this.key === null) {\n this.key = key;\n this.value = value;\n }\n /* If the existing node does not have a left child, \n meaning that if the `left` pointer is empty, \n then we can just instantiate and insert the new node \n as the left child of that node, passing `this` as the parent */\n else if (key < this.key) {\n if (this.left === null) {\n this.left = new BinarySearchTree(key, value, this)\n }\n /* If the node has an existing left child, \n then we recursively call the `insert` method \n so the node is added further down the tree */\n else {\n this.left.insert(key, value);\n }\n }\n // Similarly, if the new key is greater than the node's key then you do the same thing, but on the right-hand side */\n else {\n if (this.right == null) {\n this.right = new BinarySearchTree(key, value, this)\n } else {\n this.right.insert(key, value);\n }\n }\n }", "function bst({ root, key }) {\n if(!root) {\n root = { key };\n }\n else if (key < root.key) {\n root.left = bst({ root: root.left, key });\n }\n else {\n root.right = bst({ root: root.right, key });\n }\n return root;\n}", "insert (key, value) {\n // Empty tree, insert as root\n if (!Object.prototype.hasOwnProperty.call(this, 'key')) {\n this.key = key\n this.data.push(value)\n return\n }\n\n // Same key as root\n if (this.compareKeys(this.key, key) === 0) {\n if (this.unique) {\n const err = new Error(`Can't insert key ${key}, it violates the unique constraint`)\n err.key = key\n err.errorType = 'uniqueViolated'\n throw err\n } else this.data.push(value)\n return\n }\n\n if (this.compareKeys(key, this.key) < 0) {\n // Insert in left subtree\n if (this.left) this.left.insert(key, value)\n else this.createLeftChild({ key: key, value: value })\n } else {\n // Insert in right subtree\n if (this.right) this.right.insert(key, value)\n else this.createRightChild({ key: key, value: value })\n }\n }", "function put(root, node) {\n //Exit when null link is hit (leaf or node placed already)\n if(_.isNull(root)) { return node }\n\n //Traverse tree by values, updating links with inclusion of new node\n if (node.value < root.value) {\n root.left = put(root.left, node)\n } else if (node.value > root.value) {\n root.right = put(root.right, node)\n } else {\n root.value = node.value\n }\n\n //Update sizes and restore links\n root.size = 1 + size(root.left) + size(root.right);\n return root\n}", "insert(key) {\n\n const insertNode = (node, key) => {\n if(key < node.key) {\n if(node.left === null) {\n node.left = new Node(key)\n } else {\n return insertNode(node.left, key)\n }\n } else {\n if (node.right === null) {\n node.right = new Node(key)\n } else {\n return insertNode(node.right, key)\n }\n }\n }\n\n if( this.root === null ) {\n \n this.root = new Node( key )\n \n } else {\n return insertNode(this.root, key)\n }\n }", "add(key, value) {\n let newNode = new TreeNode(key, value);\n\n if (this.root === null) {\n this.root = newNode;\n } else {\n this.insertNode(this.root, newNode);\n }\n }", "insert(value) {\n if (value === this.key) {\n return;\n }\n\n if (value < this.key) {\n if (this.left) {\n return this.left.insert(value);\n }\n\n this.left = new Node(value);\n\n return value;\n }\n\n if (this.right) {\n return this.right.insert(value);\n }\n\n this.right = new Node(value);\n\n return value;\n }", "insert (key, value) {\n const insertPath = []\n let currentNode = this\n\n // Empty tree, insert as root\n if (!Object.prototype.hasOwnProperty.call(this, 'key')) {\n this.key = key\n this.data.push(value)\n this.height = 1\n return this\n }\n\n // Insert new leaf at the right place\n while (true) {\n // Same key: no change in the tree structure\n if (currentNode.compareKeys(currentNode.key, key) === 0) {\n if (currentNode.unique) {\n const err = new Error(`Can't insert key ${key}, it violates the unique constraint`)\n err.key = key\n err.errorType = 'uniqueViolated'\n throw err\n } else currentNode.data.push(value)\n return this\n }\n\n insertPath.push(currentNode)\n\n if (currentNode.compareKeys(key, currentNode.key) < 0) {\n if (!currentNode.left) {\n insertPath.push(currentNode.createLeftChild({ key: key, value: value }))\n break\n } else currentNode = currentNode.left\n } else {\n if (!currentNode.right) {\n insertPath.push(currentNode.createRightChild({ key: key, value: value }))\n break\n } else currentNode = currentNode.right\n }\n }\n\n return this.rebalanceAlongPath(insertPath)\n }", "set(key: K, val: V) {\n this.tree.remove([key, null]);\n this.tree.insert([key, val]);\n }", "_insert(key, value, root) {\n // Perform regular BST insertion\n if (root === null) {\n return new Node(key, value);\n }\n if (this.compare(key, root.key) < 0) {\n root.left = this._insert(key, value, root.left);\n }\n else if (this.compare(key, root.key) > 0) {\n root.right = this._insert(key, value, root.right);\n }\n else {\n return root;\n }\n // Update height and rebalance tree\n root.height = Math.max(root.leftHeight, root.rightHeight) + 1;\n const balanceState = this._getBalanceState(root);\n if (balanceState === 4 /* UNBALANCED_LEFT */) {\n if (this.compare(key, root.left.key) < 0) {\n // Left left case\n root = root.rotateRight();\n }\n else {\n // Left right case\n root.left = root.left.rotateLeft();\n return root.rotateRight();\n }\n }\n if (balanceState === 0 /* UNBALANCED_RIGHT */) {\n if (this.compare(key, root.right.key) > 0) {\n // Right right case\n root = root.rotateLeft();\n }\n else {\n // Right left case\n root.right = root.right.rotateRight();\n return root.rotateLeft();\n }\n }\n return root;\n }", "function set (p, key, value) {\n let n, r\n if (p !== null && p.branch === 0) { // found\n n = p.node\n r = Node (key, value, n.level, n.l, n.r)\n p = p.parent }\n else\n r = Node (key, value, 1, EMPTY, EMPTY)\n while (p !== null) {\n n = p.node\n r = (p.branch === RIGHT)\n ? Node (n.key, n.value, n.level, n.l, r)\n : Node (n.key, n.value, n.level, r, n.r)\n r = split (skew (r))\n p = p.parent }\n return r }", "insert(value) {\n if (value < this.value) {\n if (this.left === null) {\n this.left = new BinarySearchTree(value);\n } else {\n this.left.insert(value);\n }\n } else if (value > this.value) {\n if (this.right === null) {\n this.right = new BinarySearchTree(value);\n } else {\n this.right.insert(value);\n }\n }\n }", "function put(root, key, value, cb) {\n cb = cb || noop\n this.root = decode(root)\n key = decode(key)\n value = decode(value)\n this.put(key, value, function() {\n cb(null, encode(this.root))\n }.bind(this))\n}", "insert(value) {\n this.count++;\n let newNode = new Node(value)\n const searchTree = (node) => {\n // if value < node.value, go left\n if (value < node.value) {\n // if no left child, append new node\n if (!node.left) {\n node.left = newNode; \n // if left child, look left again\n } else {\n searchTree(node.left);\n }\n }\n // if value > node.value, go right\n if (value > node.value ) {\n // if no right child, append new node\n if (!node.right) {\n node.right = newNode;\n // if right child, look right again\n } else {\n searchTree(node.right);\n }\n }\n }\n searchTree(this.root);\n }", "insert(value) {\n let currentNode = this;\n while (true) {\n if (value < currentNode.value) {\n if (currentNode.left === null) {\n currentNode.left = new BST(value);\n break;\n } else {\n currentNode = currentNode.left;\n }\n } else {\n if (currentNode.right === null) {\n currentNode.right = new BST(value);\n break;\n } else {\n currentNode = currentNode.right;\n }\n }\n }\n return this;\n }", "constructor(key = null, value = null, parent = null) {\n this.key = key;\n this.value = value;\n this.parent = parent;\n this.left = null;\n this.right = null;\n }", "constructor(key = null, value = null, parent = null) {\n this.key = key;\n this.value = value;\n this.parent = parent;\n this.left = null;\n this.right = null;\n }", "insert(value) {\n const node = new BinarySearchTree(value);// create the new node\n // console.log(node);\n let current = this; // root node\n // console.log(current);\n let parent;\n while (true) { // keep looping over the tree until we find an empty tree that fits and call break\n // handle node value is less than current value\n parent = current;\n if (value < current.value) {\n current = current.left; // focus on left node\n if (current == null) { // node is empty, insert new node\n parent.left = node;\n break;\n }\n } else { // we focus on the right node for this iteration\n current = current.right; // move focus onto child right node\n if (current == null) {\n parent.right = node;\n break;\n }\n }\n }\n }", "put(key, value) {\n if (this.hashMap.get(key) === undefined) {\n let node = this.doublyLinkedList.addToHead({ key: key, val: value });\n this.hashMap.set(key, node);\n this.checkLLCapacity();\n } else {\n let node = this.hashMap.get(key);\n node.storage.val = value;\n this.doublyLinkedList.moveToHead(node);\n }\n }", "set(key, value) {\n if (!this.rootKey) {\n this.rootKey = key;\n this.rootValue = value;\n this.preReference = new SortedTreeMap(this.comparisonMethod, this);\n this.postReference = new SortedTreeMap(this.comparisonMethod, this);\n return value;\n }\n\n const comparisonResult = this.comparisonMethod(this.rootKey, key);\n if (comparisonResult < 0) {\n return this.preReference.set(key, value);\n } else if (comparisonResult > 0) {\n return this.postReference.set(key, value);\n } else {\n const result = this.rootValue;\n this.rootValue = value;\n return result;\n }\n }", "function BSTAdd(val){\n if (this.root == null){\n this.root = new BTNode(val);\n return;\n }\n var walker = this.root;\n while (walker.val != null){\n if (walker.val > val){\n if (walker.left == null){\n walker.left = new BTNode(val);\n return;\n }\n walker = walker.left;\n }\n else if (walker.val <= val){\n if (walker.right == null){\n walker.right = new BTNode(val);\n return;\n }\n walker = walker.right;\n }\n }\n }", "insert(value) {\n // Write your code here.\n // Do not edit the return statement of this method.\n let current = this;\n while (true) {\n if (value < current.value) {\n if (current.left === null) {\n current.left = new BST(value)\n break;\n } else {\n current = current.left\n }\n } else {\n if (current.right === null) {\n current.right = new BST(value)\n break;\n } else {\n current = current.right\n }\n }\n }\n return this;\n }", "_insert(node, value) {\n if (node === null) {\n return new Node(value, null, null);\n }\n\n // Passing to childnodes and update\n var side = ~~(value > node.value);\n node.children[side] = this._insert(node.children[side], value);\n\n // Keep it balance\n if (node.children[side].key < node.key) {\n return node.rotate(side);\n }\n return node.resize();\n }", "insert(value) { // delegate behaviors to the child trees\n // const nextTree = new BinarySearchTree(value);\n // console.log(this); // this === parent\n // console.log(nextTree); // nexxtTree === child\n // console.log(value); // the value we want to insert into the tree (make a new node with)\n\n if (value < this.value) {\n // is there a left\n if (this.left) { // the left node exists\n this.left.insert(value); // insert the value as the child of the this.left\n } else {\n this.left = new BinarySearchTree(value);\n }\n // this.left.insert(value);\n } else if (value > this.value) {\n if (this.right) {\n this.right.insert(value);\n } else {\n this.right = new BinarySearchTree(value);\n }\n }\n }", "insert(value) {\n let swapCompleted = false;\n const newNode = new BinarySearchTree(value);\n let root = this;\n \n while (!swapCompleted) {\n if (root.value >= value) {\n if (!root.left) {\n root.left = newNode;\n swapCompleted = true;\n }\n root = root.left;\n } else {\n if (!root.right) {\n root.right = newNode;\n swapCompleted = true;\n }\n root = root.right;\n } \n }\n return newNode; \n }", "remove(key) {\n if (this.key == key) {\n if (this.left && this.right) {\n const successor = this.right._findMin()\n this.key = successor.key; \n this.value = successor.key; \n successor.remove(successor.key)\n }\n //if node only has a left child => you'd replace the node with its left child\n else if (this.left) {\n this.replaceWith(this.left);\n }\n //if node only has right child => you'd replce the node with its right child \n else if (this.right) {\n this.replaceWith(this.right);\n }\n //if node has no children => remove it & any references to it by calling replaceWith(null)\n else {\n this._replaceWith(null);\n }\n }\n else if (key < this.key && this.left) {\n this.left.remove(key);\n }\n else if (key > this.key && this.right) {\n this.right.remove(key);\n }\n else {\n throw new Error('Key Error')\n }\n }", "insert(newData) {\n if (newData < this.data && this.left) {\n this.left.insert(newData)\n } else if (newData < this.data) {\n this.left = new BST(newData)\n }\n \n if (newData > this.data && this.right) {\n this.right.insert(newData)\n } else if (newData > this.data) {\n this.right = new BST(newData)\n }\n }", "insert(val) {\n // if there is no root values in the tree we should isnert one \n if(this.root === null){\n // create a new node\n this.root = new Node(val);\n // return the tree (which is what this is referring to)\n return this;\n }\n // if it has values then we should find a spot for it on the tree\n // very similar to searching for a value \n // have our current Node available if there is one\n let currentNode = this.root;\n // should run until the value is placed and the return statements will break us out of the loop\n while(true){\n // if the value of our current node is less than the value that we want to insert it will go to the right \n if(currentNode.val < val){\n // if there is no right value existing then we can create a new node to be the right value of the current node\n if(currentNode.right === null){\n currentNode.right = new Node(val);\n // we return the tree\n return this;\n // otherwise we have to traverse to the existing right node and then we check it again because the while loop wont break unless the value is inserted\n } else{\n currentNode = currentNode.right;\n }\n // this is the inverse where we insert values to the left\n } else if(currentNode.val > val){\n // if there is no left valye\n if(currentNode.left === null){\n // create a new node at the left valye\n currentNode.left = new Node(val);\n // return the tree\n return this;\n // otherwise we traverse to that node and the loop starts again \n } else{\n currentNode = currentNode.left;\n }\n }\n\n }\n }", "insert(val, currentNode=this.root) {\n // [] Check if the root exists\n if (!this.root) { \n // [] if it does not, then set the root to be a new TreeNode with the value\n this.root = new TreeNode(val);\n return\n }\n // [] Check if the val greater the currentNode\n // [] If the value is less than the current node\n if (val < currentNode.val) {\n // [] Check if a left node exists\n if (!currentNode.left) {\n // [] if it doesn't exist then insert it\n currentNode.left = new TreeNode(val);\n } else {\n // [] otherwise then recurse and call pass in currentNode.left\n this.insert(val, currentNode.left);\n }\n } else {\n // [] If the value is greater or equal to the current node\n // [] Check if a right node exists\n if (!currentNode.right){\n // [] if it doesn't exist then insert it\n currentNode.right = new TreeNode(val);\n } else {\n // [] otherwise then recurse and call pass in currentNode.right\n this.insert(val, currentNode.right);\n }\n }\n\n }", "insert(value) {\n const newNode = new Node(value);\n if (this.root === null) {\n this.root = newNode;\n return this;\n }\n let current = this.root;\n while (true) {\n if (value === current.value) return undefined;\n if (value < current.value) {\n if (current.left === null) {\n current.left = newNode;\n return this;\n }\n current = current.left;\n } else {\n if (current.right === null) {\n current.right = newNode;\n return this;\n }\n current = current.right;\n }\n }\n }", "insert(value) {\n if (this.value === null || this.value === undefined) {\n this.value = value;\n\n return this;\n }\n if (value < this.value) {\n if (this.left) {\n return this.left.insert(value);\n }\n const newNode = new BinarySearchTreeNodes(value);\n this.setLeft(newNode);\n this.left.parent = this;\n\n return newNode;\n } else if (value > this.value) {\n if (this.right) {\n return this.right.insert(value);\n }\n const newNode = new BinarySearchTreeNodes(value);\n this.setRight(newNode);\n this.right.parent = this;\n\n return newNode;\n }\n return this;\n }", "insert(val) {\n\t\tlet node = this.root;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set current node to root\n\t\t\n\t\tif (!node) { \t\t\t// if tree is empty, make a new node and have it be the root\n\t\t\tthis.root = new TreeNode(val);\n\t\t\treturn;\n\t\t}\n\n\t\twhile (node) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loop while node exists (not null)\n\t\t\tif (val < node.val) {\n\t\t\t\tif (!node.left) {\n\t\t\t\t\tnode.left = new TreeNode(val);\n\t\t\t\t} \n\t\t\t\tnode = node.left;\n\t\t\n\t\t\t} else {\n\t\t\t\tif (!node.right) {\n\t\t\t\t\tnode.right = new TreeNode(val);\n\t\t\t\t} \n\t\t\t\tnode = node.right;\n\t\t\t}\n\t\t}\n\t}", "_replaceWith(node) {\n if (this.parent) {\n if (this == this.parent.left) {\n this.parent.left = node;\n } else if (this == this.parent.right) {\n this.parent.right = node;\n }\n\n if (node) {\n node.parent = this.parent;\n }\n } else {\n if (node) {\n this.key = node.key;\n this.value = node.value;\n this.left = node.left;\n this.right = node.right;\n } else {\n this.key = null;\n this.value = null;\n this.left = null;\n this.right = null;\n }\n }\n }", "insertAfter(key, value) {\n if(this.head === null) {\n this.head = new _Node(value, this.head)\n }\n let currNode = this.head\n while(currNode !== null & currNode.value !== key) {\n currNode = currNode.next\n }\n currNode.next = new _Node(value, currNode.next)\n }", "insert(val) {\n // If we have an empty tree, insert new val at the root\n if(this.root === null){\n this.root = new Node(val);\n return this;\n }\n\n // If not we find the right spot for the node\n let current = this.root;\n while (true){\n if(val < current.val){\n if(current.left === null){\n current.left = new Node(val);\n return this;\n } else {\n current = current.left;\n }\n } else if(current.val < val){\n if(current.right === null) {\n current.right = new Node(val);\n return this;\n } else {\n current = current.right;\n }\n\n }\n }\n\n }", "insert(value) {\n let newNode = new Node(value);\n if (!this.root) {\n return this.root = newNode;\n } else {\n let current = this.root;\n while (current) {\n if (value < current.value) {\n if (!current.left) {\n return current.left = newNode;\n }\n current = current.left;\n } else {\n if (!current.right) {\n return current.right = newNode;\n }\n current = current.right;\n }\n }\n }\n }", "insert(value) {\n var newItem = new Node(value);\n\n if (this.root == null) {\n this.root = newItem;\n } else {\n this.insertItem(this.root, newItem);\n }\n\n return this; //Cascading/chaining\n }", "function inorder(node){\n if(!_.isNull(node.left)) inorder(node.left)\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n if(!_.isNull(node.right)) inorder(node.right)\n}", "insert(value){\n // if value is already in tree I won't add it, another option\n // can be keeping a frequency property for each node and increamenting\n // the value for every repeat\n\n let newNode = new Node(value);\n\n if(!this.root){\n this.root = newNode;\n return this;\n }\n\n let current = this.root;\n while(true){\n if(value === current.value) return undefined;\n if(value < current.value){ //go left\n if(!current.left){\n current.left = newNode;\n return this;\n }\n current = current.left;\n }else{ // go right\n if(!current.right){\n current.right = newNode;\n return this;\n }\n current = current.right;\n }\n }\n }", "push(node, process_node = this.numeric_ordinal) { // makes a BST by default\n if(process_node(node.val, this.val) && !this.right){\n this.right = node;\n return this;\n }\n if(!process_node(node.val, this.val) && !this.left){\n this.left = node;\n return this;\n }\n //if(process_node(node.val, this.val)) {\n // return this.push(node, process_node);\n //} else {\n this.push(node, process_node);\n //return this;\n //}\n }", "insert(value) {\n // Create a new node with the value passed\n let newNode = new Node(value);\n // Check edge case (if tree is empty)\n if (!this.root) {\n this.root = newNode;\n } else {\n // If edge case is not true, first set a current value, we always start with the node\n let previous = this.root;\n // We can set any statement here to loop that is true, I used while previous is true which is always true, we will break out of looping with the break keyword\n while (previous) {\n // If the value of the new node is less than the current node, then we either traverse down the left of the list, or we set the .left of the node to the new node. We do the second case if and only if the .left property is null. We cannot trasverse directly until we hit null because then we will end up just setting null to the node instead of appending to the list\n if ((value = previous.value)) return;\n if (newNode.value < previous.value) {\n if (!previous.left) {\n previous.left = newNode;\n break;\n } else {\n previous = previous.left;\n }\n } else {\n // Likewise for the explanation above, this is the same\n if (!previous.right) {\n previous.right = newNode;\n break;\n } else {\n previous = previous.right;\n }\n }\n }\n }\n // Finally return the binary search tree\n return this;\n }", "insertNode(root, value) {\n if (root === null) {\n this.root = new Node(value);\n return;\n }\n if (value < root.value) {\n if (root.left) {\n return this.insertNode(root.left, value);\n } else {\n root.left = new Node(value);\n return;\n }\n } else if (value > root.value) {\n if (root.right) {\n return this.insertNode(root.right, value);\n } else {\n root.right = new Node(value);\n return;\n }\n } else {\n return;\n }\n }", "function BinarySearchTree (value) {\n this.value = value\n this.left = null\n this.right = null\n}", "function postorder(node){\n if(!_.isNull(node.left)) postorder(node.left)\n if(!_.isNull(node.right)) postorder(node.right)\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n}", "constructor(root) {\n this.key = root;\n this.leftChild = null;\n this.rightChild = null;\n }", "insertKeyValuePair(key, value) {\r\n if (!(key in this.cache)) {\r\n if (this.currentSize === this.maxSize) {\r\n this.evictLeastRecent();\r\n } else {\r\n this.currentSize++;\r\n }\r\n this.cache[key] = new DoublyLinkedListNode(key, value);\r\n } else {\r\n this.replaceKey(key, value);\r\n }\r\n this.updateMostRecent(this.cache[key]);\r\n }", "function BinarySearchTree (value) {\n this.value = value;\n this.left = null;\n this.right = null;\n}", "insertRecursive(value){\n var newNode = new Node(value);\n if (traverse(this.root)) this.root = newNode;\n \n function traverse(current){\n if (current === null) return true;\n \n if (newNode.value > current.value) {\n if (traverse(current.right)) current.right = newNode;\n } else if (newNode.value < current.value) {\n if (traverse(current.left)) current.left = newNode;\n }\n \n return false;\n }\n \n return this;\n }", "insertKeyValuePair(key, value) {\n if (!(key in this.cache)) {\n if (this.currentSize === this.maxSize) {\n this.evictLeastRecent();\n } else {\n this.currentSize++;\n }\n this.cache[key] = new DoublyLinkedListNode(key, value);\n } else {\n this.replaceKey(key, value);\n }\n this.updateMostRecent(this.cache[key]);\n }", "insert(value) {\n const _insert = (node, value) => {\n if (this.root === null) {\n this.root = this.createNode(value)\n } else if (value === node.value) {\n console.error('only unique values')\n return false\n } else if (value < node.value) {\n // go Left\n // check for balence\n node.is_balenced = this.nodeIsBalenced(node)\n if (node.left === null) {\n node.left = this.createNode(value)\n return true\n } else {\n _insert(node.left, value) // step into next node\n }\n } else if (value > node.value) {\n // go right\n // check for balence\n node.is_balenced = this.nodeIsBalenced(node)\n if (node.right === null) {\n node.right = this.createNode(value)\n return true\n } else {\n _insert(node.right, value) // step into next node\n }\n } else {\n console.error('Logic Error in AllenTree Insert Method')\n }\n\n }\n return _insert(this.root, value)\n }", "insert(val) {\n const newNode = new Node(val);\n if(!this.root){\n this.root = newNode;\n return this; \n }\n\n let currentNode = this.root;\n while (currentNode) {\n if(currentNode.val > val){\n if(!currentNode.left) {\n currentNode.left = newNode;\n return this;\n }\n currentNode = currentNode.left;\n }else if(currentNode.val < val){\n if(!currentNode.right) {\n currentNode.right = newNode;\n return this;\n }\n currentNode = currentNode.right;\n }\n }\n }", "add(key: K, val: V) {\n var ok = this.tree.insert([key, val]);\n if (!ok) {\n throw \"Key was already present.\";\n }\n }", "insertNode(node, new_node) {\n // if the data is less than the node\n // data move left of the tree\n if (new_node.data < node.data) {\n if (node.left === null) {\n node.left = new_node;\n } else {\n //if left id not null\n //recurse until null is found\n this.insertNode(node.left, new_node);\n }\n } else {\n // if right is null insert node here\n if (node.right === null) {\n node.right = new_node;\n } else {\n //if right is not null\n //recurse until null is found\n this.insertNode(node.right, new_node);\n }\n }\n }", "function node(key) {\n var self = this;\n this.key = key;\n this.left = null;\n this.right = null;\n}", "add(val) {\n // If n is equal to current val\n // if there is no left property, add it there\n // if there is a left, but no right, add it there\n // if root, left, and right children are identical\n // run through same check on root left\n if (!val || !this.root || val === undefined) {\n return -1;\n }\n const root = this.root;\n if (val === root.value) {\n return `${val} is already present in tree`;\n }\n\n // if val is less than current val, place input val in left node path\n if (val < root.value) {\n if (!root.left) {\n root.left = new BinarySearchTree(val);\n } else {\n root.left.add(val);\n }\n }\n\n // if val is greater than current val, place input val in right node path\n if (val > root.value) {\n if (!root.right) {\n root.right = new BinarySearchTree(val);\n } else {\n root.right.add(val);\n }\n }\n }", "set(key, value) {\n let steps = key.split(\".\");\n let node = this._root;\n\n steps.slice(0, steps.length - 1).forEach((name) => {\n if(!node.hasOwnProperty(name)) {\n node[name] = {};\n }\n node = node[name];\n });\n node[steps[steps.length - 1]] = value;\n }", "insert(data) {\n //create a node and init the value\n let new_node = new Node(data);\n if (this.root == null) {\n this.root = new_node;\n } else {\n this.insertNode(this.root, new_node);\n }\n }", "add(value){\n let addNode = { value, left: null, right: null};\n\n // set the root if we don't have one\n if(this.root === null){\n this.root = addNode;\n return;\n }\n\n let current = this.root;\n\n while(true){\n // check for right\n if(value > current.value){\n // add right\n if(!current.right){ current.right = addNode; break; }\n\n current = current.right;\n\n // check for left\n } else if(value < current.value){\n // add left\n if(!current.left){ current.left = addNode; break; }\n\n current = current.left;\n } else {\n // if it's the same ignore\n break;\n }\n }\n }", "removekey(value) {\n\n this.root = this.remove(this.root, value)\n\n }", "bfs(tree, values = []) {\n const queue = new queue(); //Assuming a Queue is implemented\n const node = tree.root; \n queue.enqueue = tree.root; \n while (queue.length) {\n const node = queue.dequeue(); //remove from the queue\n values.push(node.value); //add that value from queue to an array\n\n if (node.left) {\n queue.dequeue(node.left) //add left child to the queue\n }\n if (node.right) {\n queue.enqueue(node.rigth) //add right child to the queue\n }\n return values; \n }\n }", "function preorder(node){\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n if(!_.isNull(node.left)) preorder(node.left)\n if(!_.isNull(node.right)) preorder(node.right)\n}", "add(k, v) {\n if (k.length > this.level) {\n // if the key length is greater, it belongs in a child node\n let char = k[this.level];\n\n // if there is no child node with the correct letter, create one\n if (!(char in this.children)) {\n this.children[char] = new Node(this.level + 1, this);\n }\n // add the key-value pair to the child\n this.children[char].add(k, v);\n } else {\n // if the key length is not greater, the value\n // must belong in this node (base case)\n this.values.push(v)\n }\n }", "insert(value) {\n this.head = new Node(value, this.head);\n }", "function BinarySearchTree(keys) {\n let Node = function(key) {\n this.key = key;\n this.left = null;\n this.right = null;\n };\n let root = null;\n let insertNode = (node, newNode) => {\n if (newNode.key < node.key) {\n if (node.left === null) {\n node.left = newNode;\n } else {\n insertNode(node.left, newNode);\n }\n } else {\n if (node.right === null) {\n node.right = newNode;\n } else {\n insertNode(node.right, newNode);\n }\n }\n };\n this.insert = key => {\n let newNode = new Node(key);\n if (root === null) {\n root = newNode;\n } else {\n insertNode(root, newNode);\n }\n };\n\n keys.forEach(key => {\n console.log(this);\n this.insert(key);\n });\n\n return root;\n}", "insertRecursively(val, currentNode=this.root) {\n if(this.root === null){\n // create a new node\n this.root = new Node(val);\n // return the tree (which is what this is referring to)\n return this;\n }\n if(currentNode.val < val){\n if(currentNode.right===null){\n currentNode.right = new Node(val);\n return this;\n }else{\n this.insertRecursively(val,currentNode.right)\n }\n } else if(currentNode.val > val){\n if(currentNode.left===null){\n currentNode.left = new Node(val);\n return this;\n }else{\n this.insertRecursively(val,currentNode.left)\n }\n }\n }", "put(key, value){\n /* WITHOUT SEPARATE CHAINING COLLISION HANDLING...\n var idx = this.hashFunction(key);\n console.log(idx + ' -> ' + key);\n this.table[idx] = value;\n */\n\n // WITH SEPARATE CHAINING...\n var position = this.hashFunction(key);\n\n if (this.table[position] == undefined){\n // if 1st element at the position (no collision yet) -> create a LL at that position...\n this.table[position] = new LinkedList();\n }\n // add the ValuePair instance to the LL using the LL-append method\n this.table[position].append(new ValuePair(key, value));\n\n\n }", "insertNode(node, newNode) {\n // if the value is less than the node\n // value move left of the tree\n if (newNode.value < node.value) {\n // if left is null insert node here\n if (node.left === null) {\n node.left = newNode;\n } else {\n // if left is not null recurr until\n // null is found\n this.insertNode(node.left, newNode);\n }\n } else {\n // if the value is more than the node\n // value move right of the tree\n // if right is null insert node here\n if (node.right === null) {\n node.right = newNode;\n } else {\n // if right is not null recurr until\n // null is found\n this.insertNode(node.right, newNode);\n }\n }\n return this;\n }", "treeInsert(x) {\n var node = this.root\n var y = NIL\n while (node !== NIL) {\n y = node\n if (x.interval.low <= node.interval.low) {\n node = node.left\n } else {\n node = node.right\n }\n }\n x.parent = y\n\n if (y === NIL) {\n this.root = x\n x.left = x.right = NIL\n } else {\n if (x.interval.low <= y.interval.low) {\n y.left = x\n } else {\n y.right = x\n }\n }\n\n applyUpdate.call(this, x)\n }", "insert(value, runner = this.root){\r\n if(runner == null){\r\n this.root = new BSNode(value);\r\n return this;\r\n }\r\n\r\n if(value >= runner.value) {\r\n if(runner.right == null){\r\n runner.right = new BSNode(value);\r\n return this;\r\n }\r\n return this.insert(value, runner.right);\r\n }\r\n else {\r\n if(runner.left == null) {\r\n runner.left = new BSNode(value);\r\n return this;\r\n }\r\n return this.insert(value, runner.left);\r\n }\r\n }", "insert(val) {\n this.array.push(val);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// push value to end of array (add node to farthest bottom left of tree)\n\n this.siftUp(this.array.length - 1);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// continuously swap value toward front of array to maintain maxHeap property\n }", "add(val) {\n let current = this.root;\n if (!current) {\n this.root = new Node(val);\n return;\n }\n\n while (current) {\n if (val < current.data) {\n if (!current.left) {\n current.left = new Node(val);\n break;\n }\n current = current.left;\n } else if (val >= current.data) {\n if (!current.right) {\n current.right = new Node(val);\n break;\n }\n current = current.right;\n }\n }\n }", "function BST(v) {\n this.root = this.node(v);\n}", "function BST(){\n\t\t//Default Properties\n\t\tthis.root = null;\n\t\tthis.tree = null;\n\n\t\t/************************************\n\t\t\t\tPrivate functions\n\t\t************************************/\n\t\tvar inOrder= function(obj, callback){\n\t if (obj){\n\n\t if (obj.left !== null){\n\t inOrder(obj.leftchild, callback);\n\t } \n\n\t callback.call(this,obj.element);\n\n\t if (obj.right !== null){\n\t inOrder(obj.rightchild, callback);\n\t }\n\t }\n\t }\n\n\t var preOrder = function(obj, callback){\n\t if (obj){\n\n\t \tcallback.call(this,obj.element);\n\n\t if (obj.left !== null){\n\t preOrder(obj.leftchild, callback);\n\t } \n\n\t if (obj.right !== null){\n\t preOrder(obj.rightchild, callback);\n\t }\n\t }\n\t }\n\n\t var postOrder = function(obj, callback){\n\t if (obj){\n\n\t if (obj.left !== null){\n\t postOrder(obj.leftchild, callback);\n\t } \n\n\t if (obj.right !== null){\n\t postOrder(obj.rightchild, callback);\n\t }\n\n\t callback.call(this,obj.element);\n\n\t }\n\t }\n\n\t /************************************\n\t\t\t\tExposed Functions\n\t\t************************************/\n\n\t\t//Add a new element\n\t\tthis.add = function(x){\n\t\t\tvar flag = true,\n\t\t\t\tdata = this.tree;\n\n\t\t\tif(this.root === null){\n\t\t\t\tthis.tree = {\n\t\t\t\t\telement : x,\n\t\t\t\t\tleftchild : null,\n\t\t\t\t\trightchild : null\n\t\t\t\t};\n\t\t\t\tthis.root = x;\n\t\t\t\tflag = false;\n\t\t\t}else{\n\t\t\t\twhile(flag){\n\t\t\t\t\tif(data.element === x){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else if(x > data.element){\n\t\t\t\t\t\tif(data.rightchild === null){\n\t\t\t\t\t\t\tdata.rightchild = {\n\t\t\t\t\t\t\t\telement : x,\n\t\t\t\t\t\t\t\tleftchild : null,\n\t\t\t\t\t\t\t\trightchild : null\t\t\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdata = data.rightchild;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(x < data.element){\n\t\t\t\t\t\tif(data.leftchild === null){\n\t\t\t\t\t\t\tdata.leftchild = {\n\t\t\t\t\t\t\t\telement : x,\n\t\t\t\t\t\t\t\tleftchild : null,\n\t\t\t\t\t\t\t\trightchild : null\t\t\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdata = data.leftchild;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t//Find whether element exist in exisiting BST\n\t\tthis.contains = function(x){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\twhile(flag){\n\t\t\t\tif(node != null){\n\t\t\t\t\tif(x === node.element){\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else if(x > node.element){\n\t\t\t\t\t\tnode = node.rightchildchild;\n\t\t\t\t\t}else if(x < node.element){\n\t\t\t\t\t\tnode = node.leftchildchild;\n\t\t\t\t\t}\t\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t//Find element in BST with minimum value\n\t\tthis.minValue = function(){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\t\tif(node != null){\n\t\t\t\t\twhile(flag){\n\t\t\t\t\t\tif(node.leftchildchild){\n\t\t\t\t\t\t\tnode = node.leftchildchild;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\treturn node.element;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t};\n\t\t//Find element in BST with maximum value\n\t\tthis.maxValue = function(){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\t\tif(node != null){\n\t\t\t\t\twhile(flag){\n\t\t\t\t\t\tif(node.rightchildchild){\n\t\t\t\t\t\t\tnode = node.rightchildchild;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\treturn node.element;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t};\n\t\t//Delete whole BST \n\t\tthis.removeTree = function(){\n\t\t\tthis.root = null;\n\t\t\tthis.tree = null;\n\t\t};\n\t\t//Traverse BST tree, you can traverse BST in inOrder,preOrder & postOrder fashion.\n\t\tthis.traversalTree = function(options,callback){\n\t\t\tvar obj = this.tree;\n\n\t\t\t//inOrder traversal\n\t\t\tif(options.type === \"inorder\"){\n\t\t inOrder(obj,callback);\n\t\t\t}\n\t\t\t//preOrder traversal\n\t\t\tif(options.type === \"preorder\"){\n\t\t preOrder(obj, callback);\n\t\t\t}\n\t\t\t//postOrder traversal\n\t\t\tif(options.type === \"postorder\"){\n\t\t postOrder(obj, callback);\n\t\t\t}\n\t\t};\n\t\t//Get BST size \n\t\tthis.size = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tsize = 0;\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t size = size+1;\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t inOrder(obj);\n\n\t return size;\n\t\t};\n\t\t//Convert BST tree to Array \n\t\tthis.toArray = function(type){\n\t\t\tvar obj = this.tree,\n\t\t\t\tarr = [],\n\t\t\t\tmethod = \"inorder\";\n\n\t\t\tif(!type){\n\t\t\t\ttype = method;\n\t\t\t}\n\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t arr.push(obj.element);\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t\t function preOrder(obj){\n\t\t if (obj){\n\n\t\t arr.push(obj.element);\n\n\t\t if (obj.left !== null){\n\t\t preOrder(obj.leftchild);\n\t\t } \n\n\t\t if (obj.right !== null){\n\t\t preOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t\t function postOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t postOrder(obj.leftchild);\n\t\t } \n\n\t\t \n\n\t\t if (obj.right !== null){\n\t\t postOrder(obj.rightchild);\n\t\t }\n\n\t\t arr.push(obj.element);\n\n\t\t }\n\t\t }\n\n\t\t if(type === \"inorder\"){\n\t \tinOrder(obj);\t\n\t\t\t}else if(type === \"preorder\"){\n\t\t\t\tpreOrder(obj);\n\t\t\t}else if(type === \"postorder\"){\n\t\t\t\tpostOrder(obj);\n\t\t\t}\n\t return arr;\n\t\t};\n\t\t//Convert BST tree to String\n\t\tthis.toString = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tarr = [];\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t // callback.call(this,obj.element);\n\t\t arr.push(obj.element);\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t //start with the root\n\t inOrder(obj);\n\n\t return arr.toString();\n\t\t};\n\t\t//Check maximum Depth in BST\n\t\tthis.maxDepth = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tsize = 0,\n\t\t\t\tPathArr = [],\n\t\t\t\ttraverseTopNode = false,\n\t\t\t\troot = this.root;\n\n\t\t\tfunction inOrder(obj){\n\n\t\t if (obj){\n\t\t \tif (obj.leftchild !== null){\n\t\t \t\tsize = size+1;\n\t\t inOrder(obj.leftchild);\n\t\t }else{\n\t\t \tPathArr.push(size);\n\t\t } \n\n\t\t if(obj.element === root){\n\t\t \t\ttraverseTopNode = true;\n\t\t \t\tsize = 1;\n\t\t \t}\n\t\t if (obj.rightchild !== null){\n\t\t size = size+1;\n\t\t inOrder(obj.rightchild);\n\n\t\t }else{\n\t\t \tPathArr.push(size);\n\t\t \tsize = size -1;\n\t\t }\n\n\t\t }else{\n\t\t \treturn 0;\n\t\t }\n\t\t }\n\n\t //start with the root\n\t inOrder(obj);\n\n\t PathArr.sort();\n\t PathArr.reverse();\n\t return PathArr[0];\n\t\t};\n\t\t//Remove element in BST\n\t\tthis.remove = function(value){\n\t \n\t var found = false,\n\t parent = null,\n\t node = this.tree,\n\t childCount,\n\t replacement,\n\t replacementParent;\n\t \n\t //make sure there's a node to search\n\t while(!found && node){\n\t \n\t //if the value is less than the node node's, go left\n\t if (value < node.element){\n\t parent = node;\n\t node = node.leftchild;\n\t \n\t //if the value is greater than the node node's, go right\n\t } else if (value > node.element){\n\t parent = node;\n\t node = node.rightchild;\n\t \n\t //values are equal, found it!\n\t } else {\n\t found = true;\n\t }\n\t }\n\t \n\t //only proceed if the node was found\n\t if (found){\n\t \n\t //figure out how many children\n\t childCount = (node.leftchild !== null ? 1 : 0) + (node.rightchild !== null ? 1 : 0);\n\t \n\t //special case: the value is at the root\n\t if (node === this.tree){\n\t switch(childCount){\n\t \n\t //no children, just erase the root\n\t case 0:\n\t this.tree = null;\n\t this.root = null;\n\t break;\n\t \n\t //one child, use one as the root\n\t case 1:\n\t this.tree = (node.rightchild === null ? node.leftchild : node.rightchild);\n\t break;\n\t \n\t //two children, little work to do\n\t case 2:\n\n\t //new root will be the old root's left child...maybe\n\t replacement = this.tree.leftchild;\n\t \n\t //find the right-most leaf node to be the real new root\n\t while (replacement.rightchild !== null){\n\t replacementParent = replacement;\n\t replacement = replacement.rightchild;\n\t }\n\t \n\t //it's not the first node on the left\n\t if (replacementParent !== null){\n\t \n\t //remove the new root from it's previous position\n\t replacementParent.rightchild = replacement.leftchild;\n\t \n\t //give the new root all of the old root's children\n\t replacement.rightchild = this.tree.rightchild;\n\t replacement.leftchild = this.tree.leftchild;\n\t } else {\n\t \n\t //just assign the children\n\t replacement.rightchild = this.tree.rightchild;\n\t }\n\t \n\t //officially assign new root\n\t this.tree = replacement;\n\t this.root = replacement.element;\n\t \n\t //no default\n\t \n\t } \n\n\t //non-root values\n\t } else {\n\t \n\t switch (childCount){\n\t \n\t //no children, just remove it from the parent\n\t case 0:\n\t //if the node value is less than its parent's, null out the left pointer\n\t if (node.element < parent.element){\n\t parent.leftchild = null;\n\t \n\t //if the node value is greater than its parent's, null out the right pointer\n\t } else {\n\t parent.rightchild = null;\n\t }\n\t break;\n\t \n\t //one child, just reassign to parent\n\t case 1:\n\t //if the node value is less than its parent's, reset the left pointer\n\t if (node.element < parent.element){\n\t parent.leftchild = (node.leftchild === null ? node.rightchild : node.leftchild);\n\t \n\t //if the node value is greater than its parent's, reset the right pointer\n\t } else {\n\t parent.rightchild = (node.leftchild === null ? node.rightchild : node.leftchild);\n\t }\n\t break; \n\n\t //two children, a bit more complicated\n\t case 2:\n\t \n\t //reset pointers for new traversal\n\t replacement = node.leftchild;\n\t replacementParent = node;\n\t \n\t //find the right-most node\n\t while(replacement.rightchild !== null){\n\t replacementParent = replacement;\n\t replacement = replacement.rightchild; \n\t }\n\t \n\t if (replacementParent.rightchild === replacement) {\n\t replacementParent.rightchild = replacement.leftchild;\n\t } else { \n\t //replacement will be on the left when the left most subtree\n\t //of the node to remove has no children to the right\n\t replacementParent.leftchild = replacement.leftchild;\n\t }\n\t \n\t //assign children to the replacement\n\t replacement.rightchild = node.rightchild;\n\t replacement.leftchild = node.leftchild;\n\t \n\t //place the replacement in the right spot\n\t if (node.element < parent.element){\n\t parent.leftchild = replacement;\n\t } else {\n\t parent.rightchild = replacement;\n\t } \n\t }\n\t \n\t }\n\t \n\t }else{\n\t \treturn false;\n\t } \n\t }\n\t}", "insertKey(k) {\n\n this.harr.push(k)\n let i = this.harr.length - 1\n\n let parentInd = this.parent(i)\n\n while (i != 0 && parentInd > harr[i]) {\n\n this.swap(i, parentInd)\n\n i = parentInd\n parentInd = this.parent(i)\n\n }\n\n }", "function BST(array) {\n this.root = null;\n for(var i=0;i<array.length;++i){\n \tthis.add(array[i]);\n }\n}", "insert(value) {\n const newNode = new Node(value);\n if (!this.root) {\n this.root = newNode;\n return this;\n } \n // traverse it as if you would traverse a linked list\n let current = this.root;\n while (true) {\n // if duplicates are not handled, ill get an infinite loop!\n if (value === current.value) {\n return undefined;\n }\n if (value > current.value) {\n if (!current.right) {\n current.right = newNode;\n return this;\n }\n // update current if there is already a right\n current = current.right;\n } else {\n if (!current.left) {\n current.left = newNode;\n return this;\n }\n // update current if there is already a left\n current = current.left;\n }\n }\n }", "insertBefore(key, value) {\n if(this.head === null) {\n this.head = new _Node(value, this.head)\n } else {\n let currNode = this.head\n let prevNode = this.head\n while(currNode !== null && currNode.value !== key) {\n prevNode = currNode\n currNode = currNode.next\n }\n prevNode.next = new _Node(value, currNode)\n }\n }", "changeKey(node, newKey) {\n this._treapDelete(node);\n let goLeft = newKey < node.key;\n node.key = newKey;\n\n let parent = node.parent;\n\n // was previously root, so has no parent\n if (parent === NIL) {\n parent = this.root;\n } else {\n if (goLeft) {\n while (parent !== this.root && node.key < parent.key) {\n parent = parent.parent;\n }\n } else {\n while (parent !== this.root && node.key > parent.key) {\n parent = parent.parent;\n }\n }\n }\n // insert will take care of getting new parent\n this._treeInsert(parent, node);\n this._heapFixUp(node);\n }", "insert(key, value) {\n let index = this.makeHash(key);\n let bucket = this.storage[index];\n let item = new Node(key, value);\n \n // Create a new bucket if none exist\n if (!bucket) {\n bucket = new List(item);\n this.storage[index] = bucket; \n bucket.count++;\n this.count++;\n \n return 'New bucket created';\n } \n else {\n let current = bucket.head;\n \n // If the head has null next it is there is only one node in the list\n if (!current.next) {\n current.next = item;\n }\n else {\n // move to the end of the list\n while(current.next) {\n current = current.next;\n }\n \n current.next = item;\n }\n bucket.count++;\n this.count++;\n \n return 'New item placed in bucket at position ' + bucket.count;\n }\n }", "insertNewNode(root, node){\n /*\n ** [6, 53, 5, 3, 50]\n ** -> root = 6. -> insertNewNode(6, 53) -> { \n root: { \n data: 6, \n left: null, \n right: { \n data: 53, \n left: null, \n right: null \n } \n }\n } (1st Iteration)\n ** -> root = 6 -> insertNewNode(6, 5) -> {\n root: {\n data: 6,\n left: {\n data: 5,\n left: null,\n right: null\n },\n right: { \n data: 53, \n left: null, \n right: null \n } \n }\n } (2nd Iteration)\n ** -> root = 6 -> insertNewNode(6, 3) -> duplicate left node -> insertNewNode(5, 3) -> {\n root: {\n data: 6,\n left: { \n data: 5, \n left: { \n data: 5, \n left: { data: 3, left: null, right: null }, \n right: null \n }\n },\n right:{\n data: 53,\n left: null,\n right: null\n }\n }\n } (3rd Iteration)\n ** -> root = 6, insertNewNode(6, 50) -> duplicate right node -> \n insertNewNode(53, 50) -> insert into left position since 50 is less than of the root at the current level. -> {\n root: {\n data: 6,\n left: {\n data: 5,\n left: {\n data: 3,\n left: null, \n right: null\n }\n right:null\n },\n right: {\n data: 53,\n left: {\n data: 50,\n left: null,\n right: null\n },\n right: null\n } \n }\n }\\(4th iteration)\n */\n if(node.data < root.data) {\n if(!root.left) return root.left = node;\n return this.insertNewNode(root.left, node);\n }\n\n if(root.data < node.data) {\n if(!root.right) return root.right = node;\n return this.insertNewNode(root.right, node);\n }\n }", "add(key, value = key) {\n const node = new HeapNode(key, value);\n const i = this.store.push(node) - 1;\n this.heapUp(i);\n // console.log(this.store);\n }", "insertRecursively(val, currentNode=this.root) {\n const newNode = new Node(val);\n if(!this.root){\n this.root = newNode;\n return this; \n }\n if(!currentNode) return 0;\n if(currentNode.val > val){\n if(!currentNode.left) {\n currentNode.left = newNode;\n return this;\n }\n this.insertRecursively(val, currentNode.left);\n }else if(currentNode.val < val){\n if(!currentNode.right) {\n currentNode.right = newNode;\n return this;\n }\n this.insertRecursively(val, currentNode.right);\n }\n }", "insert(value) {\n\t\tlet newNode = new Node(value);\n\n\t\t// If root empty, set new node as the root\n\t\tif (!this.root) {\n\t\t\tthis.root = newNode;\n\t\t} else {\n\t\t\tthis.insertNode(this.root, newNode);\n\t\t}\n\t}", "remove(key) {\n if (this.key == key) {\n if (this.left && this.right) {\n const successor = this.right._findMin();\n this.key = succesor.key;\n this.value = succesor.value;\n successor.remove(successor.key);\n }\n // If node only has a left child, then replace the node with its left child\n else if (this.left) {\n this._replaceWith(this.left);\n } else if (this.right) {\n this._replaceWith(this.right);\n }\n // If node has no children, then simply remove it and any references to it\n else {\n this._replaceWith(null);\n }\n } else if (key < this.key && this.left) {\n this.left.remove(key);\n } else if (key > this.key && this.right) {\n this.right.remove(key);\n } else {\n throw new Error(\"Key error\");\n }\n }", "add(k, v) {\n this.root.add(k, v);\n }", "add(value) {\n if (this.root === null) {\n this.root = new TreeNode(value)\n } else {\n this._add(this.root, value)\n }\n }", "write(key, value){\n this.ensureLimit();\n\n if(!this.head){\n this.head = this.tail = new Node(key, value);\n }else{\n const node = new Node(key, value, this.head.next);\n this.head.prev = node;\n this.head = node;\n }\n\n //Update the cache map\n this.cache[key] = this.head;\n this.size++;\n }", "function treeSetValue(tree, value) {\n tree.node.value = value;\n treeUpdateParents(tree);\n}", "insert(node){\n /*\n ** Upon the insertion of the element\n ** Initialize new node instance.\n ** if the root is null, insert element to the root.\n ** The insertNewNode helper function\n *** else if the root node is less than the node to be inserted, set the left element.\n *** else if the root node is greater than the node to be inserted, set the right element.\n */\n const newNode = new Node(node);\n if(!this.root) return this.root = newNode;\n //Use insertNewNode helper function to find current position in the binary and insert new node.\n else this.insertNewNode(this.root, newNode);\n }", "insert(value){\n if (this.head === null){\n this.head = new Node(value);\n }\n }", "addNode(val) {\n var newNode = new BSTNode(val); // Define new node\n // If the tree is empty, make this new node the root node\n if (this.root == null) {\n this.root = newNode;\n return this;\n }\n var runner = this.root; // Runner pointing to the current node, starting at the root\n // Loop to traverse the tree\n while (runner != null) {\n if (val > runner.val) { ;// If value is bigger than current node, move right\n if (runner.right == null) { // If no node to the right, insert there\n runner.right = newNode;\n break; // No need to go further - we've added the node\n } else { // Node already found to the right, so move runner\n runner = runner.right;\n }\n } else { // Otherwise, move left\n if (runner.left == null) { // If no node to the left, insert there\n runner.left = newNode;\n break; // No need to go further - we've added the node\n } else { // Node already found to the left, so move runner\n runner = runner.left;\n }\n }\n }\n return this;\n }", "insertAutomatic(node,key,scene) {\n\n if (node.key == 'null') {\n\n node.setKey(key);\n node.setNodeGraphics();\n\n // // create left child\n // var childL = new NodeBST(scene, node.posX-this.w, node.posY+this.z, 'null',node.dpth+1,node);\n // childL.distanceFromParent = -this.w;\n \n // // create right child\n // var childR = new NodeBST(scene, node.posX+this.w, node.posY+this.z, 'null',node.dpth+1,node);\n // childR.distanceFromParent = this.w;\n\n // node.setChildren(childL,childR);\n\n if (this.isRB) {\n\n if (node != this.root) {\n node.isRed = true;\n }\n node.changeLinkColour(scene);\n\n // create left child\n var childL = new NodeBST(scene, this.nodeColor, node.posX-this.w, node.posY+this.z, 'null',node.dpth+1,node,true);\n childL.distanceFromParent = -this.w;\n \n // create right child\n var childR = new NodeBST(scene, this.nodeColor, node.posX+this.w, node.posY+this.z, 'null',node.dpth+1,node,true);\n childR.distanceFromParent = this.w;\n\n node.setChildren(childL,childR);\n\n this.nodearray.push(childL);\n this.nodearray.push(childR);\n\n // update depth of the tree\n if (childL.dpth > this.treedpth) {\n this.treedpth = childL.dpth;\n }\n\n this.checkRBLinksInserted(scene,node);\n this.check(scene);\n\n } else {\n\n // create left child\n var childL = new NodeBST(scene, this.nodeColor, node.posX-this.w, node.posY+this.z, 'null',node.dpth+1,node,false);\n childL.distanceFromParent = -this.w;\n \n // create right child\n var childR = new NodeBST(scene, this.nodeColor, node.posX+this.w, node.posY+this.z, 'null',node.dpth+1,node,false);\n childR.distanceFromParent = this.w;\n\n node.setChildren(childL,childR);\n\n this.checkCollisions(childL);\n \n this.checkCollisions(childR);\n \n // update depth of the tree\n if (childL.dpth > this.treedpth) {\n this.treedpth = childL.dpth;\n }\n \n // this.traverseAndCheckCollisions(scene);\n this.traverseAndCheckCrossings(scene);\n this.traverseAndCheckCollisions(scene);\n }\n\n } else if (node.key > key) {\n if (node.left != null) { // we might not need this if statement check cause we dont have a node.left that is null\n this.insertAutomatic(node.left, key, scene);\n }\n } else if (node.key < key) {\n if (node.right != null) {\n this.insertAutomatic(node.right, key, scene);\n }\n }\n }", "insertRecursively(val, current = this.root) {\n // If the tree is empty insert at the root.\n if (this.root === null) {\n this.root = new Node(val);\n return this;\n }\n\n // If not we find the right spot for the new val\n // recursively\n\n if(val < current.val){\n if(current.left === null){\n current.left = new Node(val);\n return this;\n } else {\n this.insertRecursively(val, current = current.left);\n }\n } else if(current.val < val){\n if(current.right === null) {\n current.right = new Node(val);\n return this;\n } else {\n this.insertRecursively(val, current = current.right);\n }\n\n }\n\n }", "function orderTest() {\n const BST = new BinarySearchTree();\n [25, 15, 50, 10, 24, 35, 70, 4, 12, 18, 31, 44, 66, 90, 22].forEach(num => {\n BST.insert(num, num);\n });\n //console.log(inOrder(BST));\n //console.log(preOrder(BST));\n //console.log(postOrder(BST));\n}", "add(val) {\n const q = new Queue();\n let current = this.root;\n if (!current) {\n this.root = new Node(val);\n return;\n }\n q.enqueue(current);\n while (q.peek()) {\n current = q.dequeue();\n if (!current.left) {\n current.left = new Node(val);\n return;\n }\n if (!current.right) {\n current.right = new Node(val);\n return;\n }\n q.enqueue(current.left);\n q.enqueue(current.right);\n }\n }" ]
[ "0.76697665", "0.75830215", "0.756652", "0.74670446", "0.7416154", "0.7303209", "0.72141135", "0.7160151", "0.70765877", "0.7041104", "0.702723", "0.69686866", "0.6964511", "0.6914944", "0.69114923", "0.6900008", "0.68844813", "0.6643288", "0.6639078", "0.66138464", "0.65566987", "0.65566987", "0.6530314", "0.6516626", "0.6502536", "0.6462821", "0.64345807", "0.6418217", "0.63904464", "0.63823444", "0.63762206", "0.6337861", "0.6323598", "0.6281495", "0.6245319", "0.6239409", "0.6233689", "0.621079", "0.6210321", "0.61759424", "0.61629355", "0.61428607", "0.613411", "0.61248654", "0.6106682", "0.6093777", "0.60916215", "0.6086638", "0.60383594", "0.6015294", "0.600305", "0.60025305", "0.599448", "0.5973248", "0.5972958", "0.59668607", "0.59511286", "0.5951111", "0.5937983", "0.5928876", "0.58997077", "0.5897887", "0.5896361", "0.5879311", "0.5878695", "0.5876509", "0.58687675", "0.5868418", "0.5852305", "0.5852259", "0.5847284", "0.58400995", "0.58293253", "0.57968134", "0.579643", "0.57954276", "0.5792265", "0.5782292", "0.5769718", "0.5769352", "0.5768112", "0.5766775", "0.57630974", "0.57516956", "0.5749689", "0.5736908", "0.57326734", "0.5727491", "0.57264817", "0.57078725", "0.56851", "0.56776285", "0.5676856", "0.5668735", "0.5660071", "0.56545633", "0.56463575", "0.5644935", "0.56276286", "0.561921" ]
0.6780852
17
whether bst contains given key
contains(key) { return this.getAnimated(key) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(key) {\n let current = this.head;\n while(current.object != key) {\n current = current.next;\n if(current == null)\n return false;\n }\n return true;\n }", "contains(key)\n\t{\n\t\tkey = this.toString(key);\n\t\treturn super.has(key);\n\t}", "async has(key) {}", "has(key) {\n return this.keys.indexOf(key) > -1;\n }", "has(key: K): boolean {\n return this.tree.find([key, null]) != null;\n }", "hasKey(key) {\n return this.id2Value[key.id] != null;\n }", "contains(key) {\n key = binding_key_1.BindingKey.validate(key);\n return this.registry.has(key);\n }", "function sc_hashtableContains(ht, key) {\n var hash = sc_hash(key);\n if (hash in ht)\n\treturn true;\n else\n\treturn false;\n}", "has (key) {\n return this.keys.has(key)\n }", "has(k) {\n return k in this.kvStore;\n }", "has(key) {\n return this._has(this._translateKey(key));\n }", "contains(KEY)\n {\n // Local variable dictionary\n let keyFound = false; // Flag if found the key in dictionary\n\n // Find the key\n if (arguments.length > 1)\n {\n throw new Error(\"Too many arguments\");\n }\n else if (arguments.length < 1)\n {\n throw new Error(\"Too few arguments\");\n }\n else if (!(KEY instanceof Hashable))\n {\n throw new Error(\"Invalid type\");\n }\n else\n {\n // Local variable dictionary\n let hashIndex = KEY.hashVal() % this.#table.getLength();\n\n // Find if the key exists in the table and get the value\n let listIndex = this.#table.peekIndex(hashIndex);\n for (let counter = 0; counter < listIndex.getLength() && keyFound === false; counter++)\n {\n // Get the hash entry\n let hashEntry = listIndex.peekIndex(counter);\n\n // Check if it is the same key\n if (hashEntry.key.key === KEY.key)\n {\n keyFound = true;\n }\n }\n }\n\n // Return flag if the key found\n return keyFound;\n }", "has(key)\n\t{\n\t\tkey = this.toString(key);\n\t\treturn super.has(key);\n\t}", "has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }", "has(key) {\n\t\treturn key in this.collection;\n\t}", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }", "containsKey(key) {\n return this.getKeys().includes(key);\n }", "hasKey(key) {\n return this.store.hasOwnProperty(key);\n }", "isBound(key) {\n if (this.contains(key))\n return true;\n if (this._parent) {\n return this._parent.isBound(key);\n }\n return false;\n }", "exists(key) {\n let found = true;\n let current = this._root;\n\n key.split(\".\").forEach((name) => {\n if(current && found) {\n if(current.hasOwnProperty(name)) {\n current = current[name];\n } else {\n found = false;\n }\n }\n });\n\n return(found);\n }", "has(key) {\n return this._.has(key);\n }", "function BOT_matchKey(ref,key) {\r\n\tif(BOT_isArray(ref)) return (BOT_member(ref, key))\r\n\telse if(ref == key) return true\r\n\telse return false\r\n}", "has(key) {\n return identity.isCollection(this.contents) ? this.contents.has(key) : false;\n }", "has(key) {\n return isCollection(this.contents) ? this.contents.has(key) : false;\n }", "function contains(arr, key, val) {\n for (var i = 0; i < arr.length; i++) {\n if(arr[i][key] === val) return true;\n }\n return false;\n }", "function has(key) /*: boolean*/ {\n\t var val = this.node && this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function has(key) /*: boolean*/ {\n\t var val = this.node && this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "function contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "function contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "function contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "function contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "contains(data) {\n return this.findBFS(data) ? true : false;\n }", "static hasHead(key) {\n return Object.keys(this.heads).includes(key);\n }", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function IsInHash(object, key) {\n\treturn key in object;\n}", "function has(object, key) {\n let newArray =Object.keys(object);\n for (let i = 0; i < newArray.length; i++) {\n if(newArray[i]===key) {\n return true;\n } \n \n }\n return false;\n}", "function has(key) {\n\t var val = this.node && this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "has(obj, key){\n if ( obj.hasOwnProperty(key) ) {\n return true;\n } else return false;\n }", "hasKey(name) {\n if (name in this.values) {\n return true;\n }\n for (let i in this.subspacesById) {\n if (this.subspacesById[i].hasKey(name)) {\n return true;\n }\n }\n return false;\n }", "function has(key) {\n\t var val = this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function has(key) {\n\t var val = this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function has(key) {\n var val = this.node[key];\n if (val && Array.isArray(val)) {\n return !!val.length;\n } else {\n return !!val;\n }\n}", "function contains$2(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "has(object, key){\n \n // To access the current value at specified key\n const hasValue = object['key'];\n \n if(hasValue != undefined ){\n return true;\n } else {\n return false;\n }\n }", "async has (key) {\n let result = await this.client.get(this.namedKey(key));\n return !!result;\n }", "has(k) {\n return Object.keys(this.cache).indexOf(k) > -1;\n }", "function hasKey(n,t){var o=n;return t.slice(0,-1).forEach(function(n){o=o[n]||{}}),t[t.length-1]in o}", "function mutationQueuesContainKey(txn, docKey) {\n var found = false;\n return mutationQueuesStore(txn).iterateSerial(function (userId) {\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\n if (containsKey) {\n found = true;\n }\n\n return PersistencePromise.resolve(!containsKey);\n });\n }).next(function () {\n return found;\n });\n }", "function has(obj, key) {\n return key in obj\n}", "function mutationQueuesContainKey(txn, docKey) {\r\n var found = false;\r\n return mutationQueuesStore(txn)\r\n .iterateSerial(function (userId) {\r\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\r\n if (containsKey) {\r\n found = true;\r\n }\r\n return PersistencePromise.resolve(!containsKey);\r\n });\r\n })\r\n .next(function () { return found; });\r\n}", "function mutationQueuesContainKey(txn, docKey) {\r\n var found = false;\r\n return mutationQueuesStore(txn)\r\n .iterateSerial(function (userId) {\r\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\r\n if (containsKey) {\r\n found = true;\r\n }\r\n return PersistencePromise.resolve(!containsKey);\r\n });\r\n })\r\n .next(function () { return found; });\r\n}", "function mutationQueuesContainKey(txn, docKey) {\r\n var found = false;\r\n return mutationQueuesStore(txn)\r\n .iterateSerial(function (userId) {\r\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\r\n if (containsKey) {\r\n found = true;\r\n }\r\n return PersistencePromise.resolve(!containsKey);\r\n });\r\n })\r\n .next(function () { return found; });\r\n}", "contains(data) {\n return this.find(data) !== -1 ? true : false\n }", "contains(value) {\n var currentNode = this.head;\n while(currentNode !== null) {\n if(value === currentNode.data) {\n return true;\n }\n currentNode = currentNode.next;\n }\n return false;\n }", "contains(entity) {\n const id = this.id(entity);\n return this.has(id) && this.get(id) === entity;\n }", "function mutationQueuesContainKey(txn, docKey) {\n var found = false;\n return mutationQueuesStore(txn)\n .iterateSerial(function (userId) {\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\n if (containsKey) {\n found = true;\n }\n return PersistencePromise.resolve(!containsKey);\n });\n })\n .next(function () { return found; });\n}", "function _has(obj, key) {\n\t return Object.prototype.hasOwnProperty.call(obj, key);\n\t }", "has(myObject, myKey){\r\n let hasValue = myObject.myKey;\r\n //store the key, value pairs of the object.\r\n if (hasValue != 'undefined'){\r\n \t\t// return true if the key is undefined\r\n return true;\r\n }\r\n for (let i = 0; i < myObject.length; i++){\r\n\t\t\t// check if the key is within the object\r\n // return the boolean status accordingly.\r\n if (myObject[0] === myKey){\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n } // for loop for objects\r\n }", "function mutationQueuesContainKey(txn, docKey) {\n var found = false;\n return mutationQueuesStore(txn).iterateSerial(function (userId) {\n return mutationQueueContainsKey(txn, userId, docKey).next(function (containsKey) {\n if (containsKey) {\n found = true;\n }\n\n return PersistencePromise.resolve(!containsKey);\n });\n }).next(function () {\n return found;\n });\n}", "__key_in_object(object, key) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n return true\n } else {\n return false\n }\n }", "function eventExistsInTimeline(key) {\n for (var i = 0; i < $rootScope.sortedEventList.length; i++) {\n if ($rootScope.sortedEventList[i].$id && $rootScope.sortedEventList[i].$id == key) {\n return true;\n }\n }\n return false;\n }", "contains(obj)\r\n {\r\n var list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n if (list[j].data === obj) return true;\r\n }\r\n return false;\r\n }", "has(key) {\n const value = this._map.get(key);\n const result = value && value.getTime() > Date.now();\n log.map(\"Key '%s' is present in the map? -> %s\", key, result);\n return result;\n }", "has(key) {\n return this.map[key] !== undefined;\n }", "has(key) {\n return this.items[key]\n && this.items[key].created > (Date.now() / 1000) - this.timeToLive;\n }", "has(key) {\n if (this.#outgoing !== null && this.#outgoing.has(key)) {\n let [, , isSetValue] = this.#outgoing.get(key);\n return isSetValue;\n }\n const values = this.#ensureParsed();\n return !!values[key];\n }", "function search(key, array) {\n if (array === undefined || array === null) return false \n if (array.length) {\n for (let i = 0; i < array.length; i++) {\n if (key === array[i]) {\n return true \n }\n }\n }\n return false \n}", "has (object, key) {\n const valuePresent = key in object;\n return valuePresent;\n }", "has(obj, key) {\n return obj.hasOwnProperty(key);\n }", "static has(key) {\r\n return Object.get(Config.data, key, '__not_exists_') !== '__not_exists_';\r\n }", "function inArray(key, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (key == arr[i]) {\n return true\n }\n }\n return false\n}", "has (key, strict = true) {\n if (!strict) {\n return [...this.keys()].some((_key) => {\n return isEqual(key, _key);\n });\n }\n return Map.prototype.has.call(this, key);\n }", "function transitionKeysContain(keys, key) {\n return !!(0,_Utilities__WEBPACK_IMPORTED_MODULE_0__.find)(keys, function (transitionKey) {\n return transitionKeysAreEqual(transitionKey, key);\n });\n}", "static hasSegment(key) {\n return Object.keys(this.segments).includes(key);\n }", "function hasit (key) {\n if (key.indexOf('.') === -1) return this.cache.hasOwnProperty(key)\n return has(this.cache, key)\n}", "function hasCertainKey(arr, key) {\n\treturn arr.every(function(obj) {\n\t\treturn obj[key];\n\t})\n}", "function hasKey(obj, key) {\n return getValue(obj, key) != null;\n}", "function BSTContains(val){\n if (this.root == null){\n return false;\n }\n var walker = this.root;\n while (walker != null){\n if (walker.val == val){\n return true;\n }\n else if (walker.val < val){\n walker = walker.right;\n }\n else if (walker.val > val){\n walker = walker.left;\n }\n }\n return false;\n }", "function isAvailalbe(data, data_index, data_key, statement){\n\t\tif(data && data[data_index] && data[data_index][data_key] === statement){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function hasKey(obj, key) {\n console.log(obj.hasOwnProperty(key))\n return obj.hasOwnProperty(key)\n}", "_has(key) {\n throw Error(\"Needs implementation\");\n }", "function isBST(bst) {\n if(bst.left) {\n if(bst.left.key > bst.key) {\n return false;\n }\n if(!isbst(bst.left)) {\n return false;\n }\n }\n if(bst.right) {\n if(bst.right.key < bst.key) {\n return false;\n }\n if(!isbst(bst.right)) {\n return false;\n }\n }\n return true;\n }", "function boat_has_this_load(loads, load_id) {\n flag = false;\n loads.forEach((load) => {\n if (load.key == load_id) {\n flag = true;\n }\n });\n return flag;\n}", "function objectContainsKey(obj, key) {\n return true ? arrayContains(Object.keys(obj), key) : false;\n}", "function contains(data) {\n if (this.dataStore.indexOf(data) > -1) {\n return true;\n } else {\n return false;\n }\n}", "async has(key) {\n let value = await this.client.get(key);\n return !!value;\n }", "function hasKey(list, value, subIndex) {\n var i;\n \n if (subIndex > -1) {\n for (i in list) {\n if (list[i][subIndex].equalsIgnoreCase(value)) {\n return true;\n }\n }\n } else {\n for (i in list) {\n if (list[i].equalsIgnoreCase(value)) {\n return true;\n }\n }\n }\n return false;\n }", "containsItem(itemID){\n return this.itemStacks.some(itemStack => itemStack.itemID == itemID);\n }", "function keyExists(t,e){if(!e||e.constructor!==Array&&e.constructor!==Object)return!1;for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return t in e}", "function binarySearch(node, target) {\n const current = node;\n \n while (current !== null) {\n\t if (current.key > target.key) {\n current = current.left;\n } else if (current.key < target.key) {\n current = current.right;\n } else {\n\t return true;\n }\n }\n return false;\n}", "contain(data) {\n if (this.dataStore.indexOf(data) > -1) {\n return true;\n } else {\n return false;\n }\n }", "function containsKeyPair(array, key, value) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\tif (array[i][key] == value)\n\t\t\treturn true;\n\t}\n\treturn false;\n}" ]
[ "0.74852335", "0.7288049", "0.7159886", "0.7114057", "0.7095252", "0.7091315", "0.7019882", "0.6891799", "0.6878289", "0.680276", "0.67626894", "0.673904", "0.6724886", "0.66724604", "0.6665484", "0.6661064", "0.6661064", "0.6661064", "0.6661064", "0.6661064", "0.6654296", "0.66361487", "0.66144925", "0.66107184", "0.65730935", "0.6511132", "0.6503035", "0.6483724", "0.64813584", "0.6443426", "0.6422913", "0.6422913", "0.6422529", "0.6422529", "0.6422529", "0.6422529", "0.6422529", "0.6405268", "0.63776976", "0.63642", "0.63435876", "0.63374317", "0.6332585", "0.6297749", "0.6272612", "0.62574965", "0.62574965", "0.6257424", "0.6254433", "0.6249792", "0.6249792", "0.6239414", "0.62234586", "0.62080705", "0.6182721", "0.6129275", "0.6112939", "0.6111546", "0.6111546", "0.6111546", "0.6105425", "0.6100717", "0.6080792", "0.607855", "0.60669696", "0.6060245", "0.60552514", "0.60341483", "0.6033545", "0.6033043", "0.60134846", "0.6010783", "0.60104865", "0.6001363", "0.5988085", "0.598205", "0.5973408", "0.5960715", "0.59603024", "0.59430504", "0.59341496", "0.59190273", "0.59185046", "0.5917776", "0.5904259", "0.5897969", "0.58896405", "0.5875195", "0.586154", "0.5854663", "0.584889", "0.5841044", "0.5830271", "0.58288133", "0.5828059", "0.5823938", "0.5823863", "0.58172554", "0.5799297", "0.57986295" ]
0.6368829
39
delete minimum node (not animation)
deleteMin() { this.root = this.animateDeleteMinHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteMin(node) {\n if (node.left == null) return node.right;\n node.left = deleteMin(node.left);\n node.size = size(node.left) + size(node.right) + 1;\n return node;\n}", "animateDeleteMin() {\r\n const animations = [];\r\n animations.push(new Animation(\"display\", \"Deleting Min\", \"\"));\r\n\r\n this.root = this.animateDeleteMinHelper(this.root, animations);\r\n this.positionReset(); // reset x,y positions of nodes\r\n\r\n animations[animations.length - 1].setClass(\"found-node\");\r\n\r\n animations.push(new Animation(\"display\", \"Deleted Min\", \"\"));\r\n\r\n return animations;\r\n }", "removeNode(g, n) { }", "removeNode(g, n) { }", "removeMin() {\r\n\t\tthis.remove(this.heap[0]);\r\n\t}", "function checkAndDeleteSecondNode(player, node){\n if(nodeToDelete != null && node.key != 'null'){\n var key = min(nodeToDelete.right);\n if(node.key == key){\n\n if (nodeToDelete.right.left.key == 'null') { // when nodeToDelete's right child IS min (move min and its right subtree up)\n\n // DISABLE KEYBOARD\n this.input.keyboard.enabled = false;\n\n // hide links:\n if (nodeToDelete.parent != null) {\n this.add.tween({\n targets: [nodeToDelete.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n }\n\n this.add.tween({\n targets: [nodeToDelete.left.link, nodeToDelete.right.link, node.left.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // nodes and their components:\n this.add.tween({\n targets: [nodeToDelete.nodeGraphics, nodeToDelete.curtain, nodeToDelete.keyString, node.left.nullGraphics, node.left.keyString],\n delay: 1000,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // destroy left child(null) of 15 and update some stuff\n this.time.addEvent({\n delay: 2100,\n callback: function(nodeToDelete,node) {\n node.left.destroyNode(); // destroy null left child of 15\n node.left = null;\n node.parent = nodeToDelete.parent; // set 15s parent as what 10 had (null) || set 25s parent to 15\n node.dpth = nodeToDelete.dpth;\n },\n args: [nodeToDelete,node]\n });\n\n // abs(10 x - 15 x) + node x\n this.time.addEvent({\n delay: 2500,\n callback: function(nodeToDelete,node,scene) {\n var distanceX = Math.abs(nodeToDelete.posX-node.posX);\n // Version 2\n updateBranch(node,distanceX);\n },\n args: [nodeToDelete,node,this]\n });\n\n // Version 2\n this.time.addEvent({\n delay: 3000,\n callback: function(nodeToDelete,node,scene) {\n var distanceX = Math.abs(nodeToDelete.posX-node.posX);\n\n if (nodeToDelete == tree.root) { // if deleted node is root\n tree.root = node;\n node.left = nodeToDelete.left; // move 10's left branch to 15\n node.left.parent = node; // change left branch's parent to 15\n } else if (nodeToDelete == nodeToDelete.parent.right){ // if deleted node is right child\n node.left = nodeToDelete.left; // set 25s left to 16 (move 20's left branch to 25)\n node.left.parent = node; // set 16s parent to 25 (change left branch's parent to 25)\n node.parent.right = node; // set 15's right child to 25\n } else if (nodeToDelete == nodeToDelete.parent.left) { // if deleted node is left child\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.parent.left = node; \n }\n node.distanceFromParent = nodeToDelete.distanceFromParent;\n tree.updateNodeDepths(tree.root);\n // nodeToDelete.destroyNode();\n\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n\n scene.add.tween({\n targets: player,\n x: node.posX, // if 15 is on left branch then we should do +\n y: node.posY - BUFFER, // 10 is Buffer\n ease: 'Power2',\n duration: 1500,\n });\n\n actuallyMoveBranch(node,distanceX,scene);\n\n // TODO: ROTATE node.right.link and after it is rotated then redraw to extend:\n // node.right.link.setAlpha(0);\n // move node link, rotate it and extend it\n if (node.right.link != null) {\n\n var N = node.right.distanceFromParent;\n \n var O = null;\n if (node.right.distanceFromParent < 0) {\n O = (node.right.link.x - node.right.link.width) - node.right.link.x;\n } else {\n O = (node.right.link.x + node.right.link.width) - node.right.link.x;\n }\n \n var oldAngle = calcAngle(tree.z,O);\n var newAngle = calcAngle(tree.z,N);\n var difference = oldAngle - newAngle;\n \n scene.add.tween({\n targets: node.right.link,\n x: node.right.posX, \n y: node.right.posY,\n ease: 'Power2',\n duration: 1500\n });\n \n if (difference != 0) {\n // ROTATION TWEEN:\n scene.add.tween({\n targets: node.right.link,\n angle: -difference,\n ease: 'Sine.easeInOut',\n duration: 1500,\n onComplete: drawLink,\n onCompleteParams: [node.right,scene]\n });\n \n function drawLink(tween,targets,node,scene) {\n node.drawLinkToParent(scene);\n }\n }\n }\n // appearLinks(node,scene);\n },\n args: [nodeToDelete,node,this]\n });\n\n // need to appear movedNodes's link to parent and left link\n\n this.time.addEvent({\n delay: 4500,\n callback: function(node,scene) {\n node.drawLinkToParent(scene);\n node.link.setAlpha(0);\n node.left.drawLinkToParent(scene);\n node.left.link.setAlpha(0);\n scene.add.tween({\n targets: [node.link, node.left.link],\n ease: 'Sine.easeIn',\n duration: 1000,\n alpha: '+=1'\n });\n \n },\n args: [node,this]\n });\n // end of Version 2\n\n this.time.addEvent({\n delay: 5800,\n callback: function(node,scene) {\n nodeToDelete.destroyNode();\n nodeToDelete = null;\n tree.updateNodeDepths(node);\n // Version 2\n // A way to move the branch together with already expanded branch:\n // in moveBranch only update the posX - line 643\n // then check for collisions - line \n // then actually move the branch nodes (change x to updated posX) - line\n // redraw\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n tree.redraw(scene);\n },\n args: [node,this]\n });\n\n this.time.addEvent({\n delay: 7500,\n callback: function(scene) {\n taskSucceededActions(scene);\n displayTask(scene);\n // ENABLE KEYBOARD\n scene.input.keyboard.enabled = true;\n },\n args: [this]\n });\n \n \n } else if (nodeToDelete.right.left.key != 'null') { // when nodeToDelete's right child's left exists (it means there will be a min somewhere on the left from right child)\n\n var nodeToUseForAppear = node.parent;\n\n // DISABLE KEYBOARD\n this.input.keyboard.enabled = false;\n\n // hide links:\n if (nodeToDelete.parent != null) {\n this.add.tween({\n targets: [nodeToDelete.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n }\n\n this.add.tween({\n targets: [nodeToDelete.left.link, nodeToDelete.right.link, node.left.link, node.right.link, node.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // when min doesn't have children on the right\n if (node.right.key == 'null') {\n\n // hide nodes and their components:\n this.add.tween({\n targets: [nodeToDelete.nodeGraphics, nodeToDelete.curtain, nodeToDelete.keyString, node.left.nullGraphics, node.left.keyString, node.right.nullGraphics, node.right.keyString],\n delay: 1000,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n \n // create null for 20 and destroy 16's both null children and update some stuff\n this.time.addEvent({\n delay: 2100,\n callback: function(nodeToDelete,node,scene) {\n // make null for 20\n var childL = new NodeBST(scene, singleTon.deleteMinColor, node.parent.posX-tree.w, node.parent.posY+tree.z, 'null',node.parent.dpth+1,node.parent);\n childL.distanceFromParent = -tree.w;\n node.parent.left = childL;\n childL.nullGraphics.setAlpha(0);\n childL.keyString.setAlpha(0);\n childL.link.setAlpha(0);\n\n tree.checkCollisions(childL);\n\n // teleporting + curtains\n childL.setPhysicsNode(cursors,player,scene);\n\n // physics\n scene.physics.add.overlap(player, childL, deleteNode, backspaceIsPressed, scene);\n scene.physics.add.overlap(player, childL, checkAndDeleteSecondNode, mIsPressed, scene);\n scene.physics.add.collider(player, childL);\n \n node.left.destroyNode(); // destroy null left child of 16\n node.right.destroyNode(); // destroy null right child of 16\n node.left = null;\n node.right = null;\n node.parent = nodeToDelete.parent; // set 16s parent as what 15 had (null)\n node.dpth = nodeToDelete.dpth;\n },\n args: [nodeToDelete,node,this]\n });\n\n // move 16 to the place of 15\n this.time.addEvent({\n delay: 2500,\n callback: function(nodeToDelete,node,scene) {\n \n // player moves up\n scene.add.tween({\n targets: player,\n x: nodeToDelete.x,\n y: nodeToDelete.y - BUFFER,\n ease: 'Power2',\n duration: 1500,\n });\n \n // 16 shape and curtain moves up\n scene.add.tween({\n targets: [node, node.nodeGraphics, node.curtain],\n x: nodeToDelete.x,\n y: nodeToDelete.y, \n ease: 'Power2',\n duration: 1500,\n });\n \n var distanceX = Math.abs(node.keyString.x-node.posX);\n \n // 16s keystring moves up\n scene.add.tween({\n targets: node.keyString,\n x: nodeToDelete.x - distanceX,\n y: nodeToDelete.keyString.y, // - (tree.z*(node.dpth-nodeToDelete.dpth))\n ease: 'Power2',\n duration: 1500,\n });\n\n // draw 16s link to parent, update physics bodies\n scene.time.addEvent({\n delay: 1500,\n callback: function(node,scene) {\n node.drawLinkToParent(scene);\n node.link.setAlpha(0);\n node.body.updateFromGameObject();\n node.curtain.body.updateFromGameObject();\n },\n args: [node,scene]\n });\n\n // update 16s x and y\n node.posX = nodeToDelete.posX;\n node.posY = nodeToDelete.posY;\n\n },\n args: [nodeToDelete,node,this]\n });\n\n this.time.addEvent({\n delay: 4500,\n callback: function(nodeToUseForAppear,nodeToDelete,node,scene) {\n if (nodeToDelete == tree.root) { // if deleted node is root\n tree.root = node;\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n } else if (nodeToDelete == nodeToDelete.parent.right){ // if deleted node is right child\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n node.parent.right = node;\n } else if (nodeToDelete == nodeToDelete.parent.left) { // if deleted node is left child\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n node.parent.left = node; \n }\n\n // put/appear null on the left of 20\n scene.add.tween({\n targets: [nodeToUseForAppear.left.nullGraphics, nodeToUseForAppear.left.nodeGraphics, nodeToUseForAppear.left.keyString],\n ease: 'Sine.easeIn',\n duration: 1000,\n alpha: '+=1'\n });\n\n node.distanceFromParent = nodeToDelete.distanceFromParent;\n \n if (node.parent != null) {\n scene.add.tween({\n targets: [node.link],\n delay: 1000,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '+=1'\n });\n }\n\n scene.add.tween({\n targets: [node.left.link, node.right.link, nodeToUseForAppear.left.link], //node.right.left.link\n delay: 1000,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '+=1'\n });\n\n tree.updateNodeDepths(tree.root);\n nodeToDelete.destroyNode();\n },\n args: [nodeToUseForAppear,nodeToDelete,node,this]\n });\n\n this.time.addEvent({\n delay: 8000,\n callback: function(node,scene) {\n nodeToDelete = null;\n tree.updateNodeDepths(node);\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n tree.redraw(scene); \n },\n args: [node,this]\n });\n\n } else if (node.right.key != 'null') { // when min has children on the right (need to move the right branch up)\n \n // hide nodes and their components:\n this.add.tween({\n targets: [nodeToDelete, nodeToDelete.nodeGraphics, nodeToDelete.curtain, nodeToDelete.keyString, node.left, node.left.nullGraphics, node.left.keyString],\n delay: 1000,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n this.time.addEvent({\n delay: 2100,\n callback: function(nodeToDelete,node,scene) {\n node.left.destroyNode(); // node is min. we destroy its left child because it wont be needed anymore/it will be replaced\n node.left = null;\n node.parent = nodeToDelete.parent;\n node.dpth = nodeToDelete.dpth;\n },\n args: [nodeToDelete,node,this]\n });\n\n this.time.addEvent({\n delay: 2500,\n callback: function(nodeToDelete,node,scene) {\n \n // player moves up\n scene.add.tween({\n targets: player,\n x: nodeToDelete.x,\n y: nodeToDelete.y - BUFFER,\n ease: 'Power2',\n duration: 1500,\n });\n \n // 11 shape and curtain moves up\n scene.add.tween({\n targets: [node, node.nodeGraphics, node.curtain],\n x: nodeToDelete.x,\n y: nodeToDelete.y, \n ease: 'Power2',\n duration: 1500,\n });\n \n var distanceX = Math.abs(node.keyString.x-node.posX);\n \n // 11s keystring moves up\n scene.add.tween({\n targets: node.keyString,\n x: nodeToDelete.x - distanceX,\n y: nodeToDelete.keyString.y, // - (tree.z*(node.dpth-nodeToDelete.dpth))\n ease: 'Power2',\n duration: 1500,\n });\n\n // draw 11s link to parent, update physics bodies\n scene.time.addEvent({\n delay: 1500,\n callback: function(node,scene) {\n // node.drawLinkToParent(scene);\n // node.link.setAlpha(0);\n node.body.updateFromGameObject();\n node.curtain.body.updateFromGameObject();\n },\n args: [node,scene]\n });\n\n },\n args: [nodeToDelete,node,this]\n });\n\n this.time.addEvent({\n delay: 4500,\n callback: function(nodeToUseForAppear,nodeToDelete,node,scene) {\n\n var distanceX = Math.abs(node.posX-node.right.posX);\n \n updateBranch(node.right,distanceX); //v2\n\n // update 11s x and y - just to be sure it doesn't get updated before moveBranch \n node.posX = nodeToDelete.posX;\n node.posY = nodeToDelete.posY;\n\n // draw 11s links - have to have it here after we update 11s posX and posY\n node.drawLinkToParent(scene);\n node.link.setAlpha(0);\n \n // update 12s distance from parent\n node.right.distanceFromParent = node.distanceFromParent; // <-- 11s.distancefromparent // nodeToUseForAppear.left.distanceFromParent; <-- 13s.left\n nodeToUseForAppear.left = node.right; // here nodeToUseForAppear is the parent of node(min)\n node.right.parent = nodeToUseForAppear;\n\n if (nodeToDelete == tree.root) { // if deleted node is root\n tree.root = node;\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n } else if (nodeToDelete == nodeToDelete.parent.right){ // if deleted node is right child\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n node.parent.right = node;\n } else if (nodeToDelete == nodeToDelete.parent.left) { // if deleted node is left child\n node.left = nodeToDelete.left;\n node.left.parent = node;\n node.right = nodeToDelete.right;\n node.right.parent = node;\n node.parent.left = node; \n }\n\n // update distancefromparent for 11\n node.distanceFromParent = nodeToDelete.distanceFromParent;\n\n\n // tree.updateNodeDepths(node.right);\n tree.updateNodeDepths(tree.root);\n\n tree.traverseAndCheckCollisions(scene); //v2\n tree.traverseAndCheckCrossings(scene); //v2\n\n actuallyMoveBranch(nodeToUseForAppear.left,distanceX,scene); //v2\n\n // appearLinks(node.right, scene);\n\n node.drawLinkToParent(scene);\n node.link.setAlpha(0);\n nodeToUseForAppear.left.drawLinkToParent(scene);\n nodeToUseForAppear.left.link.setAlpha(0);\n \n if (node.parent != null) {\n scene.add.tween({\n targets: [node.link],\n delay: 1500,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '+=1'\n });\n }\n\n scene.add.tween({\n targets: [node.left.link, node.right.link, nodeToUseForAppear.left.link], //node.right.left.link\n delay: 1500,\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '+=1'\n });\n\n // tree.updateNodeDepths(tree.root);\n nodeToDelete.destroyNode();\n },\n args: [nodeToUseForAppear,nodeToDelete,node,this]\n });\n\n this.time.addEvent({\n delay: 7000,\n callback: function(nodeToUseForAppear,node,scene) {\n nodeToDelete = null;\n tree.updateNodeDepths(node);\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n tree.redraw(scene); \n },\n args: [nodeToUseForAppear,node,this]\n });\n\n } //end of else if\n\n this.time.addEvent({\n delay: 8000,\n callback: function(scene) {\n taskSucceededActions(scene);\n displayTask(scene);\n // ENABLE KEYBOARD\n scene.input.keyboard.enabled = true;\n },\n args: [this]\n });\n\n\n } //end of else if\n\n } else {\n panel.redFeedback();\n player.setPosition(nodeToDelete.x,nodeToDelete.y-BUFFER);\n tree.closeCurtains()\n }\n }\n }", "function deleteNode( node ) {\n\t\n\tLog(\"Deleting Node \" + node.id);\n\t\n\telements_in_canvas[node.id] = null;\n\tnodes_in_canvas_by_id[node.id] = null;\n\tnodes_in_canvas.splice( nodes_in_canvas.indexOf( node ), 1 );\n\t\n\tif (node.animationParent) {\n\t node.animationParent.animationChildren[node.id] = null;\n\t}\n\t\n\tnode.deleteNode();\n\t\n}", "function deleteMin(h) { \n if (h.left == null || h.left == undefined)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }", "removeNode(node) {\n this.nodes.splice(this.nodes.indexOf(node), 1);\n this.svgsManager.nodeManager.update();\n }", "function GoneNode(id) {\n $('.grid').isotope( 'remove', $(\"#node-\" + id)).isotope('layout')\n delete nodes_by_id[id] // Don't change indices\n delete nodes[name]\n delete charts[id]\n setNodes()\n}", "removeNode(node) {\n if (nodesCount > 0) { nodesCount -= 1; }\n if (node.id < nodesCount && nodesCount > 0) {\n // we do not really delete anything from the buffer.\n // Instead we swap deleted node with the \"last\" node in the\n // buffer and decrease marker of the \"last\" node. Gives nice O(1)\n // performance, but make code slightly harder than it could be:\n webglUtils.copyArrayPart(nodes, node.id * ATTRIBUTES_PER_PRIMITIVE, nodesCount * ATTRIBUTES_PER_PRIMITIVE, ATTRIBUTES_PER_PRIMITIVE);\n }\n }", "function _deleteNode() {\n const id = diagram.selection.toArray()[0].key;\n const node = diagram.findNodeForKey(id);\n diagram.startTransaction();\n diagram.remove(node);\n diagram.commitTransaction(\"deleted node\");\n diagramEvent()\n}", "function node_delete(_nodeindex){\r\n\tvar currentnode = nodes[_nodeindex];\r\n\tvar temp = delete_relatededges(currentnode, edges, edges_tangents);\r\n\tedges = temp.edges;\r\n\tedges_tangents = temp.edges_tangents;\r\n\tif(matchnodeindex(nodes,currentnode.id)>= 0 & matchnodeindex(nodes,currentnode.id)< nodes.length){\r\n\t\tswitch (currentnode.type){\r\n\t\t\tcase \"ellipse\": \r\n\t\t\t\tnumElli--;\r\n\t\t\t\tnumNode--;\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"rect\":\r\n\t\t\t\tnumRec--;\r\n\t\t\t\tnumNode--;\t\t\t\t\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"triangle\":\r\n\t\t\t\tnumTri--;\r\n\t\t\t\tnumNode--;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:;\r\n\t\t}//end of switch (_type) \r\n\t\tnodes.splice(_nodeindex,1);\r\n\t}\r\n}", "function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key; // get parent node\n\n var parent = node.parent;\n\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent); // remove all nodes from parent to the root parent\n\n\n _cascadingCut(minimum, parent);\n } // update minimum node if needed\n\n\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n } // return minimum\n\n\n return minimum;\n }", "function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key; // get parent node\n\n var parent = node.parent;\n\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent); // remove all nodes from parent to the root parent\n\n\n _cascadingCut(minimum, parent);\n } // update minimum node if needed\n\n\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n } // return minimum\n\n\n return minimum;\n }", "remove() {\n this.node.remove()\n }", "function deleteNode(node) {\n\n // delete link, tubes and cables\n spliceLinksForNode(node);\n\n // delete node\n nodes.splice(nodes.indexOf(node), 1);\n\n correctID();\n\n updateMatrix();\n\n // close the modal box\n closeModal();\n\n // redraw\n restart();\n}", "anchoredNodeRemoved(node) {}", "async function deleteStackNode() {\n let pos = stack.size - 1;\n d3.select(\"#g\" + pos)\n .transition()\n .ease(d3.easeExp)\n .duration(500)\n\n .attr(\"transform\", \"translate(0,0)\")\n .style(\"opacity\", 0);\n await timeout(510);\n d3.select(\"#g\" + pos).remove();\n data_nodes.pop();\n}", "remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : this.step || 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(this.value);\n }", "function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--; // reset y.child if necessary\n\n if (parent.child === node) {\n parent.child = node.right;\n } // remove child if degree is 0\n\n\n if (parent.degree === 0) {\n parent.child = null;\n } // add node to root list of heap\n\n\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node; // set parent[node] to null\n\n node.parent = null; // set mark[node] to false\n\n node.mark = false;\n }", "function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--; // reset y.child if necessary\n\n if (parent.child === node) {\n parent.child = node.right;\n } // remove child if degree is 0\n\n\n if (parent.degree === 0) {\n parent.child = null;\n } // add node to root list of heap\n\n\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node; // set parent[node] to null\n\n node.parent = null; // set mark[node] to false\n\n node.mark = false;\n }", "function outNode(){\n\t\ttooltipsvg\n\t\t.style(\"opacity\", 0)\n\t\t.attr(\"width\",0)\n\t\t.attr(\"height\",0)\n\t\t.selectAll(\"*\").remove();;\n\t}", "function deleteNode(player, node) {\n if (nodeToDelete == null && tasks.length != 0) {\n // (node.key != 'null') \n if (node.key != 'null' && (tasks[0] == node.key || (tasks[0] == 'Min' && node.key == min(tree.root)) || (tasks[0] == 'Max' && node.key == max(tree.root))) && nodeToDelete == null) {\n if (node.left.key =='null' && node.right.key =='null') { // both children are null \n\n // DISABLE KEYBOARD\n this.input.keyboard.enabled = false;\n\n if (node.parent != null) {\n player.setPosition(node.parent.posX,node.parent.posY-BUFFER);\n }\n\n // node.left, node.right, node\n // hide links and nodes\n this.add.tween({\n targets: [node.left.link, node.right.link, node.left.nullGraphics, node.right.nullGraphics, node.nodeGraphics, node.keyString, node.left.keyString,node.right.keyString],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n this.time.addEvent({\n delay: 1000,\n callback: function(node) {\n node.setKey('null');\n node.setNullGraphics();\n node.nullGraphics.setAlpha(0);\n node.left.destroyNode();\n node.right.destroyNode();\n node.setChildren(); // set children as null\n },\n args: [node]\n });\n\n this.add.tween({\n targets: [node.nullGraphics, node.keyString],\n ease: 'Sine.easeIn',\n delay: 2000,\n duration: 1000,\n alpha: '+=1',\n // onComplete: taskSucceededActions(this),\n // onCompleteParams: [this]\n });\n\n this.time.addEvent({\n delay: 4000,\n callback: function(scene) {\n // ENABLE KEYBOARD\n taskSucceededActions(scene)\n scene.input.keyboard.enabled = true;\n // displayTask();\n },\n args: [this]\n });\n\n } else if (node.right.key == 'null' || node.left.key == 'null') { // one child is null\n\n // DISABLE KEYBOARD\n this.input.keyboard.enabled = false;\n\n if (node.right.key == 'null') { // right child is null\n\n player.setPosition(node.left.x,node.left.y-BUFFER);\n\n // hide links\n this.add.tween({\n targets: [node.left.link, node.right.link, node.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // hide right null of deleted node and the deleted node\n this.add.tween({\n targets: [node.right.nullGraphics, node.nodeGraphics, node.keyString, node.right.keyString],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // branch moves to the right\n this.time.addEvent({\n delay: 1000,\n callback: function(node,scene) {\n\n if (node.parent == null) {\n node.left.parent = null;\n tree.root = node.left;\n tree.root.dpth = 0;\n } else if (node.parent.left == node) {\n node.parent.left = node.left;\n node.left.parent = node.parent;\n } else if (node.parent.right == node) {\n node.parent.right = node.left;\n node.left.parent = node.parent;\n }\n \n var distanceX = node.left.posX-node.posX;\n // moveBranch(node.left,distanceX,scene); //v1\n updateBranch(node.left,distanceX); //v2\n\n // TO PREVENT COLLAPSING:\n node.left.distanceFromParent = node.distanceFromParent;\n\n tree.updateNodeDepths(node.left); // starting from 9 (the node that changes deleted node)\n\n tree.traverseAndCheckCollisions(scene); //v2\n tree.traverseAndCheckCrossings(scene); //v2\n\n // player moves up\n scene.add.tween({\n targets: player,\n x: node.left.posX,\n y: node.left.posY - BUFFER,\n ease: 'Power2',\n duration: 1500,\n });\n\n actuallyMoveBranch(node.left,distanceX,scene); //v2\n\n // // destroy 15.right\n // node.right.destroyNode();\n // // destroy 15\n // node.destroyNode();\n },\n args: [node,this]\n });\n\n // appear link that changed\n this.time.addEvent({\n delay: 2500,\n callback: function(scene,node) {\n\n node.left.drawLinkToParent(scene);\n node.left.link.setAlpha(0);\n scene.add.tween({\n targets: node.left.link,\n ease: 'Sine.easeIn',\n duration: 1000,\n alpha: '+=1'\n });\n\n },\n args: [this,node]\n });\n\n // move player to root, update tasks, enable keyboard\n this.time.addEvent({\n delay: 3000,\n callback: function(scene) {\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n // tree.traverseAndCheckCrossings(scene);\n\n tree.redraw(scene);\n\n // appearLinksOneChild(node.left, scene);\n // destroy 15.right\n node.right.destroyNode();\n // destroy 15\n node.destroyNode();\n\n },\n args: [this]\n });\n\n } else { // left child is null\n\n player.setPosition(node.right.x,node.right.y-BUFFER);\n\n // hide links\n this.add.tween({\n targets: [node.left.link, node.right.link, node.link],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // hide left null of deleted node and the deleted node\n this.add.tween({\n targets: [node.left.nullGraphics, node.nodeGraphics, node.keyString, node.left.keyString],\n ease: 'Sine.easeOut',\n duration: 1000,\n alpha: '-=1'\n });\n\n // branch moves to the left up\n this.time.addEvent({\n delay: 1000,\n callback: function(node,scene) {\n\n if (node.parent == null) {\n node.right.parent = null;\n tree.root = node.right;\n tree.root.dpth = 0;\n } else if (node.parent.left == node) {\n node.parent.left = node.right;\n node.right.parent = node.parent;\n } else if (node.parent.right == node) {\n node.parent.right = node.right;\n node.right.parent = node.parent;\n }\n\n // TODO:\n // not here:\n // 2.the collisions are checked only once? the crossings are not checked?\n\n var distanceX = node.right.posX-node.posX;\n // moveBranch(node.right,distanceX,scene); //v1\n updateBranch(node.right,distanceX); //v2\n\n // TO PREVENT COLLAPSING:\n node.right.distanceFromParent = node.distanceFromParent;\n\n tree.updateNodeDepths(node.right); // starting from 33 (the node that changes deletd node)\n\n tree.traverseAndCheckCollisions(scene); //v2\n tree.traverseAndCheckCrossings(scene); //v2\n\n // player moves up\n scene.add.tween({\n targets: player,\n x: node.right.posX,\n y: node.right.posY - BUFFER,\n ease: 'Power2',\n duration: 1500,\n });\n actuallyMoveBranch(node.right,distanceX,scene); //v2\n\n // appearLinks(node.right, scene);\n\n // // destroy 24.left\n // node.left.destroyNode();\n // // destroy 24\n // node.destroyNode();\n },\n args: [node,this]\n });\n\n // appear link that changed\n this.time.addEvent({\n delay: 2500,\n callback: function(scene,node) {\n\n node.right.drawLinkToParent(scene);\n node.right.link.setAlpha(0);\n scene.add.tween({\n targets: node.right.link,\n ease: 'Sine.easeIn',\n duration: 1000,\n alpha: '+=1'\n });\n\n },\n args: [this,node]\n });\n\n // move player to root, update tasks, enable keyboard\n this.time.addEvent({\n delay: 3500,\n callback: function(scene) {\n tree.traverseAndCheckCollisions(scene);\n tree.traverseAndCheckCrossings(scene);\n // tree.traverseAndCheckCrossings(scene);\n \n tree.redraw(scene);\n \n // appearLinksOneChild(node.right, scene);\n // destroy 24.left\n node.left.destroyNode();\n // destroy 24\n node.destroyNode();\n \n },\n args: [this]\n });\n } //end of if else\n \n\n this.time.addEvent({\n delay: 6000,\n callback: function(scene) {\n taskSucceededActions(scene);\n // ENABLE KEYBOARD\n scene.input.keyboard.enabled = true;\n },\n args: [this]\n });\n } else { // both children are NOT null\n // setting a value of nodeToDelete to use it after user clicks Enter\n nodeToDelete = node;\n nodeToDelete.nodeGraphics.setTint(0xf3a6ff);\n if(nodeToDelete.key == 631) {\n if (expert.progressCounter <= 2) {\n talkNodes.shift();\n }\n expert.progressCounter = 3;\n expert.talk('deleteTwoChildren',3,'nosymbol');\n }\n }\n } else {\n panel.redFeedback();\n player.setPosition(tree.root.x,tree.root.y-BUFFER);\n tree.closeCurtains()\n\n\n }\n }\n }", "destroy() {\n nodes.splice(nodes.indexOf(el), 1);\n }", "deleteFirstNode() {\n if (!this.head) {\n return;\n }\n this.head = this.head.next;\n }", "function deleteStart() {\n var child = starter.lastElementChild;\n starter.removeChild(child);\n}", "clear () {\n this.control.disable();\n while (this.nodes.length) this.nodes[this.nodes.length-1].remove();\n this.control.enable();\n }", "function removeNodeOnto(index){\n if(index>=0 && index<node_dataOnto.length){\n removeAllEdgesOnto(index);\n for(var i = 0;i<node_dataOnto.length;i++){\n if(i>index){\n node_dataOnto[i].index = i-1;\n }\n } \n node_dataOnto.splice(index,1);\n refreshGraphOnto(node_dataOnto,link_dataOnto);\n }\n}", "function deleteLastPosition() {\r\n\t//delete the trace of the block in the matrix\r\n\tmatrix[lastY][lastX] = 0;\r\n\tvar parent = document.getElementsByClassName('coll-' + lastX)[lastY - 1];\r\n\tparent.removeChild(parent.children[0]);\r\n}", "function deletenode(e) {\n jsPlumb.remove(e.parentNode.parentNode.parentNode.parentNode);\n}", "delMin() {\n /*\n * Save reference to the min key.\n * Swap the min key with the last key in the heap.\n * Decrement n so that the key does not swim back up the heap.\n * Sink down the heap to fix any violations that have arisen.\n * Delete the min key to prevent loitering, and return its reference.\n */\n let min = this.heap[1];\n\n [this.heap[1], this.heap[this.n]] = [this.heap[this.n], this.heap[1]];\n this.n--;\n this.sink(1);\n this.heap[this.n+1] = null;\n\n return min;\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "handleDelete() {\n API.deleteNode(this.props.node).then(() => {\n this.props.node.remove();\n this.props.engine.repaintCanvas();\n }).catch(err => console.log(err));\n }", "remove(index){\n// check the param\n\nconst leader = this.traverseToIndex(index-1);\nconst unwamtedNode = leader.next;\nleader.next = unwamtedNode.next;\nthis.length--;\n\n\n}", "removeNode (value) {\n this.nodes.delete(value)\n this.nodes.forEach(node => {\n if (node.includes(value)) {\n let newNodes = node.filter(item => item !== value)\n while (node.length > 0) {\n node.pop()\n }\n newNodes.forEach(item => node.push(item))\n }\n })\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "function deleteNode() {\n try {\n _deleteNode();\n createToast(\"Node deleted.\", \"warning\");\n } catch (e) {\n console.log(e);\n }\n}", "function removeDistantNodes(){\n\t\t\tvar preload = grid.preload,\n\t\t\t\ttrashBin = put(\"div\");\n\t\t\twhile (preload.previous){\n\t\t\t\tpreload = preload.previous;\n\t\t\t}\n\t\t\twhile (preload){\n\t\t\t\t// This code will not remove blocks of rows that are not adjacent to a preload node,\n\t\t\t\t// however currently the only situation this happens is when they are between two loading nodes.\n\t\t\t\t// In this case they will be removed on the first scroll after one of the loading nodes' queries\n\t\t\t\t// has been resolved.\n\t\t\t\tremovePreloadDistantNodes(preload, \"previousSibling\", trashBin);\n\t\t\t\tremovePreloadDistantNodes(preload, \"nextSibling\", trashBin);\n\t\t\t\tpreload = preload.next;\n\t\t\t}\n\t\t\tsetTimeout(function(){\n\t\t\t\t// we can defer the destruction until later\n\t\t\t\tput(trashBin, \"!\");\n\t\t\t},1);\n\t\t}", "function deleteNode(node){\n\tnode.parentNode.removeChild(node);\n}", "function removeNode(){\n\tfadeOut();\n\tif (state === true) {\n\t\tmakeRequest();\n\t}\n}", "function removeNodeClick() {\n if (buttonChecked == button_options.REMOVENODE) {\n buttonChecked = button_options.NONE;\n }\n else {\n buttonChecked = button_options.REMOVENODE;\n }\n consoleAdd(\"Button Selected: \" + buttonChecked);\n}", "function decreaseMin () {\n newMin = getMinimum()-10;\n min = newMin;\n return min;\n }", "function deleteNode(node){\n node.data = node.next.data\n node.next = node.next.next\n}", "function selectionChangeSmallest(){\n addStep(\"Index Node \" + (selectionIndex + 1) + \" is smaller than smallest node \" + (selectionSmallest + 1) + \". Set Node \" + (selectionIndex + 1) + \" to \\\"smallest\\\"\");\n setClass(nodes[selectionIndex], 2, \"Selected\"); //changing the current node to a blend of index and smallest (selected).\n \n if(selectionSmallest == selectionCurrent){ //the previous smallest node is the first unsorted node\n setClass(nodes[selectionSmallest], 2, \"Current\");\n }else{\n setClass(nodes[selectionSmallest], 2, \"Default\");\n }\n\n selectionSmallest = selectionIndex;\n foundNewSorted = false;\n selectionIndex++;\n}", "removeAnchoredNode(node) {\n\t\tfor (var i = 0; i < this.anchoredNodes.length; i++) {\n\t\t\tif (node === this.anchoredNodes[i].node) {\n\t\t\t\tthis.anchoredNodes.splice(i,1);\n this.scene.remove(node)\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "moveMinToFront() {\n // console.log(this.display());\n if (this.head == null && this.tail == null) {\n return;\n }\n else if (this.head == this.tail) {\n return;\n }\n\n var min = this.findMinNode();\n\n if (this.head == min) {\n return;\n }\n else {\n // Find minNode >\n \n var runner = this.head;\n \n //this is to find the node before the min node >\n while (runner.next != min) {\n runner = runner.next;\n }\n // right here we need to set runner.next to = the node after min node\n runner.next = runner.next.next;\n // Set .next of minNode to this.head\n min.next = this.head;\n this.head = min;\n if (this.head == this.tail) {\n this.tail = runner;\n }\n }\n }", "removeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n var {\n at = editor.selection,\n match\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n var depths = Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n });\n var pathRefs = Array.from(depths, _ref4 => {\n var [, p] = _ref4;\n return Editor.pathRef(editor, p);\n });\n\n for (var pathRef of pathRefs) {\n var path = pathRef.unref();\n\n if (path) {\n var [node] = Editor.node(editor, path);\n editor.apply({\n type: 'remove_node',\n path,\n node\n });\n }\n }\n });\n }", "function clearNode(node) {\n node.isLeaf = false;\n node.frequency = 0;\n for(var i = 0; i < 26; i++){\n node.children[i] = null;\n }\n}", "removeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n var {\n at = editor.selection,\n match\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n var depths = Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n });\n var pathRefs = Array.from(depths, (_ref4) => {\n var [, p] = _ref4;\n return Editor.pathRef(editor, p);\n });\n\n for (var pathRef of pathRefs) {\n var path = pathRef.unref();\n\n if (path) {\n var [node] = Editor.node(editor, path);\n editor.apply({\n type: 'remove_node',\n path,\n node\n });\n }\n }\n });\n }", "remove(index){\n const leader = this.traverseToIndex(index-1)\n const unwantedNode = leader.next;\n leader.next = unwantedNode.next;\n this.length --;\n }", "deletefirst() {\n if (this.head == null) {\n console.log(\"The linkedlist is empty\");\n }\n var n = this.head.data;\n this.head = this.head.next;\n //this.size--;\n return;\n }", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "function clearCurrentNode(node)\n {\n while(node.firstChild)\n {\n node.removeChild(node.firstChild);\n }\n}", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "function deleteAndRaiseFN() {\n let sel = $('#' + $('.selected').attr('id'));\n let pos = sel.offset();\n let subTree = sel.detach();\n $('#' + sel.attr('line-target')).remove();\n subTree.appendTo('body');\n sel.css({\n 'top' : pos.top,\n 'left' : pos.left\n });\n calc_all_lines('#' + sel.attr('id'));\n }", "animateDeleteMax() {\r\n const animations = [];\r\n animations.push(new Animation(\"display\", \"Deleting Max\", \"\"));\r\n\r\n this.root = this.animateDeleteMaxHelper(this.root, animations);\r\n this.positionReset(); // reset x,y positions of nodes\r\n\r\n animations[animations.length - 1].setClass(\"found-node\");\r\n\r\n animations.push(new Animation(\"display\", \"Deleted Max\", \"\"));\r\n\r\n return animations;\r\n }", "function deleteNode(node) {\n\tvar treeNode = node.parentNode.parentNode; // div\n\tvar nodeID = treeNode.id;\n\n\t// if has children, delete all the children, which is div 'clip'\n\tvar clip;\n\tif (treeNode.nextSibling != null\n\t\t\t&& treeNode.nextSibling.className == \"clip\") {\n\t\tvar confirmed = confirm(\"This action will also remove the children nodes. Do you still want to remove the node? \");\n\t\tif (!confirmed) {\n\t\t\treturn; // do nothing\n\t\t}\n\t\tclip = treeNode.nextSibling;\n\t\tclip.parentNode.removeChild(clip);\n\t}\n\n\tremoveNode(treeNode);\n\trevertNode(nodeID);\n\n\tif (clip != null) {\n\t\tvar children = clip.getElementsByClassName('dTreeNode');\n\t\tif (children.length > 0) {\n\t\t\tfor ( var j = children.length - 1; j >= 0; j--) {\n\t\t\t\t// alert(j + \": \" + children[j].id);\n\t\t\t\trevertNode(children[j].id);\n\t\t\t}\n\t\t}\n\t}\n\tclip = null;\n}", "delete(node) {\n mona_dish_1.DQ.byId(node.id.value, true).delete();\n }", "remove () {\n this.node.parentNode.removeChild(this.node)\n this.stylesheet.parentNode.removeChild(this.stylesheet)\n }", "function remove_start_point(x, y) {\n\tsvg.select('#'+'p'+x+'black'+y).remove();\n}", "removeNode() {\n let root;\n if (!this.data.length) {\n return;\n }\n if (this.data.length === 1) {\n root = this.data.pop();\n } else {\n root = this.data[0];\n this.data[0] = this.data[this.data.length - 1];\n this.data = this.data.slice(0, this.data.length - 1);\n }\n\n this.usage.delete(root);\n this.heapifyDown(0);\n this.store.setItem(this.key + \"_searchData\", this.data);\n this.store.setItem(this.key + \"_searchUsageMap\", this.usage);\n return root;\n }", "function removeNode(fa, nodeID) {\r\n\tfa.nodes.splice(nodeID, 1);\r\n\tfor (var i = 0; i < fa.edges.length; i++) {\r\n\t\tif (fa.edges[i].fromID === nodeID || fa.edges[i].toID === nodeID) {\r\n\t\t\tfa.edges.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\tif (nodeID < fa.startID) fa.startID--;\r\n\taddHelpfulInfoToNodesAndEdges(fa);\r\n}", "function graphRemove() {\r\n svg.selectAll(\"*\").remove();\r\n d3nodes = [];\r\n d3links = [];\r\n}", "function deleteFN() {\n let sel = $('.selected');\n $('#' + sel.attr('line-target')).remove();\n sel.find('.node').each(function() {\n // Remove the linking lines.\n let attr = $(this).attr('line-target');\n if (typeof attr !== typeof undefined && attr !== false) {\n $('#' + attr).remove();\n }\n });\n sel.remove();\n targets = ['body'];\n }", "_removeNode(curr,data,parent){\n // case 1: node to be deleted is a leaf - simply remove parents connection to it\n // case 2: node to be deleted has one child\n if(curr.data === data && (curr.left == null || curr.right == null)){\n // get the child of curr that parent will now point to\n console.log(\"in case 1 & 2\");\n let child;\n if(curr.left !== null){\n child = curr.left;\n }else{\n child = curr.right;\n }\n // if root needs to be deleted then update root\n if(this.root === curr){ //\n this.root = child;\n }else{ // make the parent of curr point to its child\n if(parent.left === curr) {\n parent.left = child;\n }else{\n parent.right = child;\n }\n }\n this.nodeCount--;\n // case 3: node to be deleted has two children\n }else if(curr.data === data){ //if two children\n console.log(\"in case 3\");\n // get the minimum value from the right subtree\n let min = this.findMinNode(curr.right);\n let minValue = min.data;\n curr.data = minValue; // replace value of node to be removed with minimum value of right subtree\n // remove duplicate value from right subtree - will be caught by case 1 or 2\n this._removeNode(curr.right,minValue,curr);\n }else{ //traverse tree looking for node to delete\n if(data <= curr.data){ // go left\n this._removeNode(curr.left,data,curr);\n }else{ // go right\n this._removeNode(curr.right,data,curr);\n }\n }\n }", "delete(node) {\n node.next.prev = node.prev;\n node.prev.next = node.next;\n }", "destroy() {\n this.node.parentNode.removeChild(this.node);\n }", "eraseNode(node) {\n if (node !== NIL) {\n this._treapDelete(node);\n }\n }", "deselectNode() {\n if (this.nodeDOM.nodeType == 1)\n this.nodeDOM.classList.remove(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.removeAttribute(\"draggable\");\n }", "removeNode(key) {\n const { nodes } = this;\n if (nodes.all[key]) {\n debug(\"Remove %s from the pool\", key);\n delete nodes.all[key];\n }\n delete nodes.master[key];\n delete nodes.slave[key];\n }", "removeNode(node){\n delete this.adjList[node];\n\n Object.keys(this.adjList).map(eachNode => {\n let currentNode = this.adjList[eachNode];\n let currentIndex = currentNode.edges.indexOf(node);\n if(currentIndex > -1){\n currentNode.edges.splice(currentIndex,1);\n }\n })\n }", "removeFirst() {\n if (this.count === 1) {\n this.clear()\n } else {\n let newHead = this.getHeadNode().next\n newHead.prev = null\n this.head = newHead\n }\n }", "removeHead() {\n let result = this.root;\n this.root = this.root.next;\n if (this.root && this.root.prev) {\n this.root.prev = null;\n }\n return result;\n }", "function delRow(row) {\n row.removeChild(row.lastChild);\n transitioning = false;\n recalc();\n}", "function deleteNode(e, object) {\n swal({\n title: \"確定要刪除?\",\n type: \"warning\",\n showCancelButton: true,\n cancelButtonText: \"取消\",\n confirmButtonClass: \"btn-danger\",\n confirmButtonText: \"確定\",\n closeOnConfirm: true\n },\n\n function (isConfirm) {\n if (isConfirm) {\n var currentObjectKey = object.part.data.key;\n var currentObjectCategory = object.part.data.category\n\n if (currentObjectCategory === \"CareMale\" || currentObjectCategory === \"CareFemale\" || currentObjectCategory === \"FreehandDrawing\" || currentObjectCategory === \"CommentBox\") {\n mainDiagram.commandHandler.deleteSelection();\n commentBoxKey = -1;\n return\n }\n\n var newNode;\n //delete parentTree's Node\n var previousNode = searchParentTreeNodePreviousNode(globalLogicData.parentTree, currentObjectKey)\n if (previousNode != null) {\n previousNode.left = null;\n previousNode.right = null;\n reRender(previousNode.id);\n return;\n }\n\n // delete node on childrenList\n var currentNodeArrayData = searchNodeCurrentArray(globalLogicData.childrenList, currentObjectKey);\n var NodeCurrentIndex = currentNodeArrayData.index;\n var NodeCurrentchildrenList = currentNodeArrayData.childrenList;\n if (NodeCurrentchildrenList[NodeCurrentIndex].parentTree) {\n var mainNodePosition = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.linkNode\n // check weather the node that want to be deleted is child or partner, if it is not partner delete the node, else delete the partner\n if ((mainNodePosition === \"left\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left.id === currentObjectKey) ||\n (mainNodePosition === \"right\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right.id === currentObjectKey)) {\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n } else if (mainNodePosition === \"left\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left;\n } else if (mainNodePosition === \"right\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right;\n }\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 0, newNode);\n reRender(currentObjectKey);\n return;\n } else {\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n }\n } else {\n return false;\n }\n }\n );\n}", "removeNode(node, key){\n if(!node) {\n return null;\n }\n //If the node.data is less than the key, the recursivaly call the removeNode function, and pass the right node and key.\n else if(node.data < key) {\n node.right = this.removeNode(node.right, key);\n return node;\n }\n //If the node.data is greater than the key, recursivaly call the removeNode function, and pass the left node and key.\n else if(node.data > key) {\n node.left = this.removeNode(node.left, key);\n return node;\n }\n //If the data is similar to the root node. Then delete the node.\n else {\n //deleting node with no children\n if(node.left === null || node.right === null) {\n node = null;\n return node;\n }\n //delete node with one children\n //Assign node with right node(make it root), when left node is null\n //Assign node with left node(make it root), when right node is null\n else if(node.left === null) {\n node = node.right;\n return node;\n } \n else if(node.right === null) {\n node = node.left;\n return node;\n }\n\n //Delete a node with two children\n //Minimum node of the right subtree.\n //Is stored in aux\n var aux = this.findMinNode(node.right);\n node.data = aux.data;\n node.right = this.removeNode(node.right, aux.data);\n return node;\n }\n }", "remove() {\n this.x = -1000\n this.y = -1000\n }", "function removeNode(node) {\n // as long as the node has a child ...\n while (node.firstChild) {\n // ... remove from node the first child\n node.removeChild(node.firstChild);\n }\n }", "function removeNode(node) {\n let { nodes, links } = Graph.graphData();\n links = links.filter(l => l.source !== node && l.target !== node); // Remove links attached to node\n nodes=nodes.filter(n=>n!==node); // Remove node\n nodes.forEach((n, idx) => { n.ID = idx; }); // Reset node ids to array index\n Graph.graphData({ nodes, links });\n }", "removeFirst(){\n if(this.size === 0){\n return;\n }else if(this.size === 1){\n this.head = null;\n this.tail = null;\n }else{\n const nextNode = this.head.next;\n nextNode.prev = null;\n this.head = nextNode; \n }\n this.size--;\n }", "removeIndexedNode(index){\n \n \n //find index where node will be removed\n let current = this.head;\n let previous = null;\n let count = 0;\n if (index < 0 || index >= this.size){\n console.log(\"Error: index out of range\")\n return \n }\n else if (index == 0){\n //edge case ...remove first node\n this.head = current.next;\n }else {\n while(count < index){\n previous = current;\n current = current.next;\n count++; //increments count until count == index which stops loop\n }\n previous.next = current.next;\n current.next = null;\n current.data = null;\n current = null;\n}\n this.size--;\n\n}", "function selectionSetNextSmallest(){\n addStep(\"Set Node \" + (selectionSmallest + 1) + \" as the smallest node\");\n setClass(nodes[selectionSmallest], 2, \"Combined\"); //changes the color of the next to the \"current\" and \"smallest\" color\n selectionIndex = selectionCurrent + 1;\n sortedSwitchStep = 1;\n}", "function remove() {\n var index = Math.floor(Math.random() * values.length);\n console.log(\"DEL \" + values[index]);\n tree.remove(values[index]);\n values.splice(index, 1);\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "function clearNode(node) {\n setTextContent(node, \"\");\n}", "removeNodeCommand(node, _isFirst) {\n // TODO SageMath fait automatiquement ça\n let isFirst = _isFirst;\n this.links.forEach(edge => {\n if (edge.source === node || edge.target === node) {\n CommandePatern_1.myManager.Execute(CommandePatern_1.CommandsRepository.SupprEdgeCommand(this, edge, isFirst));\n isFirst = false;\n }\n });\n this.loops.forEach(loop => {\n if (loop.source === node)\n CommandePatern_1.myManager.Execute(CommandePatern_1.CommandsRepository.SupprLoopCommand(this, loop, false));\n });\n CommandePatern_1.myManager.Execute(CommandePatern_1.CommandsRepository.SupprNodeCommand(this, node, false));\n }", "wipeAllPathData() {\n for (let i = 0; i < this.nodes.length; i++) {\n let node = this.nodes[i]\n node.setShortestPath(node)\n node.distance = Number.MAX_SAFE_INTEGER\n }\n\n }", "function delete_node(node) {\n\tif(node.next.next) {\n\t\tnode.val = node.next.val;\n\t\tnode.next = node.next.next;\n\t} else {\n\t\tnode = null;\n\t}\n}", "deleteNodeFront(value) {\n // nothing to delete\n if (!this.head) return null;\n // deleting curr head\n const node = this.head;\n if (this.length === 1) {\n // only 1 elem means all null\n this.head = this.tail = null;\n } else {\n // new head is whatever came after old head\n this.head = node.next;\n // make sure old head.next points to nothing\n node.next = null;\n // new head.prev must point to nothing\n this.head.prev = null;\n }\n this.length -= 1;\n return node;\n }", "moveMinToFront() {\n\t\tlet runner = this.head;\n\t\tlet min = this.head;\n\t\tlet minPrev = null;\n\t\t// console.log(\"min \" + min);\n\t\twhile (runner.next != null) {\n\t\t\tif (runner.next.value < min.value) {\n\t\t\t\tmin = runner.next;\n\t\t\t\tminPrev = runner;\n\t\t\t}\n\t\t\trunner = runner.next;\n\t\t}\n\t\tif (minPrev ==null){\n\t\t\treturn this;\n\t\t}\n\t\tminPrev = min.next;\n\t\t// console.log(\"end min: \" + min);\n\t\t// this.removeVal(min);\n\t\t// this.addToFront(min);\n\n\t}", "function unFreeze(node){\n node.fixed = false;\n for( var i = 0; i < node.get('transitions').length; i++ ) {\n var childNode = idMap[node.get('transitions')[i].target];\n unFreeze(childNode);\n }\n }", "removeFront () {\n\t\tthis.remove(0);\n\t}" ]
[ "0.7383449", "0.6988974", "0.69006515", "0.69006515", "0.68844527", "0.65875614", "0.6582033", "0.65137094", "0.6493366", "0.6442281", "0.6390009", "0.6350146", "0.63184255", "0.63092464", "0.63092464", "0.6276753", "0.6263889", "0.62426925", "0.6183698", "0.61782646", "0.6161071", "0.6161071", "0.6157428", "0.6138245", "0.6135714", "0.61340857", "0.6095085", "0.60913736", "0.6057173", "0.6032015", "0.602993", "0.59965193", "0.5996244", "0.5996244", "0.5996244", "0.5959638", "0.59220344", "0.5921266", "0.5919422", "0.5910752", "0.59043366", "0.5898655", "0.5892927", "0.588763", "0.5885152", "0.58720964", "0.5870577", "0.585645", "0.58511406", "0.5822069", "0.58202606", "0.5820085", "0.5797806", "0.5787681", "0.57837427", "0.57726395", "0.5765928", "0.5765928", "0.5764275", "0.57568043", "0.57525295", "0.5749673", "0.57485694", "0.5745871", "0.57413244", "0.57347035", "0.571328", "0.57117456", "0.570569", "0.56899804", "0.5686686", "0.5678305", "0.5666476", "0.5662475", "0.56623626", "0.5647267", "0.56435126", "0.5640923", "0.56350344", "0.5633012", "0.56243616", "0.5624209", "0.5618932", "0.5615538", "0.5609859", "0.5608117", "0.5606949", "0.56023955", "0.56023955", "0.56023955", "0.56023955", "0.56023955", "0.56023955", "0.559563", "0.55900383", "0.5587064", "0.55862564", "0.5585941", "0.55828357", "0.5581769" ]
0.8056322
0
min key of bst (used as helper function)
min() { return this.minHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minKey(key,mstSet) \n{ \n // Initialize min value \n let min = Number.MAX_VALUE, min_index; \n for (let v = 0; v < V; v++) \n if (mstSet[v] == false && key[v] < min) \n min = key[v], min_index = v; \n \n return min_index; \n}", "min() {\n const minNode = this.findMinNode(this.root);\n if (minNode) {\n return minNode.key;\n }\n return null;\n }", "function min(node) { \n var keyToReturn = node.key;\n if (node != null && node.key != 'null'){\n if (node.left.key != 'null') {\n keyToReturn = min(node.left);\n } else {\n keyToReturn = node.key;\n //deleteMin(node);\n }\n }\n return keyToReturn;\n }", "getMinKey () {\n return this.getMinKeyDescendant().key\n }", "minimum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMinimum(this.root).key;\n }", "function BSTMin(){\n var walker = this.root;\n while (walker.left != null){\n walker = walker.left;\n }\n return walker.val;\n }", "getMinKeyDescendant () {\n if (this.left) return this.left.getMinKeyDescendant()\n else return this\n }", "findJobMin(getterFn) {\n const jobsSorted = this.sampleJobs\n .slice()\n .sort((job1, job2) => getterFn(job1) - getterFn(job2));\n return getterFn(jobsSorted[0]);\n }", "function bnGetLowestSetBit() {\n\tfor(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\tif(this.s < 0) return this.t*this.DB;\n\treturn -1;\n }", "function getLowestFScore(openSet, fScore){\r\n\tvar minValue = Infinity;\r\n\tvar minNode = null;\r\n\tfor (var key in openSet){\r\n\t\tif(fScore [openSet[key]]<minValue){\r\n\t\t\tminValue = fScore [openSet[key]];\r\n\t\t\tminNode = openSet[key];\r\n\t\t}\r\n\t}\r\n\t\treturn minNode;\t\r\n}", "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "#minchild(x) {\n\t\tthis.downsteps++;\n\t\tlet minc = this.left(x);\n\t\tif (minc > this.m) return 0;\n\t\tfor (let y = minc + 1; y <= this.right(x) && y <= this.m; y++) {\n\t\t\tthis.downsteps++;\n\t\t\tif (this.#key[this.#item[y]] < this.#key[this.#item[minc]])\n\t\t\t\tminc = y;\n\t\t}\n\t\treturn minc;\n\t}", "function bnGetLowestSetBit()\n{\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n\tfor(var i = 0; i < this.t; ++i)\n\t if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n\tif(this.s < 0) return this.t*this.DB;\n\treturn -1;\n\t}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "lowestCommonAncestor(a, b) {\n if (this.key === a || this.key === b) {\n return this.key;\n }\n\n const left = this.left ? this.left.lowestCommonAncestor(a, b) : null;\n const right = this.right ? this.right.lowestCommonAncestor(a, b) : null;\n\n if (left && right) {\n return this.key;\n }\n\n return left ? left : right;\n }", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "function bnGetLowestSetBit() {\r\n\t for (var i = 0; i < this.t; ++i)\r\n\t if (this[i] != 0) return i * this.DB + lbit(this[i]);\r\n\t if (this.s < 0) return this.t * this.DB;\r\n\t return -1;\r\n\t}", "function bnGetLowestSetBit() {\r\n\t for (var i = 0; i < this.t; ++i)\r\n\t if (this[i] != 0) return i * this.DB + lbit(this[i]);\r\n\t if (this.s < 0) return this.t * this.DB;\r\n\t return -1;\r\n\t}", "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t}", "function bnGetLowestSetBit() {\n\t for (var i = 0; i < this.t; ++i)\n\t if (this[i] != 0) return i * this.DB + lbit(this[i])\n\t if (this.s < 0) return this.t * this.DB\n\t return -1\n\t}", "function bnGetLowestSetBit() {\n\t for (var i = 0; i < this.t; ++i)\n\t if (this[i] != 0) return i * this.DB + lbit(this[i])\n\t if (this.s < 0) return this.t * this.DB\n\t return -1\n\t}", "function getFirstKey(dumpsList){\n let firstKeyDump = dumpsList[3];\n return firstKeyDump;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "function indexOfMin(a) {\n\tvar nMin = 0;\n\tfor (i in a) {\n\t\tif (a[i] < a[nMin])\n\t\t\tnMin = i;\n\t}\n\treturn nMin;\n}// 2015 (c) dr.Igor Mazurok: [email protected]", "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "findmin() { return this.empty() ? 0 : this.itemAt(1); }", "function bst({ root, key }) {\n if(!root) {\n root = { key };\n }\n else if (key < root.key) {\n root.left = bst({ root: root.left, key });\n }\n else {\n root.right = bst({ root: root.right, key });\n }\n return root;\n}", "get minIndex() {\n return Number(this.getAttribute(\"min\"));\n }", "min() {\n let currentNode = this.root;\n // continue traversing left until no more children\n while(currentNode.left) {\n currentNode = currentNode.left;\n }\n return currentNode.value;\n }", "function min(a,b) {return a < b ? a : b; }", "find_min(node) {\n if (node.left) {\n return this.find_min(node.left)\n } else {\n return node;\n }\n }", "function smallest(str){\n var newobj = {};\n \n for(var i=0; i<str.length; i++)\n { if (str.charAt(i) in newobj) \n {\n newobj[str[i]] += 1;\n } else {\n newobj[str[i]] = 1;\n }\n } \n \n console.log(newobj);\n \n /* var smallest1 = 2;\n var k ='';\n \n for(var key in newobj)\n { if (newobj[key]<smallest1) {\n smallest1 = newobj[key];\n k = key; \n }\n }\n */\n \n var k ='';\n var smallest = Object.keys(newobj).reduce(function(sm,elem){\n if (newobj[elem] < sm){\n sm = newobj[elem];\n k = elem;\n }\n return sm;\n },+Infinity);\n \nconsole.log(k);\nreturn smallest ; \n \n}", "getMinOrder(payload){ // payload = {storeName (req)};\n var orderID, minOrder = 0, storeObjs;\n\n orderID = this.getStoreOrderID(payload);\n storeObjs = this.getArrDataObjs(payload);\n if(orderID && storeObjs){\n if(storeObjs.length > 0){\n minOrder = storeObjs.reduce(function(min, dataObj){\n return dataObj[orderID].dbVal < min ? dataObj[orderID].dbVal : min;\n }, 0);\n }\n }\n return minOrder;\n }", "findSmallest() {\n let node = this;\n while (node) {\n if (!node.left) return node.value;\n node = node.left;\n }\n }", "findSmallest() {\n if (this.left) return this.left.findSmallest();\n return this.value;\n }", "function min(arr){\n return sortNumbers(arr)[0];\n }", "function min(x) {\n \tif (x.left == null || x.left == undefined)\n \t\treturn x;\n \telse \n \t\treturn min(x.left);\t\n }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "get min() { return this._min; }", "function findSmallestDistance(){\n\tvar minimum=100000;\n\tvar node=-1;\n\tunvisited.forEach(function(item){\n\t\tif(distance[item]<=minimum){\n\t\t\tminimum=distance[item];\n\t\t\tnode=item;\n\t\t}\n\t})\n\tif(node==-1){\n\t\tconsole.log(\"this should never happen\");\n\t}\n\treturn node;\n}", "dequeue() {\n // set a variable equal to the object keys array\n var keys = Object.keys(this.storage);\n // set a variable equal to the lowest key value\n var lowest = this.storage[keys[0]];\n // delete the lowest key value\n delete this.storage[keys[0]];\n // return the lowest key value variable\n return lowest;\n }", "function key(pair) { return pair[0]; }", "function getMin(s) {\n\tvar x;\n\tvar min = Number.POSITIVE_INFINITY;\n\tfor (x in s) {\n\t\tif (s[x] < min) {\n\t\t\tmin = s[x];\n\t\t}\n\t}\n\treturn min;\n}", "function treeFindMinX(node, currentMin){\n\tif(typeof node===\"undefined\") node=kdtree;\n\tif(node===null) return currentMin;\n\tif(typeof currentMin!==\"number\") currentMin=node.pnt.x;\n\telse currentMin=Math.min(node.pnt.x,currentMin);\n\tif(node.dim==0) return treeFindMinX(node.left, currentMin);\n\tcurrentMin=treeFindMinX(node.left, currentMin);\n\tcurrentMin=treeFindMinX(node.right, currentMin);\n\treturn currentMin;\n}", "function keysrt(key) {\n return function(a, b){\n if (a[key].toLowerCase() > b[key].toLowerCase()) return 1;\n if (a[key].toLowerCase() < b[key].toLowerCase()) return -1;\n return 0;\n }\n}", "function smallest(x) {\r\n // if cache exists use cache\r\n if (loudest[x] != -1) return loudest[x]\r\n \r\n // if none has more money than x, return x\r\n let cur = x\r\n if (!dic[x]) {\r\n return cache(cur)\r\n }\r\n\r\n // for each y has more money than x, check if update loudest\r\n for (let y of dic[x]) {\r\n let z = smallest(y)\r\n if (quiet[z] < quiet[cur]) {\r\n cur = z\r\n }\r\n }\r\n return cache(cur)\r\n\r\n function cache(v) {\r\n loudest[x] = v\r\n return v\r\n }\r\n }" ]
[ "0.7765121", "0.7436394", "0.74103135", "0.7381988", "0.7113029", "0.6510588", "0.6460559", "0.63056743", "0.6169822", "0.6135426", "0.61296546", "0.61219144", "0.6117367", "0.6096558", "0.6096558", "0.60959053", "0.60959053", "0.60959053", "0.60955966", "0.60948294", "0.60948294", "0.60932016", "0.6093099", "0.6093099", "0.6093099", "0.6093099", "0.6093099", "0.6093099", "0.6093099", "0.6092", "0.6092", "0.6091539", "0.6087173", "0.6087173", "0.60864097", "0.60831404", "0.60831404", "0.60831404", "0.60831404", "0.60831404", "0.60809517", "0.60809517", "0.60809517", "0.60809517", "0.60809517", "0.60809517", "0.60809517", "0.60804445", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60713416", "0.60419196", "0.60419196", "0.60361534", "0.60316235", "0.5997285", "0.5988952", "0.5878338", "0.5865484", "0.5858756", "0.58548295", "0.58542657", "0.58494174", "0.58429813", "0.58267236", "0.58230335", "0.5818529", "0.5816143", "0.5816143", "0.5816143", "0.5816143", "0.5816143", "0.5816143", "0.58065736", "0.58059657", "0.57893556", "0.5788485", "0.5785577", "0.57636535", "0.5748868" ]
0.57721007
98
max key of bst
max() { return this.maxHelper(this.root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMaxKey () {\n return this.getMaxKeyDescendant().key\n }", "maxNode(node) {\n if (node) {\n while (node && node.right !== null) {\n node = node.right;\n }\n return node.key;\n }\n }", "function max(node) { \n var keyToReturn = node.key;\n if (node != null && node.key != 'null'){\n if (node.right.key != 'null') {\n keyToReturn = max(node.right);\n } else {\n keyToReturn = node.key;\n //deleteMin(node);\n }\n }\n return keyToReturn;\n }", "maximum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMaximum(this.root).key;\n }", "getMaxKeyDescendant () {\n if (this.right) return this.right.getMaxKeyDescendant()\n else return this\n }", "function maxStatsKey (stats) {\n var max = 0\n var maxKey = ''\n for (var key in stats) {\n if (stats[key] > max) {\n max = stats[key]\n maxKey = key\n }\n }\n\n return maxKey\n}", "function thirdLargestNode(tree) {\n tree.remove(tree._findMax().key);\n tree.remove(tree._findMax().key);\n return tree._findMax().key;\n}", "function BSTMax(){\n var walker = this.root;\n while (walker.right != null){\n walker = walker.right;\n }\n return walker.val;\n }", "function findKthLargestValueInBst(tree, k) {\n let treeInfo = new TreeInfo(0, -1)\n reverseInOrderTraverse(tree, k, treeInfo)\n return treeInfo.currVisitedNodeValue\n }", "get maximumValue() {\r\n return this.i.bk;\r\n }", "function indexOfMaxValue(arr, key) {\n var maxWeight = -Infinity;\n var idx = -1;\n arr.forEach(function(o, i) {\n if (o.weight > maxWeight) {\n idx = i;\n maxWeight = o.weight;\n }\n });\n return idx;\n }", "lastKey() {\n return this.keyArray()[this.keyArray().length - 1];\n }", "get maximumValue() {\n return this.i.bk;\n }", "function findKthLargestValueInBst(tree, k) {\n const treeInfo = new TreeInfo(0, -1);\n reverseInOrderTraverse(tree, k, treeInfo);\n return treeInfo.latestVisitedNodeValue;\n}", "function max_key_length(data) {\r\n \tvar max = 0;\r\n for(var i = 0; i < data.length; i++) {\r\n if (data[i].key.length > max) {\r\n max = data[i].key.length;\r\n }\r\n }\r\n return max\r\n }", "function thirdLargestKey(tree) {\n if (!tree.right) {\n return findThirdLargestKey(tree.key);\n }\n return thirdLargestKey(tree.right);\n}", "function getMaxTree(node) {}", "function greatestKeyByVal(hash) {\n let sortedByValue = Object.entries(hash).sort( ([k1, v1], [k2, v2]) => {\n if (v1 < v2) {\n return -1;\n } else if (v1 === v2) {\n return 0;\n } else {\n return 1;\n }\n });\n return sortedByValue.slice(-1)[0][0];\n}", "function maxBin (all) {\n\t if (all.length < 1) {\n\t return null;\n\t }\n\t var maxi = 0, max = _chart.ordering()(all[0]);\n\t for (var i = 1; i < all.length; ++i) {\n\t var v = _chart.ordering()(all[i]);\n\t if (v > max) {\n\t max = v;\n\t maxi = i;\n\t }\n\t }\n\t return all[maxi];\n\t }", "function getHighestKeyFromObject(object) {\n var keys = [];\n $.each(object, function (index) {\n keys.push(index);\n });\n return Math.max.apply(null, keys);\n }", "function findKthBiggest(root, k) {}", "function max_index(n){\n var m = n[0], b = 0;\n for(var i = 1; i < n.length; i++)\n if(n[i] > m) m = n[b = i];\n return b;\n}", "function getMaxValue(data) {\n var priMaxValue = data.reduce(function(a, b) {\n return data.find(function(status){\n return status[graphEntries.primary.key] === Math.max(a[graphEntries.primary.key], b[graphEntries.primary.key]);\n });\n })[graphEntries.primary.key];\n\n var secMaxValue = data.reduce(function(a, b) {\n return data.find(function(status){\n return status[graphEntries.secondary.key] === Math.max(a[graphEntries.secondary.key], b[graphEntries.secondary.key]);\n });\n })[graphEntries.secondary.key];\n return Math.max(priMaxValue, secMaxValue);\n }", "findMax() {\n\n // It will keep the last data until current right is null\n let current = this.root;\n while (current.right !== null) {\n current = current.right;\n }\n\n return current.data;\n }", "max() {\n let currentNode = this.root;\n // continue traversing right until no more children\n while(currentNode.right) {\n currentNode = currentNode.right;\n }\n return currentNode.value;\n }", "extractMax(){\r\n if(this.values.length === 1) return this.values.pop();\r\n const oldRoot = this.values[0];\r\n this.values[0] = this.values[this.values.length-1];\r\n this.values.pop();\r\n let idx = 0;\r\n let child1 = (2*idx) + 1;\r\n let child2 = (2*idx) + 2;\r\n\r\n while(this.values[idx] < this.values[child1] || \r\n this.values[idx] < this.values[child2]){\r\n child1 = (2*idx) + 1;\r\n child2 = (2*idx) + 2;\r\n if(this.values[child1] >= this.values[child2]){\r\n let temp = this.values[child1];\r\n this.values[child1] = this.values[idx];\r\n this.values[idx] = temp;\r\n idx = child1;\r\n } else {\r\n let temp = this.values[child2];\r\n this.values[child2] = this.values[idx];\r\n this.values[idx] = temp;\r\n idx = child2;\r\n }\r\n }\r\n return oldRoot;\r\n }", "findMaxValue() {\n\n let current = this.root;\n\n const findMax = (node) => {\n if (node === null) {\n return;\n }\n\n let actualMax = node.value;\n let leftSideMax = findMax(node.left);\n let rightSideMax = findMax(node.right);\n\n if (leftSideMax > actualMax) {\n actualMax = leftSideMax;\n }\n\n if (rightSideMax > actualMax) {\n actualMax = rightSideMax;\n }\n\n return actualMax;\n };\n\n return findMax(current);\n }", "getMostRecentKey() {\r\n return this.listOfMostRecent.head.key;\r\n }", "function findObjKeyWithMaxValue (object) {\n let keyNameWithMax = ''\n let maxVal = -1\n Object.getOwnPropertyNames(object).map(function (eachKey, index) {\n if (object[eachKey] > maxVal) {\n maxVal = object[eachKey]\n keyNameWithMax = eachKey\n }\n })\n return {keyNameWithMax, maxVal}\n}", "getKey() {\n // return last keys as reference\n return this.keys[this.keys.length - 1];\n }", "function selectBiggestId(idArray) {\n var id = idArray[0];\n return id;\n}", "getMostRecentKey() {\n return this.listOfMostRecent.head.key;\n }", "get maxIndex() {\n return Number(this.getAttribute(\"max\"));\n }", "function mostFreqElemBT(rootNode) {\n const freqTracker = new Map();\n\n inOrderTraversal(rootNode, freqTracker);\n\n return [...freqTracker.entries()].reduce((a, b) => a[1] > b[1] ? a : b)[0];\n}", "findJobMax(getterFn) {\n const jobsSorted = this.sampleJobs\n .slice()\n .sort((job1, job2) => getterFn(job2) - getterFn(job1));\n return getterFn(jobsSorted[0]);\n }", "function getHighestWeight(){\n maxWeight = 1;\n\n linkWeightMap.forEach(function(d){\n if(d > maxWeight)\n maxWeight = d;\n });\n\n return maxWeight;\n}", "findMax() {\n let current = this.root;\n // Loop until the rightmost node (no right subtree).\n while (current.right !== null) {\n current = current.right;\n }\n return current.data;\n }", "extractMax() {\n let values = this.values;\n if (values.length === 0) return;\n let max = values[0];\n // For time complexity reasons, I swap first then remove the old root node\n values[0] = values[values.length - 1];\n values.pop();\n console.log(values);\n // instatiate child nodes\n let child1, child2, indexToSwap;\n let currentIndex = 0;\n while (true) {\n child1 = currentIndex * 2 + 1;\n child2 = currentIndex * 2 + 2;\n if (values[currentIndex] >= Math.max(values[child1], values[child2])) {\n break;\n }\n indexToSwap = values[child1] > values[child2] ? child1 : child2;\n if (!values[indexToSwap]) break;\n let oldNode = values[currentIndex];\n values[currentIndex] = values[indexToSwap];\n values[indexToSwap] = oldNode;\n currentIndex = indexToSwap;\n }\n this.values = values;\n return max;\n }", "function findKthLargestValueInBst(tree, k) {\n let results = [];\n\n dfs(tree);\n\n return results[results.length - k];\n\n function dfs(node) {\n if (!node) {\n return;\n }\n\n if (node.left) {\n dfs(node.left);\n }\n\n results.push(node.value);\n\n if (node.right) {\n dfs(node.right);\n }\n }\n}", "function getMaxChunkIds(allKeys) {\n var maxChunkIds = {};\n\n allKeys.forEach(function (key) {\n var keySegments = key.split(\".\");\n // table.chunk.2317\n if (keySegments.length === 3 && keySegments[1] === \"chunk\") {\n var collection = keySegments[0];\n var chunkId = parseInt(keySegments[2]) || 0;\n var currentMax = maxChunkIds[collection];\n\n if (!currentMax || chunkId > currentMax) {\n maxChunkIds[collection] = chunkId;\n }\n }\n });\n return maxChunkIds;\n }", "function max() {\n // set node to the root value\n var node = this.root;\n // loop until there is no more values to the right\n while( node.right != null ) {\n node = node.right; // move to the right value\n } // end while\n return node.data;\n} // end max", "getMinKey () {\n return this.getMinKeyDescendant().key\n }", "findMax() {\r\n\t\treturn this.heap[0];\r\n\t}", "function findThirdLargestKey(key, counter) {\n key = key - 1,\n counter = counter || 0;\n\n if(counter === 1) {\n return key;\n }\n if(myBST.get(key)) {\n counter++;\n return findThirdLargestKey(key, counter);\n }\n if(myBST.get(key) === undefined) {\n return findThirdLargestKey(key, counter);\n }\n}", "min() {\n const minNode = this.findMinNode(this.root);\n if (minNode) {\n return minNode.key;\n }\n return null;\n }", "function minKey(key,mstSet) \n{ \n // Initialize min value \n let min = Number.MAX_VALUE, min_index; \n for (let v = 0; v < V; v++) \n if (mstSet[v] == false && key[v] < min) \n min = key[v], min_index = v; \n \n return min_index; \n}", "lastIndexOf(key) {\n let current = this.tail, index = this.length - 1;\n while(current.object != key && current != null) {\n current = current.prev;\n index--;\n if(current == null)\n return -1;\n }\n return index;\n }", "function HighestNmb(arr) {\n return Math.max.apply(null, arr);\n}", "getMaxOrder(payload){ // payload = {storeName (req)};\n var orderID, maxOrder = 0, storeObjs;\n\n orderID = this.getStoreOrderID(payload);\n storeObjs = this.getArrDataObjs(payload);\n if(orderID && storeObjs){\n if(storeObjs.length > 0){\n maxOrder = storeObjs.reduce(function(max, dataObj){\n return dataObj[orderID].dbVal > max ? dataObj[orderID].dbVal : max;\n }, 0);\n }\n }\n return maxOrder;\n }", "highestScoringWord() {\n // TODO: test and implement\n return this.at(-1);\n }", "function msMax() {\n\t\tlet max1 = msSingle.reduce((a, b) => {\n\t\t\treturn a[1] > b[1] ? a : b;\n\t\t});\n\n\t\treturn parseInt(max1[0]); //function being reduced has 2 key/value pairs in each object. reducing to max in value index 1 then returning value index 0;\n\t}", "maxValue() {\n let currNode = this.top;\n let maxValue = this.top.value;\n \n while (currNode.next) {\n if (currNode.next.value > maxValue) maxValue = currNode.next.value;\n currNode = currNode.next;\n }\n \n return maxValue;\n }", "lastId() {\n const lists = [...this.state.lists];\n return lists.reduce((max, list) => (list.id > max ? list.id : max), 0);\n }", "max(){\r\n if(this.isEmpty()){\r\n console.log(\"Tree is empty!\");\r\n return null;\r\n }\r\n let runner = this.root;\r\n while(runner.right != null){\r\n runner = runner.right;\r\n }\r\n return runner.value;\r\n }", "max() {\n let currentNode = this.root;\n // Case for no root\n if(!currentNode) {\n throw new Error('This tree does not yet contain any values');\n return;\n }\n while(currentNode.right) {\n currentNode = currentNode.right;\n }\n return currentNode.value;\n }", "function getMax(array){\n var max=0;\n for(var i=0;i<array.length;i++){\n map=array[i];\n if(map[\"cnt\"]>max)\n max=map[\"cnt\"];\n }\n return max;\n}", "getMax() {\n return this.storage[0];\n }", "getMax() {\n return this.storage[0];\n }", "function mostFreq(node){\n let freq = new Map()\n let mostFreqKey = null\n let maxOccurance = -Infinity\n visit(node)\n \n function visit(node){\n if(!node) return \n visit(node.left)\n visit(node.right)\n const count = (freq.get(node.val) || 0) + 1\n\n if(count > maxOccurance) {\n mostFreqKey = node.val\n maxOccurance = count\n }\n freq.set(node.value, count)\n }\n\n return mostFreqKey\n}", "function whichOneHasMax(m, n) {\n if(m[m.length-1] === n[n.length-1]) return 0\n if(m[m.length-1] > n[n.length-1]) return 1\n if(m[m.length-1] < n[n.length-1]) return -1\n }", "max() {\n let current = this.root\n if (current == null)\n return null\n while (current.right != null)\n current = current.right\n return current.content\n }", "function findDeadPerson(dict) {\n var maxID = \"\";\n var maxCount = 0;\n\n for (var key in dict) {\n\talert(\"key: \" + key);\n }\n /*\n for (var i = 0; i < dict.length; i++) {\n\tif (dict[i] > maxCount) {\n\t maxID = ;\n\t maxCount = dict[i];\n\t}\n }*/\n\n \n alert(\"maxId \" + maxID);\n return maxID;\n}", "function ifMax(id) {\r\n\t//var i = 0;\r\n\tvar max = true;\r\n\tvar i=getItemIndex(id)+1;\r\n\twhile (i < nodePosition && max == true) {\r\n\t\tif(nodes[i].prentID==getItem(id).parentID){ \r\n\t\t\tmax = false;\r\n\t\t}\r\n\t\ti++;\r\n\t}\r\n\t//alert(nodes[currentIndex].id+\" is max? \"+max);\r\n\treturn max;\r\n}", "findMaxNode() {\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n var runner = this.head\n var temp = runner\n while (runner != null) {\n if ( temp.value < runner.value ){\n temp = runner\n }\n runner = runner.next;\n \n }\n return temp;\n }", "getNodeMaxLevel(node, max) {\n\t\tif (node == undefined)\n\t\t\treturn;\n\n\t\tif (node.level > max.level)\n\t\t\tmax.level = node.level;\n\n\t\tfor (let i = 0; i < node.kids.length; i++) {\n\t\t\tthis.getNodeMaxLevel(node.kids[i], max)\n\t\t}\n\n\t\treturn max.level;\n\t}", "max() {}", "getMax() {\n return Math.max.apply(Math, this.my_orders.map(function(o) { return o.curr_1 }));\n }", "function findNextHighest() {\n var temp = highest;\n while (numStore[highest] === undefined) {\n highest = highest - 1;\n }\n return highest;\n }", "function maxCnt (x) {\n let out = Object.keys(x)\n return out[vectorMaxIdx(Object.values(x))]\n}", "max(S) {}", "function min(node) { \n var keyToReturn = node.key;\n if (node != null && node.key != 'null'){\n if (node.left.key != 'null') {\n keyToReturn = min(node.left);\n } else {\n keyToReturn = node.key;\n //deleteMin(node);\n }\n }\n return keyToReturn;\n }", "getLargest() { \n this.setState({ \n inital:false\n })\n var largestLikeIndex= null\n var largerstLikeNum= 0 \n var root= firebase.database().ref(this.props.groupCode)\n var largest = [] \n var snapshotResults = {}\n var keys = []\n root.child(\"Results\").once('value',function(snapshot){\n snapshotResults= Object.assign({},snapshot.val(),snapshotResults)\n console.log(snapshotResults)\n Object.keys(snapshotResults).map(i=> { \n if(snapshotResults[i].right>largerstLikeNum){ \n largestLikeIndex= i\n largerstLikeNum= snapshotResults[i].right\n }\n })\n var ref= \"CmRaAAAAiJXePWe2z4gmIfMTlehvhKrzDWDSLt3qpzNTTb6ePG09O_9McUVlJqbCtwAtEsQShc3XPENqtszlszeFfAm5SlNQMqMpTblxfBHqkF5nOTxpmdrndfWTgeNLrYH3w99nEhCHIJhs2a4Ssv9xlRHz_7BgGhTSCIlnGXCRiDvvqu1PDOfl6_dbKg\"\n if(!snapshotResults[largestLikeIndex].photoRef==false){\n ref= snapshotResults[largestLikeIndex].photoRef\n // Currently only saves the first photo availalbe. \n }\n largest= {\n 'name': largestLikeIndex, \n 'rating':snapshotResults[largestLikeIndex].rating,\n 'photoReference': ref\n }\n console.log(largest.name)\n root.child(\"Most Voted\").set(largest.name) \n \n }) \n }", "function bstHeight(bst, left = 0, right = 0) {\n if (bst.key === null) {\n return 0;\n }\n\n if (!bst.left && !bst.right) {\n return 1;\n }\n if (bst.left) {\n left = 1 + bstHeight(bst.left, left, right);\n }\n if (bst.right) {\n right = 1 + bstHeight(bst.right, left, right);\n }\n return left > right ? left : right;\n}", "function getCurrentWeight(callback){\n\n var openReq = window.indexedDB.open(\"weightTracker\");\n\n openReq.onsuccess = function() {\n var db = openReq.result;\n var transaction = db.transaction(['weight_history'], 'readonly');\n var objectStore = transaction.objectStore('weight_history');\n var index = objectStore.index('date');\n var openCursorRequest = index.openCursor(null, 'prev');\n var maxObject = null;\n\n openCursorRequest.onsuccess = function (event) {\n if (event.target.result) {\n maxObject = event.target.result.value; //the object with max revision\n }\n };\n\n transaction.oncomplete = function (event) {\n db.close();\n if(callback) {\n \t callback(maxObject);\n } \n };\n }\n}", "function maxValue (arr) {\r\n// liefert die indexnummer des elmentes im array 'arr' mit dem groessten wert\r\n var maxV;\r\n if (arr.length > 0) { // wenn das array ueberhaupt elemente enthaelt\r\n maxV = 0;\r\n for (i = 1; i < arr.length; i++) {\r\n if (arr[i]>arr[maxV]) { maxV = i; }\r\n }\r\n } else {\r\n maxV = null\r\n }\r\n return maxV; \r\n}", "ceiling(key) {\n if (!key) {\n throw new Error('invalid key');\n }\n\n const node = this.doCeiling(this.root, key);\n\n if (!node) {\n return null;\n }\n\n return node.key;\n }", "remove(key) {\n\n // getIndexBelowMax(this.storage[key]);\n }", "function maxKivalasztasValue(arr) {\n let maxValue = 0;\n let maxIndex = 0;\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] > maxValue) {\n maxValue = arr[i];\n maxIndex = i;\n }\n }\n return maxValue;\n}", "findLastKey( whichKey ) {\n\t\treturn this.keysActive.map( e => e.which ).lastIndexOf( whichKey );\n\t}", "maxToBack(){\n // your code here\n var runner = this.head\n var max = runner\n while (runner.next != null){\n if (runner.next.value > max.value){\n max = runner.next\n }\n runner = runner.next\n }\n var temp = runner.value\n runner.value = max.value\n max.value = temp\n return this\n }", "getRange(name) {\n //push new item mimicing new purchase \n var key = name\n var keyObj = {[key]: 1}\n\n\n //train data\n for (let i = 0; i < this.items.length; i++) {\n this.trainingData.push({\n input: this.items[i],\n output: this.range[i]\n })\n }\n\n\n //set up neural net\n const net = new brain.NeuralNetwork({ hiddenLayers: [3]});\n\n\n //train data\n const stats = net.train(this.trainingData)\n //console.log(stats)\n \n \n // Store all ranges of a specific category in \"allRange\" object\n var allRange = net.run({\n keyObj\n })\n //console.log(allRange)\n\n \n // Store the key with the maximum value in \"answer\"\n var answer = Object.keys(allRange).reduce((a, b) => allRange[a] > allRange[b] ? a : b)\n //console.log(answer)\n\n return answer\n\n }", "function maxBasalLookup (inputs) {\n return inputs.settings.maxBasal;\n}", "max() {\n if(this.items.length >0)\n return this.items[this.items.length - 1]\n else\n throw new Error('EmptySortedList')\n }", "getMax() {\n let values = [];\n let current = this.head;\n\n // collect all values in the list\n while (current) {\n values.push(current.value);\n\n current = current.next;\n }\n\n return values.length === 0 ? null : Math.max(...values);\n }", "function getMaxConnId() {\n var maxIdNum = 0;\n for (var rid in relations) {\n var idNum = parseInt(rid.slice(1));\n if (idNum > maxIdNum) {\n maxIdNum = idNum;\n }\n }\n return maxIdNum;\n }", "maxmum() {\n constructor()\n return this.input[this.input.length-1];\n }", "function secondLargestElement(tree) {\n var current = tree;\n var previous = tree.value;\n\n while (current) {\n if (current.left && !current.right) {\n previous = Math.max(current.value, previous);\n current = current.left;\n } else if (current.right) {\n previous = Math.max(current.value, previous);\n current = current.right;\n } else if (!current.right && !current.left) {\n return Math.min(previous, current.value);\n }\n\n }\n}", "function bestContainer(list){\n var i;\n // Max store.\n var a = 0;\n \n for (i = 0; i < list.length; i++){\n // Get store count.\n var b = _.sum(list[i].store)\n if(a > b){\n // keep a\n }\n else{\n // keep b and list item\n a = b\n var fullestContainer = list[i]\n }\n }\n // Return highest store.\n return fullestContainer;\n}", "max(other) {\n return other.pos > this.pos ? other : this;\n }", "function indexHighestNumber(arr) {\n var big = -Infinity\n arr.forEach(function(ele){\n if(ele > big) {\n big = ele\n }\n })\n return a.lastIndexOf(\"big\")\n}", "minimum() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.doMinimum(this.root).key;\n }", "deleteMax() {\n // recall that we have an empty position at the very front of the array, \n // so an array length of 2 means there is only 1 item in the heap\n\n if (this.array.length === 1) return null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// edge case- if no nodes in tree, exit\n\n if (this.array.length === 2) return this.array.pop();\t\t\t\t\t\t\t\t\t\t\t\t// edge case- if only 1 node in heap, just remove it (2 bec. null doesnt count)\n\n let max = this.array[1];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// save reference to root value (max)\n\n this.array[1] = this.array.pop();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // remove last val in array (farthest right node in tree), and update root value with it\n\n this.siftDown(1);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// continuoully swap the new root toward the back of the array to maintain maxHeap property\n\n return max;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// return max value\n }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "get max() { return this._max; }", "function findMax(ar)\r\n{\r\n\tvar maxnum = ar.reduce((cur,item) =>{\r\n\t\tif(item > cur)\r\n\t\t\treturn item;\r\n\t\treturn cur;\r\n\t},0)\r\n\treturn maxnum;\r\n}", "function maxChar(str) {\n const map = new Map();\n for(c of str) {\n if(map.get(c) === undefined) {\n map.set(c,1);\n } else {\n map.set(c, map.get(c)+1);\n }\n }\n let maxVal = 0;\n let keyRet = '';\n for(var [key, value] of map) {\n if(value > maxVal) {\n maxVal = value;\n keyRet = key;\n }\n }\n\n return keyRet;\n}" ]
[ "0.7417824", "0.7282816", "0.7147359", "0.70557886", "0.66765076", "0.6442911", "0.6403701", "0.63958293", "0.6278479", "0.62258345", "0.6217179", "0.62098986", "0.6203329", "0.6197103", "0.61727077", "0.6158078", "0.6141446", "0.6104041", "0.60833156", "0.6047678", "0.5978829", "0.5975873", "0.5924713", "0.58798176", "0.5813527", "0.57982236", "0.57951105", "0.5781219", "0.57599556", "0.57383525", "0.57248896", "0.5722055", "0.5704803", "0.57006276", "0.56487745", "0.56332135", "0.56328857", "0.5632375", "0.56112593", "0.5592381", "0.5591984", "0.5589933", "0.55879045", "0.5577246", "0.5565954", "0.55514663", "0.55355674", "0.55171436", "0.55140716", "0.5511376", "0.55059516", "0.55026895", "0.5500316", "0.54989433", "0.5491662", "0.5488678", "0.5488438", "0.5488438", "0.5488262", "0.5470228", "0.5465743", "0.5456118", "0.54539496", "0.5450149", "0.54494035", "0.54293996", "0.54236484", "0.54184335", "0.54070324", "0.5403756", "0.5401815", "0.5394169", "0.5384543", "0.5383591", "0.5380154", "0.5366969", "0.53515935", "0.5344475", "0.53423905", "0.5340853", "0.53386897", "0.5338019", "0.53348804", "0.53325313", "0.53276414", "0.5321242", "0.53187054", "0.53111416", "0.5303732", "0.5301895", "0.53011805", "0.52974105", "0.52909344", "0.52909344", "0.52909344", "0.52909344", "0.52909344", "0.52909344", "0.5284195", "0.5283221" ]
0.5695654
34
return all nodes in bst
nodes() { if (this.isEmpty()) return []; return this.nodesHelper1(this.min().key, this.max().key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "list_nodes() {\n let result = this._list_nodes_in_subtree(this.root);\n return result;\n }", "bfs() {\n const visitedNodes = [];\n const nodeQueue = [this.root];\n\n while(nodeQueue.length){\n const currentNode = nodeQueue.shift();\n visitedNodes.push(currentNode.val);\n if(currentNode.left) nodeQueue.push(currentNode.left);\n if(currentNode.right) nodeQueue.push(currentNode.right);\n }\n return visitedNodes;\n }", "*nodes(){\n if(!this.root) return;\n let stack = [this.root];\n while(stack.length){\n const node = stack.pop();\n if(node.left) stack.push(node.left);\n if(node.right) stack.push(node.right);\n yield node;\n }\n }", "LeafNodes() {\r\n\r\n\t\tif(this.isEmpty()){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\telse{\r\n\t\t\tvar result = [];\r\n\r\n\t\t\tvar traverse = node => {\r\n\t\t\t\tif (node.left !== null)\r\n\t\t\t\t\ttraverse(node.left);\r\n\r\n\t\t\t\tif (node.right !== null)\r\n\t\t\t\t\ttraverse(node.right);\r\n\r\n\t\t\t\tif (node.left === null && node.right === null)\r\n\t\t\t\t\tresult.push(node.value);\r\n\t\t\t}\r\n\r\n\t\t\ttraverse(this.root);\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "function getNodes() {\n return d3.selectAll('g .node');\n}", "function visibleNodes() {\n var temp = [];\n for (var i = 0; i < root.length ; i++) {\n if(root[i]){\n temp.push(root[i]);\n }\n }\n return temp;\n}", "bfs() {\n let result = [],\n queue = [],\n node = null;\n\n queue.push(this.root);\n\n while (queue.length) {\n node = queue.shift();\n result.push(node);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n\n return result;\n }", "function getNodes() {\n var allNodes = nodes.get();\n var nodeList = [];\n for(var i = 0; i < allNodes.length; i++) {\n nodeList.push(allNodes[i].id);\n }\n return nodeList;\n}", "getNodes() {\n return this.model.getNodes();\n }", "bfs() {\n let result = [];\n let queue = [];\n queue.push(this.root);\n while(queue.length) {\n let currentNode = queue.shift();\n result.push(currentNode.value);\n if (currentNode.left) {\n queue.push(currentNode.left);\n }\n if (currentNode.right) {\n queue.push(currentNode.right);\n }\n }\n return result;\n }", "bfs() {\r\n let result = []\r\n let queue = []\r\n\r\n queue.push(this.root)\r\n\r\n while (queue.length) {\r\n //dequeue\r\n let currentNode = queue.shift()\r\n\r\n //push to result\r\n result.push(currentNode.data)\r\n\r\n //enqueue child nodes\r\n //push to result\r\n if (currentNode.left) {\r\n queue.push(currentNode.left)\r\n }\r\n if (currentNode.right) {\r\n queue.push(currentNode.right)\r\n } \r\n }\r\n\r\n return result\r\n }", "function nodes(tree) {\n\t var nodes = [];\n\t // tree.walk((node, x0, y0, x1, y1) => {\n\t // node.x0 = x0, node.y0 = y0;\n\t // node.x1 = x1, node.y1 = y1;\n\t // nodes.push(node);\n\t // });\n\t var collect = tree._bucketSize === 0\n\t ? function (n) { if (!n.data) { nodes.push(n); } }\n\t : function (n) { nodes.push(n); };\n\t tree.postOrder(getTightBoxes);\n\t tree.preOrder(collect);\n\t return nodes;\n\t}", "function getAllNodesNeighborhood(){\n\t\tglobalData.nodes.map(function(node){\n\t\t\tnode.neighbors = getNeighborhoodLabels(node.index)\n\t\t\tneighborhoodLengths.push(node.neighbors.length)\n\t\t\td3.select('#' + node.label)\n\t\t\t\t.attr('neighborhood', node.neighbors.toString())\n\t\t})\n\t}", "getNodes() {\n return Object.values(this.lookup);\n }", "bfsInOrder() {\r\n\r\n\t\tif(this.isEmpty()){\r\n\t\t\treturn []\r\n\t\t}\r\n\r\n\t\telse{\r\n\t\t\tvar result = [];\r\n\r\n\t\t\tvar traverse = node => {\r\n\t\r\n\t\t\t\tif (node.left !== null)\r\n\t\t\t\t\ttraverse(node.left);\r\n\t\r\n\t\t\t\tresult.push(node.value);\r\n\t\r\n\t\t\t\tif (node.right !== null)\r\n\t\t\t\t\ttraverse(node.right);\r\n\t\t\t}\r\n\t\r\n\t\t\ttraverse(this.root);\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "allElems() {\n return this.rootNode;\n }", "allElems() {\n return this.rootNode;\n }", "getNodes() {\n return this.nodes;\n }", "BFS() {\n let data = [],\n queue = [];\n queue.push(this.root);\n while (queue.length) {\n node = queue.shift();\n data.push(node);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n return data;\n }", "nodes(quadtree) {\n var nodes = [];\n quadtree.visit(function(node, x0, y0, x1, y1) {\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n nodes.push(node);\n });\n return nodes;\n }", "bfs() {\n // need to use a queue when we are doing breadth first searching \n let currentNode = this.root;\n let queue = [];\n let visitedNodes = [];\n // push our current value into our queue array \n queue.push(currentNode);\n // while there are still elements in our queue array\n while (queue.length) {\n // first in is the first out so we work with the oldest item\n currentNode = queue.shift();\n // push the current value into our visited Nodes array\n visitedNodes.push(currentNode.val);\n // if there is a left side that exists \n if (currentNode.left) {\n // push that into our queue to work on \n queue.push(currentNode.left);\n }\n // after the left side if a right side exists then we can push that into the queue\n if (currentNode.right) {\n // push that right value into the queue\n queue.push(currentNode.right);\n }\n }\n // return the array of nodes we have visited \n return visitedNodes;\n }", "function populateNodes(tree) {\n var out = [];\n visitInternal(tree, out);\n return out;\n }", "function listNodes(all_nodes) {\n var container = [];\n for (var i in all_nodes) {\n container.push(i);\n }\n return container;\n }", "getLeafNodes() {\n return this.model.getLeafs();\n }", "BFS(){\n var node = this.root,\n queue = [],\n data = []\n \n queue.push(node)\n while(queue.length){\n node = queue.shift()\n data.push(node.value)\n if (node.left) queue.push(node.left)\n if (node.right) queue.push(node.right)\n }\n return data\n }", "BFS() {\n let data = [],\n queue = [],\n node = this.root;\n queue.push(node)\n while (queue.length) {\n node = queue.shift();\n data.push(node);\n if (node.left) queue.push(node.left)\n if (node.right) queue.push(node.right)\n }\n return data;\n }", "bfs() {\n let node = this.root;\n let queue = [];\n let visited = [];\n\n queue.push(node);\n\n while(queue.length){\n node = queue.shift();\n visited.push(node.val);\n if(node.left){\n queue.push(node.left);\n }\n if(node.right) {\n queue.push(node.right);\n }\n }\n\n return visited;\n\n }", "getNodes() {\n return this.target.assignedNodes(this.options);\n }", "getRootNodes() {\n return this.model.getRoots();\n }", "traverseBST() {\n if (this.root == null) return\n let curr = this.root, data = []\n function traverse(curr) {\n if (curr.left != null) traverse(curr.left)\n data.push(curr.data)\n if (curr.right != null) traverse(curr.right)\n return data\n }\n traverse(curr)\n return data\n }", "traverseBF(fn) {\n //will give us some element within our root node, inside an array\n const arr = [this.root]\n\n //while-loop, works as long as array has something in it, is TRUTHY\n while (arr.length) {\n //remove first element out of array, with shift() method\n const node = arr.shift()\n //then take all node's children and push them into our array\n // CAN'T do node.children, would create a nested array\n // use spread operator to take all elements out, and push them into the array\n arr.push(...node.children) //TODO:For-loop, would have been more code!!!\n\n //take node AND pass in to our iterator func\n fn(node)\n }\n }", "printAll() {\n if (!this.root) return;\n \n this.traverseBF((item) => {\n console.log(item);\n })\n }", "printAll() {\n if (!this.root) return;\n \n this.traverseBF((item) => {\n console.log(item);\n })\n }", "bfsTraversal(root) {\r\n const path = []\r\n if(root.children.length === 0)\r\n path.push(root.val)\r\n else {\r\n let bfsQueue = new Queue();\r\n bfsQueue.enqueue(root)\r\n while(bfsQueue.size!==0) {\r\n const currentNode = bfsQueue.dequeue()\r\n for (let child of currentNode.children) {\r\n bfsQueue.enqueue(child)\r\n }\r\n path.push(currentNode.val)\r\n }\r\n }\r\n return path\r\n }", "breadthFirstTraverse() {\n var queue = [this]\n var result = []\n while (queue.length != 0) {\n var head = queue.shift()\n if (head.leftChild !== null)\n queue.push(head.leftChild)\n if (head.rightChild !== null)\n queue.push(head.rightChild)\n result.push(head)\n }\n return result\n }", "randomTrees () {\n return this.generateNodes();\n }", "BFS() {\n var data = [],\n queue = [],\n node = this.root;\n queue.push(node);\n while(queue.length) {\n node = queue.shift();\n data.push(node.value);\n if(node.left) queue.push(node.left);\n if(node.right) queue.push(node.right);\n }\n return data;\n }", "BFS() {\n let data = [];\n let queue = [];\n let node = this.root;\n queue.push(node);\n while (queue.length) {\n node = queue.shift();\n data.push(node.value);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n return data;\n }", "function getAllNodes() {\n return new Promise(function(resolve, reject) {\n db.all('SELECT * FROM Node', function(err, res) {\n if (err)\n return reject(err)\n resolve(res)\n })\n })\n}", "BFS() {\n let node = this.root;\n const data = [];\n const queue = [];\n\n queue.push(node);\n\n while (queue.length) {\n node = queue.shift();\n data.push(node.value);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n return data;\n }", "inorderNodes() {\r\n let queue = [];\r\n\r\n this.inorderNodesHelper(this.root, queue);\r\n\r\n return queue;\r\n }", "function get_all_nodes(callback) {\n\tmongoClient.connect(url, function(err, db) {\n\t\tif (err) {\n\t\t\tcallback(err, 'Can\\'t connect to the server');\n\t\t} else {\n\t\t\tvar collection = db.collection('nodes');\n\t\t\tcollection.find().toArray(function(err, res) {\n\t\t\t\tif (err) {\n\t\t\t\t\tcallback(err, 'Can\\'t find nodes. errcode: ' + err.errcode);\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null, res);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function walkAll(nodes){\n var result = undefined\n for (var i=0;i<nodes.length;i++){\n var childNode = nodes[i]\n if (childNode.type === 'EmptyStatement') continue\n result = walk(childNode)\n if (result instanceof ReturnValue){\n return result\n }\n }\n return result\n }", "function walkAll(nodes){\n var result = undefined\n for (var i=0;i<nodes.length;i++){\n var childNode = nodes[i]\n if (childNode.type === 'EmptyStatement') continue\n result = walk(childNode)\n if (result instanceof ReturnValue){\n return result\n }\n }\n return result\n }", "getNodes(){\n return Object.keys(this.nodes);\n }", "inOrder() {\n let results = [];\n\n let _walk = node => {\n if (node.left) _walk(node.left);\n results.push(node.value);\n if (node.right) _walk(node.right);\n };\n _walk(this.root);\n\n return results;\n }", "get childNodes () {\n return childNodes(this._data).map(data => createNode(data));\n }", "BFS() {\n let data = [],\n queue = [],\n node = this.root\n queue.push(node)\n\n while (queue.length) {\n node = queue.shift()\n data.push(node.value)\n if (node.left) queue.push(node.left)\n if (node.right) queue.push(node.right)\n }\n return data\n }", "DFSPost() {\n let result = [];\n let current = this.root;\n\n function helper(node) {\n if (node.left) {\n helper(node.left);\n }\n if (node.right) {\n helper(node.right);\n }\n result.push(node.value)\n }\n helper(current);\n return result;\n }", "branch(node = undefined, filter = undefined){\r\n\r\n\t\tnode = this.node_null(node);\r\n\t\tlet datas = node; //liste d'objet\r\n\t\t\r\n\t\tlet childrens = this.childrens(node,filter);\r\n\t\tdatas = datas.concat(childrens);\r\n\t\treturn datas;\r\n\t}", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "*nodes(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n pass,\n reverse = false\n } = options;\n var {\n from = [],\n to\n } = options;\n var visited = new Set();\n var p = [];\n var n = root;\n\n while (true) {\n if (to && (reverse ? Path.isBefore(p, to) : Path.isAfter(p, to))) {\n break;\n }\n\n if (!visited.has(n)) {\n yield [n, p];\n } // If we're allowed to go downward and we haven't decsended yet, do.\n\n\n if (!visited.has(n) && !Text.isText(n) && n.children.length !== 0 && (pass == null || pass([n, p]) === false)) {\n visited.add(n);\n var nextIndex = reverse ? n.children.length - 1 : 0;\n\n if (Path.isAncestor(p, from)) {\n nextIndex = from[p.length];\n }\n\n p = p.concat(nextIndex);\n n = Node.get(root, p);\n continue;\n } // If we're at the root and we can't go down, we're done.\n\n\n if (p.length === 0) {\n break;\n } // If we're going forward...\n\n\n if (!reverse) {\n var newPath = Path.next(p);\n\n if (Node.has(root, newPath)) {\n p = newPath;\n n = Node.get(root, p);\n continue;\n }\n } // If we're going backward...\n\n\n if (reverse && p[p.length - 1] !== 0) {\n var _newPath = Path.previous(p);\n\n p = _newPath;\n n = Node.get(root, p);\n continue;\n } // Otherwise we're going upward...\n\n\n p = Path.parent(p);\n n = Node.get(root, p);\n visited.add(n);\n }\n }", "breadthFirstTraversal() {\n let traversal = [];\n let queue = [];\n queue.unshift(this.root);\n while (queue.length > 0) {\n let node = queue.pop();\n traversal.push(node.value);\n if (node.left) {\n queue.unshift(node.left);\n }\n if (node.right) {\n queue.unshift(node.right);\n }\n }\n return traversal;\n }", "*descendants() {\r\n let state = this.next;\r\n while (state != null) {\r\n yield state;\r\n state = state.next;\r\n }\r\n }", "BFS() {\n let result = [];\n let queue = [];\n let current = this.root;\n let dequeued;\n\n if (!this.root) return undefined;\n queue.push(this.root);\n while (queue.length) {\n current = queue.shift();\n result.push(current.value);\n if (current.left) {\n queue.push(current.left);\n }\n if (current.right) {\n queue.push(current.right);\n }\n }\n return result;\n }", "*nodes(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n pass,\n reverse = false\n } = options;\n var {\n from = [],\n to\n } = options;\n var visited = new Set();\n var p = [];\n var n = root;\n\n while (true) {\n if (to && (reverse ? Path.isBefore(p, to) : Path.isAfter(p, to))) {\n break;\n }\n\n if (!visited.has(n)) {\n yield [n, p];\n } // If we're allowed to go downward and we haven't descended yet, do.\n\n\n if (!visited.has(n) && !Text.isText(n) && n.children.length !== 0 && (pass == null || pass([n, p]) === false)) {\n visited.add(n);\n var nextIndex = reverse ? n.children.length - 1 : 0;\n\n if (Path.isAncestor(p, from)) {\n nextIndex = from[p.length];\n }\n\n p = p.concat(nextIndex);\n n = Node.get(root, p);\n continue;\n } // If we're at the root and we can't go down, we're done.\n\n\n if (p.length === 0) {\n break;\n } // If we're going forward...\n\n\n if (!reverse) {\n var newPath = Path.next(p);\n\n if (Node.has(root, newPath)) {\n p = newPath;\n n = Node.get(root, p);\n continue;\n }\n } // If we're going backward...\n\n\n if (reverse && p[p.length - 1] !== 0) {\n var _newPath = Path.previous(p);\n\n p = _newPath;\n n = Node.get(root, p);\n continue;\n } // Otherwise we're going upward...\n\n\n p = Path.parent(p);\n n = Node.get(root, p);\n visited.add(n);\n }\n }", "function nodesToArr2() {\n let body = document.querySelector('body');\n return treeTags(body);\n}", "getNodes() {\n if (\"subtree\" in this.options) {\n return Array.from(this.target.querySelectorAll(this.options.selector));\n }\n\n return Array.from(this.target.childNodes);\n }", "function getAllNodes(grid) {\n const nodes = [];\n for (const row of grid) {\n for (const node of row) {\n nodes.push(node);\n }\n }\n return nodes;\n}", "function list() {\n return request({\n url: `/nodes`,\n method: 'GET'\n })\n}", "dfsPostOrder() {\n let result = [];\n const traverse = node => {\n if (node.left) {\n traverse(node.left)\n }\n if (node.right) {\n traverse(node.right)\n }\n result.push(node.data);\n }\n\n\n traverse(this.root)\n return result;\n }", "function BTree(){\n\tthis.root = null;\n\tthis.length = 0;\n}", "BFSRecursive(levelNodes) {\n\n if (levelNodes.length) {\n\n var data = levelNodes.map(node => node.data);\n\n console.log(data.join(' '));\n\n var newLevelNodes = [];\n\n levelNodes.forEach(function (node) {\n if (node.left != null) newLevelNodes.push(node.left);\n if (node.right != null) newLevelNodes.push(node.right);\n });\n\n this.BFSRecursive(newLevelNodes);\n\n }\n\n }", "function bfs(node) {\n let q = [];\n let level = 0;\n q.push(node);\n\n while (q.length > 0) {\n let cur = q.shift();\n console.log(cur.data);\n if (cur.left !== null || cur.right !== null) {\n level++;\n if (cur.left !== null) {\n q.push(cur.left);\n }\n if (cur.right !== null) {\n q.push(cur.right);\n }\n }\n }\n\n console.log(level);\n}", "function breadthFirstArray(root){\r\n let queue = [root];\r\n let checkedNodesVals = [];\r\n while(queue.length){\r\n let node = queue.shift();\r\n\r\n checkedNodesVals.push(node.val);\r\n\r\n if(node.left) queue.push(node.left);\r\n if(node.right) queue.push(node.right);\r\n }\r\n return checkedNodesVals;\r\n}", "inOrder() {\n const results = [];\n const _traverse = (node) => {\n if (node.left) _traverse(node.left);\n results.push(node.value);\n if (node.right) _traverse(node.right);\n };\n\n _traverse(this.root);\n return results;\n }", "function nodesAtLevels() {\n let x = createVector(WIDTH / 2, HEIGHT);\n let y = createVector(WIDTH / 2, HEIGHT - LENGTH);\n let root = new Branch(x, y, BRANCH_ANGLE, LENGTH_FACTOR);\n\n let byLevel = [];\n byLevel.push([root]);\n\n for (let i = 1; i < LEVELS; i++) {\n let prev = byLevel[i - 1];\n let curr = [];\n prev.forEach(b => {\n let t = b.branch();\n curr = curr.concat(t);\n })\n byLevel.push(curr);\n }\n return byLevel;\n}", "breadthFirstSearch(){\n var data = [];\n var queue = [];\n\n queue.push(this.root);\n\n while(queue.length){\n var temp = queue.shift();\n data.push(temp);\n if(temp.left){\n queue.push(temp.left);\n }\n if(temp.right){\n queue.push(temp.right)\n }\n }\n return data;\n }", "function getRoot(nodes){\n\tvar rootNodes=[];\n\tfor (var a=0;a<nodes.length;a++)\n\t{\n\t\tif (nodes[a].incoming.length==0)\n\t\t{\n\t\t\trootNodes.push(nodes[a]);\n\t\t}\n\n\t}\n\treturn rootNodes;\n}", "function calculateNodesList(page) {\n var config = page.config;\n var linkHeight = config.getLinkHeight();\n var treeData = page.root;\n var treeLayout = page.treeLayout;\n var nodesList;\n\n nodesList = treeLayout.nodes(treeData).reverse();\n nodesList.forEach(function(d){\n d.y = d.depth * linkHeight;\n d.y += 80;\n });\n\n return nodesList;\n}", "BFS() {\n let q = [this.root];\n let visited = [];\n let node = null;\n while ((node = q.shift())) {\n visited.push(node.val);\n if (node.left !== null) q.push(node.left);\n if (node.right !== null) q.push(node.right);\n }\n return visited;\n }", "function bfs(node) {\n var queue = [];\n queue.push(node);\n while(queue.length > 0) {\n // Pop first thing from the queue\n var n = queue.shift();\n console.log(n.name);\n // Add children to queue\n n.children.forEach(function(child) {\n queue.push(child);\n });\n }\n}", "inOrder() {\n const results = [];\n const _traversal = (node) => {\n if (node.left) _traversal(node.left);\n results.push(node.value);\n if (node.right) _traversal(node.right);\n };\n _traversal(this.root);\n return results;\n }", "split() {\n return this.nodes.map(node => GraphNode([node], this.graph, this.sources));\n }", "bfs(tree, values = []) {\n const queue = new queue(); //Assuming a Queue is implemented\n const node = tree.root; \n queue.enqueue = tree.root; \n while (queue.length) {\n const node = queue.dequeue(); //remove from the queue\n values.push(node.value); //add that value from queue to an array\n\n if (node.left) {\n queue.dequeue(node.left) //add left child to the queue\n }\n if (node.right) {\n queue.enqueue(node.rigth) //add right child to the queue\n }\n return values; \n }\n }", "* iterNodeIds() {\n yield* this.nodes.keys();\n }", "breadthFirstSearch() {\n const result = [];\n const queue = [];\n\n // push to queue\n queue.push(this.root);\n\n while (queue.length) {\n // pop node from queue\n const currentNode = queue.shift();\n\n // push it to result\n result.push(currentNode.value);\n\n // check for left child\n if (currentNode.left) {\n queue.push(currentNode.left);\n }\n\n // check for right child\n if (currentNode.right) {\n queue.push(currentNode.right);\n }\n }\n\n return result;\n }", "DFSIn() {\n let result = [];\n let current = this.root;\n\n function helper(node) {\n if (node.left) {\n helper(node.left);\n }\n result.push(node.value);\n if (node.right) {\n helper(node.right);\n }\n }\n helper(current);\n return result;\n }", "DFSPre() {\n let result = [];\n let current = this.root;\n\n function helper(node) {\n result.push(node.value);\n if (node.left) {\n helper(node.left);\n }\n if (node.right) {\n helper(node.right);\n }\n }\n helper(current);\n return result;\n }", "get childNodes()\n\t{\n\t\tvar result = [];\n\n\t\tif (this.distLists.length > 0) {\n\t\t\tfor each(var distList in this.distLists) {\n\t\t\t\tresult.push(distList);\n\t\t\t}\n\t\t}\n\t\treturn exchWebService.commonFunctions.CreateSimpleEnumerator(result);\n\t}", "postOrder() {\n const results = [];\n const _traversal = (node) => {\n if (node.left) _traversal(node.left);\n if (node.right) _traversal(node.right);\n results.push(node.value);\n };\n _traversal(this.root);\n return results;\n }", "function nodes(quadtree) {\n var nodes = [];\n quadtree.visit(function(node, x1, y1, x2, y2) {\n nodes.push({x: x1, y: y1, width: x2 - x1, height: y2 - y1});\n });\n return nodes;\n}", "static buildBFSTree(g, s) {\n // let root = new TreeNode(s.Value);\n let q = [];\n q.push(s);\n\n // Clear Color and Dist attributes of the graph\n g.clearFlags();\n\n // let current = root;\n while (q.length > 0) {\n let u = q[0];\n q.splice(0, 1);\n\n for (let i in u.Edges) {\n let v = u.Edges[i];\n if (v.Color == 0) { // If WHITE\n v.Color = 1; // Mark children with GRAY color\n v.Dist = u.Dist + 1;\n\n // let n = new TreeNode(v.Value);\n // n.Parent = current;\n // current.Children.push(n);\n }\n\n q.push(v);\n }\n u.Color = 2; // Mark processed node with BLACK color\n }\n // TBD: Need to fix an infinite loop bug\n\n // let bfsTree = new Tree('TreeFrom:' + s.Value);\n // bfsTree.Root = root;\n // return bfsTree;\n }", "getEmptyNodes () {\n var toFetch = []\n this.g.graph.nodes().forEach((n) => {\n if (n.properties === undefined) {\n toFetch.push(n.id)\n }\n })\n return toFetch\n }", "function bfs(root) {\n const queue = [];\n queue.push(root);\n while (queue.length) {\n const top = queue.shift();\n console.log(top.value);\n top.left && queue.push(top.left);\n top.right && queue.push(top.right);\n }\n}", "*nodesAscending(){\n let i = 0;\n let node = this.root && this.root.getLeftmostChild();\n while(node){\n yield node;\n node = node.getSuccessor();\n }\n }", "DFSInOrdert() {\r\n\t\treturn this.traverseInOrder(this.root, []);\r\n\t}", "doBFS(){\n // Stores the graph vertices in BFS traversal order\n let bfsNodes = [];\n // Keeps the list of visited nodes to avoid duplicates and cycle\n const visited = new Set();\n // Queue to hold the adjacent nodes ofa vertex\n const queue = new Queue();\n // Enqueue the first vertex in the queue\n for (var key of this._adjacentList.keys()) {\n queue.enqueue(key);\n visited.add(key);\n break;\n }\n \n // while a queue is not empty\n while(!queue.isEmpty()){\n // dequeue a node\n const node = queue.dequeue();\n // Push to the output array\n bfsNodes.push(node);\n // get its children and put on queue\n this._adjacentList.get(node).forEach(adjacentNode => {\n // Enqueue only if node has not been visited before\n if(!visited.has(adjacentNode)){\n queue.enqueue(adjacentNode);\n // Add to visited set\n visited.add(adjacentNode);\n }\n \n });\n }\n return bfsNodes;\n }", "*nodesDescending(){\n let node = this.root && this.root.getRightmostChild();\n while(node){\n yield node;\n node = node.getPredecessor();\n }\n }", "dfsInorder() {\n let result = [];\n const traverse = node => {\n if (node.left) {\n traverse(node.left);\n }\n result.push(node.data);\n if (node.right) {\n traverse(node.right)\n }\n }\n traverse(this.root)\n\n return result;\n }", "dfsPostOrder() {\r\n let result = []\r\n\r\n const traverse = node => {\r\n if (node.left) traverse(node.left)\r\n if (node.right) traverse(node.right)\r\n result.push(node.data)\r\n }\r\n\r\n traverse(this.root)\r\n return result\r\n }", "postOrder() {\n const results = [];\n const _traverse = (node) => {\n if (node.left) _traverse(node.left);\n if (node.right) _traverse(node.right);\n results.push(node.value);\n };\n\n _traverse(this.root);\n return results;\n }", "getBalancedBST() {\r\n const balancedBST = new BST(\r\n this.rootX,\r\n this.rootY,\r\n this.rootDeltaX,\r\n this.rootDeltaY\r\n );\r\n const inorderNodes = this.inorderNodes();\r\n let n = inorderNodes.length;\r\n if (!n > 0) return;\r\n\r\n const q = [];\r\n let lo = 0;\r\n let hi = n - 1;\r\n q.push([lo, hi]);\r\n\r\n while (q.length !== 0) {\r\n [lo, hi] = q.shift();\r\n if (lo <= hi) {\r\n const mid = lo + Math.floor((hi - lo) / 2);\r\n const midNode = inorderNodes[mid];\r\n\r\n balancedBST.put(midNode.key, midNode.value);\r\n q.push([lo, mid - 1]);\r\n q.push([mid + 1, hi]);\r\n }\r\n }\r\n return balancedBST;\r\n }", "function FBXTree() { }", "preOrder() {\n let results = [];\n\n let _walk = node => {\n results.push(node.value); //root\n if (node.left) _walk(node.left);\n if (node.right) _walk(node.right);\n };\n _walk(this.root);\n\n return results;\n }" ]
[ "0.6983639", "0.66061306", "0.6589199", "0.6575846", "0.6420659", "0.641339", "0.6354541", "0.635103", "0.6348391", "0.6341294", "0.6335956", "0.632871", "0.62996626", "0.6277351", "0.622497", "0.62093824", "0.62093824", "0.6197734", "0.6193166", "0.61921084", "0.6166727", "0.6165549", "0.6136785", "0.6126068", "0.61146945", "0.6075287", "0.6072015", "0.6068702", "0.6040886", "0.6026055", "0.60234743", "0.6010962", "0.6010962", "0.6003209", "0.5978541", "0.59744495", "0.5970294", "0.5951046", "0.59413564", "0.5937432", "0.592725", "0.59171015", "0.5914799", "0.5914799", "0.59051764", "0.59034985", "0.589304", "0.58824736", "0.587893", "0.58656627", "0.5858755", "0.5858755", "0.5858755", "0.5858755", "0.5858755", "0.5858755", "0.58563185", "0.58492655", "0.5843226", "0.5840353", "0.5838334", "0.5828521", "0.58092064", "0.5800638", "0.57849073", "0.57785076", "0.5772636", "0.5770952", "0.5770753", "0.5769925", "0.57628375", "0.5751792", "0.5751757", "0.5750069", "0.57495826", "0.5731804", "0.5718514", "0.57090074", "0.57060796", "0.5702408", "0.5698518", "0.5695234", "0.56951076", "0.56879467", "0.5681392", "0.5672143", "0.5671392", "0.5653169", "0.5650561", "0.5638917", "0.5632559", "0.56313354", "0.56261504", "0.5621841", "0.56205696", "0.5619207", "0.56160843", "0.56121296", "0.5610631", "0.5609862" ]
0.6424415
4
inorder traversal of nodes
inorderNodes() { let queue = []; this.inorderNodesHelper(this.root, queue); return queue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inOrderTraversal(node) {}", "inorderTraversal() {\n\n }", "inorderTraversal(node = this.root) {\n if (node === null)\n return;\n\n this.inorderTraversal(node.left);\n console.log(node.data);\n this.inorderTraversal(node.right);\n }", "inorder(node) {\n if (node !== null) {\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "inorder(node) {\n if (node !== null) {\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "inorder(node) {\n if (node !== null) {\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "inorder(node) {\n if (node !== null) {\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "inorder(node) {\n if (node !== null) {\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "inorder(node){\n if(node !== null){\n this.inorder(node.left);\n console.log(node.data);\n this.inorder(node.right);\n }\n }", "_inorder(node) {\n if (node !== null && node !== undefined) {\n this._inorder(node.getLeftChild());\n this.currElem = node.getElement();\n this._inorder(node.getRightChild());\n }\n }", "inOrder(node) {\n if (node != null) {\n this.inOrder(node.left);\n console.log(node.data);\n this.inOrder(node.right);\n }\n }", "function preOrderTraversal(node) {}", "inOrderTraversal(node, callback) {\n if (node !== null) {\n this.inOrderTraversal(node.left, callback);\n callback(node.key); // append via callback\n this.inOrderTraversal(node.right, callback);\n }\n }", "inorder() {\n this.inorder(this._root);\n }", "function inOrderTraversal(node) {\n if (node !== null) {\n inOrderTraversal(node.left);\n console.log(node.val);\n inOrderTraversal(node.right);\n }\n}", "function inorder(node){\n if(!_.isNull(node.left)) inorder(node.left)\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n if(!_.isNull(node.right)) inorder(node.right)\n}", "inorderTraverse() {\n let data = [];\n function traverse(node) {\n if(node.left != null) {\n traverse(node.left);\n }\n data.push(node.data);\n if(node.left != null) {\n traverse(node.left);\n }\n }\n traverse(this.root);\n return data;\n }", "inOrder(node) {\n if (node !== null) {\n this.inOrder(node.left);\n console.log(node.show());\n this.inOrder(node.right);\n }\n }", "inorder() {\n const resultArray = [];\n return this.inorderHelper(this.root, resultArray);\n }", "function inOrder(node) {\n if(node) {\n output.push(node.val);\n inOrder(node.left);\n inOrder(node.right);\n }\n else {\n output.push(null);\n }\n\n }", "inOrderTraversal(node, traversal = []) {\n if (node === null) {\n return traversal;\n } else {\n this.inOrderTraversal(node.left, traversal);\n traversal.push(node.value);\n this.inOrderTraversal(node.right, traversal);\n }\n return traversal;\n }", "inorderTraversal(currentNode) {\n let arr = []\n if (currentNode) {\n arr = this.inorderTraversal(currentNodec.left)\n arr.push(currentNode.value)\n arr = arr.push(this.inorderTraversal(currentNode.right));\n }\n return res\n\n }", "static *inorder(node) {\n if (node === null) {\n return\n }\n if ( !(node instanceof BinaryTreeNode) ) {\n throw Error(`The node must be a BinaryTreeNode instance!`)\n }\n yield *this.inorder(node.left)\n yield node.data\n yield *this.inorder(node.right)\n }", "function inOrder(node) {\n if (node == undefined) return [];\n return inOrder(node.left).concat(node.data).concat(inOrder(node.right));\n}", "inorder(root) {\n if (root != null) {\n inorder(root.left);\n console.log('Node : ' + root.data + ' , ');\n if (root.parent == null) console.log('Parent : NULL');\n else console.log('Parent : ' + root.parent.data);\n inorder(root.right);\n }\n }", "inOrderTraversal(visitorFn) {\n if (this.leftChild) {\n this.leftChild.inOrderTraversal(visitorFn)\n }\n\n visitorFn(this)\n\n if (this.rightChild) {\n this.rightChild.inOrderTraversal(visitorFn)\n }\n }", "function inOrder(node) {\n if(node) {\n // traverse the left subtree\n if(node.left !== null) {\n inOrder(node.left);\n }\n // call the process method on this node\n process.call(this, node);\n // traverse the right subtree\n if(node.right !== null) {\n inOrder(node.right);\n }\n }\n }", "function inOrder(node) {\n if(node) {\n // traverse the left subtree\n if(node.left !== null) {\n inOrder(node.left);\n }\n // call the process method on this node\n process.call(this, node);\n // traverse the right subtree\n if(node.right !== null) {\n inOrder(node.right);\n }\n }\n }", "function in_order(root, nodes) {\n if (root && root.left) {\n in_order(root.left, nodes);\n }\n nodes.push(root.data);\n if (root && root.right) {\n in_order(root.right, nodes)\n }\n return nodes;\n}", "function preOrderTraversal(node){\n console.log(node.key)\n \n if(node.left) {\n preOrderTraversal(node.left);\n }\n if(node.right){\n preOrderTraversal(node.right);\n }\n }", "function inOrderTraverse(tree) {\n let arr = [];\n inOrderTraverseHelper(tree, arr);\n return arr;\n}", "inOrder() {\n const results = [];\n const _traversal = (node) => {\n if (node.left) _traversal(node.left);\n results.push(node.value);\n if (node.right) _traversal(node.right);\n };\n _traversal(this.root);\n return results;\n }", "function traversePreOrder(node) {\n console.log(node.value);\n if (node.left) {\n traversePreOrder(node.left);\n }\n if (node.right) {\n traversePreOrder(node.right);\n }\n}", "inOrderTraversal() {\n let visited = [];\n\n function inOrder(node) {\n if (node !== null) {\n if (node.left !== null) inOrder(node.left);\n visited.push(node.value);\n if (node.right !== null) inOrder(node.right);\n }\n }\n\n inOrder(this.root);\n return visited;\n }", "inorder() {\n let values = [];\n if (this.root) this.root.inorder(values);\n return values;\n }", "function postOrderTraversal(node) {}", "function inOrder(currentNode) {\n if(currentNode.left) {\n inOrder(currentNode.left);\n }\n method.call(this, currentNode);\n if(currentNode.right) {\n inOrder(currentNode.right);\n }\n }", "inorderTraversal(root) {\r\n const path = []\r\n const rootChildren = root.children\r\n if(rootChildren.length === 0)\r\n path.push(root.val)\r\n else {\r\n let preStack = new Stack();\r\n preStack.push(root)\r\n while(preStack.size!==0) {\r\n const currentNode = preStack.pop()\r\n const currentChildren = currentNode.children\r\n if(currentChildren.length > 0 && !currentNode.visited) {\r\n for (let i=currentChildren.length-1; i>=1; i--) {\r\n preStack.push(currentChildren[i])\r\n }\r\n currentNode.visited = true\r\n preStack.push(currentNode)\r\n preStack.push(currentChildren[0])\r\n } else {\r\n currentNode.visited = false\r\n path.push(currentNode.val)\r\n } \r\n }\r\n }\r\n return path\r\n }", "function inOrderBinaryTreeTraversal(tree){\n const results = [];\n function _go(node){\n if (node.left) (_go(node.left));\n results.push(node.value);\n if (node.right) (_go(node.right));\n }\n if(tree.root){\n _go(tree.root);\n }\n return results;\n}", "inOrder(root=this.root,result=[]){\n if(root == null){\n return;\n }\n this.printOrder(root.nodeL, result);\n result.push(root.data);\n this.printOrder(root.nodeR, result);\n return result;\n }", "function traverseInOrder(node, list) {\n debugger;\n if (node.left) {\n traverseInOrder(node.left, list);\n }\n list.push(node.value);\n if (node.right) {\n traverseInOrder(node.right, list);\n }\n return list;\n}", "function inOrder(node, arr) {\n if (!arr) var arr = [];\n if (!node) return;\n inOrder(node.left, arr);\n arr.push(node.data);\n inOrder(node.right, arr);\n return arr\n}", "function inOrder(t) {\n if (t.left) {\n inOrder(t.left)\n }\n console.log(t.key)\n if (t.right) {\n inOrder(t.right)\n }\n}", "inOrder() {\n const result = [];\n\n // The recursive function\n function _inOrder(node) {\n if (node) {\n _inOrder(node.left);\n result.push(node.value);\n _inOrder(node.right);\n }\n }\n\n if (this.root) _inOrder(this.root);\n\n return result;\n }", "inOrder() {\n const arr = [];\n\n const inOrder = (node) => {\n\n if (node.left) {\n inOrder(node.left);\n }\n\n arr.push(node.value);\n\n if (node.right) {\n inOrder(node.right);\n }\n };\n\n let current = this.root;\n inOrder(current);\n\n return arr;\n }", "function preOrderTraversal(node) {\n if (node !== null) {\n console.log(node.val);\n preOrderTraversal(node.left);\n preOrderTraversal(node.right);\n }\n}", "function inorderTraversal(root) {\n const result = [];\n\n function traverse(node) {\n if (!node) return;\n traverse(node.left);\n result.push(node.val);\n traverse(node.right);\n }\n\n traverse(root);\n return result;\n}", "function inOrderTraverse(tree, array) {\n // Write your code here.\n\tif (tree !== null){\n\t\tinOrderTraverse(tree.left, array);\n\t\tarray.push(tree.value);\n\t\tinOrderTraverse(tree.right, array);\n\t}\n\n\treturn array;\n}", "function inOrder(tree) {\n if (!tree.value) {\n return \"not found\"\n\n }\n tree.left && inOrder(tree.left)\n console.log(tree.value)\n\n tree.right && inOrder(tree.right)\n\n\n}", "traverse(method) {\n inOrder(this.root);\n // Helper method for traversing the nodes in order\n function inOrder(currentNode) {\n if(currentNode.left) {\n inOrder(currentNode.left);\n }\n method.call(this, currentNode);\n if(currentNode.right) {\n inOrder(currentNode.right);\n }\n }\n }", "function inOrder_iterative(tree, index) {\n \n var stack = [];\n \n while (stack.length > 0 || !isUndefined(tree[index])) {\n if (!isUndefined(tree[index])) {\n stack.push(index);\n index = left(index);\n } else {\n index = stack.pop();\n console.log(tree[index]);\n index = right(index);\n }\n }\n}", "traverse(node, process_node = this.node_out) {\n if (!node) return;\n this.traverse(node.left, process_node);\n process_node(node); // in-order !!!\n this.traverse(node.right, process_node);\n return this;\n }", "preOrder(node) {\n if (node != null) {\n console.log(node.data);\n this.preOrder(node.left);\n this.preOrder(node.right);\n }\n }", "function inOrder_recursive(tree, index) {\n \n if (isUndefined(tree[index])) {\n return;\n }\n \n inOrder_recursive(tree, left(index));\n console.log(tree[index]);\n inOrder_recursive(tree, right(index));\n}", "preorder(node){\n if(node !== null) {\n console.log(node.data);\n this.preorder(node.left);\n this.preorder(node.right);\n }\n }", "inOrder() {\n const results = [];\n const _traverse = (node) => {\n if (node.left) _traverse(node.left);\n results.push(node.value);\n if (node.right) _traverse(node.right);\n };\n\n _traverse(this.root);\n return results;\n }", "inOrder() {\n let results = [];\n\n let _walk = node => {\n if (node.left) _walk(node.left);\n results.push(node.value);\n if (node.right) _walk(node.right);\n };\n _walk(this.root);\n\n return results;\n }", "function inOrder(root){\n if (!root){\n return;\n }\n if (root){\n inOrder(root.left);\n console.log(root.value);\n inOrder(root.right);\n }\n}", "DFSInOrdert() {\r\n\t\treturn this.traverseInOrder(this.root, []);\r\n\t}", "preOrderSearch(node) {\n if (node === null) {\n return;\n }\n\n console.log(node.data);\n\n this.preOrderSearch(node.leftChild);\n this.preOrderSearch(node.rightChild);\n }", "preorder(node) {\n if (node !== null) {\n console.log(node.data);\n this.preorder(node.left);\n this.preorder(node.right);\n }\n }", "preorder(node) {\n if (node != null) {\n console.log(node.data);\n this.preorder(node.left);\n this.preorder(node.right);\n }\n }", "preOrderTraversal(node, traversal = []) {\n if (node === null) {\n return traversal;\n } else {\n traversal.push(node.value);\n this.preOrderTraversal(node.left, traversal);\n this.preOrderTraversal(node.right, traversal);\n }\n return traversal;\n }", "*nodes(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n pass,\n reverse = false\n } = options;\n var {\n from = [],\n to\n } = options;\n var visited = new Set();\n var p = [];\n var n = root;\n\n while (true) {\n if (to && (reverse ? Path.isBefore(p, to) : Path.isAfter(p, to))) {\n break;\n }\n\n if (!visited.has(n)) {\n yield [n, p];\n } // If we're allowed to go downward and we haven't decsended yet, do.\n\n\n if (!visited.has(n) && !Text.isText(n) && n.children.length !== 0 && (pass == null || pass([n, p]) === false)) {\n visited.add(n);\n var nextIndex = reverse ? n.children.length - 1 : 0;\n\n if (Path.isAncestor(p, from)) {\n nextIndex = from[p.length];\n }\n\n p = p.concat(nextIndex);\n n = Node.get(root, p);\n continue;\n } // If we're at the root and we can't go down, we're done.\n\n\n if (p.length === 0) {\n break;\n } // If we're going forward...\n\n\n if (!reverse) {\n var newPath = Path.next(p);\n\n if (Node.has(root, newPath)) {\n p = newPath;\n n = Node.get(root, p);\n continue;\n }\n } // If we're going backward...\n\n\n if (reverse && p[p.length - 1] !== 0) {\n var _newPath = Path.previous(p);\n\n p = _newPath;\n n = Node.get(root, p);\n continue;\n } // Otherwise we're going upward...\n\n\n p = Path.parent(p);\n n = Node.get(root, p);\n visited.add(n);\n }\n }", "inOrder() {\n let root = this.root;\n let arr = [];\n\n if (root.left) {\n arr.push(...root.left.inOrder());\n }\n\n arr.push(root.value);\n\n if (root.right) {\n arr.push(...root.right.inOrder());\n }\n return arr;\n }", "*nodes(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n pass,\n reverse = false\n } = options;\n var {\n from = [],\n to\n } = options;\n var visited = new Set();\n var p = [];\n var n = root;\n\n while (true) {\n if (to && (reverse ? Path.isBefore(p, to) : Path.isAfter(p, to))) {\n break;\n }\n\n if (!visited.has(n)) {\n yield [n, p];\n } // If we're allowed to go downward and we haven't descended yet, do.\n\n\n if (!visited.has(n) && !Text.isText(n) && n.children.length !== 0 && (pass == null || pass([n, p]) === false)) {\n visited.add(n);\n var nextIndex = reverse ? n.children.length - 1 : 0;\n\n if (Path.isAncestor(p, from)) {\n nextIndex = from[p.length];\n }\n\n p = p.concat(nextIndex);\n n = Node.get(root, p);\n continue;\n } // If we're at the root and we can't go down, we're done.\n\n\n if (p.length === 0) {\n break;\n } // If we're going forward...\n\n\n if (!reverse) {\n var newPath = Path.next(p);\n\n if (Node.has(root, newPath)) {\n p = newPath;\n n = Node.get(root, p);\n continue;\n }\n } // If we're going backward...\n\n\n if (reverse && p[p.length - 1] !== 0) {\n var _newPath = Path.previous(p);\n\n p = _newPath;\n n = Node.get(root, p);\n continue;\n } // Otherwise we're going upward...\n\n\n p = Path.parent(p);\n n = Node.get(root, p);\n visited.add(n);\n }\n }", "preorder(node) {\n if (node !== null) {\n console.log(node.data);\n this.preorder(node.left);\n this.preorder(node.right);\n }\n }", "preorder(node)\n {\n if(node != null)\n {\n console.log(node.data);\n this.preorder(node.left);\n this.preorder(node.right);\n }\n }", "function inOrderDFS(root) {\n if (root === null) return;\n // print here -> pre order\n if (root.left) {\n preOrderDFS(root.left);\n }\n // print here -> in order\n console.log(root.value);\n if (root.right) {\n preOrderDFS(root.right);\n }\n // print here -> post order\n}", "function inOrderTraverse(tree, array) {\n\tvar current = tree;\n\tfunction traverse(node) {\n\t\tnode.left && traverse(node.left);\n\t\tarray.push(node.value);\n\t\tnode.right && traverse(node.right);\n\t}\n\ttraverse(tree);\n\treturn array;\n}", "levelOrderSearch(node) {\n if (node === null) {\n return;\n }\n\n let discoveredNodes = [];\n discoveredNodes.push(node);\n\n while(discoveredNodes.length > 0) {\n let currentNode = discoveredNodes[0];\n console.log(currentNode.data);\n\n if (currentNode.leftChild !== null) {\n discoveredNodes.push(currentNode.leftChild);\n }\n if (currentNode.rightChild !== null) {\n discoveredNodes.push(currentNode.rightChild);\n }\n\n discoveredNodes.shift();\n }\n }", "preTraverseSceneGraph(rootNode, func) {\n func(rootNode);\n if (!this.gameObjects.has(rootNode)) return; //might have been deleted during execution\n\n let nodeQueue = new Set(this.childrenOf(rootNode)); //shallow copy\n for (let child of nodeQueue) {\n this.preTraverseSceneGraph(child, func);\n }\n }", "traverse(fn) { \n var curr = this.head; \n //var str = \"\"; \n while (curr) { \n //str += curr.element + \" \"; \n \n fn (curr.element, curr.next.element);\n\n curr = curr.next; \n } \n }", "function inOrder(root, process) {\n if (root.leftChild !== null) {\n inOrder(root.leftChild, process);\n }\n\n process.call(this, root.value);\n\n if (root.rightChild !== null) {\n inOrder(root.rightChild, process);\n }\n}", "preOrder() {\n const results = [];\n const _traversal = (node) => {\n results.push(node.value);\n if (node.left) _traversal(node.left);\n if (node.right) _traversal(node.right);\n };\n _traversal(this.root);\n return results;\n }", "function traverse(root) {}", "function inOrderArrayIter(root) {\n\tlet path = [];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 1) initialize empty stack, and current node to root\n\tlet stack = [];\n\tlet node = root;\n\n\twhile (stack.length || node) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2) loop while stack NOT empty OR node exists\n\n\t\tif (node) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3) if current node exists, push node to stack, update node to left node\n\t\t\tstack.push(node);\n\t\t\tnode = node.left;\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 4) if current node does NOT exist\n\n\t\t\tnode = stack.pop();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 5) update node\"visit\" node/pop last node in stack\n\t\t\tpath.push(node.val);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 6) push node val to path\n\t\t\tnode = node.right;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 7) update node to right node\n\t\t}\n\t}\n\n\treturn path;\n}", "*nodesAscending(){\n let i = 0;\n let node = this.root && this.root.getLeftmostChild();\n while(node){\n yield node;\n node = node.getSuccessor();\n }\n }", "function postOrderTraversal(node) {\n if (node !== null) {\n postOrderTraversal(node.left);\n postOrderTraversal(node.right);\n console.log(node.val);\n }\n}", "function inOrderHelper(root) {\n if(root === null) return\n\n inOrderHelper(root.left)\n\n count--\n\n if(count === 0) {\n response.push(root.value)\n return\n }\n\n inOrderHelper(root.right)\n }", "_preorder(node) {\n if (node !== null && node !== undefined) {\n this.currElem = node.getElement();\n this._preorder(node.getLeftChild());\n this._preorder(node.getRightChild());\n }\n }", "dfsInOrder(){\n let result = []\n\n const traverse = node => {\n //if left node exists, go left again//\n if(node.left) traverse(node.left)\n //capture root node value//\n result.push(node.value)\n //if right node exists, go right again//\n if(node.right) traverse(node.right)\n }\n\n traverse(this.root)\n console.log(`DFS In Order: ${result}`)\n }", "preOrderTraversal() {\n \n let visited = [];\n\n if (this.root === null) {\n return visited;\n }\n\n function preOrder(node) {\n if (node === null) {\n return;\n }\n\n visited.push(node.value);\n preOrder(node.left);\n preOrder(node.right);\n }\n\n preOrder(this.root);\n return visited;\n }", "function fnTraversal(root, node, preorder, postorder) {\n\t\tnode.childnodes.forEach((child, i) => { //iterate over next deep level\n\t\t\tpreorder(root, node, child, i) && fnTraversal(root, child, preorder, postorder); //preorder = cut/poda\n\t\t\tpostorder(root, node, child, i);\n\t\t});\n\t\treturn self;\n\t}", "function preOrder(root) {\n console.log(root.data) \n root.left && preOrder(root.left) \n root.right && preOrder(root.right) \n }", "dfsInOrder() {\n let visitedNodes = [];\n let currentNode = this.root;\n\n function traverse(node){\n \n node.left && traverse(node.left)\n visitedNodes.push(node.val);\n node.right && traverse(node.right);\n }\n \n traverse(currentNode);\n return visitedNodes;\n }", "dfsPreOrder() {\n let result = [];\n function traverse(node, arr) {\n arr.push(node);\n if (node.left) traverse(node.left);\n if (node.right) traverse(node.right);\n }\n traverse(this.root, result);\n return result;\n }", "function levelOrderTraversal(node) {\n let queue = [];\n let res = [];\n\n if (node) queue.push(node);\n\n while (queue.length) {\n node = queue.shift();\n\n res.push(node.val);\n\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n\n return res;\n}", "function xWalkTreeRev( oNode, fnVisit, skip, data )\r\n{\r\n var r=null;\r\n if(oNode){if(oNode.nodeType==1&&oNode!=skip){r=fnVisit(oNode,data);if(r)return r;}\r\n for(var c=oNode.lastChild;c;c=c.previousSibling){if(c!=skip)r=xWalkTreeRev(c,fnVisit,skip,data);if(r)return r;}}\r\n return r;\r\n}", "dfsInOrder() {\n let result = [];\n\n function traverse(node, arr) {\n if (node.left) traverse(node.left);\n arr.push(node);\n if (node.right) traverse(node.right);\n }\n traverse(this.root, result);\n return result;\n }", "preOrder(node) {\n if (node != null) {\n document.write(node.key + \" \");\n this.preOrder(node.left);\n this.preOrder(node.right);\n }\n }", "DFSInOrder() {\n let data = []\n function traverse(node) {\n if (node.left) traverse(node.left)\n data.push(node.value)\n if (node.right) traverse(node.right)\n }\n traverse(this.root)\n return data\n }", "preOrder() { //DLR\n let results = [];\n\n let _walk = node => {\n results.push(node.value); //executing code\n if(node.left) _walk(node.left); //go left - if node,left is null, we are at a leaf - traversing\n if(node.right) _walk(node.right); // go right - if node.right=null then we are at a leaf - traversing\n };\n console.log(_walk(this.root));\n _walk(this.root); // for whiteboard use ll.root instead of this.root, unless using a class constructor\n return results;\n }", "DFSInOrder() {\n var data = [],\n current = this.root\n\n function traverse(node) {\n if (node.left) traverse(node.left)\n data.push(node.value)\n if (node.right) traverse(node.right)\n \n }\n traverse(current)\n return data\n }", "function xWalkTree2( oNode, fnVisit, skip, data )\r\n{\r\n var r=null;\r\n if(oNode){if(oNode.nodeType==1&&oNode!=skip){r=fnVisit(oNode,data);if(r)return r;}\r\n for(var c=oNode.firstChild;c;c=c.nextSibling){if(c!=skip)r =xWalkTree2(c,fnVisit,skip,data);if(r)return r;}}\r\n return r;\r\n}", "dfsInorder() {\n let result = [];\n const traverse = node => {\n if (node.left) {\n traverse(node.left);\n }\n result.push(node.data);\n if (node.right) {\n traverse(node.right)\n }\n }\n traverse(this.root)\n\n return result;\n }", "bfsInOrder() {\r\n\r\n\t\tif(this.isEmpty()){\r\n\t\t\treturn []\r\n\t\t}\r\n\r\n\t\telse{\r\n\t\t\tvar result = [];\r\n\r\n\t\t\tvar traverse = node => {\r\n\t\r\n\t\t\t\tif (node.left !== null)\r\n\t\t\t\t\ttraverse(node.left);\r\n\t\r\n\t\t\t\tresult.push(node.value);\r\n\t\r\n\t\t\t\tif (node.right !== null)\r\n\t\t\t\t\ttraverse(node.right);\r\n\t\t\t}\r\n\t\r\n\t\t\ttraverse(this.root);\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "inOrder(root = this.root, values = []) {\n if (!root) {\n return null;\n }\n if (root.left) {\n this.inOrder(root.left, values);\n }\n\n values.push(root.data);\n\n if (root.right) {\n this.inOrder(root.right, values);\n }\n return values;\n }", "function preOrder(node) {\n if (node == undefined) return [];\n return [node.data].concat(preOrder(node.left)).concat(preOrder(node.right));\n}", "dfsPreOrder() {\n let visitedNodes = [];\n let currentNode = this.root;\n\n function traverse(node){\n visitedNodes.push(node.val);\n node.left && traverse(node.left)\n node.right && traverse(node.right);\n }\n \n traverse(currentNode);\n return visitedNodes;\n }" ]
[ "0.8586327", "0.80949754", "0.78377247", "0.78191906", "0.78191906", "0.7784994", "0.7784994", "0.7784994", "0.7769381", "0.7545223", "0.74973994", "0.7490266", "0.7421076", "0.73980016", "0.7306658", "0.72934455", "0.72826487", "0.7265739", "0.72056234", "0.7176716", "0.7061097", "0.7046876", "0.70393145", "0.70218277", "0.70203805", "0.6998537", "0.696094", "0.696094", "0.6922681", "0.68645865", "0.67907345", "0.6756864", "0.6743377", "0.6714066", "0.6700872", "0.6669368", "0.66533506", "0.6644839", "0.66327906", "0.6603852", "0.6564797", "0.65523076", "0.654072", "0.65339786", "0.6532404", "0.6497586", "0.6453754", "0.64520186", "0.64409256", "0.6387689", "0.63864684", "0.6384282", "0.6383414", "0.6340791", "0.63406", "0.62862456", "0.62496203", "0.6240982", "0.6236617", "0.62307674", "0.62293464", "0.619983", "0.6191537", "0.6184882", "0.617529", "0.6172259", "0.61694133", "0.61544704", "0.6111803", "0.60837924", "0.6061115", "0.6049689", "0.60467845", "0.604458", "0.60179245", "0.5982799", "0.59739065", "0.5965129", "0.59570587", "0.59532356", "0.5942424", "0.5941571", "0.59218323", "0.59169656", "0.59148794", "0.5894449", "0.5869738", "0.586121", "0.58532804", "0.5850877", "0.58249867", "0.58234257", "0.5822105", "0.5813701", "0.5807099", "0.57724124", "0.5759053", "0.57526004", "0.575114", "0.5750435" ]
0.6893698
29
return balanced version of current BST
getBalancedBST() { const balancedBST = new BST( this.rootX, this.rootY, this.rootDeltaX, this.rootDeltaY ); const inorderNodes = this.inorderNodes(); let n = inorderNodes.length; if (!n > 0) return; const q = []; let lo = 0; let hi = n - 1; q.push([lo, hi]); while (q.length !== 0) { [lo, hi] = q.shift(); if (lo <= hi) { const mid = lo + Math.floor((hi - lo) / 2); const midNode = inorderNodes[mid]; balancedBST.put(midNode.key, midNode.value); q.push([lo, mid - 1]); q.push([mid + 1, hi]); } } return balancedBST; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "balance() {\n // inorder traversal on bst returns a sorted sequence\n const values = this.inorder();\n // make the middle element the new root\n const root = new TreeNode(values[Math.floor(values.length / 2)]);\n // contruct the tree from root and return\n return this.balancedBST(values, 0, values.length - 1, root, this.inverted);\n }", "balance() {\n // Helper function to find median\n function median(arr) {\n if(arr.length % 2 === 0) {\n return Math.floor(arr.length / 2) - 1;\n }\n else {\n return Math.floor(arr.length / 2);\n }\n }\n // Helper function to recursively balance half the tree\n function balanceSide(currentNode, arr) {\n if(arr.length === 1) {\n var node = new Node(arr[0]);\n currentNode = node;\n }\n else if(arr.length === 2) {\n var node = new Node(arr[1]);\n var left = new Node(arr[0]);\n currentNode = node;\n currentNode.left = left;\n }\n else {\n var mid = median(arr);\n var node = new Node(arr[mid]);\n node.left = balanceSide(node.left, arr.slice(0, mid));\n node.right = balanceSide(node.right, arr.slice(mid + 1));\n currentNode = node;\n }\n return currentNode;\n }\n\n let arr = this.toArray();\n let mid = median(arr);\n let root = new Node(arr[mid]);\n root.left = balanceSide(root.left, arr.slice(0, mid));\n root.right = balanceSide(root.right, arr.slice(mid + 1))\n this.root = root;\n }", "function bstBalanced(BST) {\n return numbersDiffByOneOrLess(distancesFromRoot(BST))\n}", "function balanced (root){\n if(!root) return true;\n let diff = Math.abs(isBalanced(root.left) - isBalanced(root.right))\n if(diff > 1) return false;\n else {\n return balanced(root.left) && balanced(root.right)\n }\n}", "function isBalanced(tree) {\n\tvar current = tree;\n\tif(current.left != null) {\n\t\tif(current.right == null) {\n\t\t\tif(current.left.left || current.left.right) {\n\t\t\t\tconsole.log('not balanced');\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tisBalanced(current.left);\n\t\t}\n\t}\n\tif(current.right != null) {\n\t\tif(current.left == null) {\n\t\t\tif(current.right.left || current.right.right) {\n\t\t\t\tconsole.log('not balanced');\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tisBalanced(current.right);\n\t\t}\n\t}\n}", "function bst({ root, key }) {\n if(!root) {\n root = { key };\n }\n else if (key < root.key) {\n root.left = bst({ root: root.left, key });\n }\n else {\n root.right = bst({ root: root.right, key });\n }\n return root;\n}", "function BST(){\n\t\t//Default Properties\n\t\tthis.root = null;\n\t\tthis.tree = null;\n\n\t\t/************************************\n\t\t\t\tPrivate functions\n\t\t************************************/\n\t\tvar inOrder= function(obj, callback){\n\t if (obj){\n\n\t if (obj.left !== null){\n\t inOrder(obj.leftchild, callback);\n\t } \n\n\t callback.call(this,obj.element);\n\n\t if (obj.right !== null){\n\t inOrder(obj.rightchild, callback);\n\t }\n\t }\n\t }\n\n\t var preOrder = function(obj, callback){\n\t if (obj){\n\n\t \tcallback.call(this,obj.element);\n\n\t if (obj.left !== null){\n\t preOrder(obj.leftchild, callback);\n\t } \n\n\t if (obj.right !== null){\n\t preOrder(obj.rightchild, callback);\n\t }\n\t }\n\t }\n\n\t var postOrder = function(obj, callback){\n\t if (obj){\n\n\t if (obj.left !== null){\n\t postOrder(obj.leftchild, callback);\n\t } \n\n\t if (obj.right !== null){\n\t postOrder(obj.rightchild, callback);\n\t }\n\n\t callback.call(this,obj.element);\n\n\t }\n\t }\n\n\t /************************************\n\t\t\t\tExposed Functions\n\t\t************************************/\n\n\t\t//Add a new element\n\t\tthis.add = function(x){\n\t\t\tvar flag = true,\n\t\t\t\tdata = this.tree;\n\n\t\t\tif(this.root === null){\n\t\t\t\tthis.tree = {\n\t\t\t\t\telement : x,\n\t\t\t\t\tleftchild : null,\n\t\t\t\t\trightchild : null\n\t\t\t\t};\n\t\t\t\tthis.root = x;\n\t\t\t\tflag = false;\n\t\t\t}else{\n\t\t\t\twhile(flag){\n\t\t\t\t\tif(data.element === x){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else if(x > data.element){\n\t\t\t\t\t\tif(data.rightchild === null){\n\t\t\t\t\t\t\tdata.rightchild = {\n\t\t\t\t\t\t\t\telement : x,\n\t\t\t\t\t\t\t\tleftchild : null,\n\t\t\t\t\t\t\t\trightchild : null\t\t\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdata = data.rightchild;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(x < data.element){\n\t\t\t\t\t\tif(data.leftchild === null){\n\t\t\t\t\t\t\tdata.leftchild = {\n\t\t\t\t\t\t\t\telement : x,\n\t\t\t\t\t\t\t\tleftchild : null,\n\t\t\t\t\t\t\t\trightchild : null\t\t\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdata = data.leftchild;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t//Find whether element exist in exisiting BST\n\t\tthis.contains = function(x){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\twhile(flag){\n\t\t\t\tif(node != null){\n\t\t\t\t\tif(x === node.element){\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else if(x > node.element){\n\t\t\t\t\t\tnode = node.rightchildchild;\n\t\t\t\t\t}else if(x < node.element){\n\t\t\t\t\t\tnode = node.leftchildchild;\n\t\t\t\t\t}\t\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t//Find element in BST with minimum value\n\t\tthis.minValue = function(){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\t\tif(node != null){\n\t\t\t\t\twhile(flag){\n\t\t\t\t\t\tif(node.leftchildchild){\n\t\t\t\t\t\t\tnode = node.leftchildchild;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\treturn node.element;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t};\n\t\t//Find element in BST with maximum value\n\t\tthis.maxValue = function(){\n\t\t\tvar flag = true,\n\t\t\t\tnode = this.tree;\n\n\t\t\t\tif(node != null){\n\t\t\t\t\twhile(flag){\n\t\t\t\t\t\tif(node.rightchildchild){\n\t\t\t\t\t\t\tnode = node.rightchildchild;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\treturn node.element;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t};\n\t\t//Delete whole BST \n\t\tthis.removeTree = function(){\n\t\t\tthis.root = null;\n\t\t\tthis.tree = null;\n\t\t};\n\t\t//Traverse BST tree, you can traverse BST in inOrder,preOrder & postOrder fashion.\n\t\tthis.traversalTree = function(options,callback){\n\t\t\tvar obj = this.tree;\n\n\t\t\t//inOrder traversal\n\t\t\tif(options.type === \"inorder\"){\n\t\t inOrder(obj,callback);\n\t\t\t}\n\t\t\t//preOrder traversal\n\t\t\tif(options.type === \"preorder\"){\n\t\t preOrder(obj, callback);\n\t\t\t}\n\t\t\t//postOrder traversal\n\t\t\tif(options.type === \"postorder\"){\n\t\t postOrder(obj, callback);\n\t\t\t}\n\t\t};\n\t\t//Get BST size \n\t\tthis.size = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tsize = 0;\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t size = size+1;\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t inOrder(obj);\n\n\t return size;\n\t\t};\n\t\t//Convert BST tree to Array \n\t\tthis.toArray = function(type){\n\t\t\tvar obj = this.tree,\n\t\t\t\tarr = [],\n\t\t\t\tmethod = \"inorder\";\n\n\t\t\tif(!type){\n\t\t\t\ttype = method;\n\t\t\t}\n\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t arr.push(obj.element);\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t\t function preOrder(obj){\n\t\t if (obj){\n\n\t\t arr.push(obj.element);\n\n\t\t if (obj.left !== null){\n\t\t preOrder(obj.leftchild);\n\t\t } \n\n\t\t if (obj.right !== null){\n\t\t preOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t\t function postOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t postOrder(obj.leftchild);\n\t\t } \n\n\t\t \n\n\t\t if (obj.right !== null){\n\t\t postOrder(obj.rightchild);\n\t\t }\n\n\t\t arr.push(obj.element);\n\n\t\t }\n\t\t }\n\n\t\t if(type === \"inorder\"){\n\t \tinOrder(obj);\t\n\t\t\t}else if(type === \"preorder\"){\n\t\t\t\tpreOrder(obj);\n\t\t\t}else if(type === \"postorder\"){\n\t\t\t\tpostOrder(obj);\n\t\t\t}\n\t return arr;\n\t\t};\n\t\t//Convert BST tree to String\n\t\tthis.toString = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tarr = [];\n\t\t\tfunction inOrder(obj){\n\t\t if (obj){\n\n\t\t if (obj.left !== null){\n\t\t inOrder(obj.leftchild);\n\t\t } \n\n\t\t // callback.call(this,obj.element);\n\t\t arr.push(obj.element);\n\n\t\t if (obj.right !== null){\n\t\t inOrder(obj.rightchild);\n\t\t }\n\t\t }\n\t\t }\n\t //start with the root\n\t inOrder(obj);\n\n\t return arr.toString();\n\t\t};\n\t\t//Check maximum Depth in BST\n\t\tthis.maxDepth = function(){\n\t\t\tvar obj = this.tree,\n\t\t\t\tsize = 0,\n\t\t\t\tPathArr = [],\n\t\t\t\ttraverseTopNode = false,\n\t\t\t\troot = this.root;\n\n\t\t\tfunction inOrder(obj){\n\n\t\t if (obj){\n\t\t \tif (obj.leftchild !== null){\n\t\t \t\tsize = size+1;\n\t\t inOrder(obj.leftchild);\n\t\t }else{\n\t\t \tPathArr.push(size);\n\t\t } \n\n\t\t if(obj.element === root){\n\t\t \t\ttraverseTopNode = true;\n\t\t \t\tsize = 1;\n\t\t \t}\n\t\t if (obj.rightchild !== null){\n\t\t size = size+1;\n\t\t inOrder(obj.rightchild);\n\n\t\t }else{\n\t\t \tPathArr.push(size);\n\t\t \tsize = size -1;\n\t\t }\n\n\t\t }else{\n\t\t \treturn 0;\n\t\t }\n\t\t }\n\n\t //start with the root\n\t inOrder(obj);\n\n\t PathArr.sort();\n\t PathArr.reverse();\n\t return PathArr[0];\n\t\t};\n\t\t//Remove element in BST\n\t\tthis.remove = function(value){\n\t \n\t var found = false,\n\t parent = null,\n\t node = this.tree,\n\t childCount,\n\t replacement,\n\t replacementParent;\n\t \n\t //make sure there's a node to search\n\t while(!found && node){\n\t \n\t //if the value is less than the node node's, go left\n\t if (value < node.element){\n\t parent = node;\n\t node = node.leftchild;\n\t \n\t //if the value is greater than the node node's, go right\n\t } else if (value > node.element){\n\t parent = node;\n\t node = node.rightchild;\n\t \n\t //values are equal, found it!\n\t } else {\n\t found = true;\n\t }\n\t }\n\t \n\t //only proceed if the node was found\n\t if (found){\n\t \n\t //figure out how many children\n\t childCount = (node.leftchild !== null ? 1 : 0) + (node.rightchild !== null ? 1 : 0);\n\t \n\t //special case: the value is at the root\n\t if (node === this.tree){\n\t switch(childCount){\n\t \n\t //no children, just erase the root\n\t case 0:\n\t this.tree = null;\n\t this.root = null;\n\t break;\n\t \n\t //one child, use one as the root\n\t case 1:\n\t this.tree = (node.rightchild === null ? node.leftchild : node.rightchild);\n\t break;\n\t \n\t //two children, little work to do\n\t case 2:\n\n\t //new root will be the old root's left child...maybe\n\t replacement = this.tree.leftchild;\n\t \n\t //find the right-most leaf node to be the real new root\n\t while (replacement.rightchild !== null){\n\t replacementParent = replacement;\n\t replacement = replacement.rightchild;\n\t }\n\t \n\t //it's not the first node on the left\n\t if (replacementParent !== null){\n\t \n\t //remove the new root from it's previous position\n\t replacementParent.rightchild = replacement.leftchild;\n\t \n\t //give the new root all of the old root's children\n\t replacement.rightchild = this.tree.rightchild;\n\t replacement.leftchild = this.tree.leftchild;\n\t } else {\n\t \n\t //just assign the children\n\t replacement.rightchild = this.tree.rightchild;\n\t }\n\t \n\t //officially assign new root\n\t this.tree = replacement;\n\t this.root = replacement.element;\n\t \n\t //no default\n\t \n\t } \n\n\t //non-root values\n\t } else {\n\t \n\t switch (childCount){\n\t \n\t //no children, just remove it from the parent\n\t case 0:\n\t //if the node value is less than its parent's, null out the left pointer\n\t if (node.element < parent.element){\n\t parent.leftchild = null;\n\t \n\t //if the node value is greater than its parent's, null out the right pointer\n\t } else {\n\t parent.rightchild = null;\n\t }\n\t break;\n\t \n\t //one child, just reassign to parent\n\t case 1:\n\t //if the node value is less than its parent's, reset the left pointer\n\t if (node.element < parent.element){\n\t parent.leftchild = (node.leftchild === null ? node.rightchild : node.leftchild);\n\t \n\t //if the node value is greater than its parent's, reset the right pointer\n\t } else {\n\t parent.rightchild = (node.leftchild === null ? node.rightchild : node.leftchild);\n\t }\n\t break; \n\n\t //two children, a bit more complicated\n\t case 2:\n\t \n\t //reset pointers for new traversal\n\t replacement = node.leftchild;\n\t replacementParent = node;\n\t \n\t //find the right-most node\n\t while(replacement.rightchild !== null){\n\t replacementParent = replacement;\n\t replacement = replacement.rightchild; \n\t }\n\t \n\t if (replacementParent.rightchild === replacement) {\n\t replacementParent.rightchild = replacement.leftchild;\n\t } else { \n\t //replacement will be on the left when the left most subtree\n\t //of the node to remove has no children to the right\n\t replacementParent.leftchild = replacement.leftchild;\n\t }\n\t \n\t //assign children to the replacement\n\t replacement.rightchild = node.rightchild;\n\t replacement.leftchild = node.leftchild;\n\t \n\t //place the replacement in the right spot\n\t if (node.element < parent.element){\n\t parent.leftchild = replacement;\n\t } else {\n\t parent.rightchild = replacement;\n\t } \n\t }\n\t \n\t }\n\t \n\t }else{\n\t \treturn false;\n\t } \n\t }\n\t}", "balancedBST(arr, start, end, root, inverted) {\n if (start >= end) return; // base case\n let leftMid, rightMid; // indices of left and right children in arr\n\n const mid = Math.floor((start + end) / 2);\n // left child is the middle element of first half of the sorted array\n leftMid = end - start === 1 ? start : Math.floor((start + mid - 1) / 2);\n // right child is the middle element of second half of the sorted array\n rightMid = end - start === 1 ? end : Math.floor((mid + 1 + end) / 2);\n\n // create nodes\n const left = new TreeNode(arr[leftMid]);\n const right = new TreeNode(arr[rightMid]);\n\n // add to the tree\n root.addNode(left, inverted);\n root.addNode(right, inverted);\n\n // recursively set the left and right children for next level\n this.balancedBST(arr, start, mid - 1, left, inverted);\n this.balancedBST(arr, mid + 1, end, right, inverted);\n\n return root;\n }", "insert(value) {\n // Write your code here.\n // Do not edit the return statement of this method.\n let current = this;\n while (true) {\n if (value < current.value) {\n if (current.left === null) {\n current.left = new BST(value)\n break;\n } else {\n current = current.left\n }\n } else {\n if (current.right === null) {\n current.right = new BST(value)\n break;\n } else {\n current = current.right\n }\n }\n }\n return this;\n }", "insert(value) {\n let swapCompleted = false;\n const newNode = new BinarySearchTree(value);\n let root = this;\n \n while (!swapCompleted) {\n if (root.value >= value) {\n if (!root.left) {\n root.left = newNode;\n swapCompleted = true;\n }\n root = root.left;\n } else {\n if (!root.right) {\n root.right = newNode;\n swapCompleted = true;\n }\n root = root.right;\n } \n }\n return newNode; \n }", "function Bst(){\n this.root = null;\n \n //make an isEmpty function to use throughout the other methods\n this.isEmpty = function(){\n if(this.root){\n return false;\n } else{\n return true;\n }\n }\n \n //make an add function to add new UNIQUE nodes to the bst\n this.add = function(val){\n nNode = new Btnode(val);\n \n //check if the bst is empty, if it is, then set the root to the new node\n if(this.isEmpty()){\n this.root = nNode;\n return this;\n }\n \n //set a runner variable to the root of the bst\n var r = this.root; \n while(r){\n if(nNode.val < r.val && r.left == null){\n nNode.parent = r;\n r.left = nNode;\n return this;\n }\n else if(nNode.val > r.val && r.right == null){\n nNode.parent = r;\n r.right = nNode;\n return this;\n }\n else if(nNode.val == r.val){\n return this;\n }\n else if(nNode.val < r.val){\n r = r.left;\n }\n else{\n r = r.right;\n }\n }\n return false;\n }\n \n //check the bst to see if it contains the given value\n this.contains = function(val){\n var r = this.root;\n while(r){\n if(val == r.val){\n return true;\n }\n else if(val < r.val){\n r = r.left;\n }\n else{\n r = r.right;\n }\n }\n return false;\n }\n \n //add get min method\n this.min = function(){\n if(this.isEmpty()){\n return false;\n }\n var r = this.root;\n while(r.left){\n r = r.left;\n }\n return r.val;\n }\n \n //add get max method\n this.max = function(){\n if(this.isEmpty()){\n return false;\n }\n var r = this.root;\n while(r.right){\n r = r.right;\n }\n return r.val;\n }\n \n //add isValid method using recursion\n this.isValid = function(r){\n if(r === undefined){ var r = this.root; }\n if(r === null){ return true; }\n if(( r.left === null || r.left.val < r.val ) &&( r.right === null || r.right.val > r.val )){\n return this.isValid(r.left) && this.isValid(r.right);\n } else {\n return false;\n }\n }\n \n //add size method using recursion\n this.size = function(r){\n if(r === undefined){ var r = this.root; }\n if(r === null){ return 0; }\n return this.size(r.left) + this.size(r.right) + 1;\n }\n \n this.remove = function(value){\n //if the bst doesn't contain the value, return the bst and don't remove anything\n if(!this.contains(value)){\n return this;\n }\n var r = this.root;\n while(r){\n //if r is the value we want to remove\n if(r.val == value){\n //if r is the value and r has no connection and we are at the root (avoid pulling val from null)\n if(r.left === null && r.right === null && r.parent == null){\n this.root = null;\n return this;\n }\n //if r is the value and r has no connection and is not parent\n else if(r.left === null && r.right === null){\n if(r.parent.val > r.val){\n r.parent.left = null;\n } else{\n r.parent.right = null;\n }\n return this;\n }\n //if r is the value and r has a right connection\n else if(r.left === null){\n if(r.parent.val > r.val){\n r.parent.left = r.right;\n } else{\n r.parent.right = r.right;\n }\n return this;\n }\n //if r is the value and r has a left connection\n else if(r.right === null){\n if(r.parent.val > r.val){\n r.parent.left = r.left;\n } else{\n r.parent.right = r.left;\n }\n return this;\n }\n //if r is the value and has both a left and right connection, search the left side for the maximum and swap values\n else{\n var max = r.left;\n //find max on the left side of r\n while(max){\n if(max.right){\n var temp = max;\n max = max.right;\n max.parent = temp;\n }\n }\n r.val = max.val;\n if(max.parent.right == max){\n max.parent.right = null;\n }\n return this;\n }\n }\n //r doesn't match so go left if it's too big\n else if(r.val > value){\n r.left.parent = r;\n r = r.left;\n }\n //r doesn't match so go right if it's too small\n else{\n r.right.parent = r;\n r = r.right;\n }\n }\n }\n \n //using the BstNode height function, we can find out the longest branch from the tree root\n this.height = function(){\n if(this.root === null){\n return 0;\n }\n return this.root.height();\n }\n \n //checking balance based on the definition that a 'balanced' tree has a branch (left and right) that are within 1 height increment away from eachother\n this.balanced = function(){\n if(this.root === null){\n return true;\n }\n if(Math.abs(this.root.left.height() - this.root.right.height()) <= 1){\n return true;\n } else{\n return false;\n }\n }\n}", "insert(value) {\n let currentNode = this;\n while (true) {\n if (value < currentNode.value) {\n if (currentNode.left === null) {\n currentNode.left = new BST(value);\n break;\n } else {\n currentNode = currentNode.left;\n }\n } else {\n if (currentNode.right === null) {\n currentNode.right = new BST(value);\n break;\n } else {\n currentNode = currentNode.right;\n }\n }\n }\n return this;\n }", "_insert(key, value, root) {\n // Perform regular BST insertion\n if (root === null) {\n return new Node(key, value);\n }\n if (this.compare(key, root.key) < 0) {\n root.left = this._insert(key, value, root.left);\n }\n else if (this.compare(key, root.key) > 0) {\n root.right = this._insert(key, value, root.right);\n }\n else {\n return root;\n }\n // Update height and rebalance tree\n root.height = Math.max(root.leftHeight, root.rightHeight) + 1;\n const balanceState = this._getBalanceState(root);\n if (balanceState === 4 /* UNBALANCED_LEFT */) {\n if (this.compare(key, root.left.key) < 0) {\n // Left left case\n root = root.rotateRight();\n }\n else {\n // Left right case\n root.left = root.left.rotateLeft();\n return root.rotateRight();\n }\n }\n if (balanceState === 0 /* UNBALANCED_RIGHT */) {\n if (this.compare(key, root.right.key) > 0) {\n // Right right case\n root = root.rotateLeft();\n }\n else {\n // Right left case\n root.right = root.right.rotateRight();\n return root.rotateLeft();\n }\n }\n return root;\n }", "function balancedBST(tree) {\n if (tree.findHeight() - tree.findHeight(0, false) > 1) {\n return false;\n }else {\n return true;\n }\n}", "function balancedBst(bst) {\n // if no left or right, return true\n if (!bst.left && !bst.right) {\n return true;\n }\n\n if (!bst.left && bst.right) {\n if (!bst.right.left && !bst.right.right) {\n return true;\n } else {\n return false;\n }\n }\n if (!bst.right && bst.left) {\n if (!bst.left.left && !bst.left.right) {\n return true;\n } else {\n return false;\n }\n }\n if (bst.left && bst.right) {\n return balancedBst(bst.left) && balancedBst(bst.right);\n }\n}", "insertNode(current, node) {\n switch (this.comparator.compare(node.value, current.value)) {\n case 0:\n // eq\n current.siblings.push(node.id);\n node.parent = current.id;\n break;\n case 1:\n // gt\n if (current.right) {\n this.insertNode(this.nodes[current.right], node);\n this.updateBalance(current);\n }\n else {\n current.right = node.id;\n node.parent = current.id;\n this.updateBalance(current);\n }\n break;\n case -1:\n // lt\n if (current.left) {\n this.insertNode(this.nodes[current.left], node);\n this.updateBalance(current);\n }\n else {\n current.left = node.id;\n node.parent = current.id;\n this.updateBalance(current);\n }\n break;\n default: throw new Error(\"Invalid comparator result\");\n }\n if (current.balance < -1) {\n if (current.left === null) {\n throw new Error(\"insertNode.balance() : left child should not be null\");\n }\n if (this.nodes[current.left].balance <= 0) {\n this.leftLeftCase(current);\n }\n else {\n this.leftRightCase(current);\n }\n }\n if (current.balance > 1) {\n if (current.right === null) {\n throw new Error(\"insertNode.balance() : right child should not be null\");\n }\n if (this.nodes[current.right].balance >= 0) {\n this.rightRightCase(current);\n }\n else {\n this.rightLeftCase(current);\n }\n }\n return current.height;\n }", "function createBalancedBst2(arr, start = 0, end = arr.length) {\n if (start >= end) {\n return null;\n }\n\n const middleIndex = Math.floor(end + start);\n const value = arr[middleIndex];\n const node = new BinarySearchTree(value);\n\n node.left = createBalancedBst(arr, start, middleIndex);\n node.right = createBalancedBst(arr, middleIndex + 1, end);\n\n return node;\n}", "insert(value) {\n const node = new BinarySearchTree(value);// create the new node\n // console.log(node);\n let current = this; // root node\n // console.log(current);\n let parent;\n while (true) { // keep looping over the tree until we find an empty tree that fits and call break\n // handle node value is less than current value\n parent = current;\n if (value < current.value) {\n current = current.left; // focus on left node\n if (current == null) { // node is empty, insert new node\n parent.left = node;\n break;\n }\n } else { // we focus on the right node for this iteration\n current = current.right; // move focus onto child right node\n if (current == null) {\n parent.right = node;\n break;\n }\n }\n }\n }", "function BSTMin(){\n var walker = this.root;\n while (walker.left != null){\n walker = walker.left;\n }\n return walker.val;\n }", "function balanceTree(arr) {\n return createNodes(arr, 0, arr.length - 1);\n}", "function balancedBSTFromSortedArr(array, start, end) {\n if (!array.length) return [];\n if (start > end) return;\n const mid = Math.floor((start + end) / 2);\n const root = new Node(array[mid]);\n\n root.left = balancedBSTFromSortedArr(array, start, mid - 1);\n root.right = balancedBSTFromSortedArr(array, mid + 1, end);\n\n return root;\n}", "function BST(array) {\n this.root = null;\n for(var i=0;i<array.length;++i){\n \tthis.add(array[i]);\n }\n}", "function BST(v) {\n this.root = this.node(v);\n}", "function bstHeight(bst, left = 0, right = 0) {\n if (bst.key === null) {\n return 0;\n }\n\n if (!bst.left && !bst.right) {\n return 1;\n }\n if (bst.left) {\n left = 1 + bstHeight(bst.left, left, right);\n }\n if (bst.right) {\n right = 1 + bstHeight(bst.right, left, right);\n }\n return left > right ? left : right;\n}", "function check_balanced(curr_node){\n if(!curr_node){\n return([true, -1]);\n }\n //let result be an array of( is_balanced, height);\n let result_left = check_balanced(curr_node.left_child);\n if(!result_left[0]){\n return(result_left);\n }\n let result_right = check_balanced(curr_node.right_child);\n if(!result_right[0]){\n return result_right;\n }\n let result = [];\n result[0] = Math.abs(result_left[1] - result_right[1]) <= 1;\n result[1] = Math.max(result_left[1], result_right[1]) + 1;\n return result; \n}", "function bstFromPreorder(preorder) {\n if (preorder.length == 0) return null;\n const ans = new TreeNode(preorder[0]);\n let stack = [[ans, Infinity]], length = preorder.length;\n for (let i = 1; i < length; i++) {\n const node = new TreeNode(preorder[i]);\n while ((stack[stack.length - 1][0].left && stack[stack.length - 1][0].right) || stack[stack.length - 1][1] < preorder[i]) {\n stack.pop();\n }\n if (preorder[i] < stack[stack.length - 1][0].val) {\n stack[stack.length - 1][0].left = node;\n stack.push([node, stack[stack.length - 1][0].val])\n } else {\n stack[stack.length - 1][0].right = node;\n stack.push([node, stack[stack.length - 1][1]]);\n }\n } \n return ans;\n}", "function isTreeBalanced(root) {\n if (root === null) {\n return true;\n }\n let leftHeight = getHeight(root.left);\n let rightHeight = getHeight(root.right);\n if (Math.abs(leftHeight - rightHeight) > 1) {\n return false;\n }\n return isTreeBalanced(root.left) && isTreeBalanced(root.right);\n}", "function BSTHeight(tree) {\n if (!tree.key) return 0;\n \n let left = 0, right = 0;\n\n if (!tree.left && !tree.right) {\n return 1;\n }\n \n if (tree.left) {\n left = BSTHeight(tree.left);\n }\n\n if (tree.right) {\n right = BSTHeight(tree.right);\n }\n\n return Math.max(left, right) + 1;\n}", "function isBalanced(tree) {\n if (!tree) {\n return true;\n }\n let diff = Math.abs(height(tree.left) - height(tree.right));\n if (diff > 1) {\n return false;\n } else {\n return isBalanced(tree.left) && isBalanced(tree.right);\n }\n}", "function sortedArrayToBST(arr){\n if(arr === null || arr.length === 0) return null;\n let mid = Math.floor(arr.length/2);\n let node = new TreeNode(arr[mid]);\n node.left = sortedArrayToBST(arr.slice(0,mid)) \n node.right = sortedArrayToBST(arr.slice(mid + 1, arr.length))\n return node \n }", "function isBalanced(root) {\n\n}", "breadthFirst() {\n let data = [];\n let queue = [];\n let current = this.root;\n queue.push(current);\n while(queue.length != 0) {\n current = queue.shift();\n data.push(current);\n if(current.left) {\n queue.push(current.left);\n }\n if(current.right) {\n queue.push(current.right);\n }\n }\n return data;\n }", "BFS() {\n // Create a queue and an array\n const q = []; // Array implementation of a queue\n const result = [];\n\n // Temporary variable to store a node that's dequeued\n let tempNode;\n\n // Enqueue the 'root' node of the tree\n q.push(this.root);\n\n // Loop until the queue has at least one node in it\n while (q.length) {\n // Perform dequeue operation and store it to a temporary variable\n tempNode = q.shift();\n\n // push tempNode's value to the 'result' array\n result.push(tempNode.val);\n\n // Check if tempNode has a 'left' property and enqueue the same\n if (tempNode.left) q.push(tempNode.left);\n\n // Check if tempNode has a 'right' property and enqueue the same\n if (tempNode.right) q.push(tempNode.right);\n }\n\n // return the result\n return result;\n }", "function isBalanced(tree) {\n if (tree === null) {\n return true;\n }\n\n if (getHeight(tree) === -1) {\n return false;\n } else {\n return isBalanced(tree.left) && isBalanced(tree.right);\n }\n}", "function BST( data ){\n\tvar root, createNode;\n\n\t// Creates tree node\n\tcreateNode = function( data ){\n\t\treturn {\n\t\t\tleft: null,\n\t\t\tdata: data,\n\t\t\tright: null\n\t\t};\n\t};\n\n\troot = createNode( data );\n\n\t// Inserts new node in tree, if it doesn't already exist\n\tthis.insert = function( data ){\n\t\tvar node, next = root, newNode;\n\n\t\t// Traverse tree to find position for new node\n\t\twhile ( next !== null ){\n\t\t\tnode = next; \n\t\t\tnext = data < node.data ? node.left : node.right;\n\n\t\t\tif ( data === node.data ){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tnewNode = createNode( data );\n\t\tif ( data < node.data ){\n\t\t\tnode.left = newNode;\n\t\t}else{\n\t\t\tnode.right = newNode;\n\t\t}\n\n\t\treturn data;\n\t};\n}", "breadthFirstSearch(){\n var data = [];\n var queue = [];\n\n queue.push(this.root);\n\n while(queue.length){\n var temp = queue.shift();\n data.push(temp);\n if(temp.left){\n queue.push(temp.left);\n }\n if(temp.right){\n queue.push(temp.right)\n }\n }\n return data;\n }", "GetTreeBalance() {\n return this.m_contactManager.m_broadPhase.GetTreeBalance();\n }", "breadthFirstTraversal() {\n let traversal = [];\n let queue = [];\n queue.unshift(this.root);\n while (queue.length > 0) {\n let node = queue.pop();\n traversal.push(node.value);\n if (node.left) {\n queue.unshift(node.left);\n }\n if (node.right) {\n queue.unshift(node.right);\n }\n }\n return traversal;\n }", "_getBalanceState(node) {\n const heightDifference = node.leftHeight - node.rightHeight;\n switch (heightDifference) {\n case -2:\n return 0 /* UNBALANCED_RIGHT */;\n case -1:\n return 1 /* SLIGHTLY_UNBALANCED_RIGHT */;\n case 1:\n return 3 /* SLIGHTLY_UNBALANCED_LEFT */;\n case 2:\n return 4 /* UNBALANCED_LEFT */;\n case 0:\n return 2 /* BALANCED */;\n default: {\n console.error('Internal error: Avl tree should never be more than two levels unbalanced');\n if (heightDifference > 0) {\n return 4 /* UNBALANCED_LEFT */;\n }\n return 0 /* UNBALANCED_RIGHT */; // heightDifference can't be 0\n }\n }\n }", "function isBalanced(tree) {\n let diff = Math.abs(getHeight(tree.left) - getHeight(tree.right));\n return diff < 2 ? true : false;\n}", "BFS(){\n var node = this.root,\n queue = [],\n data = []\n \n queue.push(node)\n while(queue.length){\n node = queue.shift()\n data.push(node.value)\n if (node.left) queue.push(node.left)\n if (node.right) queue.push(node.right)\n }\n return data\n }", "function isBST() {\r\n return isBSTUtil(this.root, Number.MIN_VALUE, Number.MAX_VALUE);\r\n}", "isBalanced(curr = this.root) {\n\t\tif (curr === null) return 0;\n\n\t\tconst leftH = this.isBalanced(curr.left);\n\t\tif (leftH === -1) return -1;\n\n\t\tconst rightH = this.isBalanced(curr.right);\n\t\tif (rightH === -1) return -1;\n\n\t\tif (Math.abs(leftH - rightH) > 1) return -1;\n\n\t\treturn Math.max(leftH, rightH) + 1;\n\t}", "function BSTAdd(val){\n if (this.root == null){\n this.root = new BTNode(val);\n return;\n }\n var walker = this.root;\n while (walker.val != null){\n if (walker.val > val){\n if (walker.left == null){\n walker.left = new BTNode(val);\n return;\n }\n walker = walker.left;\n }\n else if (walker.val <= val){\n if (walker.right == null){\n walker.right = new BTNode(val);\n return;\n }\n walker = walker.right;\n }\n }\n }", "function height(bst) {\n //if current node is null\n if(!bst) {\n return 0;\n } else {\n // traverse through left and right nodes until you reach null \n if (bst.left && !bst.right) {\n return 1 + height(bst.left);\n } else if (bst.right && !bst.left) {\n return 1 + height(bst.right);\n } else if (!bst.right && !bst.left) {\n return 1;\n } else {\n return 1 + max(height(bst.left), height(bst.right));\n }\n }\n}", "function BSTMax(){\n var walker = this.root;\n while (walker.right != null){\n walker = walker.right;\n }\n return walker.val;\n }", "breadthFirst() {\n\n let iteration = [];\n\n let traversal = (current, num) => {\n if (!current) {\n return null;\n }\n\n if (!iteration[num]) {\n iteration[num] = [current.value];\n } else {\n iteration[num].push(current.value);\n }\n\n traversal(current.left, num + 1);\n traversal(current.right, num + 1);\n };\n\n traversal(this.root, 0);\n\n let flattenArray = (array, result = []) => {\n\n for (let i = 0; i < array.length; i++) {\n let value = array[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n result[result.length] = value;\n }\n }\n\n return result;\n };\n\n return flattenArray(iteration);\n }", "function minimumBST (array) {\n\n var midPoint = array[Math.floor(array.length/2)];\n var head;\n\n function innerTreeMaker(currentArr) {\n\n if(currentArr.length === 0) return null;\n if(currentArr.length === 1) return currentArr[0];\n\n var mid = Math.floor(currentArr.length / 2);\n var currentNode = new Node (array[mid]);\n\n if (head === null) {\n head = currentNode;\n }\n\n currentNode.left = innerTreeMaker(currentArr.slice(0, mid));\n currentArr.right = innerTreeMaker(currentArr.slice(mid));\n\n }\n\n innerTreeMaker(array)\n\n return head;\n}", "function isBalanced(root) {\n if (!root) return true; // 1) base case if no tree/root, tree is balanced\n\n let heightDifference = getMaxHeight(root.left) - getMaxHeight(root.right); // 2) find height difference of left and right subtrees\n\n let heightIsBalanced = Math.abs(heightDifference) <= 1; // 3) check if height difference is balanced\n\n return heightIsBalanced && isBalanced(root.left) && isBalanced(root.right); // 4) recursively check all subtrees for balanced\n}", "function mediumTree() {\n\tlet b = makeBST();\n\tb.insert(\"S\");\n\tb.insert(\"E\");\n\tb.insert(\"X\");\n\tb.insert(\"A\");\n\tb.insert(\"R\");\n\tb.insert(\"C\");\n\tb.insert(\"H\");\n\tb.insert(\"M\");\n\treturn b;\n}", "bfs() {\n let result = [];\n let queue = [];\n queue.push(this.root);\n while(queue.length) {\n let currentNode = queue.shift();\n result.push(currentNode.value);\n if (currentNode.left) {\n queue.push(currentNode.left);\n }\n if (currentNode.right) {\n queue.push(currentNode.right);\n }\n }\n return result;\n }", "function validateBST(root) {\n let queue = [root];\n while(queue.length) {\n let currentNode = queue.shift();\n if ((!currentNode.left || (currentNode.left.value < currentNode.value)) && (!currentNode.right || (currentNode.right.value > currentNode.value))) {\n if (currentNode.left) {\n queue.push(currentNode.left);\n }\n if (currentNode.right) {\n queue.push(currentNode.right);\n }\n } else {\n return false;\n }\n \n }\n return true;\n\n }", "insert(value) {\n if (this.value === null || this.value === undefined) {\n this.value = value;\n\n return this;\n }\n if (value < this.value) {\n if (this.left) {\n return this.left.insert(value);\n }\n const newNode = new BinarySearchTreeNodes(value);\n this.setLeft(newNode);\n this.left.parent = this;\n\n return newNode;\n } else if (value > this.value) {\n if (this.right) {\n return this.right.insert(value);\n }\n const newNode = new BinarySearchTreeNodes(value);\n this.setRight(newNode);\n this.right.parent = this;\n\n return newNode;\n }\n return this;\n }", "insert(value) {\n // Create a new node with the value passed\n let newNode = new Node(value);\n // Check edge case (if tree is empty)\n if (!this.root) {\n this.root = newNode;\n } else {\n // If edge case is not true, first set a current value, we always start with the node\n let previous = this.root;\n // We can set any statement here to loop that is true, I used while previous is true which is always true, we will break out of looping with the break keyword\n while (previous) {\n // If the value of the new node is less than the current node, then we either traverse down the left of the list, or we set the .left of the node to the new node. We do the second case if and only if the .left property is null. We cannot trasverse directly until we hit null because then we will end up just setting null to the node instead of appending to the list\n if ((value = previous.value)) return;\n if (newNode.value < previous.value) {\n if (!previous.left) {\n previous.left = newNode;\n break;\n } else {\n previous = previous.left;\n }\n } else {\n // Likewise for the explanation above, this is the same\n if (!previous.right) {\n previous.right = newNode;\n break;\n } else {\n previous = previous.right;\n }\n }\n }\n }\n // Finally return the binary search tree\n return this;\n }", "function heightBalanced(root) {\n if (!root) {\n return true\n }\n let leftHeight = height(root.left)\n console.log(leftHeight)\n let rightHeight = height(root.right)\n console.log(rightHeight)\n if (Math.abs(leftHeight - rightHeight) <= 1 && heightBalanced(root.left) && heightBalanced(root.right)) {\n return true\n } else {\n return false\n }\n}", "balance(config = {}) {\n return this.children.length <= 8 /* Balance.BranchFactor */ ? this :\n balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));\n }", "insert(value) {\n this.count++;\n let newNode = new Node(value)\n const searchTree = (node) => {\n // if value < node.value, go left\n if (value < node.value) {\n // if no left child, append new node\n if (!node.left) {\n node.left = newNode; \n // if left child, look left again\n } else {\n searchTree(node.left);\n }\n }\n // if value > node.value, go right\n if (value > node.value ) {\n // if no right child, append new node\n if (!node.right) {\n node.right = newNode;\n // if right child, look right again\n } else {\n searchTree(node.right);\n }\n }\n }\n searchTree(this.root);\n }", "delete(root, data) {\n // STEP 1: PERFORM STANDARD BST DELETE\n if (root == null) return root;\n \n // If the data to be deleted is smaller than\n // the root's data, then it lies in left subtree\n if (data < root.data) root.left = this.delete(root.left, data);\n // If the data to be deleted is greater than the\n // root's data, then it lies in right subtree\n else if (data > root.data) root.right = this.delete(root.right, data);\n // if data is same as root's data, then this is the node\n // to be deleted\n else {\n // node with only one child or no child\n if (root.left == null || root.right == null) {\n let temp = null;\n //if left node is null then set root to right Other wise left node assign to Root \n if (root.left === null ) \n temp = root.right;\n else temp = root.left;\n \n // No child available case\n if (temp == null) {\n temp = root;\n root = null;\n } // One child case\n else root = temp; // Copy the contents of\n // the non-empty child\n } else {\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n let temp = this.getMinValueNode(root.right);\n \n // Copy the inorder successor's data to this node\n root.data = temp.data;\n \n // Delete the inorder successor\n root.right = this.delete(root.right, temp.data);\n }\n }\n \n // If the tree had only one node then return\n if (root == null) return root;\n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = this.max(this.height(root.left), this.height(root.right)) + 1;\n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n const balance = this.getBalance(root);\n \n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && this.getBalance(root.left) >= 0)\n return this.rightRotate(root);\n \n // Left Right Case\n if (balance > 1 && this.getBalance(root.left) < 0) {\n root.left = this.leftRotate(root.left);\n return this.rightRotate(root);\n }\n \n // Right Right Case\n if (balance < -1 && this.getBalance(root.right) <= 0)\n return this.leftRotate(root);\n \n // Right Left Case\n if (balance < -1 && this.getBalance(root.right) > 0) {\n root.right = this.rightRotate(root.right);\n return this.leftRotate(root);\n }\n \n return root;\n }", "bfs() {\n // need to use a queue when we are doing breadth first searching \n let currentNode = this.root;\n let queue = [];\n let visitedNodes = [];\n // push our current value into our queue array \n queue.push(currentNode);\n // while there are still elements in our queue array\n while (queue.length) {\n // first in is the first out so we work with the oldest item\n currentNode = queue.shift();\n // push the current value into our visited Nodes array\n visitedNodes.push(currentNode.val);\n // if there is a left side that exists \n if (currentNode.left) {\n // push that into our queue to work on \n queue.push(currentNode.left);\n }\n // after the left side if a right side exists then we can push that into the queue\n if (currentNode.right) {\n // push that right value into the queue\n queue.push(currentNode.right);\n }\n }\n // return the array of nodes we have visited \n return visitedNodes;\n }", "function balanceSide(currentNode, arr) {\n if(arr.length === 1) {\n var node = new Node(arr[0]);\n currentNode = node;\n }\n else if(arr.length === 2) {\n var node = new Node(arr[1]);\n var left = new Node(arr[0]);\n currentNode = node;\n currentNode.left = left;\n }\n else {\n var mid = median(arr);\n var node = new Node(arr[mid]);\n node.left = balanceSide(node.left, arr.slice(0, mid));\n node.right = balanceSide(node.right, arr.slice(mid + 1));\n currentNode = node;\n }\n return currentNode;\n }", "insert(value) {\n const newNode = new Node(value);\n if (this.root === null) {\n this.root = newNode;\n return this;\n }\n let current = this.root;\n while (true) {\n if (value === current.value) return undefined;\n if (value < current.value) {\n if (current.left === null) {\n current.left = newNode;\n return this;\n }\n current = current.left;\n } else {\n if (current.right === null) {\n current.right = newNode;\n return this;\n }\n current = current.right;\n }\n }\n }", "bfs() {\n let result = [],\n queue = [],\n node = null;\n\n queue.push(this.root);\n\n while (queue.length) {\n node = queue.shift();\n result.push(node);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n\n return result;\n }", "function sortedArrayToBST(nums) {\n if (!nums.length) return null;\n let idx = Math.floor(nums.length / 2);\n let mid = nums[idx];\n\n let root = new TreeNode(mid);\n\n root.left = sortedArrayToBST(nums.slice(0, idx));\n root.right = sortedArrayToBST(nums.slice(idx + 1));\n\n return root \n}", "function BFS(root) {\n let queue = [root];\n\n while (queue.length > 0) {\n let curr = queue.shift();\n console.log(curr.val);\n if (curr.left) {\n queue.push(curr.left);\n }\n if (curr.right) {\n queue.push(curr.right);\n }\n }\n}", "function validateBst(tree) {\n\n\n return traverse(tree,-Infinity, Infinity)\n\n }", "function isBalanced(node) {\n if (!node) return 0;\n\n var left = isBalanced(node.left);\n var right = isBalanced(node.right);\n\n if (left === false || right === false) {\n return false;\n } else if (Math.abs(left - right) > 1) {\n return false;\n } else {\n return Math.max(left, right) + 1;\n }\n}", "BFS() {\n let node = this.root;\n const data = [];\n const queue = [];\n\n queue.push(node);\n\n while (queue.length) {\n node = queue.shift();\n data.push(node.value);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n return data;\n }", "function getBST(players, metric=\"HR\") {\n const bst = binarySearchTree();\n players.forEach(\n player => insert(player, metric, bst)\n );\n return bst;\n}", "BFS() {\n let result = [];\n let queue = [];\n let current = this.root;\n let dequeued;\n\n if (!this.root) return undefined;\n queue.push(this.root);\n while (queue.length) {\n current = queue.shift();\n result.push(current.value);\n if (current.left) {\n queue.push(current.left);\n }\n if (current.right) {\n queue.push(current.right);\n }\n }\n return result;\n }", "BFS() {\n let data = [],\n queue = [],\n node = this.root\n queue.push(node)\n\n while (queue.length) {\n node = queue.shift()\n data.push(node.value)\n if (node.left) queue.push(node.left)\n if (node.right) queue.push(node.right)\n }\n return data\n }", "function findClosestValueInBst(tree, target) {\n // Write your code here.\n let current=tree;\n let closest=tree.value;\n\n while(current!==null){\n\n if(current.value===target){\n closest=current.value;\n break;\n }\n //if target-current.value is less than target-cloest, then the current value is smaller\n if(Math.abs(target-closest)>Math.abs(target-current.value)){\n closest=current.value;\n }\n\n //target<current.value then the number to the left has a higher chance being closer to it\n if(target<=current.value){\n current=current.left;\n }else if(target>current.value){\n current=current.right\n }\n }\n \n }", "function findClosestValueInBst(tree, target) {\nlet currentNode = tree;\nlet closest = Infinity;\nwhile(currentNode !== null){\n if(Math.abs(target-currentNode.value) < Math.abs(target-closest)){\n closest = currentNode.value\n }\n if(currentNode.value > target){\n currentNode = currentNode.left\n } else {\n currentNode = currentNode.right\n } \n}\nreturn closest\n}", "insert(val) {\n // If we have an empty tree, insert new val at the root\n if(this.root === null){\n this.root = new Node(val);\n return this;\n }\n\n // If not we find the right spot for the node\n let current = this.root;\n while (true){\n if(val < current.val){\n if(current.left === null){\n current.left = new Node(val);\n return this;\n } else {\n current = current.left;\n }\n } else if(current.val < val){\n if(current.right === null) {\n current.right = new Node(val);\n return this;\n } else {\n current = current.right;\n }\n\n }\n }\n\n }", "function heightOfBST(bst) {\n let leftHeight = 0;\n let rightHeight = 0;\n\n if(!bst) {\n return 0;\n }\n else {\n leftHeight = heightOfBST(bst.left);\n rightHeight = heightOfBST(bst.right);\n if (leftHeight > rightHeight) {\n return leftHeight++;\n }\n else {\n return rightHeight++;\n }\n }\n}", "function isBalancedBT(rootNode) {\n\n const stack = [];\n\n stack.push({node: rootNode, depth: 0});\n\n let firstLeafDepth, secondLeafDepth;\n\n while (stack.length) {\n\n const {node, depth} = stack.pop();\n\n if (node.left) {\n stack.push({node: node.left, depth: depth + 1});\n }\n\n if (node.right) {\n stack.push({node: node.right, depth: depth + 1});\n }\n\n if (!node.left && !node.right) {\n if (!firstLeafDepth) {\n firstLeafDepth = depth;\n } else if (Math.abs(firstLeafDepth - depth) > 1) {\n return false;\n } else if (depth !== firstLeafDepth && !secondLeafDepth) {\n secondLeafDepth = depth;\n } else if (depth !== firstLeafDepth && depth !== secondLeafDepth) {\n return false;\n }\n }\n\n }\n\n return true;\n\n}", "function tree(t) {\n if (!t) {\n return 0;\n }\n return tree(t.left) + t.key + tree(t.right);\n}", "insert(val) {\n // if there is no root values in the tree we should isnert one \n if(this.root === null){\n // create a new node\n this.root = new Node(val);\n // return the tree (which is what this is referring to)\n return this;\n }\n // if it has values then we should find a spot for it on the tree\n // very similar to searching for a value \n // have our current Node available if there is one\n let currentNode = this.root;\n // should run until the value is placed and the return statements will break us out of the loop\n while(true){\n // if the value of our current node is less than the value that we want to insert it will go to the right \n if(currentNode.val < val){\n // if there is no right value existing then we can create a new node to be the right value of the current node\n if(currentNode.right === null){\n currentNode.right = new Node(val);\n // we return the tree\n return this;\n // otherwise we have to traverse to the existing right node and then we check it again because the while loop wont break unless the value is inserted\n } else{\n currentNode = currentNode.right;\n }\n // this is the inverse where we insert values to the left\n } else if(currentNode.val > val){\n // if there is no left valye\n if(currentNode.left === null){\n // create a new node at the left valye\n currentNode.left = new Node(val);\n // return the tree\n return this;\n // otherwise we traverse to that node and the loop starts again \n } else{\n currentNode = currentNode.left;\n }\n }\n\n }\n }", "function isBst(bst) {\n if (!bst.left && !bst.right) {\n return true;\n }\n if (bst.left) {\n if (bst.left.value >= bst.value) {\n return false;\n }\n isBst(bst.left);\n }\n if (bst.right) {\n if (bst.right.value <= bst.value) {\n return false;\n }\n isBst(bst.right);\n }\n return true;\n}", "function isBST(bst) {\n if(bst.left) {\n if(bst.left.key > bst.key) {\n return false;\n }\n if(!isbst(bst.left)) {\n return false;\n }\n }\n if(bst.right) {\n if(bst.right.key < bst.key) {\n return false;\n }\n if(!isbst(bst.right)) {\n return false;\n }\n }\n return true;\n }", "function bstHeight(bst) {\n if (bst === null) {\n return 0;\n } else {\n let heightL = bstHeight(bst.left);\n let heightR = bstHeight(bst.right);\n if (heightL > heightR) {\n return heightL + 1;\n } else {\n return heightR + 1;\n }\n }\n}", "function bfs(root) {\n const queue = [];\n queue.push(root);\n while (queue.length) {\n const top = queue.shift();\n console.log(top.value);\n top.left && queue.push(top.left);\n top.right && queue.push(top.right);\n }\n}", "insert(newData) {\n if (newData < this.data && this.left) {\n this.left.insert(newData)\n } else if (newData < this.data) {\n this.left = new BST(newData)\n }\n \n if (newData > this.data && this.right) {\n this.right.insert(newData)\n } else if (newData > this.data) {\n this.right = new BST(newData)\n }\n }", "function minHeightBst(array) {\n // Write your code here.\n return constructTree(array, 0, array.length - 1);\n}", "insert(value, runner = this.root){\r\n if(runner == null){\r\n this.root = new BSNode(value);\r\n return this;\r\n }\r\n\r\n if(value >= runner.value) {\r\n if(runner.right == null){\r\n runner.right = new BSNode(value);\r\n return this;\r\n }\r\n return this.insert(value, runner.right);\r\n }\r\n else {\r\n if(runner.left == null) {\r\n runner.left = new BSNode(value);\r\n return this;\r\n }\r\n return this.insert(value, runner.left);\r\n }\r\n }", "BFS() {\n let data = [];\n let queue = [];\n let node = this.root;\n queue.push(node);\n while (queue.length) {\n node = queue.shift();\n data.push(node.value);\n if (node.left) queue.push(node.left);\n if (node.right) queue.push(node.right);\n }\n return data;\n }", "min(){\r\n if(this.isEmpty()){\r\n console.log(\"Tree is empty!\");\r\n return null;\r\n }\r\n\r\n let runner = this.root;\r\n while(runner.left != null){\r\n runner = runner.left;\r\n }\r\n return runner.value;\r\n }", "function checkSubTree(root) {\n if (!root) return 0;\n const hLeft = checkSubTree(root.left);\n const hRight = checkSubTree(root.right);\n // once we know its unbalanced keep passing -Infinity up\n if (hRight === -Infinity || hLeft === -Infinity) return -Infinity;\n\n // if NOT balanced\n if (Math.abs(hLeft - hRight) > 1) return -Infinity;\n // if balanced\n else return Math.max(hLeft, hRight) + 1;\n}", "function BinarySearchTree (value) {\n this.value = value\n this.left = null\n this.right = null\n}", "insertRecursively(val, current = this.root) {\n // If the tree is empty insert at the root.\n if (this.root === null) {\n this.root = new Node(val);\n return this;\n }\n\n // If not we find the right spot for the new val\n // recursively\n\n if(val < current.val){\n if(current.left === null){\n current.left = new Node(val);\n return this;\n } else {\n this.insertRecursively(val, current = current.left);\n }\n } else if(current.val < val){\n if(current.right === null) {\n current.right = new Node(val);\n return this;\n } else {\n this.insertRecursively(val, current = current.right);\n }\n\n }\n\n }", "function main() {\n let numArr = [3, 1, 4, 6, 9, 2, 5, 7];\n let result = insertNumBst(numArr);\n // tree(result); \n console.log(height(result));\n\n let fakeTree ={key: 3, left:{key: 5}};\n console.log(bstChecker(result));\n bstChecker(fakeTree)\n\n let letterArr = ['E', 'A', 'S', 'Y', 'Q', 'U', 'E', 'S', 'T', 'I', 'O', 'N'];\n insertLettersBst(letterArr);\n}", "function findClosestValueInBst(tree, target) {\n let current = tree\n let closest = tree.value\n while (current) {\n if (Math.abs(current.value - target) < Math.abs(target - closest)) {\n closest = current.value\n }\n if (target > current.value) {\n current = current.right\n }\n else if (target < current.value) {\n current = current.left\n }\n else {\n return closest\n }\n }\n return closest\n}", "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "function isBST(root) {\n const queue = [root];\n\n while (queue.length) {\n const node = queue.pop();\n if (node.left) {\n if (node.left.value >= node.value) {\n return false;\n }\n queue.unshift(node.left);\n }\n if (node.right) {\n if (node.right.value < node.value) {\n return false;\n }\n queue.unshift(node.right);\n }\n }\n\n return true;\n}", "function floorBST(root, X) {\n if (root === null) return null\n floorBSTRecur(root, X)\n return floor\n}", "bfs() {\r\n let result = []\r\n let queue = []\r\n\r\n queue.push(this.root)\r\n\r\n while (queue.length) {\r\n //dequeue\r\n let currentNode = queue.shift()\r\n\r\n //push to result\r\n result.push(currentNode.data)\r\n\r\n //enqueue child nodes\r\n //push to result\r\n if (currentNode.left) {\r\n queue.push(currentNode.left)\r\n }\r\n if (currentNode.right) {\r\n queue.push(currentNode.right)\r\n } \r\n }\r\n\r\n return result\r\n }", "function orderTest() {\n const BST = new BinarySearchTree();\n [25, 15, 50, 10, 24, 35, 70, 4, 12, 18, 31, 44, 66, 90, 22].forEach(num => {\n BST.insert(num, num);\n });\n //console.log(inOrder(BST));\n //console.log(preOrder(BST));\n //console.log(postOrder(BST));\n}", "insert(value) {\n let newNode = new Node(value);\n if (!this.root) {\n return this.root = newNode;\n } else {\n let current = this.root;\n while (current) {\n if (value < current.value) {\n if (!current.left) {\n return current.left = newNode;\n }\n current = current.left;\n } else {\n if (!current.right) {\n return current.right = newNode;\n }\n current = current.right;\n }\n }\n }\n }", "insertRecursive(value){\n var newNode = new Node(value);\n if (traverse(this.root)) this.root = newNode;\n \n function traverse(current){\n if (current === null) return true;\n \n if (newNode.value > current.value) {\n if (traverse(current.right)) current.right = newNode;\n } else if (newNode.value < current.value) {\n if (traverse(current.left)) current.left = newNode;\n }\n \n return false;\n }\n \n return this;\n }", "function numbers() {\n let BST = new BinarySearchTree();\n const num = [3, 1, 4, 6, 9, 2, 5, 7];\n num.forEach((element) => BST.insert(element));\n return BST;\n}" ]
[ "0.7789535", "0.6980783", "0.6961443", "0.69460994", "0.69186974", "0.6902281", "0.67135483", "0.6669187", "0.6631955", "0.6584506", "0.65605843", "0.653778", "0.6526986", "0.6490976", "0.6478659", "0.64777195", "0.63858235", "0.6381439", "0.6335802", "0.632249", "0.626935", "0.6220734", "0.6191157", "0.6188921", "0.6109488", "0.6108035", "0.6107679", "0.609796", "0.6095214", "0.60879993", "0.60635483", "0.6045792", "0.6031415", "0.60308856", "0.6025682", "0.6017745", "0.6013143", "0.6004026", "0.599922", "0.5963228", "0.59624547", "0.59584945", "0.5948626", "0.593483", "0.5922818", "0.59204507", "0.59118164", "0.5904009", "0.590188", "0.5900804", "0.58887684", "0.5888572", "0.58855826", "0.5858171", "0.584784", "0.5844429", "0.5838516", "0.58379054", "0.5837071", "0.5836494", "0.5836446", "0.58308566", "0.58298194", "0.58223253", "0.5811887", "0.5806256", "0.58061796", "0.58056444", "0.5801911", "0.5799581", "0.57922494", "0.57921064", "0.578869", "0.5786093", "0.57764703", "0.5756755", "0.57401127", "0.5727489", "0.5725121", "0.5723154", "0.57190967", "0.57189566", "0.5715285", "0.571246", "0.5707422", "0.57058406", "0.5698006", "0.5682152", "0.56780267", "0.56746197", "0.5669286", "0.56595224", "0.56595224", "0.5657232", "0.5651801", "0.564891", "0.5648876", "0.5646832", "0.5646719", "0.5638787" ]
0.78425217
0