code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function generateMutation(node) { var nodeMeta = parseMeta(node); if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) { return generateLayersText(node, nodeMeta); } else { return generateSvgReplacementMutation(node, nodeMeta); } }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
generateMutation
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function onTree(root) { var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!IS_DOM) return; var htmlClassList = DOCUMENT.documentElement.classList; var hclAdd = function hclAdd(suffix) { return htmlClassList.add( "".concat(HTML_CLASS_I2SVG_B...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
onTree
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
hclAdd = function hclAdd(suffix) { return htmlClassList.add( "".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix) ); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
hclAdd
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
hclRemove = function hclRemove(suffix) { return htmlClassList.remove( "".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix) ); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
hclRemove
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function onNode(node) { var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; generateMutation(node).then(function (mutation) { if (mutation) { perform([mutation], callback); } }); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
onNode
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function replaceForPosition(node, position) { var pendingAttribute = "" .concat(DATA_FA_PSEUDO_ELEMENT_PENDING) .concat(position.replace(":", "-")); return new picked(function (resolve, reject) { if (node.getAttribute(pendingAttribute) !== null) { // This node is already being processe...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
replaceForPosition
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function replace(node) { return picked.all([ replaceForPosition(node, ":before"), replaceForPosition(node, ":after"), ]); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
replace
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function processable(node) { return ( node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf( node.tagName.toUpperCase() ) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== "svg") ); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
processable
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function searchPseudoElements(root) { if (!IS_DOM) return; return new picked(function (resolve, reject) { var operations = toArray(root.querySelectorAll("*")) .filter(processable) .map(replace); var end = perf.begin("searchPseudoElements"); disableObservation(); picked ...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
searchPseudoElements
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function css() { var dfp = DEFAULT_FAMILY_PREFIX; var drc = DEFAULT_REPLACEMENT_CLASS; var fp = config.familyPrefix; var rc = config.replacementClass; var s = baseStyles; if (fp !== dfp || rc !== drc) { var dPatt = new RegExp("\\.".concat(dfp, "\\-"), "g"); var customPropPatt = new ...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
css
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function Library() { _classCallCheck(this, Library); this.definitions = {}; }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
Library
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function ensureCss() { if (config.autoAddCss && !_cssInserted) { insertCss(css()); _cssInserted = true; } }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
ensureCss
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function apiObject(val, abstractCreator) { Object.defineProperty(val, "abstract", { get: abstractCreator, }); Object.defineProperty(val, "html", { get: function get() { return val.abstract.map(function (a) { return toHtml(a); }); }, }); Object.defineProper...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
apiObject
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function findIconDefinition(iconLookup) { var _iconLookup$prefix = iconLookup.prefix, prefix = _iconLookup$prefix === void 0 ? "fa" : _iconLookup$prefix, iconName = iconLookup.iconName; if (!iconName) return; return ( iconFromMapping(library.definitions, prefix, iconName) || iconFrom...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
findIconDefinition
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function resolveIcons(next) { return function (maybeIconDefinition) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {}); ...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
resolveIcons
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
noAuto = function noAuto() { config.autoReplaceSvg = false; config.observeMutations = false; disconnect(); }
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
noAuto
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
text = function text(content) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _params$transform2 = params.transform, transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2, _params$title2 = pa...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
text
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
counter = function counter(content) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _params$title3 = params.title, title = _params$title3 === void 0 ? null : _params$title3, _params$classes3 = params.classes, classes = _params$classes3 === void ...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
counter
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
layer = function layer(assembler) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _params$classes4 = params.classes, classes = _params$classes4 === void 0 ? [] : _params$classes4; return apiObject( { type: "layer", }, function ...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
layer
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
autoReplace = function autoReplace() { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _params$autoReplaceSv = params.autoReplaceSvgRoot, autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv; if ( (Object....
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
autoReplace
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function bootstrap() { if (IS_BROWSER) { if (!WINDOW.FontAwesome) { WINDOW.FontAwesome = api; } domready(function () { autoReplace(); observe({ treeCallback: onTree, nodeCallback: onNode, pseudoElementsCallback: searchPseudoElements, }...
Font Awesome 4 used the prefix of `fa` for all icons. With the introduction of new styles we needed to differentiate between them. Prefix `fa` is now an alias for `fas` so we'll easy the upgrade process for our users by automatically defining this as well.
bootstrap
javascript
ashutosh1919/masterPortfolio
src/assets/font-awesome/js/fontawesome.js
https://github.com/ashutosh1919/masterPortfolio/blob/master/src/assets/font-awesome/js/fontawesome.js
MIT
function typeToLogLevel(annotationType) { const level = { error: 'error', warning: 'warn' }[annotationType]; if (!level) { throw new Error(`Invalid annotation type: '${annotationType}'`); } return level; }
Turns annotation type into a log level
typeToLogLevel
javascript
apiaryio/dredd
packages/dredd/lib/annotationToLoggerInfo.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/annotationToLoggerInfo.js
MIT
function formatComponent(component) { switch (component) { case 'apiDescriptionParser': return 'API description parser'; case 'parametersValidation': return 'API description URI parameters validation'; case 'uriTemplateExpansion': return 'API description URI template expansion'; defa...
Takes a component identifier and turns it into something user can understand @param {string} component
formatComponent
javascript
apiaryio/dredd
packages/dredd/lib/annotationToLoggerInfo.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/annotationToLoggerInfo.js
MIT
function formatLocation(apiDescriptionLocation, annotationLocation) { if (!annotationLocation) { return apiDescriptionLocation; } const [[startLine, startColumn], [endLine, endColumn]] = annotationLocation; const editorLink = `${apiDescriptionLocation}:${startLine}`; const from = `line ${startLine} colum...
Formats given location data as something user can understand @param {string} apiDescriptionLocation API description location name @param {array} annotationLocation See 'dredd-transactions' docs
formatLocation
javascript
apiaryio/dredd
packages/dredd/lib/annotationToLoggerInfo.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/annotationToLoggerInfo.js
MIT
function annotationToLoggerInfo( apiDescriptionLocation, annotation, ) { const level = typeToLogLevel(annotation.type); if (annotation.component === 'apiDescriptionParser') { const message = `${formatComponent(annotation.component)} ${annotation.type}` + ` in ${formatLocation(apiDescriptionLoca...
Takes API description parser or compiler annotation returned from the 'dredd-transactions' library and transforms it into a message Dredd can show to the user. Returns an object logger accepts as input. @param {string} apiDescriptionLocation API description location name @param {Object} annotation the annotation objec...
annotationToLoggerInfo
javascript
apiaryio/dredd
packages/dredd/lib/annotationToLoggerInfo.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/annotationToLoggerInfo.js
MIT
function getProxySettings(env) { return Object.entries(env) .filter((entry) => PROXY_ENV_VARIABLES.includes(entry[0].toUpperCase())) .filter((entry) => entry[1] !== '') .map((entry) => `${entry[0]}=${entry[1]}`); }
Expects an environment variables object (typically process.env) and returns an array of strings representing HTTP proxy settings, such as ['HTTPS_PROXY=https://proxy.example.com:8080', ...] Supports both upper and lower case names and skips env vars set as empty strings (other falsy values are not taken care of as env...
getProxySettings
javascript
apiaryio/dredd
packages/dredd/lib/getProxySettings.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/getProxySettings.js
MIT
function performRequest(uri, transactionReq, options, callback) { if (typeof options === 'function') { [options, callback] = [{}, options]; } const logger = options.logger || defaultLogger; const request = options.request || defaultRequest; const httpOptions = Object.assign({}, options.http || {}); htt...
Performs the HTTP request as described in the 'transaction.request' object In future we should introduce a 'real' request object as well so user has access to the modifications made on the way. @param {string} uri @param {Object} transactionReq @param {Object} [options] @param {Object} [options.logger] Custom logger ...
performRequest
javascript
apiaryio/dredd
packages/dredd/lib/performRequest.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/performRequest.js
MIT
function getBodyAsBuffer(body, encoding) { return body instanceof Buffer ? body : Buffer.from(`${body || ''}`, normalizeBodyEncoding(encoding)); }
Coerces the HTTP request body to a Buffer @param {string|Buffer} body @param {*} encoding
getBodyAsBuffer
javascript
apiaryio/dredd
packages/dredd/lib/performRequest.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/performRequest.js
MIT
function normalizeBodyEncoding(encoding) { if (!encoding) { return 'utf-8'; } switch (encoding.toLowerCase()) { case 'utf-8': case 'utf8': return 'utf-8'; case 'base64': return 'base64'; default: throw new Error( `Unsupported encoding: '${encoding}' (only UTF-8 and `...
Returns the encoding as either 'utf-8' or 'base64'. Throws an error in case any other encoding is provided. @param {string} encoding
normalizeBodyEncoding
javascript
apiaryio/dredd
packages/dredd/lib/performRequest.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/performRequest.js
MIT
function normalizeContentLengthHeader(headers, body, options = {}) { const logger = options.logger || defaultLogger; const modifiedHeaders = Object.assign({}, headers); const calculatedValue = Buffer.byteLength(body); const name = caseless(modifiedHeaders).has('Content-Length'); if (name) { const value =...
Detects an existing Content-Length header and overrides the user-provided header value in case it's out of sync with the real length of the body. @param {Object} headers HTTP request headers @param {Buffer} body HTTP request body @param {Object} [options] @param {Object} [options.logger] Custom logger
normalizeContentLengthHeader
javascript
apiaryio/dredd
packages/dredd/lib/performRequest.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/performRequest.js
MIT
function createTransactionResponse(response, body) { const transactionRes = { statusCode: response.statusCode, headers: Object.assign({}, response.headers), }; if (Buffer.byteLength(body || '')) { transactionRes.bodyEncoding = detectBodyEncoding(body); transactionRes.body = body.toString(transacti...
Real transaction response object factory. Serializes binary responses to string using Base64 encoding. @param {Object} response Node.js HTTP response @param {Buffer} body HTTP response body as Buffer
createTransactionResponse
javascript
apiaryio/dredd
packages/dredd/lib/performRequest.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/performRequest.js
MIT
function applyLoggingOptions(config) { if (config.color === false) { logger.transports.console.colorize = false; reporterOutputLogger.transports.console.colorize = false; } // TODO https://github.com/apiaryio/dredd/issues/1346 if (config.loglevel) { const loglevel = config.loglevel.toLowerCase(); ...
Applies logging options from the given configuration. Operates on the validated normalized config.
applyLoggingOptions
javascript
apiaryio/dredd
packages/dredd/lib/configuration/applyLoggingOptions.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/configuration/applyLoggingOptions.js
MIT
function coerceToBoolean(value) { if (value === 'true') return true; if (value === 'false') return false; if (value) return true; return false; }
Removes options that are no longer supported by Dredd. Any coercion will not be performed, as they are removed prior to coercion.
coerceToBoolean
javascript
apiaryio/dredd
packages/dredd/lib/configuration/normalizeConfig.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/configuration/normalizeConfig.js
MIT
validateConfig = (config) => ({ warnings: flushMessages(deprecatedOptions, config), errors: flushMessages(unsupportedOptions, config), })
Returns the errors and warnings relative to the given config.
validateConfig
javascript
apiaryio/dredd
packages/dredd/lib/configuration/validateConfig.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/configuration/validateConfig.js
MIT
validateConfig = (config) => ({ warnings: flushMessages(deprecatedOptions, config), errors: flushMessages(unsupportedOptions, config), })
Returns the errors and warnings relative to the given config.
validateConfig
javascript
apiaryio/dredd
packages/dredd/lib/configuration/validateConfig.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd/lib/configuration/validateConfig.js
MIT
function symlinkDependencyTreeToLocalNodeModules(dependencyName) { const localDependencyPath = path.join(PACKAGE_DIR, 'node_modules', dependencyName); console.log('\nlinking dependency tree for "%s"', dependencyName); console.log('%s: %s', dependencyName, localDependencyPath); if (!fs.existsSync(localDependen...
Goes through the whole dependency tree of a given top-level dependency and makes sure all packages involved are accessible in the local 'node_modules' directory at least in form of symlinks. This is useful if the project uses yarn workspaces, but wants to publish the package with npm and uses 'bundledDependencies'. 'n...
symlinkDependencyTreeToLocalNodeModules
javascript
apiaryio/dredd
packages/dredd-transactions/scripts/prepack.js
https://github.com/apiaryio/dredd/blob/master/packages/dredd-transactions/scripts/prepack.js
MIT
function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
getParameterByName
javascript
Freeboard/freeboard
js/freeboard.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.js
MIT
function resizeEnd() { freeboardUI.processResize(true); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
resizeEnd
javascript
Freeboard/freeboard
js/freeboard.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.js
MIT
function Coords(obj) { if(obj[0] && $.isPlainObject(obj[0])) { this.data = obj[0]; } else { this.el = obj; } this.isCoords = true; this.coords = {}; this.init(); return this; }
Creates objects with coordinates (x1, y1, x2, y2, cx, cy, width, height) to simulate DOM elements on the screen. Coords is used by Gridster to create a faux grid with any DOM element can collide. @class Coords @param {HTMLElement|Object} obj The jQuery HTMLElement or a object with: left, top, width and height properti...
Coords
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function Collision(el, colliders, options) { this.options = $.extend(defaults, options); this.$element = el; this.last_colliders = []; this.last_colliders_coords = []; if(typeof colliders === 'string' || colliders instanceof jQuery) { this.$colliders = $(colliders, this.options.colliders_context).not(th...
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
Collision
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
later = function() { timeout = null; if(!immediate) func.apply(context, args); }
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
later
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
later = function() { timeout = null; if(more) func.apply(context, args); whenDone(); }
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
later
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function Gridster(el, options) { this.options = $.extend(true, defaults, options); this.$el = $(el); this.$wrapper = this.$el.parent(); this.$widgets = this.$el.children(this.options.widget_selector).addClass('gs_w'); this.panes = []; this.$changed = $([]); this.wrapper_width = this.$wrapper.width(); t...
@class Gridster @uses Draggable @uses Collision @param {HTMLElement} el The HTMLelement that contains all the panes. @param {Object} [options] An Object with all options you want to overwrite: @param {HTMLElement|String} [options.widget_selector] Define who will be the draggable panes. Can be a CSS Select...
Gridster
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function setCaretTo(element, start, end) { if(element.createTextRange) { var range = element.createTextRange(); range.moveStart('character', start); range.moveEnd('character', (end || start)); range.select(); } else if(element.selectionStart) { element.focus(); element.setSelectionRange(sta...
Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks @method destroy @return {undefined}
setCaretTo
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function getCaretPosition(element) { if(typeof element.selectionStart == 'number') { return element.selectionStart; } else if(document.selection) { var range = document.selection.createRange(); var rangeLength = range.text.length; range.moveStart('character', -element.value.length); return ran...
Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks @method destroy @return {undefined}
getCaretPosition
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function Fe(a,b){var c=Vf(a,b),d=De(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a; f.push(i)}else g&&(c[e]=g)}return c}
Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks @method destroy @return {undefined}
Fe
javascript
Freeboard/freeboard
js/freeboard.thirdparty.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard.thirdparty.js
MIT
function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
getParameterByName
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function resizeEnd() { freeboardUI.processResize(true); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
resizeEnd
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
jsonDatasource = function (settings, updateCallback) { var self = this; var updateTimer = null; var currentSettings = settings; var errorStage = 0; // 0 = try standard request // 1 = try JSONP // 2 = try thingproxy.freeboard.io var lockErrorStage = false; function updateRefresh(refreshTime) { if (u...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
jsonDatasource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateRefresh(refreshTime) { if (updateTimer) { clearInterval(updateTimer); } updateTimer = setInterval(function () { self.updateNow(); }, refreshTime); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateRefresh
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
openWeatherMapDatasource = function (settings, updateCallback) { var self = this; var updateTimer = null; var currentSettings = settings; function updateRefresh(refreshTime) { if (updateTimer) { clearInterval(updateTimer); } updateTimer = setInterval(function () { self.updateNow(); }, refr...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
openWeatherMapDatasource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateRefresh(refreshTime) { if (updateTimer) { clearInterval(updateTimer); } updateTimer = setInterval(function () { self.updateNow(); }, refreshTime); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateRefresh
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function toTitleCase(str) { return str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
toTitleCase
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
dweetioDatasource = function (settings, updateCallback) { var self = this; var currentSettings = settings; function onNewDweet(dweet) { updateCallback(dweet); } this.updateNow = function () { dweetio.get_latest_dweet_for(currentSettings.thing_id, function (err, dweet) { if (err) { //onNewDwee...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
dweetioDatasource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
playbackDatasource = function (settings, updateCallback) { var self = this; var currentSettings = settings; var currentDataset = []; var currentIndex = 0; var currentTimeout; function moveNext() { if (currentDataset.length > 0) { if (currentIndex < currentDataset.length) { updateCallback(curren...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
playbackDatasource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function moveNext() { if (currentDataset.length > 0) { if (currentIndex < currentDataset.length) { updateCallback(currentDataset[currentIndex]); currentIndex++; } if (currentIndex >= currentDataset.length && currentSettings.loop) { currentIndex = 0; } if (currentIndex < currentDa...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
moveNext
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function stopTimeout() { currentDataset = []; currentIndex = 0; if (currentTimeout) { clearTimeout(currentTimeout); currentTimeout = null; } }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
stopTimeout
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
clockDatasource = function (settings, updateCallback) { var self = this; var currentSettings = settings; var timer; function stopTimer() { if (timer) { clearTimeout(timer); timer = null; } } function updateTimer() { stopTimer(); timer = setInterval(self.updateNow, currentSettings.refre...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
clockDatasource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function stopTimer() { if (timer) { clearTimeout(timer); timer = null; } }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
stopTimer
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateTimer() { stopTimer(); timer = setInterval(self.updateNow, currentSettings.refresh * 1000); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateTimer
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
meshbluSource = function(settings, updateCallback) { // Always a good idea... var self = this; // Good idea to create a variable to hold on to our settings, because they might change in the future. See below. var currentSettings = settings; /* This is some function where I'll get my data from somewhere...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
meshbluSource
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function getData() { var conn = skynet.createConnection({ "uuid": currentSettings.uuid, "token": currentSettings.token, "server": currentSettings.server, "port": currentSettings.port }); conn.on('ready', function(data){ conn.on('message', function(message){ ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
getData
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function easeTransitionText(newValue, textElement, duration) { var currentValue = $(textElement).text(); if (currentValue == newValue) return; if ($.isNumeric(newValue) && $.isNumeric(currentValue)) { var numParts = newValue.toString().split('.'); var endingPreci...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
easeTransitionText
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function addSparklineLegend(element, legend) { var legendElt = $("<div class='sparkline-legend'></div>"); for(var i=0; i<legend.length; i++) { var color = SPARKLINE_COLORS[i % SPARKLINE_COLORS.length]; var label = legend[i]; legendElt.append("<div class='sparkline-legend-value'><span style='color:" + ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
addSparklineLegend
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function addValueToSparkline(element, value, legend) { var values = $(element).data().values; var valueMin = $(element).data().valueMin; var valueMax = $(element).data().valueMax; if (!values) { values = []; valueMin = undefined; valueMax = undefined; } var collateValues = function(val, plotIndex)...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
addValueToSparkline
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
collateValues = function(val, plotIndex) { if(!values[plotIndex]) { values[plotIndex] = []; } if (values[plotIndex].length >= SPARKLINE_HISTORY_LENGTH) { values[plotIndex].shift(); } values[plotIndex].push(Number(val)); if(valueMin === undefined || val < valueMin) { valueMin = val; } ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
collateValues
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
textWidget = function (settings) { var self = this; var currentSettings = settings; var displayElement = $('<div class="tw-display"></div>'); var titleElement = $('<h2 class="section-title tw-title tw-td"></h2>'); var valueElement = $('<div class="tw-value"></div>'); var unitsEleme...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
textWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateValueSizing() { if(!_.isUndefined(currentSettings.units) && currentSettings.units != "") // If we're displaying our units { valueElement.css("max-width", (displayElement.innerWidth() - unitsElement.outerWidth(true)) + "px"); } else { valueElement.css("max-width", "100%"); } ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateValueSizing
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
gaugeWidget = function (settings) { var self = this; var thisGaugeID = "gauge-" + gaugeID++; var titleElement = $('<h2 class="section-title"></h2>'); var gaugeElement = $('<div class="gauge-widget" id="' + thisGaugeID + '"></div>'); var gaugeObject; var rendered = false...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
gaugeWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function createGauge() { if (!rendered) { return; } gaugeElement.empty(); gaugeObject = new JustGage({ id: thisGaugeID, value: (_.isUndefined(currentSettings.min_value) ? 0 : currentSettings.min_value), min...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
createGauge
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
sparklineWidget = function (settings) { var self = this; var titleElement = $('<h2 class="section-title"></h2>'); var sparklineElement = $('<div class="sparkline"></div>'); var sparklineLegend = $('<div></div>'); var currentSettings = settings; this.render = function (element) { ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
sparklineWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
pointerWidget = function (settings) { var self = this; var paper; var strokeWidth = 3; var triangle; var width, height; var currentValue = 0; var valueDiv = $('<div class="widget-big-text"></div>'); var unitsDiv = $('<div></div>'); function polygo...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
pointerWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function polygonPath(points) { if (!points || points.length < 2) return []; var path = []; //will use path object type path.push(['m', points[0], points[1]]); for (var i = 2; i < points.length; i += 2) { path.push(['l', points[i], points[i ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
polygonPath
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
pictureWidget = function(settings) { var self = this; var widgetElement; var timer; var imageURL; function stopTimer() { if(timer) { clearInterval(timer); timer = null; } } function ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
pictureWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function stopTimer() { if(timer) { clearInterval(timer); timer = null; } }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
stopTimer
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateImage() { if(widgetElement && imageURL) { var cacheBreakerURL = imageURL + (imageURL.indexOf("?") == -1 ? "?" : "&") + Date.now(); $(widgetElement).css({ "background-image" : "url(" + cacheBreakerURL + ")" ...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateImage
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
indicatorWidget = function (settings) { var self = this; var titleElement = $('<h2 class="section-title"></h2>'); var stateElement = $('<div class="indicator-text"></div>'); var indicatorElement = $('<div class="indicator-light"></div>'); var currentSettings = settings; v...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
indicatorWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updateState() { indicatorElement.toggleClass("on", isOn); if (isOn) { stateElement.text((_.isUndefined(onText) ? (_.isUndefined(currentSettings.on_text) ? "" : currentSettings.on_text) : onText)); } else { stateElement.text((_.isU...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updateState
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
googleMapWidget = function (settings) { var self = this; var currentSettings = settings; var map; var marker; var currentPosition = {}; function updatePosition() { if (map && marker && currentPosition.lat && currentPosition.lon) { var newLatLo...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
googleMapWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function updatePosition() { if (map && marker && currentPosition.lat && currentPosition.lon) { var newLatLon = new google.maps.LatLng(currentPosition.lat, currentPosition.lon); marker.setPosition(newLatLon); map.panTo(newLatLon); } }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
updatePosition
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function initializeMap() { var mapOptions = { zoom: 13, center: new google.maps.LatLng(37.235, -115.811111), disableDefaultUI: true, draggable: false, styles: [ {"featureType": "wa...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
initializeMap
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
htmlWidget = function (settings) { var self = this; var htmlElement = $('<div class="html-widget"></div>'); var currentSettings = settings; this.render = function (element) { $(element).append(htmlElement); } this.onSettingsChanged = function (newSettings) {...
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
htmlWidget
javascript
Freeboard/freeboard
js/freeboard_plugins.js
https://github.com/Freeboard/freeboard/blob/master/js/freeboard_plugins.js
MIT
function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
getParameterByName
javascript
Freeboard/freeboard
lib/js/freeboard/freeboard.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/freeboard/freeboard.js
MIT
function resizeEnd() { freeboardUI.processResize(true); }
@KNOWN_ISSUE: The new value is buggy for STYLE attribute as we don't have any additional information on which style is getting updated.
resizeEnd
javascript
Freeboard/freeboard
lib/js/freeboard/freeboard.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/freeboard/freeboard.js
MIT
function Coords(obj) { if(obj[0] && $.isPlainObject(obj[0])) { this.data = obj[0]; } else { this.el = obj; } this.isCoords = true; this.coords = {}; this.init(); return this; }
Creates objects with coordinates (x1, y1, x2, y2, cx, cy, width, height) to simulate DOM elements on the screen. Coords is used by Gridster to create a faux grid with any DOM element can collide. @class Coords @param {HTMLElement|Object} obj The jQuery HTMLElement or a object with: left, top, width and height properti...
Coords
javascript
Freeboard/freeboard
lib/js/thirdparty/jquery.gridster.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/thirdparty/jquery.gridster.js
MIT
function Collision(el, colliders, options) { this.options = $.extend(defaults, options); this.$element = el; this.last_colliders = []; this.last_colliders_coords = []; if(typeof colliders === 'string' || colliders instanceof jQuery) { this.$colliders = $(colliders, this.options.colliders_context).not(th...
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
Collision
javascript
Freeboard/freeboard
lib/js/thirdparty/jquery.gridster.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/thirdparty/jquery.gridster.js
MIT
later = function() { timeout = null; if(!immediate) func.apply(context, args); }
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
later
javascript
Freeboard/freeboard
lib/js/thirdparty/jquery.gridster.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/thirdparty/jquery.gridster.js
MIT
later = function() { timeout = null; if(more) func.apply(context, args); whenDone(); }
Detects collisions between a DOM element against other DOM elements or Coords objects. @class Collision @uses Coords @param {HTMLElement} el The jQuery wrapped HTMLElement. @param {HTMLElement|Array} colliders Can be a jQuery collection of HTMLElements or an Array of Coords instances. @param {Object} [options] An Obj...
later
javascript
Freeboard/freeboard
lib/js/thirdparty/jquery.gridster.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/thirdparty/jquery.gridster.js
MIT
function Gridster(el, options) { this.options = $.extend(true, defaults, options); this.$el = $(el); this.$wrapper = this.$el.parent(); this.$widgets = this.$el.children(this.options.widget_selector).addClass('gs_w'); this.panes = []; this.$changed = $([]); this.wrapper_width = this.$wrapper.width(); t...
@class Gridster @uses Draggable @uses Collision @param {HTMLElement} el The HTMLelement that contains all the panes. @param {Object} [options] An Object with all options you want to overwrite: @param {HTMLElement|String} [options.widget_selector] Define who will be the draggable panes. Can be a CSS Select...
Gridster
javascript
Freeboard/freeboard
lib/js/thirdparty/jquery.gridster.js
https://github.com/Freeboard/freeboard/blob/master/lib/js/thirdparty/jquery.gridster.js
MIT
function hookErrorHandler() { isHooked = true; window.onerror = onErrorHandler; }
@type {!Array.<{regex: !Pattern, handler: !function()}>}
hookErrorHandler
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
function checkForKnownIssueHandler(subject, isKnownIssueUrl) { if (isKnownIssueUrl !== undefined) { return undefined; } for (let {regex, handler} of knownIssueRegexes) { //noinspection JSUnusedAssignment if (regex.test(subject)) { //noinspection JSUnusedAssignment ...
@type {!Array.<{regex: !Pattern, handler: !function()}>}
checkForKnownIssueHandler
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
showErrorDiv_forced = (callout, subject, body, isKnownIssueUrl) => { // Set shown error details. document.getElementById('error-happened-div').innerText = callout; document.getElementById('error-message-div').innerText = subject; document.getElementById('error-description-div').innerText = body; doc...
@type {!Array.<{regex: !Pattern, handler: !function()}>}
showErrorDiv_forced
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
showErrorDiv_forced = (callout, subject, body, isKnownIssueUrl) => { // Set shown error details. document.getElementById('error-happened-div').innerText = callout; document.getElementById('error-message-div').innerText = subject; document.getElementById('error-description-div').innerText = body; doc...
@type {!Array.<{regex: !Pattern, handler: !function()}>}
showErrorDiv_forced
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
showErrorDiv = (callout, subject, body, identifier, isKnownIssueUrl=undefined) => { let errDivStyle = document.getElementById('error-div').style; if (errDivStyle.opacity < 0.7) { // Partially faded away as user interacted with circuit. // Enough time to justify updating the message despite the r...
@param {!string} callout Scary 'there was an error' title show to user. @param {!string} subject Subject used for github issue / mailto link. @param {!string} body Body used for github issue / mailto link. @param {!string} identifier A minimal description of the error that shouldn't vary as the circuit is edited, so @p...
showErrorDiv
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
showErrorDiv = (callout, subject, body, identifier, isKnownIssueUrl=undefined) => { let errDivStyle = document.getElementById('error-div').style; if (errDivStyle.opacity < 0.7) { // Partially faded away as user interacted with circuit. // Enough time to justify updating the message despite the r...
@param {!string} callout Scary 'there was an error' title show to user. @param {!string} subject Subject used for github issue / mailto link. @param {!string} body Body used for github issue / mailto link. @param {!string} identifier A minimal description of the error that shouldn't vary as the circuit is edited, so @p...
showErrorDiv
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
takeScreenshotOfCanvas = () => { let canvas = document.getElementById("drawCanvas"); if (canvas === undefined) { return '#'; } return canvas.toDataURL("image/png"); }
@param {!string} callout Scary 'there was an error' title show to user. @param {!string} subject Subject used for github issue / mailto link. @param {!string} body Body used for github issue / mailto link. @param {!string} identifier A minimal description of the error that shouldn't vary as the circuit is edited, so @p...
takeScreenshotOfCanvas
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
takeScreenshotOfCanvas = () => { let canvas = document.getElementById("drawCanvas"); if (canvas === undefined) { return '#'; } return canvas.toDataURL("image/png"); }
@param {!string} callout Scary 'there was an error' title show to user. @param {!string} subject Subject used for github issue / mailto link. @param {!string} body Body used for github issue / mailto link. @param {!string} identifier A minimal description of the error that shouldn't vary as the circuit is edited, so @p...
takeScreenshotOfCanvas
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
notifyAboutRecoveryFromUnexpectedError = (recovery, context, error) => { if (!isHooked) { throw error; } console.error('Recovered from unexpected error', {recovery, context, error}); let location = error.stack || "unknown"; let msg = [ recovery, '', 'URL', do...
@param {!string} recovery A short description of what happened and how it was recovered from. @param {*} context Details about what caused the error and how we recovered. @param {*} error The exception object.
notifyAboutRecoveryFromUnexpectedError
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
notifyAboutRecoveryFromUnexpectedError = (recovery, context, error) => { if (!isHooked) { throw error; } console.error('Recovered from unexpected error', {recovery, context, error}); let location = error.stack || "unknown"; let msg = [ recovery, '', 'URL', do...
@param {!string} recovery A short description of what happened and how it was recovered from. @param {*} context Details about what caused the error and how we recovered. @param {*} error The exception object.
notifyAboutRecoveryFromUnexpectedError
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0
notifyAboutKnownIssue = (summary, url, regexes) => { let handler = () => showErrorDiv( 'A known problem is happening. :(', summary, '', summary, url); for (let regex of regexes) { knownIssueRegexes.push({regex, handler}); } handler(); }
@param {!string} recovery A short description of what happened and how it was recovered from. @param {*} context Details about what caused the error and how we recovered. @param {*} error The exception object.
notifyAboutKnownIssue
javascript
Strilanc/Quirk
src/fallback.js
https://github.com/Strilanc/Quirk/blob/master/src/fallback.js
Apache-2.0