Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns only dogs that start with the search string
function filterByName(dogs, name) { return dogs.filter(function(dog) { return dog.name.toLowerCase().startsWith(name.toLowerCase()); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findWords(dogString,dogNames)\n{\n let dogName = dogString.split(\",\")[1].toLowerCase().split(\" \").splice(-1);\n for(let i=0; i <= dogNames.length; i++)\n {\n if(dogNames[i].toLowerCase() == dogName)\n {\n return \"Matched dog_name\";\n }\n continue;\n ...
[ "0.65473694", "0.6161114", "0.6121134", "0.60136485", "0.59895986", "0.5869747", "0.5784009", "0.57766646", "0.5769014", "0.5716776", "0.5659882", "0.5650109", "0.56455165", "0.5618156", "0.56046224", "0.5590966", "0.55878466", "0.5573191", "0.55503625", "0.55425304", "0.5534...
0.6567688
0
Returns only dogs that match the breed exactly
function filterByBreed(dogs, breed) { return dogs.filter(function(dog) { return dog.breed === breed; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gooseFilter(birds){\n const geese = ['African', 'Roman Tufted', 'Toulouse', 'Pilgrim', 'Steinbacher'];\n return birds.filter(bird => !geese.includes(bird));\n}", "function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}", "function onlyDrama(movies){\n return movies.f...
[ "0.6019023", "0.5976843", "0.59504163", "0.5857991", "0.5854265", "0.5829342", "0.58144844", "0.5748318", "0.56847286", "0.5640317", "0.5613768", "0.5601369", "0.5573348", "0.5565394", "0.5549305", "0.5539864", "0.5471456", "0.54704934", "0.54672444", "0.54671884", "0.5464394...
0.74894947
0
Returns only dogs that are included in the selected dog sizes
function filterBySize(dogs, sizes) { return dogs.filter(function(dog) { return sizes.includes(dog.size); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(dogs, inputs) {\n if (inputs.name) {\n dogs = filterByName(dogs, inputs.name);\n }\n if (inputs.breed) {\n dogs = filterByBreed(dogs, inputs.breed);\n }\n if (inputs.sizes && inputs.sizes.length > 0) {\n dogs = filterBySize(dogs, inputs.sizes);\n }\n return dogs;\n}", "function fD...
[ "0.6484849", "0.55410784", "0.5519137", "0.55004203", "0.5353505", "0.53114176", "0.5301908", "0.5297326", "0.52909994", "0.52301896", "0.523016", "0.5223799", "0.51765054", "0.50672436", "0.49874812", "0.4961645", "0.4942444", "0.48781925", "0.4832489", "0.48246303", "0.4807...
0.8293143
0
Is the component a react function of scan like java?
constructor() { super() //Think of the car and wheel example wheels on the car or we build many cars... this.state = { //This is where we make the factory name: "", //The person we build email: "", //Their email we have password: "", //Their unique identifyier that they only know error:"", //value can be added to this user profile for support later on? open: false }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scan() {\n store.dispatch(startScan());\n }", "scan(input){\n\n }", "render() {\n return (\n\n <div>\n This is React search Component !\n </div>\n );\n }", "function FunctionalComponent() {}", "handleClickScanButton() {\n this.setState({\n ...
[ "0.5729474", "0.55795324", "0.55683124", "0.55635256", "0.54626864", "0.54334146", "0.54009145", "0.535205", "0.53415686", "0.53217983", "0.5287848", "0.5252748", "0.52402735", "0.52396387", "0.5231014", "0.520937", "0.5199561", "0.5167802", "0.51661414", "0.5162427", "0.5126...
0.0
-1
The render function opens method(s) below If you want to add things to the signup page Put them in here
render() { const {name, email, password, error, open} = this.state //destructure is a Big O return ( <div className="container"> <h2 className="ml-0 mt-5 mb-5" > Signup </h2> {/*// margin of 5 bottom of 5*/} {/* The error message will be above the form - the light blue stripe*/} {/*condiitonal value is set within the style tag to appear only on error */} <div className="alert alert-danger" style={{display: error ? "" :"none"}}> {error} {/*this is destructured and collects the state value */} </div> <div className="alert alert-info" style={{display: open ? "" :"none"}} > Account created Successfully. Please <Link to="/signin">Sign In</Link> </div> {this.signupForm(name, email, password)} </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\t{...this.props}\n\t\t\t\t{...this.state}\n\t\t\t\tonSubmit={this.handleSubmit}\n\t\t\t\tonBack={this.handleCancel}\n\t\t\t\tonChange={this.handleChange}\n\t\t\t\tonRangeChange={this.handleRangeChange}\n\t\t\t\tonUserSelection={this.handleUserSelection}\n\t\t\t\tonCr...
[ "0.7378705", "0.73150885", "0.71624327", "0.70459884", "0.70391893", "0.7010485", "0.69932497", "0.6988795", "0.6946535", "0.6912021", "0.6899727", "0.6857819", "0.6855621", "0.685367", "0.6695107", "0.6692088", "0.66763264", "0.6659908", "0.6630246", "0.66160893", "0.6602883...
0.61811364
57
If you click on input with same name then minus val and ckecked false
function checkActiveSameNames(context) { $('.form-content input').each(function(i, input) { if ($(input).prop('checked')) { if (context.prop('name') == $(this).prop('name')) { if (context.prop('id') != $(this).prop('id')) { $(this).prop('checked', false); carPrice = carPrice - parseInt($(this).val()); } } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_element_value() {\n if ( regex.test(this.name) ) {\n $(this).val(nval);\n //log_inline.log('Blanking value [' , nval , '] for input with name: ' , this.name);\n }\n }", "function a(e){return function(){var t=this.element.val();e.apply(thi...
[ "0.6132339", "0.59494346", "0.5926352", "0.57899845", "0.5777096", "0.576324", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.5720987", "0.57096267", "0.5706699", "0.5704157", "0.56800157", "0.5675853", "0.56...
0.57686555
5
Show calctulated car price
function showCarPrice(price) { $(modelPrice).empty().text(price + '$'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPrice(){\r\n\tdocument.getElementById(\"cost\").innerText = \"$\" + (cost + size_cost + glazing_cost).toFixed(2);\r\n}", "function calcPrice(){\n var price = doorPrice + handlePrice;\n document.getElementById('price').innerHTML = \"\";\n document.getElementById('price').innerHTML = \"Prezzo: \...
[ "0.7187774", "0.6948575", "0.6907733", "0.68868595", "0.68632525", "0.6844997", "0.6727364", "0.6718678", "0.66953075", "0.66783535", "0.6627213", "0.6595778", "0.6594391", "0.6583834", "0.65674424", "0.6555324", "0.6554547", "0.6553843", "0.6550379", "0.65397143", "0.6528668...
0.7564609
0
This plugin will automatically rotate the globe around its vertical axis a configured number of degrees every second.
function autorotate(degPerSec) { // Planetary.js plugins are functions that take a `planet` instance // as an argument... return function(planet) { var lastTick = null; var paused = false; planet.plugins.autorotate = { pause: function() { paused = true; }, resume: function() { paused = false; } }; // ...and configure hooks into certain pieces of its lifecycle. planet.onDraw(function() { if (paused || !lastTick) { lastTick = new Date(); } else { var now = new Date(); var delta = now - lastTick; // This plugin uses the built-in projection (provided by D3) // to rotate the globe each time we draw it. var rotation = planet.projection.rotate(); rotation[0] += degPerSec * delta / 1000; if (rotation[0] >= 180) rotation[0] -= 360; planet.projection.rotate(rotation); lastTick = now; } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myTimer(now) {\n if (rotationOn) {\n tNew = now;\n dt = tOld - tNew;\n steps = dt * 360 / tRotation;\n\n pos = oldPos - steps //the earth rotates towards the east\n\n if (pos <= -180) {pos = pos+360}\n\n projection.rotate([pos, 0]);\n ...
[ "0.6983913", "0.64857525", "0.63927674", "0.6361528", "0.63423246", "0.63388485", "0.630926", "0.6284332", "0.62682617", "0.62682617", "0.618183", "0.6147924", "0.61002016", "0.60458523", "0.60326064", "0.60320854", "0.60225177", "0.59840155", "0.5983982", "0.59717625", "0.59...
0.63778317
3
This plugin takes lake data from the special TopoJSON we're loading and draws them on the map.
function lakes(options) { options = options || {}; var lakes = null; return function(planet) { planet.onInit(function() { // We can access the data loaded from the TopoJSON plugin // on its namespace on `planet.plugins`. We're loading a custom // TopoJSON file with an object called "ne_110m_lakes". var world = planet.plugins.topojson.world; lakes = topojson.feature(world, world.objects.ne_110m_lakes); }); planet.onDraw(function() { planet.withSavedContext(function(context) { context.beginPath(); planet.path.context(context)(lakes); context.fillStyle = options.fill || 'black'; context.fill(); }); }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lakes(options) {\n\t options = options || {};\n\t var lakes = null;\n\t\n\t return function(planet) {\n\t planet.onInit(function() {\n\t // We can access the data loaded from the TopoJSON plugin\n\t // on its namespace on `planet.plugins`. We're loading a custom\n\t // T...
[ "0.64040565", "0.6390578", "0.6311872", "0.6278037", "0.6254612", "0.6191077", "0.6155553", "0.61390954", "0.6113944", "0.6065498", "0.6058482", "0.6048828", "0.6002596", "0.59925497", "0.59917957", "0.598388", "0.59825766", "0.5957769", "0.5957241", "0.5940285", "0.59372556"...
0.64078116
0
region Traverse =============================================================== BEGIN ===============================================================
function Traverse(obj) { if (!(this instanceof Traverse)) { return new Traverse(obj); } this.value = obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function walker() {\n\n}", "function traverse(root) {}", "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 ...
[ "0.62409014", "0.6152476", "0.609079", "0.60179514", "0.60150814", "0.5981329", "0.5981329", "0.59724647", "0.58751833", "0.5854579", "0.5852606", "0.5834093", "0.5831164", "0.5795604", "0.5757922", "0.5731947", "0.5724908", "0.5721031", "0.5698307", "0.5684423", "0.5668885",...
0.0
-1
Recalculates svg and element sizes when the chart is resized
recalculateSizes() { let elem = ReactDOM.findDOMNode(this).parentNode; this.width = elem.offsetWidth - 30; this.divHeight = elem.offsetHeight; this.height = this.data.length * 60; this.barHeight = (this.height - 50) / this.data.length / 2; const minSize = Math.min(this.width, this.divHeight); this.textSize = minSize / 30; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\n size = chartData.size = d3.event.detail.size;\n redraw();\n }", "function chart_resize(width)\n {\n if( $(elm).length )\n {\n var height = width * ratio;\n $(elm).attr(\"height\", height + \"px\");\n $(elm).attr(\"width\", width + \"px\");\n $(elm).wi...
[ "0.8191736", "0.79434687", "0.787385", "0.7837152", "0.7815759", "0.7815759", "0.78108543", "0.78098637", "0.7780156", "0.7780156", "0.7780156", "0.7780156", "0.7754976", "0.7749732", "0.7736269", "0.77310205", "0.77310205", "0.7721554", "0.7709251", "0.7703007", "0.7703007",...
0.7320122
41
Called from the visualization page
handleResize() { if (this.data === undefined) { // do nothing } else { this.drawBarChart(); // Draw bar chart this.forceUpdate(); // Forces re-render so that it takes up the appropriate space } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addDataVisuals () {\n }", "_render() {\n\t\tthis.tracker.replaceSelectedMeasures();\n }", "function SVGPieChart() {\r\n }", "function makeVis() {\n ScatterPlot = new ScatterPlot(\"scatter_plot\", all_data, lottery_data, round_1_data, round_2_data);\n Slider = new Slider('slider', all_data);\n\n}...
[ "0.6461024", "0.64574647", "0.62805665", "0.6276297", "0.62708634", "0.6232274", "0.6221378", "0.62108576", "0.6189503", "0.6139483", "0.61315024", "0.6118983", "0.60692227", "0.6065836", "0.60617703", "0.6053029", "0.6041915", "0.60339653", "0.6032007", "0.6012257", "0.59938...
0.0
-1
Creates the bar chart
drawBarChart() { this.recalculateSizes(); // calculate sizes before drawing // Remove existing bar chart svg d3.select("div." + this.barClass) .select("svg") .remove(); // Create new svg for the bar chart this.svg = d3 .select("div." + this.barClass) .append("svg") .attr("width", this.width) .attr("height", this.height); // alter this dynamically // Finding the maximum number of times a rule has been suggested. // Used to calculate bar width later this.maxSuggested = 0; for (let i = 0; i < this.data.length; i++) { if (this.data[i].num_suggested > this.maxSuggested) { this.maxSuggested = this.data[i].num_suggested; } } // Sorting data to display it in descending order this.data.sort((a, b) => (a.num_suggested < b.num_suggested ? 1 : -1)); // Drawing the rectangles based on times the rule has been suggested this.svg .selectAll("rect.totalRect") .data(this.data) .enter() .append("rect") .attr("fill", "white") .style("fill-opacity", 1e-6) .attr("stroke", "black") .attr("x", this.width * 0.1) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_suggested / this.maxSuggested) * 0.8 * this.width) .attr("class", "totalRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Drawing the rectanbles for number of times the rule has been accepted this.svg .selectAll("rect.acceptedRect") .data(this.data) .enter() .append("rect") .attr("fill", "green") .attr("stroke", "black") .attr("x", this.width * 0.1) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_accepted / this.maxSuggested) * 0.8 * this.width) .attr("class", "acceptedRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Drawing the rectangles for number of times the rule has been rejected this.svg .selectAll("rect.rejectedRect") .data(this.data) .enter() .append("rect") .attr("fill", "red") .attr("stroke", "black") .attr("x", d => { // Starting where the accepted rectangle ends return this.width * 0.1 + (d.num_accepted / this.maxSuggested) * 0.8 * this.width; }) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_rejected / this.maxSuggested) * 0.8 * this.width) .attr("class", "rejectedRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Displaying information about the rule above each bar this.svg .selectAll("text.ruleText") .data(this.data) .enter() .append("text") .text(d => { // LHS -> RHS - confidence: 0.xx (2 decimal places) return d.lhs + " \u2192 " + d.rhs + " - confidence: " + d.confidence.toFixed(2); }) .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", (d, i) => { return i * this.barHeight * 2 + 45; }) .attr("x", this.width * 0.1) .attr("class", "ruleText"); // Displaying the number of times the rule has been suggested to the right of the bar this.svg .selectAll("text.numText") .data(this.data) .enter() .append("text") .text(d => d.num_suggested) .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50 + (this.barHeight * 3) / 4; }) .attr("x", d => { return this.width * 0.1 + (d.num_suggested / this.maxSuggested) * 0.8 * this.width + 5; }) .attr("class", "numText"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chartBar(){//creating a function which draws the chart when it is called (the code in the function is ran)\n\t\tvar chart = new Chart(ctx, {//creating a new chart\n\t\t type: 'bar',//selecting the type of chart wanted\n\t\t data: dataForChart, //calling dataset\n\t\t\t options:{\n\t\t\t \ttitl...
[ "0.77163464", "0.7526737", "0.7479934", "0.74186444", "0.73083645", "0.7291003", "0.7275676", "0.7248214", "0.72424597", "0.7237493", "0.7189951", "0.7187999", "0.7186899", "0.7117562", "0.71012074", "0.7046209", "0.7043848", "0.70428026", "0.7034797", "0.7022937", "0.7019136...
0.66483456
90
Creates the popup when hovering over a bar
popUp(d, i) { let popG = this.svg .append("g") // Appending "g" element for both text and rectangle .attr("transform", () => { let height = i * this.barHeight * 2 + 50 + this.barHeight; return "translate(" + this.width * 0.1 + "," + height + ")"; }) .attr("class", "popUpG"); // Adding the white background to display text on popG .append("rect") .attr("fill", "white") .attr("width", this.width * 0.4) .attr("height", this.barHeight * 1.5) .attr("class", "popUpRect"); // Adding the text showing the acceptance rate popG .append("text") .text("Accepted: " + d.num_accepted + " (" + ((d.num_accepted / d.num_suggested) * 100).toFixed(0) + "%)") // Shows in percent with 0 decimals .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", this.barHeight / 2 + 5) .attr("x", 10); // Adding the text showing the rejection rate popG .append("text") .text("Rejected: " + d.num_rejected + " (" + ((d.num_rejected / d.num_suggested) * 100).toFixed(0) + "%)") // Shows in percent with 0 decimals .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", this.barHeight + 10) .attr("x", 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInteractionEvents() {\n\n // bar group hover\n $(\"g.barGroup\").hover(function(e) {\n showInfoBox( e, $(this).attr(\"index\"), $(this).attr(\"membership\") );\n }\n );\n $(\".vis .background, .vis .mouseLine\").hover(function(e) {\n showInfoBox( e, null);\n });\n\n\n\n\n}", "function...
[ "0.6595492", "0.65790623", "0.64050937", "0.63626146", "0.6332866", "0.62675226", "0.6227894", "0.6193408", "0.61869437", "0.6184789", "0.6164893", "0.6156323", "0.61546177", "0.6153536", "0.6151304", "0.61465174", "0.61457324", "0.6144028", "0.61330926", "0.6132817", "0.6109...
0.5754574
94
Removes the popup when removing the mouse from a bar
clearPopUp(d, i) { this.svg.selectAll("g.popUpG").remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBarMouseOut(d, i) {\n d3.select('#id-name').remove();\n }", "function removePopupCloseBar() { \n //skyro\n var closeBarTag = document.getElementById(DEFAULT_DIALOG_POPUP_ID+\"skyroscloseBar\");\n //swan\n if(closeBarTag == null) closeBarTag = document.getElementById(DEFAULT_DIALOG_POPUP_ID...
[ "0.71298915", "0.7129802", "0.68721306", "0.68204534", "0.67693007", "0.6747195", "0.6672235", "0.66662806", "0.6660013", "0.66590595", "0.6629238", "0.6616812", "0.6602794", "0.6595134", "0.6595134", "0.6595134", "0.65803236", "0.65803236", "0.65803236", "0.65803236", "0.657...
0.62392485
67
Renders the bar chart
render() { const style = { height: this.divHeight, // Takes up this much space on the screen overflowY: "scroll" // The rest of the chart can be seen by scrolling }; return <div id={"bar" + this.props.id} className={this.barClass} style={style} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n fo...
[ "0.78678536", "0.7800753", "0.7373784", "0.72033334", "0.7177757", "0.7111624", "0.71062815", "0.7093427", "0.7078036", "0.70710635", "0.70667", "0.69942605", "0.6988119", "0.69647324", "0.6939461", "0.6921477", "0.6888767", "0.68878615", "0.6878645", "0.68233407", "0.6739321...
0.0
-1
This resizes the blanket to fit the height of the page because there is not height=100% attribute. This also centers the popUp vertically.
function blanket_size(popUpDivVar){ if(typeof window.innerWidth!='undefined'){ viewportheight=window.innerHeight; } else{ viewportheight=document.documentElement.clientHeight; } if((viewportheight>document.body.parentNode.scrollHeight)&&(viewportheight>document.body.parentNode.clientHeight)){ blanket_height=viewportheight; } else{ if(document.body.parentNode.clientHeight>document.body.parentNode.scrollHeight){ blanket_height=document.body.parentNode.clientHeight; } else{ blanket_height=document.body.parentNode.scrollHeight; } } var blanket=document.getElementById('blanket');blanket.style.height=blanket_height+'px'; var popUpDiv=document.getElementById(popUpDivVar); popUpDiv_height=blanket_height/1.5; popUpDiv.style.top=popUpDiv_height+'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoResize() {\n var h = $(window).height() - 120;\n if (hasFooter) h -= 90;\n if (h < 400) h = 400;\n popup.height(h);\n popup.trigger('aweresize');\n }", "function setPopupMaxHeight() {\n $(modalPopupContent).css('max-height', ($(body).h...
[ "0.66757894", "0.65208757", "0.63072705", "0.6275321", "0.6264929", "0.6264929", "0.62403154", "0.62109715", "0.6169411", "0.61307764", "0.61140543", "0.60465795", "0.6003051", "0.59819645", "0.5977626", "0.5962041", "0.5881093", "0.5871994", "0.5851368", "0.58437186", "0.583...
0.69576627
0
This centers the popUp vertically.
function window_pos(popUpDivVar){ if(typeof window.innerWidth!='undefined'){ viewportwidth=window.innerHeight; } else{ viewportwidth=document.documentElement.clientHeight; } if((viewportwidth>document.body.parentNode.scrollWidth)&&(viewportwidth>document.body.parentNode.clientWidth)){ window_width=viewportwidth; } else{ if(document.body.parentNode.clientWidth>document.body.parentNode.scrollWidth){ window_width=document.body.parentNode.clientWidth; } else{ window_width=document.body.parentNode.scrollWidth; } } var popUpDiv=document.getElementById(popUpDivVar); window_width=window_width/2-260; popUpDiv.style.left=window_width+'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centerVertically() {\n\t\tjQuery('.formOverlay').css({\n\t\t\t'top' : '50%',\n\t\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t\t});\n\t}", "function centerVertically() {\n\n\tjQuery('.formOverlay').css({\n\t\t'top' : '50%',\n\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t});\n}", ...
[ "0.70235914", "0.68569136", "0.6525881", "0.6350007", "0.6336411", "0.62905973", "0.619759", "0.6031462", "0.5965502", "0.59488547", "0.59030074", "0.58725643", "0.5865487", "0.58460826", "0.5823242", "0.5805242", "0.57774776", "0.57330513", "0.56705767", "0.5670379", "0.5589...
0.0
-1
This function contains the other three to make life simple in the HTML file.
function popup(windowname){ blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmlWriter() {\n \n //writes the html for introduction\n htmlIntro();\n \n //creates the event functionality for example 1 and example 2\n exampleSetEvents();\n \n //writes the html for the game\n htmlGame();\n }", "function load() {\n \n //writes all the html for the page\n ...
[ "0.70121616", "0.6308024", "0.628527", "0.62637013", "0.62441903", "0.61575997", "0.6140361", "0.6114862", "0.5997205", "0.598447", "0.5963262", "0.5934411", "0.59086347", "0.5878245", "0.5878179", "0.58699495", "0.5855572", "0.58399355", "0.5829063", "0.58289486", "0.5816942...
0.0
-1
creation de la function d affichage avec un number
function affichage(array) { const nb = document.createElement('input'); nb.type = 'number' nb.value = 0; nb.max = 12; nb.min = 0; const div = document.createElement('div'); div.className = 'row py-3' let last = 0; nb.addEventListener('change', () => { const nouveau = parseInt(nb.value); for (let i = nouveau; i < last; i++) //pour enlever un select si l utilisateur decide d enlever une pizza div.removeChild(div.lastChild); for (let i = last; i < nouveau; i++) // pour ajouter un select si l utilisateur decide d ajouter une pizza div.append(createSelect(array)) last = nb.valueAsNumber; //pour redefinir last au nb choisit }) document.getElementById('commande').append(nb, div); //endroit ou l on place }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createExpFunc(num) {\n\n}", "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "function funcion() {\n return numeracion;\n}", "function createBase (num) {\n return fun...
[ "0.71254164", "0.70957863", "0.6981608", "0.6817879", "0.677229", "0.6743852", "0.66902727", "0.66752297", "0.64784896", "0.64726025", "0.64650244", "0.6461294", "0.64417815", "0.6438037", "0.6417279", "0.63921463", "0.636289", "0.63433266", "0.62147784", "0.6190905", "0.6174...
0.0
-1
Highest Level Component that oversees the React Routing Setup
function App() { return ( <Router> <header> <div className="nav-bar"> <Toolbar className="tool-bar"> <h1 className="baseCheck"><Link className="baseCheckLink" to="/">BaseCheck</Link></h1> </Toolbar> </div> </header> <Switch> <Route exact path='/'><HomePage/></Route> <Route path='/county/:county/:state'><CountyDetail/></Route> <Route path='/search/:county'><SearchPage/></Route> <Redirect to='/'/> </Switch> </Router> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const routes = (\n <Switch>\n <Route\n path=\"/\"\n exact\n render={() => (\n <AsyncMarketOverview\n rowCount={this.props.rowCount}\n currencyData={this.props.currencyData}\n showLoader={this.props.showLoader}\...
[ "0.7471299", "0.72514266", "0.71519035", "0.71105695", "0.71049553", "0.7076688", "0.7071293", "0.70368457", "0.7021053", "0.7019338", "0.7004927", "0.7000449", "0.6998639", "0.6987305", "0.6979963", "0.6944773", "0.6943733", "0.69436044", "0.69263834", "0.69157463", "0.69075...
0.0
-1
Component representing the full Home Page
function HomePage() { let baseUri = "https://cors-anywhere.gradyt.com/https://covercovid-19.com/saved?"; const savedLocations = JSON.parse(localStorage.getItem("counties")); document.title = "BaseCheck"; // Track the previous URL accessed let prevUrl = useLocation().pathname; localStorage.setItem("prevUrl", prevUrl); if (savedLocations) { savedLocations.map((id) => { return baseUri += "ids[]=" + id + "&"; }); } baseUri = baseUri.slice(0, -1); const [counties, setCounties] = useState([]); const [loaded, setLoaded] = useState(false); useEffect(() => { fetch(baseUri, { method: 'GET', mode: 'cors', cache: 'default', headers: { 'Access-Control-Allow-Origin': '*', 'Origin': 'http://localhost:3000' } }) .then((response) => response.json()) .then((responseData) => { setCounties(responseData); }) .then(() => { setLoaded(true); }) .catch((err) => { console.log(err); }); }, []); // If there are locations saved, will load the savedCounties on the Home Page Dashboard // If not, will inform the user that there are no saved locations. if (savedLocations && savedLocations.length > 0) { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> {loaded ? <SavedCardList counties={counties}/> : <div className="margin-top"><Ring/></div>} </main> ); } else { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> <div className="empty-list"> <h2>No Saved Locations</h2> </div> </main> ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function Home() {\n return(\n <div>\n <Navbar></Navbar>\n\n <h1>temporary homepage</h1>\n\n {/* add link to other pages here for now */}\n <a href=\"/ticket\">ticket</a>\n <br/>\n <a href=\"/enclosu...
[ "0.7484706", "0.7205797", "0.71785885", "0.71783334", "0.7078643", "0.7073782", "0.69430816", "0.69089407", "0.6898658", "0.68250626", "0.6795143", "0.6721337", "0.66872907", "0.66780806", "0.66696405", "0.66564596", "0.6634378", "0.6633857", "0.6629965", "0.662977", "0.66220...
0.0
-1
Component representing the search page
function SearchPage() { document.title = "Search | BaseCheck"; let { county } = useParams(); const baseUri = "https://cors-anywhere.gradyt.com/https://covercovid-19.com/search/" + county; const [counties, setCounties] = useState([]); const [loaded, setLoaded] = useState(false); // Track the previous URL accessed let prevUrl = useLocation().pathname; localStorage.setItem("prevUrl", prevUrl); useEffect(() => { fetch(baseUri, { method: 'GET', mode: 'cors', cache: 'default', headers: { 'Access-Control-Allow-Origin': '*', 'Origin': 'http://localhost:3000' } }) .then((response) => response.json()) .then((responseData) => { setCounties(responseData); }) .then(() => { setLoaded(true); }) .catch((err) => { console.log(err); }); }, []); if (counties) { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> <CountyCardList counties={counties} loaded={loaded} search={county}/> <div> </div> </main> ); } else { return <div></div> } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "search() {\n this.send('searchWithParams', t...
[ "0.7439431", "0.71394867", "0.71268225", "0.69284594", "0.6850917", "0.6790371", "0.67758965", "0.6753482", "0.67338157", "0.6659519", "0.6647506", "0.6641174", "0.65809566", "0.6564233", "0.6549926", "0.6538047", "0.6534458", "0.6528409", "0.65151507", "0.6503617", "0.649828...
0.0
-1
Send any uncaught error to the default error handler
function asyncHandler(fn) { return function(req, res, next) { return Promise.resolve(fn(req, res, next).catch(next)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorHandler() {}", "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "setOnErrorHandler(handler) { return; }", "callUnhandledRejectionHandler(error) {\n const errHandler...
[ "0.749333", "0.6940096", "0.68918085", "0.68904907", "0.68207073", "0.6814079", "0.67585284", "0.674889", "0.6747471", "0.67302215", "0.67267144", "0.67072356", "0.6689278", "0.6672737", "0.6672737", "0.6655419", "0.6655259", "0.6646841", "0.66360486", "0.6618822", "0.6611017...
0.0
-1
Fetches the locations, converts it to GeoJSON and renders the home view
async function renderMap(req, res) { // The only things we need to render the dots on the map is the lat long and // an identifier. We can later use this identifier to fetch the full info of a // point const locations = await database .select("id", "latitude", "longitude") .from("locations"); // Convert the raw locations to GeoJSON. Mapbox on the front-end will use this as // the initial dataset const geojson = { type: "FeatureCollection", features: locations.map(l => ({ id: l.id, type: "Feature", geometry: { type: "Point", coordinates: [l.longitude, l.latitude] } })) }; res.render("index", { locations: geojson }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLocations() {\n fetch(\"http://localhost:3000/location/load\", {\n method: \"GET\",\n })\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n locations = data.locations;\n })\n .catch((err) => {\n console.log(`Error looking up the ...
[ "0.69302857", "0.6445347", "0.6349254", "0.6315161", "0.63055634", "0.62847716", "0.62761736", "0.62350285", "0.6190274", "0.6158551", "0.61425865", "0.6139178", "0.61288035", "0.61107385", "0.6083875", "0.60771", "0.60771", "0.6041177", "0.60375226", "0.6008874", "0.59670305...
0.6357385
2
Get the info for a single point on the map by identifier
async function getInfo(req, res) { const locationID = req.params.locationID; // Fetch the full location data const locations = await database .select([ "name", "line1", "line2", "zip", "city", "state", "wheelchair_accessible", "latitude", "longitude" ]) .from("locations") .where({ id: locationID }); const location = locations[0]; // Get all the meetings that are held at this location const meetings = await database .select(["id", "title", "details"]) .from("meetings") .where({ location_id: locationID }); // For every one of these meetings, fetch the individual meetings const hours = await database .select([ "meeting_hours.day", "meeting_hours.start_time", "meeting_hours.end_time", "meeting_hours.special_interest", "meeting_hours.meeting_id", "meeting_types.name AS type" ]) .from("meeting_hours") .whereIn("meeting_id", meetings.map(h => h.id)) .leftJoin( "meeting_types", "meeting_hours.meeting_type_id", "meeting_types.id" ); // How to sort the days of the week const sorter = { Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6, Sunday: 7 }; // Combine hours and meetings into a single object const result = { location, meetings: meetings .map(({ id, title, details }) => { return { title, details, hours: hours // Only nest the hours of the meeting we're working on .filter(h => h.meeting_id === id) // Strip out the fields we don't need .map(({ day, start_time, end_time, special_interest, type }) => ({ day: getDayName(day), start_time: formatTime(start_time), end_time: formatTime(end_time), special_interest, type })) // Sort by day of the week .sort((a, b) => { return sorter[a.day] > sorter[b.day] ? 1 : -1; }) }; }) // Sort the top level meetings by title alphabetically .sort((a, b) => (a.title > b.title ? 1 : -1)) }; return res.json(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPt(id) {\n for (var i=0; i<points.length; i++) { \n if (points[i].id == id) { return points[i]; }\n }\n}", "function getInfo(point, callback) {\n var url = $.StringFormat('api/Map/GetRegionByPoint/{0}/{1}/{2}',\n 1, point[0], point[1]);\n url = getUrl(url);\n...
[ "0.6529646", "0.62422067", "0.6213143", "0.61647475", "0.6152371", "0.612864", "0.60602134", "0.60185033", "0.5978962", "0.5912388", "0.5903155", "0.58792114", "0.57814556", "0.5766544", "0.56738406", "0.5672328", "0.56620836", "0.566206", "0.56618106", "0.5645751", "0.563904...
0.0
-1
Send the search query to NLP, use result to search for IDs of locations so the application can show just those locations
async function search(req, res) { const q = req.body.q; const { data } = await axios.get("https://api.wit.ai/message", { params: { q, v: 20181205 }, headers: { Authorization: `Bearer ${process.env.WIT_KEY}` } }); const info = {}; let rows = await database .select("id") .from("locations") .map(row => row.id); if (data.entities) { await Promise.all( Object.keys(data.entities).map(async entityName => { const entity = data.entities[entityName][0]; console.log(entity); if (entity.confidence < 0.9) return; if (entityName === "neighborhood") { const center = { lat: +entity.metadata.split(",")[0], lon: +entity.metadata.split(",")[1] }; info.center = center; const locationIDs = await database .select("id") .from("locations") .whereRaw( ` ( 3959 * acos( cos(radians(${center.lat})) * cos(radians(latitude)) * cos( radians(longitude) - radians(${center.lon}) ) + sin(radians(${center.lat})) * sin(radians(latitude)) ) ) < 0.75 ` ) .map(row => row.id); rows = rows.filter(id => locationIDs.includes(id)); } // Specific time or day "tomorrow", "in 2 days", "now", "tomorrow at 3" if (entityName === "datetime" && entity.value) { const days = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; const date = new Date(entity.value); const day = days[date.getDay()]; const query = database .select("locations.id") .from("meeting_hours") .leftJoin("meetings", "meeting_hours.meeting_id", "meetings.id") .leftJoin("locations", "meetings.location_id", "locations.id") .where({ day }); if (entity.grain === "hour" || entity.grain === "minute" || entity.grain === "second") { query.where({ start_time: date.toLocaleTimeString("en-GB") }); } query.groupBy("locations.id"); const dayIDs = await query.map(row => row.id); rows = rows.filter(id => dayIDs.includes(id)); info.day = day; } // Time range "before 3pm", "after 10a", "between 12 and 4" // Because the meetings are a recurring event, it doesn't necessarily make // sense to have "After monday", as it will wrap around indefinitely if (entityName === "datetime" && (entity.to || entity.from)) { const query = database .select("locations.id") .from("meeting_hours") .leftJoin("meetings", "meeting_hours.meeting_id", "meetings.id") .leftJoin("locations", "meetings.location_id", "locations.id"); if (entity.from) { const date = new Date(entity.from.value); query.where("start_time", ">", date.toLocaleTimeString("en-GB")); info.from = date; } if (entity.to) { const date = new Date(entity.to.value); query.where("start_time", "<", date.toLocaleTimeString("en-GB")); info.to = date; } query.groupBy("locations.id"); const dayIDs = await query.map(row => row.id); rows = rows.filter(id => dayIDs.includes(id)); } }) ); } return res.json({ ids: rows, info }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doSearchWith(location) {\n state = 1;\n locations = [];\n errorMessage = '';\n searchTerm = location;\n\n $$('#search-text').val(searchTerm);\n\n doSearchByTerm();\n }", "searchGoogle(searchStr, location2) {\n console.log(\"I'm in search Go...
[ "0.6563675", "0.6422522", "0.6415669", "0.63826334", "0.63748336", "0.63509065", "0.6348148", "0.62460667", "0.6243116", "0.61705744", "0.6132467", "0.612258", "0.6115154", "0.6114472", "0.6082796", "0.6062363", "0.6054352", "0.60445225", "0.60358274", "0.60297674", "0.601946...
0.6334055
7
Console log any uncaught errors and return a 500 error
function errorHandler(error, req, res, next) { console.log("\n" + JSON.stringify(error, null, 2) + "\n"); res.status(500).end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exceptionHandler() {\n this.server.use(async (err, req, res, _next) => {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n const errors = await new Youch(err, req).toJSON();\n return res.status(500).json(errors);\n }\n\n return res.status(500).json...
[ "0.66826737", "0.6674529", "0.6674529", "0.66566586", "0.66491514", "0.6634539", "0.6609027", "0.66086215", "0.6593812", "0.65918833", "0.65782785", "0.6575421", "0.65572834", "0.6555865", "0.6552396", "0.65217906", "0.64840674", "0.6483882", "0.6478902", "0.6451221", "0.6450...
0.66880614
0
Convert a day shorthand to the full name
function getDayName(day) { switch (day) { case "mon": return "Monday"; case "tue": return "Tuesday"; case "wed": return "Wednesday"; case "thu": return "Thursday"; case "fri": return "Friday"; case "sat": return "Saturday"; case "sun": return "Sunday"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_day_name(day) {\n switch (day) {\n case 0:\n return \"ѕн\";\n case 1:\n return \"¬т\";\n case 2:\n return \"—р\";\n case 3:\n return \"„т\";\n case 4:\n return \"ѕт\";\n case 5:\n return \"—б\";\n case 6:\n return \"¬с\";\n\n ...
[ "0.73955697", "0.7046606", "0.702821", "0.6944925", "0.6942296", "0.6846222", "0.67730534", "0.6684676", "0.66161096", "0.6579167", "0.6551712", "0.6547645", "0.64998364", "0.64977765", "0.6379533", "0.63597834", "0.6348753", "0.63403744", "0.631655", "0.62867796", "0.6242216...
0.738814
1
Convert a timestring YYYYMMDDTHH:MM:SS to 12h format 20181210T15:36:00 => 3:36PM
function formatTime(timeString) { const H = +timeString.substr(0, 2); const h = H % 12 || 12; const ampm = H < 12 ? "AM" : "PM"; return h + timeString.substr(2, 3) + ampm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeTo12HrFormat(time_to_convert)\n{ // Take a time in 24 hour format and format it in 12 hour format\n let time_part_array = time_to_convert.split(\":\");\n let ampm = 'AM';\n\n if (time_part_array[0] >= 12) {\n ampm = 'PM';\n }\n\n if (time_part_array[0] > 12) {\n time_par...
[ "0.7604746", "0.7502571", "0.7458783", "0.74494475", "0.74114186", "0.7336281", "0.7317826", "0.73045397", "0.7218895", "0.71925", "0.7158564", "0.7154339", "0.7120323", "0.71182984", "0.7089649", "0.70373565", "0.7031415", "0.7009963", "0.70091", "0.7007204", "0.7006592", ...
0.7315751
7
varianta care NU merge ramane Aprins
function switch_() { var bulb = document.getElementById('bulb2'); if(bulb.src == "http://127.0.0.1:5500/Teme/Vlad/L13/Images/bulbon.png") { /* '.src' arenevoie de toata calea" */ bulb.src = "Images/bulboff.png"; } else { bulb.src = "Images/bulbon.png"; } console.log(bulb.src) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.leng...
[ "0.57224685", "0.56796664", "0.56416065", "0.5552063", "0.54637206", "0.53561866", "0.53365123", "0.5327602", "0.52938485", "0.5251051", "0.51810575", "0.5179268", "0.51686335", "0.5158905", "0.5146927", "0.5136259", "0.5124638", "0.5089595", "0.50867534", "0.50853854", "0.50...
0.0
-1
Get the Expression Condition's HTML id. Generate a new one if no ID present.
getId() { return this.props.id || this.generatedId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNeededId(self){\n var manipulator = $(self);\n var neededId = manipulator.attr('id').split('_')[1];//getting unique general value of id\n return neededId;\n}", "htmlId(name, type = '', ext = '') {\n return Util.htmlId(name, type, ext);\n }", "function getElementId(context) {\n return `#...
[ "0.5656492", "0.55521345", "0.5539869", "0.55060476", "0.55060476", "0.54695356", "0.54695356", "0.536411", "0.53513783", "0.53201914", "0.53169733", "0.5291072", "0.5237168", "0.51988393", "0.5193068", "0.51418287", "0.51248926", "0.5124469", "0.51183987", "0.51112384", "0.5...
0.48050958
42
Updates data in the context when the state or props change
getChildContext() { return { // story is passed along context to handle entities rendering story: this.state.story, // dimensions are the dimensions of the wrapper dimensions: this.state.dimensions }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateContext(context) {\n this.context = context\n }", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "function updateContext () {\n // Most of the time, the...
[ "0.6943792", "0.6887212", "0.6870903", "0.6834622", "0.6834622", "0.6738094", "0.6657684", "0.649532", "0.647826", "0.6465182", "0.6451466", "0.64466405", "0.6435928", "0.6351043", "0.63240737", "0.6296172", "0.62808186", "0.62790316", "0.624504", "0.62392515", "0.6186127", ...
0.0
-1
this method is called when your extension iopenTextDocuments activated your extension is activated the very first time the command is executed
function activate(context) { // assume only one preview supported. const contentProvider = new preview_content_provider_1.MarkdownPreviewEnhancedView(context); function openPreviewToTheSide(uri) { let resource = uri; if (!(resource instanceof vscode.Uri)) { if (vscode.window.activeTextEditor) { // we are relaxed and don't check for markdown files resource = vscode.window.activeTextEditor.document.uri; } } contentProvider.initPreview(resource, vscode.window.activeTextEditor, { viewColumn: vscode.ViewColumn.Two, preserveFocus: true, }); } function openPreview(uri) { let resource = uri; if (!(resource instanceof vscode.Uri)) { if (vscode.window.activeTextEditor) { // we are relaxed and don't check for markdown files resource = vscode.window.activeTextEditor.document.uri; } } contentProvider.initPreview(resource, vscode.window.activeTextEditor, { viewColumn: vscode.ViewColumn.One, preserveFocus: false, }); } function toggleScrollSync() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const scrollSync = !config.get("scrollSync"); config.update("scrollSync", scrollSync, true).then(() => { contentProvider.updateConfiguration(); if (scrollSync) { vscode.window.showInformationMessage("Scroll Sync is enabled"); } else { vscode.window.showInformationMessage("Scroll Sync is disabled"); } }); } function toggleLiveUpdate() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const liveUpdate = !config.get("liveUpdate"); config.update("liveUpdate", liveUpdate, true).then(() => { contentProvider.updateConfiguration(); if (liveUpdate) { vscode.window.showInformationMessage("Live Update is enabled"); } else { vscode.window.showInformationMessage("Live Update is disabled"); } }); } function toggleBreakOnSingleNewLine() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const breakOnSingleNewLine = !config.get("breakOnSingleNewLine"); config .update("breakOnSingleNewLine", breakOnSingleNewLine, true) .then(() => { contentProvider.updateConfiguration(); if (breakOnSingleNewLine) { vscode.window.showInformationMessage("Break On Single New Line is enabled"); } else { vscode.window.showInformationMessage("Break On Single New Line is disabled"); } }); } function customizeCSS() { const globalStyleLessFile = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./style.less")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(globalStyleLessFile)); } function openMermaidConfig() { const mermaidConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mermaid_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mermaidConfigFilePath)); } function openMathJaxConfig() { const mathjaxConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mathjax_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mathjaxConfigFilePath)); } function openKaTeXConfig() { const katexConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./katex_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(katexConfigFilePath)); } function extendParser() { const parserConfigPath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./parser.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(parserConfigPath)); } function showUploadedImages() { const imageHistoryFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./image_history.md")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(imageHistoryFilePath)); } function insertNewSlide() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, "<!-- slide -->\n"); }); } } function insertPagebreak() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, "<!-- pagebreak -->\n"); }); } } function createTOC() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, '\n<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->\n'); }); } } function insertTable() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, `| | | |---|---| | | | `); }); } } function openImageHelper() { contentProvider.openImageHelper(vscode.window.activeTextEditor.document.uri); } function webviewFinishLoading(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.updateMarkdown(sourceUri); } /** * Insert imageUrl to markdown file * @param uri: markdown source uri * @param imageUrl: url of image to be inserted */ function insertImageUrl(uri, imageUrl) { const sourceUri = vscode.Uri.parse(uri); vscode.window.visibleTextEditors .filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) && editor.document.uri.fsPath === sourceUri.fsPath) .forEach((editor) => { // const line = editor.selection.active.line editor.edit((textEditorEdit) => { textEditorEdit.insert(editor.selection.active, `![enter image description here](${imageUrl})`); }); }); } function refreshPreview(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.refreshPreview(sourceUri); } function openInBrowser(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.openInBrowser(sourceUri); } function htmlExport(uri, offline) { const sourceUri = vscode.Uri.parse(uri); contentProvider.htmlExport(sourceUri, offline); } function chromeExport(uri, type) { const sourceUri = vscode.Uri.parse(uri); contentProvider.chromeExport(sourceUri, type); } function princeExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.princeExport(sourceUri); } function eBookExport(uri, fileType) { const sourceUri = vscode.Uri.parse(uri); contentProvider.eBookExport(sourceUri, fileType); } function pandocExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.pandocExport(sourceUri); } function markdownExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.markdownExport(sourceUri); } /* function cacheSVG(uri, code, svg) { const sourceUri = vscode.Uri.parse(uri); contentProvider.cacheSVG(sourceUri, code, svg) } */ function cacheCodeChunkResult(uri, id, result) { const sourceUri = vscode.Uri.parse(uri); contentProvider.cacheCodeChunkResult(sourceUri, id, result); } function runCodeChunk(uri, codeChunkId) { const sourceUri = vscode.Uri.parse(uri); contentProvider.runCodeChunk(sourceUri, codeChunkId); } function runAllCodeChunks(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.runAllCodeChunks(sourceUri); } function runAllCodeChunksCommand() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; const previewUri = preview_content_provider_1.getPreviewUri(sourceUri); if (!previewUri) { return; } contentProvider.previewPostMessage(sourceUri, { command: "runAllCodeChunks", }); } function runCodeChunkCommand() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; const previewUri = preview_content_provider_1.getPreviewUri(sourceUri); if (!previewUri) { return; } contentProvider.previewPostMessage(sourceUri, { command: "runCodeChunk", }); } function syncPreview() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; contentProvider.previewPostMessage(sourceUri, { command: "changeTextEditorSelection", line: textEditor.selections[0].active.line, forced: true, }); } function clickTagA(uri, href) { href = decodeURIComponent(href); href = href .replace(/^vscode\-resource:\/\//, "") .replace(/^vscode\-webview\-resource:\/\/(.+?)\//, "") .replace(/^file\/\/\//, "file:///") .replace(/^https?:\/\/(.+?)\.vscode-webview-test.com\/vscode-resource\/file\/+/, "file:///") .replace(/^https?:\/\/file(.+?)\.vscode-webview\.net\/+/, "file:///"); if ([".pdf", ".xls", ".xlsx", ".doc", ".ppt", ".docx", ".pptx"].indexOf(path.extname(href)) >= 0) { mume_1.utility.openFile(href); } else if (href.match(/^file:\/\/\//)) { // openFilePath = href.slice(8) # remove protocol let openFilePath = mume_1.utility.addFileProtocol(href.replace(/(\s*)[\#\?](.+)$/, "")); // remove #anchor and ?params... openFilePath = decodeURI(openFilePath); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(openFilePath), vscode.ViewColumn.One); } else { mume_1.utility.openFile(href); } } function clickTaskListCheckbox(uri, dataLine) { const sourceUri = vscode.Uri.parse(uri); const visibleTextEditors = vscode.window.visibleTextEditors; for (let i = 0; i < visibleTextEditors.length; i++) { const editor = visibleTextEditors[i]; if (editor.document.uri.fsPath === sourceUri.fsPath) { dataLine = parseInt(dataLine, 10); editor.edit((edit) => { let line = editor.document.lineAt(dataLine).text; if (line.match(/\[ \]/)) { line = line.replace("[ ]", "[x]"); } else { line = line.replace(/\[[xX]\]/, "[ ]"); } edit.replace(new vscode.Range(new vscode.Position(dataLine, 0), new vscode.Position(dataLine, line.length)), line); }); break; } } } function setPreviewTheme(uri, theme) { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); config.update("previewTheme", theme, true); } context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => { if (preview_content_provider_1.isMarkdownFile(document)) { contentProvider.updateMarkdown(document.uri, true); } })); context.subscriptions.push(vscode.workspace.onDidChangeTextDocument((event) => { if (preview_content_provider_1.isMarkdownFile(event.document)) { contentProvider.update(event.document.uri); } })); context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { contentProvider.updateConfiguration(); })); context.subscriptions.push(vscode.window.onDidChangeTextEditorSelection((event) => { if (preview_content_provider_1.isMarkdownFile(event.textEditor.document)) { const firstVisibleScreenRow = getTopVisibleLine(event.textEditor); const lastVisibleScreenRow = getBottomVisibleLine(event.textEditor); const topRatio = (event.selections[0].active.line - firstVisibleScreenRow) / (lastVisibleScreenRow - firstVisibleScreenRow); contentProvider.previewPostMessage(event.textEditor.document.uri, { command: "changeTextEditorSelection", line: event.selections[0].active.line, topRatio, }); } })); context.subscriptions.push(vscode.window.onDidChangeTextEditorVisibleRanges((event) => { const textEditor = event.textEditor; if (Date.now() < editorScrollDelay) { return; } if (preview_content_provider_1.isMarkdownFile(textEditor.document)) { const sourceUri = textEditor.document.uri; if (!event.textEditor.visibleRanges.length) { return undefined; } else { const topLine = getTopVisibleLine(textEditor); const bottomLine = getBottomVisibleLine(textEditor); let midLine; if (topLine === 0) { midLine = 0; } else if (Math.floor(bottomLine) === textEditor.document.lineCount - 1) { midLine = bottomLine; } else { midLine = Math.floor((topLine + bottomLine) / 2); } contentProvider.previewPostMessage(sourceUri, { command: "changeTextEditorSelection", line: midLine, }); } } })); /** * Open preview automatically if the `automaticallyShowPreviewOfMarkdownBeingEdited` is on. * @param textEditor */ context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor((textEditor) => { if (textEditor && textEditor.document && textEditor.document.uri) { if (preview_content_provider_1.isMarkdownFile(textEditor.document)) { const sourceUri = textEditor.document.uri; const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const automaticallyShowPreviewOfMarkdownBeingEdited = config.get("automaticallyShowPreviewOfMarkdownBeingEdited"); const isUsingSinglePreview = config.get("singlePreview"); /** * Is using single preview and the preview is on. * When we switched text ed()tor, update preview to that text editor. */ if (contentProvider.isPreviewOn(sourceUri)) { if (isUsingSinglePreview && !contentProvider.previewHasTheSameSingleSourceUri(sourceUri)) { contentProvider.initPreview(sourceUri, textEditor, { viewColumn: contentProvider.getPreview(sourceUri).viewColumn, preserveFocus: true, }); } else if (!isUsingSinglePreview) { const previewPanel = contentProvider.getPreview(sourceUri); if (previewPanel) { previewPanel.reveal(vscode.ViewColumn.Two, true); } } } else if (automaticallyShowPreviewOfMarkdownBeingEdited) { openPreviewToTheSide(sourceUri); } } } })); /* context.subscriptions.push(vscode.workspace.onDidOpenTextDocument((textDocument)=> { // console.log('onDidOpenTextDocument', textDocument.uri) })) */ /* context.subscriptions.push(vscode.window.onDidChangeVisibleTextEditors(textEditors=> { // console.log('onDidChangeonDidChangeVisibleTextEditors ', textEditors) })) */ context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreviewToTheSide", openPreviewToTheSide)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreview", openPreview)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleScrollSync", toggleScrollSync)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleLiveUpdate", toggleLiveUpdate)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleBreakOnSingleNewLine", toggleBreakOnSingleNewLine)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openImageHelper", openImageHelper)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runAllCodeChunks", runAllCodeChunksCommand)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runCodeChunk", runCodeChunkCommand)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.syncPreview", syncPreview)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.customizeCss", customizeCSS)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMermaidConfig", openMermaidConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMathJaxConfig", openMathJaxConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openKaTeXConfig", openKaTeXConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.extendParser", extendParser)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.showUploadedImages", showUploadedImages)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertNewSlide", insertNewSlide)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertTable", insertTable)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertPagebreak", insertPagebreak)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.createTOC", createTOC)); context.subscriptions.push(vscode.commands.registerCommand("_mume.revealLine", revealLine)); context.subscriptions.push(vscode.commands.registerCommand("_mume.insertImageUrl", insertImageUrl)); context.subscriptions.push(vscode.commands.registerCommand("_mume.pasteImageFile", image_helper_1.pasteImageFile)); context.subscriptions.push(vscode.commands.registerCommand("_mume.uploadImageFile", image_helper_1.uploadImageFile)); context.subscriptions.push(vscode.commands.registerCommand("_mume.refreshPreview", refreshPreview)); context.subscriptions.push(vscode.commands.registerCommand("_mume.openInBrowser", openInBrowser)); context.subscriptions.push(vscode.commands.registerCommand("_mume.htmlExport", htmlExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.chromeExport", chromeExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.princeExport", princeExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.eBookExport", eBookExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.pandocExport", pandocExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.markdownExport", markdownExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.webviewFinishLoading", webviewFinishLoading)); // context.subscriptions.push(vscode.commands.registerCommand('_mume.cacheSVG', cacheSVG)) context.subscriptions.push(vscode.commands.registerCommand("_mume.cacheCodeChunkResult", cacheCodeChunkResult)); context.subscriptions.push(vscode.commands.registerCommand("_mume.runCodeChunk", runCodeChunk)); context.subscriptions.push(vscode.commands.registerCommand("_mume.runAllCodeChunks", runAllCodeChunks)); context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTagA", clickTagA)); context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTaskListCheckbox", clickTaskListCheckbox)); context.subscriptions.push(vscode.commands.registerCommand("_mume.showUploadedImageHistory", showUploadedImages)); context.subscriptions.push(vscode.commands.registerCommand("_mume.setPreviewTheme", setPreviewTheme)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() {\n this._setDocumentTitle();\n }", "function activate() {\n scope.$on('wizard_changes-have-been-made', onChanges);\n scope.$on('text-edit_changes-have-been-made', onChanges);\n\n // array of the IDs of opened ndDialogs\n // will change if some ngDialog ...
[ "0.6455283", "0.6117023", "0.60365486", "0.6014545", "0.5901986", "0.57529926", "0.57506055", "0.5723525", "0.5675816", "0.56572926", "0.55934495", "0.55851805", "0.5583049", "0.55814564", "0.55658954", "0.5561733", "0.5561733", "0.5478126", "0.5466789", "0.5465945", "0.54476...
0.0
-1
Insert imageUrl to markdown file
function insertImageUrl(uri, imageUrl) { const sourceUri = vscode.Uri.parse(uri); vscode.window.visibleTextEditors .filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) && editor.document.uri.fsPath === sourceUri.fsPath) .forEach((editor) => { // const line = editor.selection.active.line editor.edit((textEditorEdit) => { textEditorEdit.insert(editor.selection.active, `![enter image description here](${imageUrl})`); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markdownReplaceImageURL (md, prefix) {\n let mdMod = md.replace(/\\!\\[[a-zA-Z0-9 ]*\\]\\(\\s*(\\S*)\\s*\\)/gm, function(correspondance, p1){\n if (p1.startsWith('http')) {\n return correspondance\n } else {\n return correspondance.replace(p1, pathJoin([prefix, p1]))\n }\n });\n retu...
[ "0.68855274", "0.63933325", "0.6258238", "0.6179141", "0.6099886", "0.6023173", "0.6010743", "0.5999033", "0.59867644", "0.596878", "0.5950638", "0.59488547", "0.5932189", "0.5922752", "0.59114945", "0.5863421", "0.57739586", "0.57591665", "0.57256883", "0.57233", "0.57179755...
0.7792185
0
Get the topmost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number
function getTopVisibleLine(editor) { if (!editor["visibleRanges"].length) { return undefined; } const firstVisiblePosition = editor["visibleRanges"][0].start; const lineNumber = firstVisiblePosition.line; const line = editor.document.lineAt(lineNumber); const progress = firstVisiblePosition.character / (line.text.length + 2); return lineNumber + progress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePo...
[ "0.8047043", "0.7824864", "0.6870879", "0.6537144", "0.65344673", "0.63819563", "0.6225287", "0.6216907", "0.6168492", "0.61107486", "0.60311925", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0....
0.8464181
0
Get the bottommost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number
function getBottomVisibleLine(editor) { if (!editor["visibleRanges"].length) { return undefined; } const firstVisiblePosition = editor["visibleRanges"][0].end; const lineNumber = firstVisiblePosition.line; let text = ""; if (lineNumber < editor.document.lineCount) { text = editor.document.lineAt(lineNumber).text; } const progress = firstVisiblePosition.character / (text.length + 2); return lineNumber + progress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTopVisibleLine(editor) {\n if (!editor[\"visibleRanges\"].length) {\n return undefined;\n }\n const firstVisiblePosition = editor[\"visibleRanges\"][0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = f...
[ "0.77540386", "0.7541392", "0.6650702", "0.6616165", "0.65909344", "0.6335403", "0.6110543", "0.60798913", "0.592969", "0.5913406", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", ...
0.8385597
0
this method is called when your extension is deactivated
function deactivate() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivat...
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", ...
0.0
-1
server.listen(pipe) creates a new pipe wrap, so server.close() doesn't actually unlink this existing pipe. It needs to be unlinked separately via handle.close()
function closePipeServer(handle) { return common.mustCall(function() { this.close(); handle.close(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeServer() {\n if (!!this.server) {\n this.server.close();\n }\n }", "function endConnection() {\n\t\tsocket.unpipe();\n\t\tserverSocket.unpipe();\n\t\tsocket.end();\n\t\tserverSocket.end();\n\t}", "_killServer(callback) {\n // Destroy all open sockets\n for (var socketId in this._sockets)...
[ "0.5974828", "0.5912525", "0.58015645", "0.5787746", "0.57842267", "0.57499593", "0.5748326", "0.5730429", "0.57298464", "0.5723317", "0.5723317", "0.5723317", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548",...
0.71555525
0
Avoid conflict with listenpath
function randomPipePath() { return `${common.PIPE}-listen-handle-${counter++}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doListen(registry) {}", "static _onListenDone () {\n }", "listen() {\n }", "function defaultOnListen() {\n console.log(\"Socket is listening on port: \" + port);\n\n if (onListen)\n onListen();\n }", "function onListening() {\n // 忽略80端口\n const _port = (port != 80 ? ':' + p...
[ "0.6034013", "0.6020821", "0.5982961", "0.59537745", "0.58785844", "0.5844389", "0.5844389", "0.5840405", "0.58013064", "0.57963765", "0.5788366", "0.57648695", "0.5738501", "0.57290965", "0.57160616", "0.5711018", "0.56939334", "0.5689265", "0.56786615", "0.56610465", "0.563...
0.0
-1
Gets a Location object from the window with information about the current location of the document.
getWindowLocation() { return window.location; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation() {\n return location;\n }", "function GetLocation(){\n\tif(navigator.geolocation){\n\t\tnavigator.geolocation.getCurrentPosition(setLocation);\n\t}\n}", "function getWindowLocation() {\n\t\t\tif (!W.location.origin) {\n\t\t\t\tW.location.origin = W.location.protocol + \"//\" + W.locat...
[ "0.7135316", "0.648938", "0.6483093", "0.64668214", "0.645223", "0.645223", "0.645223", "0.6387621", "0.6378854", "0.6374205", "0.63673174", "0.6292917", "0.6246053", "0.61984664", "0.6196415", "0.619536", "0.6194755", "0.6188552", "0.61591405", "0.6143732", "0.6121506", "0...
0.630214
11
Loads a HTML page Put the content of the body tag into the current page. Arguments: url of the other HTML page to load id of the tag that has to hold the content
function loadHTML(url, fun, storage, param) { var xhr = createXHR(); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { //if(xhr.status == 200) { storage.innerHTML = getBody(xhr.responseText); fun(storage, param); } } }; xhr.open("GET", url, true); xhr.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoadIntoId(url, id)\n{\n\t// Set default\n\tid = id || \"page_area\";\n\t\n\tvar page_area = document.getElementById(id);\n\t\n\tpage_area.innerHTML = read_contents(url);\n\t\n\t// Scroll to the top of the page\n\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n}", "function LoadPage(...
[ "0.72878", "0.70443434", "0.6654676", "0.6397467", "0.6391386", "0.62999713", "0.62387264", "0.6182824", "0.61464417", "0.6141637", "0.6113012", "0.6099956", "0.6098753", "0.60514396", "0.6050539", "0.60404617", "0.60300356", "0.5970459", "0.5961327", "0.59513694", "0.5937839...
0.5821569
28
Callback Assign directly a tag
function processHTML(temp, target) { target.innerHTML = temp.innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "function addTag(id, tag){\n\t\n}", "onReplaceTagAtIndex() {}", "function __(tag, block) {\n block.tag = tag;\n return block;\n }", "function addTagInternal( tag ) {\n if( typeof tag === 'stri...
[ "0.77069604", "0.77069604", "0.77069604", "0.77069604", "0.6721587", "0.6617568", "0.64636", "0.6403452", "0.6338535", "0.6338535", "0.6338535", "0.62873125", "0.62832475", "0.62603307", "0.6228817", "0.61790305", "0.6139829", "0.6120483", "0.6118738", "0.6028711", "0.5979836...
0.0
-1
Create responseHTML for acces by DOM's methods
function processByDOM(responseHTML, target) { target.innerHTML = "Extracted by id:<br />"; // does not work with Chrome/Safari //var message = responseHTML.getElementsByTagName("div").namedItem("two").innerHTML; var message = responseHTML.getElementsByTagName("div").item(1).innerHTML; target.innerHTML += message; target.innerHTML += "<br />Extracted by name:<br />"; message = responseHTML.getElementsByTagName("form").item(0); target.innerHTML += message.dyn.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exractBody(response) {\n let dom1 = document.createElement(\"html\");\n dom1.innerHTML = response;\n let bodyText = dom1.getElementsByTagName(\"body\")[0].innerHTML;\n return bodyText;\n}", "function XJRResponse(data) {\n\tvar resp = document.getElementById(data.id);\n\tresp.innerHTML = data.html;\n...
[ "0.67058796", "0.6376604", "0.6268358", "0.62579644", "0.61839056", "0.6179392", "0.6166648", "0.61453015", "0.6088579", "0.60719585", "0.6041743", "0.6038999", "0.6005426", "0.5968968", "0.59531385", "0.5945219", "0.59088063", "0.5899462", "0.5885394", "0.58508724", "0.58482...
0.56767845
40
Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body
function openNav() { document.getElementById("mySideBar").style.width = "250px"; document.getElementById("main").style.marginLeft = "250px"; document.getElementById("main").style.width = "83%"; document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250...
[ "0.6467901", "0.64344347", "0.64197123", "0.6400105", "0.6400105", "0.6362734", "0.6362734", "0.6362734", "0.6340359", "0.6322647", "0.6274176", "0.6102225", "0.6093096", "0.60584486", "0.60584486", "0.60437936", "0.60437936", "0.60370016", "0.5982772", "0.5978939", "0.597201...
0.6563949
0
Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white
function closeNav() { document.getElementById("mySideBar").style.width = "0"; document.getElementById("main").style.marginLeft = "5%"; document.getElementById("main").style.width = "90%"; document.body.style.backgroundColor = " #fffdf4"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeNav() {\n document.getElementById(\"sideNav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n // document.canvas.sty...
[ "0.64571106", "0.64564526", "0.63776743", "0.63110507", "0.62765867", "0.6269704", "0.6269704", "0.6269704", "0.6269704", "0.6269704", "0.6187079", "0.6187079", "0.6187079", "0.6186469", "0.6186469", "0.6186053", "0.6186053", "0.6186053", "0.61744153", "0.61616695", "0.613577...
0.62138486
10
Our component just got rendered
componentDidMount() { this.shouldNavigateAway(() => { this.props .dispatch(getAuthedUser(this.props.auth, this.props.id)) .then(() => this.setState({ loading: false })); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "onAfterRendering() {}", "static rendered () {}", "static rendered () {}", "onRender () {\n\n }", "didRender() {\n console.log...
[ "0.7532576", "0.73727936", "0.7353397", "0.7353397", "0.7323151", "0.72538215", "0.72395265", "0.7210754", "0.7210754", "0.7200434", "0.71859515", "0.7182143", "0.716166", "0.71540457", "0.7137834", "0.710127", "0.6953705", "0.69468975", "0.69430166", "0.69430166", "0.6941129...
0.0
-1
Our component just got updated
componentDidUpdate() { this.shouldNavigateAway(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n // ... no implementation required\n }", "updated() {}", "updated(){\n console.log('Updated');\n }", "update() {\n // Subclasses should override\n }", "componentDidUpdate() {\n console.log('[Order Summary] DidUpdate'); \n }", "afterupdate (el) {\n c...
[ "0.75659233", "0.7549686", "0.75179875", "0.7468388", "0.73158187", "0.73153985", "0.7197263", "0.7197263", "0.7197263", "0.7197263", "0.7197263", "0.7138228", "0.71340305", "0.7129429", "0.7129429", "0.71273214", "0.7121043", "0.70975786", "0.70770305", "0.7062664", "0.70455...
0.0
-1
positive modulo for outofbounds array access
function modulo(arr, index) { return (arr.length + (index % arr.length)) % arr.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_mod(val) {\r\n if (this.pillar === false) return val\r\n return (val + this.largezero) % this.grid.length\r\n }", "_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }", "function evansMod(i, mod) {\n while (i < 0) {\n i += mod;\n }\n ...
[ "0.67774326", "0.65961987", "0.6526993", "0.64628106", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.62558407", "0.6192013", "0.61744505", "0.5914202", "0.5910607", "0.58757424", "0.58575726", "0.584661...
0.7100841
0
Function gets a new movie then fills the appropriate html info
function getNewMovie(args) { console.log("Getting new movie"); var req = new XMLHttpRequest(); req.open("GET", request_path+"/recommendations/"+user_id, true); req.onload = function() { var response = JSON.parse(req.response); movie_id = response["movie_id"]; getMovieInfo(args); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMovieInformation() {\n document.querySelector( '.movie-information' ).innerHTML = getTemplate();\n }", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-...
[ "0.7241745", "0.70697844", "0.69527066", "0.6943384", "0.6919568", "0.68991745", "0.68914515", "0.6854918", "0.681705", "0.6789709", "0.6726539", "0.67135084", "0.6683075", "0.66331136", "0.66168493", "0.66092485", "0.6604751", "0.6603469", "0.6592809", "0.65871656", "0.65851...
0.66813093
13
Function gets the movie information
function getMovieInfo(args){ console.log("Getting info for movie "+movie_id); var req = new XMLHttpRequest(); req.open("GET", request_path+"/movies/"+movie_id, true); req.onload = function() { var response = JSON.parse(req.response); args[0].setText(response["title"]); args[2].setImage(args[3]+response["img"]); getMovieRating(args); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9c...
[ "0.76905596", "0.74595827", "0.7442448", "0.74126834", "0.7398734", "0.73495376", "0.7347973", "0.7321103", "0.730877", "0.7308059", "0.729426", "0.7276822", "0.7269765", "0.7222126", "0.71885026", "0.7155367", "0.71488017", "0.71385187", "0.7136701", "0.70962274", "0.7061909...
0.7605141
1
Function gets the movie information
function getMovieRating(args){ console.log("Getting rating for movie "+movie_id); var req = new XMLHttpRequest(); req.open("GET", request_path+"/ratings/"+movie_id, true); req.onload = function() { var response = JSON.parse(req.response); args[1].setText(Number(response["rating"]).toFixed(3)); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9c...
[ "0.76905596", "0.7605141", "0.74595827", "0.7442448", "0.74126834", "0.7398734", "0.73495376", "0.7347973", "0.7321103", "0.730877", "0.7308059", "0.729426", "0.7276822", "0.7269765", "0.7222126", "0.71885026", "0.7155367", "0.71488017", "0.71385187", "0.7136701", "0.70962274...
0.0
-1
Function to vote on a movie, then calls getNewMovie()
function rateMovie(args) { console.log("Rating movie "+movie_id+" with a rating of "+args[4]); var req = new XMLHttpRequest(); req.open("PUT", request_path+"/recommendations/"+user_id, true); req.onload = function() { console.log("Added rating to db"); getNewMovie(args); } var data = { "movie_id": movie_id, "rating": args[4], "apikey": "AaD72Feb3" }; req.send(JSON.stringify(data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewMovie(args) {\n\tconsole.log(\"Getting new movie\");\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/recommendations/\"+user_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\tmovie_id = response[\"movie_id\"];\n\t\tgetMovieInfo(args);\...
[ "0.6556113", "0.6547793", "0.64192307", "0.62632614", "0.6205357", "0.6180932", "0.6112547", "0.6005892", "0.59823346", "0.59118795", "0.59071213", "0.58952785", "0.5892452", "0.5883365", "0.58751285", "0.5867206", "0.5862421", "0.5854426", "0.5840176", "0.5837168", "0.581755...
0.59363234
9
compoundInterest p is the principal (how much you are borrowing) r is the interest rate n is how many times per year you are adding interest t is how many years you are paying it off in Example: compoundInterest(30000, 0.08, 12, 4) Loan of 30k, 8% interest, 12 times a year, over 4 years
function compoundInterest (p, r, n, t) { return p * Math.pow(1 + (r/n) , n*t); // Math.pow(2, 8); // 2 ** 8 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compoundInterest(principle, interest_rate, time) {\n interest = principle * ((1 + interest_rate/100) * time);\n return interest\n}", "function computeCompoundInterest( principal, interestRate, frequency, timeInYears ) {\n return principal * (Math.pow( 1 + interestRate / frequency, frequency * tim...
[ "0.786775", "0.7559858", "0.7206405", "0.6932793", "0.692635", "0.685467", "0.6839577", "0.67644835", "0.6745944", "0.65658104", "0.6334478", "0.62171453", "0.6196766", "0.61839205", "0.59828156", "0.5972659", "0.59681845", "0.59538174", "0.59259236", "0.59230155", "0.5902051...
0.8124679
0
This function hides all main DIV elements. The caller is then responsible for reshowing the one that needs to be displayed.
function hideAllPanels() { $('#AllLeads').hide(); $('#AddLead').hide(); $('#LeadDetails').hide(); $('#AllOpps').hide(); $('#OppDetails').hide(); $('#AllSales').hide(); $('#SaleDetails').hide(); $('#AllLostSales').hide(); $('#LostSaleDetails').hide(); $('#AllReports').hide(); $('#amountPipeline').hide(); $('#countPipeline').hide(); $('#chartArea').hide(); $('#drillDown').hide(); $('#pipelineName').hide(); $('#conversionName').hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideDivs()\n{\n\tpageNavHeader.style.marginBottom = '1em';\n\tpageNavButton.innerHTML = 'Show Quick Links';\n\tpageNavDiv.style.display = 'none';\n\t\n\tinformationHeader.style.marginBottom = '1em';\n\tinformationButton.innerHTML = 'Show Information';\n\tinformationDiv.style.display = 'none';\n\t\n\tfor(v...
[ "0.7335277", "0.7247037", "0.7201496", "0.69616705", "0.68890977", "0.6862547", "0.6859901", "0.68153554", "0.67900854", "0.6702604", "0.66901237", "0.6677316", "0.66563046", "0.6650601", "0.66383094", "0.662691", "0.65512073", "0.6538004", "0.6517151", "0.65132976", "0.64936...
0.0
-1
This function retrieves all leads.
function showLeads() { //Highlight the selected tile $('#LeadsTile').css("background-color", "orange"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasLeads = false; hideAllPanels(); var LeadList = document.getElementById("AllLeads"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var leadTable = document.getElementById("LeadList"); // Remove all nodes from the lead <DIV> so we have a clean space to write to while (leadTable.hasChildNodes()) { leadTable.removeChild(leadTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lead") { // Create a DIV to display the organization name var lead = document.createElement("div"); var leadLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); lead.appendChild(leadLabel); // Add an ID to the lead DIV lead.id = listItem.get_id(); // Add an class to the lead DIV lead.className = "item"; // Add an onclick event to show the lead details $(lead).click(function (sender) { showLeadDetails(sender.target.id); }); // Add the lead div to the UI leadTable.appendChild(lead); hasLeads = true; } } if (!hasLeads) { var noLeads = document.createElement("div"); noLeads.appendChild(document.createTextNode("There are no leads. You can add a new lead from here.")); leadTable.appendChild(noLeads); } $('#AllLeads').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Leads. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#LeadList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static leadsOfcampaign(campaignId, processStep) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let camp = yield this.findById(campaignId);\n if (camp == null) {\n return [];\n }\n else {\n ...
[ "0.5870157", "0.58543706", "0.57299566", "0.5640385", "0.5637337", "0.56351227", "0.56073624", "0.5598634", "0.5568519", "0.55490696", "0.550896", "0.54997504", "0.5499062", "0.54932797", "0.5492179", "0.549086", "0.5464971", "0.54624695", "0.5456106", "0.5440093", "0.5437010...
0.0
-1
This function shows the form for adding a new lead
function addNewLead() { $('#LeadDetails').hide(); $('#AddLead').fadeIn(500, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commit...
[ "0.6375686", "0.6279301", "0.6181734", "0.61438817", "0.6109383", "0.6089658", "0.60577124", "0.60405135", "0.60298336", "0.5978685", "0.5934301", "0.59329695", "0.5858318", "0.58579856", "0.5845238", "0.5805184", "0.5765164", "0.57591796", "0.57426214", "0.5735533", "0.57210...
0.6595563
0
This function shows the details for a specific lead
function showLeadDetails(itemID) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddLead').hide(); $('#LeadDetails').hide(); $('#AllOpps').hide(); $('#OppDetails').hide(); $('#AllSales').hide(); $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editLead').val(currentItem.get_fieldValues()["Title"]); $('#editContactPerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editContactNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editEmail').val(currentItem.get_fieldValues()["Email"]); $('#editPotentialAmount').val("$"+currentItem.get_fieldValues()["DealAmount"]); //Add an onclick event to the convertToOpp div $('#convertToOpp').click(function (sender) { convertToOpp(itemID); }); $('#LeadDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lead(id) \n\t\t{\n\t\t\tpreviewPath = \"../leads_information.php?id=\"+id;\n\t\t\twindow.open(previewPath,'_blank','width=700,height=800,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no');\n\t\t}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle},...
[ "0.6155748", "0.58527076", "0.576146", "0.5753577", "0.5739801", "0.5738476", "0.57344794", "0.57156134", "0.5701738", "0.5615793", "0.5600871", "0.5551276", "0.55466855", "0.5544169", "0.55083287", "0.55045277", "0.5466686", "0.54450876", "0.5427636", "0.54196763", "0.541517...
0.0
-1
This function saves the newlyentered lead
function saveNewLead() { if ($('#newPotentialAmount').val() == "" || $('#newLead').val() == "") { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { var itemCreateInfo = new SP.ListItemCreationInformation(); var listItem = list.addItem(itemCreateInfo); listItem.set_item("Title", $('#newLead').val()); listItem.set_item("ContactPerson", $('#newContactPerson').val()); listItem.set_item("ContactNumber", $('#newContactNumber').val()); listItem.set_item("Email", $('#newEmail').val()); listItem.set_item("_Status", "Lead"); listItem.set_item("DealAmount", $('#newPotentialAmount').val()); listItem.update(); context.load(listItem); context.executeQueryAsync(function () { clearNewLeadForm(); showLeads(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"...
[ "0.65835935", "0.6401567", "0.61969", "0.6120719", "0.60416925", "0.60043424", "0.5999269", "0.59733", "0.590907", "0.5898496", "0.5896863", "0.5872143", "0.5860919", "0.5850837", "0.5847643", "0.5830421", "0.5824442", "0.5758286", "0.5743204", "0.5736624", "0.5711586", "0....
0.5833299
15
This function updates an existing lead's details
function saveEditLead() { if ($('#editPotentialAmount').val() == "" || $('#editLead').val() == "") { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editLead').val()); currentItem.set_item("ContactPerson", $('#editContactPerson').val()); currentItem.set_item("ContactNumber", $('#editContactNumber').val()); currentItem.set_item("Email", $('#editEmail').val()); currentItem.set_item("DealAmount", $('#editPotentialAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditLeadForm(); showLeads(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLead(contactInfo) {\n this.setState({\n contactInfo: {...this.state.contactInfo, ...contactInfo},\n loading: true\n })\n\n return this.getLead()\n .then(lead => {\n let contactState = States[contactInfo.stateCode].abbreviation\n let updatedLead = {\n id: lead.id...
[ "0.6759188", "0.59959406", "0.5849318", "0.58174187", "0.58011323", "0.5744198", "0.57401884", "0.5687227", "0.5678077", "0.5597881", "0.55947375", "0.5551576", "0.55313635", "0.55211365", "0.5510525", "0.55058676", "0.54958683", "0.5489356", "0.54399955", "0.54372627", "0.54...
0.0
-1
This function cancels the creation of a lead
function cancelNewLead() { clearNewLeadForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEditLead() {\n clearEditLeadForm();\n}", "function Cancellation() { }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }", "func...
[ "0.6329806", "0.62861603", "0.6128394", "0.60012776", "0.5954276", "0.59452295", "0.5927591", "0.5927563", "0.5926853", "0.5917221", "0.58609056", "0.58424795", "0.5825814", "0.5819498", "0.58065873", "0.57984406", "0.57947487", "0.5792172", "0.5782675", "0.576391", "0.576343...
0.70813686
0
This function clears the inputs on the new lead form
function clearNewLeadForm() { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddLead').fadeOut(500, function () { $('#AddLead').hide(); $('#newLead').val(""); $('#newContactPerson').val(""); $('#newContactNumber').val(""); $('#newEmail').val(""); $('#newPotentialAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearForm() {\n $(\"#name-input\").val(\"\");\n $(\"#destination-input\").val(\"\")\n $(\"#firstTime-input\").val(\"\");\n $(\"#frequency-input\").val(\"\");\n }", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \...
[ "0.797564", "0.7899326", "0.78950864", "0.7831015", "0.78022206", "0.77535695", "0.77535695", "0.77535695", "0.77338415", "0.7683781", "0.76666725", "0.76577467", "0.7613719", "0.7609766", "0.76073486", "0.76067376", "0.7603794", "0.7599629", "0.7596057", "0.759066", "0.75896...
0.0
-1
This function cancels the editing of an existing lead's details
function cancelEditLead() { clearEditLeadForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelNewLead() {\n clearNewLeadForm();\n}", "function editCancelFunc(){\n setEdit(null);\n }", "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 ...
[ "0.7663377", "0.7083451", "0.7054394", "0.70182973", "0.6912614", "0.68968034", "0.6835991", "0.6817441", "0.6726299", "0.67232335", "0.6703917", "0.6696722", "0.6666923", "0.65891993", "0.65277267", "0.65143514", "0.6509518", "0.6507401", "0.6486365", "0.64838725", "0.648320...
0.8118909
0
This function clears the inputs on the edit form for a lead
function clearEditLeadForm() { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LeadDetails').fadeOut(500, function () { $('#LeadDetails').hide(); $('#editLead').val(""); $('#editContactPerson').val(""); $('#editContactNumber').val(""); $('#editEmail').val(""); $('#editPotentialAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item...
[ "0.74399716", "0.7424539", "0.74009085", "0.7383851", "0.7381192", "0.73458815", "0.73298216", "0.7329398", "0.732509", "0.7303051", "0.73019385", "0.7297206", "0.72956127", "0.72940284", "0.7262547", "0.7261831", "0.72553796", "0.7248012", "0.7248012", "0.72376484", "0.72343...
0.743387
1
This function converts a lead into opportunity and shows opportunity
function convertToOpp(itemID) { hideAllPanels(); clearEditLeadForm(); currentItem.set_item("_Status", "Opportunity"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearNewLeadForm(); showOpps(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function handleLeadCompanyIntent(intent, session, response) {\n var sqsParam;\n var names = session.attributes.name.split(' ');\n var query = \"Select Name, Id from Account where Name like '\" + intent.slots.Company.value + \"'\";\n\n console.log...
[ "0.58595735", "0.50108016", "0.48255992", "0.4747155", "0.47273692", "0.47123143", "0.471151", "0.46539143", "0.46386236", "0.46251595", "0.45892575", "0.45809624", "0.45274416", "0.45132077", "0.4502267", "0.44973874", "0.44965854", "0.44862333", "0.4479352", "0.4475481", "0...
0.50619364
1
This retrieves all opportunities
function showOpps() { //Highlight the selected tile $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "orange"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasOpps = false; hideAllPanels(); var oppList = document.getElementById("AllOpps"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { var oppTable = document.getElementById("OppList"); // Remove all nodes from the Opportunity <DIV> so we have a clean space to write to while (oppTable.hasChildNodes()) { oppTable.removeChild(oppTable.lastChild); } var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Opportunity") { // Create a DIV to display the organization name var opp = document.createElement("div"); var oppLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); opp.appendChild(oppLabel); // Add an ID to the opportunity DIV opp.id = listItem.get_id(); // Add an class to the opportunity DIV opp.className = "item"; // Add an onclick event to show the opportunity details $(opp).click(function (sender) { showOppDetails(sender.target.id); }); //Add the opportunity div to the UI oppTable.appendChild(opp); hasOpps = true; } } if (!hasOpps) { var noOpps = document.createElement("div"); noOpps.appendChild(document.createTextNode("There are no opportunity. You can add a new Opportunity to an existing Lead.")); oppTable.appendChild(noOpps); } $('#AllOpps').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get opportunity. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#OppList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "async function getOpportunityPhases (req, res) {\n res.send(await service.getOpportunityPhases(req.authUser, req.params.opportunityId))\n}", "async function getOpportunityDetails ...
[ "0.6058134", "0.5598122", "0.5592937", "0.53780794", "0.53768057", "0.50000894", "0.49766225", "0.49700993", "0.49307495", "0.48573822", "0.48112598", "0.4808224", "0.4767078", "0.472867", "0.47020328", "0.46967432", "0.469502", "0.46920297", "0.46859482", "0.4679138", "0.467...
0.4390956
75
This function shows the details for a specific opportunity
function showOppDetails(itemID) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddOpp').hide(); $('#OppDetails').hide(); $('#AddSale').hide(); $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editOpp').val(currentItem.get_fieldValues()["Title"]); $('#editOppPerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editOppNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editOppEmail').val(currentItem.get_fieldValues()["Email"]); $('#editOppAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); //Add an onclick event to the convertToSale div $('#convertToSale').click(function (sender) { convertToSale(itemID); }); //Add an onclick event to the convertToLostSale div $('#convertToLostSale').click(function (sender) { convertToLostSale(itemID); }); var oppList = document.getElementById("OppAttachments"); while (oppList.hasChildNodes()) { oppList.removeChild(oppList.lastChild); } if (currentItem.get_fieldValues()["Attachments"] == true) { var attachmentFolder = web.getFolderByServerRelativeUrl("Lists/Prospects/Attachments/" + itemID); var attachments = attachmentFolder.get_files(); context.load(attachments); context.executeQueryAsync(function () { // Enumerate and list the Opp Attachments if they exist var attachementEnumerator = attachments.getEnumerator(); while (attachementEnumerator.moveNext()) { var attachment = attachementEnumerator.get_current(); var oppDelete = document.createElement("span"); oppDelete.appendChild(document.createTextNode("Delete")); oppDelete.className = "deleteButton"; oppDelete.id = attachment.get_serverRelativeUrl(); $(oppDelete).click(function (sender) { deleteOppAttachment(sender.target.id, itemID); }); oppList.appendChild(oppDelete); var oppLink = document.createElement("a"); oppLink.setAttribute("target", "_blank"); oppLink.setAttribute("href", attachment.get_serverRelativeUrl()); oppLink.appendChild(document.createTextNode(attachment.get_name())); oppList.appendChild(oppLink); oppList.appendChild(document.createElement("br")); oppList.appendChild(document.createElement("br")); } }, function () { }); } $('#OppDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "function Opportunity(obj) {\n\tthis...
[ "0.6864376", "0.6244238", "0.6145558", "0.58991754", "0.58604413", "0.58328044", "0.578931", "0.573019", "0.5721313", "0.56971484", "0.5692121", "0.5654901", "0.5588213", "0.5584418", "0.5581117", "0.55611485", "0.55573285", "0.55573285", "0.55573285", "0.5531864", "0.5521421...
0.0
-1
This function converts an opportunity into sale and shows sales
function convertToSale(itemID) { $('#AllOpps').hide(); $('#OppDetails').hide(); clearEditOppForm(); currentItem.set_item("_Status", "Sale"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showSales(); } , function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\...
[ "0.54950756", "0.5442647", "0.5410122", "0.5312123", "0.53018874", "0.5220079", "0.5210371", "0.5195265", "0.5180969", "0.5145649", "0.5078532", "0.50449085", "0.50380903", "0.5019473", "0.49916834", "0.49908888", "0.49891898", "0.49330318", "0.49132553", "0.49101803", "0.486...
0.5755146
0
This function converts an opportunity into lost opportunity
function convertToLostSale(itemID) { $('#AllOpps').hide(); $('#OppDetails').hide(); clearEditOppForm(); currentItem.set_item("_Status", "Lost Sale"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showLostSales(); } , function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpposite() {\n\n return (BUY == orderType) ? SELL: BUY;\n\n }", "function assignOppositeFlow(flow) {\n\t\tvar candidates, i, j;\n\t\t\n\t\t// Make sure this flow doesn't already have an opposingFlow.\n\t\tif(!flow.hasOwnProperty(\"oppositeFlow\")) {\n\t\t\t// Look at the outgoing flows of the end...
[ "0.5084763", "0.50229406", "0.49570805", "0.4934618", "0.49278998", "0.49138314", "0.49138314", "0.48153996", "0.48037946", "0.47967684", "0.47928435", "0.4789087", "0.47878963", "0.47853902", "0.4744723", "0.47378787", "0.47327945", "0.4720696", "0.47020024", "0.46769297", "...
0.4630659
23
This function updates an existing opportunity's details
function saveEditOpp() { if ($('#editOppAmount').val() == "" || $('#editOpp').val() == "") { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editOpp').val()); currentItem.set_item("ContactPerson", $('#editOppPerson').val()); currentItem.set_item("ContactNumber", $('#editOppNumber').val()); currentItem.set_item("Email", $('#editOppEmail').val()); currentItem.set_item("DealAmount", $('#editOppAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showOpps(); }, function (sender, args) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updateOpportunityDetails (req, res) {\n res.send(await service.updateOpportunityDetails(req.authUser, req.params.opportunityId, req.body))\n}", "function update() {\n updateGym(id, name, address1, address2, town, county, openingHours)\n .then(() => {\n alert(\"Gym Information updat...
[ "0.7364753", "0.65099853", "0.6487726", "0.60082096", "0.5966967", "0.5918077", "0.59168464", "0.5816638", "0.5808199", "0.5795895", "0.5736338", "0.57270527", "0.56655884", "0.5663554", "0.56552815", "0.5650041", "0.5641827", "0.56417966", "0.56198794", "0.5614056", "0.55973...
0.0
-1
This function cancels the editing of an existing opportunity's details
function cancelEditOpp() { clearEditOppForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEditLead() {\n clearEditLeadForm();\n}", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function editCancelFunc(){\n setEdit(null)...
[ "0.75310826", "0.7472145", "0.72921914", "0.72144395", "0.71878", "0.7137927", "0.7091826", "0.703644", "0.70224464", "0.70043117", "0.6931523", "0.6899447", "0.6882118", "0.6872421", "0.6871263", "0.6869518", "0.6857791", "0.68068117", "0.67740315", "0.676982", "0.6731836", ...
0.7528529
1
This function clears the inputs on the edit form for a opportunity
function clearEditOppForm() { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#OppDetails').fadeOut(500, function () { $('#OppDetails').hide(); $('#editOpp').val(""); $('#editOppPerson').val(""); $('#editOppNumber').val(""); $('#editOppEmail').val(""); $('#editOppAmount').val(""); $('#editOppDate').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "clearForm() {\n ...
[ "0.75559187", "0.7507091", "0.7383113", "0.7323118", "0.7318477", "0.7314623", "0.728837", "0.72187555", "0.7209933", "0.7204842", "0.71905166", "0.7185397", "0.7183318", "0.7175612", "0.7173881", "0.71593165", "0.7152816", "0.7135449", "0.7126685", "0.7126685", "0.7119893", ...
0.0
-1
This function deletes an attachment from a Prospects list opportunity item and then refreshed the Prospects form
function deleteOppAttachment(url, itemID) { var attachment = web.getFileByServerRelativeUrl(url); attachment.deleteObject(); showOppDetails(itemID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOppDetails(itemID) {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n $('#AddOpp').hide();\n $('#OppDet...
[ "0.6036632", "0.5950442", "0.59453875", "0.58625627", "0.5824961", "0.5787567", "0.5787567", "0.57353246", "0.56986034", "0.56957966", "0.56613743", "0.5640394", "0.56151897", "0.55989826", "0.5576555", "0.55622935", "0.55592227", "0.55398905", "0.5533175", "0.5530458", "0.55...
0.6974799
0
This function runs when a file is successfully loaded and read by the PO file input. It references SP.RequestExecutor.js which will upload the file as an attachment by using the REST API. NOTE: This is safer and more capabale (in terms of file size) than using JSOM file creation for uploading files as attachments.
function oppFileOnload(event) { contents = event.target.result; // The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js $.getScript(web.get_url() + "/_layouts/15/SP.RequestExecutor.js", storeOppAsAttachment); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n ...
[ "0.6802467", "0.64451814", "0.6315319", "0.62748504", "0.6202645", "0.6177801", "0.61405754", "0.6117803", "0.6061337", "0.60337394", "0.6030239", "0.6023879", "0.59792835", "0.5921451", "0.5910848", "0.58695996", "0.585191", "0.585032", "0.5832177", "0.58171964", "0.5787905"...
0.7078655
0
This helper function ensures that the byte array passed in is returned in a format that's required for the contents of a file sent to SharePoint for storage as a list item attachment.
function fixBuffer(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return binary; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareAttachmentForStorage(attData, cb) {\n readAsBinaryString(attData, cb);\n}", "function isByteArray(data) {\n return (typeof data === 'object' && Array.isArray(data) \n && data.length > 0 && typeof data[0] === 'number')\n}", "raw_blob(txt) { return Base64.decode(txt) }", "attachmentW...
[ "0.6067535", "0.56576943", "0.5500187", "0.53863144", "0.529308", "0.5230164", "0.52195746", "0.5169015", "0.5137089", "0.5107119", "0.50754255", "0.506259", "0.5021915", "0.49969152", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", ...
0.0
-1
This function runs when the file input is used to uplaod a proposal document for a opportunity
function oppAttach(event) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } if (!event.target) { var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("The FileSystem APIs are not supported in this browser.")); errArea.appendChild(divMessage); return (false); } var files = event.target.files; if (!window.FileReader) { var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("The FileSystem APIs are not supported in this browser.")); errArea.appendChild(divMessage); return (false); } if (files.length > 0) { // Get the first file. In this case, only one file can be selected but because the file input could support // multi-file selection in some browsers we still need to access the file as the 0th member of the files collection file = files[0]; // Wire up the HTML5 FileReader to read the selected file var reader = new FileReader(); reader.onload = oppFileOnload; reader.onerror = function (event) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Error reading file: " + event.target.error.code)); errArea.appendChild(divMessage); }; // Reading the file triggers the oppFileOnLoad function that was wired up above reader.readAsArrayBuffer(file); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newFile() {\n\teditor.reset();\n\tpathToFileBeingEdited = undefined;\n\tparse();\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateL...
[ "0.559201", "0.5418875", "0.530729", "0.5121854", "0.50767225", "0.5063616", "0.5063237", "0.50583225", "0.50316024", "0.500559", "0.4974667", "0.4973006", "0.49413094", "0.4929875", "0.49256665", "0.49239013", "0.49227002", "0.4920849", "0.4916842", "0.4915906", "0.49107948"...
0.0
-1
This function runs after we are sure we have a reference to SP.RequestExecutor.js. It uses the REST API to upload the file as an attachment
function storeOppAsAttachment() { var fileContents = fixBuffer(contents); var createitem = new SP.RequestExecutor(web.get_url()); createitem.executeAsync({ url: web.get_url() + "/_api/web/lists/GetByTitle('Prospects')/items(" + currentItem.get_id() + ")/AttachmentFiles/add(FileName='" + file.name + "')", method: "POST", binaryStringRequestBody: true, body: fileContents, success: storeOppSuccess, error: storeOppFailure, state: "Update" }); function storeOppSuccess(data) { // Success callback var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } // Workaround to clear the value in the file input. // What we really want to do is clear the text of the input=file element. // However, we are not allowed to do that because it could allow malicious script to interact with the file system. // So we’re not allowed to read/write that value in JavaScript (or jQuery) // So what we have to do is replace the entire input=file element with a new one (which will have an empty text box). // However, if we just replaced it with HTML, then it wouldn’t be wired up with the same events as the original. // So we replace it with a clone of the original instead. // And that’s what we need to do just to clear the text box but still have it work for uploading a second, third, fourth file. $('#oppUpload').replaceWith($('#oppUpload').val('').clone(true)); var oppUpload = document.getElementById("oppUpload"); oppUpload.addEventListener("change", oppAttach, false); showOppDetails(currentItem.get_id()); } function storeOppFailure(data) { // Failure callback var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("File upload failed.")); errArea.appendChild(divMessage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n ...
[ "0.72109455", "0.68065494", "0.6431627", "0.64285105", "0.6408927", "0.6329918", "0.6251092", "0.6233021", "0.62218744", "0.62139416", "0.61401397", "0.6127133", "0.6110041", "0.6096919", "0.60918397", "0.60884875", "0.6083382", "0.6028441", "0.6026446", "0.60027665", "0.6002...
0.6841957
1
This function retrieves all sales from Prospects list
function showSales() { //Highlight selected tile $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "orange"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasSales = false; hideAllPanels(); var saleList = document.getElementById("AllSales"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("SaleList"); // Remove all nodes from the sale <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Propsects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Sale") { // Create a DIV to display the organization name var sale = document.createElement("div"); var saleLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); sale.appendChild(saleLabel); // Add an ID to the sale DIV sale.id = listItem.get_id(); // Add an class to the sale DIV sale.className = "item"; // Add an onclick event to show the sale details $(sale).click(function (sender) { showSaleDetails(sender.target.id); }); saleTable.appendChild(sale); hasSales = true; } } if (!hasSales) { var noSales = document.createElement("div"); noSales.appendChild(document.createTextNode("There are no sales. You can add a new sale from here.")); saleTable.appendChild(noSales); } $('#AllSales').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get sales. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#SaleList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_U...
[ "0.66979516", "0.62137157", "0.60977745", "0.6088173", "0.6077098", "0.59924906", "0.5975461", "0.5859383", "0.58162403", "0.5774087", "0.57652336", "0.57155746", "0.5700134", "0.56405514", "0.56146747", "0.56059897", "0.5603738", "0.5575388", "0.557178", "0.5532657", "0.5525...
0.0
-1
This function shows the details for a specific sale
function showSaleDetails(itemID) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editSale').val(currentItem.get_fieldValues()["Title"]); $('#editSalePerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editSaleNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editSaleEmail').val(currentItem.get_fieldValues()["Email"]); $('#editSaleStatus').val(currentItem.get_fieldValues()["_Status"]); $('#editSaleAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); $('#SaleDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalSale(){\n\n console.log(sale.name);\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err,...
[ "0.69730794", "0.6691109", "0.6495654", "0.6490595", "0.6486762", "0.64315", "0.60111", "0.59943", "0.5987773", "0.5975199", "0.5952797", "0.59054244", "0.58577776", "0.5830926", "0.58250487", "0.57536995", "0.5723273", "0.5676545", "0.5671133", "0.56689286", "0.56684625", ...
0.53304154
49
This function clears the inputs on the edit form for a sale
function cancelEditSale() { clearEditSaleForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';...
[ "0.756188", "0.756188", "0.7501576", "0.7443869", "0.74255663", "0.7381309", "0.73807275", "0.7321939", "0.7223663", "0.7220769", "0.7210711", "0.71952885", "0.719072", "0.7186856", "0.7184216", "0.7181345", "0.7169639", "0.71645117", "0.7163952", "0.7140837", "0.7138663", ...
0.7445479
3
This function clears the inputs on the edit form for a sale
function clearEditSaleForm() { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#SaleDetails').fadeOut(500, function () { $('#SaleDetails').hide(); $('#editSaleName').val(""); $('#editSalePerson').val(""); $('#editSaleNumber').val(""); $('#editSaleEmail').val(""); $('#editSaleAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';...
[ "0.7559467", "0.7559467", "0.7499257", "0.7446134", "0.74417937", "0.7423586", "0.7379165", "0.73204905", "0.7221571", "0.7218246", "0.7208463", "0.7193243", "0.7189295", "0.71848047", "0.718238", "0.71793485", "0.7167522", "0.71626", "0.71624124", "0.7138791", "0.71364295", ...
0.73803425
6
This function updates an existing sale's details
function saveEditSale() { if ($('#editSaleAmount').val() == "" || $('#editSale').val() == "") { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editSale').val()); currentItem.set_item("ContactPerson", $('#editSalePerson').val()); currentItem.set_item("ContactNumber", $('#editSaleNumber').val()); currentItem.set_item("Email", $('#editSaleEmail').val()); currentItem.set_item("DealAmount", $('#editSaleAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { showSales(); }, function (sender, args) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateSale(saleID, storeID) {\n\n}", "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.que...
[ "0.7641599", "0.6589605", "0.6433845", "0.64084125", "0.6355225", "0.6160315", "0.6100403", "0.60600704", "0.6017934", "0.5945191", "0.5935192", "0.5914338", "0.58704233", "0.5862563", "0.5834998", "0.5833835", "0.5634119", "0.5612833", "0.56082404", "0.5605296", "0.55957294"...
0.5388544
33
This function retrieves all lost sales from Prospects list
function showLostSales() { $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "orange"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var haslostSales = false; hideAllPanels(); var saleList = document.getElementById("AllLostSales"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("LostSaleList"); // Remove all nodes from the lostSale <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Propsects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { // Create a DIV to display the organization name var lostSale = document.createElement("div"); var saleLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); lostSale.appendChild(saleLabel); // Add an ID to the lostSale DIV lostSale.id = listItem.get_id(); // Add an class to the lostSale DIV lostSale.className = "item"; // Add an onclick event to show the lostSale details $(lostSale).click(function (sender) { showLostSaleDetails(sender.target.id); }); saleTable.appendChild(lostSale); haslostSales = true; } } if (!haslostSales) { var noLostSales = document.createElement("div"); noLostSales.appendChild(document.createTextNode("There are no lost sales.")); saleTable.appendChild(noLostSales); } $('#AllLostSales').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get lost sales. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#LostSaleList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNotSoldProducts(store) {\n \n // get the output1 sheet\n\tvar sheet = getOutputSheet(1)\n \n // get the first cell of the Output1 sheet\n var cell = getOutputFirstCell(1);\n \n // set the formula to get the asked information\n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select ...
[ "0.61157554", "0.5692415", "0.5599473", "0.55588496", "0.5500307", "0.54688597", "0.5408894", "0.5382795", "0.5346829", "0.5335059", "0.5281104", "0.5265118", "0.52641475", "0.525718", "0.52004206", "0.5200095", "0.51901793", "0.5168106", "0.51667845", "0.5166086", "0.5153726...
0.53702885
8
This function shows the details for a specific lost sale
function showLostSaleDetails(itemID) { var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LostSaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#lostSale').val(currentItem.get_fieldValues()["Title"]); $('#lostSalePerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#lostSaleNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#lostSaleEmail').val(currentItem.get_fieldValues()["Email"]); $('#lostSaleStatus').val(currentItem.get_fieldValues()["_Status"]); $('#lostSaleAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); $('#LostSaleDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalSale(){\n\n console.log(sale.name);\n}", "function viewSale() {\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 console.log(\"----------------------------...
[ "0.6457778", "0.6134489", "0.60750747", "0.6047149", "0.5972565", "0.58748937", "0.57993543", "0.57311463", "0.5690661", "0.5605454", "0.5584485", "0.55698514", "0.5507119", "0.5470921", "0.54649156", "0.54442716", "0.54122114", "0.54013485", "0.53928924", "0.53308886", "0.53...
0.53581417
19
This function closes the lost sale detail form
function cancelLostSale() { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LostSaleDetails').fadeOut(500, function () { $('#LostSaleDetails').hide(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeDetails() {\n\n\tif (!Alloy.Globals.detailsWindow) {\n\t\treturn;\n\t}\n\n\t$.tab.closeWindow(Alloy.Globals.detailsWindow);\n\n\tAlloy.Globals.detailsWindow = null;\n}", "function closePriceWin(obj) {\n obj.hide()\n obj.find('.setPrice-num').val('');\n }", "function fhArrival_clo...
[ "0.6926146", "0.6909939", "0.6806721", "0.6559106", "0.6443541", "0.64165354", "0.63693875", "0.63185865", "0.6302571", "0.62976885", "0.6297595", "0.62764835", "0.62740195", "0.62653846", "0.62377334", "0.6227472", "0.62108666", "0.61988795", "0.6198675", "0.6186229", "0.618...
0.0
-1
This function creates report graphs
function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) { $('#pipelineName').show(); $('#conversionName').show(); $('#pipeLead').width((allLead / allCurrentPipe) * 800); $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800); $('#pipeSale').width((allSale / allCurrentPipe) * 800); $('#leadText').width((allLead / allCurrentPipe) * 800); $('#blankopp').width((allOpp / allCurrentPipe) * 800); $('#blankLead').width((allLead / allCurrentPipe) * 800); $('#oppText').width((allOpp / allCurrentPipe) * 800); $('#saleText').width((allSale / allCurrentPipe) * 800); // Calculate the widths for conversion rate var total = allLost + allSale; $('#wonOpp').width((allSale / total) * 660); $('#lostOpp').width((allLost / total) * 660); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-s...
[ "0.6571701", "0.6333574", "0.630047", "0.62503386", "0.621513", "0.62101257", "0.61687285", "0.6150619", "0.6135054", "0.61107767", "0.61055577", "0.61012805", "0.6077987", "0.606655", "0.6055672", "0.6044861", "0.6041029", "0.6030964", "0.6013327", "0.599888", "0.5989515", ...
0.62552667
3
This function shows lead count and total deal amount in pipeline on mouseover
function showLeadAmount(leadAmount) { var getdiv = document.getElementById("hoverLead"); getdiv.innerText = ""; var leadAmtLabel = document.createElement("DIV"); leadAmtLabel.className = "chartBarLabel"; leadAmtLabel.appendChild(document.createTextNode("$" + leadAmount.toLocaleString())); $('#hoverLead').append(leadAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.67282546", "0.67143846", "0.58398664", "0.5573118", "0.5561016", "0.5490889", "0.5467163", "0.537842", "0.5371907", "0.53241843", "0.5315588", "0.5302775", "0.52802175", "0.52729136", "0.5270246", "0.5262978", "0.5258699", "0.5251025", "0.5248389", "0.52119786", "0.5193957...
0.6231987
2
This function shows opportunities count and total deal amount in pipeline on mouseover
function showOppAmount(oppAmount) { var getdiv = document.getElementById("hoverOpp"); getdiv.innerText = ""; var oppAmtLabel = document.createElement("DIV"); oppAmtLabel.className = "chartBarLabel"; oppAmtLabel.appendChild(document.createTextNode("$" + oppAmount.toLocaleString())); $('#hoverOpp').append(oppAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.649632", "0.59669816", "0.5820691", "0.55538", "0.5489368", "0.54846215", "0.5401589", "0.5399341", "0.5374675", "0.5359719", "0.5353452", "0.52864295", "0.5269863", "0.523301", "0.52233297", "0.5223235", "0.5219091", "0.5156936", "0.514597", "0.5143204", "0.51423156", "...
0.5184354
17
This function shows customer count and total deal amount in pipeline on mouseover
function showSaleAmount(saleAmount) { var saleAmtLabel = document.createElement("DIV"); saleAmtLabel.className = "chartBarLabel"; saleAmtLabel.appendChild(document.createTextNode("$" + saleAmount.toLocaleString())); var getdiv = document.getElementById("hoverSale"); getdiv.innerText = ""; $('#hoverSale').append(saleAmtLabel); var getwondiv = document.getElementById("wonOpp"); getwondiv.innerText = ""; var wonAmtLabel = document.createElement("DIV"); wonAmtLabel.className = "wonLostLabel"; wonAmtLabel.appendChild(document.createTextNode("$" + saleAmount.toLocaleString())); $('#wonOpp').append(wonAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.65691406", "0.5912847", "0.5752698", "0.57207483", "0.5499622", "0.5450888", "0.5372179", "0.5365616", "0.5365435", "0.53644097", "0.53138584", "0.53135705", "0.53110814", "0.5297435", "0.5279137", "0.5278823", "0.5276103", "0.5268961", "0.52617824", "0.5257476", "0.523853...
0.59686136
1
This function shows lost opportunity count and total deal amount in graph on mouseover
function showLostAmount(lostAmount) { var getdiv = document.getElementById("lostOpp"); getdiv.innerText = ""; var lostAmtLabel = document.createElement("DIV"); lostAmtLabel.className = "wonLostLabel"; lostAmtLabel.appendChild(document.createTextNode("$" + lostAmount.toLocaleString())); $('#lostOpp').append(lostAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.6426414", "0.61706126", "0.60711235", "0.5904209", "0.58985", "0.5892405", "0.5852378", "0.5817237", "0.572569", "0.57182544", "0.5711737", "0.5648951", "0.56489205", "0.5621979", "0.5607887", "0.5598327", "0.55813", "0.55786043", "0.5571478", "0.5550848", "0.5549257", "...
0.0
-1
This function shows lead count and total deal amount in pipeline on mouseover
function showLeadCount(leadCount) { var getDiv = document.getElementById("hoverLead"); getDiv.innerText = leadCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.67282546", "0.6231987", "0.58398664", "0.5573118", "0.5561016", "0.5490889", "0.5467163", "0.537842", "0.5371907", "0.53241843", "0.5315588", "0.5302775", "0.52802175", "0.52729136", "0.5270246", "0.5262978", "0.5258699", "0.5251025", "0.5248389", "0.52119786", "0.51939577...
0.67143846
1
This function shows opportunities count and total deal amount in pipeline on mouseover
function showOppCount(oppCount) { var getDiv = document.getElementById("hoverOpp"); getDiv.innerText = oppCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.649632", "0.59669816", "0.55538", "0.5489368", "0.54846215", "0.5401589", "0.5399341", "0.5374675", "0.5359719", "0.5353452", "0.52864295", "0.5269863", "0.523301", "0.52233297", "0.5223235", "0.5219091", "0.5184354", "0.5156936", "0.514597", "0.5143204", "0.51423156", "...
0.5820691
2
This function shows customer count and total deal amount in pipeline on mouseover
function showSaleCount(saleCount) { //$('#pipeSale').mouseenter(function () { var getDiv = document.getElementById("hoverSale"); getDiv.innerText = saleCount; var getwondiv = document.getElementById("wonOpp"); getwondiv.innerText = ""; var wonCountLabel = document.createElement("DIV"); wonCountLabel.className = "wonLostLabel"; wonCountLabel.appendChild(document.createTextNode(saleCount)); $('#wonOpp').append(wonCountLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerTex...
[ "0.59686136", "0.5912847", "0.5752698", "0.57207483", "0.5499622", "0.5450888", "0.5372179", "0.5365616", "0.5365435", "0.53644097", "0.53138584", "0.53135705", "0.53110814", "0.5297435", "0.5279137", "0.5278823", "0.5276103", "0.5268961", "0.52617824", "0.5257476", "0.523853...
0.65691406
0
This function shows lost opportunity count and total deal amount in graph on mouseover
function showLostSaleCount(lostCount) { var getdiv = document.getElementById("lostOpp"); getdiv.innerText = ""; var lostCountLabel = document.createElement("DIV"); lostCountLabel.className = "wonLostLabel"; lostCountLabel.appendChild(document.createTextNode(lostCount)); $('#lostOpp').append(lostCountLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElemen...
[ "0.6426414", "0.61706126", "0.60711235", "0.5904209", "0.58985", "0.5892405", "0.5852378", "0.5817237", "0.572569", "0.5711737", "0.5648951", "0.56489205", "0.5621979", "0.5607887", "0.5598327", "0.55813", "0.55786043", "0.5571478", "0.5550848", "0.5549257", "0.5513899", "0...
0.57182544
9
This function shows the conversion rate report and pipeline
function showReports() { $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "orange"); hideAllPanels(); $('#AllReports').fadeIn(500, null); $('#amountPipeline').show(); $('#countPipeline').show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPerf() {\n //Get all times combined\n let timeCombined = 0;\n perf.timePerClient.forEach(elem => {\n timeCombined += elem;\n });\n\n // Get the average time of all the combined times\n const averageTime = timeCombined / perf.timePerClient.length;\n\n //Calculcate percentage in relation to...
[ "0.56859595", "0.5635288", "0.56152296", "0.55657244", "0.55223155", "0.54507864", "0.5379305", "0.53574294", "0.52907366", "0.52847356", "0.52658", "0.52355504", "0.5194467", "0.5193092", "0.5193092", "0.51879096", "0.51702565", "0.51645464", "0.5160962", "0.5138168", "0.512...
0.0
-1
This function gets deal amount for leads, opportunities, sales and lost opportunities
function getAmount() { $("#wonLostDrillDown").hide(); $("#pipeDrillDown").hide(); $("#drillTable").hide(); leadAmount = 0; oppAmount = 0; saleAmount = 0; var lostSaleAmount = 0; var allProspect = 0; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Iterate through the list items in the Invoice list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); // Sum up all deal amounts if (listItem.get_fieldValues()["_Status"] == "Lead") { leadAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Opportunity") { oppAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Sale") { saleAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { lostSaleAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()) { allProspect += parseFloat(listItem.get_fieldValues()["DealAmount"]); } var pipelineAmount = allProspect - lostSaleAmount; } showLeadAmount(leadAmount); showOppAmount(oppAmount); showSaleAmount(saleAmount); showLostAmount(lostSaleAmount); $('#chartArea').fadeIn(500, null); createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount); }, function () { alert("failure in get amount"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent(){\n let sum = 0;\n for(const meal of this.mea...
[ "0.627752", "0.627752", "0.6138144", "0.6107445", "0.6082965", "0.6076039", "0.60117716", "0.59998304", "0.59753764", "0.5949133", "0.59258074", "0.5918761", "0.59184986", "0.59025747", "0.5894164", "0.5879869", "0.5876208", "0.58450013", "0.5844477", "0.5844288", "0.5838463"...
0.5770791
28
This function gets count for leads, opportunities, sales and lost opportunities
function getCount() { $("#wonLostDrillDown").hide(); $("#pipeDrillDown").hide(); $("#drillTable").hide(); var leadCount = 0; var oppCount = 0; var saleCount = 0; var lostSaleCount = 0; var allCount = 0; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Iterate through the list items in the Invoice list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); // Sum up all counts if (listItem.get_fieldValues()["_Status"] == "Lead") { leadCount = parseInt(leadCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Opportunity") { oppCount = parseInt(oppCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Sale") { saleCount = parseInt(saleCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { lostSaleCount = parseInt(lostSaleCount) + 1; } if (listItem.get_fieldValues()) { allCount = parseInt(allCount) + 1; } var current = allCount - lostSaleCount; } showLeadCount(leadCount); showOppCount(oppCount); showSaleCount(saleCount); showLostSaleCount(lostSaleCount); $('#chartArea').fadeIn(500, null); createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount); }, function () { alert("failure in getCount"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookedCountHelper(dbBookings){\n var count = 0;\n for(booking in dbBookings){\n count = count + dbBookings[booking].target_count;\n }\n console.log(\" Total Seats Booked in the Current Flight are - \" + count);\n return count;\n}", "bookingCount() {\n ...
[ "0.6353665", "0.6037318", "0.5961234", "0.5839468", "0.58316606", "0.58018774", "0.57679766", "0.57649976", "0.57395744", "0.5724641", "0.5723641", "0.5709042", "0.57036096", "0.5703531", "0.570331", "0.5692324", "0.5681472", "0.5676365", "0.5651066", "0.56458837", "0.564185"...
0.6273857
1
This function gives leads details in the pipe drill down
function drillLead() { var hasLeads = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Lead"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var leadTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (leadTable.hasChildNodes()) { leadTable.removeChild(leadTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lead") { // Get information for each Lead var leadTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var leadPerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var leadNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var leadEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var leadPotentialAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(leadTitle.textContent, leadPerson.textContent, leadNumber.textContent,leadEmail.textContent, leadPotentialAmt.textContent, type, leadAmount.toLocaleString()); } hasLeads = true; } if (!hasLeads) { // Text to display if there are no leads var noLeads = document.createElement("div"); noLeads.appendChild(document.createTextNode("There are no leads. You can add a new lead from here.")); leadTable.appendChild(noLeads); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Leads. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showDoctors(){\n var j=1;\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t...
[ "0.5266271", "0.52337575", "0.50949556", "0.50354266", "0.50354123", "0.4953867", "0.49201727", "0.49186254", "0.49137583", "0.48746255", "0.4831739", "0.47993863", "0.47959682", "0.47596398", "0.4724484", "0.47126144", "0.4707885", "0.47018892", "0.46931022", "0.4689647", "0...
0.45172215
50
This function gives opportunity details in the pipe drill down
function drillOpp() { var hasOpp = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Opportunities"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var oppTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (oppTable.hasChildNodes()) { oppTable.removeChild(oppTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Opportunity") { // Get information for each Opportunity var oppTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var oppPerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var oppNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var oppEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var oppAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(oppTitle.textContent, oppPerson.textContent, oppNumber.textContent, oppEmail.textContent, oppAmt.textContent, type, oppAmount); } hasOpp = true; } if (!hasOpp) { // Text to display if there are no Opportunities var noOpps = document.createElement("div"); noOpps.appendChild(document.createTextNode("There are no Opportunities.")); oppTable.appendChild(noOpps); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Opportunities. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "getDetails(){\n return [ this.search,\n this.cost,\n this.state,...
[ "0.5502532", "0.54416037", "0.5397782", "0.52958333", "0.52073485", "0.509295", "0.50837195", "0.5044975", "0.50349134", "0.5002779", "0.49955818", "0.49856973", "0.49830937", "0.49719363", "0.49347574", "0.49087036", "0.4902716", "0.49007633", "0.4847376", "0.48454365", "0.4...
0.0
-1
This function gives sale details in the pipe drill down
function drillSale() { var hasSale = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Sale"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Sale") { // Get information for each Sale var saleTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var salePerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var saleNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var saleEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var saleAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(saleTitle.textContent, salePerson.textContent, saleNumber.textContent, saleEmail.textContent, saleAmt.textContent, type, saleAmount); } hasSale = true; } if (!hasSale) { // Text to display if there are no Sales var noSales = document.createElement("div"); noSales.appendChild(document.createTextNode("There are no Sales.")); saleTable.appendChild(noSales); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Sales. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewSale() {\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 console.log(\"---------------------------------------------\");\n console.log(res[i].item_id...
[ "0.65242743", "0.6435476", "0.640648", "0.63659734", "0.60214293", "0.6010571", "0.5927727", "0.5880507", "0.5830779", "0.58215594", "0.58188033", "0.576814", "0.5763571", "0.57349867", "0.569134", "0.56725425", "0.56581235", "0.56543934", "0.5641388", "0.5631957", "0.5568955...
0.5310062
47