query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get the response body
getBody() { return this.response.text(); }
{ "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}", "getBody() {\n return this.body;\n }", "async getResponseBody(params) {\n return await new ...
[ "0.69054323", "0.679065", "0.6740696", "0.6729227", "0.6235844", "0.6233899", "0.6190504", "0.60173863", "0.60173863", "0.5993346", "0.5993346", "0.5968506", "0.58940977", "0.5887934", "0.58548576", "0.5810505", "0.580509", "0.57605636", "0.57605636", "0.57605636", "0.5760563...
0.8114753
0
Get the response headers
getHeaders() { return this.response.headers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get headerNames() {\n return this.response.getHeaderNames();\n }", "function getResponseHeaders(xhr) {\n var raw = xhr.getAllResponseHeaders();\n return raw.replace(/\\r/g, \"\").replace(/^\\s+/,\"\").replace(/\\s+$/,\"\").split(/\\n/);\n}", "function allHeader(text){\n\n return text.getAllR...
[ "0.7872358", "0.77093124", "0.71865684", "0.70876104", "0.7070867", "0.7015091", "0.7005985", "0.70032984", "0.6952532", "0.6931957", "0.6898778", "0.6871433", "0.68651515", "0.685269", "0.6803506", "0.66387004", "0.66387004", "0.66387004", "0.65572333", "0.6544185", "0.65100...
0.842609
0
Compute a table map.
function computeMap(table) { if (table.type.spec.tableRole != "table") throw new RangeError("Not a table node: " + table.type.name) let width = findWidth(table), height = table.childCount let map = [], mapPos = 0, problems = null, colWidths = [] for (let i = 0, e = width * height; i < e; i++) map[i] = 0 for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeMap(table) {\n if (table.type.spec.tableRole != \"table\") { throw new RangeError(\"Not a table node: \" + table.type.name) }\n var width = findWidth(table), height = table.childCount;\n var map = [], mapPos = 0, problems = null, colWidths = [];\n for (var i = 0, e = width * height; i < e; i++)...
[ "0.71847045", "0.6622232", "0.6511895", "0.6302117", "0.61788255", "0.5968459", "0.58989125", "0.58989125", "0.5679906", "0.56472564", "0.553556", "0.54890877", "0.5416545", "0.5393475", "0.53670746", "0.5333328", "0.5311716", "0.5305715", "0.53018415", "0.5300443", "0.529197...
0.70389783
1
The stackLetter function should accept the array as the sole argument / Write a `for` loop that iterates over the array argument and outputs the letters. / step 2. write the for loop
function stackLetters (theAlphabetArray) { var letters = ""; // empty string for new combinations (bucket) for (var i = 0; i < alphabet.length; i++){ letters += alphabet[i]; // console.log("letters inside of for loop", letters ); // console.log("each letter", alphabet[i]); // console.log("type o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stackLetters (theAlphabetArray) {\n\t\tvar stack = \"\";\n\t\t\n\tfor(var i = 0; i < theAlphabetArray.length; i++) {\n\t\tif (i % 3 === 0) {\n\t\t\tstack += \" \" + theAlphabetArray[i];\n\t\t}else{\n\t\tstack += theAlphabetArray[i];\n\t\tconsole.log(stack);\n\t\t}\n\t}\n\t\t\n}", "function stackLetters ...
[ "0.77866244", "0.7285101", "0.6902879", "0.6167186", "0.6058709", "0.5966741", "0.5956802", "0.5950039", "0.5875174", "0.578146", "0.5771069", "0.5768094", "0.5726857", "0.5720861", "0.570952", "0.569656", "0.567425", "0.5667561", "0.56584364", "0.5646768", "0.56264734", "0...
0.75616723
1
For action links of the type: Axes: on | off here is a more concise version with 4x props: 'name', 'variableName', 'value', 'hofCB' (so still 4 props, but usage will be 6x LOC, rather than 17x LOC) There are 2x optional props: 'actionNames' 'representedValues'
function WgMut2WayActionLink(props) { const customNames = props.actionNames !== undefined; const representedValues = props.representedValues || [false, true]; return ( <WgMutexActionLink name={props.name} className={props.variableName} equityTestingForEnabled={{ currentValue: props.valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waOverviewActions(pv_action,pv_details,pv_linkDestination,pv_ttSku) {\n\t//pv_ttSku=TurboTax SKU\n\tif(pv_action) { pv_action=pv_action.toLowerCase(); }\n\tif(pv_details) { pv_details=pv_details.toLowerCase(); }\n\tif(pv_linkDestination) { pv_linkDestination=pv_linkDestination.toLowerCase(); }\n\tif(pv_t...
[ "0.5764077", "0.56301004", "0.54206234", "0.5359292", "0.5296584", "0.517826", "0.50981873", "0.50709885", "0.5048219", "0.5039257", "0.50048", "0.50020915", "0.4985688", "0.4968236", "0.4950916", "0.49413863", "0.48600116", "0.4848423", "0.48465893", "0.4841913", "0.4839495"...
0.57477665
1
Pushes key to the key state array if it is not already there
pushKeyState(key) { for (let e of this.keyStates) { if (e.key == key) return; } this.keyStates.push(new KeyValuePair(key, State.Up)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeStateKey(key){return key;}", "addKey( whichKey ) {\n\t\tif ( showAllKeyDown === true ) {\n\t\t\tthis.keysActive.push( this.createKeyObject( whichKey ) );\n\t\t\treturn this.keysActive[ this.keysActive.length - 1 ];\n\t\t} else {\n\t\t\t// don't add if its already in the list\n\t\t\tconst hasKey = th...
[ "0.6481606", "0.6403074", "0.6254922", "0.6189564", "0.616906", "0.61494046", "0.6136096", "0.61173356", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.61084765", "0.6100831", "0.6080978", "0.6080978", "0.604...
0.82440025
0
> hide or reveal TRADE div
function tradeDivVisibilityOn(reveal){ var tradeItemsDiv = document.getElementById("tradeDiv"); var sellingItemsDiv = document.getElementById("sellingDiv"); if (reveal) { tradeItemsDiv.style.display = "block"; sellingItemsDiv.style.display = "block"; } else { tradeItemsDiv.style.display = "none"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hide() {\n toogle = 'hide'\n\n }", "function hideElement(){\n $('#attendee_container').show(\"slide\", { direction: \"up\" }, 500);\n $('#attendee_1_wrap').hide('Slide');\n $('#attendee_2_wrap').hide('Slide');\n $('#attendee_3_wrap').hide('Slide');\n $('#attendee_4_wrap').hide('...
[ "0.6568586", "0.6489025", "0.6484546", "0.6349352", "0.6331106", "0.6290246", "0.62727875", "0.623249", "0.62045366", "0.6196306", "0.6169083", "0.616677", "0.6163166", "0.61573607", "0.61573607", "0.6136447", "0.61355525", "0.61120427", "0.60604274", "0.6054842", "0.6038323"...
0.67448664
0
> hide or reveal strangers
function strangersVisibilityOn(reveal){ var strangersDiv = document.getElementById("strangers"); if (reveal){ strangersDiv.style.display = "block"; } else { strangersDiv.style.display = "none"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hide() {\n toogle = 'hide'\n\n }", "hide() {}", "function samling() {\n\n\n\n\t\tif (jQuery(sam).hide) {\n\t\t\tfor (var i = 0; i < sam.length; i++) {\n\t\t\t\tjQuery(mod[i]).hide();\n\t\t\t\tjQuery(ren[i]).hide();\n\t\t\t\tjQuery(sam[i]).show();\n\t\t\t\tjQuery(fors[i]).hide();\n\n\t\t\t}\n...
[ "0.7256089", "0.66737974", "0.6617015", "0.65906376", "0.6564174", "0.6512202", "0.6491175", "0.6454707", "0.6445623", "0.64362305", "0.6416174", "0.64002633", "0.6398833", "0.6371603", "0.6350122", "0.63182366", "0.62979835", "0.62949467", "0.62808895", "0.62707347", "0.6269...
0.7815478
0
onKeyDown() some browsers require key down events for special keys
function onKeyDown(e) { // do not handle key events when not in input mode if (!imode) { return; } // only handle special keys here specialKey(e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onKeyDown(event) {\n}", "HandleKeyDown(event) {}", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "function keyDownHandler(e) {\n\twasdKeys.onKeyDown(e);\n}", "keyDown(_keycode) {}", "function keyDownHandler(event) {\n keyHandler(true, event);\n}", "function handleKeyDown(ev...
[ "0.84783685", "0.798798", "0.7853719", "0.783679", "0.77540904", "0.7680882", "0.76610065", "0.76222235", "0.76111716", "0.7543208", "0.748356", "0.7479753", "0.74563247", "0.744162", "0.7407407", "0.7399419", "0.7386269", "0.73861593", "0.73861593", "0.73776186", "0.7369708"...
0.85975605
0
Public interface functions ////////////////////////////////////////////////////////////////////////// addLine() add text to the terminal at the current position and seek to a new line
function addLine(text,className) { var line = new TerminalLine(className); line.addText(text); line.finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insertLine(text) {\n if (this.$el.is(':focus')) {\n const value = this.el.value;\n const cursor = this.el.selectionEnd;\n const endOfLine = value.indexOf('\\n', cursor);\n\n if (endOfLine === -1) {\n // The cursor is on the last line.\n ...
[ "0.6911211", "0.6909513", "0.68435156", "0.68157804", "0.6663016", "0.64953685", "0.6349714", "0.62891316", "0.61851865", "0.617578", "0.6100065", "0.60987604", "0.6079738", "0.600027", "0.5979799", "0.5978089", "0.59593534", "0.59223354", "0.5887814", "0.5869094", "0.5868632...
0.72024626
0
newLine() creates a new TerminalLine object and returns it to the user
function newLine(className) { var line = new TerminalLine(className); return line; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newLine() {\n startofLine = true;\n\n logBody.push(\"newLine\")\n logBody.push(`startofLine -> ${startofLine}`)\n }", "function newLine() {\r\n return document.createElement('br');\r\n }", "function addLine(text,className) {\n var line = new Termi...
[ "0.7223601", "0.71173185", "0.6941963", "0.67639965", "0.67639965", "0.67203665", "0.6676123", "0.65806705", "0.65780306", "0.634506", "0.6293305", "0.626928", "0.6233143", "0.6232506", "0.62250316", "0.6212043", "0.62116677", "0.62104577", "0.61786443", "0.6167106", "0.61671...
0.81622565
0
inputMode() sets the terminal to input mode; the callback is called once the user has finished input; the terminal behaves canonically and returns input after the user has finished entering a line
function inputMode(callback) { imode = true; imodeCb = callback; // reset the state of the input line itext = ""; ipos = 0; ispanBefore.data = ""; ispanAfter.data = ""; cursorText.data = " "; // add the input line span to the terminal screen ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function input(callback) {\n\t\t\t\n\t\t\toutputDisplay.focus();\n\t\t\toutputDisplay.onkeypress = function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\toutputDisplay.onkeypress = function() { };\t\t\t\t\t\n\t\t\t\tcallback(event.charCode);\n\t\t\t}\n\t\t}", "function endInputMode() {\n if (imode) {...
[ "0.612807", "0.59486425", "0.56701535", "0.5555064", "0.5550383", "0.55422115", "0.53755385", "0.5336325", "0.5317868", "0.5284158", "0.5280392", "0.5200988", "0.5162571", "0.5116363", "0.5101963", "0.5090834", "0.50772375", "0.50720704", "0.5061813", "0.504848", "0.50352347"...
0.76647735
0
endInputMode() return the input gathered from the terminal thus far and keep the input echoed in the terminal
function endInputMode() { if (imode) { imode = false; termDiv.removeChild(ispan); addLine(itext,'terminal-input'); return itext; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function end() {\n focusInput();\n updateInput = true;\n move(); up();\n }", "function end() {\n focusInput();\n updateInput = true;\n move(); up();\n }", "function endTextEntry () {\n if (state.textInput) {\n state.textInput.abort()\n state.textInput ...
[ "0.6930363", "0.6930363", "0.6725385", "0.65563047", "0.6010866", "0.6010866", "0.597455", "0.5960916", "0.5960916", "0.5929141", "0.5884743", "0.57763845", "0.5696237", "0.56873435", "0.5648917", "0.560222", "0.55584615", "0.552268", "0.5517914", "0.5517914", "0.5487466", ...
0.8113609
0
cancelInput() cancels input mode (if on) and returns whatever input the user has specified
function cancelInput() { if (imode) { // exit input mode by toggling the flag and removing the input line // element from the terminal screen imode = false; termDiv.removeChild(ispan); return itext; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelInput() {\n this.closeSettings();\n }", "handleCancel() {\n this.cancel = true;\n this.changeScreen('screen-input');\n }", "function cancel() {\n gotoReturnState();\n }", "cancel() {\n this._revertInputValueToValue(); // In the next _detectAndDispatchChange() call, the change dete...
[ "0.7333762", "0.6857248", "0.6735127", "0.66958195", "0.6618319", "0.6444973", "0.63879204", "0.63630193", "0.62142444", "0.6164419", "0.61565226", "0.61523575", "0.61523575", "0.60535777", "0.6037322", "0.60188264", "0.60188264", "0.60188264", "0.6015544", "0.5991945", "0.59...
0.8379788
0
Fetches an API response and normalizes the result JSON according to schema. This makes every API response have the same shape, regardless of how nested it was.
function callApi(endpoint, option, schema) { const fullUrl = (endpoint.indexOf(API_ROOT) === -1) ? API_ROOT + endpoint : endpoint; return fetch(fullUrl, option) .then(response => { if (response.status === 204) { return { json: undefined, response: response }; } return response.json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flattenResponse(fullResponse, responseSpec) {\n var _a, _b;\n const parsedHeaders = fullResponse.parsedHeaders;\n // head methods never have a body, but we return a boolean set to body property\n // to indicate presence/absence of the resource\n if (fullResponse.request.method === \"HEAD\")...
[ "0.62359923", "0.6132798", "0.5983695", "0.5475439", "0.54231715", "0.53708655", "0.534179", "0.52611065", "0.5242166", "0.5211305", "0.5182607", "0.51583666", "0.5156469", "0.50958407", "0.50918096", "0.5087023", "0.50448394", "0.5042274", "0.5029611", "0.5027434", "0.502373...
0.6421155
0
Called form calling code when it's resetting its transport
resetTransport(){ //For loading loops on-the-fly, see below this.nextLoopStartBeat = 0; this.newLoopState(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transportReset(){\n this.transportState = 'stop'; //others: 'play'\n this.beatClick.nextPerfBeat = 0;\n console.log('Transport stopped and reset');\n //reset/re-init some framework stuff to clear lists\n // of MX and VX objects (and whatever else)\n this.VXmanager.reset();...
[ "0.78186566", "0.661344", "0.6542739", "0.65192384", "0.64457786", "0.64144427", "0.63856345", "0.6315777", "0.628542", "0.6278983", "0.62407887", "0.6218655", "0.6212156", "0.62110674", "0.6190869", "0.61896586", "0.6176195", "0.61750865", "0.61303276", "0.6123506", "0.61039...
0.7519997
1
Calling func calls this and gets the next note in the loop. If calling func uses it, it should then call usedTheNote() to advance the internal index
checkNextNote(){ var ind = this.nextNoteNum * 2; //Get the note ( beat time and instrument number ); var note = this.currentLoop.notes.slice( ind, ind+2 /*non-inclusive*/ ); //Increment beat for the loop # we're on note[0] += this.startBeat + ( this.loopCount * this.currentLoop.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "usedTheNote(){\n this.nextNoteNum++;\n if( this.nextNoteNum * 2 >= this.currentLoop.notes.length ){\n this.loopCount++;\n this.nextNoteNum = 0;\n //cache this so we can load new loop while parent transport is still going,\n // and we'll get the beat timing ...
[ "0.67797977", "0.6323986", "0.604354", "0.5860007", "0.5767684", "0.5440674", "0.5422045", "0.54206556", "0.5415429", "0.54050183", "0.5403832", "0.53699106", "0.5343856", "0.53401583", "0.5306408", "0.52799565", "0.5279399", "0.5225239", "0.5214481", "0.52114034", "0.5201962...
0.67230415
1
Create home button, direct to playlist page with history
function HomeButton(){ let history = useHistory(); function handleClick() { history.push("/playlists"); } return ( <BsHouseFill type="button" className="home-button" onClick={handleClick}></BsHouseFill> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function angryPlaylist() {\n window.location.href = \"angryPlaylist.html\"\n}", "function setup(){\r\n document.getElementById('backButton').setAttribute('href', '/home/' + thisUser.id);\r\n\r\n}", "processGoHome() {\n window.todo.model.goHome();\n }", "static goToHome() {\n browser.refr...
[ "0.67761433", "0.66749763", "0.6304955", "0.6238386", "0.6222275", "0.6183153", "0.6141272", "0.61232084", "0.61162096", "0.60957867", "0.6046517", "0.60387325", "0.6038672", "0.60305333", "0.60052675", "0.6000088", "0.5997751", "0.5978016", "0.5962183", "0.5955509", "0.59530...
0.6711499
1
handle forms in a manner similar to bodyparser
function bodyParser(e) { var el = e.target, form = el, nodeName = el.nodeName, keycode = (e.keyCode ? e.keyCode : e.which), link, proto, path, orig, body = {}, submitAdded, i, l, control; if (e.type === 'keypress') { if (keycode === 13) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FormBodyParser() {\n\t}", "formParser(req, res, next) {\n\t\tif(['POST','PATCH'].indexOf(req.method)==-1) { next(); return }\n\t\tvar ct = req.get('content-type') || ''\n\t\tswitch (ct) {\n\t\tcase 'application/json':\n\t\t\treq.setEncoding('utf8')\n\t\t\tvar data = ''\n\t\t\treq.on('data', function(chu...
[ "0.7792735", "0.69171405", "0.6719666", "0.63923633", "0.635001", "0.63328624", "0.6254653", "0.6172463", "0.6146612", "0.6120304", "0.61154807", "0.6097344", "0.6004251", "0.5901508", "0.5892024", "0.58759063", "0.587426", "0.5845681", "0.5768246", "0.5753548", "0.5747207", ...
0.70699304
1
Implements the PouchDB API for dealing with CouchDB instances over HTTP
function HttpPouch(opts, callback) { // The functions that will be publicly available for HttpPouch var api = this; api.getHost = opts.getHost ? opts.getHost : getHost; // Parse the URI given by opts.name into an easy-to-use object var host = api.getHost(opts.name, opts); // Generate the database URL base...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HttpPouch(opts, callback) {\n // The functions that will be publicly available for HttpPouch\n var api = this;\n\n // Parse the URI given by opts.name into an easy-to-use object\n var getHostFun = getHost;\n\n // TODO: this seems to only be used by yarong for the Thali project.\n // Verify whether o...
[ "0.719548", "0.7121671", "0.70794916", "0.6950341", "0.68232334", "0.6817106", "0.6803468", "0.68031555", "0.6792288", "0.6750207", "0.6740128", "0.6728266", "0.6704459", "0.62006915", "0.6023865", "0.57878196", "0.5762086", "0.573143", "0.5696738", "0.55466336", "0.5507667",...
0.73045546
0
TODO: check CouchDB's replication id generation Generate a unique id particular to this replication
function genReplicationId(src, target, opts) { var filterFun = opts.filter ? opts.filter.toString() : ''; return src.id().then(function (src_id) { return target.id().then(function (target_id) { var queryData = src_id + target_id + filterFun + JSON.stringify(opts.query_params) + opts.doc_ids; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genReplicationId(src, target, opts) {\n var filterFun = opts.filter ? opts.filter.toString() : '';\n return src.id().then(function (src_id) {\n return target.id().then(function (target_id) {\n var queryData = src_id + target_id + filterFun +\n JSON.stringify(opts.query_params) + opts.doc_...
[ "0.69551015", "0.69294417", "0.69191164", "0.6886713", "0.6872798", "0.68451357", "0.6840625", "0.6797022", "0.6797022", "0.67628944", "0.6756228", "0.6749239", "0.6744815", "0.6729848", "0.6726228", "0.6724636", "0.67153525", "0.6692319", "0.66843355", "0.66751546", "0.66744...
0.70203483
0
Check user permissions for existing invitation
function canManageInvitation(context, invitation) { if (context.isStaff) { return true; } if (!context.isOwner) { return false; } if (invitation.project_role) { return true; } if (invitation.customer_role) { return ENV.OWNERS_CAN_MANAGE_OWNERS; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkPermission(idUser) {\n const profileName = Roles.getScopesForUser(idUser)[0];\n return Roles.userIsInRole(idUser, this._permissions, profileName);\n }", "function hasPermissions(user) {\r\n if(user.status == 'admin') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}"...
[ "0.6664679", "0.6277318", "0.61503613", "0.59813845", "0.59496754", "0.5865564", "0.58574003", "0.5827332", "0.576801", "0.5755967", "0.57543135", "0.57398635", "0.56689626", "0.56629694", "0.56617844", "0.5631305", "0.5607511", "0.5604757", "0.55984175", "0.55933976", "0.558...
0.6617987
1
onRequestClosed handles a failed request
function onRequestClosed () { stats.dec(TRACKERS.OPEN_REQUESTS); // Increase number of abruptly closed reqs stats.inc(TRACKERS.TOTAL_REQ_ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCloseRequest(msg) {\n if (this._promise) {\n this.reject();\n }\n super.onCloseRequest(msg);\n }", "function onRequestFailure(msg)\n{\n $(\"#dialog-message\").dialog( \"destroy\" );\n \n switch (msg.status) {\n case 403:\n // 403 specific handler\n ...
[ "0.684952", "0.6583691", "0.65677345", "0.65677345", "0.6374594", "0.6291135", "0.62604916", "0.6212266", "0.60322326", "0.6000405", "0.5908764", "0.5899645", "0.5890782", "0.58864015", "0.5871481", "0.58126694", "0.5793862", "0.5765785", "0.57202977", "0.57007366", "0.569223...
0.7466511
0
add gravitanional force to make the ball fall
gravity(force) { this.ay += force }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply_gravity(){\r\n for (let b = 0; b < balls.length; b++){\r\n balls[b].vy += gravity * time_delta_s;\r\n }\r\n}", "apply_gravity_and_friction(frame_delta, gravity_const, bounce_factor, friction_factor, is_doge, boink_audio) {\n var ball_on_floor_pos = FLOOR_Y_POS + this.radius;\n ...
[ "0.72546047", "0.697927", "0.6976938", "0.69630396", "0.68383014", "0.6824431", "0.6522747", "0.65069145", "0.6480381", "0.64230514", "0.6399228", "0.6385542", "0.638132", "0.63680845", "0.632666", "0.6302617", "0.62909186", "0.62790686", "0.62443405", "0.62341845", "0.621840...
0.74738187
0
===== Make the balls bounce from the paddle =====
bounce(paddle) { //if (ball is within the left edge of the paddle and the right edge of the paddle) {bounce} if (this.x > paddle.x - paddle.width / 2 && this.x < paddle.x + paddle.width / 2 && this.y + this.size / 2 > paddle.y - paddle.height / 2 && this.y - this.size / 2 < paddle.y + paddle....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameBounce(state) {\r\n if (!state) {\r\n return;\r\n }\r\n\r\n for (let ball of state.balls) {\r\n var bax = ball.pos.x;\r\n var bay = ball.pos.y;\r\n var rad = ball.rad;\r\n\r\n // Rebonds sur les bords horizontaux\r\n if (bay + rad + ball.vel.y > BOARD_HEIGHT || bay - rad + ball.ve...
[ "0.87263453", "0.8439575", "0.801316", "0.792238", "0.7876835", "0.776819", "0.77628976", "0.77601624", "0.775621", "0.7711028", "0.76715505", "0.7670115", "0.76176167", "0.7544496", "0.75026417", "0.7486232", "0.7462095", "0.7410768", "0.74029315", "0.74019206", "0.7395525",...
0.8539313
1
===== Make the balls bounce back from the X walls ======
wallBounce() { if (this.x >= width || this.x <= 0) { this.vx = -this.vx } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bouncing_ball() {\n\n\tdraw_briques();\n\n\tfor(j=0;j<balls_lost.length;j++) {\n\t\tif (x[j] + dx[j] > WIDTH || x[j] + dx[j] < 0)\n\t\t\tdx[j] = -dx[j];\n\t\tif (y[j] + dy[j] > HEIGHT || y[j] + dy[j] < 0)\n\t\t\tdy[j] = -dy[j];\n\t}\n\tdraw_ball_or_balls();\n}", "function handleWallBounces() {\n if (...
[ "0.776721", "0.753609", "0.7490269", "0.7466629", "0.73805", "0.73798263", "0.7329035", "0.7292254", "0.7263409", "0.72544765", "0.71362144", "0.71359676", "0.7122404", "0.7100247", "0.70952004", "0.70701283", "0.7043726", "0.7035687", "0.70196146", "0.70149827", "0.70110804"...
0.75644475
1
Agregar productos al ticket con la computadora seleccionada
function addProductToTicket() { var idProducto = parseInt($('#sProductos').val()); var nombre = $('#sProductos option:selected').text(); var cantidad = parseInt($('#iCantidad').val()); var precio = parseFloat($('#iPrecio').val()); var total = parseFloat($('#iTotal').val()); if (_idComputadora =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agregar_producto_mi_ticket(ps){\n\t// validar que el producto no exista en el ticket seleccionado \n\t// y de ser asu amrle las cantidades necesarias\n\tconsole.log(ps);\n\tvar agregar=true;\n\tvar pos=0;\n\n\t\n\tconsole.log(document.getElementById(\"selTipoVentaFactura\").value);\n\n\tif(document.getEle...
[ "0.72371477", "0.66625243", "0.6555849", "0.6513834", "0.6464254", "0.6461287", "0.6443414", "0.64234835", "0.6353551", "0.63435155", "0.6326414", "0.62878245", "0.6213604", "0.62073094", "0.61914754", "0.61898726", "0.6151578", "0.6142112", "0.6127963", "0.61237437", "0.6088...
0.75291413
0
Ajax call to get the desktop info data
function getDesktopByName(client) { var desktop = { idComputadora: 0, IP: client.sock.address().address, nombre: client.data.hostname, costoRenta: 0, enLinea: false } var url = apiURL + 'api/Desktop/getDesktopByName'; $.ajax({ url: url, type: "POS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProfile() {\n $.ajax({\n method: 'post', url: \"https://ewserver.di.unimi.it/mobicomp/mostri/getprofile.php\",\n data: JSON.stringify({session_id: session_id}),\n dataType: 'json',\n success: function (result) {\n console.log(result);\n showProfileIn...
[ "0.6615507", "0.64924693", "0.6445974", "0.60660034", "0.6019018", "0.6002922", "0.59295756", "0.58719134", "0.5831103", "0.5831025", "0.5827776", "0.57798415", "0.57738084", "0.5772745", "0.57595193", "0.57421845", "0.57070136", "0.57056636", "0.57039636", "0.5702822", "0.56...
0.6794988
0
Will return true if all user input is valid
function isAllValid(){ return ( BILL_REGEX.test(billInput.value) && (NUM_REGEX.test(customPercent.value) || document.querySelector('input[name="tip-amount"]:checked')) && NUM_REGEX.test(numPeople.value) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allValid(inputs, ignoreInvalid){\n\tconsole.log('Ignore invalid set to: ' + ignoreInvalid);\n\tif(ignoreInvalid) {\n\t\tconsole.log('allValid: returning [ true ]');\n\t\treturn true;\n\t}\n\tconsole.log('AllValid: Performing Checks');\n let valid = true;\n\tinputs.map(e => {\n\t\t/*\n\t\t* Sweeps the...
[ "0.7341929", "0.73025787", "0.72940576", "0.7011774", "0.7008682", "0.70014364", "0.69903815", "0.6966988", "0.6956309", "0.69519615", "0.69482374", "0.6936851", "0.68980086", "0.68715495", "0.6849062", "0.6849062", "0.68224716", "0.6817179", "0.6816749", "0.678754", "0.67873...
0.73635924
0
Checks each button object to see if key is valid. This function will only be called by the alert, confirm, and prompt helpers.
function validateButtons(options, buttons) { var allowedButtons = {}; each(buttons, function (key, value) { allowedButtons[value] = true; }); each(options.buttons, function (key) { if (allowedButtons[key] === undefined) { throw new Error('button key "' + key + '" is not allowed (opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateButtons(options, buttons) {\r\n var allowedButtons = {};\r\n each(buttons, function (key, value) {\r\n allowedButtons[value] = true;\r\n });\r\n\r\n each(options.buttons, function (key) {\r\n if (allowedButtons[key] === undefined) {\r\n throw new Error('button key \"' ...
[ "0.6597815", "0.6368732", "0.60678697", "0.6028222", "0.59198296", "0.585227", "0.5789268", "0.57807386", "0.57714975", "0.57619953", "0.57441825", "0.57371914", "0.57091385", "0.57046413", "0.5677661", "0.56504816", "0.56478953", "0.56401736", "0.56368643", "0.5627571", "0.5...
0.6554782
1
Get localized text from a locale. Defaults to 'en' locale if no locale provided or a nonregistered locale is requested
function getText(key, locale) { var labels = locales[locale]; return labels ? labels[key] : locales.en[key]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getText(key, locale) {\r\n var labels = locales[locale];\r\n\r\n return labels ? labels[key] : locales.en[key];\r\n }", "function getLocaleText(locale = \"DE\") {\n return {\n days_narrow: [...Array(7).keys()].map((day) =>\n new Intl.DateTimeFormat(locale, { weekday: \"narrow...
[ "0.71609133", "0.66976714", "0.6354048", "0.62476766", "0.61828804", "0.6164143", "0.60297596", "0.6005159", "0.59445494", "0.59096134", "0.59005475", "0.5898698", "0.5893867", "0.5884608", "0.58801126", "0.5829103", "0.57809395", "0.5774769", "0.57205504", "0.57125026", "0.5...
0.72063196
0
Tiny wrapper function around jQuery.each; just adds index as the third parameter
function each(collection, iterator) { var index = 0; $.each(collection, function (key, value) { iterator(key, value, index++); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function each(collection, iterator) {\r\n var index = 0;\r\n $.each(collection, function (key, value) {\r\n iterator(key, value, index++);\r\n });\r\n }", "function myForEach(arr, callback) {\n for (var i = 0; i < arr.length; i++) {\n // I don't feel like providing the index today\n ...
[ "0.69257206", "0.66692674", "0.6511509", "0.6411849", "0.63625515", "0.63463163", "0.6285529", "0.6270959", "0.6270959", "0.6268264", "0.62492275", "0.62279904", "0.62058306", "0.6182599", "0.6164474", "0.609383", "0.60691726", "0.6038994", "0.5972269", "0.5969444", "0.596067...
0.69662696
0
Validate `min` and `max` values based on the current `inputType` value
function minAndMaxAreValid(type, min, max) { var result = false; var minValid = true; var maxValid = true; if (type === 'date') { if (min !== undefined && !(minValid = dateIsValid(min))) { console.warn('Browsers which natively support the "date" input type expect date values to be of the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minAndMaxAreValid(type, min, max) {\r\n var result = false;\r\n var minValid = true;\r\n var maxValid = true;\r\n\r\n if (type === 'date') {\r\n if (min !== undefined && !(minValid = dateIsValid(min))) {\r\n console.warn('Browsers which natively support the \"date\" input type expe...
[ "0.7793956", "0.727797", "0.69144523", "0.6729834", "0.6695516", "0.6657328", "0.6619847", "0.66186017", "0.6608212", "0.65326625", "0.6527764", "0.64695334", "0.6463501", "0.64463377", "0.64386576", "0.64076257", "0.64075124", "0.63950634", "0.632854", "0.63086134", "0.62918...
0.7774958
1
questo metodo genera 3 liste: lista delle coordinate sull'asse x degli stop lista delle coordinate sull'asse y delle linee della metro lista delle intersezioni
function generateCoords(dict){ // coords= linea: valori stop (es lineaA: 1800, 1820, 1825) let coords=[]; // xcoords= <linea:coordinate X degli stop> (es <lineaA: [0, 2, 3]>) let xcoords=[]; // ycoords= <linea:coordinate Y delle linee> (es <lineaA:0>) let ycoords=[]; // intersections= <coordinata X di uno stop:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcDirectionCoordsForTraitor(lat1, lon1, lat2, lon2) {\n //Line will be around 1000m long or something\n const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2);\n return ([{\n latitude: lat2 + ((lat1 - lat2) * multiplier),\n longitude: lon2 + ((lon1 - lon2) * multiplier)\n },\n ...
[ "0.6331906", "0.62757796", "0.62424135", "0.6216871", "0.6143505", "0.61382085", "0.60782677", "0.6055676", "0.60317665", "0.5987669", "0.59246814", "0.5907291", "0.58902675", "0.5876325", "0.5871612", "0.58684003", "0.58503115", "0.5832087", "0.58317", "0.5819194", "0.581367...
0.6700089
0
Inside the file, write a function named echo that takes 2 arguments: a stringa nd a number It should print out the string, number number of times
function echo(str,num){ for(var i = 0; i < num; i++){ console.log(str); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function echo (stringInput, num){\n for(var i = 0; i < num; i++){\n console.log(stringInput + \", \" + (i+1));\n }\n}", "function echo(strg, num){\n for (var i = 0; i < num; i++ ){\n console.log(strg);\n }\n}", "function printFruit(i){\n console.log(`I want to eat a ${i}`);\n}", ...
[ "0.71754414", "0.7107464", "0.6555895", "0.6319752", "0.6155433", "0.61223555", "0.59831583", "0.5900614", "0.58633095", "0.58500534", "0.582574", "0.5805075", "0.57240045", "0.5720816", "0.56837106", "0.5673198", "0.56356204", "0.56246424", "0.5620843", "0.55997974", "0.5578...
0.72047514
0
adds a new line every n chars
function addNewlines (str, n) { var arr = str.split(' ') var chunks = _.chunk(arr, n) var strings = chunks.map(function (c) { return c.join(' ') }) return strings.join('\n') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function putlines(n) {\n if (isNaN(n))\n n = 1;\n for (var index = 0; index < n; ++index)\n document.write(\"<br/>\");\n}", "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "function makeLine(length) {\n va...
[ "0.674074", "0.6694808", "0.6694808", "0.6692865", "0.66256547", "0.66221386", "0.66171885", "0.6565986", "0.6521977", "0.6485584", "0.647574", "0.645788", "0.6421128", "0.64023834", "0.6311064", "0.6298156", "0.62647444", "0.6211315", "0.61976504", "0.6168125", "0.611926", ...
0.7612021
0
Process the network inputs we have received since the last time the game loop was processed.
function processInput() { // // Double buffering on the queue so we don't asynchronously receive inputs // while processing. let processMe = inputQueue; inputQueue = []; for (let inputIndex in processMe) { let input = processMe[inputIndex]; let client = activeClients[input.clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processInput(elapsedTime) {\n //\n // Start with the keyboard updates so those messages can get in transit\n // while the local updating of received network messages are processed.\n myKeyboard.update(elapsedTime);\n //\n // Double buffering on the queue so we don't asynchronously receiv...
[ "0.7093181", "0.6018039", "0.6002971", "0.58744603", "0.58399194", "0.58018684", "0.5754077", "0.5643196", "0.5598085", "0.5577742", "0.5552283", "0.5509559", "0.5484797", "0.54603034", "0.54528815", "0.5449755", "0.5443666", "0.5443666", "0.5374343", "0.5374343", "0.5374343"...
0.7221092
0
Send new information about UFOs to the clients
function updateClientsAboutUFOs(elapsedTime){ //New UFO if(ufosHandler.newUFOs.length){ for(let id in ufosHandler.newUFOs){ if (ufosHandler.newUFOs[id] in ufosHandler.ufos){ let currNewUFO = ufosHandler.ufos[ufosHandler.newUFOs[id]]; transmitMessageToAllClient...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function informNewClientAboutExistingUFOs(clientSocket){\n let fos = ufosHandler.ufos;\n for (let key in fos){\n let currFos = fos[key];\n clientSocket.emit('message', {\n type: \"ufo-new\",\n message: currFos.state\n })\n }\n}", "function editInfo() {\n io....
[ "0.73785925", "0.6028753", "0.5820167", "0.57836425", "0.5722819", "0.5686082", "0.5660774", "0.5648054", "0.5646622", "0.56271183", "0.5618752", "0.560285", "0.55698794", "0.5566229", "0.5508442", "0.5500264", "0.54926026", "0.5450632", "0.545", "0.5444836", "0.54417044", ...
0.7319582
1
Generic function used to send messages to all clients
function transmitMessageToAllClients(message, type){ for (let clientId in activeClients) { let client = activeClients[clientId]; client.socket.emit('message', { type: type, message: message } ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendToAllClients(msg){\n wss.clients.forEach(d => d.send(JSON.stringify(msg)))\n}", "function sendAll(obj) {\n clients.forEach((client) => {\n send(client, obj);\n })\n}", "function sendAll(content){\n //show what is happening\n console.log(\"Send All!\");\n\n //loop through every cli...
[ "0.799901", "0.75909936", "0.75540644", "0.7462868", "0.7266195", "0.72310174", "0.71166474", "0.705295", "0.70142305", "0.6974504", "0.6898716", "0.6892769", "0.67753845", "0.6742497", "0.6663717", "0.657363", "0.65718025", "0.65718025", "0.65694267", "0.6541868", "0.6533575...
0.7663356
1
Transmits messages of all current asteroids to the provided clientSocket
function informNewClientAboutExistingAsteroids(clientSocket){ let messageGroup = {}; let i = 0; let rocks = asteroidsHandler.asteroids; for( let key in rocks ){ let currRock = rocks[key]; let message = { asteroidState: currRock.state, key: key } m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMessages() {\n setTimeout(sendMessages,1000);\n for(var i=0; i<socket.sockets.clients().length; i++) {\n var sock = socket.sockets.clients()[i];\n if(sock) {\n var client = clientMap[sock.sessId];\n logger.debug('Client with sessid: ' + sock.sessId + ' with st...
[ "0.67246807", "0.6693886", "0.64760596", "0.64392877", "0.639129", "0.63238424", "0.6295643", "0.6144187", "0.61390984", "0.61169523", "0.6111529", "0.6098597", "0.6093443", "0.606215", "0.6045065", "0.6013127", "0.60088927", "0.6004483", "0.59966123", "0.5995063", "0.5989349...
0.69464254
0
Transmits messages of all current Missiles to the provided clientSocket
function informNewClientAboutExistingMissiles(clientSocket){ let missiles = missilesHandler.missiles; for (let key in missiles){ let currMissiles = missiles[key]; let message = { state:currMissiles.state, owner:currMissiles.owner, clientID:currMissiles.clientI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMessages() {\n setTimeout(sendMessages,1000);\n for(var i=0; i<socket.sockets.clients().length; i++) {\n var sock = socket.sockets.clients()[i];\n if(sock) {\n var client = clientMap[sock.sessId];\n logger.debug('Client with sessid: ' + sock.sessId + ' with st...
[ "0.67417634", "0.62749785", "0.60436916", "0.5971933", "0.5938618", "0.5936252", "0.5857152", "0.58341795", "0.5794987", "0.5758341", "0.56912035", "0.5690015", "0.5683783", "0.5662154", "0.5633936", "0.56147474", "0.5611383", "0.5604636", "0.5593268", "0.5582414", "0.5570077...
0.68240637
0
Notifies the already connected clients about the arrival of this new client. Plus, tell the newly connected client about the other players already connected.
function notifyConnect(socket, newPlayer) { for (let clientId in activeClients) { let client = activeClients[clientId]; if (newPlayer.clientId !== clientId) { // // Tell existing about the newly connected player client.socket.emit('message'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleConnectedClient(clients) {\n let client;\n\n if (!is_page_in_view && clients.length > 0) {\n // play message notification sound\n sound.play();\n }\n\n // iterate through the list\n for (let i = 0; i < clients.length; i++) {\n clien...
[ "0.6651602", "0.6169089", "0.6134154", "0.61313266", "0.6115673", "0.59911984", "0.59862596", "0.5943724", "0.5909946", "0.5884768", "0.5884574", "0.58800143", "0.58758277", "0.5857499", "0.58433056", "0.5842854", "0.58013266", "0.57964015", "0.5792674", "0.5750605", "0.57423...
0.70014894
0
Notifies the already connected clients about the disconnect of another client.
function notifyDisconnect(playerId) { for (let clientId in activeClients) { let client = activeClients[clientId]; if (playerId !== clientId) { client.socket.emit('message', { type: 'disconnect-other', clientId: playerId ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "function handleClientDisconnection(socket) {\n socket.on(\"disconnect\", func...
[ "0.72969794", "0.7137123", "0.7104798", "0.7038366", "0.6946217", "0.6926507", "0.67627573", "0.6741016", "0.67343247", "0.6718421", "0.6641816", "0.6600093", "0.65693784", "0.6561334", "0.6559702", "0.65483034", "0.6533827", "0.6533827", "0.6533827", "0.6533827", "0.6521368"...
0.72513497
1
Receives a set of messages from our message manager, maps each to a handler, and passes the results to our message callbacks.
receiveMessage({data, target}) { data.forEach(msg => { if (msg) { let handlers = Array.from(this.getHandlers(msg.messageName, msg.sender || null, msg.recipient)); msg.target = target; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleMessages(messages) {\n\n }", "processMessages() {\n if (this._currentlyProcessing) {\n // Prevent bloating the call stack.\n return;\n }\n this._currentlyProcessing = true;\n while (this._messageQueue.size > 0) {\n let [sender, descriptor, body, target] = this._messageQueue.de...
[ "0.68416333", "0.68255913", "0.68043566", "0.672113", "0.64172363", "0.63599885", "0.62043375", "0.61434245", "0.60395795", "0.5940846", "0.58901143", "0.58754504", "0.5806244", "0.575701", "0.5730557", "0.5721759", "0.57205653", "0.5713378", "0.57123405", "0.57106453", "0.57...
0.69940656
0
Schedules a new idle callback to dispatch pending lowpriority messages, if one is not already scheduled.
scheduleIdleCallback() { if (!this.idleScheduled) { ChromeUtils.idleDispatch(this.onIdle, {timeout: LOW_PRIORITY_TIMEOUT_MS}); this.idleScheduled = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onIdle (callback) {\n\t\tif (Object.keys (this.taskMap).length <= 0) {\n\t\t\tsetImmediate (callback);\n\t\t\treturn;\n\t\t}\n\t\tthis.statusEventEmitter.once (IdleEvent, callback);\n\t}", "schedule_idle() {\n\t\tclearTimeout(this.idle_timer); // question: can this ever be alive?\n\t\tif (this.idle_timeout >= 0 ...
[ "0.6224156", "0.59151864", "0.5804115", "0.5486098", "0.5437182", "0.54168135", "0.54168135", "0.5385195", "0.5385195", "0.5374733", "0.52589834", "0.51362294", "0.5110288", "0.5099204", "0.5071227", "0.50504553", "0.5047847", "0.49978387", "0.49574623", "0.49574623", "0.4940...
0.7685612
0
Cleans up after this message once we've received or aborted a response.
cleanup() { if (this.broker) { this.broker.removeHandler(String(this.channelId), this); MessageChannel.pendingResponses.delete(this); this.message = null; this.broker = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanup() {\n res.removeListener('finish', makePoint);\n res.removeListener('error', cleanup);\n res.removeListener('close', cleanup);\n }", "function handleFinish(_event) {\n cleanup(null, responseData)\n }", "destroy() {\n this._service.destroy();\n this._sent...
[ "0.63807476", "0.63596743", "0.6265467", "0.6256771", "0.62322795", "0.6151946", "0.6114827", "0.6109647", "0.6090182", "0.60351384", "0.60270786", "0.5984577", "0.5920132", "0.590946", "0.5902058", "0.5902058", "0.5902058", "0.58920646", "0.5877619", "0.5877619", "0.5877619"...
0.753348
0
Start:/bitrix/js/main/ajax.js Bitrix AJAX library ver 6.5 alpha / private CAjaxThread class description of current AJAX request thread.
function CAjaxThread(TID) { this.TID = TID; this.httpRequest = this._CreateHttpObject(); this.arAction = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CurrentThread() {\r\n}", "function getThread() { \n var id = this.get('id').toInt(); // ID of thread chosen\n if($(id+'editThreadForm') == null) { // If the thread title isn't being edited\n var open = this.get('open'); // Thread open status\n if (open == 'false') { // If the thread...
[ "0.6882548", "0.6396779", "0.57924867", "0.57324916", "0.56972694", "0.55863726", "0.5582882", "0.55747235", "0.55439144", "0.5515516", "0.54737353", "0.5472693", "0.54590285", "0.54564834", "0.54446304", "0.54131323", "0.53986144", "0.53753793", "0.5365049", "0.5364801", "0....
0.70055544
0
public CAjax main class
function CAjax() { this.arThreads = {}; this.obTemporary = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zXmlDom() {\n\n}", "jxon(){}", "function hello_world(params)\n{\n // we call this function from the php prospective as follow\n // inclucde 'cjax/cjax.php';\n // $CJAX->init(true);\n // $CJAX->hello_world('param1 here','param2 !');\n // and bellow is a how you would access these parame...
[ "0.6023745", "0.599963", "0.5956457", "0.5875189", "0.57410455", "0.5689651", "0.56394815", "0.5533278", "0.55173826", "0.5427216", "0.54218465", "0.53976834", "0.538857", "0.5388174", "0.5378222", "0.53530127", "0.53522426", "0.5339759", "0.5309424", "0.530275", "0.530275", ...
0.688919
0
Retrieve the describeCoverage response from remote or local server
function retrieveDescribeCoverage(serverIndex, coverageIndex) { Ti.API.info('availableCoverageWin.js - serverIndex: ' + serverIndex); Ti.API.info('availableCoverageWin.js - coverageIndex: ' + coverageIndex); showLoading(); //Verify if describeCoverage response is null for the server with index choosen var server...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retrieveDescribeCoverage(serverIndex, coverageIndex) {\n\tTi.API.info('WcsCoverageMetadata.js - serverIndex: ' + serverIndex);\n\tTi.API.info('WcsCoverageMetadata.js - coverageIndex: ' + coverageIndex);\n\n\t// activity indicator for entertainment\n\tvar indicatorStyle;\n\tif (Ti.Platform.name === 'iPhone...
[ "0.6021906", "0.56447846", "0.5468357", "0.523627", "0.5225494", "0.51496345", "0.5149336", "0.5107959", "0.50828046", "0.5063733", "0.50380105", "0.5026258", "0.50185984", "0.5017506", "0.50074524", "0.49914595", "0.49899915", "0.4973767", "0.49726236", "0.4972168", "0.49404...
0.5757413
1
Capture the keystroke and send it to the Pi API
function sendKeystroke(e) { console.log(e) fetch(`http://${server_addr}:8080/${e}`) .then(res => res.json()) .then((data) => { console.log(data) document.getElementById('temperature').innerHTML = `${data[0]} &deg;C` document.getElementById('direction').innerHTML = `${data[1]}` ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyPressed() {\n lastKeyPressed = key;\n\n sendChannel2();\n \n }", "sendKeyboard(data) {\n this.webSocket.send('k' + data);\n }", "function sendKey(key){ OimoWorker.postMessage({tell:\"KEY\", key:key}); }", "function keyPressed() {\n if (handler.active === handler.nameplate) {\n do...
[ "0.6835779", "0.6534537", "0.6411924", "0.6355083", "0.6285194", "0.6197327", "0.6196429", "0.6186901", "0.61583334", "0.6133102", "0.6130832", "0.6128799", "0.6075166", "0.6042757", "0.6042659", "0.60402036", "0.6031296", "0.6023514", "0.60193753", "0.60193753", "0.601863", ...
0.68612176
0
Adds some angular watchers to enable some degree of Fabric canvas integration.
function addWatchers() { addWatcherForNumericProperty('left'); addWatcherForNumericProperty('top'); addWatcherForNumericProperty('width'); addWatcherForNumericProperty('height'); addWatcherForNumericProperty('fontSize');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWatches() {\n scope.watcher = watchClass();\n }", "function addWatchers() {\n\t\t\t\tif (addWatchers.hasRun) { return; }\n\t\t\t\taddWatchers.hasRun = true;\n\n\t\t\t\tKEYS.forEach(function(key) {\n\t\t\t\t\tenquire.register(CONFIG[key].query, {\n\t\t\t\t\t\tmatch: _.throttl...
[ "0.6720057", "0.6034694", "0.58391374", "0.57531124", "0.5670495", "0.56488776", "0.5580704", "0.5488842", "0.54240227", "0.5407303", "0.5397864", "0.5339391", "0.53374594", "0.5334028", "0.53264034", "0.53104556", "0.53104556", "0.5300034", "0.52891934", "0.5285813", "0.5280...
0.6254196
1
Support method to angular 'watch' a Fabric object property.
function addWatcherForObjectProperty(objectProperty) { $scope.$watch('fabric.selectedObject.' + objectProperty, function(newVal) { $scope.fabric.setActiveObjectProperty(objectProperty, newVal); $scope.fabric.render(); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWatcherForStringProperty(objectProperty) {\n $scope.$watch('fabric.selectedObject.' + objectProperty, function(newVal) {\n if (typeof newVal === 'string' && newVal) {\n $scope.fabric.setActiveObjectProperty(objectProperty, newVal);\n ...
[ "0.63543177", "0.6191584", "0.61871165", "0.60279924", "0.6025443", "0.5908718", "0.5903858", "0.58020383", "0.58020383", "0.58020383", "0.58020383", "0.58020383", "0.5784169", "0.5784169", "0.5784169", "0.5784169", "0.5784169", "0.5784169", "0.57747465", "0.5770707", "0.5767...
0.68497103
0
Support method to angular 'watch' a Fabric object string property.
function addWatcherForStringProperty(objectProperty) { $scope.$watch('fabric.selectedObject.' + objectProperty, function(newVal) { if (typeof newVal === 'string' && newVal) { $scope.fabric.setActiveObjectProperty(objectProperty, newVal); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWatcherForObjectProperty(objectProperty) {\n $scope.$watch('fabric.selectedObject.' + objectProperty, function(newVal) {\n $scope.fabric.setActiveObjectProperty(objectProperty, newVal);\n $scope.fabric.render();\n });\n...
[ "0.650516", "0.6112416", "0.59353477", "0.56312865", "0.5577075", "0.5577075", "0.5577075", "0.5577075", "0.5577075", "0.5550113", "0.5550113", "0.5550113", "0.5550113", "0.5550113", "0.5550113", "0.5517901", "0.54989463", "0.5481563", "0.547301", "0.5397052", "0.53851885", ...
0.75461817
0
Support method to angular 'watch' a Fabric object numeric property.
function addWatcherForNumericProperty(objectProperty) { $scope.$watch('fabric.selectedObject.' + objectProperty, function(newVal) { if (typeof newVal === 'string' || typeof newVal === 'number') { $scope.fabric.setActiveObjectProperty(objectProperty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initWatchVal(){}", "function initWatchVal(){}", "function initWatchVal() {} // 16439", "function addWatcherForObjectProperty(objectProperty) {\n $scope.$watch('fabric.selectedObject.' + objectP...
[ "0.5903802", "0.5903802", "0.57901067", "0.57872003", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", "0.5781312", ...
0.7558186
0
Client action method that loads rule from the storage.
function loadRule(ruleId) { // Call the LoadRule MVC action declared in HomeController post("/LoadRule", JSON.stringify({ Data: ruleId }), ruleLoaded); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadRules() {\n console.log(\"Load rules\");\n api.storage.local.get(\"rules\", (data) => {\n var loaded = api.runtime.lastError ? [] : data[\"rules\"];\n if (!loaded) {\n loaded = [];\n }\n rules = loaded.filter(function (rule) {\n return rule.enabl...
[ "0.6287926", "0.5546045", "0.540242", "0.540242", "0.5341534", "0.5329103", "0.5325551", "0.5296293", "0.5247004", "0.51429653", "0.50396377", "0.5016256", "0.4989338", "0.49435586", "0.48870695", "0.48869812", "0.48787746", "0.48241827", "0.48138908", "0.47947833", "0.479478...
0.6405607
0
Handler of the successful loadRule() call
function ruleLoaded(ruleData) { // Load the rule into the Rule Area by passing json to the editor codeeffects.loadRule(ruleData); // Notify user that the rule was loaded $("#Info").text("Rule is loaded"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadRule(ruleId)\n{\n\t// Call the LoadRule MVC action declared in HomeController\n\tpost(\"/LoadRule\", JSON.stringify({ Data: ruleId }), ruleLoaded);\n}", "function ruleEvaluated(data)\n{\n\tif (data.isRuleEmpty) $(\"#Info\").text(\"The rule is empty\"); // The Rule Area was empty\n\telse if (!data.is...
[ "0.6872296", "0.6033315", "0.5956763", "0.56907815", "0.5675961", "0.5675961", "0.5642184", "0.56416166", "0.55561006", "0.553774", "0.5526026", "0.55217105", "0.54512995", "0.542573", "0.542573", "0.5295362", "0.5283456", "0.5274498", "0.52443194", "0.52163804", "0.5213089",...
0.743803
0
Client action method that deletes the current rule from the storage.
function deleteRule(ruleId) { // Call the DeleteRule MVC action declared in HomeController post("/DeleteRule", JSON.stringify({ Data: ruleId }), ruleDeleted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ruleDeleted()\n{\n\t// Let the editor know that there were no errors and\n\t// the rule of codeeffects.getRuleId() ID was deleted successfully\n\tcodeeffects.deleted(codeeffects.getRuleId());\n\n\t// Clear the Rule Area (we just deleted the rule,\n\t// there is no point of displaying it anymore)\n\tcodeef...
[ "0.6253581", "0.6220987", "0.5941568", "0.59380716", "0.58235234", "0.58088785", "0.575338", "0.5685811", "0.567824", "0.56274915", "0.5594135", "0.55640954", "0.5562279", "0.5559029", "0.5539431", "0.5531092", "0.5520252", "0.5500878", "0.55000496", "0.5487442", "0.54856837"...
0.6386325
0
Handler of the successful deleteRule() call
function ruleDeleted() { // Let the editor know that there were no errors and // the rule of codeeffects.getRuleId() ID was deleted successfully codeeffects.deleted(codeeffects.getRuleId()); // Clear the Rule Area (we just deleted the rule, // there is no point of displaying it anymore) codeeffects.clear(); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRule(ruleId)\n{\n\t// Call the DeleteRule MVC action declared in HomeController\n\tpost(\"/DeleteRule\", JSON.stringify({ Data: ruleId }), ruleDeleted);\n}", "function deleteRule(URL) {\n $.ajax({\n url: URL,\n type: 'DELETE',\n success: function() {\n ...
[ "0.7004219", "0.6766023", "0.6381805", "0.61407363", "0.6067214", "0.6057999", "0.5965007", "0.5963686", "0.58894217", "0.5766849", "0.57340366", "0.5695936", "0.5609626", "0.56043357", "0.5579638", "0.55569625", "0.5499336", "0.54988617", "0.5493331", "0.5485973", "0.5484513...
0.75169915
0
Client action method that saves the new or existing rule in the storage.
function saveRule(ruleData) { post("/SaveRule", JSON.stringify({ Data: ruleData }), ruleSaved); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(url, rules, data) {\n if (!url || url == \"\")\n return;\n\n if (rules) {\n elements.styles[url] = {};\n elements.styles[url]['_rules'] = rules;\n }\n else\n delete elements.styles[url];\n\t\t\n // if there is meta data, store it in the social object\n if...
[ "0.6026052", "0.59407824", "0.57849157", "0.57564956", "0.5728516", "0.5628067", "0.5551179", "0.5544423", "0.55422735", "0.55355775", "0.552275", "0.5514378", "0.54999125", "0.54431766", "0.5416812", "0.5400448", "0.53741425", "0.53686345", "0.53642714", "0.5316884", "0.5268...
0.6592682
0
Handler of the successful saveRule() call
function ruleSaved(data) { if (data.isRuleEmpty) $("#Info").text("The rule is empty"); // The Rule Area is empty else if (!data.isRuleValid) { // The rule is invalid. Pass the received invalid client data to the editor codeeffects.loadInvalids(data.clientInvalidData); // Notify user $("#Info").text("The rul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveRule(ruleData)\n{\n\tpost(\"/SaveRule\", JSON.stringify({ Data: ruleData }), ruleSaved);\n}", "save() {}", "async postSave () {\n\t}", "save() {\n }", "function saveRuleServerCall(projectId, repositoryId, shortDesc, ruleType){\t\r\n\t\r\n\t//alert('saveRuleServerCal : projectId ['+ projectI...
[ "0.735002", "0.6197831", "0.6020102", "0.5989912", "0.5949225", "0.59420323", "0.5832296", "0.5814721", "0.58097076", "0.57348275", "0.5719526", "0.56546104", "0.5646793", "0.564491", "0.5582631", "0.55116564", "0.55116165", "0.54946053", "0.54784924", "0.5468301", "0.5465945...
0.74838763
0
Function that handles the evaluation of the current rule
function evaluateRule() { $("#Info").text("Evaluating (6 second trial delay)..."); // The codeeffects.extract() method returns rule's data post("/EvaluateRule", JSON.stringify({ Data: codeeffects.extract() }), ruleEvaluated); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ruleEvaluated(data)\n{\n\tif (data.isRuleEmpty) $(\"#Info\").text(\"The rule is empty\"); // The Rule Area was empty\n\telse if (!data.isRuleValid)\n\t{\n\t\t// The rule is not valid, pass invalid data to the editor\n\t\tcodeeffects.loadInvalids(data.clientInvalidData);\n\n\t\t// Notify user\n\t\t$(\"#Inf...
[ "0.7019216", "0.6678325", "0.6678325", "0.65913975", "0.64135677", "0.63992214", "0.6360928", "0.6338785", "0.62550163", "0.6172782", "0.60984695", "0.6079482", "0.60582346", "0.60582346", "0.5966087", "0.5962271", "0.59198195", "0.58567744", "0.58451706", "0.58226275", "0.58...
0.67051804
1
Handler of the successful evaluateRule() call
function ruleEvaluated(data) { if (data.isRuleEmpty) $("#Info").text("The rule is empty"); // The Rule Area was empty else if (!data.isRuleValid) { // The rule is not valid, pass invalid data to the editor codeeffects.loadInvalids(data.clientInvalidData); // Notify user $("#Info").text("The rule is not vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateRule()\n{\n\t$(\"#Info\").text(\"Evaluating (6 second trial delay)...\");\n\t// The codeeffects.extract() method returns rule's data\n\tpost(\"/EvaluateRule\", JSON.stringify({ Data: codeeffects.extract() }), ruleEvaluated);\n}", "function parseRule(rule, variables, processedResult)\n{ \n\t// ...
[ "0.7201997", "0.69323045", "0.69323045", "0.6514018", "0.6307991", "0.6058027", "0.6011805", "0.599529", "0.592433", "0.58898926", "0.5715726", "0.5715726", "0.5708902", "0.57086396", "0.5667385", "0.5632885", "0.56186277", "0.56177264", "0.5428976", "0.5401709", "0.5398754",...
0.75105304
0
Get the version of the database, as specified in the Version table
_getDatabaseVersion(database: SQLite.SQLiteDatabase): Promise<number> { // Select the highest version number from the version table return database .executeSql('SELECT version FROM Version ORDER BY version DESC LIMIT 1;') .then(([results]) => { if (results.rows && results.rows.length > 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDatabaseVersion() {\n return knex.schema.hasTable('settings').then(function (exists) {\n // Check for the current version from the settings table\n if (exists) {\n // Temporary code to deal with old databases with currentVersion settings\n return knex('settings')\...
[ "0.7537472", "0.73881936", "0.6949214", "0.69127554", "0.6849803", "0.67423934", "0.66823596", "0.6635987", "0.6603751", "0.65791243", "0.6475059", "0.6415757", "0.63044316", "0.6209044", "0.6209044", "0.61290294", "0.6127898", "0.6102518", "0.60894835", "0.60776794", "0.6070...
0.7518411
1
Only calls user provided 'responseHandler' function if response is ready and not an error
function handleResponse(request, responseHandler) { if ((request.readyState == 4) && (request.status == 200)) { responseHandler(request); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleResponse(request, responseHandler, isJsonResponse) {\n\n if ((request.readyState == 4) && (request.status == 200)) {\n\n // Default to isJsonResponse = true\n if (isJsonResponse == undefined) {\n isJsonResponse = true;\n }\n\n if (isJsonResponse) {\n\n ...
[ "0.6976038", "0.69543296", "0.69200987", "0.68696356", "0.67755663", "0.6693433", "0.66851944", "0.65364313", "0.65329474", "0.6500784", "0.6442999", "0.62637776", "0.6230402", "0.62276846", "0.62205756", "0.6219314", "0.6210696", "0.61949104", "0.61553484", "0.61467505", "0....
0.7506223
1
Function that adds a new GIF field
function prepGif(newG,count){ newG = $('#gif_template').clone(); newG.removeAttr("id").addClass('gif_wrap'); newG.find('input').removeClass('template').attr('type','text'); newG.find('input.gifUrl').attr('name','gifUrl'+(count+1)).attr('id','gifUrl'+(count+1)).addClass('combineUrl'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subir_GIF_function() {\r\n let form = new FormData();\r\n form.append('file', GIF_video, 'myGif.gif');\r\n let GIF_preview = URL.createObjectURL(GIF_video);\r\n summary_panel_function(GIF_preview);\r\n POST_GIF_function(form);\r\n }", "functi...
[ "0.7039496", "0.6860917", "0.6644792", "0.66174155", "0.6600247", "0.6597048", "0.6573962", "0.65314025", "0.6528287", "0.652579", "0.64327896", "0.6425736", "0.64212805", "0.6411943", "0.6390994", "0.63203895", "0.63005567", "0.62969446", "0.6291319", "0.62904024", "0.621742...
0.69831854
1
Test let makan = pluckFirstSyllable("makan"); let ngambek = pluckFirstSyllable("ngambek"); let nyaman = pluckFirstSyllable("nyaman"); let nyambung = pluckFirstSyllable("nyambung"); let o = pluckFirstSyllable("o"); console.log(makan, "should be", ["ma", "kan"]); console.log(ngambek, "should be", ["ngam", "bek"]); consol...
function getSyllabels(word, syllabels = []) { if (word === "") { return syllabels; } const [firstSyllabel, restWord] = pluckFirstSyllable(word); return getSyllabels(restWord, [...syllabels, firstSyllabel]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pluckFirstLetter(word) {\n const firstLetter = word.slice(0, 1);\n word = word.slice(1, word.length);\n return [firstLetter, word];\n}", "mapSyllableRomajiUnicode() {\n return {\n mapping: [\n {syllable: {alphabet: \"h\", consonant: \"\", vowel: \"a\"}, romaji: \"a\",...
[ "0.598837", "0.5569905", "0.5514207", "0.54766625", "0.54563797", "0.5328626", "0.5318836", "0.5276278", "0.5247969", "0.5231109", "0.52225584", "0.5212696", "0.5208912", "0.5134311", "0.51227856", "0.5109422", "0.5104713", "0.5084934", "0.50647825", "0.5053466", "0.5032469",...
0.5897019
1
get all ISBNs for this book and write to global var isbns then call getBookStatuses
function getStatusAllISBNs(isbn) { var wbUrl = 'http://labs.oclc.org/xisbn/' + isbn; GM_xmlhttpRequest({ method: 'GET', url: wbUrl, headers: { 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3', 'Accept': 'application/atom+xml,application/xml,text/xml', }, on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookStatuses(){\r\n\tisbnsIndex++;\r\n\tif(DEBUG) GM_log(\"getBookStatuses\"+isbnsIndex+ \" \" + isbns.length);\r\n\r\n\tif (isbnsIndex < isbns.length){\r\n\t\tif(VERBOSE) updateStatusHTML(\"Searching for ISBN \"+ isbns[isbnsIndex] + \" in \" + libraryName + '...');\r\n\t\tgetBookStatus(libraryIsbnUrlP...
[ "0.8168241", "0.5735061", "0.56292504", "0.55689657", "0.55613756", "0.5513577", "0.5485945", "0.5465522", "0.5463983", "0.53672904", "0.5347927", "0.5301958", "0.52960396", "0.5206353", "0.5205853", "0.5196761", "0.519442", "0.5181892", "0.51518476", "0.5103178", "0.5078953"...
0.67741805
1
connect to library server to get book status for isbn and then insert result under the book title call getBookStatuses when done
function getBookStatus(libraryUrlPattern, isbn){ if(DEBUG) GM_log('Searching: '+libraryUrlPattern + isbn); var libraryAvailability = /Checked In/; var libraryOnOrder = /(\d+) Copies On Order/; var libraryInProcess = /Pending/; var libraryTransitRequest = /Transit Request/; var libraryBeingHeld = /Being ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookStatuses(){\r\n\tisbnsIndex++;\r\n\tif(DEBUG) GM_log(\"getBookStatuses\"+isbnsIndex+ \" \" + isbns.length);\r\n\r\n\tif (isbnsIndex < isbns.length){\r\n\t\tif(VERBOSE) updateStatusHTML(\"Searching for ISBN \"+ isbns[isbnsIndex] + \" in \" + libraryName + '...');\r\n\t\tgetBookStatus(libraryIsbnUrlP...
[ "0.7421019", "0.65444696", "0.6068437", "0.60333645", "0.5983307", "0.59751225", "0.59543717", "0.5943956", "0.58511233", "0.5835405", "0.5811632", "0.57846284", "0.5775838", "0.5768427", "0.5767303", "0.5685861", "0.5657305", "0.56492966", "0.56327343", "0.56259125", "0.5622...
0.6562122
1
none found add link to search by title
function setStatusNoneFound() { var title = getTitle(); var splStatusDiv = document.getElementById('splLinkyStatusHTML'); if (splStatusDiv == null) { return; } var link = document.createElement('a'); link.setAttribute('title', title ); link.setAttribute('href', libraryURLPatternForNoMatch + encodeURICom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMoreSearchText() {\n if ($('ms-srch-group-link a') !== null) {\n $('.ms-srch-group-link a').text('Show All People Results');\n $('.ms-srch-group-link a').attr('title', 'Show All People Results...');\n }\n }", "function gotSearch(data) {\n\n //Random title from search results\n ...
[ "0.63588065", "0.62300766", "0.6228793", "0.6183159", "0.6181273", "0.61662614", "0.61539817", "0.61519843", "0.6144777", "0.61223054", "0.6073575", "0.60591173", "0.60493267", "0.60384196", "0.6017593", "0.6000598", "0.59962344", "0.59929854", "0.5962829", "0.5962574", "0.59...
0.6565224
0
check if there is a ISBN in the URL URL looks like
function getIsbn(url){ try { //match if there is a / followed by a 7-9 digit number followed by either another number or an x //followed by a / or end of url var isbn = url.match(/\/(\d{7,9}[\d|X])(\/|$)/)[1]; } catch (e) { return 0; } return isbn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIsbn() {\n var match = window.location.href.match(/\\/(\\d{7,9}[\\d|X])\\//);\n if (!match) {\n\t var match = document.body.innerHTML.match(/ISBN.{1,20}(\\d{7,9}[\\d|X])/);\n\t\tif (!match) return null\n\t}\n\n var isbn = match[1];\n return isbn;\n}", "checkISBN(isbn) {\n return...
[ "0.7224314", "0.7037791", "0.6706432", "0.662946", "0.6572847", "0.6389991", "0.63175374", "0.6060635", "0.6029078", "0.6007138", "0.59810996", "0.58500934", "0.5801798", "0.5788395", "0.5699947", "0.5699947", "0.56789935", "0.56709296", "0.5643679", "0.56310475", "0.5573894"...
0.7291405
0
Find the node containing the book title
function getTitleNode() { // Amazon has a number of different page layouts that put the title in different tags // This is an array of xpaths that can contain an item's title var titlePaths = [ "//span[@id='btAsinTitle']/node()[not(self::span)]", "//h1[@id='title']/node()[not(self::span)]" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTitleNode()\r\n{\r\n\tvar nodes = document.evaluate(\"//span[@id='\" + titleNodeId + \"']\", document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);\r\n\tif(!nodes){\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar thisNode = nodes.iterateNext(); \r\n\tvar titleNode;\r\n\t// Get the last node\r\n\twhil...
[ "0.7280169", "0.63078415", "0.61382735", "0.61244047", "0.6074707", "0.596701", "0.59222865", "0.59111446", "0.5890053", "0.5882683", "0.5882683", "0.5882683", "0.5882683", "0.5882683", "0.5877939", "0.58768195", "0.58464646", "0.583462", "0.5785628", "0.5783641", "0.57817686...
0.7295673
0
Print all coordinates where rover has traveled over
function printTravelLog(rover){ var coordinates = ''; rover.travelLog.forEach(function(item, index){ if (index % 2 === 0){ coordinates += '(' + item + ','; } else if (index % 2 !== 0){ coordinates += item + ') '; } }); console.log(rover.name + ' tracking: ' + coordinates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTrainArea(map, x, y) {\n let previewSize = 6 / 2;\n for (let j = Math.max(0, y - previewSize); j < Math.min(map.map.length - 1, y + previewSize); j++) {\n let line = \"\";\n for (let i = Math.max(0, x - previewSize); i < Math.min(x + previewSize, map.map[j].length); i++) {\n ...
[ "0.64447206", "0.6328872", "0.61726373", "0.5863796", "0.5846609", "0.57202315", "0.57134604", "0.5706525", "0.568447", "0.5661742", "0.5638027", "0.5599272", "0.5594091", "0.5581789", "0.5581313", "0.55780953", "0.5574275", "0.55639774", "0.5560988", "0.5556752", "0.5554012"...
0.7214386
0
Check which rover have the next turn
function checkRoverNextTurn(){ var roverNextTurn; for (var rover in rovers){ if (rovers[rover].myTurn){ roverNextTurn = rovers[rover]; } } return roverNextTurn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNextMovement(nextPositionX, nextPositionY, rover){\n if ((nextPositionX >= 0 && nextPositionX < 10) && (nextPositionY >= 0 && nextPositionY < 10)){\n if (grid[nextPositionY][nextPositionX] === null){\n // Set null to rover's previous position\n grid[rover.y][rover.x] = null;\n // S...
[ "0.70436364", "0.68485767", "0.6789171", "0.67682475", "0.6593231", "0.65592843", "0.65360624", "0.65308964", "0.6526584", "0.64811695", "0.6469991", "0.64518607", "0.6421899", "0.637249", "0.6353876", "0.62681425", "0.62638986", "0.62218803", "0.6219475", "0.62085944", "0.62...
0.79573625
0
This function applies the above filter and sort functions to each item of the list, and returns a list that meets the filter and sort requirements specified in the dropdowns
applyFiltersAndSorts() { var list = this.props.list.filter(this.matchesFilterEnergyLevel); list = list.filter(this.matchesFilterFunLevel) var sort_type = this.getSortFunction() if(sort_type != null){ list = list.sort(sort_type) } return list }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sortFilters() {\n this.$filterSelects.each(function() {\n const $select = $(this);\n const $toSort = $select.find('option');\n const sortingFunction = sortingFunctions[$select.data('filters-type')];\n\n if (sortingFunction) {\n $toSort.sort((a, b) => {\n return sortingFuncti...
[ "0.69477564", "0.65974796", "0.6568075", "0.6449052", "0.6391684", "0.6354739", "0.6282483", "0.6273855", "0.62695175", "0.62548685", "0.6251136", "0.62444794", "0.6209795", "0.6185633", "0.6141089", "0.61238873", "0.6123445", "0.6099721", "0.60897475", "0.6067301", "0.605372...
0.7851826
0
When an activity's "add" button is clicked, or the "+" button in the schedule it triggers this function which, given an activity, adds this activity to the planned_activitites state. This enables the user to add activities to their schedule.
addToPlannedActivities(item) { var new_planned_activities = this.state.planned_activities //iterates through the activities for(var i = 0; i < new_planned_activities.length; i++){ //if the activity is already present in the planned_activities list, add //one to the quanti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_activity() {\n\n create_new_activity.style.display = \"block\";\n let new_title = d.getElementById(\"title\");\n let new_desc = d.getElementById(\"desc\");\n let new_goal = d.getElementById(\"goal\");\n let confirm_new_activity = d.getElementById(\"confirm_new_activity\");\n\n functi...
[ "0.64878106", "0.6472385", "0.64700204", "0.6408329", "0.63256216", "0.6175984", "0.6135696", "0.6132392", "0.603566", "0.585929", "0.58560866", "0.58363694", "0.5798628", "0.57726604", "0.56571835", "0.5650925", "0.5518051", "0.54352117", "0.54350084", "0.5413713", "0.536883...
0.6605979
0
Calculates the sums of option prices and vpe values
calcOptionSums() { var selectors = [ this.moduleSelector + ' ' + this.dataSelector + ':checked', this.moduleSelector + ' ' + this.dataSelector + ':selected' ] var optionPriceSum = 0; var optionVpeValueSum = 0; var selector = selectors.join(','); v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcProductPrices(optionSums, optionData) {\n var originalPrice = optionSums.optionPriceSum + optionData.productPriceOriginal;\n var currentPrice = optionSums.optionPriceSum + optionData.productPriceCurrent;\n var vpePrice = currentPrice / (optionData.productVpeValue + optionSums.optionVpeValu...
[ "0.7416193", "0.7272866", "0.6923308", "0.6748836", "0.6652647", "0.65393853", "0.6496923", "0.6484396", "0.6444732", "0.6437374", "0.64104825", "0.6362337", "0.6314474", "0.63117296", "0.6287675", "0.6215133", "0.6195507", "0.6156198", "0.61387205", "0.6127489", "0.61053306"...
0.7635386
0
Function for create coupon
function createCoupon() { var text = tinyMCE.activeEditor.getContent({ format: 'raw' }); coupon.service.coupon.DescriptionOnSellerPage = text; coupon.service.coupon.$save(function (response) { coupon.uploader.url = '/api/ImagesUplo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCoupon() {\r\n //it doesn't generate 6 digit number between 000000-100000 //need to be fixed\r\n let randomNum = Math.random() * (999999 - 100000) + 100000;\r\n \r\n\r\n dispatchCouponToSave(updateCoupon(randomNum))\r\n }", "function addCoupon() {\n\t// Hide the i...
[ "0.71881145", "0.6699827", "0.6585232", "0.6565523", "0.6324525", "0.62891024", "0.61362606", "0.6134582", "0.6031164", "0.5981925", "0.5877163", "0.5866849", "0.5862355", "0.58403504", "0.58117944", "0.57815886", "0.5762174", "0.57242286", "0.568734", "0.56603295", "0.565874...
0.6781962
1
A test constructor that throws an error.
function ThrowingConstructorTest() { throw new Error('taco'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExpectedError(message) {\n this.message = message || \"\";\n}", "constructor() {\n throw new Error('Tried instantiating a utility class.');\n }", "constructor() {\n throw new Error(`${this.constructor.name} class cannot be instantiated`);\n }", "constructor() {\n throw new Erro...
[ "0.6928687", "0.68448293", "0.66613334", "0.6622724", "0.66214293", "0.6547026", "0.65144455", "0.6501186", "0.6415801", "0.63397956", "0.6320425", "0.62967473", "0.62615836", "0.618759", "0.61844593", "0.61800504", "0.61800504", "0.61800504", "0.61800504", "0.61800504", "0.6...
0.8672695
0
Gets an array of PayrollRunReferences for the current and previous months
function getPayrollRuns() { try { return ReturnPeriodResponse.find({ $or: [ { 'returnPeriod.periodStartDate': months[0].startDate }, { 'returnPeriod.periodStartDate': months[1].startDate } ] }).distinct('payrollRunDetails.payrollRunReference'); } catch (error) { throw new Err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPrevDays() {\n\n // First step we need to know is witch weekday\n // the month starts and assert it is an integer\n let actualMonthStartAt = parseInt(\n dateObject\n .startOf(\"month\")\n .format(\"d\")\n )\n\n // Creates a copy of the actual date and\n // in the co...
[ "0.5691306", "0.5543119", "0.53201693", "0.52482355", "0.5218817", "0.5169959", "0.5169959", "0.512626", "0.50930285", "0.50930285", "0.48473644", "0.48473644", "0.48443225", "0.48315656", "0.48243377", "0.4732983", "0.4716222", "0.47054148", "0.4688176", "0.46767935", "0.466...
0.6532235
0
Identifies payroll submissions files to be uploaded to MongoDB and imports them from payroll
async function getSubmissionsFromPayroll() { let payrollRuns = await getPayrollRuns(); let allSubmissions = await getPayrollSubmissionResponses(payrollRuns); let existingSubmissions = await getPayrollSubmissions(payrollRuns); for (const submission of allSubmissions) { if (!submissionExists(existingSubmissi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UploadProcess(serverIP, fileName, dbObj) {\r\n\r\n\t// Delete the doc before insert\r\n\tDBOperationRemoveDocByNode(serverIP, fileName, dbObj);\r\n\r\n\t// Parse the doc to MongoD\r\n\tDBOperationParseETLToMongoD(serverIP, fileName, dbObj);\r\n\r\n\t//Query count\r\n\t//DBOperationFindDoc(serverIP, fileNa...
[ "0.6117158", "0.6015397", "0.5952082", "0.58594835", "0.5711114", "0.5675174", "0.56644666", "0.5624326", "0.5618279", "0.5578917", "0.55523735", "0.55471003", "0.5537062", "0.552349", "0.54536545", "0.5442395", "0.5399697", "0.5375064", "0.5342479", "0.533114", "0.5316138", ...
0.68480086
0
private dyno_id is expected to be [type].[instanceid] where instance id is the value returned from /v1/space/:space/app/:app/instance without the alamo app name prefix (and forward dash). E.g., web.234523453452 or worker.23432442222
async function dyno_stop(pg_pool, app_uuid, app_name, space_name, dyno_id, why) { if (dyno_id.indexOf('.') === -1) { throw new common.NotFoundError('The specified dyno id was not found.'); } const type = dyno_id.substring(0, dyno_id.indexOf('.')); const formation = await select_formation(pg_pool, [app_uuid,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get instanceID() {\n return this.controller.model.instanceID\n }", "instanceInstanceIdGet(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.OccurrenceApi(); // String | Use a project access token with 'read' scop // Number | The occurrence ID\n /*let xRoll...
[ "0.5492621", "0.5489633", "0.5341986", "0.52384764", "0.5225734", "0.52086884", "0.50855035", "0.508138", "0.50752074", "0.5049114", "0.5049114", "0.5049114", "0.5049114", "0.5049114", "0.5049114", "0.50360316", "0.5022379", "0.50180304", "0.4974841", "0.4922492", "0.4913103"...
0.55111355
0
Hide/show new member criteria field based on moderation
function checkCriteria(modVal) { if(modVal === 'by_request') { $id_new_member_criteria_fieldset.show(); } else { $id_new_member_criteria_fieldset.hide(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "applyDisplayModeToFields(member) {\n if (this.isMemberPresent()) {\n this.$el.find('[data-display-mode=\"new_members_only\"]').hide(0);\n } else {\n this.$el.find('[data-display-mode=\"recognized_members_only\"]').hide(0);\n }\n }", "function hideOtherShown(memberName) {\n $('.vhmavi-membe...
[ "0.6862562", "0.5928797", "0.5840575", "0.5601342", "0.55875385", "0.5443609", "0.54226995", "0.5420683", "0.5406622", "0.5358399", "0.5346905", "0.53063524", "0.5278814", "0.5249039", "0.52380055", "0.5212273", "0.5199658", "0.51976734", "0.5185903", "0.5184491", "0.5175939"...
0.7019167
0
gets the username & runs the game & gets user input & runs the game if the user input is equivilent to yes
function play() { getName() let userInput = 'yes' while (userInput == 'yes') { playgame() userInput = prompt('Do you want play again') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame () {\n\tvar userName = prompt( 'What is your name?' );\n\n\taskYorNQs();\n\taskNumGuessQ();\n\taskCityQ();\n\n\talert( userName + ', you got ' + tally + ' out of ' + questionArray.length + ' questions right.' );\n}", "function playGame() {\n inquirer\n .prompt([\n // Here we create a ...
[ "0.7126254", "0.69814426", "0.6917699", "0.6886237", "0.6870528", "0.6855181", "0.6828318", "0.681378", "0.6749063", "0.6748858", "0.6699526", "0.6685377", "0.6683282", "0.6654", "0.6640944", "0.66376984", "0.6617388", "0.6596679", "0.6594072", "0.6587628", "0.65614617", "0...
0.7165588
0
googleData.normalizedInput.state state matching condition for filter
function filter_by_state(member) { return member.state == googleState }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSearchButtonClickState() {\n // Format the user's search by removing leading and trailing whitespace\n var filterState = $stateInput.value.trim().toLowerCase();\n\n // Set ufoSightings to an array of all dataSet whose \"date\" matches the filter\n ufoSightings = dataSet.filter(function(sightings...
[ "0.65763104", "0.62262493", "0.61359864", "0.61359864", "0.60528415", "0.60148937", "0.59842145", "0.5979922", "0.59571016", "0.59203666", "0.5854018", "0.5846921", "0.5836498", "0.5791047", "0.5761424", "0.574026", "0.57144773", "0.57132727", "0.5692619", "0.5686186", "0.568...
0.6466321
1
function to create a horizontal wall
hWall(num, x, y){ for(let w = 0; w < num; w++){ wall = walls.create(TILE_WIDTH * x + (TILE_WIDTH * w), TILE_HEIGHT * y, 'wall'); wall.body.immovable = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHorizontalWalls()\r\n{\r\n // Material to clone into all wall shapes\r\n let v = getWall(); v.rotateY(Math.PI/0);\r\n v.position.x = -50;\r\n v.position.z = -85;\r\n v.scale.x = 3;\r\n addWall(v);\r\n\r\n let h1 = getWall();\r\n h1.position.x = -77\r\n h1.position.z = -72;...
[ "0.795412", "0.74007475", "0.737562", "0.72769135", "0.7144699", "0.71274114", "0.7088347", "0.70358795", "0.7025505", "0.70168585", "0.6944065", "0.69426024", "0.69343054", "0.6919083", "0.68808687", "0.68452525", "0.68180364", "0.6798603", "0.6777549", "0.6765924", "0.66900...
0.7593081
1
function to create a vertical wall
vWall(num, x, y){ for(let w = 0; w < num; w++){ wall = walls.create(TILE_WIDTH * x, TILE_HEIGHT * y + (TILE_HEIGHT * w), 'wall'); wall.body.immovable = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "vertical_wall(left_col, right_col, start_row, end_row, val) {\n this.set_vertical_wall(left_col, right_col, start_row, end_row, val);\n this.draw_vertical_wall(left_col, right_col, start_row, end_row, val);\n }", "function createWall(wallLenght, startTileX, startTileZ, vertical, name) {\n ...
[ "0.71468896", "0.7145987", "0.71318513", "0.71273726", "0.69139576", "0.6897756", "0.68968296", "0.68883556", "0.68121374", "0.6770606", "0.6740347", "0.67043495", "0.66640514", "0.6642041", "0.6609752", "0.6592409", "0.64972323", "0.64884657", "0.64418614", "0.64333105", "0....
0.73587745
0
function to create a vertical path
vPath(num, x, y){ for(let p = 0; p < num; p++){ path = paths.create(TILE_WIDTH * x, TILE_HEIGHT * y + (TILE_HEIGHT * p), 'path'); path.body.immovable = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makePath() {\n var obj = new Graphics();\n obj.lineStyle(2, 0xffffff, 1);\n obj.moveTo(0, 0);\n obj.lineTo(pathProp.pathLenght, 0);\n\n obj.pivot.set(pathProp.pathLenght / 2, 0);\n obj.x = app.renderer.view.width / 2;\n obj.y = pathProp.pathY;\n return obj;\n}", "function vertical(direction){\n ...
[ "0.60647887", "0.60442615", "0.6020841", "0.59323615", "0.59267384", "0.5922361", "0.5909036", "0.5887356", "0.5849949", "0.58405197", "0.58157885", "0.5812426", "0.5785571", "0.5743166", "0.57257986", "0.5676422", "0.566589", "0.56253964", "0.56231195", "0.5616567", "0.55782...
0.65596986
0
This class watches the gameplay rules, and counts the score
function RulesManager(ball, userPaddle, aiPaddle) { this.ball = ball; this.userPaddle = userPaddle; this.aiPaddle = aiPaddle; var scoreElement = document.getElementById("score"); this.userScore = 0; this.aiScore = 0; this.checkBallPosition = function () { if (this.ball.position.x < this.userPaddle.position.x)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trackScore() {\n if (totalScore === goalNum) {\n wins++;\n console.log(\"wins\");\n award();\n reset();\n\n\n }\n else if (totalScore > goalNum) {\n losses++;\n console.log(\"losses\");\n award();\n ...
[ "0.6220562", "0.6077657", "0.599443", "0.5925251", "0.5855856", "0.584131", "0.5779651", "0.5745046", "0.5736502", "0.571941", "0.57133675", "0.5705558", "0.56907386", "0.5687328", "0.5675981", "0.5674317", "0.5644304", "0.56441635", "0.56438845", "0.5627559", "0.56243783", ...
0.6141661
1
uses Redis to get a serial number
function SerialNumber(redisClient) { this.redisClient = redisClient }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getStoredSerialNumberById(id){\n const serialNum = await Seriall.getSerialNumberById(id);\n return serialNum;\n }", "getSerialId() {\n if (!this.serialid) {\n let id = this.getId();\n if (id) {\n id = id.replace(/(.+?)\\/(.+?)\\/(.*)/, '$2');\n this.serialid = id.re...
[ "0.66844493", "0.64133275", "0.6319414", "0.61423916", "0.6108558", "0.5902839", "0.58886075", "0.57561624", "0.5706391", "0.5678169", "0.5673884", "0.567262", "0.55710876", "0.5537361", "0.55226254", "0.5487272", "0.54804605", "0.5468156", "0.5465124", "0.5448822", "0.542866...
0.70609504
0
Builds the page mask and appends it to the container.
buildMask_() { dev().assert(this.container_); const mask = this.win.document.createElement('div'); mask.classList.add('i-amphtml-lbv-mask'); this.container_.appendChild(mask); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mask (){\n\t\tvar $doc = $(document);\n\t\tvar $body = $(document.body);\n\t\tvar $win = $(window);\n\t\tif (!$body.find('.mask').length) {\n\t\t\t$body.append($('<div class=\"mask\"></div>'));\n\t\t}\n\t\tvar m = maxMask();\n\t\tif (!m.data('data-resize')) {\n\t\t\t$(window).on('resize', function (){\n\t...
[ "0.56200653", "0.53169656", "0.5142659", "0.5045121", "0.50291264", "0.5000544", "0.48827195", "0.4880754", "0.48741496", "0.48499918", "0.48473445", "0.48410606", "0.48192826", "0.4800966", "0.47556177", "0.47551903", "0.47426537", "0.47360596", "0.4727715", "0.47074854", "0...
0.6961168
0
Builds the carousel and appends it to the container.
buildCarousel_() { if (!this.carousel_) { dev().assert(this.container_); Services.extensionsFor(this.win).installExtensionForDoc( this.getAmpDoc(), 'amp-carousel'); this.carousel_ = this.win.document.createElement('amp-carousel'); this.carousel_.setAttribute('type', 'slides'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildCarouselHtml() {\n $(\"<div>\", {class: \"item\"}).append(\n $(\"<a href =\" + link + \">\").append(\n $(\"<img src =\" + image + \" alt = ''>\")\n ),\n $(\"<div>\", {class:\"carousel-caption\"}).append(\n $(\"<h3>\").text(title), \n $(\"<h6>\").text(a...
[ "0.72393364", "0.71146894", "0.68464893", "0.65817237", "0.6567015", "0.6458303", "0.6283184", "0.62695456", "0.6253074", "0.62384444", "0.62157965", "0.6198782", "0.6196701", "0.61598057", "0.6104951", "0.6086703", "0.6048137", "0.6041781", "0.5987445", "0.59643453", "0.5938...
0.76109844
0
Build description box and append it to the container.
buildDescriptionBox_() { this.descriptionBox_ = this.win.document.createElement('div'); this.descriptionBox_.classList.add('i-amphtml-lbv-desc-box'); this.descriptionBox_.classList.add('standard'); this.descriptionTextArea_ = this.win.document.createElement('div'); this.descriptionTextArea_.classL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateDescriptionBox_() {\n const descText = this.clonedLightboxableElements_[this.currentElementId_]\n .descriptionText;\n this.descriptionTextArea_.textContent = descText;\n if (!descText) {\n this.descriptionBox_.classList.add('hide');\n }\n }", "GenerateDescriptionBox() {\n if (th...
[ "0.709386", "0.69170535", "0.64618695", "0.642272", "0.6323281", "0.6304074", "0.6283775", "0.61841136", "0.6164946", "0.61334985", "0.6052158", "0.6045841", "0.5945554", "0.5880046", "0.5867559", "0.5832975", "0.5826707", "0.57995343", "0.57844496", "0.5774696", "0.5774292",...
0.7883328
0
Update description box text.
updateDescriptionBox_() { const descText = this.clonedLightboxableElements_[this.currentElementId_] .descriptionText; this.descriptionTextArea_.textContent = descText; if (!descText) { this.descriptionBox_.classList.add('hide'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDesc(newDesc) {\r\n $(\"#foodDesc\").text(newDesc.desc);\r\n}", "function changeDescription(value){\n setDescription(value)\n }", "function updateEventDesc()\n{\n $('#event-desc').html($('#desc').val());\n}", "function addDescription() {\n var d, f, b, v;\n setTimeo...
[ "0.7614955", "0.7496595", "0.72929776", "0.72745675", "0.7208268", "0.7158309", "0.712574", "0.6949202", "0.6924896", "0.6905658", "0.68944454", "0.6869352", "0.684322", "0.6791437", "0.67482173", "0.6738266", "0.6738266", "0.6695005", "0.66587985", "0.65662014", "0.6563611",...
0.7998721
0
Toggle the overflow state of description box
toggleDescriptionOverflow_() { if (this.descriptionBox_.classList.contains('standard')) { const measureBeforeExpandingDescTextArea = state => { state.prevDescTextAreaHeight = this.descriptionTextArea_./*OK*/scrollHeight; state.descBoxHeight = this.descriptionBox_./*OK*/clientHeight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expand() {;\n document.getElementById(\"description\").style.width = \"75vw\";\n document.getElementById(\"description\").style.overflow = \"auto\";\n document.getElementById(\"left-arrow\").style.display = \"none\";\n document.getElementById(\"right-arrow\").style.display = \"block\";\n}", ...
[ "0.67063487", "0.6589814", "0.6549838", "0.65189034", "0.6497934", "0.6245057", "0.62071836", "0.6170833", "0.61184704", "0.60817146", "0.6071355", "0.6063121", "0.6005127", "0.5992461", "0.59410745", "0.5938755", "0.59326804", "0.5889757", "0.58513486", "0.58364904", "0.5832...
0.73031354
0
Builds the top bar containing buttons and appends them to the container.
buildTopBar_() { dev().assert(this.container_); this.topBar_ = this.win.document.createElement('div'); this.topBar_.classList.add('i-amphtml-lbv-top-bar'); this.topFill_ = this.win.document.createElement('div'); this.topFill_.classList.add('i-amphtml-lbv-top-bar-top-fill'); this.topBar_.appendC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateControlBar() {\n var result = doc.createElement(\"table\");\n result.setAttribute(\"class\", \"toolbar\");\n\n var tr = doc.createElement(\"tr\");\n \n/* @@ Add in later -- not debugged yet \n var sparqlButtonDiv = doc.createElement(\"td\");\n ...
[ "0.65669537", "0.6336845", "0.63146263", "0.62530476", "0.6198052", "0.6125875", "0.6085205", "0.60652894", "0.6049306", "0.6043442", "0.6032711", "0.60162455", "0.6008868", "0.5997528", "0.59788775", "0.5968018", "0.5944241", "0.59327215", "0.59171194", "0.59161645", "0.5905...
0.77668965
0
Toggle lightbox controls including topbar and description.
toggleControls_() { if (this.controlsMode_ == LightboxControlsModes.HIDE_CONTROLS) { this.toggleDescriptionBox_(/* opt_display */true); this.toggleTopBar_(/* opt_display */true); this.controlsMode_ = LightboxControlsModes.SHOW_CONTROLS; } else { this.toggleDescriptionBox_(/* opt_display ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openLightbox() {\n\n document.getElementById('Lightbox').setAttribute(\"style\", \"display:flex; opacity:1;\", \"class\", \"active\");\n document.body.classList.toggle('noscroll');\n\n }", "function unhideLightbox1() {\n\tunhideLightbox(\"d1\") \n}", "function dm3_lightbox_controls(ob...
[ "0.6814774", "0.6611209", "0.6598171", "0.65517807", "0.6495526", "0.64666027", "0.6463011", "0.63816583", "0.6248471", "0.62374765", "0.62247795", "0.6093268", "0.6089507", "0.60694456", "0.60653037", "0.6022027", "0.59872913", "0.5982085", "0.5974228", "0.5961708", "0.59442...
0.8071363
0
Set up container listener.
setupContainerListener_() { dev().assert(this.container_); const toggleControls = this.toggleControls_.bind(this); listen(dev().assertElement(this.container_), 'click', toggleControls); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupListener() {\r\n container.addEventListener('click', clickHandler);\r\n}", "function init() {\n setupListeners();\n }", "start() {\n\t\tthis.registerListeners();\n\t}", "registerListeners() {}", "attachListeners() {\n }", "function setupListeners() {\n setupAppHomeOpenedListener(...
[ "0.7294461", "0.6440393", "0.63862616", "0.63091224", "0.6305318", "0.6261753", "0.62192", "0.6068892", "0.6067803", "0.6066203", "0.6037869", "0.60327643", "0.6030134", "0.6022445", "0.5971698", "0.5935891", "0.592434", "0.59195596", "0.59120953", "0.59107894", "0.5906232", ...
0.73069245
0
Display gallery view to show thumbnails of lightboxed elements
openGallery_() { // Build gallery div for the first time if (!this.gallery_) { this.buildGallery_(); } this.container_.setAttribute('gallery-view', ''); this.topBar_.classList.add('fullscreen'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildGallery_() {\n // Build gallery\n this.gallery_ = this.win.document.createElement('div');\n this.gallery_.classList.add('i-amphtml-lbv-gallery');\n\n // Initialize thumbnails\n this.updateThumbnails_();\n\n this.vsync_.mutate(() => {\n this.container_.appendChild(this.gallery_);\n })...
[ "0.71490526", "0.7103943", "0.70488745", "0.70220506", "0.6999177", "0.69742364", "0.696518", "0.6939959", "0.68495566", "0.68168384", "0.6781534", "0.675067", "0.66500956", "0.66481686", "0.66168827", "0.6583432", "0.6575252", "0.6555891", "0.65557504", "0.65447533", "0.6541...
0.72240627
0
Build lightbox gallery. This is called only once when user enter gallery view for the first time.
buildGallery_() { // Build gallery this.gallery_ = this.win.document.createElement('div'); this.gallery_.classList.add('i-amphtml-lbv-gallery'); // Initialize thumbnails this.updateThumbnails_(); this.vsync_.mutate(() => { this.container_.appendChild(this.gallery_); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openGallery_() {\n // Build gallery div for the first time\n if (!this.gallery_) {\n this.buildGallery_();\n }\n this.container_.setAttribute('gallery-view', '');\n this.topBar_.classList.add('fullscreen');\n }", "Lightbox() {\n $('.fancybox').fancybox({\n loop: false,\n });...
[ "0.73648506", "0.72273844", "0.715383", "0.7111805", "0.6986736", "0.69798833", "0.6960078", "0.694683", "0.69213027", "0.69178855", "0.6915809", "0.6899468", "0.6886205", "0.67977625", "0.6768314", "0.67411023", "0.66844076", "0.66666466", "0.66528565", "0.66491663", "0.6633...
0.78513455
0
Update thumbnails displayed in lightbox gallery. This function only supports initialization now.
updateThumbnails_() { if (this.thumbnails_) { // TODO: Need to update gallery if there's change with thumbnails return; } // Initialize thumbnails from lightbox manager this.thumbnails_ = []; const thumbnailList = this.manager_.getThumbnails(); thumbnailList.forEach(thumbnail => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshLightbox() {\n\t\tif (_lightbox) {\n\t\t\tvar item = _images[_lightbox.idx];\n\t\t\t_lightbox.$titleText.nodeValue = item.title || \"\";\n\t\t\t_lightbox.$imgAnchor.setAttribute(\"href\", item.image.url);\n\t\t\tif (_lightbox.$img.getAttribute(\"src\") !== item.image.url) {\n\t\t\t\t_lightbox.$img....
[ "0.7170116", "0.6953482", "0.6947068", "0.6759381", "0.6744937", "0.67208886", "0.67200375", "0.6708461", "0.6660532", "0.66280925", "0.6590062", "0.6451301", "0.64155847", "0.64071345", "0.64050364", "0.6368281", "0.63621163", "0.6359672", "0.63520813", "0.6349773", "0.63339...
0.8598588
0