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 |
|---|---|---|---|---|---|---|
Open add new folder dialog | function openNewFolderDialog(mobile) {
build = "\
<div id='full-page-container'>\
<div id='inline-fields'>\
<button class='hideButton' onclick='unloadFullPageContainer();'></button>\
<h1>Give name to your folder</h1>\
<input id='file-name' type='text' class='wide-fat mt-10' placeholder='Folder name'>\... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openCreateFolderDialog(){\r\n\t\t\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_create_folder\");\r\n\t\tif(objDialog.length == 0)\r\n\t\t\tthrow new Error(\"The create folder dialog must be here\");\r\n\t\t\r\n\t\t//init fields\r\n\t\tjQuery(\"#uc_dialog_create_folder_name\").val(\"\");\r\n\t\t\r\n\t\t//oep... | [
"0.7616536",
"0.73049694",
"0.68762755",
"0.6780992",
"0.6777072",
"0.67077",
"0.6670909",
"0.6649842",
"0.6627476",
"0.65858436",
"0.6582482",
"0.65370756",
"0.65093446",
"0.6499887",
"0.6419596",
"0.6418188",
"0.63731456",
"0.6333699",
"0.63243985",
"0.62994003",
"0.6244817... | 0.7367268 | 1 |
Open remove plugin dialog | function openRemovePluginDialog(mobile) {
build = "\
<div id='full-page-container'>\
<div id='inline-fields'>\
<button class='hideButton' onclick='unloadFullPageContainer();'></button>\
<h1>You are going to delete your project.</h1>\
<h2 class='border-b-e5e5e5'>Are you sure for that ?</h2>\
<div c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UninstallPlugin()\n{\n let txt = \"¿Está seguro de querer desinstalar este plugin?\";\n let conf = confirm(txt);\n \n if(conf)\n {\n $.post(\"api/\",{uninstall_plugin: $(this).attr(\"plugin\")}).done(function(info)\n {\n console.log(info);\n if(info!=\"fa... | [
"0.70723057",
"0.69870484",
"0.69530314",
"0.6942024",
"0.6763463",
"0.67531765",
"0.6649567",
"0.6445761",
"0.64001256",
"0.6361242",
"0.6338329",
"0.6335329",
"0.6295082",
"0.6294813",
"0.6267361",
"0.62297046",
"0.62226135",
"0.6176205",
"0.60455287",
"0.6034795",
"0.60290... | 0.74743927 | 0 |
Open upload update dialog | function openUploadUpdateDialog(mobile) {
build = "\
<div id='full-page-container'>\
<div id='inline-fields'>\
<button class='hideButton' onclick='unloadFullPageContainer();'></button>\
<h1>Choose file to upload</h1>\
<h2 style='padding-bottom: 5px;'>Only .ZIP files!</h2>\
<input type='file' id='u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openUploader() {\n\t$(\"#diaUpload\").dialog(\"open\");\n}",
"function openDialogUpload(objManager){\r\n\t\t\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_upload_files\");\r\n\t\t\r\n\t\tobjDialog.data(\"manager\", objManager);\r\n\t\t\r\n\t\tvar buttonOpts = {};\r\n\t\t\r\n\t\tbuttonOpts[\"Close\"] = uplo... | [
"0.7290025",
"0.69610703",
"0.6915224",
"0.65501434",
"0.64892167",
"0.64881146",
"0.6458176",
"0.64329535",
"0.6328427",
"0.63047326",
"0.62588423",
"0.6188928",
"0.6183157",
"0.61602247",
"0.6152556",
"0.6139034",
"0.611429",
"0.61133945",
"0.6082436",
"0.6073333",
"0.60682... | 0.73313147 | 0 |
Build plugin control container | function buildPluginControlContainer(pluginID, pluginName, pluginSlug, pluginLocation, pluginState, pluginAuthor, pluginStoreID, mobile) {
build_holder = "\
<div id='plugin-"+pluginID+"' class='plugin-container'>\
</div>\
";
$("#plugins-container").append(build_holder);
//Send request
var requestType;
if (w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initPlugins() {}",
"initPlugins() {}",
"setupChildInjector(){\n this.PluginLogger.log('Creating plugin injection Context.',3)\n this.PluginDI.service('LateError', (error) => {\n this.PluginLogger.error('Encountered a late error and cannot continue.')\n this.ErrorAccumulator.push(error)\n e... | [
"0.6168543",
"0.6168543",
"0.5860376",
"0.5850033",
"0.58000064",
"0.5776355",
"0.56208",
"0.56086504",
"0.56007904",
"0.5599826",
"0.55946726",
"0.5587739",
"0.5584303",
"0.5580483",
"0.5577101",
"0.5572806",
"0.55421907",
"0.553433",
"0.5492359",
"0.5481775",
"0.54653436",
... | 0.6536167 | 0 |
Build plugin store plugin container | function buildPluginStoreContainer(pluginID, mobile) {
build_ = "\
<div id='container-"+pluginID+"' class='plugin-container'>\
</div>\
";
if ( $("#container-"+pluginID).length ) {
$("#container-"+pluginID).replaceWith(build_);
} else {
$("#plugins-list").append(build_);
}
//Send request
var requestType... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildPluginControlContainer(pluginID, pluginName, pluginSlug, pluginLocation, pluginState, pluginAuthor, pluginStoreID, mobile) {\n\tbuild_holder = \"\\\n\t\t<div id='plugin-\"+pluginID+\"' class='plugin-container'>\\\n\t\t</div>\\\n\t\";\n\n\t$(\"#plugins-container\").append(build_holder);\n\n\t//Send re... | [
"0.61057425",
"0.58695626",
"0.56658876",
"0.55956715",
"0.5594252",
"0.5594252",
"0.5562693",
"0.54400015",
"0.5426995",
"0.540962",
"0.5338121",
"0.5302518",
"0.52789944",
"0.52755874",
"0.5252274",
"0.52505463",
"0.5242748",
"0.52309865",
"0.52239484",
"0.51987493",
"0.519... | 0.6537555 | 0 |
Function creates new Java Arraylist (Rowset) using function 'arguments'. | function xdtlArray() {
var a = new java.util.ArrayList(arguments.length);
for (var i = 0; i < arguments.length; i++) {
a.add(arguments[i]);
}
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeArrayOfItems () {\n return Array.from(arguments)\n}",
"function create2DArr(rows){\n //start an array\n var array = [];\n \n //loop through the array\n for(var i=0;i<rows;i++){\n //put an array in that index\n array[i] = [];\n }\n \n return array;\n}",
"funct... | [
"0.5679564",
"0.5667831",
"0.56066257",
"0.5274337",
"0.52595425",
"0.51682365",
"0.5122682",
"0.5100399",
"0.5099681",
"0.5086453",
"0.5041721",
"0.50392246",
"0.5033913",
"0.5027579",
"0.50082725",
"0.5002178",
"0.49665618",
"0.49598145",
"0.49370256",
"0.4936855",
"0.49315... | 0.66198534 | 0 |
Convert comma separated list to new single column rowset. (NOT xdtl:Read command friendly). | function xdtlListToRowset(s) {
var arr = s.split(',');
var a = new java.util.ArrayList(arr.length);
for (var i = 0; i < arr.length; i++) {
a.add(arr[i].toString().trim());
}
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitListStrUsingComma(sourceStr) {\n // FILL THIS IN\n var splitSourceArray = [];\n splitSourceArray = sourceStr.split(',');\n return splitSourceArray;\n }",
"function readList(reader){\r\n\t\tvar ret=[];\r\n\t\tvar x=reader();\r\n\t\tif(x)\r\n\t\t\tret.push(x);\r\n\t\t... | [
"0.57929736",
"0.5677022",
"0.5654514",
"0.5616448",
"0.54188305",
"0.52305555",
"0.52041286",
"0.5199891",
"0.51875484",
"0.5097455",
"0.5078852",
"0.50722057",
"0.50578904",
"0.50019175",
"0.4996922",
"0.49881908",
"0.4987993",
"0.49791852",
"0.4973033",
"0.48838848",
"0.48... | 0.7382665 | 0 |
Install our link under [Settings > script_name ] | function installMenu() {
wkof.Menu.insert_script_link({
name: script_name,
submenu: "Settings",
title: script_name,
on_click: openSettings,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }",
"function install_menu() {\n var config = {\n ... | [
"0.70652366",
"0.6624693",
"0.6457269",
"0.6457269",
"0.6457269",
"0.6457269",
"0.64215183",
"0.641787",
"0.641787",
"0.62586504",
"0.6257975",
"0.6257975",
"0.6257975",
"0.62455946",
"0.6110806",
"0.60252225",
"0.59967715",
"0.59935373",
"0.59935373",
"0.59935373",
"0.599353... | 0.69773626 | 1 |
Retrieve reviews from API and calculate metrics | async function collectMetrics() {
// Get all reviews within interval hours of now
let firstReviewDate = new Date(
Date.now() - settings.interval * 60 * 60 * 1000
);
let options = {
last_update: firstReviewDate,
};
let reviewCollection = await wkof.Apiv2.fetch_endpoint("reviews", opt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getReviews() {\n $.post('http://trypadvisorreviewsservice-LB-2114261024.us-west-2.elb.amazonaws.com/api/review/' + this.state.attractionId, (reviews) => {\n this.setState({\n reviews: reviews,\n reviewTotals: {\n totalAll: reviews.length,\n total5star: reviews.reduce((acc, r... | [
"0.73013955",
"0.71957207",
"0.67562896",
"0.6605719",
"0.65768564",
"0.65614295",
"0.65446854",
"0.6475567",
"0.6449642",
"0.6426547",
"0.6360083",
"0.63555086",
"0.62944746",
"0.6276254",
"0.62305856",
"0.62292784",
"0.62101614",
"0.61993957",
"0.6199254",
"0.61899775",
"0.... | 0.74423975 | 0 |
Determine if newTime is within maxMinutes of prevTime | function withinSession(prevTime, newTime, maxMinutes) {
let timeDifference = newTime - prevTime;
// increment appropriate pareto counter
for (let i = metrics.pareto.length - 1; i >= 0; i--) {
let bucket = metrics.pareto[i];
if (timeDifference >= bucket.rangeStart * 1000) {
bucket.count ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function minuteChecker(oldTime, timeDifference) {\n var minutePassed = true;\n if (new Date().getTime() - oldTime < timeDifference) {\n minutePassed = false;\n }\n return minutePassed;\n}",
"function checkBestTime(BestTime,currWinner){\n if(BestTime.min>=currWinner.min){\n if(BestTim... | [
"0.6405817",
"0.63834167",
"0.6333401",
"0.59977674",
"0.5986702",
"0.596369",
"0.59211344",
"0.58808535",
"0.58168566",
"0.58047444",
"0.57755363",
"0.57334137",
"0.5719817",
"0.56565773",
"0.56554174",
"0.5631913",
"0.56287843",
"0.56188",
"0.5600996",
"0.5536564",
"0.55285... | 0.72209466 | 0 |
Return the url from the Degrees list page | static getDegreesUrl() {
return EHUrls.getAllDegrees();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWorld()\r\n{\r\n\treturn location.href.split('.')[0].split('de')[1];\r\n}",
"function getAlbumListUrl(world) {\n const root = world.getRoot();\n let url;\n if (root) {\n // Parent's Albums tab.\n url = `${root}/albums`;\n } else {\n // Main Album List page.\n url = world.routes.albums... | [
"0.5533831",
"0.54813004",
"0.5458271",
"0.5424092",
"0.53055215",
"0.53032064",
"0.5297763",
"0.52871436",
"0.52624065",
"0.52591825",
"0.5258802",
"0.52344304",
"0.5215957",
"0.5183445",
"0.51804364",
"0.51716715",
"0.5147302",
"0.5145573",
"0.51257104",
"0.5109341",
"0.510... | 0.7751631 | 0 |
Returns an array with the diferent campus | static getCampus() {
return [
{
name: 'BI',
code: 3,
}, {
name: 'GI',
code: 2,
}, {
name: 'AR',
code: 1,
},
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_selected_camps() {\n\n\tvar camp_id = [];\n\t\n\t//get all selected camp ids\n\t$(\"#campaign_list\").each(function(){\n\t\tcamp_id.push($(this).val());\n\t});\n\t \n\treturn camp_id;\n}",
"function ciudades (){\nvar uniqueStorage = removeDuplicates(Storage, \"Ciudad\");\nvar atributos = Array();\n ... | [
"0.6469158",
"0.6185917",
"0.5799879",
"0.57698935",
"0.57182074",
"0.5527582",
"0.54595256",
"0.5445178",
"0.543596",
"0.5415736",
"0.5327334",
"0.5316791",
"0.52688986",
"0.52230614",
"0.5213587",
"0.52128124",
"0.5149889",
"0.5148566",
"0.5147934",
"0.5141582",
"0.51118606... | 0.66173124 | 0 |
create html error alert error = array. | function generateHtmlAlertError( error ){
var htmlError = " ";
htmlError += '<div class="alert alert-danger"';
htmlError += '<strong>Error! </strong>';
$.each(error,function(keyName,valueName){
htmlError += '<div class="item">';
htmlError += '<p>';
htmlError += '<strong>'+keyName+'</strong>';
htmlEr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateHtmlAlertError( error ){\r\n var htmlError = \" \";\r\n htmlError += '<div class=\"alert alert-danger\"';\r\n htmlError += '<strong>Error! </strong>';\r\n $.each(error,function(keyName,valueName){\r\n htmlError += '<div class=\"item\">';\r\n htmlError += '<p>';\r\n htmlError += '<stro... | [
"0.74122214",
"0.67571324",
"0.6562768",
"0.6505634",
"0.6502646",
"0.648415",
"0.648415",
"0.6482332",
"0.64582247",
"0.6452825",
"0.6447283",
"0.63942736",
"0.63890785",
"0.63728285",
"0.6364806",
"0.63540304",
"0.6326934",
"0.6248366",
"0.6247763",
"0.6246092",
"0.62348044... | 0.75171363 | 0 |
Removes tr from the comparison table if all children are empty | function pruneEmptyCompareRow(rowid){
var countFilled = 0;
$(rowid).children("td").each(function(){
if($(this).text().length > 0) countFilled++;
});
if(countFilled == 0) $(rowid).remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove_empty_rows() {\n var tableRows = document.querySelectorAll('#ComparisonTable tr + tr');\n var rowIndexesToRemove = [];\n for (let i = 0; i < tableRows.length; i++) {\n var remove = true;\n var cells = tableRows[i].querySelectorAll('td + td');\n for (let ... | [
"0.6728541",
"0.64836794",
"0.62133104",
"0.619998",
"0.6157313",
"0.6090241",
"0.59312636",
"0.5858956",
"0.5840102",
"0.5826487",
"0.57568234",
"0.5754805",
"0.57395804",
"0.5736623",
"0.5727045",
"0.57067764",
"0.5700878",
"0.56820077",
"0.5678051",
"0.5663984",
"0.5621463... | 0.7177241 | 0 |
Configure the protractor for running the E2E tests. | function protractor() {
var configObj = {
configFile: './protractor.conf.js'
};
if (gutil.env.suite) {
configObj['args'] = ['--suite', gutil.env.suite];
}
return gulp.src([])
.pipe(Protractor(configObj))
.on('error', function() {
gutil.log('E2E Tests failed');
process.exit(1);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spawnProtractor() {\n\n logger.info('Beginning e2e tests.');\n const protractorPath = path.resolve(\n 'node_modules',\n '.bin',\n 'protractor'\n );\n\n const protractor = spawn.spawn(\n protractorPath,\n [getProtractorConfigPath()],\n spawnOptions\n );\n\n protractor.on('exit', kil... | [
"0.7487704",
"0.6838098",
"0.65845186",
"0.643956",
"0.6389007",
"0.6349825",
"0.6121094",
"0.61035806",
"0.6015345",
"0.5784013",
"0.5731123",
"0.5651859",
"0.56181365",
"0.5599973",
"0.5561337",
"0.54519725",
"0.54151326",
"0.53777504",
"0.5324244",
"0.5321397",
"0.51682556... | 0.711271 | 1 |
flairFunction sets the flair for each commentor. | function flairFunction(fl, arr) {
for (i = 0; i < arr.length; i++) {
console.log(arr[i].name)
if (arr[i].name == fl) {
$('#flairHTML').html('<img class="flairClass" src=' + arr[i].src + ' />')
console.log(arr[i].src)
break
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFlair(flairClasses, flairText) {\n\t// Visually update the flair\n\t$('#id-user-flair').removeClass($('#id-user-flair').prop('class'));\n\t$('#id-user-flair').addClass(flairClasses);\n\tif (is.not.empty(flairText) && is.not.space(flairText)) {\n\t\t$('#id-user-flair').text(flairText);\n\t} else {\n\... | [
"0.5726554",
"0.4937417",
"0.48338503",
"0.48201242",
"0.46866855",
"0.46195978",
"0.4597167",
"0.45762217",
"0.45183545",
"0.451211",
"0.45073435",
"0.449107",
"0.44773751",
"0.4460333",
"0.44548637",
"0.44460538",
"0.43974474",
"0.43871614",
"0.4385123",
"0.43737167",
"0.43... | 0.5614826 | 1 |
Build CSW getRecords URLs. | function buildRequests (csw, start, increment, callback) {
utility.buildGetRecords(csw, start, increment, function (getUrl) {
callback(getUrl);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating... | [
"0.6409811",
"0.6150869",
"0.581901",
"0.5780864",
"0.5748901",
"0.56973666",
"0.5663476",
"0.55748904",
"0.5500686",
"0.54954314",
"0.5435685",
"0.54312193",
"0.5400181",
"0.53842497",
"0.5370673",
"0.53628314",
"0.53608114",
"0.5358204",
"0.535152",
"0.53495586",
"0.5322325... | 0.71930015 | 0 |
Scrape all of the WFS data in a CSW. If it's an 'aasg:WellLogs' WFS, then download all of the linkages for every feature in the WFS along with all of the feature data. | function scrapeWfs (base, csw, start, increment, max) {
start = typeof start !== "undefined" ? start : 1;
increment = typeof increment !== "undefined" ? increment : 10;
max = typeof max !== 'undefined' ? max : 10000000;
var dirs = utility.buildDirs(base);
// Another recursion here, expects the 'next' parame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onEachStation(feature, layer) {\n if (feature.properties && feature.properties[\"SITE NAME\"]) {\n var baseURL = \"http://www.co.thurston.wa.us/monitoring/\";\n var link = \"\";\n switch (feature.properties[\"SITE CODE\"]) {\n case '13u': link = '<a href=\"' + baseURL + ... | [
"0.55781263",
"0.54964775",
"0.5406103",
"0.5243677",
"0.51576126",
"0.5125789",
"0.5116506",
"0.50418955",
"0.50185645",
"0.5017723",
"0.5011356",
"0.49780384",
"0.49612147",
"0.49568886",
"0.4955927",
"0.495344",
"0.49505514",
"0.4931505",
"0.49246776",
"0.47972643",
"0.479... | 0.5564226 | 1 |
Another recursion here, expects the 'next' parameter same as 'scrapeCsw()' | function recursiveScrape (csw, start, increment, max) {
buildRequests(csw, start, increment, function (get) {
parse.parseCsw(get, function (data) {
if (data) {
async.waterfall([
function (callback) {
utility.constructorWfs(dirs, data, callback);
},
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n async.waterfall([\n function (callback) {\n utility.constructorCsw(dirs, data, callback);\n ... | [
"0.7340008",
"0.70909524",
"0.6897154",
"0.62521386",
"0.614434",
"0.595526",
"0.5894851",
"0.57934",
"0.5662445",
"0.5661462",
"0.56577855",
"0.56404316",
"0.56180483",
"0.55708814",
"0.55235666",
"0.54576546",
"0.54565823",
"0.5439231",
"0.5437596",
"0.54239726",
"0.5404684... | 0.7183921 | 1 |
Abstract function for pinging HTTP, HTTPS and FTP links. Expects a 'whichPing' parameter to determine whether to ping every single link it hits or if it should just ping each host once. | function makePing (base, csw, start, increment, max, whichPing) {
start = typeof start !== "undefined" ? start : 1;
increment = typeof increment !== "undefined" ? increment : 10;
max = typeof max !== 'undefined' ? max : 10000000;
var dirs = utility.buildDirs(base);
var global = [];
function recursivePing ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sourcePingCheck(sourceToPing, next) {\n if (skipPingCheck) {\n next();\n return;\n }\n\n self.log.trace({source: sourceToPing.url}, 'sourcePingCheck');\n self.clientFromSource(sourceToPing, function (cErr, client) {\n if (cErr) {\n ... | [
"0.5217722",
"0.48140305",
"0.46054322",
"0.4579005",
"0.4455899",
"0.44281623",
"0.4375703",
"0.42692307",
"0.4227199",
"0.42268956",
"0.4208813",
"0.42074484",
"0.4202413",
"0.4198272",
"0.41831642",
"0.41309285",
"0.411376",
"0.4111449",
"0.41052902",
"0.40530196",
"0.4040... | 0.4913357 | 1 |
Traverse every single file in the 'records' directory and upload them all to an Amazon S3 server. | function baseAwsS3 (base, s3Bucket) {
var recordsPath = path.join(base, '/outputs/records');
utility.longWalk(recordsPath, function (hosts) {
var hostsIndex = 0;
function recursiveHost (host) {
utility.longWalk(host, function (recs) {
var recsCount = recs.length;
var recsIndex = 0;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function s3Upload(files, bucketName, objectKeyPrefix, iamUserKey, iamUserSecret, callback) {\n var s3 = new AWS.S3({\n bucket: bucketName,\n accessKeyId: iamUserKey,\n secretAccessKey: iamUserSecret,\n apiVersion: '2006-03-01',\n });\n\n // s3.abortMultipartUpload(params, function (err, data) {\n /... | [
"0.67053205",
"0.6123518",
"0.58002436",
"0.5786717",
"0.5764046",
"0.5676626",
"0.5669142",
"0.5613407",
"0.5577076",
"0.55600494",
"0.5515174",
"0.55045456",
"0.5501708",
"0.5485064",
"0.54842037",
"0.54265004",
"0.5417999",
"0.5405309",
"0.5399889",
"0.537921",
"0.53245187... | 0.6873917 | 0 |
Starts a static server and returns a list of pages to snapshot. | async loadStaticPages(pathname) {
let config = this.percy.config.static;
let baseUrl = this.flags['base-url'] || config.baseUrl;
let dry = this.flags['dry-run'];
if (baseUrl && !baseUrl.startsWith('/')) {
this.error('The base-url must begin with a forward slash (/) ' + (
'when snapshottin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function startStaticServer() {\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(cors());\n\tapp.use(`/${config.staticHtmlUrl}`, express.static(config.staticHtmlPath), serveIndex(config.staticHtmlPath, {\n\t\ticons: true,\n\t\thidden: true,\n\t\tstylesheet: path.resolve(__dirname, './direct... | [
"0.6365043",
"0.63510174",
"0.63472265",
"0.6077726",
"0.60061336",
"0.59204924",
"0.5911934",
"0.5887096",
"0.5837344",
"0.5822828",
"0.57495123",
"0.57299876",
"0.56470436",
"0.5635843",
"0.5626668",
"0.561074",
"0.55481184",
"0.55409396",
"0.551535",
"0.5471788",
"0.546498... | 0.6808146 | 0 |
Loads pages to snapshot from a js, json, or yaml file. | async loadPagesFile(pathname) {
let ext = path.extname(pathname);
let baseUrl = this.flags['base-url'];
let pages = [];
if (baseUrl && !baseUrl.startsWith('http')) {
this.error('The base-url must include a protocol and hostname ' + (
'when snapshotting a list of pages'));
}
if (e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadPages() {\n this._pages = utility.getJSONFromFile(this._absoluteFile);\n }",
"async loadPagesFile(pathname) {\n let ext = _path.default.extname(pathname);\n\n if (ext === '.js') {\n let pages = require(_path.default.resolve(pathname));\n\n return typeof pages === 'function' ? await pages(... | [
"0.7341506",
"0.61757886",
"0.61236924",
"0.60716087",
"0.6034646",
"0.59854573",
"0.59847987",
"0.59204054",
"0.59204054",
"0.586273",
"0.5854092",
"0.5852902",
"0.58027476",
"0.57128906",
"0.5687154",
"0.568027",
"0.56466764",
"0.56251234",
"0.561436",
"0.56133693",
"0.5611... | 0.70909095 | 1 |
Return a resolved path for a given Monaco file. | function resolveMonacoPath(filePath) {
try {
return require.resolve(path.join('monaco-editor/esm', filePath));
}
catch (err) {
try {
return require.resolve(path.join(process.cwd(), 'node_modules/monaco-editor/esm', filePath));
}
catch (err) {
return re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolveFile (file) {\n return path.join(APP_ROOT, file)\n}",
"resolveAsPath() { }",
"function getPathByFile(file){\r\n\t\t\r\n\t\tvar path = g_activePath;\r\n\t\t\r\n\t\tif(file == \"..\"){\t\t//get parent path\r\n\t\t\tpath = getParentFolder(path);\r\n\t\t}else{\r\n\t\t\tvar isWinSlash = (path.index... | [
"0.6342855",
"0.6034342",
"0.5914572",
"0.58439463",
"0.5821625",
"0.5727247",
"0.56818265",
"0.56791145",
"0.56563705",
"0.55901855",
"0.5547937",
"0.55457836",
"0.5494013",
"0.54247624",
"0.54201955",
"0.53609693",
"0.5345959",
"0.53332704",
"0.5313267",
"0.5312137",
"0.530... | 0.72891164 | 0 |
Return the interpolated final filename for a worker, respecting the file name template. | function getWorkerFilename(filename, entry) {
return loaderUtils.interpolateName({ resourcePath: entry }, filename, {
content: fs.readFileSync(resolveMonacoPath(entry))
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFileName(index) {\n\tvar templateName = $(\"#page-template-\" + index).val();\n\t\n\tif (!lastScrapedId) {\n\t\t// Manual input.\n\t\treturn templateName + \".pdf\";\n\t}\n\t\n\tvar provider = $(\"#autofill-provider option:selected\").text();\n\tvar filename = provider + \"-\" + lastScrapedId + \"-\" +... | [
"0.6071791",
"0.5898312",
"0.5891991",
"0.5891991",
"0.57353884",
"0.5718492",
"0.5706961",
"0.5703392",
"0.5681572",
"0.55956954",
"0.55775017",
"0.55634093",
"0.5534171",
"0.5533751",
"0.5504613",
"0.5491756",
"0.5480836",
"0.54786086",
"0.5457382",
"0.54513633",
"0.544821"... | 0.74435395 | 0 |
Function that show form | function showForm() {
eManager.trigger('cleanManagementBox');
templates.render('csv-form', {}, function(html) {
var $boxContent = $('#management-box ._box-content');
$boxContent.append(html);
});
eManager.trigger('showManagementBox');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showForm(form) {\r\n // check if selected options is just the placeholder\r\n if (form === 'none') {\r\n return;\r\n }\r\n\r\n // reset open form\r\n openForm = null;\r\n\r\n // set dataType\r\n dataType = form;\r\n $(\"#form\").load('components/' + form + 'Form.html');\r\n\... | [
"0.74603784",
"0.7381017",
"0.7292653",
"0.7278613",
"0.7250089",
"0.7128959",
"0.7119826",
"0.70919764",
"0.7091168",
"0.7084499",
"0.7079244",
"0.7069087",
"0.70652235",
"0.70054233",
"0.69860166",
"0.6984025",
"0.6980723",
"0.6972165",
"0.69647604",
"0.6957255",
"0.6947943... | 0.74096745 | 1 |
Function that show tip(animation) | function showTip($tip) {
$tip.animate({
opacity: 1,
}, 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display_tip() {\n if (pause_on_tile === true) {\n g.paused = true;\n }\n\n show_description(g.progress); //description.js\n\n g.progress = g.progress + 1;\n}",
"showTooltip() {\n Animated.timing(this.animation, {\n toValue: 1,\n duration: 140,\n }).... | [
"0.7665192",
"0.716293",
"0.67305315",
"0.6453864",
"0.63824975",
"0.634363",
"0.6326855",
"0.6222728",
"0.6203313",
"0.6198592",
"0.6181701",
"0.6169528",
"0.6166127",
"0.61639154",
"0.61390144",
"0.613485",
"0.61331713",
"0.61315155",
"0.60982877",
"0.60920864",
"0.6077345"... | 0.7267275 | 1 |
Function that hide tip (animation) | function hideTip($tip) {
$tip.animate({
opacity: 0,
}, 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideTip() {\n tooltip.transition()\n .duration(250)\n .style(\"opacity\", 0);\n}",
"function hideTip() {\r\n\tif (v_visible == 1) {\r\n\t\tif (v_layer != null) {\r\n\t\t\tv_layer.style.visibility = 'hidden';\r\n\t\t\tv_visible = 0;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"function ... | [
"0.80133384",
"0.78383434",
"0.771999",
"0.7687672",
"0.76047397",
"0.7581073",
"0.7581073",
"0.7581073",
"0.75769174",
"0.74415636",
"0.737104",
"0.7308576",
"0.7270829",
"0.7235654",
"0.7223514",
"0.72016966",
"0.7199177",
"0.71934175",
"0.7145503",
"0.7144635",
"0.7091483"... | 0.82298964 | 0 |
Function that show error in case csv is not valid | function showError() {
alert('Error parsing csv');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateCSV(element) {\n\n if( element.validity.tooShort){\n element.setCustomValidity(\"Please enter a valid CSV. A valid CSV will be 3 or 4 characters long depending on your card.\");\n } else {\n element.setCustomValidity(\"\");\n }\n }",
"function parseCsv(csv) {\n if (csv.lengt... | [
"0.6840493",
"0.5992018",
"0.598907",
"0.5535139",
"0.5520324",
"0.54609776",
"0.5427544",
"0.5402553",
"0.5380576",
"0.53247845",
"0.53087085",
"0.5296594",
"0.52948374",
"0.52887356",
"0.52533513",
"0.52330256",
"0.52328396",
"0.52314806",
"0.5224348",
"0.521978",
"0.521886... | 0.7610169 | 0 |
Constructor for Allocated response button | function AllocateResponseButton(props) {
var _this = this;
_super.call(this, props, null);
this._boundHandleOnClick = null;
/**
* Method which handles the click event of window
*/
this.handleOnClick = function (source) {
/** check if the clicked elem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCannedResponseButton() {\n var spacer = document.createElement('div'),\n button = document.createElement('button'),\n i = document.createElement('i');\n\n spacer.classList.add(\"d-editor-spacer\");\n button.classList.add(\"ember-view\", \"btn\", \"no-text\", \... | [
"0.64589196",
"0.62429994",
"0.61604285",
"0.6146521",
"0.60316294",
"0.602771",
"0.596012",
"0.5942636",
"0.5926674",
"0.5911618",
"0.5901095",
"0.5899575",
"0.5863655",
"0.5834651",
"0.5823604",
"0.5807352",
"0.5805856",
"0.58035827",
"0.579926",
"0.5797053",
"0.57861286",
... | 0.73604983 | 0 |
global exports, system / ======== getLibs ======== | function getLibs(mod)
{
let GenLibs = system.getScript("/ti/utils/build/GenLibs.syscfg.js");
/* create a GenLibs input argument */
var linkOpts = {
name: "/ti/net",
deps: [],
libs: [GenLibs.libPath("ti/net", "slnetsock_release.a")]
};
return (linkOpts);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLibs(inst)\n{\n const libs = [];\n const board = Common.getLaunchPadFromDevice();\n\n if(inst.$static.genLibs)\n {\n // Get device ID and toolchain to select appropriate libs\n const GenLibs = system.getScript(\"/ti/utils/build/GenLibs.syscfg.js\");\n const toolchain = ... | [
"0.7293941",
"0.6966707",
"0.68238646",
"0.6809942",
"0.6791407",
"0.6484148",
"0.6374106",
"0.6374106",
"0.6269748",
"0.62196946",
"0.61574095",
"0.6109852",
"0.6103854",
"0.61038464",
"0.6016744",
"0.59997535",
"0.58691293",
"0.5868489",
"0.5839809",
"0.582593",
"0.57893056... | 0.7506541 | 0 |
changed the value of owner to newOwner | changeOwner(newOwner){
this.owner = newOwner;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processChangeOwner() {\n let ownerTextField = document.getElementById(TodoGUIId.LIST_OWNER_TEXTFIELD);\n let newOwner = ownerTextField.value;\n let listBeingEdited = window.todo.model.listToEdit;\n window.todo.model.updateListOwner(listBeingEdited, newOwner);\n }",
"async changeVac... | [
"0.72234553",
"0.7199003",
"0.69519866",
"0.6817571",
"0.6553501",
"0.65079963",
"0.6477356",
"0.6329687",
"0.6231116",
"0.61348444",
"0.59886855",
"0.59875095",
"0.59760535",
"0.5909754",
"0.590503",
"0.5768124",
"0.5707878",
"0.56914943",
"0.56687295",
"0.5571908",
"0.55635... | 0.858617 | 0 |
sort the items of an array by their total area then put them into a named group then return that groupItem | function sortItemsBySize(arr,groupName)
{
var result = [];
var group = tmpLay.groupItems.add();
group.name = groupName;
while(arr.length)
{
var largest = arr[0];
var largestBounds = getArea(largest);
var spliceIndex = 0;
for(var x=1,len=arr.length;x<len;x++)
{
if(getArea(arr[x]) > larges... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_sortItems(item) {\n const that = this;\n\n if (!that.grouped) {\n return;\n }\n\n const groups = [],\n groupChildren = [];\n let parent;\n\n if (item instanceof JQX.MenuItemsGroup) {\n parent = item.container.firstElementChild;\n }\... | [
"0.5949186",
"0.57424855",
"0.5671259",
"0.56607765",
"0.555039",
"0.5487969",
"0.5436059",
"0.5422715",
"0.5336835",
"0.53193337",
"0.5312838",
"0.5276675",
"0.52574843",
"0.5228871",
"0.52065665",
"0.51862085",
"0.5179337",
"0.51570207",
"0.51503855",
"0.5137446",
"0.513113... | 0.7210234 | 0 |
Initialize canvas, handlers, and camera | function Init() {
// Get context handles
CanvasHandle = document.getElementById("canvas");
CanvasHandle.width = ratioX * scale;
CanvasHandle.height = ratioY * scale;
ContextHandle = CanvasHandle.getContext("2d");
CanvasWidth = ContextHandle.canvas.clientWidth;
CanvasHeight = ContextHandle.ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n\tinitCamera();\n\tinitRenderer();\n\tinitControls();\n\trender();\n}",
"function init(){\n W = canvas.width = window.innerWidth;\n H = canvas.height = window.innerHeight;\n\n // getting all the frames into the array of frames\n loadFrames();\n // creating the origin object\n origin = ne... | [
"0.7520924",
"0.74766445",
"0.74600625",
"0.74362403",
"0.7311921",
"0.7309974",
"0.72922164",
"0.72844523",
"0.72534686",
"0.7247315",
"0.724718",
"0.7230293",
"0.72260064",
"0.72235155",
"0.7206386",
"0.72048795",
"0.7180594",
"0.7178409",
"0.7170602",
"0.7158788",
"0.71217... | 0.7508295 | 1 |
UpdateRender renders the design and then updates the canvas | function UpdateRender() {
// Set background
BackContextHandle.fillRect(0, 0, CanvasWidth, CanvasHeight);
// Render
BackContextHandle.save();
Render();
BackContextHandle.restore();
// Swap the backbuffer with the frontbuffer
var ImageData = BackContextHandle.getImageData(0, 0, CanvasWid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateRender() { controls.update(); TWEEN.update(); renderer.render(scene, camera); requestAnimFrame(updateRender); }",
"function UpdateRender() {\r\n // Set background\r\n BackContextHandle.fillRect(0, 0, CanvasWidth, CanvasHeight);\r\n\r\n // RenderSquares\r\n BackContextHandle.save();\r\n... | [
"0.7561372",
"0.742581",
"0.7404223",
"0.7325107",
"0.7297575",
"0.7197159",
"0.7096281",
"0.69460374",
"0.69293505",
"0.6885082",
"0.6860728",
"0.6852025",
"0.68427736",
"0.68041056",
"0.6772779",
"0.6760206",
"0.6714276",
"0.6688633",
"0.66826296",
"0.66824615",
"0.66736555... | 0.7477363 | 1 |
Returns if the specified page is a known and supported type. | function isSupportedPage(page, traceThis = true) {
if (traceThis) {
logTrace('invoking isSupportedPage($)', page);
}
const pageType = getPageType(page);
const result = (pageType !== null);
if (traceThis) {
if (result === true) {
logVerbose('Current page is supported:', page, pageType);
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pageIs(page){\n\t\treturn page.test(location.href);\n\t}",
"function pageType(){\r\n\tlist_pages=['page-WiHome','page-WiAltGenre','page-WiSimilarsByViewType','page-Kids','page-KidsAltGenre']\r\n\tif ($.inArray($(\"body\").attr(\"id\"),list_pages) >= 0){\r\n\t\treturn \"LIST\";\r\n\t}\r\n\telse{\r\n\t\tr... | [
"0.6882948",
"0.6258576",
"0.62161183",
"0.6187729",
"0.61350554",
"0.6070133",
"0.6030005",
"0.5840044",
"0.5838642",
"0.57970995",
"0.5751058",
"0.5740691",
"0.573824",
"0.57217157",
"0.5693028",
"0.56644195",
"0.5650274",
"0.5640509",
"0.56296706",
"0.56142145",
"0.5602160... | 0.72423154 | 0 |
Returns the type of the current page. | function getPageType(page) {
logTrace('invoking getPageType($)', page);
// remove trailing slash
page = page.replace(/\/$/, '');
switch (page) {
case '':
return 'frontpage';
case '/directory':
return 'categories';
case '/directory/all':
return 'channels';
case '/directory/gaming':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getObjectType(){\n\tif(_objectType == undefined){\n\t\t \n\t\tif(document.getElementById('scriptObjectForm')){\n\t\t\t _objectType = OBJECT_TYPE_SCRIPT;\n\t\t}else if(document.getElementById('pageForm')){\n\t \t\t _objectType = OBJECT_TYPE_PAGE;\n\t\t}\n\t}\n\n\treturn _objectType;\n}",
"function pageTy... | [
"0.65020645",
"0.639973",
"0.63785464",
"0.6281568",
"0.6223898",
"0.6177832",
"0.61550355",
"0.6105613",
"0.6092234",
"0.60632366",
"0.60470504",
"0.6022297",
"0.60173607",
"0.60173607",
"0.59747475",
"0.59573007",
"0.5949901",
"0.5879192",
"0.5879192",
"0.5879192",
"0.58791... | 0.66975653 | 0 |
Stops the current page change polling. | function stopPageChangePolling() {
logTrace('invoking stopPageChangePolling()');
window.clearInterval(onPageChangeInterval);
placeholderLoop = 0;
pageLoads = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stop() {\n if (!started)\n return;\n started = false;\n loading.value = false;\n onStopHandlers.forEach(function (handler) { return handler(); });\n onStopHandlers = [];\n if (query.value) {\n query.value.stopPolling();\n query.val... | [
"0.67055947",
"0.6685433",
"0.6657222",
"0.6545906",
"0.6500972",
"0.625105",
"0.62464976",
"0.6195631",
"0.6195631",
"0.6195631",
"0.6182027",
"0.61779344",
"0.61669177",
"0.6151737",
"0.60953444",
"0.6094041",
"0.6094041",
"0.6083937",
"0.6062716",
"0.6061816",
"0.6061816",... | 0.79893094 | 0 |
Attaches an observer to the sidebar of the current page, which will filter its items. | function observeSidebar() {
logTrace('invoking observeSidebar()');
const observerCooldown = 500;
const targetSelector = '[data-a-target^="side-nav-bar"]';
const target = rootNode.querySelector(targetSelector);
if (target !== null) {
const observer = new MutationObserver(function callback_observ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleShowFilter() {\n $('.primary-sidebar').toggleClass('open');\n }",
"function filterSidebar(mode = 'visible') {\n\t\tlogTrace('invoking filterSidebar()');\n\n\t\t// prevent filtering more than once at the same time\n\t\tif (sidebarFilterRunning === true) {\n\n\t\t\tlogWarn('Sidebar filter ... | [
"0.59440124",
"0.5838492",
"0.56928116",
"0.56899345",
"0.5631201",
"0.5598349",
"0.5466671",
"0.5441347",
"0.53830254",
"0.5376777",
"0.53644115",
"0.53086567",
"0.5250324",
"0.51959455",
"0.5193188",
"0.51745236",
"0.512573",
"0.5111942",
"0.5077903",
"0.5065412",
"0.506438... | 0.70886445 | 0 |
Checks for unprocessed items in the directory of the current page and dispatches a scroll event if necessary. | function listenToScroll() {
logTrace('invoking listenToScroll()');
const interval = 1000;
window.clearInterval(checkForItemsInterval);
checkForItemsInterval = window.setInterval(function checkForItems() {
// prevent listening during page load
if (pageLoads === true) {
logVerbose('Stopped checkForI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onScroll() {\n\t\tlogTrace('invoking onScroll()');\n\n\t\tif (pageLoads === true) {\n\n\t\t\tlogWarn('Cancelled emitted scroll event, because page load is in progress.');\n\t\t\treturn false;\n\t\t}\n\n\t\tlet remainingItems;\n\n\t\tif (\n\t\t\t(currentPageType !== 'following') ||\n\t\t\t(hideFollowing ==... | [
"0.7510631",
"0.6775852",
"0.6713531",
"0.6552199",
"0.61956626",
"0.6139247",
"0.6130419",
"0.59573907",
"0.59478545",
"0.58714664",
"0.5864476",
"0.5852923",
"0.58499765",
"0.58497274",
"0.5839888",
"0.582508",
"0.5819104",
"0.5811859",
"0.5810586",
"0.5802251",
"0.5777791"... | 0.8025892 | 0 |
Returns if the current document invokes the FFZ extension. | function usingFFZ() {
return (document.getElementById('ffz-script') !== null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInPreviewMode() {\n return getExtensionInfo().isPreview;\n}",
"function isFirefox() {\n return typeof InstallTrigger !== 'undefined';\n}",
"function isExtensionInstalled() {\n // Get the article tag data set.\n let article = document.querySelector('#surveyArticle');\n let data = article... | [
"0.5804202",
"0.5731768",
"0.5718671",
"0.5664966",
"0.56521493",
"0.56521493",
"0.56521493",
"0.56521493",
"0.56521493",
"0.56521493",
"0.56369394",
"0.56369394",
"0.56369394",
"0.56369394",
"0.56369394",
"0.55202174",
"0.5516791",
"0.5516791",
"0.55158216",
"0.548695",
"0.5... | 0.72775984 | 0 |
END: page state / BEGIN: filter operations Filters directory on the current page. Returns the remaining (not blacklisted) items. | function filterDirectory(mode = 'visible', remove = true) {
logTrace('invoking filterDirectory()');
// prevent filtering more than once at the same time
if (directoryFilterRunning === true) {
logWarn('Directory filter already running.');
return [];
}
directoryFilterRunning = true;
const items ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterDirectoryItems(items, remove = true) {\n\t\tlogTrace('invoking filterDirectoryItems($)', items);\n\n\t\tlet remainingItems = [];\n\n\t\tconst itemsLength = items.length;\n\t\tfor (let i = 0; i < itemsLength; i++) {\n\n\t\t\tconst item = items[i];\n\n\t\t\t// mark item node as being processed\n\t\t\t... | [
"0.66510093",
"0.65625733",
"0.6537236",
"0.61342347",
"0.6093334",
"0.60180426",
"0.59931546",
"0.59790343",
"0.5889082",
"0.5858683",
"0.58197653",
"0.57915324",
"0.5763528",
"0.56997854",
"0.5688288",
"0.5672478",
"0.5672478",
"0.5655644",
"0.56465244",
"0.5619872",
"0.559... | 0.6919288 | 0 |
Filters the provided items and returns the remaining (not blacklisted) items. | function filterDirectoryItems(items, remove = true) {
logTrace('invoking filterDirectoryItems($)', items);
let remainingItems = [];
const itemsLength = items.length;
for (let i = 0; i < itemsLength; i++) {
const item = items[i];
// mark item node as being processed
item.node.setAttribute('data-uttv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterSidebarItems(items) {\n\t\tlogTrace('invoking filterSidebarItems($)', items);\n\n\t\tlet remainingItems = [];\n\n\t\tconst itemsLength = items.length;\n\t\tfor (let i = 0; i < itemsLength; i++) {\n\n\t\t\tconst item = items[i];\n\n\t\t\t// mark item node as being processed\n\t\t\titem.node.setAttrib... | [
"0.74444634",
"0.6550225",
"0.6419927",
"0.626862",
"0.62235004",
"0.62159604",
"0.6208519",
"0.6208519",
"0.6076064",
"0.6065606",
"0.6065606",
"0.6042277",
"0.60283303",
"0.6021952",
"0.5950922",
"0.593475",
"0.59268254",
"0.5894367",
"0.5859204",
"0.577723",
"0.57491195",
... | 0.679419 | 1 |
Filters items in the sidebar of the current page. Returns the remaining (not blacklisted) items. | function filterSidebar(mode = 'visible') {
logTrace('invoking filterSidebar()');
// prevent filtering more than once at the same time
if (sidebarFilterRunning === true) {
logWarn('Sidebar filter already running.');
return [];
}
sidebarFilterRunning = true;
const items = getSidebarItems(mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterSidebarItems(items) {\n\t\tlogTrace('invoking filterSidebarItems($)', items);\n\n\t\tlet remainingItems = [];\n\n\t\tconst itemsLength = items.length;\n\t\tfor (let i = 0; i < itemsLength; i++) {\n\n\t\t\tconst item = items[i];\n\n\t\t\t// mark item node as being processed\n\t\t\titem.node.setAttrib... | [
"0.8016166",
"0.674508",
"0.6671647",
"0.64023566",
"0.5968654",
"0.5942281",
"0.5902928",
"0.58376884",
"0.5827117",
"0.5806154",
"0.57760274",
"0.57619953",
"0.5717262",
"0.56922483",
"0.5664527",
"0.5616556",
"0.5580679",
"0.5579585",
"0.5560802",
"0.55492395",
"0.5529252"... | 0.74597967 | 1 |
Filters the provided sidebar items and returns the remaining (not blacklisted) items. | function filterSidebarItems(items) {
logTrace('invoking filterSidebarItems($)', items);
let remainingItems = [];
const itemsLength = items.length;
for (let i = 0; i < itemsLength; i++) {
const item = items[i];
// mark item node as being processed
item.node.setAttribute('data-uttv-processed', '');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterSidebar(mode = 'visible') {\n\t\tlogTrace('invoking filterSidebar()');\n\n\t\t// prevent filtering more than once at the same time\n\t\tif (sidebarFilterRunning === true) {\n\n\t\t\tlogWarn('Sidebar filter already running.');\n\t\t\treturn [];\n\t\t}\n\n\t\tsidebarFilterRunning = true;\n\n\t\tconst ... | [
"0.7044154",
"0.67336094",
"0.65221894",
"0.59288734",
"0.58272904",
"0.57620597",
"0.5710526",
"0.5688882",
"0.56051487",
"0.558457",
"0.55333453",
"0.5526719",
"0.5521331",
"0.545942",
"0.54489195",
"0.5431824",
"0.53731525",
"0.5368541",
"0.5345151",
"0.53416",
"0.53382385... | 0.8549051 | 0 |
END: filter operations / BEGIN: item operations Returns all items matching the specified mode in the directory of the current page. | function getDirectoryItems(mode) {
logTrace('invoking getDirectoryItems($)', mode);
const items = [];
const itemNodes = getDirectoryItemNodes(mode);
const itemNodesLength = itemNodes.length;
for (let i = 0; i < itemNodesLength; i++) {
const item = readItem(
itemNodes[i]
);
if (item === ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirectoryItemNodes(mode) {\n\t\tlogTrace('invoking getDirectoryItemNodes($)', mode);\n\n\t\tif (typeof mode !== 'string') {\n\n\t\t\tthrow new Error('Argument \"mode\" is required. Expected a string.');\n\t\t}\n\n\t\tconst modes = {\n\t\t\t'visible': { prefix: '', suffix: ':not([data-uttv-... | [
"0.6280075",
"0.6106715",
"0.57779104",
"0.5436388",
"0.5349491",
"0.53419864",
"0.53193915",
"0.53134614",
"0.5285553",
"0.5229546",
"0.51770604",
"0.5141589",
"0.5073279",
"0.5037815",
"0.49762505",
"0.4975175",
"0.49717352",
"0.49211717",
"0.48954105",
"0.48633522",
"0.483... | 0.73061895 | 0 |
Returns all item nodes matching the specified mode in the directory of the current page. | function getDirectoryItemNodes(mode) {
logTrace('invoking getDirectoryItemNodes($)', mode);
if (typeof mode !== 'string') {
throw new Error('Argument "mode" is required. Expected a string.');
}
const modes = {
'visible': { prefix: '', suffix: ':not([data-uttv-hidden])' },
'hidden': ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirectoryItems(mode) {\n\t\tlogTrace('invoking getDirectoryItems($)', mode);\n\n\t\tconst items = [];\n\n\t\tconst itemNodes = getDirectoryItemNodes(mode);\n\t\tconst itemNodesLength = itemNodes.length;\n\n\t\tfor (let i = 0; i < itemNodesLength; i++) {\n\n\t\t\tconst item = readItem(\n\t\t\t\tit... | [
"0.7546794",
"0.61769813",
"0.5766174",
"0.57043946",
"0.57041126",
"0.5462038",
"0.5007814",
"0.4988374",
"0.49553445",
"0.49127844",
"0.49018633",
"0.48859754",
"0.47849494",
"0.47442332",
"0.46838862",
"0.46464062",
"0.46350184",
"0.46350184",
"0.46150893",
"0.46120623",
"... | 0.7631039 | 0 |
Returns all items matching the specified mode in the sidebar of the current page. | function getSidebarItems(mode) {
logTrace('invoking getSidebarItems($)', mode);
const items = [];
const itemNodes = getSidebarItemNodes(mode);
const itemNodesLength = itemNodes.length;
for (let i = 0; i < itemNodesLength; i++) {
const item = readSidebarItem(
itemNodes[i]
);
if (item ===... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterSidebar(mode = 'visible') {\n\t\tlogTrace('invoking filterSidebar()');\n\n\t\t// prevent filtering more than once at the same time\n\t\tif (sidebarFilterRunning === true) {\n\n\t\t\tlogWarn('Sidebar filter already running.');\n\t\t\treturn [];\n\t\t}\n\n\t\tsidebarFilterRunning = true;\n\n\t\tconst ... | [
"0.7190794",
"0.70373845",
"0.5642496",
"0.5641457",
"0.53806835",
"0.52538544",
"0.5234389",
"0.51565355",
"0.5147323",
"0.51314056",
"0.51301503",
"0.51115376",
"0.5079054",
"0.503899",
"0.5021812",
"0.4992923",
"0.4951679",
"0.49489695",
"0.4942701",
"0.49195585",
"0.49056... | 0.7968447 | 0 |
Returns all item nodes matching the specified mode in the sidebar of the current page. | function getSidebarItemNodes(mode) {
logTrace('invoking getSidebarItemNodes($)', mode);
if (typeof mode !== 'string') {
throw new Error('Argument "mode" is required. Expected a string.');
}
const modes = {
'visible': { prefix: '', suffix: ':not([data-uttv-hidden])' },
'hidden': { prefix:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSidebarItems(mode) {\n\t\tlogTrace('invoking getSidebarItems($)', mode);\n\n\t\tconst items = [];\n\n\t\tconst itemNodes = getSidebarItemNodes(mode);\n\t\tconst itemNodesLength = itemNodes.length;\n\n\t\tfor (let i = 0; i < itemNodesLength; i++) {\n\n\t\t\tconst item = readSidebarItem(\n\t\t\t\ti... | [
"0.7766015",
"0.6498068",
"0.60065216",
"0.56924146",
"0.5536221",
"0.5051269",
"0.5034694",
"0.50203854",
"0.5013917",
"0.49569288",
"0.49314582",
"0.48992014",
"0.4881188",
"0.48412842",
"0.48412246",
"0.48267692",
"0.47951838",
"0.47693503",
"0.47495118",
"0.47462878",
"0.... | 0.8261146 | 0 |
Returns item information based on the provided node. | function readItem(node) {
logTrace('invoking readItem($)', node);
if (!node) { return null; }
const target = node.getAttribute('data-a-target');
// category
if (/^card\-[0-9]+$/.test(target)) {
if (node.nodeName === 'ARTICLE') {
return readChannel(node);
}
return readCategory(node);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function item_info(item) {\n return parent.G.items[item.name];\n}",
"function getNodeInfo(node) {\n return new Promise(function(resolve, reject) {\n db.get('SELECT * FROM Node WHERE id = ?', [node], function(err, row) {\n if (err)\n return reject(err)\n resolve(row)\n })\n })\n}",
"fu... | [
"0.7364287",
"0.66601247",
"0.614886",
"0.5995682",
"0.59131616",
"0.5844842",
"0.5791888",
"0.5746478",
"0.57255876",
"0.57137424",
"0.5628011",
"0.56116456",
"0.5606903",
"0.5584304",
"0.55387646",
"0.5515848",
"0.55091685",
"0.54940146",
"0.5490118",
"0.54799694",
"0.54719... | 0.6762415 | 1 |
Returns information for a channel item based on the provided node. | function readChannel(node, findCategory = true, findTags = true) {
logTrace('invoking readChannel($, $, $)', node, findCategory, findTags);
let result = {
type: 'channels',
name: '',
category: '',
tags: [],
title: '',
rerun: false,
node: node
};
let buffer;
let par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readItem(node) {\n\t\tlogTrace('invoking readItem($)', node);\n\n\t\tif (!node) { return null; }\n\n\t\tconst target = node.getAttribute('data-a-target');\n\n\t\t// category\n\t\tif (/^card\\-[0-9]+$/.test(target)) {\n\n\t\t\tif (node.nodeName === 'ARTICLE') {\n\n\t\t\t\treturn readChannel(node);\n\t\t\t}... | [
"0.6579595",
"0.61927515",
"0.6167926",
"0.5976767",
"0.58394235",
"0.55392295",
"0.5501631",
"0.5401084",
"0.5335474",
"0.5279082",
"0.5257439",
"0.52003026",
"0.51702726",
"0.51553637",
"0.5155038",
"0.51344514",
"0.5117661",
"0.5015918",
"0.49687618",
"0.49606928",
"0.4945... | 0.6226024 | 1 |
Returns information for a category item based on the provided node. | function readCategory(node, findTags = true) {
logTrace('invoking readCategory($, $)', node, findTags);
let result = {
type: 'categories',
name: '',
category: '',
tags: [],
title: '',
rerun: false,
node: node
};
let buffer;
/* BEGIN: name */
buffer = node.clos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readItem(node) {\n\t\tlogTrace('invoking readItem($)', node);\n\n\t\tif (!node) { return null; }\n\n\t\tconst target = node.getAttribute('data-a-target');\n\n\t\t// category\n\t\tif (/^card\\-[0-9]+$/.test(target)) {\n\n\t\t\tif (node.nodeName === 'ARTICLE') {\n\n\t\t\t\treturn readChannel(node);\n\t\t\t}... | [
"0.659502",
"0.6068801",
"0.59034497",
"0.58464146",
"0.5787338",
"0.57825685",
"0.5770091",
"0.55828273",
"0.5530094",
"0.5515819",
"0.5500235",
"0.54911304",
"0.5446906",
"0.53801167",
"0.5356599",
"0.53498113",
"0.53016436",
"0.5207756",
"0.5207066",
"0.5197878",
"0.516657... | 0.6141495 | 1 |
Returns all tags found in the provided node. | function readTags(node) {
logTrace('invoking readTags($)', node);
let tags = [];
if (!node) { return tags; }
const tagsSelector = '[data-a-target]';
const nodes = node.querySelectorAll(tagsSelector);
const nodesLength = nodes.length;
if (nodesLength > 0) {
for (let i = 0; i < nodesLength; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTagsData(node,tag) {\n var tags = (node.tree.filter(e => e.tag ===tag) || []);\n return tags.map(t=>t.data);\n}",
"getTags() {\n let tickets = Array.from(this.root.querySelector(this.ticketsBlock).children);\n let tags = [];\n for (let i = 0; i < tickets.length; i++) {\n ... | [
"0.6724542",
"0.6509675",
"0.6397771",
"0.6245655",
"0.61566025",
"0.613915",
"0.6073001",
"0.60357714",
"0.60123855",
"0.5800884",
"0.57605475",
"0.57436514",
"0.5735372",
"0.5708997",
"0.57045054",
"0.56958663",
"0.56915957",
"0.56915957",
"0.56915957",
"0.56592244",
"0.564... | 0.69447243 | 0 |
Returns sidebar item information based on the provided node. | function readSidebarItem(node, findCategory = false) {
logTrace('invoking readSidebarItem($, $)', node, findCategory);
let result = {
type: 'channels',
name: '',
category: '',
tags: [],
title: '',
rerun: false,
node: node
};
let buffer;
/* BEGIN: name */
// co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function item_info(item) {\n return parent.G.items[item.name];\n}",
"getItem(item) {\n // Cannot use truthiness test because index zero may be passed.\n if (item != null) {\n // Access by index\n if (typeof item === 'number') {\n return this.items[item];\n } // Access by element\n\n ... | [
"0.5973755",
"0.5809277",
"0.5754774",
"0.57041675",
"0.55850625",
"0.5502199",
"0.544212",
"0.5309496",
"0.5301884",
"0.52911544",
"0.51900655",
"0.5178711",
"0.5114497",
"0.5064884",
"0.50586796",
"0.50428987",
"0.50238025",
"0.502111",
"0.4999298",
"0.49853113",
"0.4943798... | 0.69066423 | 0 |
Returns if the specified item is blacklisted. | function isBlacklistedItem(item) {
logTrace('invoking isBlacklistedItem($)', item);
// blacklisted for being a rerun
if (hideReruns && (item.rerun === true)) { return true; }
if (storedBlacklistedItems[item.type] === undefined) { return false; }
// blacklisted by name
if (matchTerms(item.name, item.type)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}",
"function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}",
"function isBlacklisted() {\... | [
"0.7044497",
"0.7044497",
"0.6945375",
"0.6576173",
"0.62687767",
"0.62508816",
"0.62093514",
"0.5953099",
"0.5939326",
"0.5937085",
"0.5822046",
"0.5664278",
"0.56108457",
"0.5610172",
"0.54832906",
"0.5452434",
"0.5448779",
"0.5442411",
"0.5387138",
"0.5368053",
"0.5243409"... | 0.83793265 | 0 |
Returns if the specified term matches against the provided blacklist. | function matchTerms(term, type) {
if (typeof term !== 'string') { return false; }
if (term.length === 0) { return false; }
const termL = normalizeCase(term);
// match against map
if (
(storedBlacklistedItems[type][term] !== undefined) ||
(storedBlacklistedItems[type][termL] !== undefined)
)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_is(term) {\n return (this._optionsService.options.termName + '').indexOf(term) === 0;\n }",
"_regExpMatchAllBlacklistItems (blacklist = [], routeName = '') {\n return this\n .get('blacklistArray')\n .filter(item => !!(new RegExp(`${item}`).test(routeName)));\n }",
"function checkBlackL... | [
"0.59452766",
"0.58148104",
"0.5717058",
"0.5635657",
"0.554",
"0.550236",
"0.5500457",
"0.5465374",
"0.54452574",
"0.544295",
"0.5417557",
"0.53815275",
"0.53788245",
"0.53672117",
"0.52771103",
"0.5240504",
"0.5237751",
"0.5222253",
"0.52076983",
"0.5194969",
"0.51656306",
... | 0.6621564 | 0 |
Removes the provided sidebar item node. Returns if the node could be removed. | function removeSidebarItem(item) {
logTrace('invoking removeSidebarItem($)', item);
const topNodes = [];
let topNode = item.node;
switch (item.type) {
case 'channels':
// traverse through the DOM and hide the topmost node
while (true) {
if (
(!topNode) ||
(topNode === documen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeItem() {\n const item = this.parentNode.parentNode\n const parent = item.parentNode\n parent.removeChild(item)\n}",
"remove(item) {\n const that = this;\n\n if (typeof (item) === 'number') {\n item = that._items[item];\n }\n else if (typeof item === 'strin... | [
"0.6546271",
"0.64329576",
"0.62837493",
"0.62692946",
"0.62244135",
"0.61195594",
"0.6040074",
"0.5991188",
"0.5988556",
"0.5978208",
"0.59638673",
"0.5961048",
"0.59299433",
"0.5926884",
"0.59177303",
"0.5895212",
"0.58758616",
"0.58657676",
"0.5845555",
"0.5814958",
"0.581... | 0.75248665 | 0 |
END: item operations / BEGIN: controls Attaches a hide button to all cards and tags in the directory of the current page. | function attachHideButtons(items) {
logTrace('invoking attachHideButtons($)', items);
const itemsLength = items.length;
for (let i = 0; i < itemsLength; i++) {
const item = items[i];
attachHideButtonToCard(item);
attachHideButtonsToTags(item);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideItem(tag) {\n $(tag).addClass('hidden');\n }",
"function hideSaveDeleteButtons() {\n artworkInfo.style.display = \"none\"\n}",
"function attachHideButtonToCard(item) {\n\t\tlogTrace('invoking attachHideButtonToCard($)', item);\n\n\t\tconst attachedKey = 'data-uttv-card-attached';\n\n\... | [
"0.6654018",
"0.6570834",
"0.6551762",
"0.65012777",
"0.65006655",
"0.64947945",
"0.6489289",
"0.6473113",
"0.6455786",
"0.63754624",
"0.6325379",
"0.624129",
"0.6237388",
"0.62159944",
"0.62030005",
"0.6195371",
"0.6191024",
"0.61868584",
"0.61777943",
"0.6176723",
"0.616905... | 0.6763513 | 0 |
Attaches a hide button to the provided card node. | function attachHideButtonToCard(item) {
logTrace('invoking attachHideButtonToCard($)', item);
const attachedKey = 'data-uttv-card-attached';
// prevent attaching the button more than once
if (item.node.getAttribute(attachedKey) !== null) {
return logVerbose('Hide button already attached to card.', item);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cardHide(card) {\n if (card != null && card != undefined){\n card.classList.add(\"close\");\n setTimeout(function hide(){\n card.classList.remove(\"open\");\n card.classList.remove(\"show\");\n card.classList.remove(\"close\");\n }, 1000);\n }\n}",
"function hideDealButton() {\... | [
"0.65054965",
"0.64386845",
"0.6427337",
"0.642499",
"0.6415935",
"0.63181597",
"0.63045937",
"0.6269515",
"0.6244003",
"0.62127185",
"0.6204247",
"0.620119",
"0.6201057",
"0.62002563",
"0.6193528",
"0.6180246",
"0.61458147",
"0.6137996",
"0.61361015",
"0.6127779",
"0.610022"... | 0.7465112 | 0 |
Attaches a hide button to each tag node in the provided node. | function attachHideButtonsToTags(item) {
logTrace('invoking attachHideButtonsToTags($)', item);
const attachedKey = 'data-uttv-tags-attached';
// prevent attaching the button more than once
if (item.node.getAttribute(attachedKey) !== null) {
return logVerbose('Hide buttons already attached to tags.', item... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hideDescendantItems() {\n Array.from(this._children).forEach(child => {\n child.setAttribute('aria-hidden', 'true');\n });\n }",
"function hideItem(tag) {\n $(tag).addClass('hidden');\n }",
"function hideTag() {\n tagDiv.hide();\n}",
"function attachHideButtons(items) {\n\t\tlogTrace(... | [
"0.6452417",
"0.6418654",
"0.6390064",
"0.6371333",
"0.6294271",
"0.6269825",
"0.6210483",
"0.6108225",
"0.61059076",
"0.6056903",
"0.6055364",
"0.6024874",
"0.600781",
"0.5971951",
"0.595731",
"0.5911777",
"0.59060484",
"0.5870542",
"0.5833795",
"0.58262324",
"0.5815079",
... | 0.7455655 | 0 |
Toggles visibility state of all present hide buttons in the directory of the current page. Returns all present hide buttons. | function toggleHideButtonsVisibility(state) {
logTrace('invoking toggleHideButtonsVisibility($)', state);
if (typeof state !== 'boolean') {
throw new Error('Argument "state" is illegal. Expected a boolean.');
}
// store state globally
renderButtons = state;
storageSet({ 'renderButtons': renderButtons ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hideButtons() {\n this.visible = false;\n for (const button of this.buttonsAsArray) {\n button.hideButton();\n }\n }",
"function hideButtons (btn_array)\n{\n\tfor (var i = 0; i < btn_array.length; i++)\n\t{\n\t\tbtn_array[i].style.visibility=\"hidden\";\n\t}\n}",
"function _h... | [
"0.6940194",
"0.6138332",
"0.6077926",
"0.6046494",
"0.603426",
"0.6032106",
"0.6026253",
"0.6008862",
"0.5983187",
"0.5943733",
"0.5925241",
"0.59158105",
"0.58928174",
"0.58878314",
"0.5885201",
"0.5882836",
"0.58422625",
"0.58357525",
"0.5790278",
"0.5787142",
"0.5777986",... | 0.6699116 | 1 |
Event that is emitted whenever unprocessed items appear in the directory of the current page. Returns if filtering was invoked. | function onScroll() {
logTrace('invoking onScroll()');
if (pageLoads === true) {
logWarn('Cancelled emitted scroll event, because page load is in progress.');
return false;
}
let remainingItems;
if (
(currentPageType !== 'following') ||
(hideFollowing === true)
) {
remainingItems = filte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkAllItemsStartedPreloading(){\n\t\t\n\t\tif(g_temp.isAllItemsPreloaded == true)\n\t\t\treturn(false);\n\t\t\n\t\t//if some of the items not started, exit function:\n\t\tfor(var index in g_arrItems){\n\t\t\tif(g_arrItems[index].isBigImageLoadStarted == false)\n\t\t\t\treturn(false);\n\t\t}\n\t\t\n\t\t/... | [
"0.55494505",
"0.55456525",
"0.5510395",
"0.54974353",
"0.54431224",
"0.54408944",
"0.543432",
"0.5397828",
"0.5380913",
"0.53283566",
"0.5308456",
"0.5276101",
"0.5229944",
"0.5191531",
"0.517702",
"0.5175444",
"0.5145047",
"0.51408243",
"0.5131456",
"0.51148695",
"0.5111134... | 0.5889873 | 0 |
END: events / BEGIN: blacklist Initializes the blacklisted items collection by setting up the default item types in the provided object. | function initBlacklistedItems(collection) {
logTrace('invoking initBlacklistedItems($)', collection);
const itemTypes = [
'categories',
'channels',
'tags',
'titles'
];
// base container
if (typeof collection !== 'object') {
collection = {};
}
const itemTypesLength = itemTypes.length;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set blacklist(vals){\n this._blacklist = vals;\n }",
"function setupAndProcessBlacklist(aBlacklist) {\n let blacklist;\n try {\n blacklist = JSON.parse(Services.prefs.getCharPref(PREFNAME));\n }\n catch (e) {\n log(e);\n // On failure set the default blacklist\n Services.prefs.setCharPr... | [
"0.6267541",
"0.59672385",
"0.5951869",
"0.59067744",
"0.5642331",
"0.56226265",
"0.5469108",
"0.5413552",
"0.5343711",
"0.5294429",
"0.52900827",
"0.5247505",
"0.520117",
"0.519878",
"0.5177025",
"0.5177025",
"0.51599646",
"0.51023847",
"0.50939703",
"0.5016456",
"0.5010645"... | 0.6714835 | 0 |
Retrieves all blacklisted items from the storage. | function getBlacklistedItems(callback) {
logTrace('invoking getBlacklistedItems($)', callback);
storageGet(null, function callback_storageGet(result) {
logTrace('callback invoked: storageGet($)', null, result);
let blacklistedItems = {};
if (typeof result.blacklistedItems === 'object') {
blacklisted... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syncBlacklistedItems(items) {\n\n\t\tchrome.runtime.sendMessage({ blacklistedItems: items, storage: false });\n\t}",
"function getBlackList(callback) {\n sendRequest('blacklist', 'GET', {}, true, callback);\n}",
"fetchItems() {\n this._$itemStorage.getAllItems().then((items) => {\n if (!ang... | [
"0.662589",
"0.6591302",
"0.64425164",
"0.6325957",
"0.6157675",
"0.61078984",
"0.6070186",
"0.60091645",
"0.59891933",
"0.5948488",
"0.59377635",
"0.5871686",
"0.57646704",
"0.57646704",
"0.5754525",
"0.5753758",
"0.5753758",
"0.57446855",
"0.57230514",
"0.5721838",
"0.57040... | 0.75502884 | 0 |
Stores all blacklisted items in the storage. | function putBlacklistedItems(items, callback, attemptRecovery) {
logTrace('invoking putBlacklistedItems($, $, $)', items, callback, attemptRecovery);
getStorageMode(function(mode) {
const isSync = (mode === 'sync');
if (attemptRecovery === false) {
logWarn('Restoring backup:', items);
}
// prep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syncBlacklistedItems(items) {\n\n\t\tchrome.runtime.sendMessage({ blacklistedItems: items, storage: false });\n\t}",
"function storeItems() { //#app.js\n store.setItem('items', itemList.toJSON())\n }",
"function storeGroceryItems()\r\n{\r\n\tlocalStorage.setObject(\"shoppinglist\", g... | [
"0.6971221",
"0.6648291",
"0.6355753",
"0.6255238",
"0.6032755",
"0.597551",
"0.5914903",
"0.5893359",
"0.58669764",
"0.58653826",
"0.5861302",
"0.580109",
"0.5799113",
"0.57888854",
"0.5788452",
"0.5784407",
"0.5776773",
"0.57613724",
"0.5747208",
"0.57293075",
"0.57221013",... | 0.7134384 | 0 |
Informs all tabs (including the one that invokes this function) about the provided items in order to keep them synchronized. | function syncBlacklistedItems(items) {
chrome.runtime.sendMessage({ blacklistedItems: items, storage: false });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateItems(e) {\n this.__tabs = this.querySelectorAll(\"a11y-tab\");\n this.__hasIcons = true;\n if (!this.id) this.id = this._generateUUID();\n if (this.__tabs && this.__tabs.length > 0)\n this.__tabs.forEach((tab, index) => {\n if (!tab.icon) this.__hasIcons = false;\n tab.order =... | [
"0.65886194",
"0.60353476",
"0.58568484",
"0.58412385",
"0.57200754",
"0.56857073",
"0.5639814",
"0.56165415",
"0.56103075",
"0.55811983",
"0.55464786",
"0.55279577",
"0.55148095",
"0.5489799",
"0.5457091",
"0.54489577",
"0.5427995",
"0.54169405",
"0.54085785",
"0.5402489",
"... | 0.62666833 | 1 |
END: blacklist / BEGIN: initialization Fetches blacklist from storage and starts filtering. | function init() {
logTrace('invoking init()');
if (initRun === true) {
return logWarn('Aborting invocation of init(), because the extension is already initialized.');
}
initRun = true;
// prepare blacklist (regardless of the current page support)
getBlacklistedItems(function callback_getBlacklistedIte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadBlacklist() {\n\tpool.getConnection(function(err, connection) {\n\t\tconnection.query(\"SELECT * FROM blacklist\", function(err, results) {\n\t\t\tfor(var i in results) {\n\t\t\t\tif(!blackList.hasOwnProperty(\"server\" + results[i].serverID)) {\n\t\t\t\t\tblackList[\"server\" + results[i].serverID] =... | [
"0.6971629",
"0.66226447",
"0.6526216",
"0.65103686",
"0.6426454",
"0.6319832",
"0.6241473",
"0.6159559",
"0.60747534",
"0.60642123",
"0.60261834",
"0.5877546",
"0.5860587",
"0.57164574",
"0.56000006",
"0.55960107",
"0.5591706",
"0.5543784",
"0.5541763",
"0.5407798",
"0.53834... | 0.67301244 | 1 |
Creates the close buttons for each task. It creates the event listeners necessary to get rid of task items. | function createCloseButtons () {
// store an array of all of the close, "x"s in the task list
const close = document.getElementsByClassName('close')
// make the eventlistener for all of the close "x"s,
// these will delete the task when the "x" is clicked.
for (let i = 0; i < close.length; i++) {
close[i]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function taskClose(){\n let close = document.getElementsByClassName(\"close\"); \n for (let i = 0; i < close.length; i++) {\n close[i].onclick = function() { \n let button = this.parentElement;\n ... | [
"0.76773137",
"0.73120105",
"0.69595784",
"0.6670204",
"0.66646403",
"0.65175503",
"0.63979834",
"0.63901144",
"0.63399565",
"0.6268838",
"0.62648576",
"0.6248792",
"0.62379396",
"0.6229697",
"0.6211684",
"0.6211177",
"0.6204912",
"0.61424226",
"0.61229324",
"0.61188084",
"0.... | 0.8398565 | 0 |
Function Definitions Section Define raiseToSelf Function with intInput as parameter | function raiseToSelf(intInput){
// return intInput raised to the power of intInput using Math.pow (look up in w3Schools if necessary)
return Math.pow(intInput,intInput);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enterRaise_stmt(ctx) {\n\t}",
"function thrower(){throw new Error(\"this should not happen!\")}",
"function sc_raise(obj) {\n throw obj;\n}",
"exitIntegerValue(ctx) {\n }",
"function throwError() {\n throw -1;\n}",
"enterIntegerValue(ctx) {\n }",
"function raise$1(event) {\n if (!isString(ev... | [
"0.51586604",
"0.514966",
"0.5126043",
"0.499591",
"0.49689108",
"0.49437785",
"0.49158335",
"0.48918808",
"0.48362443",
"0.4785747",
"0.47757787",
"0.47691405",
"0.47593933",
"0.47327825",
"0.47265965",
"0.47164106",
"0.4668486",
"0.46638858",
"0.4658599",
"0.46518925",
"0.4... | 0.7442155 | 0 |
sync dynamically changed IPD between viewers | function sync_ipd(ipd)
{
var krpanoL = ID("krpanoL");
var krpanoR = ID("krpanoR");
if (krpanoL && krpanoR)
{
krpanoL.set("rift.ipd", ipd);
krpanoR.set("rift.ipd", ipd);
krpanoL.call("setuprift(true);");
krpanoR.call("setuprift(true);");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syncRequest(ip) {\n ipRecord[ip] = (ipRecord[ip] || 0) + 1;\n hub.emitRemote(\"SYNC_REQUEST\", ip);\n}",
"function sync() {\n syncDom.setAttribute('data-sync-state', 'syncing');\n var opts = {live: true};\n db.replicate.to(remoteCouch, opts, syncError);\n db.replicate.from(remoteCouch, opt... | [
"0.5640561",
"0.5360423",
"0.53183156",
"0.5301231",
"0.5287",
"0.5285858",
"0.52595264",
"0.5221785",
"0.5186059",
"0.5183892",
"0.512725",
"0.5123947",
"0.50904864",
"0.50857294",
"0.506667",
"0.5064965",
"0.5043259",
"0.50316906",
"0.50179243",
"0.50068897",
"0.4977628",
... | 0.6786748 | 0 |
no vr plugin error message | function no_vr_plugin()
{
var errorBox = ID("errorBox");
errorBox.innerHTML = ""+
"<center>"+
"<br>"+
"<h1 style='margin-bottom:0;'>NPVR Browser Plugin required!</h1>"+
"<br>"+
"Get the plugin here and install it:<br>"+
"<br>"+
"<a href='https://github.com/CodingCooky/npvr/#npvr' target='_blank'>https:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function videoError(e) {\n\t alert(\"videoError: \" + e.message)\n\t}",
"function gumFail() {\n // setCommandValue(\"Fail to fetch video from webcam, plz try again\");\n alert(\"Fail to fetch video from camera, please try again\");\n}",
"function captureVideoError(error) \n\t\t{\n var msg =... | [
"0.63713735",
"0.63438135",
"0.61054045",
"0.61000395",
"0.61000395",
"0.5924443",
"0.5888725",
"0.58580655",
"0.5837929",
"0.58202785",
"0.57855976",
"0.5752039",
"0.5748157",
"0.5722496",
"0.5722496",
"0.5718418",
"0.5681795",
"0.5677962",
"0.56618375",
"0.5643503",
"0.5634... | 0.7698198 | 0 |
function to send the configuration to the Python daemon through DBus | function config() {
let audio = settings.get_boolean("audio");
let midi = settings.get_boolean("midi");
if (audio)
jvProxy.registerAudioPortsSync();
else
jvProxy.unregisterAudioPortsSync();
if (midi)
jvProxy.registerMidiPortSync();
else
jvProxy.unregisterMidiPortS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"#send() {\n const data = this.#parse();\n if (data) {\n this.#device.printDevice('Calling <b>writeConfiguration()</b>');\n this.#device.sendRequest({\n 'method': 'writeConfiguration',\n 'configuration': data\n });\n\n this.#timeout = setTimeout(() => {\n this.#timeout... | [
"0.64341563",
"0.5694074",
"0.5425957",
"0.53023934",
"0.52957994",
"0.52945197",
"0.5273966",
"0.52343124",
"0.52318054",
"0.51147735",
"0.5110051",
"0.5084145",
"0.50791913",
"0.50771177",
"0.50739986",
"0.5031178",
"0.5019053",
"0.5011761",
"0.5001048",
"0.4987797",
"0.496... | 0.57270056 | 1 |
total length of snake | function getsnakelength() {
var length = 0;
for (var i = 0; i < this.snake.length; i++) {
var cur = this.snake[i];
var next = this.snake[(i + 1) % this.snake.length];
length += distance(cur, next);
}
return length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLength() {\n var xandy = Snake.tail[Snake.length - 1]\n var x = xandy[0];\n var y = xandy[1];\n Snake.tail.push([x, y]);\n Snake.length++;\n}",
"totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n ... | [
"0.6633378",
"0.66172594",
"0.64271295",
"0.6425467",
"0.6233595",
"0.6186312",
"0.6181158",
"0.6177853",
"0.61715394",
"0.6128009",
"0.61261505",
"0.6062882",
"0.59994185",
"0.59991807",
"0.5984448",
"0.5943263",
"0.591893",
"0.5918683",
"0.5914515",
"0.5882065",
"0.58637017... | 0.84842455 | 0 |
Utility function to visually print the diff Tweak it at your own taste | function printDiff(oldObj, newObj) {
const parts = diff.diffJson(oldObj, newObj);
return {
_print: ()=>{
parts.forEach(function (part) {
part.value
.split('\n')
.filter(function (line) { return !!line; })
.forEach(function (lin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_diff(){\t\t\n\t\tvar text1 = this.currentContribution > 0 ? this.contributions[this.currentContribution - 1].content :'';\n\t\tvar text2 = this.contributions[this.currentContribution].content;\n\t\t\n\t\tvar author = this.contributions[this.currentContribution].user;\n\t\tvar soundEffect = this._getSoundEffect(au... | [
"0.65444374",
"0.6446942",
"0.64092505",
"0.63609",
"0.6228051",
"0.6169878",
"0.6125343",
"0.6125343",
"0.6125343",
"0.6125343",
"0.6125343",
"0.6125343",
"0.61097074",
"0.6093736",
"0.59842193",
"0.5958672",
"0.5901442",
"0.58782226",
"0.58122027",
"0.5795725",
"0.57478505"... | 0.69498205 | 0 |
Bind ajax on all status links | function bindStatus() {
$('a.mqueue_status').click(setStatus);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setStatus() {\n const parent = $(this).parent();\n parent.addClass('loading');\n $.getJSON(this.href + '?format=json&jsoncallback=?', function (data) {\n $('.mqueue_status_links_' + data.id).each(function () {\n $(this).replaceWith(data.status);\n ... | [
"0.66346294",
"0.6496349",
"0.6341411",
"0.6283838",
"0.6192843",
"0.6087899",
"0.6064626",
"0.6026153",
"0.60188055",
"0.5858754",
"0.5835419",
"0.5823335",
"0.5809067",
"0.5807092",
"0.58064026",
"0.58034885",
"0.5786791",
"0.57498574",
"0.57463056",
"0.5743538",
"0.5743538... | 0.7254941 | 0 |
Monitor any links refering to IMDb, existing now or in future | function monitorLinks(server) {
let timeoutId;
let insertedNodes = [];
injectStatus(server, $(document));
$('body').bind('DOMNodeInserted', function (e) {
insertedNodes.push(e.target);
// Cancel previous timeout if any
if (typeof timeoutId == 'number... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkLinksInDom() {\n // check the visibility state of document\n const currentTime = Date.now();\n if (!isDocVisible()) {\n return;\n }\n // if we don't have attention it's been more than updateInterval since we lost it\n if... | [
"0.5956882",
"0.57523143",
"0.5598145",
"0.5544787",
"0.5500598",
"0.5440648",
"0.54144925",
"0.53995293",
"0.53438354",
"0.5335014",
"0.533183",
"0.52986926",
"0.5284393",
"0.52542186",
"0.51889783",
"0.51464134",
"0.5141021",
"0.5137115",
"0.51312375",
"0.51258343",
"0.5114... | 0.62857 | 0 |
Import calculator inputs based on radio 'selected' | function renderInputs(selected, store) {
currentCalculator = selected;
let calcImport;
switch(selected) {
case 'A':
calcImport = calculatorA;
break;
case 'B':
calcImport = calculatorB;
break;
case 'C':
calcImport = calculatorC;
break;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeInput () {\n document.querySelectorAll('.operator').forEach(operand => {operand.onclick = function () {\n calculation[\"numbers\"].push(display);\n calculation[\"operators\"].push(operand.innerText);\n currentTotal(calculation[\"numbers\"], calculation[\"operators\"])\n ... | [
"0.6175315",
"0.606661",
"0.60443205",
"0.6001443",
"0.59919596",
"0.5982663",
"0.5931356",
"0.57005894",
"0.5687849",
"0.5650794",
"0.56477463",
"0.5639026",
"0.5613483",
"0.56021404",
"0.56018245",
"0.5590648",
"0.558715",
"0.5575316",
"0.5573494",
"0.55433685",
"0.5527461"... | 0.6997425 | 0 |
class for a memory cell, we store an array of these memory cells instead of just the value because strings can take up more than 1 byte | function MemoryCell() {
this.value = "00";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DataMemory(numberOfMemoryCells) {\n var _ram = new RAM(numberOfMemoryCells);\n var _media = new Media();\n var _tableManager = new TableManager()\n\n this.ram = function() {\n return _ram;\n }\n\n this.media = function() {\n return _media;\n }\n\n this.tableManager = ... | [
"0.6236101",
"0.6155835",
"0.6155835",
"0.60729074",
"0.60439473",
"0.5925621",
"0.5925621",
"0.57937604",
"0.5759481",
"0.5708024",
"0.55945253",
"0.55198705",
"0.54418826",
"0.5422913",
"0.53978544",
"0.53730303",
"0.53552586",
"0.5350197",
"0.53418124",
"0.5304005",
"0.528... | 0.7578061 | 0 |
Gets time elapsed from the last roundTimeStamp to now | function getTimeElapsed() {
return now() - _roundTimeStamp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}",
"function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}",
"function getCurTime(){\n var curTime = new Date();\n retur... | [
"0.67209214",
"0.66677076",
"0.6631707",
"0.6610274",
"0.65771693",
"0.6537893",
"0.6529823",
"0.6478201",
"0.6391229",
"0.63053674",
"0.6279168",
"0.6242018",
"0.62261295",
"0.61719006",
"0.61672616",
"0.61404216",
"0.61171407",
"0.6115596",
"0.60972905",
"0.6075822",
"0.607... | 0.85462886 | 0 |
18 19 // 20 Creates new trigger class that injects context into overlay. // 21 22 23 | function createContextWrapper(Trigger, propName) { // 24
return function (contextTypes) { // 25
var ContextWrapper = (function (_React$Component) { // 26
_inherits(ContextWrapper, _React$Component); // 27
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Trigger() { }",
"function Trigger(props) {\n var _this;\n (0,classCallCheck/* default */.Z)(this, Trigger);\n _this = _super.call(this, props);\n (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), \"popupRef\", /*#__PURE__*/react.createRef());\n (... | [
"0.59427553",
"0.59161824",
"0.56690526",
"0.5569419",
"0.5568818",
"0.55579406",
"0.5539905",
"0.5523882",
"0.5515543",
"0.54793257",
"0.5468521",
"0.5460025",
"0.5447693",
"0.5446762",
"0.54379493",
"0.54341364",
"0.54172915",
"0.54172873",
"0.5403596",
"0.5368866",
"0.5368... | 0.60146654 | 0 |
5875 / If we've just justified text within a container block // 5876 Chrome may have removed elements and instead wrapped lines in elements with a textalign property. If so, we want to fix this // 5878 5879 | function cleanupJustifyDivFragments(blockContainer) { // 5880
if (!blockContainer) { // 5881
return; // 5882
} // 5883
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_justify() {\n let hIx = 0;\n let left = 0;\n let minx = 0;\n let maxx = 0;\n let lvl = 0;\n let maxwidth = 0;\n let runningWidth = 0;\n let runningHeight = 0;\n if (!this.inlineBlocks.length) {\n return;\n }\n minx = this.inlineBlocks[0].text.startX;\n // We justify relati... | [
"0.6363451",
"0.63561654",
"0.6351366",
"0.63077384",
"0.59729356",
"0.5892992",
"0.5747191",
"0.5668109",
"0.56491166",
"0.5527687",
"0.5498054",
"0.5492784",
"0.5470489",
"0.5468319",
"0.5465896",
"0.54492164",
"0.5448672",
"0.54377675",
"0.5432962",
"0.5421921",
"0.5413343... | 0.6989713 | 0 |
75 // 76 Attempts to match a pattern on the given pathname. Patterns may use the following special characters: // 78 // 79 :paramName Matches a URL segment up to the next /, ?, or . The captured string is considered a "param" // 81 () Wraps a segment of the URL that is optional // 82 Consumes (nongreedy) all characters... | function matchPattern(pattern, pathname) { // 94
var _compilePattern2 = compilePattern(pattern); // 95
// 96
var regexpSource = _compilePattern2.regexpSource; // 97
var paramN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchPattern(pattern,pathname){ // Ensure pattern starts with leading slash for consistency with pathname.\nif(pattern.charAt(0)!=='/'){pattern='/'+pattern;}var _compilePattern2=compilePattern(pattern);var regexpSource=_compilePattern2.regexpSource;var paramNames=_compilePattern2.paramNames;var tokens=_co... | [
"0.7477258",
"0.7229294",
"0.7229294",
"0.7229294",
"0.7200056",
"0.7200056",
"0.71681595",
"0.7166429",
"0.7166429",
"0.7166429",
"0.7166429",
"0.71572065",
"0.714449",
"0.714449",
"0.714449",
"0.714449",
"0.714449",
"0.714449",
"0.714449",
"0.70681214",
"0.70513105",
"0.7... | 0.7731239 | 0 |
151 // 152 Returns a version of the given pattern with params interpolated. Throws if there is a dynamic segment of the pattern for which there is no param. 155 156 | function formatPattern(pattern, params) { // 157
params = params || {}; // 158
// 159
var _compilePattern3 = compilePattern(pattern); // 160
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatPattern(pattern, params) {\n params = params || {};\n\n var _compilePattern3 = compilePattern(pattern),\n tokens = _compilePattern3.tokens;\n\n var parenCount = 0,\n pathname = '',\n splatIndex = 0,\n parenHistory = [];\n\n var token = void 0,\n paramName = void 0,\n ... | [
"0.65868855",
"0.65868855",
"0.65868855",
"0.6569056",
"0.6569056",
"0.6569056",
"0.64991003",
"0.64688253",
"0.64688253",
"0.64688253",
"0.64688253",
"0.64688253",
"0.64688253",
"0.64688253",
"0.6463951",
"0.6394189",
"0.6394189",
"0.6394189",
"0.63916796",
"0.6387882",
"0.6... | 0.67157125 | 0 |
99 // 100 Creates and returns an array of routes from the given object which // 101 may be a JSX route, a plain object route, or an array of either. // 102 103 104 | function createRoutes(routes) { // 105
if (isReactChildren(routes)) { // 106
routes = createRoutesFromReactChildren(routes); // 107
} else if (routes && !Array.isArray(routes)) { // 108
rout... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRoutes(routes){if(isReactChildren(routes)){routes=createRoutesFromReactChildren(routes);}else if(routes&&!Array.isArray(routes)){routes=[routes];}return routes;}",
"function createRoutes(routes){if(isReactChildren(routes)){routes=createRoutesFromReactChildren(routes);}else if(routes&&!Array.isArra... | [
"0.72551334",
"0.72551334",
"0.72551334",
"0.68418205",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",
"0.6803294",... | 0.72800624 | 0 |
28 // 29 Runs all onEnter hooks in the given array of routes in order // 30 with onEnter(nextState, replaceState, callback) and calls // 31 callback(error, redirectInfo) when finished. The first hook // 32 to use replaceState shortcircuits the loop. // 33 // 34 If a hook needs to run asynchronously, it may use the call... | function runEnterHooks(routes, nextState, callback) { // 40
var hooks = getEnterHooks(routes); // 41
// 42
if (!hooks.length) { // 43
callback... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runEnterHooks(routes, nextState, callback) {\n\t var hooks = getEnterHooks(routes);\n\n\t if (!hooks.length) {\n\t callback();\n\t return;\n\t }\n\n\t var redirectInfo = undefined;\n\t function replaceState(state, pathname, query) {\n\t redirectInfo = { pathname: pathname, query: query, stat... | [
"0.8344439",
"0.8344439",
"0.8344439",
"0.8344439",
"0.82641345",
"0.82641345",
"0.8220299",
"0.8186169",
"0.8165321",
"0.81603014",
"0.8156717",
"0.8156717",
"0.8156717",
"0.81502354",
"0.81411237",
"0.8105966",
"0.7848056",
"0.77690643",
"0.77690643",
"0.77690643",
"0.77690... | 0.8751826 | 0 |
63 // 64 Runs all onLeave hooks in the given array of routes in order. // 65 66 67 | function runLeaveHooks(routes) { // 68
for (var i = 0, len = routes.length; i < len; ++i) { // 69
if (routes[i].onLeave) routes[i].onLeave.call(routes[i]); // 70
} // 71
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runLeaveHooks(routes){for(var i=0,len=routes.length;i<len;++i){if(routes[i].onLeave)routes[i].onLeave.call(routes[i]);}}",
"function runLeaveHooks(routes){for(var i=0,len=routes.length;i<len;++i){if(routes[i].onLeave)routes[i].onLeave.call(routes[i]);}}",
"function runLeaveHooks(routes){for(var i=0,le... | [
"0.86116385",
"0.86116385",
"0.86116385",
"0.84518737",
"0.84518737",
"0.84518737",
"0.84518737",
"0.84518737",
"0.84518737",
"0.84518737",
"0.84518737",
"0.8441045",
"0.84025913",
"0.84025913",
"0.84025913",
"0.84025913",
"0.84025913",
"0.84025913",
"0.84025913",
"0.84025913",... | 0.8755094 | 0 |
5 6 // 7 Extracts an object of params the given route cares about from // 8 the given params object. // 9 10 | function getRouteParams(route, params) { // 11
var routeParams = {}; // 12
// 13
if (!route.path) return routeParams; // 14
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseParams(location){\n let route = this; \n var keys=[],params={};\n var tokens = this.getMatch(location.pathname);\n if (tokens && tokens.keys.length!=0){\n var i = 1;\n var keys = tokens.keys;\n keys.forEach((e) => params[e.name] = tokens.token[i++] );\n }\n this.params = para... | [
"0.75271076",
"0.74541706",
"0.74541706",
"0.74541706",
"0.74531674",
"0.74531674",
"0.74531674",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187",
"0.74295187"... | 0.79192966 | 0 |
70 // 71 Returns true if all key/value pairs in the given query are // 72 currently active. // 73 74 | function queryIsActive(query, activeQuery) { // 75
if (activeQuery == null) return query == null; // 76
// 77
if (query == null) return true; // 78
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queryIsActive(query,activeQuery){if(activeQuery==null)return query==null;if(query==null)return true;return deepEqual(query,activeQuery);}",
"function queryIsActive(query,activeQuery){if(activeQuery==null)return query==null;if(query==null)return true;return deepEqual(query,activeQuery);}",
"function qu... | [
"0.6725694",
"0.6725694",
"0.6725694",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"0.6476496",
"... | 0.6913934 | 0 |
82 // 83 Returns true if a to the given pathname/query combination is currently active. // 85 86 | function isActive(pathname, query, indexOnly, location, routes, params) {
if (location == null) return false; // 88
// 89
if (!routeIsActive(pathname, routes, params, indexOnly)) return false;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isActive(pathname, query, indexOnly, location, routes, params) {\n\t if (location == null) return false;\n\n\t if (!routeIsActive(pathname, routes, params, indexOnly)) return false;\n\n\t return queryIsActive(query, location.query);\n\t}",
"function isActive(pathname, query, indexOnly, location, rout... | [
"0.6818289",
"0.6818289",
"0.6818289",
"0.6818289",
"0.6805413",
"0.6650743",
"0.6603737",
"0.6603737",
"0.6453421",
"0.6394052",
"0.63753855",
"0.6352867",
"0.6352867",
"0.6302143",
"0.6297478",
"0.6284179",
"0.6284179",
"0.6263454",
"0.6263454",
"0.6263454",
"0.6263454",
... | 0.72782946 | 0 |
28 // 29 A highlevel API to be used for serverside rendering. // 30 // 31 This function matches a location to a set of routes and calls // 32 callback(error, redirectLocation, renderProps) when finished. // 33 // 34 Note: You probably don't want to use this in a browser. Use // 35 the history.listen API instead. // 36 ... | function match(_ref, callback) { // 38
var routes = _ref.routes; // 39
var location = _ref.location; // 40
var parseQueryString = _ref.parseQueryString; // 41
var string... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match(_ref, callback) {\n var history = _ref.history,\n routes = _ref.routes,\n location = _ref.location,\n options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']);\n\n !(history || location) ? process.env.NODE_ENV !== 'production' ? __WEBPACK_IMPORTED_MODULE_1_invaria... | [
"0.70462203",
"0.70462203",
"0.70462203",
"0.70462203",
"0.70462203",
"0.7041751",
"0.7038465",
"0.7038465",
"0.70038867",
"0.6992517",
"0.6987971",
"0.6987971",
"0.6987971",
"0.6968076",
"0.6968076",
"0.6939693",
"0.6939693",
"0.6939693",
"0.6908282",
"0.68811506",
"0.688115... | 0.7286351 | 0 |
113 // 114 Asynchronously matches the given location to a set of routes and calls callback(error, state) when finished. The state object will have the following properties: // 117 // 118 routes An array of routes that matched, in hierarchical order params An object of URL parameters // 120 // 121 Note: This operation m... | function matchRoutes(routes, location, callback) { // 125
var basename = arguments.length <= 3 || arguments[3] === undefined ? '' : arguments[3];
// 127
_AsyncUtils.loopAsync(routes.length, function (index, next, done) { // ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchRoutes(routes,location,callback,remainingPathname){var paramNames=arguments.length<=4||arguments[4]===undefined?[]:arguments[4];var paramValues=arguments.length<=5||arguments[5]===undefined?[]:arguments[5];if(remainingPathname===undefined){ // TODO: This is a little bit ugly, but it works around a qu... | [
"0.7682211",
"0.7654853",
"0.7654853",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.7479394",
"0.74424666",
"0.74424666",
"0.74424666",
"0.7440464",
"0.7434275",
"0.7434275",
"0.7434275",
"0.74041164",
"0.7400834",... | 0.78228337 | 0 |
187 188 // 189 Registers the given hook function to run before leaving the given route. // 191 During a normal transition, the hook function receives the next location as its only argument and must return either a) a prompt message to show the user, to make sure they want to leave the page or b) false, to prevent the t... | function listenBeforeLeavingRoute(route, hook) { // 202
// TODO: Warn if they register for a route that isn't currently // 203
// active. They're probably doing something wrong, like re-creating
// route objects on every location change. // 205
var routeI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function beforeUnloadHook(){ // Synchronously check to see if any route hooks want\n// to prevent the current window/tab from closing.\nif(state.routes){var hooks=getRouteHooksForRoutes(state.routes);var message=void 0;for(var i=0,len=hooks.length;typeof message!=='string'&&i<len;++i){ // Passing no args indicates... | [
"0.7849302",
"0.7809536",
"0.7752613",
"0.7752613",
"0.7752613",
"0.7752613",
"0.7752613",
"0.7732761",
"0.7732761",
"0.7732761",
"0.7732761",
"0.7732761",
"0.7732761",
"0.7732761",
"0.766029",
"0.766029",
"0.7645174",
"0.7645174",
"0.76180834",
"0.7600892",
"0.7600892",
"0... | 0.78302115 | 1 |
51 // 52 Returns true if the HTML5 history API is supported. Taken from modernizr. // 54 // 55 changed to avoid false negatives for Windows Phones: 58 59 | function supportsHistory() { // 60
var ua = navigator.userAgent; // 61
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Window... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function supportsHistory() {\r\n\t var ua = navigator.userAgent;\r\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\r\n\t return false;\r\n\t }\r\n\t return window.histo... | [
"0.8661673",
"0.8624801",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"0.8617182",
"... | 0.88873196 | 0 |
26 // 27 Returns a new createHistory function that may be used to create // 28 history objects that know how to handle URL queries. // 29 30 | function useQueries(createHistory) { // 31
return function () { // 32
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var stringifyQuery = options.stringifyQuery; // 3... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setupHistory() {\n if (!this.history) {\n try{ this.history = createHistory(); }\n catch(e) { \n this.history = this.options.history || createMemoryHistory();\n this._isPhantomHistory = true; \n }\n } \n }",
"function createBrowserHistory(props){if(props===void 0){props={};... | [
"0.7200848",
"0.7035447",
"0.6958787",
"0.6958787",
"0.69451964",
"0.6875018",
"0.68536675",
"0.6776682",
"0.67667925",
"0.6755609",
"0.67494273",
"0.6712666",
"0.66849947",
"0.66502166",
"0.6643967",
"0.6643967",
"0.661304",
"0.6602469",
"0.65981907",
"0.6581891",
"0.6579186... | 0.7476394 | 0 |
33 // 34 Computes the next entry in the log by applying an action. // 35 36 | function computeNextEntry(reducer, action, state, error) { // 37
if (error) { // 38
return { // 39
state: state, // 40
error:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computeNextEntry(reducer, action, state, error) {\n\t if (error) {\n\t return {\n\t state: state,\n\t error: 'Interrupted by an error up the chain'\n\t };\n\t }\n\t\n\t var nextState = state;\n\t var nextError = undefined;\n\t try {\n\t nextState = reducer(state, action);\n\t } ca... | [
"0.61717457",
"0.6125455",
"0.60902613",
"0.6087966",
"0.6068709",
"0.6058816",
"0.59695375",
"0.59190863",
"0.59190863",
"0.5879511",
"0.5835015",
"0.5832098",
"0.55859625",
"0.5553192",
"0.5553192",
"0.5553192",
"0.5553192",
"0.5553192",
"0.55402714",
"0.55380416",
"0.54952... | 0.6215519 | 0 |
83 // 84 Lifts the app state reducer into a DevTools state reducer. // 85 86 | function liftReducer(reducer, initialState) { // 87
var initialLiftedState = { // 88
committedState: initialState, // 89
stagedActions: [INIT_ACTION], // 90
skippedA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function devTools() { // 268\n return function (next) { // 269\n return function (reducer, initialState) { // 270\n var liftedReducer = liftReducer(reducer, initialState); // 271\... | [
"0.73029965",
"0.64867085",
"0.64800113",
"0.61112106",
"0.60840833",
"0.59789693",
"0.59741175",
"0.59333843",
"0.5906211",
"0.5883107",
"0.5841352",
"0.5836969",
"0.58018607",
"0.5790289",
"0.57694536",
"0.57576305",
"0.57555664",
"0.57492477",
"0.57400423",
"0.57315135",
"... | 0.7051166 | 1 |
183 // 184 Lifts an app action to a DevTools action. // 185 186 | function liftAction(action) { // 187
var liftedAction = { // 188
type: ActionTypes.PERFORM_ACTION, // 189
action: action, // 190
time... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function liftAction(action) {\n return ActionCreators.performAction(action);\n }",
"function liftAction(action) {\n\t return ActionCreators.performAction(action);\n\t}",
"function liftAction(action) {\n\t return ActionCreators.performAction(action);\n\t}",
"function liftAc... | [
"0.5886786",
"0.58496976",
"0.58496976",
"0.58496976",
"0.58496976",
"0.58496976",
"0.58496976",
"0.57929546",
"0.57604575",
"0.5731228",
"0.5689716",
"0.5608603",
"0.5578898",
"0.5578898",
"0.5578898",
"0.5549945",
"0.55473495",
"0.5540913",
"0.5529364",
"0.5518073",
"0.5510... | 0.63352156 | 0 |
263 // 264 Redux DevTools middleware. // 265 266 267 | function devTools() { // 268
return function (next) { // 269
return function (reducer, initialState) { // 270
var liftedReducer = liftReducer(reducer, initialState); // 271
va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function middleware() {\n // Chrome logging\n const enhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose\n // Patched middleware\n return enhancers( applyMiddleware( thunk ) )\n}",
"function setupReduxDevTools () {\n const noop = f => f\n if (process.env.NODE_ENV === 'production') return noop... | [
"0.6780063",
"0.6291072",
"0.612203",
"0.59426993",
"0.5580278",
"0.5530468",
"0.54918605",
"0.54459697",
"0.5339142",
"0.5285245",
"0.52664524",
"0.5264291",
"0.5260772",
"0.52475816",
"0.52151865",
"0.5145325",
"0.5123101",
"0.50923604",
"0.5086715",
"0.50778645",
"0.506805... | 0.752791 | 0 |
face takes a, b, c, d in anti clockwise order | function face(a, b, c, d){
vertices.push(i[a]);
vertices.push(i[b]);
vertices.push(i[c]);
vertices.push(i[a]);
vertices.push(i[c]);
vertices.push(i[d]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function turnFace(face) {\n var x,y,z;\n var direction,value;\n var mainAxis;\n var oldMat;\n switch (face) {\n case \"L\":\n mainAxis = 0; value = -1; direction = \"L\";\n break;\n case \"R\":\n mainAxis = 0; value = 1; direction = 0;\n break;\n case \"U\":\n mainAxis = 1;... | [
"0.6456248",
"0.62898076",
"0.61707866",
"0.61007524",
"0.60837764",
"0.6070899",
"0.5962489",
"0.5945688",
"0.59388816",
"0.59360325",
"0.58815366",
"0.5879799",
"0.5855447",
"0.5855447",
"0.5845869",
"0.5829015",
"0.5821957",
"0.5789718",
"0.5758846",
"0.5685198",
"0.567890... | 0.7619672 | 0 |
Calculates total hours worked, by week. | calculateHoursWorked() {
var shift_start;
var shift_end;
var total_time = 0;
// Calculate for week 1.
this.state.week_1_shifts.forEach((shift) => {
shift_start = new Date(shift.fields['clock_in']).getTime();
if (shift.fields['clock_out'] != null) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sum() {\n for (var i = 0; i < 10; i++) {\n var weeks = 0;\n weeks = weeks + workingHours[i] * 25;\n }\n console.log(weeks);\n}",
"function getLaborTotalForWeek(regular_hours, overtime_hours, total_hours, hourly_wage){\n\n var regular_labor_total = 0;\n var overtime_labor_total = 0;\n v... | [
"0.71473277",
"0.658643",
"0.6432789",
"0.6417793",
"0.6235446",
"0.620962",
"0.6168091",
"0.61032146",
"0.6073237",
"0.6029649",
"0.6020752",
"0.5995004",
"0.5942748",
"0.5937865",
"0.58871573",
"0.58871573",
"0.58871573",
"0.5828877",
"0.58237696",
"0.58211404",
"0.58135253... | 0.69490135 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.