id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,700 | box/t3js | lib/application.js | function(data) {
if (globalConfig.debug) {
// We grab console via getGlobal() so we can stub it out in tests
var globalConsole = this.getGlobal('console');
if (globalConsole && globalConsole.warn) {
globalConsole.warn(data);
}
} else {
application.fire('warning', data);
}
} | javascript | function(data) {
if (globalConfig.debug) {
// We grab console via getGlobal() so we can stub it out in tests
var globalConsole = this.getGlobal('console');
if (globalConsole && globalConsole.warn) {
globalConsole.warn(data);
}
} else {
application.fire('warning', data);
}
} | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"globalConfig",
".",
"debug",
")",
"{",
"// We grab console via getGlobal() so we can stub it out in tests",
"var",
"globalConsole",
"=",
"this",
".",
"getGlobal",
"(",
"'console'",
")",
";",
"if",
"(",
"globalConsole",
... | Signals that an warning has occurred.
If in development mode, console.warn is invoked.
If in production mode, an event is fired.
@param {*} data A message string or arbitrary data
@returns {void} | [
"Signals",
"that",
"an",
"warning",
"has",
"occurred",
".",
"If",
"in",
"development",
"mode",
"console",
".",
"warn",
"is",
"invoked",
".",
"If",
"in",
"production",
"mode",
"an",
"event",
"is",
"fired",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L842-L852 | |
16,701 | box/t3js | lib/application.js | function(data) {
if (globalConfig.debug) {
// We grab console via getGlobal() so we can stub it out in tests
var globalConsole = this.getGlobal('console');
if (globalConsole && globalConsole.info) {
globalConsole.info(data);
}
}
} | javascript | function(data) {
if (globalConfig.debug) {
// We grab console via getGlobal() so we can stub it out in tests
var globalConsole = this.getGlobal('console');
if (globalConsole && globalConsole.info) {
globalConsole.info(data);
}
}
} | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"globalConfig",
".",
"debug",
")",
"{",
"// We grab console via getGlobal() so we can stub it out in tests",
"var",
"globalConsole",
"=",
"this",
".",
"getGlobal",
"(",
"'console'",
")",
";",
"if",
"(",
"globalConsole",
... | Display console info messages.
If in development mode, console.info is invoked.
@param {*} data A message string or arbitrary data
@returns {void} | [
"Display",
"console",
"info",
"messages",
".",
"If",
"in",
"development",
"mode",
"console",
".",
"info",
"is",
"invoked",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L860-L868 | |
16,702 | box/t3js | examples/todo/js/services/router.js | parseRoutes | function parseRoutes() {
// Regexs to convert a route (/file/:fileId) into a regex
var optionalParam = /\((.*?)\)/g,
namedParam = /(\(\?)?:\w+/g,
splatParam = /\*\w+/g,
escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g,
namedParamCallback = function(match, optional) {
return optional ? match : '([^\/... | javascript | function parseRoutes() {
// Regexs to convert a route (/file/:fileId) into a regex
var optionalParam = /\((.*?)\)/g,
namedParam = /(\(\?)?:\w+/g,
splatParam = /\*\w+/g,
escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g,
namedParamCallback = function(match, optional) {
return optional ? match : '([^\/... | [
"function",
"parseRoutes",
"(",
")",
"{",
"// Regexs to convert a route (/file/:fileId) into a regex",
"var",
"optionalParam",
"=",
"/",
"\\((.*?)\\)",
"/",
"g",
",",
"namedParam",
"=",
"/",
"(\\(\\?)?:\\w+",
"/",
"g",
",",
"splatParam",
"=",
"/",
"\\*\\w+",
"/",
... | Parses the user-friendly declared routes at the top of the application,
these could be init'ed or passed in from another context to help extract
navigation for T3 from the framework. Populates the regexRoutes variable
that is local to the service.
Regexs and parsing borrowed from Backbone's router since they did it rig... | [
"Parses",
"the",
"user",
"-",
"friendly",
"declared",
"routes",
"at",
"the",
"top",
"of",
"the",
"application",
"these",
"could",
"be",
"init",
"ed",
"or",
"passed",
"in",
"from",
"another",
"context",
"to",
"help",
"extract",
"navigation",
"for",
"T3",
"f... | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/router.js#L28-L48 |
16,703 | box/t3js | examples/todo/js/services/router.js | broadcastStateChanged | function broadcastStateChanged(fragment) {
var globMatches = matchGlob(fragment);
if (!!globMatches) {
application.broadcast('statechanged', {
url: fragment,
prevUrl: prevUrl,
params: globMatches.splice(1) // Get everything after the URL
});
}
} | javascript | function broadcastStateChanged(fragment) {
var globMatches = matchGlob(fragment);
if (!!globMatches) {
application.broadcast('statechanged', {
url: fragment,
prevUrl: prevUrl,
params: globMatches.splice(1) // Get everything after the URL
});
}
} | [
"function",
"broadcastStateChanged",
"(",
"fragment",
")",
"{",
"var",
"globMatches",
"=",
"matchGlob",
"(",
"fragment",
")",
";",
"if",
"(",
"!",
"!",
"globMatches",
")",
"{",
"application",
".",
"broadcast",
"(",
"'statechanged'",
",",
"{",
"url",
":",
"... | Gets the fragment and broadcasts the previous URL and the current URL of
the page, ideally we wouldn't have a dependency on the previous URL...
@param {string} fragment the current "URL" the user is getting to
@returns {void} | [
"Gets",
"the",
"fragment",
"and",
"broadcasts",
"the",
"previous",
"URL",
"and",
"the",
"current",
"URL",
"of",
"the",
"page",
"ideally",
"we",
"wouldn",
"t",
"have",
"a",
"dependency",
"on",
"the",
"previous",
"URL",
"..."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/router.js#L78-L88 |
16,704 | box/t3js | examples/todo/js/services/router.js | function(state, title, fragment) {
prevUrl = history.state.hash;
// First push the state
history.pushState(state, title, fragment);
// Then make the AJAX request
broadcastStateChanged(fragment);
} | javascript | function(state, title, fragment) {
prevUrl = history.state.hash;
// First push the state
history.pushState(state, title, fragment);
// Then make the AJAX request
broadcastStateChanged(fragment);
} | [
"function",
"(",
"state",
",",
"title",
",",
"fragment",
")",
"{",
"prevUrl",
"=",
"history",
".",
"state",
".",
"hash",
";",
"// First push the state",
"history",
".",
"pushState",
"(",
"state",
",",
"title",
",",
"fragment",
")",
";",
"// Then make the AJA... | The magical method the application code will call to navigate around,
high level it pushes the state, gets the templates from server, puts
them on the page and broadcasts the statechanged.
@param {Object} state the state associated with the URL
@param {string} title the title of the page
@param {string} fra... | [
"The",
"magical",
"method",
"the",
"application",
"code",
"will",
"call",
"to",
"navigate",
"around",
"high",
"level",
"it",
"pushes",
"the",
"state",
"gets",
"the",
"templates",
"from",
"server",
"puts",
"them",
"on",
"the",
"page",
"and",
"broadcasts",
"th... | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/router.js#L100-L108 | |
16,705 | box/t3js | examples/todo/js/behaviors/todo.js | getClosestTodoElement | function getClosestTodoElement(element) {
var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector;
while (element) {
if (matchesSelector.bind(element)('li')) {
return element;
} else {
element = element.parentNode;
}
}
... | javascript | function getClosestTodoElement(element) {
var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector;
while (element) {
if (matchesSelector.bind(element)('li')) {
return element;
} else {
element = element.parentNode;
}
}
... | [
"function",
"getClosestTodoElement",
"(",
"element",
")",
"{",
"var",
"matchesSelector",
"=",
"element",
".",
"matches",
"||",
"element",
".",
"webkitMatchesSelector",
"||",
"element",
".",
"mozMatchesSelector",
"||",
"element",
".",
"msMatchesSelector",
";",
"while... | Returns the nearest todo element
@param {HTMLElement} element A root/child node of a todo element to search from
@returns {HTMLElement}
@private | [
"Returns",
"the",
"nearest",
"todo",
"element"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L31-L44 |
16,706 | box/t3js | examples/todo/js/behaviors/todo.js | function(event, element, elementType) {
if (elementType === 'delete-btn') {
var todoEl = getClosestTodoElement(element),
todoId = getClosestTodoId(element);
moduleEl.querySelector('#todo-list').removeChild(todoEl);
todosDB.remove(todoId);
context.broadcast('todoremoved', {
id: todoId
... | javascript | function(event, element, elementType) {
if (elementType === 'delete-btn') {
var todoEl = getClosestTodoElement(element),
todoId = getClosestTodoId(element);
moduleEl.querySelector('#todo-list').removeChild(todoEl);
todosDB.remove(todoId);
context.broadcast('todoremoved', {
id: todoId
... | [
"function",
"(",
"event",
",",
"element",
",",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"===",
"'delete-btn'",
")",
"{",
"var",
"todoEl",
"=",
"getClosestTodoElement",
"(",
"element",
")",
",",
"todoId",
"=",
"getClosestTodoId",
"(",
"element",
")"... | Handles all click events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or ... | [
"Handles",
"all",
"click",
"events",
"for",
"the",
"behavior",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L90-L105 | |
16,707 | box/t3js | examples/todo/js/behaviors/todo.js | function(event, element, elementType) {
if (elementType === 'mark-as-complete-checkbox') {
var todoEl = getClosestTodoElement(element),
todoId = getClosestTodoId(element);
if (element.checked) {
todoEl.classList.add('completed');
todosDB.markAsComplete(todoId);
} else {
todoEl.class... | javascript | function(event, element, elementType) {
if (elementType === 'mark-as-complete-checkbox') {
var todoEl = getClosestTodoElement(element),
todoId = getClosestTodoId(element);
if (element.checked) {
todoEl.classList.add('completed');
todosDB.markAsComplete(todoId);
} else {
todoEl.class... | [
"function",
"(",
"event",
",",
"element",
",",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"===",
"'mark-as-complete-checkbox'",
")",
"{",
"var",
"todoEl",
"=",
"getClosestTodoElement",
"(",
"element",
")",
",",
"todoId",
"=",
"getClosestTodoId",
"(",
"... | Handles change events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or nul... | [
"Handles",
"change",
"events",
"for",
"the",
"behavior",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L116-L134 | |
16,708 | box/t3js | examples/todo/js/behaviors/todo.js | function(event, element, elementType) {
if (elementType === 'todo-label') {
var todoEl = getClosestTodoElement(element);
event.preventDefault();
event.stopPropagation();
this.showEditor(todoEl);
}
} | javascript | function(event, element, elementType) {
if (elementType === 'todo-label') {
var todoEl = getClosestTodoElement(element);
event.preventDefault();
event.stopPropagation();
this.showEditor(todoEl);
}
} | [
"function",
"(",
"event",
",",
"element",
",",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"===",
"'todo-label'",
")",
"{",
"var",
"todoEl",
"=",
"getClosestTodoElement",
"(",
"element",
")",
";",
"event",
".",
"preventDefault",
"(",
")",
";",
"even... | Handles double click events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified ... | [
"Handles",
"double",
"click",
"events",
"for",
"the",
"behavior",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L145-L156 | |
16,709 | box/t3js | examples/todo/js/behaviors/todo.js | function(event, element, elementType) {
if (elementType === 'edit-input') {
var todoEl = getClosestTodoElement(element);
if (event.keyCode === ENTER_KEY) {
this.saveLabel(todoEl);
this.hideEditor(todoEl);
} else if (event.keyCode === ESCAPE_KEY) {
this.hideEditor(todoEl);
}
}
... | javascript | function(event, element, elementType) {
if (elementType === 'edit-input') {
var todoEl = getClosestTodoElement(element);
if (event.keyCode === ENTER_KEY) {
this.saveLabel(todoEl);
this.hideEditor(todoEl);
} else if (event.keyCode === ESCAPE_KEY) {
this.hideEditor(todoEl);
}
}
... | [
"function",
"(",
"event",
",",
"element",
",",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"===",
"'edit-input'",
")",
"{",
"var",
"todoEl",
"=",
"getClosestTodoElement",
"(",
"element",
")",
";",
"if",
"(",
"event",
".",
"keyCode",
"===",
"ENTER_KE... | Handles keydown events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or nu... | [
"Handles",
"keydown",
"events",
"for",
"the",
"behavior",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L167-L181 | |
16,710 | box/t3js | examples/todo/js/behaviors/todo.js | function(todoEl) {
var todoId = getClosestTodoId(todoEl),
editInputEl = todoEl.querySelector('.edit'),
title = todosDB.get(todoId).title; // Grab current label
// Set the edit input value to current label
editInputEl.value = title;
todoEl.classList.add('editing');
// Place user cursor in the i... | javascript | function(todoEl) {
var todoId = getClosestTodoId(todoEl),
editInputEl = todoEl.querySelector('.edit'),
title = todosDB.get(todoId).title; // Grab current label
// Set the edit input value to current label
editInputEl.value = title;
todoEl.classList.add('editing');
// Place user cursor in the i... | [
"function",
"(",
"todoEl",
")",
"{",
"var",
"todoId",
"=",
"getClosestTodoId",
"(",
"todoEl",
")",
",",
"editInputEl",
"=",
"todoEl",
".",
"querySelector",
"(",
"'.edit'",
")",
",",
"title",
"=",
"todosDB",
".",
"get",
"(",
"todoId",
")",
".",
"title",
... | Displays a input box for the user to edit the label with
@param {HTMLElement} todoEl The todo element to edit
@returns {void} | [
"Displays",
"a",
"input",
"box",
"for",
"the",
"user",
"to",
"edit",
"the",
"label",
"with"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L188-L200 | |
16,711 | box/t3js | examples/todo/js/behaviors/todo.js | function(todoEl) {
var todoId = getClosestTodoId(todoEl),
editInputEl = todoEl.querySelector('.edit'),
newTitle = (editInputEl.value).trim();
todoEl.querySelector('label').textContent = newTitle;
todosDB.edit(todoId, newTitle);
} | javascript | function(todoEl) {
var todoId = getClosestTodoId(todoEl),
editInputEl = todoEl.querySelector('.edit'),
newTitle = (editInputEl.value).trim();
todoEl.querySelector('label').textContent = newTitle;
todosDB.edit(todoId, newTitle);
} | [
"function",
"(",
"todoEl",
")",
"{",
"var",
"todoId",
"=",
"getClosestTodoId",
"(",
"todoEl",
")",
",",
"editInputEl",
"=",
"todoEl",
".",
"querySelector",
"(",
"'.edit'",
")",
",",
"newTitle",
"=",
"(",
"editInputEl",
".",
"value",
")",
".",
"trim",
"("... | Saves the value of the edit input and saves it to the db
@param {HTMLElement} todoEl The todo element to edit
@returns {void} | [
"Saves",
"the",
"value",
"of",
"the",
"edit",
"input",
"and",
"saves",
"it",
"to",
"the",
"db"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/behaviors/todo.js#L216-L223 | |
16,712 | box/t3js | examples/todo/js/modules/list.js | isListCompleted | function isListCompleted() {
var todos = todosDB.getList();
var len = todos.length;
var isComplete = len > 0;
for (var i = 0; i < len; i++) {
if (!todos[i].completed) {
isComplete = false;
break;
}
}
return isComplete;
} | javascript | function isListCompleted() {
var todos = todosDB.getList();
var len = todos.length;
var isComplete = len > 0;
for (var i = 0; i < len; i++) {
if (!todos[i].completed) {
isComplete = false;
break;
}
}
return isComplete;
} | [
"function",
"isListCompleted",
"(",
")",
"{",
"var",
"todos",
"=",
"todosDB",
".",
"getList",
"(",
")",
";",
"var",
"len",
"=",
"todos",
".",
"length",
";",
"var",
"isComplete",
"=",
"len",
">",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i... | Returns true if all todos in the list are complete
@returns {boolean}
@private | [
"Returns",
"true",
"if",
"all",
"todos",
"in",
"the",
"list",
"are",
"complete"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/list.js#L26-L37 |
16,713 | box/t3js | examples/todo/js/modules/list.js | function(event, element, elementType) {
if (elementType === 'select-all-checkbox') {
var shouldMarkAsComplete = element.checked;
if (shouldMarkAsComplete) {
todosDB.markAllAsComplete();
} else {
todosDB.markAllAsIncomplete();
}
this.renderList();
context.broadcast('todostatuscha... | javascript | function(event, element, elementType) {
if (elementType === 'select-all-checkbox') {
var shouldMarkAsComplete = element.checked;
if (shouldMarkAsComplete) {
todosDB.markAllAsComplete();
} else {
todosDB.markAllAsIncomplete();
}
this.renderList();
context.broadcast('todostatuscha... | [
"function",
"(",
"event",
",",
"element",
",",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"===",
"'select-all-checkbox'",
")",
"{",
"var",
"shouldMarkAsComplete",
"=",
"element",
".",
"checked",
";",
"if",
"(",
"shouldMarkAsComplete",
")",
"{",
"todosD... | Handles all click events for the module.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or nu... | [
"Handles",
"all",
"click",
"events",
"for",
"the",
"module",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/list.js#L101-L117 | |
16,714 | box/t3js | examples/todo/js/modules/list.js | function(name, data) {
switch(name) {
case 'todoadded':
case 'todoremoved':
this.renderList();
this.updateSelectAllCheckbox();
break;
case 'todostatuschange':
this.updateSelectAllCheckbox();
break;
case 'statechanged':
setFilterByUrl(data.url);
this.renderList();... | javascript | function(name, data) {
switch(name) {
case 'todoadded':
case 'todoremoved':
this.renderList();
this.updateSelectAllCheckbox();
break;
case 'todostatuschange':
this.updateSelectAllCheckbox();
break;
case 'statechanged':
setFilterByUrl(data.url);
this.renderList();... | [
"function",
"(",
"name",
",",
"data",
")",
"{",
"switch",
"(",
"name",
")",
"{",
"case",
"'todoadded'",
":",
"case",
"'todoremoved'",
":",
"this",
".",
"renderList",
"(",
")",
";",
"this",
".",
"updateSelectAllCheckbox",
"(",
")",
";",
"break",
";",
"c... | Handles all messages received for the module.
@param {string} name The name of the message received.
@param {*} [data] Additional data sent along with the message.
@returns {void} | [
"Handles",
"all",
"messages",
"received",
"for",
"the",
"module",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/list.js#L125-L144 | |
16,715 | box/t3js | examples/todo/js/modules/list.js | function(id, title, isCompleted) {
var todoTemplateEl = moduleEl.querySelector('.todo-template-container li'),
newTodoEl = todoTemplateEl.cloneNode(true);
// Set the label of the todo
newTodoEl.querySelector('label').textContent = title;
newTodoEl.setAttribute('data-todo-id', id);
if (isCompleted) {... | javascript | function(id, title, isCompleted) {
var todoTemplateEl = moduleEl.querySelector('.todo-template-container li'),
newTodoEl = todoTemplateEl.cloneNode(true);
// Set the label of the todo
newTodoEl.querySelector('label').textContent = title;
newTodoEl.setAttribute('data-todo-id', id);
if (isCompleted) {... | [
"function",
"(",
"id",
",",
"title",
",",
"isCompleted",
")",
"{",
"var",
"todoTemplateEl",
"=",
"moduleEl",
".",
"querySelector",
"(",
"'.todo-template-container li'",
")",
",",
"newTodoEl",
"=",
"todoTemplateEl",
".",
"cloneNode",
"(",
"true",
")",
";",
"// ... | Creates a list item for a todo based off of a template
@param {number} id The id of the todo
@param {string} title The todo label
@param {boolean} isCompleted Is todo complete
@returns {Node} | [
"Creates",
"a",
"list",
"item",
"for",
"a",
"todo",
"based",
"off",
"of",
"a",
"template"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/list.js#L153-L166 | |
16,716 | box/t3js | examples/todo/js/modules/list.js | function() {
// Clear the todo list first
this.clearList();
var todos = todosDB.getList(),
todo;
// Render todos - factor in the current filter as well
for (var i = 0, len = todos.length; i < len; i++) {
todo = todos[i];
if (!filter
|| (filter === 'incomplete' && !todo.completed)
... | javascript | function() {
// Clear the todo list first
this.clearList();
var todos = todosDB.getList(),
todo;
// Render todos - factor in the current filter as well
for (var i = 0, len = todos.length; i < len; i++) {
todo = todos[i];
if (!filter
|| (filter === 'incomplete' && !todo.completed)
... | [
"function",
"(",
")",
"{",
"// Clear the todo list first",
"this",
".",
"clearList",
"(",
")",
";",
"var",
"todos",
"=",
"todosDB",
".",
"getList",
"(",
")",
",",
"todo",
";",
"// Render todos - factor in the current filter as well",
"for",
"(",
"var",
"i",
"=",... | Renders all todos in the todos db
@returns {void} | [
"Renders",
"all",
"todos",
"in",
"the",
"todos",
"db"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/list.js#L203-L221 | |
16,717 | box/t3js | dist/t3-jquery.js | function(type, handler) {
var handlers = this._handlers[type],
i,
len;
if (typeof handlers === 'undefined') {
handlers = this._handlers[type] = [];
}
for (i = 0, len = handlers.length; i < len; i++) {
if (handlers[i] === handler) {
// prevent duplicate handlers
return;
}
... | javascript | function(type, handler) {
var handlers = this._handlers[type],
i,
len;
if (typeof handlers === 'undefined') {
handlers = this._handlers[type] = [];
}
for (i = 0, len = handlers.length; i < len; i++) {
if (handlers[i] === handler) {
// prevent duplicate handlers
return;
}
... | [
"function",
"(",
"type",
",",
"handler",
")",
"{",
"var",
"handlers",
"=",
"this",
".",
"_handlers",
"[",
"type",
"]",
",",
"i",
",",
"len",
";",
"if",
"(",
"typeof",
"handlers",
"===",
"'undefined'",
")",
"{",
"handlers",
"=",
"this",
".",
"_handler... | Adds a new event handler for a particular type of event.
@param {string} type The name of the event to listen for.
@param {Function} handler The function to call when the event occurs.
@returns {void} | [
"Adds",
"a",
"new",
"event",
"handler",
"for",
"a",
"particular",
"type",
"of",
"event",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/dist/t3-jquery.js#L73-L91 | |
16,718 | box/t3js | dist/t3-jquery.js | DOMEventDelegate | function DOMEventDelegate(element, handler, eventTypes) {
/**
* The DOM element that this object is handling events for.
* @type {HTMLElement}
*/
this.element = element;
/**
* Object on which event handlers are available.
* @type {Object}
* @private
*/
this._handler = handler;
/**
*... | javascript | function DOMEventDelegate(element, handler, eventTypes) {
/**
* The DOM element that this object is handling events for.
* @type {HTMLElement}
*/
this.element = element;
/**
* Object on which event handlers are available.
* @type {Object}
* @private
*/
this._handler = handler;
/**
*... | [
"function",
"DOMEventDelegate",
"(",
"element",
",",
"handler",
",",
"eventTypes",
")",
"{",
"/**\n\t\t * The DOM element that this object is handling events for.\n\t\t * @type {HTMLElement}\n\t\t */",
"this",
".",
"element",
"=",
"element",
";",
"/**\n\t\t * Object on which event ... | An object that manages events within a single DOM element.
@param {HTMLElement} element The DOM element to handle events for.
@param {Object} handler An object containing event handlers such as "onclick".
@param {string[]} [eventTypes] A list of event types to handle (events must bubble). Defaults to a common set of ev... | [
"An",
"object",
"that",
"manages",
"events",
"within",
"a",
"single",
"DOM",
"element",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/dist/t3-jquery.js#L314-L350 |
16,719 | box/t3js | dist/t3-jquery.js | function() {
if (!this._attached) {
forEachEventType(this._eventTypes, this._handler, function(eventType) {
var that = this;
function handleEvent() {
that._handleEvent.apply(that, arguments);
}
Box.DOM.on(this.element, eventType, handleEvent);
this._boundHandler[eventType] = ha... | javascript | function() {
if (!this._attached) {
forEachEventType(this._eventTypes, this._handler, function(eventType) {
var that = this;
function handleEvent() {
that._handleEvent.apply(that, arguments);
}
Box.DOM.on(this.element, eventType, handleEvent);
this._boundHandler[eventType] = ha... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_attached",
")",
"{",
"forEachEventType",
"(",
"this",
".",
"_eventTypes",
",",
"this",
".",
"_handler",
",",
"function",
"(",
"eventType",
")",
"{",
"var",
"that",
"=",
"this",
";",
"function",
... | Attaches all event handlers for the DOM element.
@returns {void} | [
"Attaches",
"all",
"event",
"handlers",
"for",
"the",
"DOM",
"element",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/dist/t3-jquery.js#L369-L386 | |
16,720 | box/t3js | dist/t3-jquery.js | function() {
forEachEventType(this._eventTypes, this._handler, function(eventType) {
Box.DOM.off(this.element, eventType, this._boundHandler[eventType]);
}, this);
} | javascript | function() {
forEachEventType(this._eventTypes, this._handler, function(eventType) {
Box.DOM.off(this.element, eventType, this._boundHandler[eventType]);
}, this);
} | [
"function",
"(",
")",
"{",
"forEachEventType",
"(",
"this",
".",
"_eventTypes",
",",
"this",
".",
"_handler",
",",
"function",
"(",
"eventType",
")",
"{",
"Box",
".",
"DOM",
".",
"off",
"(",
"this",
".",
"element",
",",
"eventType",
",",
"this",
".",
... | Detaches all event handlers for the DOM element.
@returns {void} | [
"Detaches",
"all",
"event",
"handlers",
"for",
"the",
"DOM",
"element",
"."
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/dist/t3-jquery.js#L392-L396 | |
16,721 | box/t3js | examples/todo/js/modules/footer.js | function(url) {
var linkEls = moduleEl.querySelectorAll('a');
for (var i = 0, len = linkEls.length; i < len; i++) {
if (url === linkEls[i].pathname) {
linkEls[i].classList.add('selected');
} else {
linkEls[i].classList.remove('selected');
}
}
} | javascript | function(url) {
var linkEls = moduleEl.querySelectorAll('a');
for (var i = 0, len = linkEls.length; i < len; i++) {
if (url === linkEls[i].pathname) {
linkEls[i].classList.add('selected');
} else {
linkEls[i].classList.remove('selected');
}
}
} | [
"function",
"(",
"url",
")",
"{",
"var",
"linkEls",
"=",
"moduleEl",
".",
"querySelectorAll",
"(",
"'a'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"linkEls",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"if... | Updates the selected class on the filter links
@param {string} url The current url
@returns {void} | [
"Updates",
"the",
"selected",
"class",
"on",
"the",
"filter",
"links"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/footer.js#L90-L100 | |
16,722 | box/t3js | examples/todo/js/modules/footer.js | function() {
var todos = todosDB.getList();
var completedCount = 0;
for (var i = 0, len = todos.length; i < len; i++) {
if (todos[i].completed) {
completedCount++;
}
}
var itemsLeft = todos.length - completedCount;
this.updateItemsLeft(itemsLeft);
this.updateCompletedButton(complete... | javascript | function() {
var todos = todosDB.getList();
var completedCount = 0;
for (var i = 0, len = todos.length; i < len; i++) {
if (todos[i].completed) {
completedCount++;
}
}
var itemsLeft = todos.length - completedCount;
this.updateItemsLeft(itemsLeft);
this.updateCompletedButton(complete... | [
"function",
"(",
")",
"{",
"var",
"todos",
"=",
"todosDB",
".",
"getList",
"(",
")",
";",
"var",
"completedCount",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"todos",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
... | Updates todo counts based on what is in the todo DB
@returns {void} | [
"Updates",
"todo",
"counts",
"based",
"on",
"what",
"is",
"in",
"the",
"todo",
"DB"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/footer.js#L107-L122 | |
16,723 | box/t3js | examples/todo/js/modules/footer.js | function(itemsLeft) {
var itemText = itemsLeft === 1 ? 'item' : 'items';
moduleEl.querySelector('.items-left-counter').textContent = itemsLeft;
moduleEl.querySelector('.items-left-text').textContent = itemText + ' left';
} | javascript | function(itemsLeft) {
var itemText = itemsLeft === 1 ? 'item' : 'items';
moduleEl.querySelector('.items-left-counter').textContent = itemsLeft;
moduleEl.querySelector('.items-left-text').textContent = itemText + ' left';
} | [
"function",
"(",
"itemsLeft",
")",
"{",
"var",
"itemText",
"=",
"itemsLeft",
"===",
"1",
"?",
"'item'",
":",
"'items'",
";",
"moduleEl",
".",
"querySelector",
"(",
"'.items-left-counter'",
")",
".",
"textContent",
"=",
"itemsLeft",
";",
"moduleEl",
".",
"que... | Updates the displayed count of incomplete tasks
@param {number} itemsLeft # of incomplete tasks
@returns {void} | [
"Updates",
"the",
"displayed",
"count",
"of",
"incomplete",
"tasks"
] | 1cc1751650e339bd5243a0f20cc76543c834ac09 | https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/modules/footer.js#L129-L134 | |
16,724 | hugomrdias/prettier-stylelint | src/index.js | resolveConfig | function resolveConfig({
filePath,
stylelintPath,
stylelintConfig,
prettierOptions
}) {
const resolve = resolveConfig.resolve;
const stylelint = requireRelative(stylelintPath, filePath, 'stylelint');
const linterAPI = stylelint.createLinter();
if (stylelintConfig) {
return Promi... | javascript | function resolveConfig({
filePath,
stylelintPath,
stylelintConfig,
prettierOptions
}) {
const resolve = resolveConfig.resolve;
const stylelint = requireRelative(stylelintPath, filePath, 'stylelint');
const linterAPI = stylelint.createLinter();
if (stylelintConfig) {
return Promi... | [
"function",
"resolveConfig",
"(",
"{",
"filePath",
",",
"stylelintPath",
",",
"stylelintConfig",
",",
"prettierOptions",
"}",
")",
"{",
"const",
"resolve",
"=",
"resolveConfig",
".",
"resolve",
";",
"const",
"stylelint",
"=",
"requireRelative",
"(",
"stylelintPath... | Resolve Config for the given file
@export
@param {string} file - filepath
@param {Object} options - options
@returns {Promise} - | [
"Resolve",
"Config",
"for",
"the",
"given",
"file"
] | 2e37e73e600a3e01aef9b053c712914f872385d1 | https://github.com/hugomrdias/prettier-stylelint/blob/2e37e73e600a3e01aef9b053c712914f872385d1/src/index.js#L16-L33 |
16,725 | artsy/gemup | gemup.js | function() {
var xhr = $.ajaxSettings.xhr();
if (!xhr.upload) return xhr;
xhr.upload.addEventListener('progress', function(e) {
options.progress(e.loaded / e.total);
});
return xhr;
} | javascript | function() {
var xhr = $.ajaxSettings.xhr();
if (!xhr.upload) return xhr;
xhr.upload.addEventListener('progress', function(e) {
options.progress(e.loaded / e.total);
});
return xhr;
} | [
"function",
"(",
")",
"{",
"var",
"xhr",
"=",
"$",
".",
"ajaxSettings",
".",
"xhr",
"(",
")",
";",
"if",
"(",
"!",
"xhr",
".",
"upload",
")",
"return",
"xhr",
";",
"xhr",
".",
"upload",
".",
"addEventListener",
"(",
"'progress'",
",",
"function",
"... | Send progress updates | [
"Send",
"progress",
"updates"
] | 25f8883218b974a6c713dde071274f144974dc6f | https://github.com/artsy/gemup/blob/25f8883218b974a6c713dde071274f144974dc6f/gemup.js#L66-L73 | |
16,726 | beyondxgb/xredux | examples/standard/src/core/request/index.js | buildRequest | async function buildRequest(method, url, params, options) {
let param = {};
let config = {};
if (noneBodyMethod.indexOf(method) >= 0) {
param = { params: { ...params }, ...reqConfig, ...options };
} else {
param = JSON.stringify(params);
config = {
...reqConfig,
headers: {
'Conte... | javascript | async function buildRequest(method, url, params, options) {
let param = {};
let config = {};
if (noneBodyMethod.indexOf(method) >= 0) {
param = { params: { ...params }, ...reqConfig, ...options };
} else {
param = JSON.stringify(params);
config = {
...reqConfig,
headers: {
'Conte... | [
"async",
"function",
"buildRequest",
"(",
"method",
",",
"url",
",",
"params",
",",
"options",
")",
"{",
"let",
"param",
"=",
"{",
"}",
";",
"let",
"config",
"=",
"{",
"}",
";",
"if",
"(",
"noneBodyMethod",
".",
"indexOf",
"(",
"method",
")",
">=",
... | Build uniform request | [
"Build",
"uniform",
"request"
] | b889468837016cc0770c04f72822fea90fdb75fb | https://github.com/beyondxgb/xredux/blob/b889468837016cc0770c04f72822fea90fdb75fb/examples/standard/src/core/request/index.js#L27-L44 |
16,727 | beyondxgb/xredux | examples/standard/src/index.js | renderRoutes | function renderRoutes() {
return (
<Switch>
{
routes.map(route => (
<Route key={route.path || ''} {...route} />
))
}
</Switch>
);
} | javascript | function renderRoutes() {
return (
<Switch>
{
routes.map(route => (
<Route key={route.path || ''} {...route} />
))
}
</Switch>
);
} | [
"function",
"renderRoutes",
"(",
")",
"{",
"return",
"(",
"<",
"Switch",
">",
"\n ",
"{",
"routes",
".",
"map",
"(",
"route",
"=>",
"(",
"<",
"Route",
"key",
"=",
"{",
"route",
".",
"path",
"||",
"''",
"}",
"{",
"...",
"route",
"}",
"/",
">"... | Render routes from route config | [
"Render",
"routes",
"from",
"route",
"config"
] | b889468837016cc0770c04f72822fea90fdb75fb | https://github.com/beyondxgb/xredux/blob/b889468837016cc0770c04f72822fea90fdb75fb/examples/standard/src/index.js#L29-L39 |
16,728 | dominictarr/epidemic-broadcast-trees | events.js | isAlreadyReplicating | function isAlreadyReplicating(state, feed_id, ignore_id) {
for(var id in state.peers) {
if(id !== ignore_id) {
var peer = state.peers[id]
if(peer.notes && getReceive(peer.notes[id])) return id
if(peer.replicating && peer.replicating[feed_id] && peer.replicating[feed_id].rx) return id
}
}
... | javascript | function isAlreadyReplicating(state, feed_id, ignore_id) {
for(var id in state.peers) {
if(id !== ignore_id) {
var peer = state.peers[id]
if(peer.notes && getReceive(peer.notes[id])) return id
if(peer.replicating && peer.replicating[feed_id] && peer.replicating[feed_id].rx) return id
}
}
... | [
"function",
"isAlreadyReplicating",
"(",
"state",
",",
"feed_id",
",",
"ignore_id",
")",
"{",
"for",
"(",
"var",
"id",
"in",
"state",
".",
"peers",
")",
"{",
"if",
"(",
"id",
"!==",
"ignore_id",
")",
"{",
"var",
"peer",
"=",
"state",
".",
"peers",
"[... | check if a feed is already being replicated on another peer from ignore_id | [
"check",
"if",
"a",
"feed",
"is",
"already",
"being",
"replicated",
"on",
"another",
"peer",
"from",
"ignore_id"
] | 48cfd33a757d378ce78235a33c294f22791e133d | https://github.com/dominictarr/epidemic-broadcast-trees/blob/48cfd33a757d378ce78235a33c294f22791e133d/events.js#L34-L43 |
16,729 | dominictarr/epidemic-broadcast-trees | events.js | isAvailable | function isAvailable(state, feed_id, ignore_id) {
for(var peer_id in state.peers) {
if(peer_id != ignore_id) {
var peer = state.peers[peer_id]
//BLOCK: check wether id has blocked this peer
if((peer.clock && peer.clock[feed_id] || 0) > (state.clock[feed_id] || 0) && isShared(state, feed_id, peer... | javascript | function isAvailable(state, feed_id, ignore_id) {
for(var peer_id in state.peers) {
if(peer_id != ignore_id) {
var peer = state.peers[peer_id]
//BLOCK: check wether id has blocked this peer
if((peer.clock && peer.clock[feed_id] || 0) > (state.clock[feed_id] || 0) && isShared(state, feed_id, peer... | [
"function",
"isAvailable",
"(",
"state",
",",
"feed_id",
",",
"ignore_id",
")",
"{",
"for",
"(",
"var",
"peer_id",
"in",
"state",
".",
"peers",
")",
"{",
"if",
"(",
"peer_id",
"!=",
"ignore_id",
")",
"{",
"var",
"peer",
"=",
"state",
".",
"peers",
"[... | check if a feed is available from a peer apart from ignore_id | [
"check",
"if",
"a",
"feed",
"is",
"available",
"from",
"a",
"peer",
"apart",
"from",
"ignore_id"
] | 48cfd33a757d378ce78235a33c294f22791e133d | https://github.com/dominictarr/epidemic-broadcast-trees/blob/48cfd33a757d378ce78235a33c294f22791e133d/events.js#L53-L63 |
16,730 | dominictarr/epidemic-broadcast-trees | events.js | eachFrom | function eachFrom(keys, key, iter) {
var i = keys.indexOf(key)
if(!~i) return
//start at 1 because we want to visit all keys but key.
for(var j = 1; j < keys.length; j++)
if(iter(keys[(j+i)%keys.length], j))
return
} | javascript | function eachFrom(keys, key, iter) {
var i = keys.indexOf(key)
if(!~i) return
//start at 1 because we want to visit all keys but key.
for(var j = 1; j < keys.length; j++)
if(iter(keys[(j+i)%keys.length], j))
return
} | [
"function",
"eachFrom",
"(",
"keys",
",",
"key",
",",
"iter",
")",
"{",
"var",
"i",
"=",
"keys",
".",
"indexOf",
"(",
"key",
")",
"if",
"(",
"!",
"~",
"i",
")",
"return",
"//start at 1 because we want to visit all keys but key.",
"for",
"(",
"var",
"j",
... | jump to a particular key in a list, then iterate from there back around to the key. this is used for switching away from peers that stall so that you'll rotate through all the peers not just swich between two different peers. | [
"jump",
"to",
"a",
"particular",
"key",
"in",
"a",
"list",
"then",
"iterate",
"from",
"there",
"back",
"around",
"to",
"the",
"key",
".",
"this",
"is",
"used",
"for",
"switching",
"away",
"from",
"peers",
"that",
"stall",
"so",
"that",
"you",
"ll",
"ro... | 48cfd33a757d378ce78235a33c294f22791e133d | https://github.com/dominictarr/epidemic-broadcast-trees/blob/48cfd33a757d378ce78235a33c294f22791e133d/events.js#L70-L77 |
16,731 | Kurento/kurento-utils-js | lib/WebRtcPeer.js | WebRtcPeerRecvonly | function WebRtcPeerRecvonly(options, callback) {
if (!(this instanceof WebRtcPeerRecvonly)) {
return new WebRtcPeerRecvonly(options, callback)
}
WebRtcPeerRecvonly.super_.call(this, 'recvonly', options, callback)
} | javascript | function WebRtcPeerRecvonly(options, callback) {
if (!(this instanceof WebRtcPeerRecvonly)) {
return new WebRtcPeerRecvonly(options, callback)
}
WebRtcPeerRecvonly.super_.call(this, 'recvonly', options, callback)
} | [
"function",
"WebRtcPeerRecvonly",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"WebRtcPeerRecvonly",
")",
")",
"{",
"return",
"new",
"WebRtcPeerRecvonly",
"(",
"options",
",",
"callback",
")",
"}",
"WebRtcPeerRecvonly",
... | Specialized child classes | [
"Specialized",
"child",
"classes"
] | b808a5403320ba55ffb265ccac9a2fe598b54087 | https://github.com/Kurento/kurento-utils-js/blob/b808a5403320ba55ffb265ccac9a2fe598b54087/lib/WebRtcPeer.js#L739-L745 |
16,732 | englercj/node-esl | examples/chatty/public/js/app.js | sendMessage | function sendMessage(e) {
var txt = $('#msgtxt').val().trim();
if(!txt) return;
$('#messages').append(createMsgBox(txt));
socket.emit('sendmsg', txt, function(evtJson) {
var evt = JSON.parse(evtJson),
reply = evt['Reply-Text'].split(' '), //0 = +OK, 1 = uuid
... | javascript | function sendMessage(e) {
var txt = $('#msgtxt').val().trim();
if(!txt) return;
$('#messages').append(createMsgBox(txt));
socket.emit('sendmsg', txt, function(evtJson) {
var evt = JSON.parse(evtJson),
reply = evt['Reply-Text'].split(' '), //0 = +OK, 1 = uuid
... | [
"function",
"sendMessage",
"(",
"e",
")",
"{",
"var",
"txt",
"=",
"$",
"(",
"'#msgtxt'",
")",
".",
"val",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"txt",
")",
"return",
";",
"$",
"(",
"'#messages'",
")",
".",
"append",
"(",
"create... | send a text | [
"send",
"a",
"text"
] | 2b7780e5307c0c0bd68baf09893dcef6780186e3 | https://github.com/englercj/node-esl/blob/2b7780e5307c0c0bd68baf09893dcef6780186e3/examples/chatty/public/js/app.js#L28-L47 |
16,733 | englercj/node-esl | examples/chatty/public/js/app.js | openChat | function openChat() {
var num = validateNum();
if(num) {
socket.emit('setup', num, function() {
number = num;
$('#num').hide();
$('#chat').show();
});
}
} | javascript | function openChat() {
var num = validateNum();
if(num) {
socket.emit('setup', num, function() {
number = num;
$('#num').hide();
$('#chat').show();
});
}
} | [
"function",
"openChat",
"(",
")",
"{",
"var",
"num",
"=",
"validateNum",
"(",
")",
";",
"if",
"(",
"num",
")",
"{",
"socket",
".",
"emit",
"(",
"'setup'",
",",
"num",
",",
"function",
"(",
")",
"{",
"number",
"=",
"num",
";",
"$",
"(",
"'#num'",
... | opens a chat session with a number | [
"opens",
"a",
"chat",
"session",
"with",
"a",
"number"
] | 2b7780e5307c0c0bd68baf09893dcef6780186e3 | https://github.com/englercj/node-esl/blob/2b7780e5307c0c0bd68baf09893dcef6780186e3/examples/chatty/public/js/app.js#L55-L65 |
16,734 | englercj/node-esl | examples/chatty/public/js/app.js | validateNum | function validateNum() {
var pass = true,
num = '';
['#areacode', '#phnum1', '#phnum2'].forEach(function(id) {
var $e = $(id),
val = $e.val();
if(!val || val.length !== parseInt($e.attr('maxlength'), 10)) {
pass = false;
$e.ad... | javascript | function validateNum() {
var pass = true,
num = '';
['#areacode', '#phnum1', '#phnum2'].forEach(function(id) {
var $e = $(id),
val = $e.val();
if(!val || val.length !== parseInt($e.attr('maxlength'), 10)) {
pass = false;
$e.ad... | [
"function",
"validateNum",
"(",
")",
"{",
"var",
"pass",
"=",
"true",
",",
"num",
"=",
"''",
";",
"[",
"'#areacode'",
",",
"'#phnum1'",
",",
"'#phnum2'",
"]",
".",
"forEach",
"(",
"function",
"(",
"id",
")",
"{",
"var",
"$e",
"=",
"$",
"(",
"id",
... | validate the phone number fields | [
"validate",
"the",
"phone",
"number",
"fields"
] | 2b7780e5307c0c0bd68baf09893dcef6780186e3 | https://github.com/englercj/node-esl/blob/2b7780e5307c0c0bd68baf09893dcef6780186e3/examples/chatty/public/js/app.js#L68-L87 |
16,735 | vitalets/angular-xeditable | dist/js/xeditable.js | function() {
if (this.$visible) {
return;
}
this.$visible = true;
var pc = editablePromiseCollection();
//own show
pc.when(this.$onshow());
//clear errors
this.$setError(null, '');
//children show
angular.forEach(this.$editables, function(editable... | javascript | function() {
if (this.$visible) {
return;
}
this.$visible = true;
var pc = editablePromiseCollection();
//own show
pc.when(this.$onshow());
//clear errors
this.$setError(null, '');
//children show
angular.forEach(this.$editables, function(editable... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"$visible",
")",
"{",
"return",
";",
"}",
"this",
".",
"$visible",
"=",
"true",
";",
"var",
"pc",
"=",
"editablePromiseCollection",
"(",
")",
";",
"//own show",
"pc",
".",
"when",
"(",
"this",
".",
... | Shows form with editable controls.
@method $show()
@memberOf editable-form | [
"Shows",
"form",
"with",
"editable",
"controls",
"."
] | 257ad977266d093bf853b328690ec0d670dbe4f2 | https://github.com/vitalets/angular-xeditable/blob/257ad977266d093bf853b328690ec0d670dbe4f2/dist/js/xeditable.js#L1558-L1595 | |
16,736 | vitalets/angular-xeditable | dist/js/xeditable.js | function(name, msg) {
angular.forEach(this.$editables, function(editable) {
if(!name || editable.name === name) {
editable.setError(msg);
}
});
} | javascript | function(name, msg) {
angular.forEach(this.$editables, function(editable) {
if(!name || editable.name === name) {
editable.setError(msg);
}
});
} | [
"function",
"(",
"name",
",",
"msg",
")",
"{",
"angular",
".",
"forEach",
"(",
"this",
".",
"$editables",
",",
"function",
"(",
"editable",
")",
"{",
"if",
"(",
"!",
"name",
"||",
"editable",
".",
"name",
"===",
"name",
")",
"{",
"editable",
".",
"... | Shows error message for particular field.
@method $setError(name, msg)
@param {string} name name of field
@param {string} msg error message
@memberOf editable-form | [
"Shows",
"error",
"message",
"for",
"particular",
"field",
"."
] | 257ad977266d093bf853b328690ec0d670dbe4f2 | https://github.com/vitalets/angular-xeditable/blob/257ad977266d093bf853b328690ec0d670dbe4f2/dist/js/xeditable.js#L1700-L1706 | |
16,737 | vitalets/angular-xeditable | dist/js/xeditable.js | getNearest | function getNearest($select, value) {
var delta = {};
angular.forEach($select.children('option'), function(opt, i){
var optValue = angular.element(opt).attr('value');
if(optValue === '') return;
var distance = Math.abs(optValue - value);
if(typeof delta.distance... | javascript | function getNearest($select, value) {
var delta = {};
angular.forEach($select.children('option'), function(opt, i){
var optValue = angular.element(opt).attr('value');
if(optValue === '') return;
var distance = Math.abs(optValue - value);
if(typeof delta.distance... | [
"function",
"getNearest",
"(",
"$select",
",",
"value",
")",
"{",
"var",
"delta",
"=",
"{",
"}",
";",
"angular",
".",
"forEach",
"(",
"$select",
".",
"children",
"(",
"'option'",
")",
",",
"function",
"(",
"opt",
",",
"i",
")",
"{",
"var",
"optValue"... | function to find nearest value in select options | [
"function",
"to",
"find",
"nearest",
"value",
"in",
"select",
"options"
] | 257ad977266d093bf853b328690ec0d670dbe4f2 | https://github.com/vitalets/angular-xeditable/blob/257ad977266d093bf853b328690ec0d670dbe4f2/dist/js/xeditable.js#L2500-L2512 |
16,738 | libp2p/js-libp2p-kad-dht | src/providers.js | writeProviderEntry | function writeProviderEntry (store, cid, peer, time, callback) {
const dsKey = [
makeProviderKey(cid),
'/',
utils.encodeBase32(peer.id)
].join('')
store.put(new Key(dsKey), Buffer.from(varint.encode(time)), callback)
} | javascript | function writeProviderEntry (store, cid, peer, time, callback) {
const dsKey = [
makeProviderKey(cid),
'/',
utils.encodeBase32(peer.id)
].join('')
store.put(new Key(dsKey), Buffer.from(varint.encode(time)), callback)
} | [
"function",
"writeProviderEntry",
"(",
"store",
",",
"cid",
",",
"peer",
",",
"time",
",",
"callback",
")",
"{",
"const",
"dsKey",
"=",
"[",
"makeProviderKey",
"(",
"cid",
")",
",",
"'/'",
",",
"utils",
".",
"encodeBase32",
"(",
"peer",
".",
"id",
")",... | Write a provider into the given store.
@param {Datastore} store
@param {CID} cid
@param {PeerId} peer
@param {number} time
@param {function(Error)} callback
@returns {undefined}
@private | [
"Write",
"a",
"provider",
"into",
"the",
"given",
"store",
"."
] | 18ac394245419d453f017c8407127e55fcde3edd | https://github.com/libp2p/js-libp2p-kad-dht/blob/18ac394245419d453f017c8407127e55fcde3edd/src/providers.js#L297-L305 |
16,739 | libp2p/js-libp2p-kad-dht | src/providers.js | loadProviders | function loadProviders (store, cid, callback) {
pull(
store.query({ prefix: makeProviderKey(cid) }),
pull.map((entry) => {
const parts = entry.key.toString().split('/')
const lastPart = parts[parts.length - 1]
const rawPeerId = utils.decodeBase32(lastPart)
return [new PeerId(rawPeerId)... | javascript | function loadProviders (store, cid, callback) {
pull(
store.query({ prefix: makeProviderKey(cid) }),
pull.map((entry) => {
const parts = entry.key.toString().split('/')
const lastPart = parts[parts.length - 1]
const rawPeerId = utils.decodeBase32(lastPart)
return [new PeerId(rawPeerId)... | [
"function",
"loadProviders",
"(",
"store",
",",
"cid",
",",
"callback",
")",
"{",
"pull",
"(",
"store",
".",
"query",
"(",
"{",
"prefix",
":",
"makeProviderKey",
"(",
"cid",
")",
"}",
")",
",",
"pull",
".",
"map",
"(",
"(",
"entry",
")",
"=>",
"{",... | Load providers from the store.
@param {Datastore} store
@param {CID} cid
@param {function(Error, Map<PeerId, Date>)} callback
@returns {undefined}
@private | [
"Load",
"providers",
"from",
"the",
"store",
"."
] | 18ac394245419d453f017c8407127e55fcde3edd | https://github.com/libp2p/js-libp2p-kad-dht/blob/18ac394245419d453f017c8407127e55fcde3edd/src/providers.js#L317-L334 |
16,740 | libp2p/js-libp2p-kad-dht | src/rpc/index.js | handleMessage | function handleMessage (peer, msg, callback) {
// update the peer
dht._add(peer, (err) => {
if (err) {
log.error('Failed to update the kbucket store')
log.error(err)
}
// get handler & exectue it
const handler = getMessageHandler(msg.type)
if (!handler) {
... | javascript | function handleMessage (peer, msg, callback) {
// update the peer
dht._add(peer, (err) => {
if (err) {
log.error('Failed to update the kbucket store')
log.error(err)
}
// get handler & exectue it
const handler = getMessageHandler(msg.type)
if (!handler) {
... | [
"function",
"handleMessage",
"(",
"peer",
",",
"msg",
",",
"callback",
")",
"{",
"// update the peer",
"dht",
".",
"_add",
"(",
"peer",
",",
"(",
"err",
")",
"=>",
"{",
"if",
"(",
"err",
")",
"{",
"log",
".",
"error",
"(",
"'Failed to update the kbucket ... | Process incoming DHT messages.
@param {PeerInfo} peer
@param {Message} msg
@param {function(Error, Message)} callback
@returns {void}
@private | [
"Process",
"incoming",
"DHT",
"messages",
"."
] | 18ac394245419d453f017c8407127e55fcde3edd | https://github.com/libp2p/js-libp2p-kad-dht/blob/18ac394245419d453f017c8407127e55fcde3edd/src/rpc/index.js#L25-L43 |
16,741 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('reset');
locationset = [];
featuredset = [];
normalset = [];
markers = [];
firstRun = false;
$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' li');
if ( $('.' + this.settings.locationList + ' .bh-sl-close-directions-container').length ) {
... | javascript | function () {
this.writeDebug('reset');
locationset = [];
featuredset = [];
normalset = [];
markers = [];
firstRun = false;
$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' li');
if ( $('.' + this.settings.locationList + ' .bh-sl-close-directions-container').length ) {
... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'reset'",
")",
";",
"locationset",
"=",
"[",
"]",
";",
"featuredset",
"=",
"[",
"]",
";",
"normalset",
"=",
"[",
"]",
";",
"markers",
"=",
"[",
"]",
";",
"firstRun",
"=",
"false",
";",
"... | Reset function
This method clears out all the variables and removes events. It does not reload the map. | [
"Reset",
"function",
"This",
"method",
"clears",
"out",
"all",
"the",
"variables",
"and",
"removes",
"events",
".",
"It",
"does",
"not",
"reload",
"the",
"map",
"."
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L280-L306 | |
16,742 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('formFiltersReset');
if (this.settings.taxonomyFilters === null) {
return;
}
var $inputs = $('.' + this.settings.taxonomyFiltersContainer + ' input'),
$selects = $('.' + this.settings.taxonomyFiltersContainer + ' select');
if ( typeof($inputs) !== 'object') {
r... | javascript | function () {
this.writeDebug('formFiltersReset');
if (this.settings.taxonomyFilters === null) {
return;
}
var $inputs = $('.' + this.settings.taxonomyFiltersContainer + ' input'),
$selects = $('.' + this.settings.taxonomyFiltersContainer + ' select');
if ( typeof($inputs) !== 'object') {
r... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'formFiltersReset'",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"taxonomyFilters",
"===",
"null",
")",
"{",
"return",
";",
"}",
"var",
"$inputs",
"=",
"$",
"(",
"'.'",
"+",
"this",
"... | Reset the form filters | [
"Reset",
"the",
"form",
"filters"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L311-L335 | |
16,743 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('mapReload');
this.reset();
reload = true;
if ( this.settings.taxonomyFilters !== null ) {
this.formFiltersReset();
this.taxonomyFiltersInit();
}
if ((olat) && (olng)) {
this.settings.mapSettings.zoom = originalZoom;
this.processForm();
}
else {
... | javascript | function() {
this.writeDebug('mapReload');
this.reset();
reload = true;
if ( this.settings.taxonomyFilters !== null ) {
this.formFiltersReset();
this.taxonomyFiltersInit();
}
if ((olat) && (olng)) {
this.settings.mapSettings.zoom = originalZoom;
this.processForm();
}
else {
... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'mapReload'",
")",
";",
"this",
".",
"reset",
"(",
")",
";",
"reload",
"=",
"true",
";",
"if",
"(",
"this",
".",
"settings",
".",
"taxonomyFilters",
"!==",
"null",
")",
"{",
"this",
".",
"... | Reload everything
This method does a reset of everything and reloads the map as it would first appear. | [
"Reload",
"everything",
"This",
"method",
"does",
"a",
"reset",
"of",
"everything",
"and",
"reloads",
"the",
"map",
"as",
"it",
"would",
"first",
"appear",
"."
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L341-L358 | |
16,744 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (notifyText) {
this.writeDebug('notify',notifyText);
if (this.settings.callbackNotify) {
this.settings.callbackNotify.call(this, notifyText);
}
else {
alert(notifyText);
}
} | javascript | function (notifyText) {
this.writeDebug('notify',notifyText);
if (this.settings.callbackNotify) {
this.settings.callbackNotify.call(this, notifyText);
}
else {
alert(notifyText);
}
} | [
"function",
"(",
"notifyText",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'notify'",
",",
"notifyText",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"callbackNotify",
")",
"{",
"this",
".",
"settings",
".",
"callbackNotify",
".",
"call",
"(",
"this... | Notifications
Some errors use alert by default. This is overridable with the callbackNotify option
@param notifyText {string} the notification message | [
"Notifications",
"Some",
"errors",
"use",
"alert",
"by",
"default",
".",
"This",
"is",
"overridable",
"with",
"the",
"callbackNotify",
"option"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L366-L374 | |
16,745 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(param) {
this.writeDebug('getQueryString',param);
if(param) {
param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + param + '=([^&#]*)'),
results = regex.exec(location.search);
return (results === null) ? '' : decodeURIComponent(results[1].replace... | javascript | function(param) {
this.writeDebug('getQueryString',param);
if(param) {
param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + param + '=([^&#]*)'),
results = regex.exec(location.search);
return (results === null) ? '' : decodeURIComponent(results[1].replace... | [
"function",
"(",
"param",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'getQueryString'",
",",
"param",
")",
";",
"if",
"(",
"param",
")",
"{",
"param",
"=",
"param",
".",
"replace",
"(",
"/",
"[\\[]",
"/",
",",
"'\\\\['",
")",
".",
"replace",
"(",
"... | Check for query string
@param param {string} query string parameter to test
@returns {string} query string value | [
"Check",
"for",
"query",
"string"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L398-L406 | |
16,746 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('_formEventHandler');
var _this = this;
// ASP.net or regular submission?
if (this.settings.noForm === true) {
$(document).on('click.'+pluginName, '.' + this.settings.formContainer + ' button', function (e) {
_this.processForm(e);
});
$(document).on('keydown.'+... | javascript | function () {
this.writeDebug('_formEventHandler');
var _this = this;
// ASP.net or regular submission?
if (this.settings.noForm === true) {
$(document).on('click.'+pluginName, '.' + this.settings.formContainer + ' button', function (e) {
_this.processForm(e);
});
$(document).on('keydown.'+... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_formEventHandler'",
")",
";",
"var",
"_this",
"=",
"this",
";",
"// ASP.net or regular submission?",
"if",
"(",
"this",
".",
"settings",
".",
"noForm",
"===",
"true",
")",
"{",
"$",
"(",
"docume... | Form event handler setup - private | [
"Form",
"event",
"handler",
"setup",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L506-L532 | |
16,747 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (lat, lng, address, geocodeData, map) {
this.writeDebug('_getData',arguments);
var _this = this,
northEast = '',
southWest = '',
formattedAddress = '';
// Define extra geocode result info
if (typeof geocodeData !== 'undefined' && typeof geocodeData.geometry.bounds !== 'undefined') {
... | javascript | function (lat, lng, address, geocodeData, map) {
this.writeDebug('_getData',arguments);
var _this = this,
northEast = '',
southWest = '',
formattedAddress = '';
// Define extra geocode result info
if (typeof geocodeData !== 'undefined' && typeof geocodeData.geometry.bounds !== 'undefined') {
... | [
"function",
"(",
"lat",
",",
"lng",
",",
"address",
",",
"geocodeData",
",",
"map",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_getData'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
",",
"northEast",
"=",
"''",
",",
"southWest",
"=",
"... | AJAX data request - private
@param lat {number} latitude
@param lng {number} longitude
@param address {string} street address
@param geocodeData {object} full Google geocode results object
@param map (object} Google Maps object.
@returns {Object} deferred object | [
"AJAX",
"data",
"request",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L545-L627 | |
16,748 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('_start');
var _this = this,
doAutoGeo = this.settings.autoGeocode,
latlng;
// Full map blank start
if (_this.settings.fullMapStartBlank !== false) {
var $mapDiv = $('#' + _this.settings.mapID);
$mapDiv.addClass('bh-sl-map-open');
var myOptions = _this.se... | javascript | function () {
this.writeDebug('_start');
var _this = this,
doAutoGeo = this.settings.autoGeocode,
latlng;
// Full map blank start
if (_this.settings.fullMapStartBlank !== false) {
var $mapDiv = $('#' + _this.settings.mapID);
$mapDiv.addClass('bh-sl-map-open');
var myOptions = _this.se... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_start'",
")",
";",
"var",
"_this",
"=",
"this",
",",
"doAutoGeo",
"=",
"this",
".",
"settings",
".",
"autoGeocode",
",",
"latlng",
";",
"// Full map blank start",
"if",
"(",
"_this",
".",
"set... | Checks for default location, full map, and HTML5 geolocation settings - private | [
"Checks",
"for",
"default",
"location",
"full",
"map",
"and",
"HTML5",
"geolocation",
"settings",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L632-L702 | |
16,749 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('htmlGeocode',arguments);
var _this = this;
if (_this.settings.sessionStorage === true && window.sessionStorage && window.sessionStorage.getItem('myGeo')){
_this.writeDebug('Using Session Saved Values for GEO');
_this.autoGeocodeQuery(JSON.parse(window.sessionStorage.getIt... | javascript | function() {
this.writeDebug('htmlGeocode',arguments);
var _this = this;
if (_this.settings.sessionStorage === true && window.sessionStorage && window.sessionStorage.getItem('myGeo')){
_this.writeDebug('Using Session Saved Values for GEO');
_this.autoGeocodeQuery(JSON.parse(window.sessionStorage.getIt... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'htmlGeocode'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"_this",
".",
"settings",
".",
"sessionStorage",
"===",
"true",
"&&",
"window",
".",
"sessionStorage",
"&... | Geocode function used for auto geocode setting and geocodeID button | [
"Geocode",
"function",
"used",
"for",
"auto",
"geocode",
"setting",
"and",
"geocodeID",
"button"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L707-L743 | |
16,750 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (thisObj) {
thisObj.writeDebug('reverseGoogleGeocode',arguments);
var geocoder = new google.maps.Geocoder();
this.geocode = function (request, callbackFunction) {
geocoder.geocode(request, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[0]) {
... | javascript | function (thisObj) {
thisObj.writeDebug('reverseGoogleGeocode',arguments);
var geocoder = new google.maps.Geocoder();
this.geocode = function (request, callbackFunction) {
geocoder.geocode(request, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[0]) {
... | [
"function",
"(",
"thisObj",
")",
"{",
"thisObj",
".",
"writeDebug",
"(",
"'reverseGoogleGeocode'",
",",
"arguments",
")",
";",
"var",
"geocoder",
"=",
"new",
"google",
".",
"maps",
".",
"Geocoder",
"(",
")",
";",
"this",
".",
"geocode",
"=",
"function",
... | Reverse geocode to get address for automatic options needed for directions link | [
"Reverse",
"geocode",
"to",
"get",
"address",
"for",
"automatic",
"options",
"needed",
"for",
"directions",
"link"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L770-L787 | |
16,751 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (num, dec) {
this.writeDebug('roundNumber',arguments);
return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
} | javascript | function (num, dec) {
this.writeDebug('roundNumber',arguments);
return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
} | [
"function",
"(",
"num",
",",
"dec",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'roundNumber'",
",",
"arguments",
")",
";",
"return",
"Math",
".",
"round",
"(",
"num",
"*",
"Math",
".",
"pow",
"(",
"10",
",",
"dec",
")",
")",
"/",
"Math",
".",
"po... | Rounding function used for distances
@param num {number} the full number
@param dec {number} the number of digits to show after the decimal
@returns {number} | [
"Rounding",
"function",
"used",
"for",
"distances"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L796-L799 | |
16,752 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (obj) {
this.writeDebug('hasEmptyObjectVals',arguments);
var objTest = true;
for(var key in obj) {
if (obj.hasOwnProperty(key)) {
if (obj[key] !== '' && obj[key].length !== 0) {
objTest = false;
}
}
}
return objTest;
} | javascript | function (obj) {
this.writeDebug('hasEmptyObjectVals',arguments);
var objTest = true;
for(var key in obj) {
if (obj.hasOwnProperty(key)) {
if (obj[key] !== '' && obj[key].length !== 0) {
objTest = false;
}
}
}
return objTest;
} | [
"function",
"(",
"obj",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'hasEmptyObjectVals'",
",",
"arguments",
")",
";",
"var",
"objTest",
"=",
"true",
";",
"for",
"(",
"var",
"key",
"in",
"obj",
")",
"{",
"if",
"(",
"obj",
".",
"hasOwnProperty",
"(",
"... | Checks to see if all the property values in the object are empty
@param obj {Object} the object to check
@returns {boolean} | [
"Checks",
"to",
"see",
"if",
"all",
"the",
"property",
"values",
"in",
"the",
"object",
"are",
"empty"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L823-L836 | |
16,753 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('modalClose');
// Callback
if (this.settings.callbackModalClose) {
this.settings.callbackModalClose.call(this);
}
// Reset the filters
filters = {};
// Undo category selections
$('.' + this.settings.overlay + ' select').prop('selectedIndex', 0);
$('.' + thi... | javascript | function () {
this.writeDebug('modalClose');
// Callback
if (this.settings.callbackModalClose) {
this.settings.callbackModalClose.call(this);
}
// Reset the filters
filters = {};
// Undo category selections
$('.' + this.settings.overlay + ' select').prop('selectedIndex', 0);
$('.' + thi... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'modalClose'",
")",
";",
"// Callback",
"if",
"(",
"this",
".",
"settings",
".",
"callbackModalClose",
")",
"{",
"this",
".",
"settings",
".",
"callbackModalClose",
".",
"call",
"(",
"this",
")",
... | Modal window close function | [
"Modal",
"window",
"close",
"function"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L841-L857 | |
16,754 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (loopcount) {
this.writeDebug('_createLocationVariables',arguments);
var value;
locationData = {};
for (var key in locationset[loopcount]) {
if (locationset[loopcount].hasOwnProperty(key)) {
value = locationset[loopcount][key];
if (key === 'distance' || key === 'altdistance') {
... | javascript | function (loopcount) {
this.writeDebug('_createLocationVariables',arguments);
var value;
locationData = {};
for (var key in locationset[loopcount]) {
if (locationset[loopcount].hasOwnProperty(key)) {
value = locationset[loopcount][key];
if (key === 'distance' || key === 'altdistance') {
... | [
"function",
"(",
"loopcount",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_createLocationVariables'",
",",
"arguments",
")",
";",
"var",
"value",
";",
"locationData",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"key",
"in",
"locationset",
"[",
"loopcount",
"]",... | Create the location variables - private
@param loopcount {number} current marker id | [
"Create",
"the",
"location",
"variables",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L864-L880 | |
16,755 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(locationsarray) {
this.writeDebug('sortAlpha',arguments);
var property = (this.settings.sortBy.hasOwnProperty('prop') && typeof this.settings.sortBy.prop !== 'undefined') ? this.settings.sortBy.prop : 'name';
if (this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() =... | javascript | function(locationsarray) {
this.writeDebug('sortAlpha',arguments);
var property = (this.settings.sortBy.hasOwnProperty('prop') && typeof this.settings.sortBy.prop !== 'undefined') ? this.settings.sortBy.prop : 'name';
if (this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() =... | [
"function",
"(",
"locationsarray",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'sortAlpha'",
",",
"arguments",
")",
";",
"var",
"property",
"=",
"(",
"this",
".",
"settings",
".",
"sortBy",
".",
"hasOwnProperty",
"(",
"'prop'",
")",
"&&",
"typeof",
"this",
... | Location alphabetical sorting function
@param locationsarray {array} locationset array | [
"Location",
"alphabetical",
"sorting",
"function"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L887-L900 | |
16,756 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(locationsarray) {
this.writeDebug('sortDate',arguments);
var property = (this.settings.sortBy.hasOwnProperty('prop') && typeof this.settings.sortBy.prop !== 'undefined') ? this.settings.sortBy.prop : 'date';
if (this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() ==... | javascript | function(locationsarray) {
this.writeDebug('sortDate',arguments);
var property = (this.settings.sortBy.hasOwnProperty('prop') && typeof this.settings.sortBy.prop !== 'undefined') ? this.settings.sortBy.prop : 'date';
if (this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() ==... | [
"function",
"(",
"locationsarray",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'sortDate'",
",",
"arguments",
")",
";",
"var",
"property",
"=",
"(",
"this",
".",
"settings",
".",
"sortBy",
".",
"hasOwnProperty",
"(",
"'prop'",
")",
"&&",
"typeof",
"this",
... | Location date sorting function
@param locationsarray {array} locationset array | [
"Location",
"date",
"sorting",
"function"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L907-L920 | |
16,757 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (locationsarray) {
this.writeDebug('sortNumerically',arguments);
var property = (
this.settings.sortBy !== null &&
this.settings.sortBy.hasOwnProperty('prop') &&
typeof this.settings.sortBy.prop !== 'undefined'
) ? this.settings.sortBy.prop : 'distance';
if (this.settings.sortBy !== n... | javascript | function (locationsarray) {
this.writeDebug('sortNumerically',arguments);
var property = (
this.settings.sortBy !== null &&
this.settings.sortBy.hasOwnProperty('prop') &&
typeof this.settings.sortBy.prop !== 'undefined'
) ? this.settings.sortBy.prop : 'distance';
if (this.settings.sortBy !== n... | [
"function",
"(",
"locationsarray",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'sortNumerically'",
",",
"arguments",
")",
";",
"var",
"property",
"=",
"(",
"this",
".",
"settings",
".",
"sortBy",
"!==",
"null",
"&&",
"this",
".",
"settings",
".",
"sortBy",
... | Location distance sorting function
@param locationsarray {array} locationset array | [
"Location",
"distance",
"sorting",
"function"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L927-L944 | |
16,758 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (data, filters) {
this.writeDebug('filterData',arguments);
var filterTest = true;
for (var k in filters) {
if (filters.hasOwnProperty(k)) {
// Exclusive filtering
if (this.settings.exclusiveFiltering === true || (this.settings.exclusiveTax !== null && Array.isArray(this.settings.exclus... | javascript | function (data, filters) {
this.writeDebug('filterData',arguments);
var filterTest = true;
for (var k in filters) {
if (filters.hasOwnProperty(k)) {
// Exclusive filtering
if (this.settings.exclusiveFiltering === true || (this.settings.exclusiveTax !== null && Array.isArray(this.settings.exclus... | [
"function",
"(",
"data",
",",
"filters",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'filterData'",
",",
"arguments",
")",
";",
"var",
"filterTest",
"=",
"true",
";",
"for",
"(",
"var",
"k",
"in",
"filters",
")",
"{",
"if",
"(",
"filters",
".",
"hasOw... | Filter the data with Regex
@param data {array} data array to check for filter values
@param filters {Object} taxonomy filters object
@returns {boolean} | [
"Filter",
"the",
"data",
"with",
"Regex"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L971-L1005 | |
16,759 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (currentPage) {
this.writeDebug('paginationSetup',arguments);
var pagesOutput = '';
var totalPages;
var $paginationList = $('.bh-sl-pagination-container .bh-sl-pagination');
// Total pages
if ( this.settings.storeLimit === -1 || locationset.length < this.settings.storeLimit ) {
totalPage... | javascript | function (currentPage) {
this.writeDebug('paginationSetup',arguments);
var pagesOutput = '';
var totalPages;
var $paginationList = $('.bh-sl-pagination-container .bh-sl-pagination');
// Total pages
if ( this.settings.storeLimit === -1 || locationset.length < this.settings.storeLimit ) {
totalPage... | [
"function",
"(",
"currentPage",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'paginationSetup'",
",",
"arguments",
")",
";",
"var",
"pagesOutput",
"=",
"''",
";",
"var",
"totalPages",
";",
"var",
"$paginationList",
"=",
"$",
"(",
"'.bh-sl-pagination-container .bh-... | Set up the pagination pages
@param currentPage {number} optional current page | [
"Set",
"up",
"the",
"pagination",
"pages"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1052-L1085 | |
16,760 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (markerUrl, markerWidth, markerHeight) {
this.writeDebug('markerImage',arguments);
var markerImg;
// User defined marker dimensions
if (typeof markerWidth !== 'undefined' && typeof markerHeight !== 'undefined') {
markerImg = {
url: markerUrl,
size: new google.maps.Size(markerWidth, m... | javascript | function (markerUrl, markerWidth, markerHeight) {
this.writeDebug('markerImage',arguments);
var markerImg;
// User defined marker dimensions
if (typeof markerWidth !== 'undefined' && typeof markerHeight !== 'undefined') {
markerImg = {
url: markerUrl,
size: new google.maps.Size(markerWidth, m... | [
"function",
"(",
"markerUrl",
",",
"markerWidth",
",",
"markerHeight",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'markerImage'",
",",
"arguments",
")",
";",
"var",
"markerImg",
";",
"// User defined marker dimensions",
"if",
"(",
"typeof",
"markerWidth",
"!==",
... | Marker image setup
@param markerUrl {string} path to marker image
@param markerWidth {number} width of marker
@param markerHeight {number} height of marker
@returns {Object} Google Maps icon object | [
"Marker",
"image",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1095-L1117 | |
16,761 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (point, name, address, letter, map, category) {
this.writeDebug('createMarker',arguments);
var marker, markerImg, letterMarkerImg;
var categories = [];
// Custom multi-marker image override (different markers for different categories
if (this.settings.catMarkers !== null) {
if (typeof categ... | javascript | function (point, name, address, letter, map, category) {
this.writeDebug('createMarker',arguments);
var marker, markerImg, letterMarkerImg;
var categories = [];
// Custom multi-marker image override (different markers for different categories
if (this.settings.catMarkers !== null) {
if (typeof categ... | [
"function",
"(",
"point",
",",
"name",
",",
"address",
",",
"letter",
",",
"map",
",",
"category",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'createMarker'",
",",
"arguments",
")",
";",
"var",
"marker",
",",
"markerImg",
",",
"letterMarkerImg",
";",
"va... | Map marker setup
@param point {Object} LatLng of current location
@param name {string} location name
@param address {string} location address
@param letter {string} optional letter used for front-end identification and correlation between list and points
@param map {Object} the Google Map
@param category {string} loca... | [
"Map",
"marker",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1130-L1200 | |
16,762 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (currentMarker, storeStart, page) {
this.writeDebug('_defineLocationData',arguments);
var indicator = '';
this._createLocationVariables(currentMarker.get('id'));
var altDistLength,
distLength;
if (locationData.distance <= 1) {
if (this.settings.lengthUnit === 'km') {
distLength = ... | javascript | function (currentMarker, storeStart, page) {
this.writeDebug('_defineLocationData',arguments);
var indicator = '';
this._createLocationVariables(currentMarker.get('id'));
var altDistLength,
distLength;
if (locationData.distance <= 1) {
if (this.settings.lengthUnit === 'km') {
distLength = ... | [
"function",
"(",
"currentMarker",
",",
"storeStart",
",",
"page",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_defineLocationData'",
",",
"arguments",
")",
";",
"var",
"indicator",
"=",
"''",
";",
"this",
".",
"_createLocationVariables",
"(",
"currentMarker",
... | Define the location data for the templates - private
@param currentMarker {Object} Google Maps marker
@param storeStart {number} optional first location on the current page
@param page {number} optional current page
@returns {Object} extended location data object | [
"Define",
"the",
"location",
"data",
"for",
"the",
"templates",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1210-L1264 | |
16,763 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (marker, storeStart, page) {
this.writeDebug('listSetup',arguments);
// Define the location data
var locations = this._defineLocationData(marker, storeStart, page);
// Set up the list template with the location data
var listHtml = listTemplate(locations);
$('.' + this.settings.locationList +... | javascript | function (marker, storeStart, page) {
this.writeDebug('listSetup',arguments);
// Define the location data
var locations = this._defineLocationData(marker, storeStart, page);
// Set up the list template with the location data
var listHtml = listTemplate(locations);
$('.' + this.settings.locationList +... | [
"function",
"(",
"marker",
",",
"storeStart",
",",
"page",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'listSetup'",
",",
"arguments",
")",
";",
"// Define the location data",
"var",
"locations",
"=",
"this",
".",
"_defineLocationData",
"(",
"marker",
",",
"sto... | Set up the list templates
@param marker {Object} Google Maps marker
@param storeStart {number} optional first location on the current page
@param page {number} optional current page | [
"Set",
"up",
"the",
"list",
"templates"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1273-L1281 | |
16,764 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (marker) {
var markerImg;
// Reset the previously selected marker
if ( typeof prevSelectedMarkerAfter !== 'undefined' ) {
prevSelectedMarkerAfter.setIcon( prevSelectedMarkerBefore );
}
// Change the selected marker icon
if (this.settings.selectedMarkerImgDim === null) {
markerImg = ... | javascript | function (marker) {
var markerImg;
// Reset the previously selected marker
if ( typeof prevSelectedMarkerAfter !== 'undefined' ) {
prevSelectedMarkerAfter.setIcon( prevSelectedMarkerBefore );
}
// Change the selected marker icon
if (this.settings.selectedMarkerImgDim === null) {
markerImg = ... | [
"function",
"(",
"marker",
")",
"{",
"var",
"markerImg",
";",
"// Reset the previously selected marker",
"if",
"(",
"typeof",
"prevSelectedMarkerAfter",
"!==",
"'undefined'",
")",
"{",
"prevSelectedMarkerAfter",
".",
"setIcon",
"(",
"prevSelectedMarkerBefore",
")",
";",... | Change the selected marker image
@param marker {Object} Google Maps marker object | [
"Change",
"the",
"selected",
"marker",
"image"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1288-L1310 | |
16,765 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (marker, location, infowindow, storeStart, page) {
this.writeDebug('createInfowindow',arguments);
var _this = this;
// Define the location data
var locations = this._defineLocationData(marker, storeStart, page);
// Set up the infowindow template with the location data
var formattedAddress = ... | javascript | function (marker, location, infowindow, storeStart, page) {
this.writeDebug('createInfowindow',arguments);
var _this = this;
// Define the location data
var locations = this._defineLocationData(marker, storeStart, page);
// Set up the infowindow template with the location data
var formattedAddress = ... | [
"function",
"(",
"marker",
",",
"location",
",",
"infowindow",
",",
"storeStart",
",",
"page",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'createInfowindow'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
";",
"// Define the location data",
"var",
... | Create the infowindow
@param marker {Object} Google Maps marker object
@param location {string} indicates if the list or a map marker was clicked
@param infowindow Google Maps InfoWindow constructor
@param storeStart {number}
@param page {number} | [
"Create",
"the",
"infowindow"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1321-L1366 | |
16,766 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (position) {
this.writeDebug('autoGeocodeQuery',arguments);
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
originAddress;
// Query string parameters
if (this.settings.querystringParams === true) {
// Check for distance query string paramet... | javascript | function (position) {
this.writeDebug('autoGeocodeQuery',arguments);
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
originAddress;
// Query string parameters
if (this.settings.querystringParams === true) {
// Check for distance query string paramet... | [
"function",
"(",
"position",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'autoGeocodeQuery'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
",",
"distance",
"=",
"null",
",",
"$distanceInput",
"=",
"$",
"(",
"'#'",
"+",
"this",
".",
"settings",... | HTML5 geocoding function for automatic location detection
@param position {Object} coordinates | [
"HTML5",
"geocoding",
"function",
"for",
"automatic",
"location",
"detection"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1373-L1425 | |
16,767 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('defaultLocation');
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
originAddress;
// Query string parameters
if (this.settings.querystringParams === true) {
// Check for distance query string parameters
if (this.get... | javascript | function() {
this.writeDebug('defaultLocation');
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
originAddress;
// Query string parameters
if (this.settings.querystringParams === true) {
// Check for distance query string parameters
if (this.get... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'defaultLocation'",
")",
";",
"var",
"_this",
"=",
"this",
",",
"distance",
"=",
"null",
",",
"$distanceInput",
"=",
"$",
"(",
"'#'",
"+",
"this",
".",
"settings",
".",
"maxDistanceID",
")",
"... | Default location method | [
"Default",
"location",
"method"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1440-L1487 | |
16,768 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (newPage) {
this.writeDebug('paginationChange',arguments);
// Page change callback
if (this.settings.callbackPageChange) {
this.settings.callbackPageChange.call(this, newPage);
}
mappingObj.page = newPage;
this.mapping(mappingObj);
} | javascript | function (newPage) {
this.writeDebug('paginationChange',arguments);
// Page change callback
if (this.settings.callbackPageChange) {
this.settings.callbackPageChange.call(this, newPage);
}
mappingObj.page = newPage;
this.mapping(mappingObj);
} | [
"function",
"(",
"newPage",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'paginationChange'",
",",
"arguments",
")",
";",
"// Page change callback",
"if",
"(",
"this",
".",
"settings",
".",
"callbackPageChange",
")",
"{",
"this",
".",
"settings",
".",
"callbackP... | Change the page
@param newPage {number} page to change to | [
"Change",
"the",
"page"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1494-L1504 | |
16,769 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(markerID) {
this.writeDebug('getAddressByMarker',arguments);
var formattedAddress = "";
// Set up formatted address
if(locationset[markerID].address){ formattedAddress += locationset[markerID].address + ' '; }
if(locationset[markerID].address2){ formattedAddress += locationset[markerID].address2... | javascript | function(markerID) {
this.writeDebug('getAddressByMarker',arguments);
var formattedAddress = "";
// Set up formatted address
if(locationset[markerID].address){ formattedAddress += locationset[markerID].address + ' '; }
if(locationset[markerID].address2){ formattedAddress += locationset[markerID].address2... | [
"function",
"(",
"markerID",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'getAddressByMarker'",
",",
"arguments",
")",
";",
"var",
"formattedAddress",
"=",
"\"\"",
";",
"// Set up formatted address",
"if",
"(",
"locationset",
"[",
"markerID",
"]",
".",
"address",... | Get the address by marker ID
@param markerID {number} location ID
@returns {string} formatted address | [
"Get",
"the",
"address",
"by",
"marker",
"ID"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1512-L1524 | |
16,770 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('clearMarkers');
var locationsLimit = null;
if (locationset.length < this.settings.storeLimit) {
locationsLimit = locationset.length;
}
else {
locationsLimit = this.settings.storeLimit;
}
for (var i = 0; i < locationsLimit; i++) {
markers[i].setMap(null);
... | javascript | function() {
this.writeDebug('clearMarkers');
var locationsLimit = null;
if (locationset.length < this.settings.storeLimit) {
locationsLimit = locationset.length;
}
else {
locationsLimit = this.settings.storeLimit;
}
for (var i = 0; i < locationsLimit; i++) {
markers[i].setMap(null);
... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'clearMarkers'",
")",
";",
"var",
"locationsLimit",
"=",
"null",
";",
"if",
"(",
"locationset",
".",
"length",
"<",
"this",
".",
"settings",
".",
"storeLimit",
")",
"{",
"locationsLimit",
"=",
"... | Clear the markers from the map | [
"Clear",
"the",
"markers",
"from",
"the",
"map"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1529-L1543 | |
16,771 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(origin, locID, map) {
this.writeDebug('directionsRequest',arguments);
// Directions request callback
if (this.settings.callbackDirectionsRequest) {
this.settings.callbackDirectionsRequest.call(this, origin, locID, map, locationset[locID]);
}
var destination = this.getAddressByMarker(locID)... | javascript | function(origin, locID, map) {
this.writeDebug('directionsRequest',arguments);
// Directions request callback
if (this.settings.callbackDirectionsRequest) {
this.settings.callbackDirectionsRequest.call(this, origin, locID, map, locationset[locID]);
}
var destination = this.getAddressByMarker(locID)... | [
"function",
"(",
"origin",
",",
"locID",
",",
"map",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'directionsRequest'",
",",
"arguments",
")",
";",
"// Directions request callback",
"if",
"(",
"this",
".",
"settings",
".",
"callbackDirectionsRequest",
")",
"{",
... | Handle inline direction requests
@param origin {string} origin address
@param locID {number} location ID
@param map {Object} Google Map | [
"Handle",
"inline",
"direction",
"requests"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1552-L1596 | |
16,772 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('closeDirections');
// Close directions callback
if (this.settings.callbackCloseDirections) {
this.settings.callbackCloseDirections.call(this);
}
// Remove the close icon, remove the directions, add the list back
this.reset();
if ((olat) && (olng)) {
if (this... | javascript | function() {
this.writeDebug('closeDirections');
// Close directions callback
if (this.settings.callbackCloseDirections) {
this.settings.callbackCloseDirections.call(this);
}
// Remove the close icon, remove the directions, add the list back
this.reset();
if ((olat) && (olng)) {
if (this... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'closeDirections'",
")",
";",
"// Close directions callback",
"if",
"(",
"this",
".",
"settings",
".",
"callbackCloseDirections",
")",
"{",
"this",
".",
"settings",
".",
"callbackCloseDirections",
".",
... | Close the directions panel and reset the map with the original locationset and zoom | [
"Close",
"the",
"directions",
"panel",
"and",
"reset",
"the",
"map",
"with",
"the",
"original",
"locationset",
"and",
"zoom"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1601-L1623 | |
16,773 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function($lengthSwap) {
this.writeDebug('lengthUnitSwap',arguments);
if ($lengthSwap.val() === 'alt-distance') {
$('.' + this.settings.locationList + ' .loc-alt-dist').show();
$('.' + this.settings.locationList + ' .loc-default-dist').hide();
} else if ($lengthSwap.val() === 'default-distance') {
... | javascript | function($lengthSwap) {
this.writeDebug('lengthUnitSwap',arguments);
if ($lengthSwap.val() === 'alt-distance') {
$('.' + this.settings.locationList + ' .loc-alt-dist').show();
$('.' + this.settings.locationList + ' .loc-default-dist').hide();
} else if ($lengthSwap.val() === 'default-distance') {
... | [
"function",
"(",
"$lengthSwap",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'lengthUnitSwap'",
",",
"arguments",
")",
";",
"if",
"(",
"$lengthSwap",
".",
"val",
"(",
")",
"===",
"'alt-distance'",
")",
"{",
"$",
"(",
"'.'",
"+",
"this",
".",
"settings",
... | Handle length unit swap
@param $lengthSwap | [
"Handle",
"length",
"unit",
"swap"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1630-L1640 | |
16,774 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (data, lat, lng, origin, maxDistance) {
this.writeDebug('locationsSetup',arguments);
if (typeof origin !== 'undefined') {
if (!data.distance) {
data.distance = this.geoCodeCalcCalcDistance(lat, lng, data.lat, data.lng, GeoCodeCalc.EarthRadius);
// Alternative distance length unit
if (... | javascript | function (data, lat, lng, origin, maxDistance) {
this.writeDebug('locationsSetup',arguments);
if (typeof origin !== 'undefined') {
if (!data.distance) {
data.distance = this.geoCodeCalcCalcDistance(lat, lng, data.lat, data.lng, GeoCodeCalc.EarthRadius);
// Alternative distance length unit
if (... | [
"function",
"(",
"data",
",",
"lat",
",",
"lng",
",",
"origin",
",",
"maxDistance",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'locationsSetup'",
",",
"arguments",
")",
";",
"if",
"(",
"typeof",
"origin",
"!==",
"'undefined'",
")",
"{",
"if",
"(",
"!",... | Checks distance of each location and sets up the locationset array
@param data {Object} location data object
@param lat {number} origin latitude
@param lng {number} origin longitude
@param origin {string} origin address
@param maxDistance {number} maximum distance if set | [
"Checks",
"distance",
"of",
"each",
"location",
"and",
"sets",
"up",
"the",
"locationset",
"array"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1801-L1838 | |
16,775 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('sorting',arguments);
var _this = this,
$mapDiv = $('#' + _this.settings.mapID),
$sortSelect = $('#' + _this.settings.sortID);
if ($sortSelect.length === 0) {
return;
}
$sortSelect.on('change.'+pluginName, function (e) {
e.stopPropagation();
// Reset pa... | javascript | function() {
this.writeDebug('sorting',arguments);
var _this = this,
$mapDiv = $('#' + _this.settings.mapID),
$sortSelect = $('#' + _this.settings.sortID);
if ($sortSelect.length === 0) {
return;
}
$sortSelect.on('change.'+pluginName, function (e) {
e.stopPropagation();
// Reset pa... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'sorting'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
",",
"$mapDiv",
"=",
"$",
"(",
"'#'",
"+",
"_this",
".",
"settings",
".",
"mapID",
")",
",",
"$sortSelect",
"=",
"$",
"... | Set up front-end sorting functionality | [
"Set",
"up",
"front",
"-",
"end",
"sorting",
"functionality"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1843-L1879 | |
16,776 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('order',arguments);
var _this = this,
$mapDiv = $('#' + _this.settings.mapID),
$orderSelect = $('#' + _this.settings.orderID);
if ($orderSelect.length === 0) {
return;
}
$orderSelect.on('change.'+pluginName, function (e) {
e.stopPropagation();
// Reset ... | javascript | function() {
this.writeDebug('order',arguments);
var _this = this,
$mapDiv = $('#' + _this.settings.mapID),
$orderSelect = $('#' + _this.settings.orderID);
if ($orderSelect.length === 0) {
return;
}
$orderSelect.on('change.'+pluginName, function (e) {
e.stopPropagation();
// Reset ... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'order'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
",",
"$mapDiv",
"=",
"$",
"(",
"'#'",
"+",
"_this",
".",
"settings",
".",
"mapID",
")",
",",
"$orderSelect",
"=",
"$",
"(... | Set up front-end ordering functionality - this ties in to sorting and that has to be enabled for this to work. | [
"Set",
"up",
"front",
"-",
"end",
"ordering",
"functionality",
"-",
"this",
"ties",
"in",
"to",
"sorting",
"and",
"that",
"has",
"to",
"be",
"enabled",
"for",
"this",
"to",
"work",
"."
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1884-L1913 | |
16,777 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('countFilters');
var filterCount = 0;
if (!this.isEmptyObject(filters)) {
for (var key in filters) {
if (filters.hasOwnProperty(key)) {
filterCount += filters[key].length;
}
}
}
return filterCount;
} | javascript | function () {
this.writeDebug('countFilters');
var filterCount = 0;
if (!this.isEmptyObject(filters)) {
for (var key in filters) {
if (filters.hasOwnProperty(key)) {
filterCount += filters[key].length;
}
}
}
return filterCount;
} | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'countFilters'",
")",
";",
"var",
"filterCount",
"=",
"0",
";",
"if",
"(",
"!",
"this",
".",
"isEmptyObject",
"(",
"filters",
")",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"filters",
")",
... | Count the selected filters
@returns {number} | [
"Count",
"the",
"selected",
"filters"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1920-L1933 | |
16,778 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(key) {
this.writeDebug('_existingRadioFilters',arguments);
$('#' + this.settings.taxonomyFilters[key] + ' input[type=radio]').each(function () {
if ($(this).prop('checked')) {
var filterVal = $(this).val();
// Only add the taxonomy id if it doesn't already exist
if (typeof filterVal !... | javascript | function(key) {
this.writeDebug('_existingRadioFilters',arguments);
$('#' + this.settings.taxonomyFilters[key] + ' input[type=radio]').each(function () {
if ($(this).prop('checked')) {
var filterVal = $(this).val();
// Only add the taxonomy id if it doesn't already exist
if (typeof filterVal !... | [
"function",
"(",
"key",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'_existingRadioFilters'",
",",
"arguments",
")",
";",
"$",
"(",
"'#'",
"+",
"this",
".",
"settings",
".",
"taxonomyFilters",
"[",
"key",
"]",
"+",
"' input[type=radio]'",
")",
".",
"each",
... | Find the existing selected value for each radio button filter - private
@param key {string} object key | [
"Find",
"the",
"existing",
"selected",
"value",
"for",
"each",
"radio",
"button",
"filter",
"-",
"private"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1976-L1988 | |
16,779 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('checkFilters');
for(var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
// Find the existing checked boxes for each checkbox filter
this._existingCheckedFilters(key);
// Find the existing selected value for each s... | javascript | function () {
this.writeDebug('checkFilters');
for(var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
// Find the existing checked boxes for each checkbox filter
this._existingCheckedFilters(key);
// Find the existing selected value for each s... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'checkFilters'",
")",
";",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"settings",
".",
"taxonomyFilters",
")",
"{",
"if",
"(",
"this",
".",
"settings",
".",
"taxonomyFilters",
".",
"hasOwnProp... | Check for existing filter selections | [
"Check",
"for",
"existing",
"filter",
"selections"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L1993-L2008 | |
16,780 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function( taxonomy, value ) {
this.writeDebug('selectQueryStringFilters', arguments);
var $taxGroupContainer = $('#' + this.settings.taxonomyFilters[taxonomy]);
// Handle checkboxes.
if ( $taxGroupContainer.find('input[type="checkbox"]').length ) {
for ( var i = 0; i < value.length; i++ ) {
$tax... | javascript | function( taxonomy, value ) {
this.writeDebug('selectQueryStringFilters', arguments);
var $taxGroupContainer = $('#' + this.settings.taxonomyFilters[taxonomy]);
// Handle checkboxes.
if ( $taxGroupContainer.find('input[type="checkbox"]').length ) {
for ( var i = 0; i < value.length; i++ ) {
$tax... | [
"function",
"(",
"taxonomy",
",",
"value",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'selectQueryStringFilters'",
",",
"arguments",
")",
";",
"var",
"$taxGroupContainer",
"=",
"$",
"(",
"'#'",
"+",
"this",
".",
"settings",
".",
"taxonomyFilters",
"[",
"taxo... | Select the indicated values from query string parameters.
@param taxonomy {string} Current taxonomy.
@param value {array} Query string array values. | [
"Select",
"the",
"indicated",
"values",
"from",
"query",
"string",
"parameters",
"."
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2016-L2040 | |
16,781 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('checkQueryStringFilters',arguments);
// Loop through the filters.
for(var key in filters) {
if (filters.hasOwnProperty(key)) {
var filterVal = this.getQueryString(key);
// Check for multiple values separated by comma.
if ( filterVal.indexOf( ',' ) !== -1 ) {
... | javascript | function () {
this.writeDebug('checkQueryStringFilters',arguments);
// Loop through the filters.
for(var key in filters) {
if (filters.hasOwnProperty(key)) {
var filterVal = this.getQueryString(key);
// Check for multiple values separated by comma.
if ( filterVal.indexOf( ',' ) !== -1 ) {
... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'checkQueryStringFilters'",
",",
"arguments",
")",
";",
"// Loop through the filters.",
"for",
"(",
"var",
"key",
"in",
"filters",
")",
"{",
"if",
"(",
"filters",
".",
"hasOwnProperty",
"(",
"key",
... | Check query string parameters for filter values. | [
"Check",
"query",
"string",
"parameters",
"for",
"filter",
"values",
"."
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2045-L2074 | |
16,782 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (filterContainer) {
this.writeDebug('getFilterKey',arguments);
for (var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
for (var i = 0; i < this.settings.taxonomyFilters[key].length; i++) {
if (this.settings.taxonomyFilters[key] === filterCo... | javascript | function (filterContainer) {
this.writeDebug('getFilterKey',arguments);
for (var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
for (var i = 0; i < this.settings.taxonomyFilters[key].length; i++) {
if (this.settings.taxonomyFilters[key] === filterCo... | [
"function",
"(",
"filterContainer",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'getFilterKey'",
",",
"arguments",
")",
";",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"settings",
".",
"taxonomyFilters",
")",
"{",
"if",
"(",
"this",
".",
"settings",
"."... | Get the filter key from the taxonomyFilter setting
@param filterContainer {string} ID of the changed filter's container | [
"Get",
"the",
"filter",
"key",
"from",
"the",
"taxonomyFilter",
"setting"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2081-L2092 | |
16,783 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function () {
this.writeDebug('taxonomyFiltersInit');
// Set up the filters
for(var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
filters[key] = [];
}
}
} | javascript | function () {
this.writeDebug('taxonomyFiltersInit');
// Set up the filters
for(var key in this.settings.taxonomyFilters) {
if (this.settings.taxonomyFilters.hasOwnProperty(key)) {
filters[key] = [];
}
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'taxonomyFiltersInit'",
")",
";",
"// Set up the filters",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"settings",
".",
"taxonomyFilters",
")",
"{",
"if",
"(",
"this",
".",
"settings",
".",
"taxo... | Initialize or reset the filters object to its original state | [
"Initialize",
"or",
"reset",
"the",
"filters",
"object",
"to",
"its",
"original",
"state"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2097-L2106 | |
16,784 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(markers, map) {
this.writeDebug('checkVisibleMarkers',arguments);
var _this = this;
var locations, listHtml;
// Empty the location list
$('.' + this.settings.locationList + ' ul').empty();
// Set up the new list
$(markers).each(function(x, marker){
if (map.getBounds().contains(marker... | javascript | function(markers, map) {
this.writeDebug('checkVisibleMarkers',arguments);
var _this = this;
var locations, listHtml;
// Empty the location list
$('.' + this.settings.locationList + ' ul').empty();
// Set up the new list
$(markers).each(function(x, marker){
if (map.getBounds().contains(marker... | [
"function",
"(",
"markers",
",",
"map",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'checkVisibleMarkers'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
";",
"var",
"locations",
",",
"listHtml",
";",
"// Empty the location list",
"$",
"(",
"'.'",
... | Updates the location list to reflect the markers that are displayed on the map
@param markers {Object} Map markers
@param map {Object} Google map | [
"Updates",
"the",
"location",
"list",
"to",
"reflect",
"the",
"markers",
"that",
"are",
"displayed",
"on",
"the",
"map"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2230-L2253 | |
16,785 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(map) {
this.writeDebug('dragSearch',arguments);
var newCenter = map.getCenter(),
newCenterCoords,
_this = this;
// Save the new zoom setting
this.settings.mapSettings.zoom = map.getZoom();
olat = mappingObj.lat = newCenter.lat();
olng = mappingObj.lng = newCenter.lng();
// Deter... | javascript | function(map) {
this.writeDebug('dragSearch',arguments);
var newCenter = map.getCenter(),
newCenterCoords,
_this = this;
// Save the new zoom setting
this.settings.mapSettings.zoom = map.getZoom();
olat = mappingObj.lat = newCenter.lat();
olng = mappingObj.lng = newCenter.lng();
// Deter... | [
"function",
"(",
"map",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'dragSearch'",
",",
"arguments",
")",
";",
"var",
"newCenter",
"=",
"map",
".",
"getCenter",
"(",
")",
",",
"newCenterCoords",
",",
"_this",
"=",
"this",
";",
"// Save the new zoom setting",
... | Performs a new search when the map is dragged to a new position
@param map {Object} Google map | [
"Performs",
"a",
"new",
"search",
"when",
"the",
"map",
"is",
"dragged",
"to",
"a",
"new",
"position"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2260-L2284 | |
16,786 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('emptyResult',arguments);
var center,
locList = $('.' + this.settings.locationList + ' ul'),
myOptions = this.settings.mapSettings,
noResults;
// Create the map
this.map = new google.maps.Map(document.getElementById(this.settings.mapID), myOptions);
// Callback... | javascript | function() {
this.writeDebug('emptyResult',arguments);
var center,
locList = $('.' + this.settings.locationList + ' ul'),
myOptions = this.settings.mapSettings,
noResults;
// Create the map
this.map = new google.maps.Map(document.getElementById(this.settings.mapID), myOptions);
// Callback... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'emptyResult'",
",",
"arguments",
")",
";",
"var",
"center",
",",
"locList",
"=",
"$",
"(",
"'.'",
"+",
"this",
".",
"settings",
".",
"locationList",
"+",
"' ul'",
")",
",",
"myOptions",
"=",
... | Handle no results | [
"Handle",
"no",
"results"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2289-L2323 | |
16,787 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(map, origin, originPoint) {
this.writeDebug('originMarker',arguments);
if (this.settings.originMarker !== true) {
return;
}
var marker,
originImg = '';
if (typeof origin !== 'undefined') {
if (this.settings.originMarkerImg !== null) {
if (this.settings.originMarkerDim === nul... | javascript | function(map, origin, originPoint) {
this.writeDebug('originMarker',arguments);
if (this.settings.originMarker !== true) {
return;
}
var marker,
originImg = '';
if (typeof origin !== 'undefined') {
if (this.settings.originMarkerImg !== null) {
if (this.settings.originMarkerDim === nul... | [
"function",
"(",
"map",
",",
"origin",
",",
"originPoint",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'originMarker'",
",",
"arguments",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"originMarker",
"!==",
"true",
")",
"{",
"return",
";",
"}",
"va... | Origin marker setup
@param map {Object} Google map
@param origin {string} Origin address
@param originPoint {Object} LatLng of origin point | [
"Origin",
"marker",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2333-L2365 | |
16,788 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function() {
this.writeDebug('modalWindow');
if (this.settings.modal !== true) {
return;
}
var _this = this;
// Callback
if (_this.settings.callbackModalOpen) {
_this.settings.callbackModalOpen.call(this);
}
// Pop up the modal window
$('.' + _this.settings.overlay).fadeIn();
/... | javascript | function() {
this.writeDebug('modalWindow');
if (this.settings.modal !== true) {
return;
}
var _this = this;
// Callback
if (_this.settings.callbackModalOpen) {
_this.settings.callbackModalOpen.call(this);
}
// Pop up the modal window
$('.' + _this.settings.overlay).fadeIn();
/... | [
"function",
"(",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'modalWindow'",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"modal",
"!==",
"true",
")",
"{",
"return",
";",
"}",
"var",
"_this",
"=",
"this",
";",
"// Callback",
"if",
"(",
"_this",
... | Modal window setup | [
"Modal",
"window",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2370-L2400 | |
16,789 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(nearestLoc, infowindow, storeStart, page) {
this.writeDebug('openNearestLocation',arguments);
if (this.settings.openNearest !== true || typeof nearestLoc === 'undefined' || (this.settings.fullMapStart === true && firstRun === true) || (this.settings.defaultLoc === true && firstRun === true)) {
retur... | javascript | function(nearestLoc, infowindow, storeStart, page) {
this.writeDebug('openNearestLocation',arguments);
if (this.settings.openNearest !== true || typeof nearestLoc === 'undefined' || (this.settings.fullMapStart === true && firstRun === true) || (this.settings.defaultLoc === true && firstRun === true)) {
retur... | [
"function",
"(",
"nearestLoc",
",",
"infowindow",
",",
"storeStart",
",",
"page",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'openNearestLocation'",
",",
"arguments",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"openNearest",
"!==",
"true",
"||",
"t... | Open and select the location closest to the origin
@param nearestLoc {Object} Details for the nearest location
@param infowindow {Object} Info window object
@param storeStart {number} Starting point of current page when pagination is enabled
@param page {number} Current page number when pagination is enabled | [
"Open",
"and",
"select",
"the",
"location",
"closest",
"to",
"the",
"origin"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2410-L2440 | |
16,790 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(map, infowindow, storeStart, page) {
this.writeDebug('listClick',arguments);
var _this = this;
$(document).on('click.' + pluginName, '.' + _this.settings.locationList + ' li', function () {
var markerId = $(this).data('markerid');
var selectedMarker = markers[markerId];
// List click cal... | javascript | function(map, infowindow, storeStart, page) {
this.writeDebug('listClick',arguments);
var _this = this;
$(document).on('click.' + pluginName, '.' + _this.settings.locationList + ' li', function () {
var markerId = $(this).data('markerid');
var selectedMarker = markers[markerId];
// List click cal... | [
"function",
"(",
"map",
",",
"infowindow",
",",
"storeStart",
",",
"page",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'listClick'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
";",
"$",
"(",
"document",
")",
".",
"on",
"(",
"'click.'",
"... | Handle clicks from the location list
@param map {Object} Google map
@param infowindow {Object} Info window object
@param storeStart {number} Starting point of current page when pagination is enabled
@param page {number} Current page number when pagination is enabled | [
"Handle",
"clicks",
"from",
"the",
"location",
"list"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2450-L2491 | |
16,791 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(map, origin) {
this.writeDebug('inlineDirections',arguments);
if (this.settings.inlineDirections !== true || typeof origin === 'undefined') {
return;
}
var _this = this;
// Open directions
$(document).on('click.'+pluginName, '.' + _this.settings.locationList + ' li .loc-directions a', ... | javascript | function(map, origin) {
this.writeDebug('inlineDirections',arguments);
if (this.settings.inlineDirections !== true || typeof origin === 'undefined') {
return;
}
var _this = this;
// Open directions
$(document).on('click.'+pluginName, '.' + _this.settings.locationList + ' li .loc-directions a', ... | [
"function",
"(",
"map",
",",
"origin",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'inlineDirections'",
",",
"arguments",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"inlineDirections",
"!==",
"true",
"||",
"typeof",
"origin",
"===",
"'undefined'",
"... | Inline directions setup
@param map {Object} Google map
@param origin {string} Origin address | [
"Inline",
"directions",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2516-L2536 | |
16,792 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function(map, markers) {
this.writeDebug('visibleMarkersList',arguments);
if (this.settings.visibleMarkersList !== true) {
return;
}
var _this = this;
// Add event listener to filter the list when the map is fully loaded
google.maps.event.addListenerOnce(map, 'idle', function(){
_this.check... | javascript | function(map, markers) {
this.writeDebug('visibleMarkersList',arguments);
if (this.settings.visibleMarkersList !== true) {
return;
}
var _this = this;
// Add event listener to filter the list when the map is fully loaded
google.maps.event.addListenerOnce(map, 'idle', function(){
_this.check... | [
"function",
"(",
"map",
",",
"markers",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'visibleMarkersList'",
",",
"arguments",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"visibleMarkersList",
"!==",
"true",
")",
"{",
"return",
";",
"}",
"var",
"_thi... | Visible markers list setup
@param map {Object} Google map
@param markers {Object} Map markers | [
"Visible",
"markers",
"list",
"setup"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2544-L2567 | |
16,793 | bjorn2404/jQuery-Store-Locator-Plugin | dist/assets/js/plugins/storeLocator/jquery.storelocator.js | function (mappingObject) {
this.writeDebug('mapping',arguments);
var _this = this;
var orig_lat, orig_lng, geocodeData, origin, originPoint, page;
if (!this.isEmptyObject(mappingObject)) {
orig_lat = mappingObject.lat;
orig_lng = mappingObject.lng;
geocodeData = mappingObject.geocodeResult;
... | javascript | function (mappingObject) {
this.writeDebug('mapping',arguments);
var _this = this;
var orig_lat, orig_lng, geocodeData, origin, originPoint, page;
if (!this.isEmptyObject(mappingObject)) {
orig_lat = mappingObject.lat;
orig_lng = mappingObject.lng;
geocodeData = mappingObject.geocodeResult;
... | [
"function",
"(",
"mappingObject",
")",
"{",
"this",
".",
"writeDebug",
"(",
"'mapping'",
",",
"arguments",
")",
";",
"var",
"_this",
"=",
"this",
";",
"var",
"orig_lat",
",",
"orig_lng",
",",
"geocodeData",
",",
"origin",
",",
"originPoint",
",",
"page",
... | The primary mapping function that runs everything
@param mappingObject {Object} all the potential mapping properties - latitude, longitude, origin, name, max distance, page | [
"The",
"primary",
"mapping",
"function",
"that",
"runs",
"everything"
] | 1145d04f7988e06e00f7b6014f8a7eca26fe4eb6 | https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/1145d04f7988e06e00f7b6014f8a7eca26fe4eb6/dist/assets/js/plugins/storeLocator/jquery.storelocator.js#L2574-L2629 | |
16,794 | cibernox/ember-basic-dropdown | addon/utils/scroll-helpers.js | calculateScrollDistribution | function calculateScrollDistribution(deltaX, deltaY, element, container, accumulator = []) {
const scrollInformation = {
element,
scrollLeft: 0,
scrollTop: 0
};
const scrollLeftMax = element.scrollWidth - element.clientWidth;
const scrollTopMax = element.scrollHeight - element.clientHeight;
const... | javascript | function calculateScrollDistribution(deltaX, deltaY, element, container, accumulator = []) {
const scrollInformation = {
element,
scrollLeft: 0,
scrollTop: 0
};
const scrollLeftMax = element.scrollWidth - element.clientWidth;
const scrollTopMax = element.scrollHeight - element.clientHeight;
const... | [
"function",
"calculateScrollDistribution",
"(",
"deltaX",
",",
"deltaY",
",",
"element",
",",
"container",
",",
"accumulator",
"=",
"[",
"]",
")",
"{",
"const",
"scrollInformation",
"=",
"{",
"element",
",",
"scrollLeft",
":",
"0",
",",
"scrollTop",
":",
"0"... | Calculates the scroll distribution for `element` inside` container.
@param {Number} deltaX
@param {Number} deltaY
@param {Element} element
@param {Element} container
@param {ScrollInformation[]} accumulator
@return {ScrollInforamtion} | [
"Calculates",
"the",
"scroll",
"distribution",
"for",
"element",
"inside",
"container",
"."
] | 799c2c52120f0f518c655437ad6d17716788b5b7 | https://github.com/cibernox/ember-basic-dropdown/blob/799c2c52120f0f518c655437ad6d17716788b5b7/addon/utils/scroll-helpers.js#L113-L162 |
16,795 | cibernox/ember-basic-dropdown | addon/components/basic-dropdown-content.js | dropdownIsValidParent | function dropdownIsValidParent(el, dropdownId) {
let closestDropdown = closestContent(el);
if (closestDropdown) {
let trigger = document.querySelector(`[aria-owns=${closestDropdown.attributes.id.value}]`);
let parentDropdown = closestContent(trigger);
return parentDropdown && parentDropdown.attributes.i... | javascript | function dropdownIsValidParent(el, dropdownId) {
let closestDropdown = closestContent(el);
if (closestDropdown) {
let trigger = document.querySelector(`[aria-owns=${closestDropdown.attributes.id.value}]`);
let parentDropdown = closestContent(trigger);
return parentDropdown && parentDropdown.attributes.i... | [
"function",
"dropdownIsValidParent",
"(",
"el",
",",
"dropdownId",
")",
"{",
"let",
"closestDropdown",
"=",
"closestContent",
"(",
"el",
")",
";",
"if",
"(",
"closestDropdown",
")",
"{",
"let",
"trigger",
"=",
"document",
".",
"querySelector",
"(",
"`",
"${"... | Evaluates if the given element is in a dropdown or any of its parent dropdowns.
@param {HTMLElement} el
@param {String} dropdownId | [
"Evaluates",
"if",
"the",
"given",
"element",
"is",
"in",
"a",
"dropdown",
"or",
"any",
"of",
"its",
"parent",
"dropdowns",
"."
] | 799c2c52120f0f518c655437ad6d17716788b5b7 | https://github.com/cibernox/ember-basic-dropdown/blob/799c2c52120f0f518c655437ad6d17716788b5b7/addon/components/basic-dropdown-content.js#L43-L52 |
16,796 | jshttp/content-disposition | index.js | contentDisposition | function contentDisposition (filename, options) {
var opts = options || {}
// get type
var type = opts.type || 'attachment'
// get parameters
var params = createparams(filename, opts.fallback)
// format into string
return format(new ContentDisposition(type, params))
} | javascript | function contentDisposition (filename, options) {
var opts = options || {}
// get type
var type = opts.type || 'attachment'
// get parameters
var params = createparams(filename, opts.fallback)
// format into string
return format(new ContentDisposition(type, params))
} | [
"function",
"contentDisposition",
"(",
"filename",
",",
"options",
")",
"{",
"var",
"opts",
"=",
"options",
"||",
"{",
"}",
"// get type",
"var",
"type",
"=",
"opts",
".",
"type",
"||",
"'attachment'",
"// get parameters",
"var",
"params",
"=",
"createparams",... | Create an attachment Content-Disposition header.
@param {string} [filename]
@param {object} [options]
@param {string} [options.type=attachment]
@param {string|boolean} [options.fallback=true]
@return {string}
@public | [
"Create",
"an",
"attachment",
"Content",
"-",
"Disposition",
"header",
"."
] | f6d7cba7ea09dfea1492d5ffe438fe2f2e3cc3bb | https://github.com/jshttp/content-disposition/blob/f6d7cba7ea09dfea1492d5ffe438fe2f2e3cc3bb/index.js#L144-L155 |
16,797 | FVANCOP/ChartNew.js | ChartNew.js | getCSSText | function getCSSText(className) {
if (typeof document.styleSheets != "object") return "";
if (document.styleSheets.length <= 0) return "";
var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules;
for (var x = 0; x < classes.length; x++) {
if (classes[x].selectorText == "." + class... | javascript | function getCSSText(className) {
if (typeof document.styleSheets != "object") return "";
if (document.styleSheets.length <= 0) return "";
var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules;
for (var x = 0; x < classes.length; x++) {
if (classes[x].selectorText == "." + class... | [
"function",
"getCSSText",
"(",
"className",
")",
"{",
"if",
"(",
"typeof",
"document",
".",
"styleSheets",
"!=",
"\"object\"",
")",
"return",
"\"\"",
";",
"if",
"(",
"document",
".",
"styleSheets",
".",
"length",
"<=",
"0",
")",
"return",
"\"\"",
";",
"v... | First Time entered; | [
"First",
"Time",
"entered",
";"
] | 08681cadc1c1b6ea334c11d48b2ae43d2267d611 | https://github.com/FVANCOP/ChartNew.js/blob/08681cadc1c1b6ea334c11d48b2ae43d2267d611/ChartNew.js#L569-L579 |
16,798 | FVANCOP/ChartNew.js | ChartNew.js | checkBrowser | function checkBrowser() {
this.ver = navigator.appVersion
this.dom = document.getElementById ? 1 : 0
this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0;
this.ie4 = (document.all && !this.dom) ? 1 : 0;
this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
this.ns4 = (document.layers && !this.dom)... | javascript | function checkBrowser() {
this.ver = navigator.appVersion
this.dom = document.getElementById ? 1 : 0
this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0;
this.ie4 = (document.all && !this.dom) ? 1 : 0;
this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
this.ns4 = (document.layers && !this.dom)... | [
"function",
"checkBrowser",
"(",
")",
"{",
"this",
".",
"ver",
"=",
"navigator",
".",
"appVersion",
"this",
".",
"dom",
"=",
"document",
".",
"getElementById",
"?",
"1",
":",
"0",
"this",
".",
"ie5",
"=",
"(",
"this",
".",
"ver",
".",
"indexOf",
"(",... | Default browsercheck, added to all scripts! | [
"Default",
"browsercheck",
"added",
"to",
"all",
"scripts!"
] | 08681cadc1c1b6ea334c11d48b2ae43d2267d611 | https://github.com/FVANCOP/ChartNew.js/blob/08681cadc1c1b6ea334c11d48b2ae43d2267d611/ChartNew.js#L793-L802 |
16,799 | FVANCOP/ChartNew.js | ChartNew.js | reverseData | function reverseData(data) {
data.labels = data.labels.reverse();
for (var i = 0; i < data.datasets.length; i++) {
for (var key in data.datasets[i]) {
if (Array.isArray(data.datasets[i][key])) {
data.datasets[i][key] = data.datasets[i][key].reverse();
}
}
}
return data;
} | javascript | function reverseData(data) {
data.labels = data.labels.reverse();
for (var i = 0; i < data.datasets.length; i++) {
for (var key in data.datasets[i]) {
if (Array.isArray(data.datasets[i][key])) {
data.datasets[i][key] = data.datasets[i][key].reverse();
}
}
}
return data;
} | [
"function",
"reverseData",
"(",
"data",
")",
"{",
"data",
".",
"labels",
"=",
"data",
".",
"labels",
".",
"reverse",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"datasets",
".",
"length",
";",
"i",
"++",
")",
"{... | Reverse the data structure for horizontal charts
- reverse labels and every array inside datasets
@param {object} data datasets and labels for the chart
@return return the reversed data | [
"Reverse",
"the",
"data",
"structure",
"for",
"horizontal",
"charts",
"-",
"reverse",
"labels",
"and",
"every",
"array",
"inside",
"datasets"
] | 08681cadc1c1b6ea334c11d48b2ae43d2267d611 | https://github.com/FVANCOP/ChartNew.js/blob/08681cadc1c1b6ea334c11d48b2ae43d2267d611/ChartNew.js#L4290-L4300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.