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
Function: isAuthorized Middleware that is used on all the authorized routes. It checks if req.user is set by our Middleware. if it is proceed, else call next with an unauthorized request error.
function isAuthorized(req, res, next) { if (req.user) { next(); } else { res.status(401); const error = new Error("Unauthorized request"); next(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateIsAuthorized(req, res, next) {\n try {\n if (req.user.id === +req.params.id && req.user.type === \"user\") {\n return next();\n }\n\n return next({ status: 401, message: \"Unauthorized\" });\n } catch (err) {\n return next({ status: 401, message: \"Unauthorized\" });\n }\n}", ...
[ "0.79230034", "0.77453315", "0.752696", "0.73830813", "0.7103238", "0.70427537", "0.7042056", "0.69907284", "0.6968322", "0.6957945", "0.69322646", "0.6918397", "0.69059837", "0.6872403", "0.68482685", "0.6843103", "0.68291134", "0.6828802", "0.68214285", "0.6818517", "0.6803...
0.80535424
0
Sends a request to the server to become host
function requestHostship() { socket.emit("requestHostship", { "id": currentPlayer.id }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "function handRequest(request, response) {\r\n\t//this will be triggered when the user goes to our port\r\n\tresponse.end(\"It Works! Path hit:...
[ "0.59654725", "0.571427", "0.5538536", "0.55262786", "0.54869294", "0.5472611", "0.5432556", "0.53998005", "0.5262057", "0.524145", "0.5225891", "0.52196974", "0.521127", "0.51953644", "0.5172166", "0.51418495", "0.513882", "0.5132433", "0.5086045", "0.5077622", "0.5067926", ...
0.57196826
1
Sends a command to the server to update the player color
function updatePlayerColor(color) { console.log("Changing color..."); console.log(color); currentPlayer.setColor(color); socket.emit("updatePlayerColor", { id: currentPlayer.id, "color": color }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editColor() {\n\n // Prompt user for new color and request new info from server\n let newColor = prompt('Please enter your new color', dbUserObject.chatColor);\n if (newColor !== '') { socket.emit('new color', dbUserObject, newColor); }\n}", "updateColor() {\n swim.downlinkValue().hostUr...
[ "0.6882424", "0.67966425", "0.6558768", "0.6431572", "0.6427383", "0.6387732", "0.63405883", "0.6297831", "0.62930906", "0.62916166", "0.6277881", "0.62550116", "0.61761075", "0.61620104", "0.6159707", "0.6159707", "0.6126784", "0.61225206", "0.60687363", "0.60214514", "0.597...
0.8089378
0
Sends a command to the server to update the player nickname
function updatePlayerNickname(nickname) { console.log("Changing nickname..."); currentPlayer.nickname = nickname; socket.emit("updatePlayerName", { "id": currentPlayer.id, "name": nickname }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUsername(){\n\t\t//send username to sockets to update username\n\t\tusername = $scope.username;\n\t\tsocket.emit('user_to_server', username);\n\t\t//end socket emit\n\t}", "function updatePlayerOnServer(){\r\n\tsocket.emit(\"update_player\", gameEnv.players[myPlayerID]);\r\n}", "updateUsername(n...
[ "0.7081001", "0.6779378", "0.66578245", "0.6656967", "0.66239655", "0.65043265", "0.6479476", "0.63451916", "0.62617946", "0.62559074", "0.6249588", "0.6195129", "0.61781603", "0.617807", "0.6167373", "0.61301786", "0.61298406", "0.61086553", "0.6078036", "0.60560876", "0.603...
0.8307158
0
Sends the updated tank array to all other clients
function sendUpdatedTankArray() { console.log(playerList) console.log("Sending updated tank array..."); socket.emit("updateTankArray", { "id": currentPlayer.id, "tankArray": playerList }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTankMovement() {\n let tankMoveData = {'userID': myPlayer.userID, 'tankLeftOffset': myTankO.leftOffset, 'playerNumber': myTankO.tankOwner };\n socket.emit('updateTank', tankMoveData);\n}", "updateTanks(){\n\t\tthis.tanks.map((tank)=>tank.update(this.deltaTime));\n\t}", "function sendBullet...
[ "0.68080264", "0.6618636", "0.5994286", "0.59356797", "0.58904386", "0.5870495", "0.58487725", "0.5843181", "0.5745545", "0.56916916", "0.56742203", "0.56384724", "0.5630554", "0.56273097", "0.5578771", "0.5569352", "0.5551925", "0.5513253", "0.5486476", "0.54849565", "0.5465...
0.81282955
0
Sends an updated array of shot bullets to all other clients
function sendBulletArray() { bulletArray = currentPlayer.bulletArr.map(function (bullet) { return { "x": bullet.x, "y": bullet.y, "rotation": bullet.rotation } }) socket.emit("updateBulletArray", { "id": currentPlayer.id, "bulletA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame(){\r\n //Initiate proxy between client and server\r\n proxy=new Proxy(socket,currentLobby.id);\r\n soundtrack.play();\r\n //Load All Image\r\n loadMap();\r\n respawn(player);\r\n playerImageLoad();\r\n shieldImageLoad();\r\n bootsImageLoad();\r\n potionImageLoad();\r\n //Event Listene...
[ "0.66319543", "0.6574518", "0.6521695", "0.65198463", "0.64239746", "0.64163226", "0.6279671", "0.6229656", "0.622107", "0.61946666", "0.61346525", "0.6132476", "0.60441095", "0.6025791", "0.600973", "0.60087", "0.60075086", "0.59887594", "0.59197354", "0.5913035", "0.5885309...
0.77831495
0
Sends the map to other clients
function sendMap() { console.log("Sending map..."); socket.emit("sendMap", wallArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendInitialGameState() {\n // broadcast map to all Clients\n for (var ID in Connections) {\n var json = JSON.stringify({\n Type: \"map\",\n Map: Sprites.Map\n });\n Connections[ID].sendUTF(json);\n }\n}", "function sendMapData (mapImage) {\n io.sock...
[ "0.67436206", "0.6525288", "0.63830525", "0.6150854", "0.61465746", "0.59771913", "0.59535724", "0.59158784", "0.59122014", "0.59042096", "0.5850285", "0.5809575", "0.5792475", "0.5735124", "0.5690926", "0.5613346", "0.55810326", "0.557894", "0.5562976", "0.55620605", "0.5558...
0.75875586
0
Sends the position data to other clients
function sendPosData() { // console.log("Sending position data..."); socket.emit("sendPosData", { "id": currentPlayer.id, "x": currentPlayer.x, "y": currentPlayer.y, "rotation": currentPlayer.rotation }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendPositionUpdate (position) {\r\n\tif (MULTI_ON)\r\n\t{\r\n\t\tsocket.emit(\"playerMove\", position);\r\n\t}\r\n}", "sendPositions(){\n let sendPosition = [];\n this.player.activeRoom.players.forEach(obj => {\n sendPosition.push(obj.position);\n });\n sendPositio...
[ "0.7549001", "0.737769", "0.716847", "0.6935788", "0.68548423", "0.6846996", "0.6819954", "0.6787612", "0.67280096", "0.67091346", "0.6629205", "0.6556109", "0.6545012", "0.64652514", "0.646119", "0.6454866", "0.64044", "0.6339226", "0.6308331", "0.6177971", "0.61736345", "...
0.83394754
0
hexToComplimentary : Converts hex value to HSL, shifts hue by 180 degrees and then converts hex, giving complimentary color as a hex value
function triangulateColour(hex){ // Convert hex to rgb // Credit to Denis http://stackoverflow.com/a/36253499/4939630 var rgb = 'rgb(' + (hex = hex.replace('#', '')).match(new RegExp('(.{' + hex.length/3 + '})', 'g')).map(function(l) { return parseInt(hex.length%2 ? l+l : l, 16); }).join(',') + ')'; /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexToComplimentary(hex){\n\n // Convert hex to rgb\n // Credit to Denis http://stackoverflow.com/a/36253499/4939630\n var rgb = 'rgb(' + (hex = hex.replace('#', '')).match(new RegExp('(.{' + hex.length/3 + '})', 'g')).map(function(l) { return parseInt(hex.length%2 ? l+l : l, 16); }).join(',') + '...
[ "0.83626074", "0.78862625", "0.77146727", "0.7711725", "0.7545289", "0.74635625", "0.74410826", "0.74162", "0.74036694", "0.721312", "0.71553576", "0.71260464", "0.70926046", "0.70891213", "0.7057926", "0.70377886", "0.70273143", "0.70249486", "0.68969166", "0.68841046", "0.6...
0.7904132
1
Maps the position of the mouse to a number between 10 100
function mouseMoved() { scl = map(mouseX,0,300,10,100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMouseLoc(event) {\n mX = event.clientX - rect.left;\n mY = event.clientY - rect.top;\n render();\n}", "largeurcopie(){ \n return map ( mouseX, this.x, this.x+this.w,5, this.w )\n }", "function trackPosition(e) {\n mouse.x = e.pageX;\n mouse.y = e.pageY;\n}", "function mouse...
[ "0.6461313", "0.6400605", "0.6370442", "0.6356944", "0.6333951", "0.62770826", "0.6250658", "0.62501985", "0.6214541", "0.6178693", "0.61585397", "0.6150094", "0.6125632", "0.6089581", "0.6065341", "0.6025036", "0.60086834", "0.60054326", "0.6003315", "0.5997066", "0.5989908"...
0.7022613
0
function that gets News Articles from the NYT api
function getNews(article) { // variable to hold the New York Times apiKey var newsApiKey = "y9hgElnn7nwF3TNGuAv89poiSSqIlw4X"; fetch("https://api.nytimes.com/svc/search/v2/articlesearch.json?q=" + article + "&api-key=" + newsApiKey) .then(function (response) { return response.json() }) .then(fu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function latestNYT() {\n var nyt_url = \"https://api.nytimes.com/svc/topstories/v2/home.json\";\n nyt_url += '?' + $.param({\n 'api-key': \"efbb8eea500b42d9ba1ef7e42eb548bc\"\n });\n $.getJSON(nyt_url, function(data) {\n // Results is an array of article objects inside the response object \"d...
[ "0.7498231", "0.74831694", "0.748279", "0.7425529", "0.74252063", "0.7411992", "0.7257575", "0.7167945", "0.7137993", "0.71227497", "0.70915145", "0.7074367", "0.7072525", "0.7032182", "0.7014566", "0.69988954", "0.6988775", "0.69258946", "0.68309295", "0.6826647", "0.6815249...
0.7486929
1
Load a parser module.
function loadParser (parserName) { var parser = parsers[parserName] if (parser !== undefined) { return parser } // this uses a switch for static require analysis switch (parserName) { case 'json': parser = require('./lib/types/json') break case 'raw': parser = require('./lib/ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadParser(parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = ...
[ "0.661214", "0.661214", "0.65431386", "0.65393126", "0.6531545", "0.65303373", "0.65013766", "0.6500379", "0.6487768", "0.6487768", "0.64810973", "0.64783514", "0.57323617", "0.5505797", "0.5389952", "0.5313569", "0.52946407", "0.5224908", "0.51518905", "0.51518905", "0.51120...
0.66536826
1
Left header Theme Change function Start
function handleleftheadertheme() { $('.theme-color > a.leftheader-theme').on("click", function() { var lheadertheme = $(this).attr("lheader-theme"); $('.pcoded-header .pcoded-left-header').attr("lheader-theme", lheadertheme); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleheadertheme() {\n\t\t$('.theme-color > a.header-theme').on(\"click\", function() {\n\t\t\tvar headertheme = $(this).attr(\"header-theme\");\n\t\t\t$('.pcoded-header').attr(\"header-theme\", headertheme);\n });\n }", "function changeHeaderColor() {\n const headerTop = document.querySel...
[ "0.70454234", "0.6354508", "0.63127035", "0.6247043", "0.6200497", "0.618618", "0.61838746", "0.6181128", "0.6176803", "0.6136446", "0.61333245", "0.6109704", "0.6103688", "0.60646975", "0.60164833", "0.60062027", "0.5995196", "0.59759164", "0.59563375", "0.5940653", "0.59330...
0.7728135
0
Left header Theme Change function Close / header Theme Change function Start
function handleheadertheme() { $('.theme-color > a.header-theme').on("click", function() { var headertheme = $(this).attr("header-theme"); $('.pcoded-header').attr("header-theme", headertheme); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleleftheadertheme() {\n\t\t$('.theme-color > a.leftheader-theme').on(\"click\", function() {\n\t\t\tvar lheadertheme = $(this).attr(\"lheader-theme\");\n\t\t\t$('.pcoded-header .pcoded-left-header').attr(\"lheader-theme\", lheadertheme);\n });\n }", "function changeTheme() {\n\n // crea...
[ "0.73846465", "0.6137314", "0.6117309", "0.60820323", "0.6059817", "0.6012988", "0.5981952", "0.59678084", "0.59608996", "0.5951317", "0.5950027", "0.59473354", "0.5940772", "0.5925203", "0.592501", "0.59245753", "0.59234905", "0.5910826", "0.5909279", "0.5895342", "0.587445"...
0.691013
1
header Theme Change function Close / Navbar Theme Change function Start
function handlenavbartheme() { $('.theme-color > a.data-navbar-theme').on("click", function() { var navbartheme = $(this).attr("data-navbar-theme"); $('.pcoded-navbar').attr("data-navbar-theme", navbartheme); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleheadertheme() {\n\t\t$('.theme-color > a.header-theme').on(\"click\", function() {\n\t\t\tvar headertheme = $(this).attr(\"header-theme\");\n\t\t\t$('.pcoded-header').attr(\"header-theme\", headertheme);\n });\n }", "function setTheme(theme){\n document.getElementById(\"header\").clas...
[ "0.71323013", "0.6630778", "0.6627326", "0.6545117", "0.64799505", "0.6410463", "0.6378015", "0.63399595", "0.6317508", "0.6298163", "0.6292446", "0.6289544", "0.6257865", "0.62519854", "0.625144", "0.6246075", "0.62455565", "0.62392426", "0.62369865", "0.622685", "0.62243885...
0.68394876
1
Navbar Theme Change function Close / Active Item Theme Change function Start
function handleactiveitemtheme() { $('.theme-color > a.active-item-theme').on("click", function() { var activeitemtheme = $(this).attr("active-item-theme"); $('.pcoded-navbar').attr("active-item-theme", activeitemtheme); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handlenavbartheme() {\n\t\t$('.theme-color > a.data-navbar-theme').on(\"click\", function() {\n\t\t\tvar navbartheme = $(this).attr(\"data-navbar-theme\");\n\t\t\t$('.pcoded-navbar').attr(\"data-navbar-theme\", navbartheme);\n });\n }", "function activeTheme() {\r\n theme = document.getElemen...
[ "0.73506993", "0.70657873", "0.6856102", "0.67685604", "0.6628691", "0.64295936", "0.64175296", "0.6369389", "0.6351696", "0.63348037", "0.63147897", "0.62825936", "0.62538993", "0.6220716", "0.6218763", "0.61773205", "0.6137444", "0.6119567", "0.61184967", "0.6108872", "0.61...
0.77899975
0
Vertical Menu Placement change function Close / Vertical Active Item Style change function Start
function handleverticalActiveItemStyle() { $('#vertical-activeitem-style').val('style1').on('change', function (get_value) { get_value = $(this).val(); $('.pcoded-navbar').attr('active-item-style', get_value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeMenu() {\n this.newActive = false\n }", "_initVerticalMenu() {\n this._removeHorizontalMenuListeners();\n this._addVerticalMenuListeners();\n const menu = this.menuVertical;\n menu.querySelectorAll('a.active').forEach((element) => {\n if (element.nextElementSibling && elem...
[ "0.6688543", "0.62357754", "0.6141645", "0.6113035", "0.60916245", "0.60810834", "0.6058438", "0.59703726", "0.5968975", "0.5951524", "0.5949006", "0.5945073", "0.5923079", "0.59129673", "0.591147", "0.59000856", "0.5895291", "0.58836555", "0.5866281", "0.58456796", "0.582790...
0.73016614
0
Vertical Active Item Style change function Close / Vertical Item border change function Start
function handleVerticalIItemBorder() { $('#vertical-item-border').change(function() { if( $(this).is(":checked")) { $('.pcoded-navbar .pcoded-item').attr('item-border', 'false'); }else { $('.pcoded-navbar .pcoded-item').attr('item-border', 'true'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleverticalActiveItemStyle() {\n\t\t$('#vertical-activeitem-style').val('style1').on('change', function (get_value) {\n\t\t\tget_value = $(this).val();\n\t\t\t$('.pcoded-navbar').attr('active-item-style', get_value); \n\t\t});\n\t}", "function handleverticalboderstyle() {\n\t\t$('#vertical-border-sty...
[ "0.70221496", "0.61894083", "0.61499166", "0.610009", "0.6071186", "0.6057336", "0.60365874", "0.59838563", "0.59724444", "0.59721535", "0.59626365", "0.5954566", "0.59318775", "0.59314513", "0.59276515", "0.589272", "0.58490723", "0.5845294", "0.57905155", "0.5790208", "0.57...
0.6552801
1
Vertical Item border change function Close / Vertical SubItem border change function Start
function handleVerticalSubIItemBorder() { $('#vertical-subitem-border').change(function() { if( $(this).is(":checked")) { $('.pcoded-navbar .pcoded-item').attr('subitem-border', 'false'); }else { $('.pcoded-navbar .pcoded-item').attr('subitem-border', 'true'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleVerticalIItemBorder() {\n\t\t\t$('#vertical-item-border').change(function() {\n\t\t\t\tif( $(this).is(\":checked\")) {\n\t\t\t\t\t$('.pcoded-navbar .pcoded-item').attr('item-border', 'false');\n\t\t\t\t}else {\n\t\t\t\t\t$('.pcoded-navbar .pcoded-item').attr('item-border', 'true');\n\t\t\t\t} \...
[ "0.7361212", "0.6541999", "0.59883124", "0.590983", "0.5869161", "0.5839531", "0.57658553", "0.57405114", "0.5727475", "0.5703661", "0.569305", "0.5691826", "0.56707305", "0.56591034", "0.56448746", "0.5636073", "0.56028605", "0.56006753", "0.5577462", "0.5540061", "0.5531829...
0.74345714
0
Vertical Item border Style change function Close / Vertical Dropdown Icon change function Start
function handleVerticalDropDownIconStyle() { $('#vertical-dropdown-icon').val('style1').on('change', function (get_value) { get_value = $(this).val(); $('.pcoded-navbar .pcoded-hasmenu').attr('dropdown-icon', get_value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleVerticalIItemBorder() {\n\t\t\t$('#vertical-item-border').change(function() {\n\t\t\t\tif( $(this).is(\":checked\")) {\n\t\t\t\t\t$('.pcoded-navbar .pcoded-item').attr('item-border', 'false');\n\t\t\t\t}else {\n\t\t\t\t\t$('.pcoded-navbar .pcoded-item').attr('item-border', 'true');\n\t\t\t\t} \...
[ "0.67899257", "0.6755337", "0.65766335", "0.65674376", "0.6483479", "0.63812494", "0.60567176", "0.60395974", "0.5999694", "0.5982787", "0.59178424", "0.58806294", "0.5831051", "0.5753345", "0.57461023", "0.5732772", "0.5703879", "0.5690073", "0.5670042", "0.5656714", "0.5651...
0.68459547
0
Vertical Dropdown Icon change function Close / Vertical SubItem Icon change function Start
function handleVerticalSubMenuItemIconStyle() { $('#vertical-subitem-icon').val('style5').on('change', function (get_value) { get_value = $(this).val(); $('.pcoded-navbar .pcoded-hasmenu').attr('subitem-icon', get_value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleVerticalDropDownIconStyle() {\n\t\t$('#vertical-dropdown-icon').val('style1').on('change', function (get_value) {\n\t\t\tget_value = $(this).val();\n\t\t\t$('.pcoded-navbar .pcoded-hasmenu').attr('dropdown-icon', get_value); \n\t\t});\n\t}", "function toggle_dropDown() {\n document.getElementBy...
[ "0.72598904", "0.6378956", "0.6369394", "0.6285153", "0.6206378", "0.6189134", "0.61794454", "0.61776245", "0.6147768", "0.61326945", "0.61030245", "0.603274", "0.60192597", "0.59755826", "0.5974433", "0.5973152", "0.5964026", "0.5942281", "0.59288627", "0.592673", "0.5919843...
0.72659296
0
au lancement de la partie, remplir la pioche
function remplirPioche() { //Remplir de 24 cartes la pioche for (let i = 0; i< 24; i++) { cardsPioche.push(carteSorti); Math.floor((Math.random().deck.length)+1); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrarprmacatequiv(pplan,com){\n\n\t///////PLAN PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar pgeobsf = categoriaproyectos(pplan,geofisica,com,1);\n \t\t\t\t\t\tvar pgeodol = categoriaproyectos(pplan,geofisica,com,2);\n \t\t...
[ "0.62769544", "0.6004395", "0.59830976", "0.59109706", "0.5859728", "0.5853233", "0.5853133", "0.5846432", "0.58263856", "0.5786247", "0.5771656", "0.57260394", "0.56810266", "0.5665846", "0.56460226", "0.5641083", "0.56286603", "0.56226933", "0.56169033", "0.5612296", "0.560...
0.62503254
1
Write an implementation of the pancake sorting algorithm (aka the prefix sorting algorithm) that returns the states after each flip. based on
function pancakeSort(arr) { function flip(arr, n) { const flipt = arr.slice(0, n+1).reverse().concat(arr.slice(n+1)) return flipt } for (let i = arr.length; i > 1; i--) { const max = Math.max(...arr.slice(0, i)) if (arr[i] !== max) { arr = flip (arr, arr.indexOf(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shellsort() {\r\n\tfor (var g = 0; g < this.gaps.length; ++g) {\r\n\tfor (var i = this.gaps[g]; i < this.dataStore.length; ++i) {\r\n\t\tvar temp = this.dataStore[i];\r\n\t\tfor (var j = i; j >= this.gaps[g] && this.dataStore[j-this.gaps[g]] > temp; j -= this.gaps[g]) {\r\n\t\t\tthis.dataStore[j] = this.d...
[ "0.5947306", "0.58915967", "0.5796209", "0.56679446", "0.5611599", "0.561038", "0.5588106", "0.5586284", "0.5584288", "0.55629057", "0.5548371", "0.5546156", "0.5495981", "0.5450728", "0.54412353", "0.54411316", "0.5419671", "0.54137814", "0.5381117", "0.53632426", "0.5353443...
0.6081348
0
Gets the effective TrendLineBrush for this indicator. Use the `actualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator.
get actualTrendLineBrush() { return brushToString(this.i.p9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get actualTickColor() {\n return brushToString(this.i.c7);\n }", "get actualSelectedBackground() {\n return brushToString(this.i.ff);\n }", "get tickColor() {\n return brushToString(this.i.ds);\n }", "get actualUncheckedBorderColor() {\n return brushToString(this.i.c9);\n...
[ "0.54289156", "0.50336707", "0.49021503", "0.47672483", "0.4760161", "0.4741363", "0.46648207", "0.4551871", "0.45053348", "0.44921118", "0.44747505", "0.44651133", "0.44375655", "0.44233212", "0.4416461", "0.4415206", "0.4407058", "0.43927327", "0.43927327", "0.43927327", "0...
0.7384816
0
If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
getSeriesValueBoundingBox(world) { let iv = this.i.lv(toPoint(world)); return fromRect(iv); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSeriesValueBoundingBox(world) {\r\n let iv = this.i.lv(toPoint(world));\r\n return fromRect(iv);\r\n }", "function getBoundingBox(t){\n var bb = {};\n bb.yLeast = t.n.y;\n bb.yMost = t.n.y;\n bb.xLeast = t.n.x;\n bb.xMost = t.n.x;\n\n t.parents.forEach(function(p){\n if(p.y > bb.yMos...
[ "0.7922159", "0.63378924", "0.6221359", "0.6211458", "0.60572463", "0.60572463", "0.60572463", "0.60572463", "0.60572463", "0.60572463", "0.60572463", "0.6036869", "0.6036869", "0.6036869", "0.6036869", "0.59333724", "0.58273876", "0.5790107", "0.5730527", "0.57271355", "0.57...
0.7896807
1
This sample demonstrates how to Updates (patches) a snapshot.
function updateASnapshot() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "{subscription-id}"; const resourceGroupName = "myResourceGroup"; const snapshotName = "mySnapshot"; const snapshot = { diskSizeGB: 20, tags: { department...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "snapshot() {\n throw new Error('Unsupported operation on snapshots: snapshot');\n }", "function updateASnapshotWithAcceleratedNetworking() {\n return __awaiter(this, void 0, void 0, function* () {\n const subscriptionId = \"{subscription-id}\";\n const resourceGroupName = \"myResourceG...
[ "0.5930053", "0.558919", "0.5504331", "0.54743266", "0.5283119", "0.52285206", "0.5200832", "0.5166234", "0.5164703", "0.5122384", "0.5085576", "0.4983632", "0.4982666", "0.4982666", "0.4982666", "0.4982059", "0.4968049", "0.49678147", "0.4962763", "0.49127626", "0.49055004",...
0.66094184
0
Load text with Ajax synchronously: takes path to file and optional MIME type
function loadTextFileAjaxSync(filePath, mimeType, callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", filePath,true); if (mimeType != null) { if (xmlhttp.overrideMimeType) { xmlhttp.overrideMimeType(mimeType); } } xmlhttp.onload = callback; xmlhttp.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTextFileAjaxSync(filePath, mimeType)\n{\n var xmlhttp=new XMLHttpRequest();\n xmlhttp.open(\"GET\",filePath,false);\n if (mimeType != null) {\n if (xmlhttp.overrideMimeType) {\n xmlhttp.overrideMimeType(mimeType);\n }\n }\n xmlhttp.send();\n if (xmlhttp.status==200)\n {\n return x...
[ "0.79925495", "0.7065096", "0.7053305", "0.7025209", "0.6924641", "0.69164616", "0.6877392", "0.6803784", "0.6753159", "0.67338103", "0.670563", "0.6616005", "0.66035974", "0.64734024", "0.6459767", "0.6437604", "0.6435179", "0.6417194", "0.6409089", "0.6344042", "0.6338462",...
0.80133516
0
Zwave Database In Memory Middleware This middleware is composed the following functions: 1. ZwaveDatabaseMemory adds a db to the server Usage: app.use(ZwaveDatabaseMemory)
function ZwaveDatabaseMemory(app) { _classCallCheck(this, ZwaveDatabaseMemory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MemoryStore() {\n Store.call(this)\n this.sessions = Object.create(null)\n}", "function MemoryStore() {\n Store.call(this)\n this.sessions = Object.create(null)\n}", "function MemoryStore() {\n Store.call(this)\n this.sessions = Object.create(null)\n}", "function MemoryStore() {\n Store.call(...
[ "0.55015177", "0.55015177", "0.55015177", "0.55015177", "0.5461089", "0.53497756", "0.53426415", "0.53424364", "0.53342456", "0.5175537", "0.51339966", "0.51317304", "0.5105901", "0.5050269", "0.50497", "0.49915934", "0.49812222", "0.49661183", "0.48920813", "0.48695529", "0....
0.6865974
0
Use boundMethod to bind all methods on the target.prototype
function boundClass(target) { // (Using reflect to get all keys including symbols) var keys = undefined; // Use Reflect if exists if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') { keys = Reflect.ownKeys(target.prototype); } else { keys = Object.getOwnPropertyNames(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boundClass(target) {\n // (Using reflect to get all keys including symbols)\n var keys; // Use Reflect if exists\n\n if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {\n keys = Reflect.ownKeys(target.prototype);\n } else {\n keys = Object.getOwnPropertyNames(target.pr...
[ "0.7570443", "0.7559575", "0.75446", "0.75446", "0.75446", "0.75446", "0.73397994", "0.7283242", "0.7283242", "0.72498155", "0.7065909", "0.7034546", "0.6904244", "0.6862316", "0.6842339", "0.6842339", "0.6842339", "0.6842339", "0.6842339", "0.6842339", "0.6842339", "0.6792...
0.75995123
0
Given two layoutitems, check if they collide.
function collides(l1, l2) { if (l1 === l2) return false; // same element if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2 if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2 if (l1.y + l1.h <= l2.y) return false; // l1 is above l2 if (l1.y >= l2.y + l2.h) return false; // l1 is below l2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_boxes_collide(box1, box2) {\n // Consequence of the Separation Axis Theorem (SAT): if the two boxes overlap,\n // their projections on the two axes overlap as well. Conversely, if there is\n // a gap in one axis, then the boxes do not overlap.\n return box1.x <= box2.x + box2.width && box1.x + box...
[ "0.6786258", "0.6766976", "0.6756878", "0.6756878", "0.6755056", "0.67416954", "0.67269254", "0.6721208", "0.671265", "0.66887116", "0.66777104", "0.66704315", "0.66448975", "0.66359717", "0.6612575", "0.65612346", "0.65414923", "0.65196097", "0.6495518", "0.6490647", "0.6455...
0.6851317
1
Compact an item in the layout.
function compactItem(compareWith, l, verticalCompact) { if (verticalCompact) { // Bottom 'y' possible is the bottom of the layout. // This allows you to do nice stuff like specify {y: Infinity} // This is here because the layout must be sorted in order to get the correct bottom `y`. l.y = Math.mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compactItem(compareWith, l, verticalCompact) {\n\t if (verticalCompact) {\n\t // Bottom 'y' possible is the bottom of the layout.\n\t // This allows you to do nice stuff like specify {y: Infinity}\n\t // This is is here because it the layout must be sorted in order to get the correct bottom `y`....
[ "0.6323969", "0.6206254", "0.60738784", "0.5629205", "0.56151426", "0.5590744", "0.5447387", "0.5422879", "0.53898", "0.52616525", "0.5249735", "0.5215408", "0.5174104", "0.5083316", "0.5060512", "0.50144", "0.50092554", "0.49786332", "0.4936099", "0.49310687", "0.48996037", ...
0.63394624
0
this file contains information on one individual blog post finding it ny id this is where each individual disqus comment section is configured
function BlogDetails(props) { const [content, setContent] = useState(""); // content is a blog post in .md const blogId = props.match.params.id; // blogId is a number in sting const blogFile = props.match.params.title; // blogFile is the name-of-the-md-file useEffect(() => { setContent(props.location.state...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disqus_config() {\n this.page.url = eckoConfig('ecko_theme_base', 'ghost_absolute_url');\n this.page.identifier = eckoConfig('ecko_theme_base', 'ghost_comment_id');\n}", "function getPostComments(postId){\n // let endPoint = 'https://baas.kinvey.com/appdata/app_id/posts/post_id'\n retu...
[ "0.71360284", "0.6258276", "0.6109711", "0.6082562", "0.6039946", "0.6000544", "0.58862585", "0.58339876", "0.5812067", "0.5773452", "0.5770109", "0.57512194", "0.5745667", "0.5706389", "0.56926626", "0.56649184", "0.5627022", "0.56095135", "0.5603771", "0.55932355", "0.55508...
0.6619215
1
Extract the (URLencoded) name of a page from a full CLiki or Kiwi edit URL.
function pageNameFromURL(url) { if (isCLikiURL()) { return pageNameFromCLikiURL(url); } else { return pageNameFromKiwiURL(url); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPageName(url) {\r\n var index = url.lastIndexOf(\"/\") + 1;\r\n var filenameWithExtension = url.substr(index);\r\n var filename = filenameWithExtension.split(\".\")[0];\r\n return filename; \r\n}", "function nameFromURL(url)\n{\n var match = url.match...
[ "0.6831095", "0.65879905", "0.6516976", "0.6362438", "0.631396", "0.61456376", "0.5956208", "0.59262955", "0.59249014", "0.5885237", "0.5856212", "0.5847439", "0.58397835", "0.5813823", "0.5813823", "0.57840943", "0.5778452", "0.57614344", "0.57406545", "0.56954104", "0.56872...
0.73182523
0
Use an XMLHttpRequest to grab the source of a CLiki page.
function getCLikiPageSource(name, fn) { var url; url = "http://www.cliki.net/" + name + "?source"; // GM_log("Getting source from url '" + url + "'."); GM_xmlhttpRequest({ method: 'GET', url: url, headers: { 'User-agent': 'Mozilla/4.0 (compatib...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Get(url){\n let Httppreq = new XMLHttpRequest();\n Httppreq.open(\"GET\", url, false)\n Httppreq.send(null)\n return Httppreq.responseText;\n}", "function getContent( url )\n {\n // attempt to create XMLHttpRequest object and make the request\n try\n {\n ...
[ "0.6954814", "0.6923383", "0.67744756", "0.6760191", "0.6739778", "0.670872", "0.6653679", "0.6629727", "0.66119856", "0.65914446", "0.65659136", "0.65582824", "0.6514042", "0.65098935", "0.64959997", "0.64885813", "0.646726", "0.6448457", "0.64382935", "0.64382935", "0.64368...
0.73238146
0
Render a mime model.
render(model) { return renderers.renderHTML({ host: this.node, source: String(model.data[this.mimeType]), trusted: model.trusted, resolver: this.resolver, sanitizer: this.sanitizer, linkHandler: this.linkHandler, shouldTypeset: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(model) {\n return renderers.renderText({\n host: this.node,\n source: String(model.data[this.mimeType])\n });\n }", "render(model) {\n return renderers.renderLatex({\n host: this.node,\n source: String(model.data[this.mimeType]),\n ...
[ "0.724215", "0.68285006", "0.68053615", "0.6776496", "0.6615458", "0.60196257", "0.59790117", "0.57692224", "0.5711098", "0.56708634", "0.566276", "0.566276", "0.55309176", "0.54747456", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.5445698"...
0.72362745
1
Render a mime model.
render(model) { return renderers.renderText({ host: this.node, source: String(model.data[this.mimeType]) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(model) {\n return renderers.renderHTML({\n host: this.node,\n source: String(model.data[this.mimeType]),\n trusted: model.trusted,\n resolver: this.resolver,\n sanitizer: this.sanitizer,\n linkHandler: this.linkHandler,\n sh...
[ "0.72362745", "0.68285006", "0.68053615", "0.6776496", "0.6615458", "0.60196257", "0.59790117", "0.57692224", "0.5711098", "0.56708634", "0.566276", "0.566276", "0.55309176", "0.54747456", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.5445698", "0.544569...
0.724215
0
We use the target from the event to add the pressed class name to the selected button Touch start functionality for the buttons
function touchstarthandler(event) { var button= event.target; button.className ="pressed"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function touchendhandler(event)\r\n{\r\n var button= event.target;\r\n button.className =\"\";\r\n}", "function addSelectedClassBtn(target) {\n target.classList.add('selected-btn');\n}", "onFocus(event) {\n this.shadowRoot\n .querySelectorAll('button')\n .forEach((el) => el.classList.remove...
[ "0.7078531", "0.6782529", "0.6333356", "0.6202028", "0.6084645", "0.60739076", "0.60602915", "0.6058536", "0.6005553", "0.5965471", "0.59273034", "0.59090376", "0.58859724", "0.58795494", "0.5860457", "0.58410954", "0.5819658", "0.5800663", "0.57864827", "0.57725537", "0.5769...
0.80187494
0
close box when page is scrolling
function closeOnScroll($box, id) { $(window).on("scroll." + id, function () { $box.trigger("close", {enableAnim: false, box: $box}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollListener(){\n if((document.body.scrollTop + window.innerHeight) === document.body.scrollHeight){\n hideCookieBox();\n }\n}", "function closeDetail(){\n\tfadeOut(\"popup\", 100, 0.5, 0);\n\tfadeOut(\"page_overlay\", 80, 0.5, 0);\n\t//$('#logo').css('display','block');\n\tse...
[ "0.7284318", "0.7030081", "0.6759355", "0.66035545", "0.66035545", "0.6528518", "0.65102005", "0.6478281", "0.6436237", "0.64210397", "0.64210397", "0.64185196", "0.64106786", "0.64067155", "0.64054865", "0.63425606", "0.63419646", "0.6338856", "0.6317847", "0.63087326", "0.6...
0.7042762
1
Write a script that allocates array of 20 integers and initializes each element by its index multiplied by 5. Print the obtained array on the console.
function problem01_IncreaseArrayMembers() { var index = 0, result = new Array(20); for (index = 0; index < 20; index++) { result[index] = index * 5; } console.log(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maker(array) {\n \n var array = [];\n \n for(var i = 1;i <= 25; i++){\n array.push(i);\n }\n return array;\n }", "function increaseArrayMembers(args) {\n var n = +args[0],\n arr = [],\n i;\n\n\n for (i = 0; i < n; i += 1) {\n arr[i] = i * 5;\n cons...
[ "0.67794067", "0.6609734", "0.6410539", "0.6367668", "0.63116616", "0.61698526", "0.61679137", "0.60982424", "0.6043923", "0.6043354", "0.60366166", "0.6022841", "0.602092", "0.60127777", "0.59874505", "0.5981984", "0.5964926", "0.5960664", "0.5956504", "0.5955421", "0.595169...
0.6856215
0
Init function that has no paramaters. calcButtons variable that gets the element by its class name that affects all the input boxes with that class. A for loop that loops through the calcButtons variable when it is clicked. When the keydown event happens it will also run the calcKeys function.
function init() { var calcButtons = document.getElementsByClassName("calcButton"); for (var i = 0; i < calcButtons.length; i++) { calcButtons[i].onclick = buttonClick; } document.getElementById("calcWindow").onkeydown = calcKeys; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\r\n\r\n //Declaring the calcButtons variable and then setting it equal to the tags that share the class of \"calcButton\".\r\n var calcButtons = document.getElementsByClassName(\"calcButton\");\r\n\r\n for (var i = 0; i < calcButtons.length; i++) {\r\n calcButtons.addEve...
[ "0.8209252", "0.6856964", "0.6841129", "0.6802673", "0.6665194", "0.6584916", "0.6514194", "0.6452982", "0.64018226", "0.63508415", "0.633244", "0.6292309", "0.6288177", "0.61491394", "0.6116476", "0.60709494", "0.603756", "0.60242766", "0.592171", "0.591659", "0.59090626", ...
0.8170141
1
Handles dispatching an action when a new dropdown sort selection is made
handleSortClick(data) { this.props.updateSortOptions(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSubmit(e) {\n e.preventDefault();\n setSort(select)\n }", "function triggerSort() {\r\n sortByOrder($(\"#sort-order-asc-desc\").val());\r\n}", "handleFaveSortChange(selectedSort) {\r\n\t\tif (selectedSort == null) {\r\n\t\t\tthis.state.selectedSort = {\r\n\t\t\t\tvalue: undefin...
[ "0.69082737", "0.6623736", "0.6589841", "0.6585961", "0.6584298", "0.65134233", "0.6475006", "0.64743716", "0.64416", "0.6429966", "0.6381162", "0.6362823", "0.6354617", "0.62912285", "0.62868077", "0.62370193", "0.6222506", "0.62091285", "0.6163583", "0.61584026", "0.6134749...
0.668608
1
Loads tweets from server
function loadTweets() { $.ajax({ method: 'GET', url: '/tweets' }).done(function (tweets) { renderTweets(tweets); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTweets(){\r\n var response;\r\n response = $.ajax({\r\n url : twitterURLJSON,\r\n type : 'get',\r\n cache : false,\r\n contentType : 'application/json',\r\n timeout : 2000,\r\n success : function(data) {\r\n \t //DEBUG:\r\n \t //alert('SUCCESS:' + JSON.strin...
[ "0.8227644", "0.82144964", "0.8163512", "0.810382", "0.80781496", "0.807436", "0.8065676", "0.8035116", "0.8031267", "0.7979456", "0.7974939", "0.7901177", "0.78472334", "0.7804074", "0.77815026", "0.7736468", "0.76531154", "0.76352227", "0.7578049", "0.750955", "0.7490346", ...
0.8272022
0
Checks if all of the required messages for a handshake have been exchanged
hasHandshaken() { return this.handshake == 0b1111; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkHandshake(self) {\n\tif (self.hasHandshaken() && !self.handshakeHandled) {\n\t\tonHandshakeComplete(self);\n\t\tself.handshakeHandled = true;\n\t\treturn;\n\t}\n\tif ((self.handshake & V_SENT) == 0) {\n\t\tself.sendVersion();\n\t}\n}", "isValid() {\n\n return RecieveMessage.compareHashes(thi...
[ "0.68389773", "0.6403839", "0.6082335", "0.60804456", "0.57389504", "0.5657553", "0.5657553", "0.55137426", "0.54644096", "0.54588336", "0.5445076", "0.5445076", "0.5407667", "0.5376979", "0.53638893", "0.5345901", "0.53430593", "0.5323812", "0.5286233", "0.5258842", "0.52588...
0.6678196
1
Calls handshake complete if necessary also sends version if we have not
function checkHandshake(self) { if (self.hasHandshaken() && !self.handshakeHandled) { onHandshakeComplete(self); self.handshakeHandled = true; return; } if ((self.handshake & V_SENT) == 0) { self.sendVersion(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendFinished () {\n this.sendHandshakeMessage(HandshakeType.FINISHED,\n this.clientVerifyData())\n }", "renegotiate() {\n // reset variables\n // this._state = HandshakeStates.preparing;\n this._isHandshaking = true;\n this.lastProcessedSeqNum = -1;\n this.lastSentSeqN...
[ "0.69950205", "0.6795586", "0.628424", "0.628163", "0.61851877", "0.6057477", "0.6047897", "0.5980229", "0.59657234", "0.58368444", "0.58344615", "0.574967", "0.5708597", "0.56816477", "0.5660994", "0.56291085", "0.56254506", "0.56254506", "0.5578256", "0.55574363", "0.552478...
0.7235671
0
Helper Function: Get Animation Phases
function getAnimationPhases( animation ) { var data = { 'burger-1' : { 'p1' : { 'burger' : { '' : '' }, 'patty' : { 'opacity' : 0 }, 'bunTop' : { 'transform' : 'translate3d(0, 0, 0)' }, 'bunBottom' : { 'transform' : 'translate3d(0, 0, 0)' } },...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_in_animation() {\n\t// Animation List - Animation must be set in _nav.scss\n\tvar animationList = [\n\t\t\"1s ease 0s 1 normal forwards running slide_down\",\n\t\t\"1s ease 0s 1 normal forwards running slide_to_right\",\n\t\t\"1s ease 0s 1 normal forwards running slide_to_left\"\n\t\t];\n\n\t// Animat...
[ "0.5879578", "0.57116693", "0.57076037", "0.5690769", "0.5679888", "0.5601001", "0.55998206", "0.55218005", "0.5498622", "0.5467598", "0.54644465", "0.54315245", "0.5326961", "0.5320029", "0.52969044", "0.52438116", "0.52438116", "0.52351576", "0.52163196", "0.5193778", "0.51...
0.7070052
0
funcion que resetea el formulario
function resetFormulario() { formulario.reset(); iniciarApp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetearFormulario(){\n\n formulario.reset();\n\n iniciarApp();\n\n}", "function resetForm(){\r\n\r\n formulario.reset();\r\n inciarApp();\r\n}", "resetearFormulario(){\n document.getElementById('formulario').reset();\n }", "function resetForm(){\n form.reset();\n }", "re...
[ "0.8636434", "0.84867394", "0.84026265", "0.83784384", "0.8263138", "0.8261228", "0.8234485", "0.8223729", "0.8208683", "0.81688535", "0.8150989", "0.81250334", "0.809846", "0.80279225", "0.7980987", "0.79804933", "0.7938255", "0.793817", "0.79225576", "0.7905495", "0.7894144...
0.8592156
1
generating a hidden IFrame
function HiddenIframe__create() { if ($("#HiddenIFrameContainer").length == 0) { var IFcontainer = document.createElement("div"); $(IFcontainer).attr("id","HiddenIFrameContainer"); $(IFcontainer).css("visibility","hidden"); $(IFcontainer).css("width","0px"); $(IFcontainer).css("height","0px"); $(IFcontaine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createIframe() {\n var span = document.createElement( \"span\" );\n params.IframeContainer.parent.appendChild( span );\n\n var iframeText = '<iframe id=\"' + internalID + '\" name=\"' + internalID +\n '\" src=\"javascript:\\'<html></html>\\'\"';\n\n // Add iframe...
[ "0.710988", "0.7054892", "0.6959744", "0.68509376", "0.6828785", "0.68122584", "0.66024256", "0.65705144", "0.65152735", "0.64856297", "0.640767", "0.6260547", "0.61773455", "0.6158126", "0.61463594", "0.61412793", "0.6130939", "0.6093872", "0.6083821", "0.6076828", "0.603911...
0.76025856
0
A deferred version of getJobsDone.
function getJobsDoneD(response) { var deferred; deferred = $.Deferred(); deferred.resolve(getJobsDone(response)); return deferred.promise(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolve() {\n this.cleanup();\n\n for (const job of this.jobs)\n job.resolve(false);\n\n this.jobs.length = 0;\n }", "function _reduceAwaiting() {\n --_awaitingAfterLoad;\n\n // if no items were left trigger finished event\n if (!items.length && !_awaitingAfterLoad...
[ "0.65286636", "0.59133893", "0.58652115", "0.5752776", "0.570942", "0.569001", "0.5667808", "0.56219304", "0.5567331", "0.5556573", "0.5547035", "0.54990035", "0.54239136", "0.54205376", "0.5398198", "0.5398198", "0.53753966", "0.5373922", "0.5366641", "0.5366641", "0.5366286...
0.7263538
0
returns a random integer from 1 to val
function randNumber(val){ return Math.floor(Math.random() * val) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genNum(val){\n return Math.floor(Math.random() * val + 1);\n}", "function randomInt( value ) {\n return Math.round( Math.random() * value );\n }", "function ranInt(num){\n return Math.floor((Math.random() * num)+1);\n }", "function randInt(){\n\treturn Math.floor(Math.random()...
[ "0.83678615", "0.7603413", "0.756979", "0.7560666", "0.7551565", "0.73886466", "0.73600364", "0.7288132", "0.72694886", "0.72576934", "0.72402865", "0.72194785", "0.72193277", "0.72193277", "0.71976084", "0.7184407", "0.71739656", "0.7163963", "0.7157508", "0.7153961", "0.715...
0.82530713
1
Disables or enables the toolbar. disabled (boolean) True to disable, false to enable. No return value.
function disableToolbar(disabled) { $('.admin-toolbar').toggleClass('disabled', disabled); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disable() {\n enabled = false;\n }", "function disable() {\n enabled = false;\n }", "function disable() {\n enabled = false;\n }", "disable() {\n this.enabled = false;\n }", "function disable() {\n _enabled = false;\n...
[ "0.68020064", "0.68020064", "0.6784594", "0.6775289", "0.67670983", "0.6753762", "0.67341083", "0.67236996", "0.67236996", "0.67236996", "0.67236996", "0.67236996", "0.67236996", "0.67236996", "0.67236996", "0.66182715", "0.66182715", "0.66182715", "0.66182715", "0.66182715", ...
0.7723971
0
Called when content is pasted into the content editor. Converts image URLs to images and grabs embed code from various providers. event (object) A paste event. No return value.
function handlePaste(event) { let pastedData = event.content; // Check for anything that looks like a URL if(pastedData.match(/^https?:\/\//i)) { event.stopPropagation(); event.preventDefault(); // Generate embed code from URL insertContentFromUrl(pastedData); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initPaste() {\n window.ondragover = function(e) { e.preventDefault(); return false };\n window.ondrop = function(e) { e.preventDefault(); return false };\n logger.debug(\"initial paste\");\n $(\"#textBox\").on(\"dragover\", function() {\n $(this).addClass(\"hover\");...
[ "0.7303286", "0.71741307", "0.6980195", "0.693895", "0.67022943", "0.6656934", "0.6287055", "0.6250255", "0.6023529", "0.6011922", "0.60024977", "0.5986759", "0.59676194", "0.5940579", "0.5865177", "0.5844705", "0.58316165", "0.58218706", "0.5773455", "0.57608205", "0.5747492...
0.7914671
0
Hides the drop zone. No return value.
function hideDropzone() { // Hide the dropzone after a short delay to prevent flickering in some browsers when dragging // over a child element of the dropzone. dropzoneTimeout = setTimeout(() => { $('#dropzone').prop('hidden', true); $('#dropzone .dropzone-target').removeClass('active'); },...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hide() {\n bed.style.visibility = 'hidden';\n }", "hideZone() {\n this.zone && document.body.removeChild(this.zone);\n }", "function hideDropMarker() {\n const marker = createOrGetDropListMarker();\n marker.classList.add(\"hidden\");\n}", "dropoff(elem) {\r\n elem.hide();\r\...
[ "0.69453496", "0.6929197", "0.6897578", "0.67730486", "0.67685604", "0.6599058", "0.6598184", "0.6598184", "0.65810263", "0.6560183", "0.65508115", "0.65486854", "0.65192515", "0.64885306", "0.6485561", "0.644032", "0.64276636", "0.642331", "0.6417872", "0.6402703", "0.640142...
0.7012773
0
Fetches metadata from the specified URL and inserts an embed based on that info. url (string) The URL to fetch metadata from. callback (function) A callback function with
function insertContentFromUrl(url) { // Check for images and insert them directly into the editor if(url.match(/^https?:\/\/(.*?)\.(gif|jpg|jpeg|png|svg)$/i)) { return contentEditor.insertImage(url); } // Fetch embed code NProgress.start(); $.ajax({ url: embedAction, type: 'GE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrapeEmbedMeta(doc, url) {\n\tvar translator = Zotero.loadTranslator(\"web\");\n\t//Embedded Metadata translator\n\ttranslator.setTranslator(\"951c027d-74ac-47d4-a107-9c3069ab7b48\");\n\n\ttranslator.setDocument(doc);\n\n\ttranslator.setHandler(\"itemDone\", function(obj, item) {\n\t\t//remove all caps i...
[ "0.63347363", "0.5849196", "0.5799073", "0.56815064", "0.56166893", "0.5482406", "0.5335452", "0.5327381", "0.53156143", "0.52686113", "0.5232448", "0.5215659", "0.5186137", "0.51717365", "0.51622033", "0.5150274", "0.5109025", "0.51056606", "0.50955355", "0.5091053", "0.5034...
0.613995
1
Tells if the user is dragging a file (as opposed to an HTML element). Returns a boolean.
function isDraggingFile(event) { if(event.originalEvent === undefined) return false; if(event.originalEvent.dataTransfer === undefined) return false; return $.inArray('Files', event.originalEvent.dataTransfer.types) > -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFileDragEvent(e)\n {\n if (e && e.originalEvent)\n {\n var dataTransfer = e.originalEvent.dataTransfer;\n if (dataTransfer)\n {\n // either files are filled or types by browsers\n if (containsFiles(dataTransfer))\n ...
[ "0.7744393", "0.72599846", "0.7123258", "0.68942106", "0.68942106", "0.68942106", "0.6835123", "0.6779508", "0.64806646", "0.64675766", "0.64593446", "0.6434592", "0.6313044", "0.6313044", "0.6313044", "0.6297836", "0.62911654", "0.62911654", "0.6287558", "0.6251418", "0.6180...
0.82098645
0
Called when the frame loads. Disables certain interactions and initializes content editors. No return value.
function loadFrame() { // Keep a reference to the frame's document object frameDoc = $('#editor-frame').get(0).contentWindow.document; // Hide the loader $('.main-container').removeClass('loading'); // Check for missing helpers by scanning for their output for(let helper of [ { code: '{@...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initEditor() {\n // Request Tag Names from Atlas and add them to the extraTags\n if (!atlasQueryService.isActive()) {\n $timeout(function() {\n ctrl.view.editor.readOnly = 'nocursor';\n ...
[ "0.6588165", "0.64529747", "0.64375407", "0.6421796", "0.621518", "0.6192175", "0.61099374", "0.6052967", "0.60198134", "0.6003927", "0.6000298", "0.5995273", "0.5943909", "0.5941921", "0.5941055", "0.5937182", "0.5936251", "0.5892678", "0.58667064", "0.58633816", "0.58612674...
0.6720684
0
Renders and loads a preview with a smooth transition. This method essentially wraps renderPreview but takes care of the loading state and fade in/out animations. Returns a promise that resolves after the preview loads and all animations are complete.
function loadPreview(postData) { return new Promise((resolve) => { // Show the loader $('.main-container').addClass('loading'); // Fade the frame out while we switch templates. This provides a smooth transition as styles // and other resources are loaded. $('#editor-frame').animateCSS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updatePreview() {\n\n // no preview desired? => abort\n if ( !self.preview ) return;\n\n // (re)render preview\n const instance = await self.target.start( self.getValue() );\n $.setContent( self.element.querySelector( '#preview' ), instance.root );\n\n ...
[ "0.6459822", "0.5816009", "0.5816009", "0.5816009", "0.5723913", "0.56807685", "0.56643045", "0.56195265", "0.5606426", "0.5599863", "0.55421686", "0.5264769", "0.5161902", "0.5161902", "0.5161902", "0.5084996", "0.5022903", "0.5017003", "0.5001181", "0.4979817", "0.49711853"...
0.7262938
0
Renders a preview using the specified post data and hot swaps the page in the editor. postData (object) The data to render the post with. Returns a promise.
function renderPreview(postData) { return new Promise((resolve) => { // // How it works: // // 1. Create a dummy form and insert the cmd, options, and post data // 2. Create a dummy iframe that will receive the form // 3. Trigger the form to submit to the iframe // 4. S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPreview(postData) {\n return new Promise((resolve) => {\n // Show the loader\n $('.main-container').addClass('loading');\n\n // Fade the frame out while we switch templates. This provides a smooth transition as styles\n // and other resources are loaded.\n $('#editor-frame'...
[ "0.72912794", "0.6324837", "0.59625214", "0.5808497", "0.57843333", "0.57554847", "0.57274354", "0.56452703", "0.5613951", "0.55906594", "0.5587101", "0.55790657", "0.53765744", "0.53726137", "0.53607595", "0.53318465", "0.5264666", "0.52468884", "0.5218497", "0.5174525", "0....
0.71254104
1
Serializes all post data. Returns an object.
function serializePost() { return { title: titleEditor.isReady ? titleEditor.getContent() : null, content: contentEditor.isReady ? contentEditor.getContent() : null, slug: $('#slug').val() || Postleaf.Slug(titleEditor.getContent()), 'published-at': $('#pub-date').val() + ' ' + $('#pub-time')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Post(data) { this.data = data; return this; }", "function postData() {}", "function getPostData(){\n var postData = Platform.Request.GetPostData(0);\n var parsedData = Platform.Function.ParseJSON( postData );\n return parsedData;\n }", "function serializePostData() {\n event.preventDe...
[ "0.6096074", "0.60416424", "0.5839937", "0.5768012", "0.56775427", "0.5619869", "0.5583937", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", "0.5523562", ...
0.67417926
0
Shows the drop zone. target (element) The target element from a drag event. No return value.
function showDropzone(target) { target = $(target).parents().addBack(); clearTimeout(dropzoneTimeout); // Add the active class to the appropriate target ['post:image', 'post:content'].forEach((zone) => { $('#dropzone [data-target="' + zone + '"]') .toggleClass('active', $(target).is('[dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropping(event) {\n event.preventDefault();\n // console.log(event.target)\n // 1. retrieve the element that we want to srop\n let elementToDrop = event.dataTransfer.getData(\"text/plain\")\n // 2. append the element on the drop zone\n let elemNode = document.getElementById(elementToDrop...
[ "0.64377606", "0.63525045", "0.63252395", "0.62365335", "0.61077434", "0.6099629", "0.60793734", "0.60754746", "0.60513115", "0.6049991", "0.60234886", "0.5981052", "0.59474784", "0.5943374", "0.5942336", "0.5905998", "0.59048635", "0.5881609", "0.58799726", "0.58735496", "0....
0.7007998
0
Toggles fullscreen mode on and off.
function toggleFullscreen() { if(Screenfull.enabled) { Screenfull.toggle(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleFullscreen() {\n const currWin = remote.getCurrentWindow();\n currWin.setFullScreen(!currWin.isFullScreen());\n}", "function toggleFullScreen() {\n try {\n if (isFullScreen()) {\n closeFullscreen();\n } else {\n openFullscreen();\n }\n } catch (e) {\n // do nothing\n }\n...
[ "0.86133075", "0.8564496", "0.8478258", "0.819569", "0.81850034", "0.8181691", "0.81713444", "0.8136808", "0.8081571", "0.8054616", "0.8028586", "0.8028586", "0.799333", "0.7986029", "0.7966748", "0.79616255", "0.7951007", "0.7932349", "0.7928447", "0.79246026", "0.7923774", ...
0.8722048
0
Toggles word count on and off.
function toggleWordCount() { wordCount = !wordCount; Cookie.set('wordCount', wordCount + ''); $('#word-count').prop('hidden', !wordCount); updateToolbar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateWordCount() {\n let count = contentEditor.getWordCount();\n $('#word-count').prop('hidden', !wordCount);\n $('.word-count-none').prop('hidden', count > 0);\n $('.word-count-one').prop('hidden', count !== 1);\n $('.word-count-many').prop('hidden', count <= 1);\n $('.word-count').tex...
[ "0.6917371", "0.6731797", "0.64912117", "0.61860967", "0.60870385", "0.5865043", "0.58139825", "0.5735891", "0.56777704", "0.5633853", "0.554554", "0.54888797", "0.54633784", "0.54427016", "0.54338455", "0.54187334", "0.54060364", "0.5404101", "0.5394274", "0.5288564", "0.527...
0.83192635
0
Toggles zen mode on and off.
function toggleZenMode(state) { // Set status zenMode = state; Cookie.set('zenMode', state); // Show/hide theme toggle $('#zen-mode-theme').prop('hidden', !zenMode); if(contentEditor && contentEditor.isReady) { loadPreview(serializePost()); updateToolbar(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle() {\n this.on = !this.on;\n }", "function toggle_mode(){\n\t\tif (self.cmode == \"farm\"){\n\t\t\tset_mode(\"greenhouse\");\n\t\t} else {\n\t\t\tset_mode(\"farm\");\n\t\t}\n\t}", "function toggle(){\n if(connected){\n if(stateActual == \"ON\"){\n client.setBinaryState(0);\n }else{\n ...
[ "0.6712326", "0.66685086", "0.666268", "0.6574202", "0.65562844", "0.64823705", "0.6470204", "0.64670646", "0.6436799", "0.6298935", "0.627463", "0.6271742", "0.6261929", "0.6198845", "0.6184939", "0.618231", "0.6176827", "0.61623126", "0.6125513", "0.61178666", "0.6106643", ...
0.79704595
0
Sets the theme for zen mode.
function toggleZenTheme(theme) { Cookie.set('zenTheme', theme); $('[data-zen-theme]').attr('data-zen-theme', theme); // Set the theme on the editor frame's body $(frameDoc.body).attr('data-theme', theme); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTheme(themeIndex) {\n\tdocument.documentElement.style.setProperty('--bg-colour', \"#\" + themes[themeIndex].colours[0]);\n\tdocument.documentElement.style.setProperty('--header-colour', \"#\" + themes[themeIndex].colours[1]);\n\tdocument.documentElement.style.setProperty('--settings-bg-colour', \"#\" +...
[ "0.6780457", "0.6649142", "0.66194665", "0.66194665", "0.66194665", "0.6572599", "0.65406287", "0.64582545", "0.64510024", "0.64059645", "0.64059645", "0.63880605", "0.63734114", "0.63734114", "0.6357917", "0.634061", "0.633354", "0.631526", "0.6313541", "0.6280781", "0.62649...
0.7288405
0
Refreshes the revision table and its empty state based on the number of items. reload (boolean) If true, the revisions table will be reloadd. Returns a promise that resolves when the table has been updated.
function updateRevisionsTable(reload) { return new Promise((resolve, reject) => { // Update empty state let hasRevisions = $('#revisions').find('tr').length > 0; $('#revisions').find('table').prop('hidden', !hasRevisions); $('#no-revisions').prop('hidden', hasRevisions); // Reload the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reload() {\n return new Promise((resolve, reject)=> {\n try {\n global.r.tableList().contains(this.table)\n .do((databaseExists) => {\n return global.r.branch(\n databaseExists,\n { dbs_created: 0 },\n global.r.tableCreate(this.table)\n ...
[ "0.60668623", "0.5654521", "0.5629181", "0.55466896", "0.5428796", "0.5396972", "0.5390797", "0.53881174", "0.53352535", "0.5327587", "0.53001064", "0.5267963", "0.5266298", "0.5130042", "0.5123683", "0.50957924", "0.5092608", "0.5085679", "0.5051495", "0.4995871", "0.4980039...
0.75079125
0
Updates the toolbar by toggling enabled states for buttons and dropdowns. No return value.
function updateToolbar() { // View options $('[data-zen-mode]').toggleClass('enabled', zenMode); if(Screenfull.enabled) { $('[data-fullscreen]').toggleClass('enabled', Screenfull.isFullscreen); } $('[data-word-count]').toggleClass('enabled', wordCount); // Undo/redo $('[data-editor="c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setEditorAndButtonState() {\n const buttonList = this.template.querySelectorAll(TOOLBAR_SELECTOR);\n if (this.disabled) {\n buttonList.forEach(button => {\n button.setAttribute('disabled', true);\n });\n if (this.quill) {\n this.quill.dis...
[ "0.73778033", "0.71794176", "0.6658314", "0.6606364", "0.6601162", "0.6596718", "0.6519826", "0.6460449", "0.6367487", "0.63022816", "0.6211197", "0.62049043", "0.61439246", "0.6099511", "0.6089923", "0.60744405", "0.60723287", "0.60722333", "0.6053025", "0.6048424", "0.60178...
0.8004962
0
Updates the current word count.
function updateWordCount() { let count = contentEditor.getWordCount(); $('#word-count').prop('hidden', !wordCount); $('.word-count-none').prop('hidden', count > 0); $('.word-count-one').prop('hidden', count !== 1); $('.word-count-many').prop('hidden', count <= 1); $('.word-count').text(count); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCounter()\n{\n\tPromise.resolve(fb.getWords()).then((value)=>{\n\t\twordList = value;\n\t\tlet countText = document.querySelector(\"#count\");\n\t\tcountText.innerHTML = `Current # of Locations: ${wordList.length}`;\n\t});\n}", "function updateCounter() {}", "function updateCounter() {}", "fun...
[ "0.7309195", "0.6831393", "0.6831393", "0.66337216", "0.6607103", "0.6510747", "0.6416349", "0.6399096", "0.63498366", "0.6323162", "0.6322533", "0.631884", "0.6309554", "0.6265053", "0.62456715", "0.6219071", "0.6210659", "0.62040776", "0.61612743", "0.6142113", "0.61397374"...
0.788325
0
Uploads a file. options (object) file (object) The file to upload. action (string) The URL to send the request to. method (string) The HTTP method to use (default 'POST'). data (object) Additional form data to send to the server (default null). Returns a promise that resolve with an API response.
function upload(options) { return new Promise((resolve, reject) => { options = options || {}; let formData = new FormData(); // Append custom data if(typeof options.data === 'object') { for(let key in options.data) { formData.append(key, options.data[key]); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static uploadFile({ petId, additionalMetadata, file }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ...
[ "0.6196323", "0.6177366", "0.61727095", "0.6059814", "0.5836119", "0.5802454", "0.57833016", "0.57094336", "0.56582236", "0.5651165", "0.562597", "0.56140375", "0.5600992", "0.55817485", "0.5559017", "0.5553484", "0.55329984", "0.5532469", "0.5500615", "0.54988223", "0.547544...
0.7231431
0
Update the search engine preview
function updateSearchEnginePreview() { let slug = $('#slug').val(); let title = $.trim($('#meta-title').val()) || $.trim(titleEditor.getContent()); let description = $.trim($('#meta-description').val()) || $.trim($(contentEditor.getContent()).text()); $('.search-engine-preview-slug').text(slug)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePreview() {\n\n // no preview desired? => abort\n if ( !my.preview ) return;\n\n // (re)render preview\n my.target.start( self.getValue(), instance => $.setContent( self.element.querySelector( '#preview' ), instance.root ) );\n\n }", "async func...
[ "0.7379311", "0.7148526", "0.645938", "0.63547295", "0.62667364", "0.62135404", "0.6076848", "0.5997178", "0.59855235", "0.5978126", "0.5975137", "0.59380615", "0.58844334", "0.58784306", "0.5848971", "0.5847464", "0.58332276", "0.5828829", "0.5827713", "0.5807477", "0.578101...
0.78132284
0
Function:savePermitData() Description: Add new permit from ajax
function savePermitData() { $.ajax({ url: "/admin/forms/savePermitData", type: "POST", data: {title: $('.inp-permit-title').val(), description: $('.inp-permit-description').val(), id: $('.inp-permit-title').attr('data-id')}, dataType: 'JSON', cache: fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveDrugSusceptibility(tid, oid){\n\t\tconsole.log(oid);\n\t\tvar dataString = $(\"#drugSusceptibilityForm_\"+oid).serialize();\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: '/susceptibility/saveSusceptibility',\n\t\t\tdata: dataString,\n\t\t\tsuccess: function(){\n\t\t\t\tdrawSusceptibility(tid, oid);\...
[ "0.6491598", "0.62123895", "0.61835635", "0.6176186", "0.61612624", "0.605425", "0.6020558", "0.59906155", "0.59343714", "0.58976644", "0.588214", "0.586856", "0.5859683", "0.5818881", "0.5751119", "0.5702723", "0.5701075", "0.569632", "0.5694082", "0.56809855", "0.5665528", ...
0.8538095
0
Function:openPermitAgencyModal() Description: Open agency model and set fiels value required data
function openPermitAgencyModal(element) { $('#formagencyid').val(' '); $('#categotyId').val(' '); $('#agencyId').val('').trigger('change'); $('#contactPerson').val(' ').trigger('change'); var title = $(element).data('title'); var formId = $(element).data('formid'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openPermitInstrctionModal(element) {\n $('#permitInstructionId').val(' ');\n $('#permitId').val('');\n var title = $(element).data('title');\n var formId = $(element).data('formid');\n var permitAgencyId = $(element).data('permitinstructionid');\n var instructionT...
[ "0.68707186", "0.63108844", "0.61301386", "0.60915786", "0.5949844", "0.5916961", "0.58998704", "0.5888181", "0.58220106", "0.5818107", "0.5766029", "0.5713299", "0.5711968", "0.5685996", "0.5672884", "0.5638742", "0.5566061", "0.5538002", "0.5534303", "0.55167913", "0.551052...
0.67610633
1
Function:getReleatedAgency() Description: Get all agency related to the permit
function getReleatedAgency(permit_id) { $.ajax({ url: "/admin/forms/getReleatedAgency/" + permit_id, type: "POST", data: {formId: 2}, contentType: false, dataType: 'html', cache: false, processData: false, success: f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAgency(){\n $rootScope.availableAgency = [];\n\n $rootScope.availableAgency.push({\"id\" :0, \"name\": \"Toutes\",});\n\n if($rootScope.listChildAgencies && $rootScope.MotherAgency){\n $.each($rootScope.listChildAgencies, function(key, child){\n $rootScop...
[ "0.68583834", "0.5884199", "0.5738584", "0.5714177", "0.56275076", "0.55389315", "0.5310627", "0.53063947", "0.52883947", "0.5281903", "0.52717143", "0.52339333", "0.52268225", "0.5205817", "0.5200136", "0.51809895", "0.51760167", "0.5156515", "0.5132403", "0.51151764", "0.50...
0.6645894
1
Function:getReleatedForms() Description: Function use for get all form related to permit
function getReleatedForms(formId) { $.ajax({ url: "/admin/forms/getReleatedForms/" + formId, type: "POST", data: {formId: formId}, contentType: false, dataType: 'html', cache: false, processData: false, success: func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadExistingFormsAsList(){\n \n }", "get formElements() {\n return this.__formElements;\n }", "get form() { return this._internals.form; }", "get form() {\n return this.internals_.form;\n }", "get form () {\n\t\treturn this._form;\n\t}", "get form() {\n\t\treturn this.__form;...
[ "0.6301059", "0.61584103", "0.6058148", "0.6025804", "0.5851545", "0.5843475", "0.5843475", "0.5843475", "0.5843475", "0.5782019", "0.5716183", "0.5702313", "0.5646656", "0.564195", "0.5603338", "0.5588386", "0.5579559", "0.5570482", "0.55633074", "0.55528086", "0.5542482", ...
0.66787755
0
Function:openPermitAttchmentModal() Description: Function use for open popup model for uploaded form related attach file related to permit
function openPermitAttchmentModal(element) { $('#formAttachmentId').val(''); var title = $(element).data('title'); var formId = $(element).data('formid'); var formAttachmentId = $(element).data('documentid'); var mandatory = $(element).data('mandatory'); if(mandatory == 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openPermitInstrctionModal(element) {\n $('#permitInstructionId').val(' ');\n $('#permitId').val('');\n var title = $(element).data('title');\n var formId = $(element).data('formid');\n var permitAgencyId = $(element).data('permitinstructionid');\n var instructionT...
[ "0.7208509", "0.66072756", "0.6519542", "0.6245903", "0.6176038", "0.6144371", "0.6135648", "0.6090994", "0.608831", "0.6032522", "0.60320294", "0.5949595", "0.5906013", "0.58948654", "0.58913094", "0.58648944", "0.58625776", "0.58421576", "0.5837889", "0.5834369", "0.5829471...
0.78787595
0
Function:getReleatedFormAttachment() Description: Function use for get form related attach file related to permit
function getReleatedFormAttachment(formId) { $.ajax({ url: "/admin/forms/getReleatedFormAttachment/" + formId, type: "POST", data: {formId: formId}, contentType: false, dataType: 'html', cache: false, processData: false, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAttachment () {\r\n return this.attachment;\r\n }", "get attachmentInput() {\n return this._attachment;\n }", "handleAttachmentMessage() {\n let response;\n\n // Get the attachment\n let attachment = this.webhookEvent.message.attachments[0];\n console.log(\"Received a...
[ "0.669303", "0.618928", "0.6109576", "0.6079351", "0.5923016", "0.5835166", "0.58349264", "0.57789296", "0.565995", "0.56497794", "0.5627076", "0.561417", "0.5552516", "0.5547356", "0.55274624", "0.5467548", "0.5456531", "0.5443937", "0.54430103", "0.5428387", "0.536395", "...
0.7461465
0
Function:openPermitDeadlineModal() Description: Function use for open deadline model related to permit
function openPermitDeadlineModal(element) { var title = $(element).data('title'); var formId = $(element).data('formid'); $('#formDeadlineId').val(''); $('#date').val(''); $('#time').val(''); var formDeadlineId = $(element).data('deadlineid'); var date = $(element...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openEdit(obj) {\n var task = $(obj);\n\n var taskID = task.find(\".list-group-item\");\n var taskHead = task.find(\".list-group-item-heading\");\n var taskName = taskHead.text().substr(1);\n $('#editTask').val(taskName);\n\n var taskBody = task.find(\"p\");\n var taskDead = taskBody.t...
[ "0.6061819", "0.5931532", "0.56732035", "0.5600434", "0.5476737", "0.5432044", "0.5430854", "0.5400192", "0.53913385", "0.5387116", "0.5361281", "0.5325621", "0.5295284", "0.52903485", "0.52784914", "0.52618587", "0.5195753", "0.51398283", "0.5115485", "0.51104254", "0.509394...
0.77544695
0
Function:getReleatedFormAlerts() Description: Function use for get alert related to permit
function getReleatedFormAlerts(formId) { $.ajax({ url: "/admin/forms/getReleatedFormAlert/" + formId, type: "POST", data: {formId: formId}, contentType: false, dataType: 'html', cache: false, processData: false, succ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAlert() { return this.alert_; }", "get alerts() {\n return this.allAlerts.filter(alert => {\n return alert.hidden === false;\n });\n }", "get getAlert(){\n return this.alert();\n }", "function submitAlert() {\n\t// do some basic checking of inputs\n\tif ($('#inputKWhr...
[ "0.5369032", "0.5031301", "0.5021245", "0.50174767", "0.49443504", "0.4920815", "0.4891557", "0.48481244", "0.4836171", "0.4835667", "0.48235613", "0.4818276", "0.48067543", "0.47993562", "0.47950393", "0.4786213", "0.47666097", "0.47641665", "0.4758387", "0.47227147", "0.472...
0.6458612
0
Function:openPermitAttchmentModal() Description: Function use for open popup model for uploaded form related attach file related to permit
function openPermitInstrctionModal(element) { $('#permitInstructionId').val(' '); $('#permitId').val(''); var title = $(element).data('title'); var formId = $(element).data('formid'); var permitAgencyId = $(element).data('permitinstructionid'); var instructionTitle = $(el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openPermitAttchmentModal(element) {\n $('#formAttachmentId').val('');\n var title = $(element).data('title');\n var formId = $(element).data('formid');\n var formAttachmentId = $(element).data('documentid');\n var mandatory = $(element).data('mandatory');\n if(man...
[ "0.78787595", "0.66072756", "0.6519542", "0.6245903", "0.6176038", "0.6144371", "0.6135648", "0.6090994", "0.608831", "0.6032522", "0.60320294", "0.5949595", "0.5906013", "0.58948654", "0.58913094", "0.58648944", "0.58625776", "0.58421576", "0.5837889", "0.5834369", "0.582947...
0.7208509
1
check if a portal has a link to another portal
function isLinkedToPortal(portal, testId) { var result = false; portal.linkIndexes.forEach(function (id) { if (id == testId) { result = true; } }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkExists(allLinks, p1, p2) {\n for (var i = 0; i < allLinks.length; i++) {\n if (allLinks[i][0] == p1 && allLinks[i][1] == p2) {\n return true;\n }\n }\n return false;\n }", "isNewLink(...
[ "0.6395632", "0.63405937", "0.6268247", "0.6168978", "0.6132054", "0.6128078", "0.6097186", "0.6088873", "0.60653764", "0.6048034", "0.59208447", "0.58994263", "0.5893813", "0.58622783", "0.5843176", "0.5830537", "0.57577395", "0.57388586", "0.56804365", "0.5662826", "0.56610...
0.748326
0
check if a link between two portals already exists
function linkExists(allLinks, p1, p2) { for (var i = 0; i < allLinks.length; i++) { if (allLinks[i][0] == p1 && allLinks[i][1] == p2) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkRepeatLink(id1,id2){\n\tfor(var i = 0; i<programmingLinksArray.length;i++) {\n\t\tvar l = programmingLinksArray[i];\n\t\tif(l.locationInA == id1 && l.locationInB == id2){\n\t\t\treturn false;\n\t\t}\n\t\tif(l.locationInA == id2 && l.locationInB == id1){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true...
[ "0.70922095", "0.66188467", "0.6601578", "0.6468637", "0.6413594", "0.62784183", "0.626585", "0.62099636", "0.61725944", "0.6083876", "0.6072073", "0.6064656", "0.606153", "0.60389584", "0.60164785", "0.5950805", "0.59455067", "0.5906824", "0.5897743", "0.5894318", "0.5872639...
0.7223043
0
get ip:port from bytes
function parseServer(b, start) { const ipParts = [b[start], b[start+1], b[start+2], b[start+3]]; const ip = ipParts.join("."); const port = (b[start+4] * (16*16)) + b[start+5]; return {ip: ip, port:port}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getipaddress(theip){\n theip = theip.split(\":\");\n return theip[3];\n}", "function EIPtoIIP(port)\n{\n if((port >= 25565 && port <= 25570) || 222)\n return ipOpti;\n else if(port == 2222)\n return ipPi;\n return botIP;\n}", "function parseHost (addr) {\n const parts = a...
[ "0.6509989", "0.6302145", "0.61343926", "0.59912443", "0.5888281", "0.58144057", "0.57876515", "0.57467765", "0.5720591", "0.5710573", "0.5704314", "0.56984645", "0.5687354", "0.5637912", "0.56357443", "0.561415", "0.55777514", "0.5549634", "0.5548548", "0.543908", "0.5434897...
0.6708001
0
Fetch coins use it for pagination
function fetchCoins(pageNumber = 1) { $.ajax({ url: 'https://api.coingecko.com/api/v3/coins/markets', data: { vs_currency: 'usd', order: 'market_cap_desc', per_page: 50, page: pageNumber, sparkline: true, // ids: 'bitcoin,ethereum,litecoin,cardano', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTop5(){\n //sort function to organise the assoc array\n function sortFunction(a,b){\n if(a[1] === b[1]){\n return 0;\n }else{\n return(a[1] < b[1]? 1:-1);\n }\n }\n \n //get top 10 trading coins by vol\n var dataSet = [];\n functio...
[ "0.6396436", "0.6382063", "0.634573", "0.63027287", "0.6272047", "0.6267523", "0.6247074", "0.6236838", "0.6223062", "0.61841184", "0.6176638", "0.60896605", "0.60789883", "0.6008863", "0.5997625", "0.59385145", "0.59118766", "0.5845433", "0.5835239", "0.5827411", "0.5825235"...
0.7629334
0
Save sidebar state (open/close) to local storage
function updateSidebarState() { const sidebarState = localStorage.getItem('sidebarState') ? localStorage.getItem('sidebarState') : 'open'; if (sidebarState === 'open') $('.sidebar').removeClass('collapsed'); else $('.sidebar').addClass('collapsed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSidebarState(/*ChromeWindow*/ chromeWindow,\r\n /*SidebarWindow*/ sidebarWindow) {\r\n chromeWindow.chickenfootSidebarState = new SidebarState(sidebarWindow);\r\n}", "function toggleSidebar() {\n var sidebar = $(\"#sidebar\");\n var shown = sidebar.hasClass(\"collapse...
[ "0.7328392", "0.7195707", "0.66754127", "0.657299", "0.6398249", "0.638301", "0.63425386", "0.6260779", "0.61961734", "0.6185823", "0.6181511", "0.61710405", "0.6122707", "0.6119917", "0.6119503", "0.60947376", "0.6023913", "0.6016631", "0.6014782", "0.601007", "0.5967653", ...
0.8003363
0
Retrieves Gregoriancalendar eras for the given locale.
function getLocaleEraNames(locale, width) { var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); var erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Eras]; return getLastDefinedValue(erasData, width); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocaleEraNames(locale, width) {\n var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ɵfindLocaleData\"])(locale);\n var erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ɵLocaleDataIndex\"].Eras];\n return getLastDefinedValue(erasData, width);\n}", "function getLocaleE...
[ "0.57732147", "0.57622176", "0.57622176", "0.57481176", "0.57481176", "0.57481176", "0.57481176", "0.57481176", "0.57481176", "0.57481176", "0.57481176", "0.57192606", "0.57192606", "0.57192606", "0.5652239", "0.5483371", "0.54628843", "0.54391366", "0.5425207", "0.5425207", ...
0.5766304
1
builds and returns a map based on the values input value If the `keys` param is provided then the `values` param is treated as a string map. Otherwise `values` is treated as a string array.
function bulidMapFromValues(errorPrefix, trim, parseOutUnits, allowSubKeys, values, keys) { var map = {}; if (keys) { // case 1: map for (var i = 0; i < keys.length; i++) { var key = keys[i]; key = trim ? key.trim() : key; var value = values[key]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrToObj(keys, values) {\n\n const obj = {};\n const valuesIter = values.values();\n\n for (const key of keys) {\n obj[key] = valuesIter.next().value;\n }\n\n return obj;\n}", "static _parseKeyValue(keys, values) {\n const result = [];\n\n let error = false;\n\n if (keys.l...
[ "0.5912799", "0.5785135", "0.57602525", "0.53485775", "0.53351384", "0.5306329", "0.53005505", "0.5277252", "0.5275359", "0.52645296", "0.5261475", "0.51112217", "0.5098465", "0.5097438", "0.5073319", "0.50693023", "0.5066931", "0.50519377", "0.50054073", "0.5000209", "0.4988...
0.70653355
0
Generates translation declaration statements.
function getTranslationDeclStmts(variable, closureVar, message, meta, params, transformFn) { if (params === void 0) { params = {}; } var statements = []; statements.push.apply(statements, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(i18nTranslationToDeclStmt(variable, closureVar, message, meta, pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTranslationDeclStmts(variable,closureVar,message,meta,params,transformFn){if(params===void 0){params={}}var statements=[];statements.push.apply(statements,i18nTranslationToDeclStmt(variable,closureVar,message,meta,params));if(transformFn){statements.push(new ExpressionStatement(variable.set(transformFn...
[ "0.67885476", "0.64270157", "0.6336213", "0.6336213", "0.5281679", "0.5221374", "0.5166816", "0.5145476", "0.50850976", "0.5066052", "0.5055835", "0.50531787", "0.50086063", "0.500848", "0.49928975", "0.49698535", "0.4969828", "0.4955282", "0.49359375", "0.492167", "0.4914101...
0.64653295
1
Write a pipe definition to the output context.
function compilePipeFromRender2(outputCtx, pipe, reflector) { var definitionMapValues = []; var name = identifierName(pipe.type); if (!name) { return error("Cannot resolve the name of " + pipe.type); } var metadata = { name: name, pipeName: pipe.name, type: outputCtx....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compilePipeFromRender2(outputCtx, pipe, reflector) {\n const definitionMapValues = [];\n const name = identifierName(pipe.type);\n if (!name) {\n return error(`Cannot resolve the name of ${pipe.type}`);\n }\n const metadata = {\n name,\n pipeName: pipe.name,\n ty...
[ "0.60160184", "0.5939455", "0.5855944", "0.5855944", "0.57844853", "0.5614871", "0.56022704", "0.56022704", "0.5600575", "0.55460924", "0.5528451", "0.5528451", "0.5528451", "0.5528451", "0.54749554", "0.546521", "0.546521", "0.5445652", "0.54005414", "0.54005414", "0.5400541...
0.6022492
0
Gets an array of literals that can be added to an expression to represent the name and namespace of an attribute. E.g. `:xlink:href` turns into `[AttributeMarker.NamespaceURI, 'xlink', 'href']`.
function getAttributeNameLiterals(name) { var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(splitNsName(name), 2), attributeNamespace = _a[0], attributeName = _a[1]; var nameLiteral = literal(attributeName); if (attributeNamespace) { return [ literal(0 /* NamespaceURI */), li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAttributeNameLiterals(name) {\n const [attributeNamespace, attributeName] = splitNsName(name);\n const nameLiteral = literal(attributeName);\n if (attributeNamespace) {\n return [\n literal(0 /* NamespaceURI */), literal(attributeNamespace), nameLiteral\n ];\n }\n ...
[ "0.669552", "0.669552", "0.6693447", "0.5547418", "0.5352114", "0.5335648", "0.5325781", "0.53248173", "0.5316462", "0.53159195", "0.53159195", "0.530724", "0.530724", "0.5306479", "0.52752", "0.52226216", "0.52226216", "0.52003807", "0.5195208", "0.51856023", "0.51242787", ...
0.69277006
1
A helper function that returns `true` if a given `TNode` has any matching directives.
function hasDirectives(tNode) { return tNode.directiveEnd > tNode.directiveStart; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doesDirectiveExist(cspTokens, directive) {\n for(let cspToken of cspTokens) {\n if(directive === cspToken.trim().split(\" \")[0]) {\n return true;\n }\n }\n \n return false;\n}", "function isDirectiveNode(node) {\n return isNode(node) && node.type === 7;\n}", "f...
[ "0.68528366", "0.6825403", "0.62005395", "0.5871819", "0.58572364", "0.58572364", "0.5824924", "0.5824924", "0.5824924", "0.5824924", "0.5824924", "0.5824924", "0.57998925", "0.57393837", "0.5722262", "0.5646957", "0.5591102", "0.55866927", "0.5584736", "0.5584186", "0.558418...
0.7900778
0
Sets the active directive host element and resets the directive id value (when the provided elementIndex value has changed).
function setActiveHostElement(elementIndex) { if (elementIndex === void 0) { elementIndex = null; } if (_selectedIndex !== elementIndex) { setSelectedIndex(elementIndex == null ? -1 : elementIndex); activeDirectiveId = elementIndex == null ? 0 : MIN_DIRECTIVE_ID; activeDirectiveSuperClas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _activateByIndex( _index ){\n $nodes.removeClass('active').eq(_index).addClass('active');\n $indicators.removeClass('active').eq(_index).addClass('active');\n }", "function switchActiveElement(elements, activateIndex, activeClass, inactiveClass) {\n toArray(elements).fo...
[ "0.5949102", "0.58855164", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.57886094", "0.5683111", "0.56801933", "0.5641762", "0.5611417", "0.55768526", "0.55665064", "0.5560949", "0.5380616", "0...
0.831545
0
Returns the current id value of the current directive. For example we have an element that has two directives on it: dirOne>hostBindings() (id == 1) dirTwo>hostBindings() (id == 2) Note that this is only active when `hostBinding` functions are being processed. Note that directive id values are specific to an element (t...
function getActiveDirectiveId() { return activeDirectiveId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get id(){\n if(this.attrs){\n for(let attr of this.attrs.statements){\n // Fun fact: in html if an element has two id attributes, the browser only takes the\n // first one. How convenient for us.\n if(attr.key === \"id\"){\n return a...
[ "0.6027703", "0.59386665", "0.5853529", "0.5853529", "0.5803646", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5793945", "0.5788968", "0.5768387", "0.5734459", "0.568829", "0.56876385", ...
0.6068709
0
Increments the current directive id value. For example we have an element that has two directives on it: dirOne>hostBindings() (index = 1) // increment dirTwo>hostBindings() (index = 2) Depending on whether or not a previous directive had any inherited directives present, that value will be incremented in addition to t...
function incrementActiveDirectiveId() { activeDirectiveId += 1 + activeDirectiveSuperClassHeight; // because we are dealing with a new directive this // means we have exited out of the inheritance chain activeDirectiveSuperClassDepthPosition = 0; activeDirectiveSuperClassHeight = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextId() {\n currentId = currentId + 1;\n}", "idGet(increment) { // was get\n\t// called once for each id created for widget\n\treturn (this.idCounter+increment).toString();\n}", "function getId () {\n return _id++;\n }", "function increment_ids(elem, num) {\r\n //for each id in elemen...
[ "0.6039823", "0.5932284", "0.59056914", "0.5854271", "0.5803342", "0.5575268", "0.55687666", "0.55600715", "0.5532127", "0.5532127", "0.5532127", "0.5532127", "0.55310845", "0.5530684", "0.54952073", "0.5481641", "0.548154", "0.54564714", "0.5368387", "0.5365741", "0.5330132"...
0.7572919
0
Set the current super class (reverse inheritance) position depth for a directive. For example we have two directives: Child and Other (but Child is a subclass of Parent) // increment parentInstance>hostBindings() (depth = 1) // decrement childInstance>hostBindings() (depth = 0) otherInstance>hostBindings() (depth = 0 b...
function adjustActiveDirectiveSuperClassDepthPosition(delta) { activeDirectiveSuperClassDepthPosition += delta; // we keep track of the height value so that when the next directive is visited // then Angular knows to generate a new directive id value which has taken into // account how many sub-class di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActiveDirectiveSuperClassDepth() {\n return activeDirectiveSuperClassDepthPosition;\n}", "set depth(value) {}", "setDepth(value){this._depth=value;return this;}", "get depth() { return parseInt(new String(this._base.depth())) }", "function depth() {\n this.each((n) => {\n n.children....
[ "0.6513031", "0.60124147", "0.58626825", "0.56601405", "0.56209743", "0.5261241", "0.52331746", "0.5214304", "0.5176686", "0.5114984", "0.5059524", "0.50041145", "0.49024764", "0.48910546", "0.48908645", "0.47829708", "0.47242624", "0.47242624", "0.4675854", "0.45852888", "0....
0.67192966
0
Returns the current super class (reverse inheritance) depth for a directive. This is designed to help instruction code distinguish different hostBindings calls from each other when a directive has extended from another directive. Normally using the directive id value is enough, but with the case of parent/subclass dire...
function getActiveDirectiveSuperClassDepth() { return activeDirectiveSuperClassDepthPosition; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get depth() { return parseInt(new String(this._base.depth())) }", "function adjustActiveDirectiveSuperClassDepthPosition(delta) {\n activeDirectiveSuperClassDepthPosition += delta;\n // we keep track of the height value so that when the next directive is visited\n // then Angular knows to generate a new...
[ "0.58448416", "0.573973", "0.56964624", "0.56868184", "0.562577", "0.55198026", "0.5431659", "0.5411987", "0.5281493", "0.5279459", "0.5237226", "0.51884437", "0.51763743", "0.51685715", "0.516448", "0.5140639", "0.5112984", "0.5111274", "0.5111274", "0.5095234", "0.50777924"...
0.71842504
0
Sets the namespace used to create elements to `null`, which forces element creation to use `createElement` rather than `createElementNS`.
function namespaceHTMLInternal() { _currentNamespace = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "function namespaceHTMLIn...
[ "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.59856766", "0.5888178", "0.58465326", "0.5772129", "0.5703018", "0.5638407", "0.5566552", "0.5516616", "0.5516616", "0.5490972", "0.5...
0.621188
0
Determines whether or not the given string is a property metadata string. See storeBindingMetadata().
function isPropMetadataString(str) { return str.indexOf(INTERPOLATION_DELIMITER) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPropMetadataString(str) {\n return str.indexOf(INTERPOLATION_DELIMITER) >= 0;\n }", "function isPropertyTypeUri(uri) {\n return ($.inArray(unurify(uri), PROPERTY_TYPES) != -1); \n }", "function IsPropertyKey(argument) {\n if (Type(argument) === 'string') return true;\n if...
[ "0.7376088", "0.63992757", "0.5956341", "0.57723063", "0.57723063", "0.5727154", "0.566391", "0.5638361", "0.56074077", "0.55981874", "0.55981874", "0.558702", "0.5554349", "0.55198395", "0.55108553", "0.55108553", "0.55108553", "0.55108553", "0.55108553", "0.55108553", "0.55...
0.74657375
0
Sets the provided directive as the last directive index in the provided `TStylingContext`. Styling in Angular can be applied from the template as well as multiple sources of host bindings. This means that each binding function (the template function or the hostBindings functions) will generate styling instructions as w...
function updateLastDirectiveIndex(context, lastDirectiveIndex) { if (lastDirectiveIndex === TEMPLATE_DIRECTIVE_INDEX) { var currentValue = context[2 /* LastDirectiveIndexPosition */]; if (currentValue > TEMPLATE_DIRECTIVE_INDEX) { // This means that a directive or two contained a host bi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLastDirectiveIndex$1(tNode, directiveIndex) {\n updateLastDirectiveIndex(getClassesContext(tNode), directiveIndex);\n updateLastDirectiveIndex(getStylesContext(tNode), directiveIndex);\n}", "function ɵɵstyling() {\n var tView = getLView()[TVIEW];\n if (tView.firstTemplatePass) {\n ...
[ "0.65620726", "0.602234", "0.6018555", "0.5492009", "0.5492009", "0.5484087", "0.54635364", "0.5397814", "0.5359043", "0.5359043", "0.5335907", "0.5335907", "0.5335907", "0.5335907", "0.5335907", "0.5335907", "0.5335907", "0.53198105", "0.5274023", "0.5274023", "0.5274023", ...
0.742753
0
Temporary function which determines whether or not a context is allowed to be flushed based on the provided directive index.
function allowStylingFlush(context, index) { return (context && index === context[2 /* LastDirectiveIndexPosition */]) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "static ngTe...
[ "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345", "0.51536345"...
0.6976728
0
Determines whether the provided styling value is truthy or falsy.
function isStylingValueDefined(value) { // the reason why null is compared against is because // a CSS class value that is set to `false` must be // respected (otherwise it would be treated as falsy). // Empty string values are because developers usually // set a value to an empty string to remove i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function truthyOrFalsy(value) {\n if (value) {\n return true\n } else {\n return false\n }\n}", "function isStylingValuePresent(value) {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding shou...
[ "0.65650433", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.64387167", "0.6168963", "0.6154893", "0.6154893", "0.6127855", "0.6092547", "0.5962038", "0.5883625", "0.5776195", "0.5...
0.6939338
0
Returns an instance of `StylingMapArray`. This function is designed to find an instance of `StylingMapArray` in case it is stored inside of an instance of `TStylingContext`. When a styling context is created it will copy over an initial styling values from the tNode (which are stored as a `StylingMapArray` on the `tNod...
function getStylingMapArray(value) { return isStylingContext(value) ? value[0 /* InitialStylingValuePosition */] : value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allocTStylingContext(initialStyling) {\n // because map-based bindings deal with a dynamic set of values, there\n // is no way to know ahead of time whether or not sanitization is required.\n // For this reason the configuration will always mark sanitization as active\n // (this means that whe...
[ "0.591752", "0.5504194", "0.5037035", "0.50190043", "0.50089884", "0.49436906", "0.49243617", "0.49151427", "0.49151427", "0.4878305", "0.48729226", "0.48646235", "0.48528183", "0.4831129", "0.4829374", "0.48097596", "0.48097596", "0.47632882", "0.4757094", "0.47327948", "0.4...
0.66539115
0
Retrieve the root view from any component or `LView` by walking the parent `LView` until reaching the root `LView`.
function getRootView(componentOrLView) { ngDevMode && assertDefined(componentOrLView, 'component'); var lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView); while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) { lView = getLViewParent(lView); } ngDevMode ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) {\n lView = getLViewParent(lView);\n }\n ...
[ "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7374342", "0.7210224", "0.7210224", "0.71764743", "0.71764743", "0.71385694", "0.6633102", "0.6633102", "0.658164", "0.6395502", "0.6341106", "0.6341106", ...
0.74188495
1