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
partition
stringclasses
1 value
box/t3js
lib/application-stub.js
function(moduleName, context) { var module = modules[moduleName].creator(context); if (!context.getElement) { // Add in a default getElement function that matches the first module element // Developer should stub this out if there are more than one instance of this module context.getElement = fu...
javascript
function(moduleName, context) { var module = modules[moduleName].creator(context); if (!context.getElement) { // Add in a default getElement function that matches the first module element // Developer should stub this out if there are more than one instance of this module context.getElement = fu...
[ "function", "(", "moduleName", ",", "context", ")", "{", "var", "module", "=", "modules", "[", "moduleName", "]", ".", "creator", "(", "context", ")", ";", "if", "(", "!", "context", ".", "getElement", ")", "{", "// Add in a default getElement function that ma...
Will create a new instance of a module with a given context @param {string} moduleName The name of the module being created @param {Object} context The context object (usually a TestServiceProvider) @returns {?Object} The module object
[ "Will", "create", "a", "new", "instance", "of", "a", "module", "with", "a", "given", "context" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application-stub.js#L100-L111
train
box/t3js
lib/application-stub.js
function(behaviorName, context) { var behaviorData = behaviors[behaviorName]; if (behaviorData) { // getElement on behaviors must be stubbed if (!context.getElement) { context.getElement = function() { throw new Error('You must stub `getElement` for behaviors.'); }; } retu...
javascript
function(behaviorName, context) { var behaviorData = behaviors[behaviorName]; if (behaviorData) { // getElement on behaviors must be stubbed if (!context.getElement) { context.getElement = function() { throw new Error('You must stub `getElement` for behaviors.'); }; } retu...
[ "function", "(", "behaviorName", ",", "context", ")", "{", "var", "behaviorData", "=", "behaviors", "[", "behaviorName", "]", ";", "if", "(", "behaviorData", ")", "{", "// getElement on behaviors must be stubbed", "if", "(", "!", "context", ".", "getElement", ")...
Will create a new instance of a behavior with a given context @param {string} behaviorName The name of the behavior being created @param {Object} context The context object (usually a TestServiceProvider) @returns {?Object} The behavior object
[ "Will", "create", "a", "new", "instance", "of", "a", "behavior", "with", "a", "given", "context" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application-stub.js#L119-L131
train
box/t3js
examples/todo/js/services/todos-db.js
function() { var todoList = []; Object.keys(todos).forEach(function(id) { todoList.push(todos[id]); }); return todoList; }
javascript
function() { var todoList = []; Object.keys(todos).forEach(function(id) { todoList.push(todos[id]); }); return todoList; }
[ "function", "(", ")", "{", "var", "todoList", "=", "[", "]", ";", "Object", ".", "keys", "(", "todos", ")", ".", "forEach", "(", "function", "(", "id", ")", "{", "todoList", ".", "push", "(", "todos", "[", "id", "]", ")", ";", "}", ")", ";", ...
Returns list of all todos @returns {Todo[]} List of todos
[ "Returns", "list", "of", "all", "todos" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/todos-db.js#L48-L56
train
box/t3js
examples/todo/js/services/todos-db.js
function() { var me = this; Object.keys(todos).forEach(function(id) { if (todos[id].completed) { me.remove(id); } }); }
javascript
function() { var me = this; Object.keys(todos).forEach(function(id) { if (todos[id].completed) { me.remove(id); } }); }
[ "function", "(", ")", "{", "var", "me", "=", "this", ";", "Object", ".", "keys", "(", "todos", ")", ".", "forEach", "(", "function", "(", "id", ")", "{", "if", "(", "todos", "[", "id", "]", ".", "completed", ")", "{", "me", ".", "remove", "(", ...
Removes all completed tasks @returns {void}
[ "Removes", "all", "completed", "tasks" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/todos-db.js#L106-L113
train
box/t3js
examples/todo/js/services/todos-db.js
function(title) { var todoId = counter++; todos[todoId] = { id: todoId, title: title, completed: false }; return todoId; }
javascript
function(title) { var todoId = counter++; todos[todoId] = { id: todoId, title: title, completed: false }; return todoId; }
[ "function", "(", "title", ")", "{", "var", "todoId", "=", "counter", "++", ";", "todos", "[", "todoId", "]", "=", "{", "id", ":", "todoId", ",", "title", ":", "title", ",", "completed", ":", "false", "}", ";", "return", "todoId", ";", "}" ]
Adds a todo @param {string} title The label of the todo @returns {number} The id of the new todo
[ "Adds", "a", "todo" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/examples/todo/js/services/todos-db.js#L120-L128
train
box/t3js
lib/application.js
isServiceBeingInstantiated
function isServiceBeingInstantiated(serviceName) { for (var i = 0, len = serviceStack.length; i < len; i++) { if (serviceStack[i] === serviceName) { return true; } } return false; }
javascript
function isServiceBeingInstantiated(serviceName) { for (var i = 0, len = serviceStack.length; i < len; i++) { if (serviceStack[i] === serviceName) { return true; } } return false; }
[ "function", "isServiceBeingInstantiated", "(", "serviceName", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "serviceStack", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "serviceStack", "[", "i", "]", "===",...
Indicates if a given service is being instantiated. This is used to check for circular dependencies in service instantiation. If two services reference each other, it causes a stack overflow and is really hard to track down, so we provide an extra check to make finding this issue easier. @param {string} serviceName The...
[ "Indicates", "if", "a", "given", "service", "is", "being", "instantiated", ".", "This", "is", "used", "to", "check", "for", "circular", "dependencies", "in", "service", "instantiation", ".", "If", "two", "services", "reference", "each", "other", "it", "causes"...
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L121-L129
train
box/t3js
lib/application.js
error
function error(exception) { if (typeof customErrorHandler === 'function') { customErrorHandler(exception); return; } if (globalConfig.debug) { throw exception; } else { application.fire('error', { exception: exception }); } }
javascript
function error(exception) { if (typeof customErrorHandler === 'function') { customErrorHandler(exception); return; } if (globalConfig.debug) { throw exception; } else { application.fire('error', { exception: exception }); } }
[ "function", "error", "(", "exception", ")", "{", "if", "(", "typeof", "customErrorHandler", "===", "'function'", ")", "{", "customErrorHandler", "(", "exception", ")", ";", "return", ";", "}", "if", "(", "globalConfig", ".", "debug", ")", "{", "throw", "ex...
Signals that an error has occurred. If in development mode, an error is thrown. If in production mode, an event is fired. @param {Error} [exception] The exception object to use. @returns {void} @private
[ "Signals", "that", "an", "error", "has", "occurred", ".", "If", "in", "development", "mode", "an", "error", "is", "thrown", ".", "If", "in", "production", "mode", "an", "event", "is", "fired", "." ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L138-L150
train
box/t3js
lib/application.js
createAndBindEventDelegate
function createAndBindEventDelegate(eventDelegates, element, handler) { var delegate = new Box.DOMEventDelegate(element, handler, globalConfig.eventTypes); eventDelegates.push(delegate); delegate.attachEvents(); }
javascript
function createAndBindEventDelegate(eventDelegates, element, handler) { var delegate = new Box.DOMEventDelegate(element, handler, globalConfig.eventTypes); eventDelegates.push(delegate); delegate.attachEvents(); }
[ "function", "createAndBindEventDelegate", "(", "eventDelegates", ",", "element", ",", "handler", ")", "{", "var", "delegate", "=", "new", "Box", ".", "DOMEventDelegate", "(", "element", ",", "handler", ",", "globalConfig", ".", "eventTypes", ")", ";", "eventDele...
Creates a new event delegate and sets up its event handlers. @param {Array} eventDelegates The array of event delegates to add to. @param {HTMLElement} element The HTML element to bind to. @param {Object} handler The handler object for the delegate (either the module instance or behavior instance). @returns {void} @pri...
[ "Creates", "a", "new", "event", "delegate", "and", "sets", "up", "its", "event", "handlers", "." ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L326-L330
train
box/t3js
lib/application.js
callMessageHandler
function callMessageHandler(instance, name, data) { // If onmessage is an object call message handler with the matching key (if any) if (instance.onmessage !== null && typeof instance.onmessage === 'object' && instance.onmessage.hasOwnProperty(name)) { instance.onmessage[name].call(instance, data); // Otherw...
javascript
function callMessageHandler(instance, name, data) { // If onmessage is an object call message handler with the matching key (if any) if (instance.onmessage !== null && typeof instance.onmessage === 'object' && instance.onmessage.hasOwnProperty(name)) { instance.onmessage[name].call(instance, data); // Otherw...
[ "function", "callMessageHandler", "(", "instance", ",", "name", ",", "data", ")", "{", "// If onmessage is an object call message handler with the matching key (if any)", "if", "(", "instance", ".", "onmessage", "!==", "null", "&&", "typeof", "instance", ".", "onmessage",...
Gets message handlers from the provided module instance @param {Box.Application~ModuleInstance|Box.Application~BehaviorInstance} instance Messages handlers will be retrieved from the Instance object @param {String} name The name of the message to be handled @param {Any} data A playload to be passed to the message handl...
[ "Gets", "message", "handlers", "from", "the", "provided", "module", "instance" ]
1cc1751650e339bd5243a0f20cc76543c834ac09
https://github.com/box/t3js/blob/1cc1751650e339bd5243a0f20cc76543c834ac09/lib/application.js#L386-L396
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train