id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
33,100
OpenSTFoundation/openst-platform
lib/contract_interact/ops_managed.js
function (contractAddress, web3Provider, currContract, defaultGasPrice) { this.contractAddress = contractAddress; this.web3Provider = web3Provider; this.currContract = currContract; this.defaultGasPrice = defaultGasPrice; this.currContract.options.address = contractAddress; //this.currContract.setProvider(w...
javascript
function (contractAddress, web3Provider, currContract, defaultGasPrice) { this.contractAddress = contractAddress; this.web3Provider = web3Provider; this.currContract = currContract; this.defaultGasPrice = defaultGasPrice; this.currContract.options.address = contractAddress; //this.currContract.setProvider(w...
[ "function", "(", "contractAddress", ",", "web3Provider", ",", "currContract", ",", "defaultGasPrice", ")", "{", "this", ".", "contractAddress", "=", "contractAddress", ";", "this", ".", "web3Provider", "=", "web3Provider", ";", "this", ".", "currContract", "=", ...
Constructor for Ops Managed Contract @constructor @augments OwnedKlass @param {string} contractAddress - address where Contract has been deployed @param {string} web3Provider - web3 provider of network where currContract has been deployed @param {string} currContract - Contract Instance @param {string} defaultGasPric...
[ "Constructor", "for", "Ops", "Managed", "Contract" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/lib/contract_interact/ops_managed.js#L30-L38
33,101
OpenSTFoundation/openst-platform
lib/contract_interact/simple_token.js
function () { const oThis = this ; oThis.contractAddress = simpleTokenContractAddr; simpleTokenContractObj.options.address = oThis.contractAddress; //simpleTokenContractObj.setProvider(web3Provider.currentProvider); OpsManagedKlass.call(oThis, oThis.contractAddress, web3Provider, simpleTokenContractObj, V...
javascript
function () { const oThis = this ; oThis.contractAddress = simpleTokenContractAddr; simpleTokenContractObj.options.address = oThis.contractAddress; //simpleTokenContractObj.setProvider(web3Provider.currentProvider); OpsManagedKlass.call(oThis, oThis.contractAddress, web3Provider, simpleTokenContractObj, V...
[ "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "oThis", ".", "contractAddress", "=", "simpleTokenContractAddr", ";", "simpleTokenContractObj", ".", "options", ".", "address", "=", "oThis", ".", "contractAddress", ";", "//simpleTokenContractObj.setPro...
Constructor for SimpleToken Contract Interact @constructor @augments OpsManagedKlass
[ "Constructor", "for", "SimpleToken", "Contract", "Interact" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/lib/contract_interact/simple_token.js#L43-L52
33,102
OpenSTFoundation/openst-platform
helpers/registration_status.js
function () { const oThis = this ; return { uuid: oThis.uuid, erc20_address: oThis.erc20Address, is_proposal_done: oThis.isProposalDone, is_registered_on_uc: oThis.isRegisteredOnUc, is_registered_on_vc: oThis.isRegisteredOnVc } }
javascript
function () { const oThis = this ; return { uuid: oThis.uuid, erc20_address: oThis.erc20Address, is_proposal_done: oThis.isProposalDone, is_registered_on_uc: oThis.isRegisteredOnUc, is_registered_on_vc: oThis.isRegisteredOnVc } }
[ "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "return", "{", "uuid", ":", "oThis", ".", "uuid", ",", "erc20_address", ":", "oThis", ".", "erc20Address", ",", "is_proposal_done", ":", "oThis", ".", "isProposalDone", ",", "is_registered_on_uc"...
convert the RegistrationStatus object to an object @return {object} returns a formatted object of registration status
[ "convert", "the", "RegistrationStatus", "object", "to", "an", "object" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/helpers/registration_status.js#L37-L48
33,103
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
function (params) { const oThis = this; oThis.btName = params.bt_name; // branded token name oThis.btSymbol = params.bt_symbol; // branded token symbol oThis.btConversionFactor = params.bt_conversion_factor; // branded token to OST conversion factor, 1 OST = 10 ACME oThis.reserveAddress = ''; // Member co...
javascript
function (params) { const oThis = this; oThis.btName = params.bt_name; // branded token name oThis.btSymbol = params.bt_symbol; // branded token symbol oThis.btConversionFactor = params.bt_conversion_factor; // branded token to OST conversion factor, 1 OST = 10 ACME oThis.reserveAddress = ''; // Member co...
[ "function", "(", "params", ")", "{", "const", "oThis", "=", "this", ";", "oThis", ".", "btName", "=", "params", ".", "bt_name", ";", "// branded token name", "oThis", ".", "btSymbol", "=", "params", ".", "bt_symbol", ";", "// branded token symbol", "oThis", ...
Constructor for proposing branded token @param {object} params - this is params @param {object} params.bt_symbol - branded token symbol @param {object} params.bt_name - branded token name @param {object} params.bt_conversion_factor - branded token conversion factor @constructor
[ "Constructor", "for", "proposing", "branded", "token" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L50-L62
33,104
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function () { const oThis = this; // Validate new branded token logger.step("** Validating branded token"); await oThis._validateBrandedTokenDetails(); // Generate reserve address logger.step("** Generating reserve address"); var addressRes = await oThis._generateAddress(); oThis...
javascript
async function () { const oThis = this; // Validate new branded token logger.step("** Validating branded token"); await oThis._validateBrandedTokenDetails(); // Generate reserve address logger.step("** Generating reserve address"); var addressRes = await oThis._generateAddress(); oThis...
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "// Validate new branded token", "logger", ".", "step", "(", "\"** Validating branded token\"", ")", ";", "await", "oThis", ".", "_validateBrandedTokenDetails", "(", ")", ";", "// Generate reser...
Start BT proposal
[ "Start", "BT", "proposal" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L68-L100
33,105
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function() { const oThis = this ; const addressObj = new generateAddress({chain: 'utility', passphrase: oThis.reservePassphrase}) , addressResponse = await addressObj.perform(); if (addressResponse.isFailure()) { logger.error("* Reserve address generation failed with error:", addressRe...
javascript
async function() { const oThis = this ; const addressObj = new generateAddress({chain: 'utility', passphrase: oThis.reservePassphrase}) , addressResponse = await addressObj.perform(); if (addressResponse.isFailure()) { logger.error("* Reserve address generation failed with error:", addressRe...
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "const", "addressObj", "=", "new", "generateAddress", "(", "{", "chain", ":", "'utility'", ",", "passphrase", ":", "oThis", ".", "reservePassphrase", "}", ")", ",", "addressResponse", ...
Generate reserve address @return {promise<result>} @private
[ "Generate", "reserve", "address" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L108-L118
33,106
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function() { const oThis = this ; logger.step("** Starting BT proposal"); logger.info("* Name:", oThis.btName, "Symbol:", oThis.btSymbol, "Conversion Factor:", oThis.btConversionFactor); const proposeBTObj = new proposeBrandedToken( {name: oThis.btName, symbol: oThis.btSymbol, conversion...
javascript
async function() { const oThis = this ; logger.step("** Starting BT proposal"); logger.info("* Name:", oThis.btName, "Symbol:", oThis.btSymbol, "Conversion Factor:", oThis.btConversionFactor); const proposeBTObj = new proposeBrandedToken( {name: oThis.btName, symbol: oThis.btSymbol, conversion...
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "logger", ".", "step", "(", "\"** Starting BT proposal\"", ")", ";", "logger", ".", "info", "(", "\"* Name:\"", ",", "oThis", ".", "btName", ",", "\"Symbol:\"", ",", "oThis", ".", "b...
Start the proposal of branded token @return {promise<result>} @private
[ "Start", "the", "proposal", "of", "branded", "token" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L126-L140
33,107
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
function(transaction_hash) { const oThis = this , timeInterval = 5000 , proposeSteps = {is_proposal_done: 0, is_registered_on_uc: 0, is_registered_on_vc: 0} ; return new Promise(function(onResolve, onReject){ logger.step("** Monitoring BT proposal status"); const statusObj = new ge...
javascript
function(transaction_hash) { const oThis = this , timeInterval = 5000 , proposeSteps = {is_proposal_done: 0, is_registered_on_uc: 0, is_registered_on_vc: 0} ; return new Promise(function(onResolve, onReject){ logger.step("** Monitoring BT proposal status"); const statusObj = new ge...
[ "function", "(", "transaction_hash", ")", "{", "const", "oThis", "=", "this", ",", "timeInterval", "=", "5000", ",", "proposeSteps", "=", "{", "is_proposal_done", ":", "0", ",", "is_registered_on_uc", ":", "0", ",", "is_registered_on_vc", ":", "0", "}", ";",...
Check propose status @param {string} transaction_hash - BT proposal transaction hash @return {promise<result>} @private
[ "Check", "propose", "status" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L150-L188
33,108
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function() { const oThis = this , existingBrandedTokens = await oThis._loadBrandedTokenConfig() ; for (var uuid in existingBrandedTokens) { var brandedToken = existingBrandedTokens[uuid]; if (oThis.btName.equalsIgnoreCase(brandedToken.Name)) { logger.error("* Branded token na...
javascript
async function() { const oThis = this , existingBrandedTokens = await oThis._loadBrandedTokenConfig() ; for (var uuid in existingBrandedTokens) { var brandedToken = existingBrandedTokens[uuid]; if (oThis.btName.equalsIgnoreCase(brandedToken.Name)) { logger.error("* Branded token na...
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ",", "existingBrandedTokens", "=", "await", "oThis", ".", "_loadBrandedTokenConfig", "(", ")", ";", "for", "(", "var", "uuid", "in", "existingBrandedTokens", ")", "{", "var", "brandedToken", ...
Check for duplicate branded token @return {boolean} @private
[ "Check", "for", "duplicate", "branded", "token" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L196-L212
33,109
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function() { const oThis = this , existingBrandedTokens = await oThis._loadBrandedTokenConfig() ; if (existingBrandedTokens[oThis.uuid]) { logger.error("* Branded token uuid already registered and present in BT config file"); process.exit(1); } existingBrandedTokens[oThis.u...
javascript
async function() { const oThis = this , existingBrandedTokens = await oThis._loadBrandedTokenConfig() ; if (existingBrandedTokens[oThis.uuid]) { logger.error("* Branded token uuid already registered and present in BT config file"); process.exit(1); } existingBrandedTokens[oThis.u...
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ",", "existingBrandedTokens", "=", "await", "oThis", ".", "_loadBrandedTokenConfig", "(", ")", ";", "if", "(", "existingBrandedTokens", "[", "oThis", ".", "uuid", "]", ")", "{", "logger", "...
Update branded token details @return {promise<object>} - branded tokens list @private
[ "Update", "branded", "token", "details" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L220-L243
33,110
OpenSTFoundation/openst-platform
tools/setup/branded_token/register.js
async function() { const oThis = this ; await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.erc20 }).allocate(); }
javascript
async function() { const oThis = this ; await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.erc20 }).allocate(); }
[ "async", "function", "(", ")", "{", "const", "oThis", "=", "this", ";", "await", "new", "openSTStorage", ".", "TokenBalanceModel", "(", "{", "ddb_service", ":", "ddbServiceObj", ",", "auto_scaling", ":", "autoScalingServiceObj", ",", "erc20_contract_address", ":",...
Allocate shard to branded token @return {promise<object>} - @private
[ "Allocate", "shard", "to", "branded", "token" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/tools/setup/branded_token/register.js#L251-L260
33,111
OpenSTFoundation/openst-platform
lib/web3/events/decoder.js
function (address, addressToNameMap) { const lcAddress = String(address).toLowerCase(); if (!addressToNameMap || !( addressToNameMap[address] || addressToNameMap[lcAddress] )) { return coreAddresses.getContractNameFor(address); } return addressToNameMap[address] || addressToNameMap[lcAddress]; }
javascript
function (address, addressToNameMap) { const lcAddress = String(address).toLowerCase(); if (!addressToNameMap || !( addressToNameMap[address] || addressToNameMap[lcAddress] )) { return coreAddresses.getContractNameFor(address); } return addressToNameMap[address] || addressToNameMap[lcAddress]; }
[ "function", "(", "address", ",", "addressToNameMap", ")", "{", "const", "lcAddress", "=", "String", "(", "address", ")", ".", "toLowerCase", "(", ")", ";", "if", "(", "!", "addressToNameMap", "||", "!", "(", "addressToNameMap", "[", "address", "]", "||", ...
Get contract name for an particular address @param {string} address - address of the contract from which the event is raised @param {object} addressToNameMap - Address to name map @return {string} - returns the name of the contract from the address - returns null for contracts which are not recognized
[ "Get", "contract", "name", "for", "an", "particular", "address" ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/lib/web3/events/decoder.js#L126-L132
33,112
OpenSTFoundation/openst-platform
executables/notification_subscribe.js
subscribe
function subscribe() { openSTNotification.subscribeEvent.rabbit( ['#'], {queue: 'openst_platform'}, function (msgContent) { logger.debug('[RECEIVED]', msgContent, '\n'); } ).catch(function (err) { logger.error(err); }); }
javascript
function subscribe() { openSTNotification.subscribeEvent.rabbit( ['#'], {queue: 'openst_platform'}, function (msgContent) { logger.debug('[RECEIVED]', msgContent, '\n'); } ).catch(function (err) { logger.error(err); }); }
[ "function", "subscribe", "(", ")", "{", "openSTNotification", ".", "subscribeEvent", ".", "rabbit", "(", "[", "'#'", "]", ",", "{", "queue", ":", "'openst_platform'", "}", ",", "function", "(", "msgContent", ")", "{", "logger", ".", "debug", "(", "'[RECEIV...
Subscribe to all events of rabbit.
[ "Subscribe", "to", "all", "events", "of", "rabbit", "." ]
2bcc62c7c7740b5f424fd9b467197aa14a94bb32
https://github.com/OpenSTFoundation/openst-platform/blob/2bcc62c7c7740b5f424fd9b467197aa14a94bb32/executables/notification_subscribe.js#L15-L25
33,113
enketo/enketo-transformer
src/language.js
parse
function parse( lang, sample ) { // TODO: this should be refactored let ianaLang; const language = { desc: lang.trim(), tag: lang.trim(), src: lang }; const parts = lang.match( /^([^(]+)\((.*)\)\s*$/ ); if ( parts && parts.length > 2 ) { language.desc = parts[ 1 ...
javascript
function parse( lang, sample ) { // TODO: this should be refactored let ianaLang; const language = { desc: lang.trim(), tag: lang.trim(), src: lang }; const parts = lang.match( /^([^(]+)\((.*)\)\s*$/ ); if ( parts && parts.length > 2 ) { language.desc = parts[ 1 ...
[ "function", "parse", "(", "lang", ",", "sample", ")", "{", "// TODO: this should be refactored", "let", "ianaLang", ";", "const", "language", "=", "{", "desc", ":", "lang", ".", "trim", "(", ")", ",", "tag", ":", "lang", ".", "trim", "(", ")", ",", "sr...
Parses a language string into a language object. Guesses missing properties. @see http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry @param {string} lang language strings as included in the XForm @return {{desc: string, tag: string, dir: string, src: string}} language object
[ "Parses", "a", "language", "string", "into", "a", "language", "object", ".", "Guesses", "missing", "properties", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/language.js#L11-L42
33,114
enketo/enketo-transformer
src/language.js
_getLangWithDesc
function _getLangWithDesc( desc ) { const results = ( desc ) ? tags.search( desc ).filter( _languagesOnly ) : []; return results[ 0 ] || ''; }
javascript
function _getLangWithDesc( desc ) { const results = ( desc ) ? tags.search( desc ).filter( _languagesOnly ) : []; return results[ 0 ] || ''; }
[ "function", "_getLangWithDesc", "(", "desc", ")", "{", "const", "results", "=", "(", "desc", ")", "?", "tags", ".", "search", "(", "desc", ")", ".", "filter", "(", "_languagesOnly", ")", ":", "[", "]", ";", "return", "results", "[", "0", "]", "||", ...
Performs IANA search to find language object with provided description @param {string} desc language description @return {<*>} the first language object result that was found
[ "Performs", "IANA", "search", "to", "find", "language", "object", "with", "provided", "description" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/language.js#L50-L53
33,115
enketo/enketo-transformer
src/transformer.js
transform
function transform( survey ) { let xformDoc; const xsltParams = survey.includeRelevantMsg ? { 'include-relevant-msg': 1 } : {}; return _parseXml( survey.xform ) .then( doc => { if ( typeof survey.preprocess === 'function' ) { doc = survey.preprocess.call( lib...
javascript
function transform( survey ) { let xformDoc; const xsltParams = survey.includeRelevantMsg ? { 'include-relevant-msg': 1 } : {}; return _parseXml( survey.xform ) .then( doc => { if ( typeof survey.preprocess === 'function' ) { doc = survey.preprocess.call( lib...
[ "function", "transform", "(", "survey", ")", "{", "let", "xformDoc", ";", "const", "xsltParams", "=", "survey", ".", "includeRelevantMsg", "?", "{", "'include-relevant-msg'", ":", "1", "}", ":", "{", "}", ";", "return", "_parseXml", "(", "survey", ".", "xf...
Performs XSLT transformation on XForm and process the result. @param {{xform: string, theme: string}} survey Survey object with at least an xform property @return {Promise} promise
[ "Performs", "XSLT", "transformation", "on", "XForm", "and", "process", "the", "result", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L22-L65
33,116
enketo/enketo-transformer
src/transformer.js
_transform
function _transform( xslStr, xmlDoc, xsltParams ) { const params = xsltParams || {}; return new Promise( ( resolve, reject ) => { libxslt.parse( xslStr, ( error, stylesheet ) => { if ( error ) { reject( error ); } else { stylesheet.apply( xmlDoc, p...
javascript
function _transform( xslStr, xmlDoc, xsltParams ) { const params = xsltParams || {}; return new Promise( ( resolve, reject ) => { libxslt.parse( xslStr, ( error, stylesheet ) => { if ( error ) { reject( error ); } else { stylesheet.apply( xmlDoc, p...
[ "function", "_transform", "(", "xslStr", ",", "xmlDoc", ",", "xsltParams", ")", "{", "const", "params", "=", "xsltParams", "||", "{", "}", ";", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "libxslt", ".", "parse", "("...
Performs a generic XSLT transformation @param {[type]} xslDoc libxmljs object of XSL stylesheet @param {[type]} xmlDoc libxmljs object of XML document @return {Promise} libxmljs result document object
[ "Performs", "a", "generic", "XSLT", "transformation" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L74-L91
33,117
enketo/enketo-transformer
src/transformer.js
_parseXml
function _parseXml( xmlStr ) { let doc; return new Promise( ( resolve, reject ) => { try { doc = libxmljs.parseXml( xmlStr ); resolve( doc ); } catch ( e ) { reject( e ); } } ); }
javascript
function _parseXml( xmlStr ) { let doc; return new Promise( ( resolve, reject ) => { try { doc = libxmljs.parseXml( xmlStr ); resolve( doc ); } catch ( e ) { reject( e ); } } ); }
[ "function", "_parseXml", "(", "xmlStr", ")", "{", "let", "doc", ";", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "try", "{", "doc", "=", "libxmljs", ".", "parseXml", "(", "xmlStr", ")", ";", "resolve", "(", "doc", ...
Parses and XML string into a libxmljs object @param {string} xmlStr XML string @return {Promise} libxmljs result document object
[ "Parses", "and", "XML", "string", "into", "a", "libxmljs", "object" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L99-L110
33,118
enketo/enketo-transformer
src/transformer.js
_replaceTheme
function _replaceTheme( doc, theme ) { const HAS_THEME = /(theme-)[^"'\s]+/; if ( !theme ) { return doc; } const formClassAttr = doc.root().get( '/root/form' ).attr( 'class' ); const formClassValue = formClassAttr.value(); if ( HAS_THEME.test( formClassValue ) ) { formClassAtt...
javascript
function _replaceTheme( doc, theme ) { const HAS_THEME = /(theme-)[^"'\s]+/; if ( !theme ) { return doc; } const formClassAttr = doc.root().get( '/root/form' ).attr( 'class' ); const formClassValue = formClassAttr.value(); if ( HAS_THEME.test( formClassValue ) ) { formClassAtt...
[ "function", "_replaceTheme", "(", "doc", ",", "theme", ")", "{", "const", "HAS_THEME", "=", "/", "(theme-)[^\"'\\s]+", "/", ";", "if", "(", "!", "theme", ")", "{", "return", "doc", ";", "}", "const", "formClassAttr", "=", "doc", ".", "root", "(", ")", ...
Replaces the form-defined theme @param {[type]} doc libxmljs object @param {string} theme theme @return {[type]} libxmljs object
[ "Replaces", "the", "form", "-", "defined", "theme" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L119-L136
33,119
enketo/enketo-transformer
src/transformer.js
_replaceMediaSources
function _replaceMediaSources( xmlDoc, mediaMap ) { if ( !mediaMap ) { return xmlDoc; } // iterate through each element with a src attribute xmlDoc.find( '//*[@src] | //a[@href]' ).forEach( mediaEl => { const attribute = ( mediaEl.name().toLowerCase() === 'a' ) ? 'href' : 'src'; ...
javascript
function _replaceMediaSources( xmlDoc, mediaMap ) { if ( !mediaMap ) { return xmlDoc; } // iterate through each element with a src attribute xmlDoc.find( '//*[@src] | //a[@href]' ).forEach( mediaEl => { const attribute = ( mediaEl.name().toLowerCase() === 'a' ) ? 'href' : 'src'; ...
[ "function", "_replaceMediaSources", "(", "xmlDoc", ",", "mediaMap", ")", "{", "if", "(", "!", "mediaMap", ")", "{", "return", "xmlDoc", ";", "}", "// iterate through each element with a src attribute", "xmlDoc", ".", "find", "(", "'//*[@src] | //a[@href]'", ")", "."...
Replaces xformManifest urls with URLs according to an internal Enketo Express url format @param {[type]} xmlDoc libxmljs object @param {*} manifest json representation of XForm manifest @return {Promise} libxmljs object
[ "Replaces", "xformManifest", "urls", "with", "URLs", "according", "to", "an", "internal", "Enketo", "Express", "url", "format" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L145-L173
33,120
enketo/enketo-transformer
src/transformer.js
_replaceLanguageTags
function _replaceLanguageTags( doc, survey ) { const map = {}; const languageElements = doc.find( '/root/form/select[@id="form-languages"]/option' ); // List of parsed language objects const languages = languageElements.map( el => { const lang = el.text(); return language.parse( lang, ...
javascript
function _replaceLanguageTags( doc, survey ) { const map = {}; const languageElements = doc.find( '/root/form/select[@id="form-languages"]/option' ); // List of parsed language objects const languages = languageElements.map( el => { const lang = el.text(); return language.parse( lang, ...
[ "function", "_replaceLanguageTags", "(", "doc", ",", "survey", ")", "{", "const", "map", "=", "{", "}", ";", "const", "languageElements", "=", "doc", ".", "find", "(", "'/root/form/select[@id=\"form-languages\"]/option'", ")", ";", "// List of parsed language objects"...
Replaces all lang attributes to the valid IANA tag if found. Also add the dir attribute to the languages in the language selector. @see http://www.w3.org/International/questions/qa-choosing-language-tags @param {[type]} doc libxmljs object @return {[type]} libxmljs object
[ "Replaces", "all", "lang", "attributes", "to", "the", "valid", "IANA", "tag", "if", "found", ".", "Also", "add", "the", "dir", "attribute", "to", "the", "languages", "in", "the", "language", "selector", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L184-L241
33,121
enketo/enketo-transformer
src/transformer.js
_getLanguageSampleText
function _getLanguageSampleText( doc, lang ) { // First find non-empty text content of a hint with that lang attribute. // If not found, find any span with that lang attribute. const langSampleEl = doc.get( `/root/form//span[contains(@class, "or-hint") and @lang="${lang}" and normalize-space() and not(./tex...
javascript
function _getLanguageSampleText( doc, lang ) { // First find non-empty text content of a hint with that lang attribute. // If not found, find any span with that lang attribute. const langSampleEl = doc.get( `/root/form//span[contains(@class, "or-hint") and @lang="${lang}" and normalize-space() and not(./tex...
[ "function", "_getLanguageSampleText", "(", "doc", ",", "lang", ")", "{", "// First find non-empty text content of a hint with that lang attribute.", "// If not found, find any span with that lang attribute.", "const", "langSampleEl", "=", "doc", ".", "get", "(", "`", "${", "lan...
Obtains a non-empty hint text or other text sample of a particular form language. @param {[type]} doc libxmljs object @param {string} lang language @return {string} the text sample
[ "Obtains", "a", "non", "-", "empty", "hint", "text", "or", "other", "text", "sample", "of", "a", "particular", "form", "language", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L250-L257
33,122
enketo/enketo-transformer
src/transformer.js
_renderMarkdown
function _renderMarkdown( htmlDoc ) { const replacements = {}; // First turn all outputs into text so *<span class="or-output></span>* can be detected htmlDoc.find( '/root/form//span[contains(@class, "or-output")]' ).forEach( ( el, index ) => { const key = `---output-${index}`; const textNo...
javascript
function _renderMarkdown( htmlDoc ) { const replacements = {}; // First turn all outputs into text so *<span class="or-output></span>* can be detected htmlDoc.find( '/root/form//span[contains(@class, "or-output")]' ).forEach( ( el, index ) => { const key = `---output-${index}`; const textNo...
[ "function", "_renderMarkdown", "(", "htmlDoc", ")", "{", "const", "replacements", "=", "{", "}", ";", "// First turn all outputs into text so *<span class=\"or-output></span>* can be detected", "htmlDoc", ".", "find", "(", "'/root/form//span[contains(@class, \"or-output\")]'", ")...
Converts a subset of Markdown in all textnode children of labels and hints into HTML @param {[type]} htmlDoc libxmljs object @return {[type]} libxmljs object
[ "Converts", "a", "subset", "of", "Markdown", "in", "all", "textnode", "children", "of", "labels", "and", "hints", "into", "HTML" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L293-L338
33,123
enketo/enketo-transformer
src/transformer.js
_md5
function _md5( message ) { const hash = crypto.createHash( 'md5' ); hash.update( message ); return hash.digest( 'hex' ); }
javascript
function _md5( message ) { const hash = crypto.createHash( 'md5' ); hash.update( message ); return hash.digest( 'hex' ); }
[ "function", "_md5", "(", "message", ")", "{", "const", "hash", "=", "crypto", ".", "createHash", "(", "'md5'", ")", ";", "hash", ".", "update", "(", "message", ")", ";", "return", "hash", ".", "digest", "(", "'hex'", ")", ";", "}" ]
Calculate the md5 hash of a message. @param {string|Buffer} message The string or buffer @return {string} The hash
[ "Calculate", "the", "md5", "hash", "of", "a", "message", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/transformer.js#L363-L367
33,124
enketo/enketo-transformer
src/markdown.js
markdownToHtml
function markdownToHtml( text ) { // note: in JS $ matches end of line as well as end of string, and ^ both beginning of line and string const html = text // html encoding of < because libXMLJs Element.text() converts html entities .replace( /</gm, '&lt;' ) // html encoding of < because ...
javascript
function markdownToHtml( text ) { // note: in JS $ matches end of line as well as end of string, and ^ both beginning of line and string const html = text // html encoding of < because libXMLJs Element.text() converts html entities .replace( /</gm, '&lt;' ) // html encoding of < because ...
[ "function", "markdownToHtml", "(", "text", ")", "{", "// note: in JS $ matches end of line as well as end of string, and ^ both beginning of line and string", "const", "html", "=", "text", "// html encoding of < because libXMLJs Element.text() converts html entities", ".", "replace", "("...
Transforms XForm label and hint textnode content with a subset of Markdown into HTML Supported: - _, __, *, **, [](), #, ##, ###, ####, #####, - span tags and html-encoded span tags, - single-level unordered markdown lists and single-level ordered markdown lists - newline characters Also HTML encodes any unsupported ...
[ "Transforms", "XForm", "label", "and", "hint", "textnode", "content", "with", "a", "subset", "of", "Markdown", "into", "HTML" ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/markdown.js#L15-L60
33,125
pimterry/raspivid-stream
index.js
getLiveStream
function getLiveStream(options) { return raspivid(Object.assign({ width: 960, height: 540, framerate: 20, profile: 'baseline', timeout: 0 }, options)) .pipe(new Splitter(NALseparator)) .pipe(new stream.Transform({ transform: function (chunk, encoding, callback) { ...
javascript
function getLiveStream(options) { return raspivid(Object.assign({ width: 960, height: 540, framerate: 20, profile: 'baseline', timeout: 0 }, options)) .pipe(new Splitter(NALseparator)) .pipe(new stream.Transform({ transform: function (chunk, encoding, callback) { ...
[ "function", "getLiveStream", "(", "options", ")", "{", "return", "raspivid", "(", "Object", ".", "assign", "(", "{", "width", ":", "960", ",", "height", ":", "540", ",", "framerate", ":", "20", ",", "profile", ":", "'baseline'", ",", "timeout", ":", "0...
This returns the live stream only, without the parameter chunks
[ "This", "returns", "the", "live", "stream", "only", "without", "the", "parameter", "chunks" ]
f50c510188fa1860e6322c84ce96a652fbbad5bd
https://github.com/pimterry/raspivid-stream/blob/f50c510188fa1860e6322c84ce96a652fbbad5bd/index.js#L41-L70
33,126
enketo/enketo-transformer
src/api.js
_request
function _request( options ) { options.headers = options.headers || {}; options.headers[ 'X-OpenRosa-Version' ] = '1.0'; const method = options.method || 'get'; return new Promise( ( resolve, reject ) => { request[ method ]( options, ( error, response, body ) => { if ( error ) { ...
javascript
function _request( options ) { options.headers = options.headers || {}; options.headers[ 'X-OpenRosa-Version' ] = '1.0'; const method = options.method || 'get'; return new Promise( ( resolve, reject ) => { request[ method ]( options, ( error, response, body ) => { if ( error ) { ...
[ "function", "_request", "(", "options", ")", "{", "options", ".", "headers", "=", "options", ".", "headers", "||", "{", "}", ";", "options", ".", "headers", "[", "'X-OpenRosa-Version'", "]", "=", "'1.0'", ";", "const", "method", "=", "options", ".", "met...
Sends a request to an OpenRosa server. Only for basic retrieval of public forms that do not require authentication. @param { {url: string, method: string} } options request options object @return { Promise }
[ "Sends", "a", "request", "to", "an", "OpenRosa", "server", ".", "Only", "for", "basic", "retrieval", "of", "public", "forms", "that", "do", "not", "require", "authentication", "." ]
58f65a71c7695fd12ace32c86b7a0f719cad6159
https://github.com/enketo/enketo-transformer/blob/58f65a71c7695fd12ace32c86b7a0f719cad6159/src/api.js#L80-L105
33,127
dylang/space-hogs
util/percentage.js
percentage
function percentage(num) { const MAX_CHARACTERS = 4; const relativePercentage = Math.ceil(num * 100 / (100 / MAX_CHARACTERS)); return `[${'▒'.repeat(relativePercentage)}${' '.repeat(MAX_CHARACTERS - relativePercentage)}]`; }
javascript
function percentage(num) { const MAX_CHARACTERS = 4; const relativePercentage = Math.ceil(num * 100 / (100 / MAX_CHARACTERS)); return `[${'▒'.repeat(relativePercentage)}${' '.repeat(MAX_CHARACTERS - relativePercentage)}]`; }
[ "function", "percentage", "(", "num", ")", "{", "const", "MAX_CHARACTERS", "=", "4", ";", "const", "relativePercentage", "=", "Math", ".", "ceil", "(", "num", "*", "100", "/", "(", "100", "/", "MAX_CHARACTERS", ")", ")", ";", "return", "`", "${", "'▒'....
Nice way to show percentage. Not really necessary.
[ "Nice", "way", "to", "show", "percentage", ".", "Not", "really", "necessary", "." ]
53c5d0a245dc22c76602c8e4cfdc44f5f6c09311
https://github.com/dylang/space-hogs/blob/53c5d0a245dc22c76602c8e4cfdc44f5f6c09311/util/percentage.js#L4-L9
33,128
oe/truncate-html
dist/truncate.es.js
extend
function extend(obj, dft) { if (obj == null) { obj = {}; } for (var k in dft) { var v = dft[k]; if (obj[k] != null) { continue; } obj[k] = v; } return obj; }
javascript
function extend(obj, dft) { if (obj == null) { obj = {}; } for (var k in dft) { var v = dft[k]; if (obj[k] != null) { continue; } obj[k] = v; } return obj; }
[ "function", "extend", "(", "obj", ",", "dft", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "obj", "=", "{", "}", ";", "}", "for", "(", "var", "k", "in", "dft", ")", "{", "var", "v", "=", "dft", "[", "k", "]", ";", "if", "(", "obj",...
extend obj with dft
[ "extend", "obj", "with", "dft" ]
31bac538894b14db0b68488b9f62d898dd03652b
https://github.com/oe/truncate-html/blob/31bac538894b14db0b68488b9f62d898dd03652b/dist/truncate.es.js#L57-L69
33,129
oe/truncate-html
dist/truncate.es.js
isBlank
function isBlank(char) { return (char === ' ' || char === '\f' || char === '\n' || char === '\r' || char === '\t' || char === '\v' || char === '\u00A0' || char === '\u2028' || char === '\u2029'); }
javascript
function isBlank(char) { return (char === ' ' || char === '\f' || char === '\n' || char === '\r' || char === '\t' || char === '\v' || char === '\u00A0' || char === '\u2028' || char === '\u2029'); }
[ "function", "isBlank", "(", "char", ")", "{", "return", "(", "char", "===", "' '", "||", "char", "===", "'\\f'", "||", "char", "===", "'\\n'", "||", "char", "===", "'\\r'", "||", "char", "===", "'\\t'", "||", "char", "===", "'\\v'", "||", "char", "==...
test a char whether a whitespace char
[ "test", "a", "char", "whether", "a", "whitespace", "char" ]
31bac538894b14db0b68488b9f62d898dd03652b
https://github.com/oe/truncate-html/blob/31bac538894b14db0b68488b9f62d898dd03652b/dist/truncate.es.js#L71-L81
33,130
oe/truncate-html
dist/truncate.es.js
substr
function substr(astralSafeCharacterArray, len) { // var boundary, cutted, result var cutted = astralSafeCharacterArray.slice(0, len).join(''); if (!this.reserveLastWord) { return cutted; } var boundary = astralSafeCharacterArray.slice(len - 1, len + 1).join('');...
javascript
function substr(astralSafeCharacterArray, len) { // var boundary, cutted, result var cutted = astralSafeCharacterArray.slice(0, len).join(''); if (!this.reserveLastWord) { return cutted; } var boundary = astralSafeCharacterArray.slice(len - 1, len + 1).join('');...
[ "function", "substr", "(", "astralSafeCharacterArray", ",", "len", ")", "{", "// var boundary, cutted, result\r", "var", "cutted", "=", "astralSafeCharacterArray", ".", "slice", "(", "0", ",", "len", ")", ".", "join", "(", "''", ")", ";", "if", "(", "!", "th...
deal with cut string in the middle of a word
[ "deal", "with", "cut", "string", "in", "the", "middle", "of", "a", "word" ]
31bac538894b14db0b68488b9f62d898dd03652b
https://github.com/oe/truncate-html/blob/31bac538894b14db0b68488b9f62d898dd03652b/dist/truncate.es.js#L147-L173
33,131
oe/truncate-html
dist/truncate.es.js
isCheerioInstance
function isCheerioInstance(elem) { return elem && elem.contains && elem.html && elem.parseHTML && true; }
javascript
function isCheerioInstance(elem) { return elem && elem.contains && elem.html && elem.parseHTML && true; }
[ "function", "isCheerioInstance", "(", "elem", ")", "{", "return", "elem", "&&", "elem", ".", "contains", "&&", "elem", ".", "html", "&&", "elem", ".", "parseHTML", "&&", "true", ";", "}" ]
return true if elem is CheerioStatic
[ "return", "true", "if", "elem", "is", "CheerioStatic" ]
31bac538894b14db0b68488b9f62d898dd03652b
https://github.com/oe/truncate-html/blob/31bac538894b14db0b68488b9f62d898dd03652b/dist/truncate.es.js#L176-L181
33,132
iVis-at-Bilkent/cytoscape.js-autopan-on-drag
cytoscape-autopan-on-drag.js
getScratch
function getScratch (eleOrCy, name) { if (eleOrCy.scratch("_autopanOnDrag") === undefined) { eleOrCy.scratch("_autopanOnDrag", {}); } var scratchPad = eleOrCy.scratch("_autopanOnDrag"); return ( name === undefined ) ? scratchPad : scratchPad[name]; }
javascript
function getScratch (eleOrCy, name) { if (eleOrCy.scratch("_autopanOnDrag") === undefined) { eleOrCy.scratch("_autopanOnDrag", {}); } var scratchPad = eleOrCy.scratch("_autopanOnDrag"); return ( name === undefined ) ? scratchPad : scratchPad[name]; }
[ "function", "getScratch", "(", "eleOrCy", ",", "name", ")", "{", "if", "(", "eleOrCy", ".", "scratch", "(", "\"_autopanOnDrag\"", ")", "===", "undefined", ")", "{", "eleOrCy", ".", "scratch", "(", "\"_autopanOnDrag\"", ",", "{", "}", ")", ";", "}", "var"...
Get scratch pad reserved for this extension on the given element or the core if 'name' parameter is not set, if the 'name' parameter is set then return the related property in the scratch instead of the whole scratchpad
[ "Get", "scratch", "pad", "reserved", "for", "this", "extension", "on", "the", "given", "element", "or", "the", "core", "if", "name", "parameter", "is", "not", "set", "if", "the", "name", "parameter", "is", "set", "then", "return", "the", "related", "proper...
0928cce76f187fa9c45b0163f99156e45d5457a8
https://github.com/iVis-at-Bilkent/cytoscape.js-autopan-on-drag/blob/0928cce76f187fa9c45b0163f99156e45d5457a8/cytoscape-autopan-on-drag.js#L32-L41
33,133
generate/generate-mocha
generator.js
filter
function filter(name, options) { return utils.through.obj(function(file, enc, next) { if (file.isNull()) { next(); return; } var basename = path.basename(file.history[0]); var stem = basename.slice(0, -3); if (basename === name || stem === name) { next(null, file); } else {...
javascript
function filter(name, options) { return utils.through.obj(function(file, enc, next) { if (file.isNull()) { next(); return; } var basename = path.basename(file.history[0]); var stem = basename.slice(0, -3); if (basename === name || stem === name) { next(null, file); } else {...
[ "function", "filter", "(", "name", ",", "options", ")", "{", "return", "utils", ".", "through", ".", "obj", "(", "function", "(", "file", ",", "enc", ",", "next", ")", "{", "if", "(", "file", ".", "isNull", "(", ")", ")", "{", "next", "(", ")", ...
Filter files to be rendered
[ "Filter", "files", "to", "be", "rendered" ]
269dd1451f4c651e530ae9a47ffdffcd85a45128
https://github.com/generate/generate-mocha/blob/269dd1451f4c651e530ae9a47ffdffcd85a45128/generator.js#L270-L286
33,134
linnovate/mean-cli
lib/scaffold.js
write
function write(path, str) { fs.writeFile(path, str); console.log(chalk.cyan(' create:'), path); }
javascript
function write(path, str) { fs.writeFile(path, str); console.log(chalk.cyan(' create:'), path); }
[ "function", "write", "(", "path", ",", "str", ")", "{", "fs", ".", "writeFile", "(", "path", ",", "str", ")", ";", "console", ".", "log", "(", "chalk", ".", "cyan", "(", "' create:'", ")", ",", "path", ")", ";", "}" ]
echo str > path. @param {String} path @param {String} str
[ "echo", "str", ">", "path", "." ]
480e0228740e85abf466a9d85e691c299dddec44
https://github.com/linnovate/mean-cli/blob/480e0228740e85abf466a9d85e691c299dddec44/lib/scaffold.js#L35-L38
33,135
linnovate/mean-cli
lib/scaffold.js
readTemplate
function readTemplate(path) { var template = fs.readFileSync(__dirname + '/templates/' + path, 'utf8'); for (var index in data) { template = template.split('__' + index + '__').join(data[index]); } return template; }
javascript
function readTemplate(path) { var template = fs.readFileSync(__dirname + '/templates/' + path, 'utf8'); for (var index in data) { template = template.split('__' + index + '__').join(data[index]); } return template; }
[ "function", "readTemplate", "(", "path", ")", "{", "var", "template", "=", "fs", ".", "readFileSync", "(", "__dirname", "+", "'/templates/'", "+", "path", ",", "'utf8'", ")", ";", "for", "(", "var", "index", "in", "data", ")", "{", "template", "=", "te...
Read template files @param {String} path
[ "Read", "template", "files" ]
480e0228740e85abf466a9d85e691c299dddec44
https://github.com/linnovate/mean-cli/blob/480e0228740e85abf466a9d85e691c299dddec44/lib/scaffold.js#L45-L51
33,136
linnovate/mean-cli
lib/scaffold.js
mkdir
function mkdir(path, fn) { shell.mkdir('-p', path); shell.chmod(755, path); console.log(chalk.cyan(' create:'), path); if (fn) fn(); }
javascript
function mkdir(path, fn) { shell.mkdir('-p', path); shell.chmod(755, path); console.log(chalk.cyan(' create:'), path); if (fn) fn(); }
[ "function", "mkdir", "(", "path", ",", "fn", ")", "{", "shell", ".", "mkdir", "(", "'-p'", ",", "path", ")", ";", "shell", ".", "chmod", "(", "755", ",", "path", ")", ";", "console", ".", "log", "(", "chalk", ".", "cyan", "(", "' create:'", ")"...
Mkdir -p. @param {String} path @param {Function} fn
[ "Mkdir", "-", "p", "." ]
480e0228740e85abf466a9d85e691c299dddec44
https://github.com/linnovate/mean-cli/blob/480e0228740e85abf466a9d85e691c299dddec44/lib/scaffold.js#L59-L64
33,137
cam-inc/riotx
index.js
function (store, evtName, handler) { var args = [], len = arguments.length - 3; while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ]; this._riotx_change_handlers.push({ store: store, evtName: evtName, handler: handler }); args.unshift(handler); args.unshift(evtName); sto...
javascript
function (store, evtName, handler) { var args = [], len = arguments.length - 3; while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ]; this._riotx_change_handlers.push({ store: store, evtName: evtName, handler: handler }); args.unshift(handler); args.unshift(evtName); sto...
[ "function", "(", "store", ",", "evtName", ",", "handler", ")", "{", "var", "args", "=", "[", "]", ",", "len", "=", "arguments", ".", "length", "-", "3", ";", "while", "(", "len", "--", ">", "0", ")", "args", "[", "len", "]", "=", "arguments", "...
add and keep event listener for store changes. through this function the event listeners will be unbinded automatically.
[ "add", "and", "keep", "event", "listener", "for", "store", "changes", ".", "through", "this", "function", "the", "event", "listeners", "will", "be", "unbinded", "automatically", "." ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/index.js#L692-L704
33,138
cam-inc/riotx
index.js
function () { var this$1 = this; // the context of `this` will be equal to riot tag instant. this.on('unmount', function () { this$1.off('*'); forEach_1(this$1._riotx_change_handlers, function (obj) { obj.store.off(obj.evtName, obj.handler); }); delete this$1...
javascript
function () { var this$1 = this; // the context of `this` will be equal to riot tag instant. this.on('unmount', function () { this$1.off('*'); forEach_1(this$1._riotx_change_handlers, function (obj) { obj.store.off(obj.evtName, obj.handler); }); delete this$1...
[ "function", "(", ")", "{", "var", "this$1", "=", "this", ";", "// the context of `this` will be equal to riot tag instant.", "this", ".", "on", "(", "'unmount'", ",", "function", "(", ")", "{", "this$1", ".", "off", "(", "'*'", ")", ";", "forEach_1", "(", "t...
intendedly use `function`. switch the context of `this` from `riotx` to `riot tag instance`.
[ "intendedly", "use", "function", ".", "switch", "the", "context", "of", "this", "from", "riotx", "to", "riot", "tag", "instance", "." ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/index.js#L710-L734
33,139
kawanet/from-xml
bin/xml2json.cli.js
readFromStream
function readFromStream(stream, callback) { var buf = []; stream.on("data", onData); stream.on("end", onEnd); stream.on("error", onError); function onData(data) { buf.push(data); } function onEnd() { if (callback) callback(null, buf.join("")); callback = null; } function onError(err) { ...
javascript
function readFromStream(stream, callback) { var buf = []; stream.on("data", onData); stream.on("end", onEnd); stream.on("error", onError); function onData(data) { buf.push(data); } function onEnd() { if (callback) callback(null, buf.join("")); callback = null; } function onError(err) { ...
[ "function", "readFromStream", "(", "stream", ",", "callback", ")", "{", "var", "buf", "=", "[", "]", ";", "stream", ".", "on", "(", "\"data\"", ",", "onData", ")", ";", "stream", ".", "on", "(", "\"end\"", ",", "onEnd", ")", ";", "stream", ".", "on...
Read all data from stream @param stream {Stream} @param callback {Function} function(err, str) {...} @license MIT @see https://gist.github.com/kawanet/c6c998b00500fe05eb8dfd0ee80deacf
[ "Read", "all", "data", "from", "stream" ]
340eb403c530d52196aacc3c569ba78943a17ef2
https://github.com/kawanet/from-xml/blob/340eb403c530d52196aacc3c569ba78943a17ef2/bin/xml2json.cli.js#L45-L64
33,140
wkallhof/Hazel
app/themes/default/public/scripts/edit.js
function($scope) { this.$scope = $scope; this.$markdownInput = $scope.find(SELECTORS.MARKDOWN_INPUT); this.$form = $scope.find(SELECTORS.FORM); this.$titleInput = $scope.find(SELECTORS.TITLE_INPUT); this.$deleteButton = $scope.find(SELECTORS.DELETE); this.dropzone = new Dropzone(SELECTORS.DROP...
javascript
function($scope) { this.$scope = $scope; this.$markdownInput = $scope.find(SELECTORS.MARKDOWN_INPUT); this.$form = $scope.find(SELECTORS.FORM); this.$titleInput = $scope.find(SELECTORS.TITLE_INPUT); this.$deleteButton = $scope.find(SELECTORS.DELETE); this.dropzone = new Dropzone(SELECTORS.DROP...
[ "function", "(", "$scope", ")", "{", "this", ".", "$scope", "=", "$scope", ";", "this", ".", "$markdownInput", "=", "$scope", ".", "find", "(", "SELECTORS", ".", "MARKDOWN_INPUT", ")", ";", "this", ".", "$form", "=", "$scope", ".", "find", "(", "SELECT...
Page View Class for the Document Edit page.
[ "Page", "View", "Class", "for", "the", "Document", "Edit", "page", "." ]
a4b4ebc3f513fe3d6107652e50ede955134cc961
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/themes/default/public/scripts/edit.js#L12-L24
33,141
wkallhof/Hazel
app/themes/default/public/scripts/edit.js
function (file, responseText) { console.log(responseText); // console should show the ID you pointed to // read the upload path from the elements data-upload attribute. var uploadPath = $(this.dropzone.element).data("upload") + responseText; var linkToUploadedFile = "(" + uploadPath + ")...
javascript
function (file, responseText) { console.log(responseText); // console should show the ID you pointed to // read the upload path from the elements data-upload attribute. var uploadPath = $(this.dropzone.element).data("upload") + responseText; var linkToUploadedFile = "(" + uploadPath + ")...
[ "function", "(", "file", ",", "responseText", ")", "{", "console", ".", "log", "(", "responseText", ")", ";", "// console should show the ID you pointed to", "// read the upload path from the elements data-upload attribute.", "var", "uploadPath", "=", "$", "(", "this", "....
Handle the event when the user successfully uploads a file via Dropzone @prop file [string] @prop responseText [string]
[ "Handle", "the", "event", "when", "the", "user", "successfully", "uploads", "a", "file", "via", "Dropzone" ]
a4b4ebc3f513fe3d6107652e50ede955134cc961
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/themes/default/public/scripts/edit.js#L38-L49
33,142
cam-inc/riotx
dist/amd.riotx+riot.js
add
function add(css, name) { if (name) { byName[name] = css; } else { remainder.push(css); } needsInject = true; }
javascript
function add(css, name) { if (name) { byName[name] = css; } else { remainder.push(css); } needsInject = true; }
[ "function", "add", "(", "css", ",", "name", ")", "{", "if", "(", "name", ")", "{", "byName", "[", "name", "]", "=", "css", ";", "}", "else", "{", "remainder", ".", "push", "(", "css", ")", ";", "}", "needsInject", "=", "true", ";", "}" ]
Save a tag style to be later injected into DOM @param { String } css - css string @param { String } name - if it's passed we will map the css to a tagname
[ "Save", "a", "tag", "style", "to", "be", "later", "injected", "into", "DOM" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L535-L539
33,143
cam-inc/riotx
dist/amd.riotx+riot.js
styleObjectToString
function styleObjectToString(style) { return Object.keys(style).reduce(function (acc, prop) { return (acc + " " + prop + ": " + (style[prop]) + ";") }, '') }
javascript
function styleObjectToString(style) { return Object.keys(style).reduce(function (acc, prop) { return (acc + " " + prop + ": " + (style[prop]) + ";") }, '') }
[ "function", "styleObjectToString", "(", "style", ")", "{", "return", "Object", ".", "keys", "(", "style", ")", ".", "reduce", "(", "function", "(", "acc", ",", "prop", ")", "{", "return", "(", "acc", "+", "\" \"", "+", "prop", "+", "\": \"", "+", "("...
Convert a style object to a string @param { Object } style - style object we need to parse @returns { String } resulting css string @example styleObjectToString({ color: 'red', height: '10px'}) // => 'color: red; height: 10px'
[ "Convert", "a", "style", "object", "to", "a", "string" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L1393-L1397
33,144
cam-inc/riotx
dist/amd.riotx+riot.js
arrayishAdd
function arrayishAdd(obj, key, value, ensureArray, index) { var dest = obj[key]; var isArr = isArray(dest); var hasIndex = !isUndefined(index); if (dest && dest === value) { return } // if the key was never set, set it once if (!dest && ensureArray) { obj[key] = [value]; } el...
javascript
function arrayishAdd(obj, key, value, ensureArray, index) { var dest = obj[key]; var isArr = isArray(dest); var hasIndex = !isUndefined(index); if (dest && dest === value) { return } // if the key was never set, set it once if (!dest && ensureArray) { obj[key] = [value]; } el...
[ "function", "arrayishAdd", "(", "obj", ",", "key", ",", "value", ",", "ensureArray", ",", "index", ")", "{", "var", "dest", "=", "obj", "[", "key", "]", ";", "var", "isArr", "=", "isArray", "(", "dest", ")", ";", "var", "hasIndex", "=", "!", "isUnd...
Set the property of an object for a given key. If something already exists there, then it becomes an array containing both the old and new value. @param { Object } obj - object on which to set the property @param { String } key - property name @param { Object } value - the value of the property to be set @param { Boole...
[ "Set", "the", "property", "of", "an", "object", "for", "a", "given", "key", ".", "If", "something", "already", "exists", "there", "then", "it", "becomes", "an", "array", "containing", "both", "the", "old", "and", "new", "value", "." ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L1631-L1657
33,145
cam-inc/riotx
dist/amd.riotx+riot.js
arrayishRemove
function arrayishRemove(obj, key, value, ensureArray) { if (isArray(obj[key])) { var index = obj[key].indexOf(value); if (index !== -1) { obj[key].splice(index, 1); } if (!obj[key].length) { delete obj[key]; } else if (obj[key].length === 1 && !ensureArray) { obj[key] = obj[key][0]...
javascript
function arrayishRemove(obj, key, value, ensureArray) { if (isArray(obj[key])) { var index = obj[key].indexOf(value); if (index !== -1) { obj[key].splice(index, 1); } if (!obj[key].length) { delete obj[key]; } else if (obj[key].length === 1 && !ensureArray) { obj[key] = obj[key][0]...
[ "function", "arrayishRemove", "(", "obj", ",", "key", ",", "value", ",", "ensureArray", ")", "{", "if", "(", "isArray", "(", "obj", "[", "key", "]", ")", ")", "{", "var", "index", "=", "obj", "[", "key", "]", ".", "indexOf", "(", "value", ")", ";...
Removes an item from an object at a given key. If the key points to an array, then the item is just removed from the array. @param { Object } obj - object on which to remove the property @param { String } key - property name @param { Object } value - the value of the property to be removed @param { Boolean } ensureArra...
[ "Removes", "an", "item", "from", "an", "object", "at", "a", "given", "key", ".", "If", "the", "key", "points", "to", "an", "array", "then", "the", "item", "is", "just", "removed", "from", "the", "array", "." ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L1905-L1913
33,146
cam-inc/riotx
dist/amd.riotx+riot.js
makeReplaceVirtual
function makeReplaceVirtual(tag, ref) { var frag = createFragment(); makeVirtual.call(tag, frag); ref.parentNode.replaceChild(frag, ref); }
javascript
function makeReplaceVirtual(tag, ref) { var frag = createFragment(); makeVirtual.call(tag, frag); ref.parentNode.replaceChild(frag, ref); }
[ "function", "makeReplaceVirtual", "(", "tag", ",", "ref", ")", "{", "var", "frag", "=", "createFragment", "(", ")", ";", "makeVirtual", ".", "call", "(", "tag", ",", "frag", ")", ";", "ref", ".", "parentNode", ".", "replaceChild", "(", "frag", ",", "re...
makes a tag virtual and replaces a reference in the dom @this Tag @param { tag } the tag to make virtual @param { ref } the dom reference location
[ "makes", "a", "tag", "virtual", "and", "replaces", "a", "reference", "in", "the", "dom" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L1955-L1959
33,147
cam-inc/riotx
dist/amd.riotx+riot.js
normalizeAttrName
function normalizeAttrName(attrName) { if (!attrName) { return null } attrName = attrName.replace(ATTRS_PREFIX, ''); if (CASE_SENSITIVE_ATTRIBUTES[attrName]) { attrName = CASE_SENSITIVE_ATTRIBUTES[attrName]; } return attrName }
javascript
function normalizeAttrName(attrName) { if (!attrName) { return null } attrName = attrName.replace(ATTRS_PREFIX, ''); if (CASE_SENSITIVE_ATTRIBUTES[attrName]) { attrName = CASE_SENSITIVE_ATTRIBUTES[attrName]; } return attrName }
[ "function", "normalizeAttrName", "(", "attrName", ")", "{", "if", "(", "!", "attrName", ")", "{", "return", "null", "}", "attrName", "=", "attrName", ".", "replace", "(", "ATTRS_PREFIX", ",", "''", ")", ";", "if", "(", "CASE_SENSITIVE_ATTRIBUTES", "[", "at...
Nomalize any attribute removing the "riot-" prefix @param { String } attrName - original attribute name @returns { String } valid html attribute name
[ "Nomalize", "any", "attribute", "removing", "the", "riot", "-", "prefix" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2030-L2035
33,148
cam-inc/riotx
dist/amd.riotx+riot.js
updateOpts
function updateOpts(isLoop, parent, isAnonymous, opts, instAttrs) { // isAnonymous `each` tags treat `dom` and `root` differently. In this case // (and only this case) we don't need to do updateOpts, because the regular parse // will update those attrs. Plus, isAnonymous tags don't need opts anyway ...
javascript
function updateOpts(isLoop, parent, isAnonymous, opts, instAttrs) { // isAnonymous `each` tags treat `dom` and `root` differently. In this case // (and only this case) we don't need to do updateOpts, because the regular parse // will update those attrs. Plus, isAnonymous tags don't need opts anyway ...
[ "function", "updateOpts", "(", "isLoop", ",", "parent", ",", "isAnonymous", ",", "opts", ",", "instAttrs", ")", "{", "// isAnonymous `each` tags treat `dom` and `root` differently. In this case", "// (and only this case) we don't need to do updateOpts, because the regular parse", "//...
We need to update opts for this tag. That requires updating the expressions in any attributes on the tag, and then copying the result onto opts. @this Tag @param {Boolean} isLoop - is it a loop tag? @param { Tag } parent - parent tag node @param { Boolean } isAnonymous - is it a tag without any impl? (a tag not...
[ "We", "need", "to", "update", "opts", "for", "this", "tag", ".", "That", "requires", "updating", "the", "expressions", "in", "any", "attributes", "on", "the", "tag", "and", "then", "copying", "the", "result", "onto", "opts", "." ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2178-L2190
33,149
cam-inc/riotx
dist/amd.riotx+riot.js
componentUpdate
function componentUpdate(tag, data, expressions) { var __ = tag.__; var nextOpts = {}; var canTrigger = tag.isMounted && !__.skipAnonymous; // inherit properties from the parent tag if (__.isAnonymous && __.parent) { extend(tag, __.parent); } extend(tag, data); updateOpts.app...
javascript
function componentUpdate(tag, data, expressions) { var __ = tag.__; var nextOpts = {}; var canTrigger = tag.isMounted && !__.skipAnonymous; // inherit properties from the parent tag if (__.isAnonymous && __.parent) { extend(tag, __.parent); } extend(tag, data); updateOpts.app...
[ "function", "componentUpdate", "(", "tag", ",", "data", ",", "expressions", ")", "{", "var", "__", "=", "tag", ".", "__", ";", "var", "nextOpts", "=", "{", "}", ";", "var", "canTrigger", "=", "tag", ".", "isMounted", "&&", "!", "__", ".", "skipAnonym...
Update the tag expressions and options @param { Tag } tag - tag object @param { * } data - data we want to use to extend the tag properties @param { Array } expressions - component expressions array @returns { Tag } the current tag instance
[ "Update", "the", "tag", "expressions", "and", "options" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2199-L2225
33,150
cam-inc/riotx
dist/amd.riotx+riot.js
componentMixin
function componentMixin(tag$$1) { var mixins = [], len = arguments.length - 1; while ( len-- > 0 ) mixins[ len ] = arguments[ len + 1 ]; each(mixins, function (mix) { var instance; var obj; var props = []; // properties blacklisted and will not be bound to the tag ins...
javascript
function componentMixin(tag$$1) { var mixins = [], len = arguments.length - 1; while ( len-- > 0 ) mixins[ len ] = arguments[ len + 1 ]; each(mixins, function (mix) { var instance; var obj; var props = []; // properties blacklisted and will not be bound to the tag ins...
[ "function", "componentMixin", "(", "tag$$1", ")", "{", "var", "mixins", "=", "[", "]", ",", "len", "=", "arguments", ".", "length", "-", "1", ";", "while", "(", "len", "--", ">", "0", ")", "mixins", "[", "len", "]", "=", "arguments", "[", "len", ...
Add a mixin to this tag @returns { Tag } the current tag instance
[ "Add", "a", "mixin", "to", "this", "tag" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2468-L2520
33,151
cam-inc/riotx
dist/amd.riotx+riot.js
remove
function remove(tags, i) { tags.splice(i, 1); this.unmount(); arrayishRemove(this.parent, this, this.__.tagName, true); }
javascript
function remove(tags, i) { tags.splice(i, 1); this.unmount(); arrayishRemove(this.parent, this, this.__.tagName, true); }
[ "function", "remove", "(", "tags", ",", "i", ")", "{", "tags", ".", "splice", "(", "i", ",", "1", ")", ";", "this", ".", "unmount", "(", ")", ";", "arrayishRemove", "(", "this", ".", "parent", ",", "this", ",", "this", ".", "__", ".", "tagName", ...
Remove a child tag @this Tag @param { Array } tags - tags collection @param { Number } i - index of the tag to remove
[ "Remove", "a", "child", "tag" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2608-L2612
33,152
cam-inc/riotx
dist/amd.riotx+riot.js
move
function move(root, nextTag, isVirtual) { if (isVirtual) { moveVirtual.apply(this, [root, nextTag]); } else { safeInsert(root, this.root, nextTag.root); } }
javascript
function move(root, nextTag, isVirtual) { if (isVirtual) { moveVirtual.apply(this, [root, nextTag]); } else { safeInsert(root, this.root, nextTag.root); } }
[ "function", "move", "(", "root", ",", "nextTag", ",", "isVirtual", ")", "{", "if", "(", "isVirtual", ")", "{", "moveVirtual", ".", "apply", "(", "this", ",", "[", "root", ",", "nextTag", "]", ")", ";", "}", "else", "{", "safeInsert", "(", "root", "...
Move a child tag @this Tag @param { HTMLElement } root - dom node containing all the loop children @param { Tag } nextTag - instance of the next tag preceding the one we want to move @param { Boolean } isVirtual - is it a virtual tag?
[ "Move", "a", "child", "tag" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2634-L2639
33,153
cam-inc/riotx
dist/amd.riotx+riot.js
insert
function insert(root, nextTag, isVirtual) { if (isVirtual) { makeVirtual.apply(this, [root, nextTag]); } else { safeInsert(root, this.root, nextTag.root); } }
javascript
function insert(root, nextTag, isVirtual) { if (isVirtual) { makeVirtual.apply(this, [root, nextTag]); } else { safeInsert(root, this.root, nextTag.root); } }
[ "function", "insert", "(", "root", ",", "nextTag", ",", "isVirtual", ")", "{", "if", "(", "isVirtual", ")", "{", "makeVirtual", ".", "apply", "(", "this", ",", "[", "root", ",", "nextTag", "]", ")", ";", "}", "else", "{", "safeInsert", "(", "root", ...
Insert and mount a child tag @this Tag @param { HTMLElement } root - dom node containing all the loop children @param { Tag } nextTag - instance of the next tag preceding the one we want to insert @param { Boolean } isVirtual - is it a virtual tag?
[ "Insert", "and", "mount", "a", "child", "tag" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2648-L2653
33,154
cam-inc/riotx
dist/amd.riotx+riot.js
append
function append(root, isVirtual) { if (isVirtual) { makeVirtual.call(this, root); } else { root.appendChild(this.root); } }
javascript
function append(root, isVirtual) { if (isVirtual) { makeVirtual.call(this, root); } else { root.appendChild(this.root); } }
[ "function", "append", "(", "root", ",", "isVirtual", ")", "{", "if", "(", "isVirtual", ")", "{", "makeVirtual", ".", "call", "(", "this", ",", "root", ")", ";", "}", "else", "{", "root", ".", "appendChild", "(", "this", ".", "root", ")", ";", "}", ...
Append a new tag into the DOM @this Tag @param { HTMLElement } root - dom node containing all the loop children @param { Boolean } isVirtual - is it a virtual tag?
[ "Append", "a", "new", "tag", "into", "the", "DOM" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2661-L2666
33,155
cam-inc/riotx
dist/amd.riotx+riot.js
getItemId
function getItemId(keyAttr, originalItem, keyedItem, hasKeyAttrExpr) { if (keyAttr) { return hasKeyAttrExpr ? tmpl(keyAttr, keyedItem) : originalItem[keyAttr] } return originalItem }
javascript
function getItemId(keyAttr, originalItem, keyedItem, hasKeyAttrExpr) { if (keyAttr) { return hasKeyAttrExpr ? tmpl(keyAttr, keyedItem) : originalItem[keyAttr] } return originalItem }
[ "function", "getItemId", "(", "keyAttr", ",", "originalItem", ",", "keyedItem", ",", "hasKeyAttrExpr", ")", "{", "if", "(", "keyAttr", ")", "{", "return", "hasKeyAttrExpr", "?", "tmpl", "(", "keyAttr", ",", "keyedItem", ")", ":", "originalItem", "[", "keyAtt...
Return the value we want to use to lookup the postion of our items in the collection @param { String } keyAttr - lookup string or expression @param { * } originalItem - original item from the collection @param { Object } keyedItem - object created by riot via { item, i in collection } @pa...
[ "Return", "the", "value", "we", "want", "to", "use", "to", "lookup", "the", "postion", "of", "our", "items", "in", "the", "collection" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2676-L2682
33,156
cam-inc/riotx
dist/amd.riotx+riot.js
createRefDirective
function createRefDirective(dom, tag, attrName, attrValue) { return create(RefExpr).init(dom, tag, attrName, attrValue) }
javascript
function createRefDirective(dom, tag, attrName, attrValue) { return create(RefExpr).init(dom, tag, attrName, attrValue) }
[ "function", "createRefDirective", "(", "dom", ",", "tag", ",", "attrName", ",", "attrValue", ")", "{", "return", "create", "(", "RefExpr", ")", ".", "init", "(", "dom", ",", "tag", ",", "attrName", ",", "attrValue", ")", "}" ]
Create a new ref directive @param { HTMLElement } dom - dom node having the ref attribute @param { Tag } context - tag instance where the DOM node is located @param { String } attrName - either 'ref' or 'data-ref' @param { String } attrValue - value of the ref attribute @returns { RefExpr } a new RefExpr object
[ "Create", "a", "new", "ref", "directive" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2896-L2898
33,157
cam-inc/riotx
dist/amd.riotx+riot.js
createIfDirective
function createIfDirective(dom, tag, attr) { return create(IfExpr).init(dom, tag, attr) }
javascript
function createIfDirective(dom, tag, attr) { return create(IfExpr).init(dom, tag, attr) }
[ "function", "createIfDirective", "(", "dom", ",", "tag", ",", "attr", ")", "{", "return", "create", "(", "IfExpr", ")", ".", "init", "(", "dom", ",", "tag", ",", "attr", ")", "}" ]
Create a new if directive @param { HTMLElement } dom - if root dom node @param { Tag } context - tag instance where the DOM node is located @param { String } attr - if expression @returns { IFExpr } a new IfExpr object
[ "Create", "a", "new", "if", "directive" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2954-L2956
33,158
cam-inc/riotx
dist/amd.riotx+riot.js
parseExpressions
function parseExpressions(root, mustIncludeRoot) { var this$1 = this; var expressions = []; walkNodes(root, function (dom) { var type = dom.nodeType; var attr; var tagImpl; if (!mustIncludeRoot && dom === root) { return } // text node if (type === 3 ...
javascript
function parseExpressions(root, mustIncludeRoot) { var this$1 = this; var expressions = []; walkNodes(root, function (dom) { var type = dom.nodeType; var attr; var tagImpl; if (!mustIncludeRoot && dom === root) { return } // text node if (type === 3 ...
[ "function", "parseExpressions", "(", "root", ",", "mustIncludeRoot", ")", "{", "var", "this$1", "=", "this", ";", "var", "expressions", "=", "[", "]", ";", "walkNodes", "(", "root", ",", "function", "(", "dom", ")", "{", "var", "type", "=", "dom", ".",...
Walk the tag DOM to detect the expressions to evaluate @this Tag @param { HTMLElement } root - root tag where we will start digging the expressions @param { Boolean } mustIncludeRoot - flag to decide whether the root must be parsed as well @returns { Array } all the expressions found
[ "Walk", "the", "tag", "DOM", "to", "detect", "the", "expressions", "to", "evaluate" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L2965-L3060
33,159
cam-inc/riotx
dist/amd.riotx+riot.js
setMountState
function setMountState(value) { var ref = this.__; var isAnonymous = ref.isAnonymous; define(this, 'isMounted', value); if (!isAnonymous) { if (value) { this.trigger('mount'); } else { this.trigger('unmount'); this.off('*'); this.__.wasCreated = fa...
javascript
function setMountState(value) { var ref = this.__; var isAnonymous = ref.isAnonymous; define(this, 'isMounted', value); if (!isAnonymous) { if (value) { this.trigger('mount'); } else { this.trigger('unmount'); this.off('*'); this.__.wasCreated = fa...
[ "function", "setMountState", "(", "value", ")", "{", "var", "ref", "=", "this", ".", "__", ";", "var", "isAnonymous", "=", "ref", ".", "isAnonymous", ";", "define", "(", "this", ",", "'isMounted'", ",", "value", ")", ";", "if", "(", "!", "isAnonymous",...
Manage the mount state of a tag triggering also the observable events @this Tag @param { Boolean } value - ..of the isMounted flag
[ "Manage", "the", "mount", "state", "of", "a", "tag", "triggering", "also", "the", "observable", "events" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L3095-L3109
33,160
cam-inc/riotx
dist/amd.riotx+riot.js
componentMount
function componentMount(tag$$1, dom, expressions, opts) { var __ = tag$$1.__; var root = __.root; root._tag = tag$$1; // keep a reference to the tag just created // Read all the attrs on this instance. This give us the info we need for updateOpts parseAttributes.apply(__.parent, [root, ro...
javascript
function componentMount(tag$$1, dom, expressions, opts) { var __ = tag$$1.__; var root = __.root; root._tag = tag$$1; // keep a reference to the tag just created // Read all the attrs on this instance. This give us the info we need for updateOpts parseAttributes.apply(__.parent, [root, ro...
[ "function", "componentMount", "(", "tag$$1", ",", "dom", ",", "expressions", ",", "opts", ")", "{", "var", "__", "=", "tag$$1", ".", "__", ";", "var", "root", "=", "__", ".", "root", ";", "root", ".", "_tag", "=", "tag$$1", ";", "// keep a reference to...
Mount the current tag instance @returns { Tag } the current tag instance
[ "Mount", "the", "current", "tag", "instance" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L3115-L3177
33,161
cam-inc/riotx
dist/amd.riotx+riot.js
tagUnmount
function tagUnmount(tag, mustKeepRoot, expressions) { var __ = tag.__; var root = __.root; var tagIndex = __TAGS_CACHE.indexOf(tag); var p = root.parentNode; if (!__.skipAnonymous) { tag.trigger('before-unmount'); } // clear all attributes coming from the mounted tag walkAttr...
javascript
function tagUnmount(tag, mustKeepRoot, expressions) { var __ = tag.__; var root = __.root; var tagIndex = __TAGS_CACHE.indexOf(tag); var p = root.parentNode; if (!__.skipAnonymous) { tag.trigger('before-unmount'); } // clear all attributes coming from the mounted tag walkAttr...
[ "function", "tagUnmount", "(", "tag", ",", "mustKeepRoot", ",", "expressions", ")", "{", "var", "__", "=", "tag", ".", "__", ";", "var", "root", "=", "__", ".", "root", ";", "var", "tagIndex", "=", "__TAGS_CACHE", ".", "indexOf", "(", "tag", ")", ";"...
Unmount the tag instance @param { Boolean } mustKeepRoot - if it's true the root node will not be removed @returns { Tag } the current tag instance
[ "Unmount", "the", "tag", "instance" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L3184-L3252
33,162
cam-inc/riotx
dist/amd.riotx+riot.js
function () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; if (!settings$2.debug) { return; } args.unshift('DEBUG'); settings$2.logger.output.apply(null, args); }
javascript
function () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; if (!settings$2.debug) { return; } args.unshift('DEBUG'); settings$2.logger.output.apply(null, args); }
[ "function", "(", ")", "{", "var", "args", "=", "[", "]", ",", "len", "=", "arguments", ".", "length", ";", "while", "(", "len", "--", ")", "args", "[", "len", "]", "=", "arguments", "[", "len", "]", ";", "if", "(", "!", "settings$2", ".", "debu...
console debug output @param {*} args
[ "console", "debug", "output" ]
8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4
https://github.com/cam-inc/riotx/blob/8fb6b71e7a65e9a589dfe02f1dc4876c47516ec4/dist/amd.riotx+riot.js#L3458-L3467
33,163
freiksenet/react-kinetic
src/KineticProperty.js
injectKineticProperties
function injectKineticProperties (kineticConfig, kineticHierarchy, kineticEvents) { for (var type in kineticHierarchy) { var parents = kineticHierarchy[type]; KineticProperty.getParents[type] = [type].concat(parents); for (var pi in paren...
javascript
function injectKineticProperties (kineticConfig, kineticHierarchy, kineticEvents) { for (var type in kineticHierarchy) { var parents = kineticHierarchy[type]; KineticProperty.getParents[type] = [type].concat(parents); for (var pi in paren...
[ "function", "injectKineticProperties", "(", "kineticConfig", ",", "kineticHierarchy", ",", "kineticEvents", ")", "{", "for", "(", "var", "type", "in", "kineticHierarchy", ")", "{", "var", "parents", "=", "kineticHierarchy", "[", "type", "]", ";", "KineticProperty"...
Inject Kinetic property infos to KineticProperty. @param {object} kineticConfig should be an object with keys as property names and values as objects of 'type', 'defaultValue', 'nodeType'. @param {object} kineticHierarchy should be a object with nodeType as key and list of nodeType parents as values. @param {object...
[ "Inject", "Kinetic", "property", "infos", "to", "KineticProperty", "." ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/src/KineticProperty.js#L15-L54
33,164
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]); var m0 = this.m[3] * d; var m1 = -this.m[1] * d; var m2 = -this.m[2] * d; var m3 = this.m[0] * d; var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]); va...
javascript
function() { var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]); var m0 = this.m[3] * d; var m1 = -this.m[1] * d; var m2 = -this.m[2] * d; var m3 = this.m[0] * d; var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]); va...
[ "function", "(", ")", "{", "var", "d", "=", "1", "/", "(", "this", ".", "m", "[", "0", "]", "*", "this", ".", "m", "[", "3", "]", "-", "this", ".", "m", "[", "1", "]", "*", "this", ".", "m", "[", "2", "]", ")", ";", "var", "m0", "=", ...
Invert the matrix @method @memberof Kinetic.Transform.prototype @returns {Kinetic.Transform}
[ "Invert", "the", "matrix" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L789-L804
33,165
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(x, y) { var m0 = this.m[0], m1 = this.m[1], m2 = this.m[2], m3 = this.m[3], m4 = this.m[4], m5 = this.m[5], yt = ((m0 * (y - m5)) - (m1 * (x - m4))) / ((m0 * m3) - (m1 * m2)), xt = (x - m...
javascript
function(x, y) { var m0 = this.m[0], m1 = this.m[1], m2 = this.m[2], m3 = this.m[3], m4 = this.m[4], m5 = this.m[5], yt = ((m0 * (y - m5)) - (m1 * (x - m4))) / ((m0 * m3) - (m1 * m2)), xt = (x - m...
[ "function", "(", "x", ",", "y", ")", "{", "var", "m0", "=", "this", ".", "m", "[", "0", "]", ",", "m1", "=", "this", ".", "m", "[", "1", "]", ",", "m2", "=", "this", ".", "m", "[", "2", "]", ",", "m3", "=", "this", ".", "m", "[", "3",...
set to absolute position via translation @method @memberof Kinetic.Transform.prototype @returns {Kinetic.Transform} @author ericdrowell
[ "set", "to", "absolute", "position", "via", "translation" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L820-L831
33,166
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var randColor = (Math.random() * 0xFFFFFF << 0).toString(16); while (randColor.length < 6) { randColor = ZERO + randColor; } return HASH + randColor; }
javascript
function() { var randColor = (Math.random() * 0xFFFFFF << 0).toString(16); while (randColor.length < 6) { randColor = ZERO + randColor; } return HASH + randColor; }
[ "function", "(", ")", "{", "var", "randColor", "=", "(", "Math", ".", "random", "(", ")", "*", "0xFFFFFF", "<<", "0", ")", ".", "toString", "(", "16", ")", ";", "while", "(", "randColor", ".", "length", "<", "6", ")", "{", "randColor", "=", "ZERO...
return random hex color @method @memberof Kinetic.Util.prototype
[ "return", "random", "hex", "color" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1056-L1062
33,167
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(color) { var rgb; // color string if (color in COLORS) { rgb = COLORS[color]; return { r: rgb[0], g: rgb[1], b: rgb[2] }; } // hex ...
javascript
function(color) { var rgb; // color string if (color in COLORS) { rgb = COLORS[color]; return { r: rgb[0], g: rgb[1], b: rgb[2] }; } // hex ...
[ "function", "(", "color", ")", "{", "var", "rgb", ";", "// color string", "if", "(", "color", "in", "COLORS", ")", "{", "rgb", "=", "COLORS", "[", "color", "]", ";", "return", "{", "r", ":", "rgb", "[", "0", "]", ",", "g", ":", "rgb", "[", "1",...
get RGB components of a color @method @memberof Kinetic.Util.prototype @param {String} color @example // each of the following examples return {r:0, g:0, b:255}<br> var rgb = Kinetic.Util.getRGB('blue');<br> var rgb = Kinetic.Util.getRGB('#0000ff');<br> var rgb = Kinetic.Util.getRGB('rgb(0,0,255)');
[ "get", "RGB", "components", "of", "a", "color" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1087-L1119
33,168
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(o1, o2) { var retObj = this._clone(o2); for(var key in o1) { if(this._isObject(o1[key])) { retObj[key] = this._merge(o1[key], retObj[key]); } else { retObj[key] = o1[key]; } ...
javascript
function(o1, o2) { var retObj = this._clone(o2); for(var key in o1) { if(this._isObject(o1[key])) { retObj[key] = this._merge(o1[key], retObj[key]); } else { retObj[key] = o1[key]; } ...
[ "function", "(", "o1", ",", "o2", ")", "{", "var", "retObj", "=", "this", ".", "_clone", "(", "o2", ")", ";", "for", "(", "var", "key", "in", "o1", ")", "{", "if", "(", "this", ".", "_isObject", "(", "o1", "[", "key", "]", ")", ")", "{", "r...
o1 takes precedence over o2
[ "o1", "takes", "precedence", "over", "o2" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1121-L1132
33,169
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(constructor, methods) { var key; for (key in methods) { constructor.prototype[key] = methods[key]; } }
javascript
function(constructor, methods) { var key; for (key in methods) { constructor.prototype[key] = methods[key]; } }
[ "function", "(", "constructor", ",", "methods", ")", "{", "var", "key", ";", "for", "(", "key", "in", "methods", ")", "{", "constructor", ".", "prototype", "[", "key", "]", "=", "methods", "[", "key", "]", ";", "}", "}" ]
adds methods to a constructor prototype @method @memberof Kinetic.Util.prototype @param {Function} constructor @param {Object} methods
[ "adds", "methods", "to", "a", "constructor", "prototype" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1185-L1191
33,170
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(mimeType, quality) { try { // If this call fails (due to browser bug, like in Firefox 3.6), // then revert to previous no-parameter image/png behavior return this._canvas.toDataURL(mimeType, quality); } catch(e) { ...
javascript
function(mimeType, quality) { try { // If this call fails (due to browser bug, like in Firefox 3.6), // then revert to previous no-parameter image/png behavior return this._canvas.toDataURL(mimeType, quality); } catch(e) { ...
[ "function", "(", "mimeType", ",", "quality", ")", "{", "try", "{", "// If this call fails (due to browser bug, like in Firefox 3.6),", "// then revert to previous no-parameter image/png behavior", "return", "this", ".", "_canvas", ".", "toDataURL", "(", "mimeType", ",", "qual...
to data url @method @memberof Kinetic.Canvas.prototype @param {String} mimeType @param {Number} quality between 0 and 1 for jpg mime types @returns {String} data url string
[ "to", "data", "url" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1376-L1391
33,171
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(shape) { var fillEnabled = shape.getFillEnabled(); if(fillEnabled) { this._fill(shape); } if(shape.getStrokeEnabled()) { this._stroke(shape); } }
javascript
function(shape) { var fillEnabled = shape.getFillEnabled(); if(fillEnabled) { this._fill(shape); } if(shape.getStrokeEnabled()) { this._stroke(shape); } }
[ "function", "(", "shape", ")", "{", "var", "fillEnabled", "=", "shape", ".", "getFillEnabled", "(", ")", ";", "if", "(", "fillEnabled", ")", "{", "this", ".", "_fill", "(", "shape", ")", ";", "}", "if", "(", "shape", ".", "getStrokeEnabled", "(", ")"...
fill then stroke @method @memberof Kinetic.Context.prototype @param {Kinetic.Shape} shape
[ "fill", "then", "stroke" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1526-L1534
33,172
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(relaxed) { var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args; for (n=0; n<len; n++) { trace = traceArr[n]; method = trace.method; // methods ...
javascript
function(relaxed) { var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args; for (n=0; n<len; n++) { trace = traceArr[n]; method = trace.method; // methods ...
[ "function", "(", "relaxed", ")", "{", "var", "traceArr", "=", "this", ".", "traceArr", ",", "len", "=", "traceArr", ".", "length", ",", "str", "=", "''", ",", "n", ",", "trace", ",", "method", ",", "args", ";", "for", "(", "n", "=", "0", ";", "...
get context trace if trace is enabled @method @memberof Kinetic.Context.prototype @param {Boolean} relaxed if false, return strict context trace, which includes method names, method parameters properties, and property values. If true, return relaxed context trace, which only returns method names and properites. @retur...
[ "get", "context", "trace", "if", "trace", "is", "enabled" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1544-L1582
33,173
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var a = arguments; this._context.arc(a[0], a[1], a[2], a[3], a[4], a[5]); }
javascript
function() { var a = arguments; this._context.arc(a[0], a[1], a[2], a[3], a[4], a[5]); }
[ "function", "(", ")", "{", "var", "a", "=", "arguments", ";", "this", ".", "_context", ".", "arc", "(", "a", "[", "0", "]", ",", "a", "[", "1", "]", ",", "a", "[", "2", "]", ",", "a", "[", "3", "]", ",", "a", "[", "4", "]", ",", "a", ...
context pass through methods
[ "context", "pass", "through", "methods" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1663-L1666
33,174
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(methodName) { var origMethod = that[methodName], ret; that[methodName] = function() { args = _simplifyArray(Array.prototype.slice.call(arguments, 0)); ret = origMethod.apply(that, arguments); ...
javascript
function(methodName) { var origMethod = that[methodName], ret; that[methodName] = function() { args = _simplifyArray(Array.prototype.slice.call(arguments, 0)); ret = origMethod.apply(that, arguments); ...
[ "function", "(", "methodName", ")", "{", "var", "origMethod", "=", "that", "[", "methodName", "]", ",", "ret", ";", "that", "[", "methodName", "]", "=", "function", "(", ")", "{", "args", "=", "_simplifyArray", "(", "Array", ".", "prototype", ".", "sli...
to prevent creating scope function at each loop
[ "to", "prevent", "creating", "scope", "function", "at", "each", "loop" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L1810-L1825
33,175
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(evt) { var e = { target: this, type: evt.type, evt: evt }; this.fire(evt.type, e); }
javascript
function(evt) { var e = { target: this, type: evt.type, evt: evt }; this.fire(evt.type, e); }
[ "function", "(", "evt", ")", "{", "var", "e", "=", "{", "target", ":", "this", ",", "type", ":", "evt", ".", "type", ",", "evt", ":", "evt", "}", ";", "this", ".", "fire", "(", "evt", ".", "type", ",", "e", ")", ";", "}" ]
some event aliases for third party integration like HammerJS
[ "some", "event", "aliases", "for", "third", "party", "integration", "like", "HammerJS" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2608-L2615
33,176
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var parent = this.getParent(); if(parent && parent.children) { parent.children.splice(this.index, 1); parent._setChildrenIndices(); delete this.parent; } // every cached attr that is calculated via node tree ...
javascript
function() { var parent = this.getParent(); if(parent && parent.children) { parent.children.splice(this.index, 1); parent._setChildrenIndices(); delete this.parent; } // every cached attr that is calculated via node tree ...
[ "function", "(", ")", "{", "var", "parent", "=", "this", ".", "getParent", "(", ")", ";", "if", "(", "parent", "&&", "parent", ".", "children", ")", "{", "parent", ".", "children", ".", "splice", "(", "this", ".", "index", ",", "1", ")", ";", "pa...
remove self from parent, but don't destroy @method @memberof Kinetic.Node.prototype @returns {Kinetic.Node} @example node.remove();
[ "remove", "self", "from", "parent", "but", "don", "t", "destroy" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2630-L2648
33,177
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(config) { var key, method; if(config) { for(key in config) { if (key === CHILDREN) { } else { method = SET + Kinetic.Util._capitalize(key); // use setter if avai...
javascript
function(config) { var key, method; if(config) { for(key in config) { if (key === CHILDREN) { } else { method = SET + Kinetic.Util._capitalize(key); // use setter if avai...
[ "function", "(", "config", ")", "{", "var", "key", ",", "method", ";", "if", "(", "config", ")", "{", "for", "(", "key", "in", "config", ")", "{", "if", "(", "key", "===", "CHILDREN", ")", "{", "}", "else", "{", "method", "=", "SET", "+", "Kine...
set multiple attrs at once using an object literal @method @memberof Kinetic.Node.prototype @param {Object} config object containing key value pairs @returns {Kinetic.Node} @example node.setAttrs({<br> x: 5,<br> fill: 'red'<br> });<br>
[ "set", "multiple", "attrs", "at", "once", "using", "an", "object", "literal" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2724-L2746
33,178
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child; function addChildren(children) { nodes = []; len = children.length; for(n = 0; n < len; n++) { ...
javascript
function() { var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child; function addChildren(children) { nodes = []; len = children.length; for(n = 0; n < len; n++) { ...
[ "function", "(", ")", "{", "var", "depth", "=", "this", ".", "getDepth", "(", ")", ",", "that", "=", "this", ",", "index", "=", "0", ",", "nodes", ",", "len", ",", "n", ",", "child", ";", "function", "addChildren", "(", "children", ")", "{", "nod...
get absolute z-index which takes into account sibling and ancestor indices @method @memberof Kinetic.Node.prototype @returns {Integer}
[ "get", "absolute", "z", "-", "index", "which", "takes", "into", "account", "sibling", "and", "ancestor", "indices" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2874-L2905
33,179
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var absoluteMatrix = this.getAbsoluteTransform().getMatrix(), absoluteTransform = new Kinetic.Transform(), offset = this.offset(); // clone the matrix array absoluteTransform.m = absoluteMatrix.slice(); absoluteTransform.trans...
javascript
function() { var absoluteMatrix = this.getAbsoluteTransform().getMatrix(), absoluteTransform = new Kinetic.Transform(), offset = this.offset(); // clone the matrix array absoluteTransform.m = absoluteMatrix.slice(); absoluteTransform.trans...
[ "function", "(", ")", "{", "var", "absoluteMatrix", "=", "this", ".", "getAbsoluteTransform", "(", ")", ".", "getMatrix", "(", ")", ",", "absoluteTransform", "=", "new", "Kinetic", ".", "Transform", "(", ")", ",", "offset", "=", "this", ".", "offset", "(...
get absolute position relative to the top left corner of the stage container div @method @memberof Kinetic.Node.prototype @returns {Object}
[ "get", "absolute", "position", "relative", "to", "the", "top", "left", "corner", "of", "the", "stage", "container", "div" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2941-L2951
33,180
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(pos) { var origTrans = this._clearTransform(), it; // don't clear translation this.attrs.x = origTrans.x; this.attrs.y = origTrans.y; delete origTrans.x; delete origTrans.y; // unravel transform it...
javascript
function(pos) { var origTrans = this._clearTransform(), it; // don't clear translation this.attrs.x = origTrans.x; this.attrs.y = origTrans.y; delete origTrans.x; delete origTrans.y; // unravel transform it...
[ "function", "(", "pos", ")", "{", "var", "origTrans", "=", "this", ".", "_clearTransform", "(", ")", ",", "it", ";", "// don't clear translation", "this", ".", "attrs", ".", "x", "=", "origTrans", ".", "x", ";", "this", ".", "attrs", ".", "y", "=", "...
set absolute position @method @memberof Kinetic.Node.prototype @param {Object} pos @param {Number} pos.x @param {Number} pos.y @returns {Kinetic.Node}
[ "set", "absolute", "position" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L2961-L2985
33,181
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(change) { var changeX = change.x, changeY = change.y, x = this.getX(), y = this.getY(); if(changeX !== undefined) { x += changeX; } if(changeY !== undefined) { y += changeY; ...
javascript
function(change) { var changeX = change.x, changeY = change.y, x = this.getX(), y = this.getY(); if(changeX !== undefined) { x += changeX; } if(changeY !== undefined) { y += changeY; ...
[ "function", "(", "change", ")", "{", "var", "changeX", "=", "change", ".", "x", ",", "changeY", "=", "change", ".", "y", ",", "x", "=", "this", ".", "getX", "(", ")", ",", "y", "=", "this", ".", "getY", "(", ")", ";", "if", "(", "changeX", "!...
move node by an amount relative to its current position @method @memberof Kinetic.Node.prototype @param {Object} change @param {Number} change.x @param {Number} change.y @returns {Kinetic.Node} @example // move node in x direction by 1px and y direction by 2px<br> node.move({<br> x: 1,<br> y: 2)<br> });
[ "move", "node", "by", "an", "amount", "relative", "to", "its", "current", "position" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3040-L3056
33,182
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { if (!this.parent) { Kinetic.Util.warn('Node has no parent. moveToTop function is ignored.'); return; } var index = this.index; this.parent.children.splice(index, 1); this.parent.children.push(this); this...
javascript
function() { if (!this.parent) { Kinetic.Util.warn('Node has no parent. moveToTop function is ignored.'); return; } var index = this.index; this.parent.children.splice(index, 1); this.parent.children.push(this); this...
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "parent", ")", "{", "Kinetic", ".", "Util", ".", "warn", "(", "'Node has no parent. moveToTop function is ignored.'", ")", ";", "return", ";", "}", "var", "index", "=", "this", ".", "index", ";", "t...
move node to the top of its siblings @method @memberof Kinetic.Node.prototype @returns {Boolean}
[ "move", "node", "to", "the", "top", "of", "its", "siblings" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3099-L3109
33,183
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { if (!this.parent) { Kinetic.Util.warn('Node has no parent. moveUp function is ignored.'); return; } var index = this.index, len = this.parent.getChildren().length; if(index < len - 1) { this.pare...
javascript
function() { if (!this.parent) { Kinetic.Util.warn('Node has no parent. moveUp function is ignored.'); return; } var index = this.index, len = this.parent.getChildren().length; if(index < len - 1) { this.pare...
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "parent", ")", "{", "Kinetic", ".", "Util", ".", "warn", "(", "'Node has no parent. moveUp function is ignored.'", ")", ";", "return", ";", "}", "var", "index", "=", "this", ".", "index", ",", "len"...
move node up @method @memberof Kinetic.Node.prototype @returns {Boolean}
[ "move", "node", "up" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3116-L3130
33,184
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(zIndex) { if (!this.parent) { Kinetic.Util.warn('Node has no parent. zIndex parameter is ignored.'); return; } var index = this.index; this.parent.children.splice(index, 1); this.parent.children.splice(zIndex, 0, this);...
javascript
function(zIndex) { if (!this.parent) { Kinetic.Util.warn('Node has no parent. zIndex parameter is ignored.'); return; } var index = this.index; this.parent.children.splice(index, 1); this.parent.children.splice(zIndex, 0, this);...
[ "function", "(", "zIndex", ")", "{", "if", "(", "!", "this", ".", "parent", ")", "{", "Kinetic", ".", "Util", ".", "warn", "(", "'Node has no parent. zIndex parameter is ignored.'", ")", ";", "return", ";", "}", "var", "index", "=", "this", ".", "index", ...
set zIndex relative to siblings @method @memberof Kinetic.Node.prototype @param {Integer} zIndex @returns {Kinetic.Node}
[ "set", "zIndex", "relative", "to", "siblings" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3178-L3188
33,185
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var type = Kinetic.Util, obj = {}, attrs = this.getAttrs(), key, val, getter, defaultValue; obj.attrs = {}; // serialize only attributes that are not function, image, DOM, or objects with methods for(key in at...
javascript
function() { var type = Kinetic.Util, obj = {}, attrs = this.getAttrs(), key, val, getter, defaultValue; obj.attrs = {}; // serialize only attributes that are not function, image, DOM, or objects with methods for(key in at...
[ "function", "(", ")", "{", "var", "type", "=", "Kinetic", ".", "Util", ",", "obj", "=", "{", "}", ",", "attrs", "=", "this", ".", "getAttrs", "(", ")", ",", "key", ",", "val", ",", "getter", ",", "defaultValue", ";", "obj", ".", "attrs", "=", "...
convert Node into an object for serialization. Returns an object. @method @memberof Kinetic.Node.prototype @returns {Object}
[ "convert", "Node", "into", "an", "object", "for", "serialization", ".", "Returns", "an", "object", "." ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3226-L3252
33,186
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(config) { Kinetic.Util._getImage(this.toDataURL(config), function(img) { config.callback(img); }); }
javascript
function(config) { Kinetic.Util._getImage(this.toDataURL(config), function(img) { config.callback(img); }); }
[ "function", "(", "config", ")", "{", "Kinetic", ".", "Util", ".", "_getImage", "(", "this", ".", "toDataURL", "(", "config", ")", ",", "function", "(", "img", ")", "{", "config", ".", "callback", "(", "img", ")", ";", "}", ")", ";", "}" ]
converts node into an image. Since the toImage method is asynchronous, a callback is required. toImage is most commonly used to cache complex drawings as an image so that they don't have to constantly be redrawn @method @memberof Kinetic.Node.prototype @param {Object} config @param {Function} config.callback function...
[ "converts", "node", "into", "an", "image", ".", "Since", "the", "toImage", "method", "is", "asynchronous", "a", "callback", "is", "required", ".", "toImage", "is", "most", "commonly", "used", "to", "cache", "complex", "drawings", "as", "an", "image", "so", ...
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L3530-L3534
33,187
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(layers) { var lays = []; // if passing in no layers if (!layers) { lays = []; } // if passing in an array of Layers // NOTE: layers could be an array or Kinetic.Collection. for simplicity, I'm just inspecting /...
javascript
function(layers) { var lays = []; // if passing in no layers if (!layers) { lays = []; } // if passing in an array of Layers // NOTE: layers could be an array or Kinetic.Collection. for simplicity, I'm just inspecting /...
[ "function", "(", "layers", ")", "{", "var", "lays", "=", "[", "]", ";", "// if passing in no layers", "if", "(", "!", "layers", ")", "{", "lays", "=", "[", "]", ";", "}", "// if passing in an array of Layers", "// NOTE: layers could be an array or Kinetic.Collection...
set layers to be redrawn on each animation frame @method @memberof Kinetic.Animation.prototype @param {Kinetic.Layer|Array} [layers] layer(s) to be redrawn.&nbsp; Can be a layer, an array of layers, or null. Not specifying a node will result in no redraw.
[ "set", "layers", "to", "be", "redrawn", "on", "each", "animation", "frame" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L6039-L6057
33,188
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(layer) { var layers = this.layers, len, n; if (layers) { len = layers.length; // don't add the layer if it already exists for (n = 0; n < len; n++) { if (layers[n]._id === layer._id) { ...
javascript
function(layer) { var layers = this.layers, len, n; if (layers) { len = layers.length; // don't add the layer if it already exists for (n = 0; n < len; n++) { if (layers[n]._id === layer._id) { ...
[ "function", "(", "layer", ")", "{", "var", "layers", "=", "this", ".", "layers", ",", "len", ",", "n", ";", "if", "(", "layers", ")", "{", "len", "=", "layers", ".", "length", ";", "// don't add the layer if it already exists", "for", "(", "n", "=", "0...
add layer. Returns true if the layer was added, and false if it was not @method @memberof Kinetic.Animation.prototype @param {Kinetic.Layer} layer
[ "add", "layer", ".", "Returns", "true", "if", "the", "layer", "was", "added", "and", "false", "if", "it", "was", "not" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L6072-L6092
33,189
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var a = Kinetic.Animation, animations = a.animations, len = animations.length, n; for(n = 0; n < len; n++) { if(animations[n].id === this.id) { return true; } } ...
javascript
function() { var a = Kinetic.Animation, animations = a.animations, len = animations.length, n; for(n = 0; n < len; n++) { if(animations[n].id === this.id) { return true; } } ...
[ "function", "(", ")", "{", "var", "a", "=", "Kinetic", ".", "Animation", ",", "animations", "=", "a", ".", "animations", ",", "len", "=", "animations", ".", "length", ",", "n", ";", "for", "(", "n", "=", "0", ";", "n", "<", "len", ";", "n", "++...
determine if animation is running or not. returns true or false @method @memberof Kinetic.Animation.prototype
[ "determine", "if", "animation", "is", "running", "or", "not", ".", "returns", "true", "or", "false" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L6098-L6110
33,190
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(t, b, c, d) { return c - Kinetic.Easings.BounceEaseOut(d - t, 0, c, d) + b; }
javascript
function(t, b, c, d) { return c - Kinetic.Easings.BounceEaseOut(d - t, 0, c, d) + b; }
[ "function", "(", "t", ",", "b", ",", "c", ",", "d", ")", "{", "return", "c", "-", "Kinetic", ".", "Easings", ".", "BounceEaseOut", "(", "d", "-", "t", ",", "0", ",", "c", ",", "d", ")", "+", "b", ";", "}" ]
bounce ease in @function @memberof Kinetic.Easings
[ "bounce", "ease", "in" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L6778-L6780
33,191
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(t, b, c, d) { if(t < d / 2) { return Kinetic.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b; } else { return Kinetic.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; } }
javascript
function(t, b, c, d) { if(t < d / 2) { return Kinetic.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b; } else { return Kinetic.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; } }
[ "function", "(", "t", ",", "b", ",", "c", ",", "d", ")", "{", "if", "(", "t", "<", "d", "/", "2", ")", "{", "return", "Kinetic", ".", "Easings", ".", "BounceEaseIn", "(", "t", "*", "2", ",", "0", ",", "c", ",", "d", ")", "*", "0.5", "+", ...
bounce ease in out @function @memberof Kinetic.Easings
[ "bounce", "ease", "in", "out" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L6786-L6793
33,192
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var children = Kinetic.Collection.toCollection(this.children); var child; for (var i = 0; i < children.length; i++) { child = children[i]; // reset parent to prevent many _setChildrenIndices calls delete child.parent; ...
javascript
function() { var children = Kinetic.Collection.toCollection(this.children); var child; for (var i = 0; i < children.length; i++) { child = children[i]; // reset parent to prevent many _setChildrenIndices calls delete child.parent; ...
[ "function", "(", ")", "{", "var", "children", "=", "Kinetic", ".", "Collection", ".", "toCollection", "(", "this", ".", "children", ")", ";", "var", "child", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i",...
remove all children @method @memberof Kinetic.Container.prototype
[ "remove", "all", "children" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L7195-L7211
33,193
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var children = Kinetic.Collection.toCollection(this.children); var child; for (var i = 0; i < children.length; i++) { child = children[i]; // reset parent to prevent many _setChildrenIndices calls delete child.parent; ...
javascript
function() { var children = Kinetic.Collection.toCollection(this.children); var child; for (var i = 0; i < children.length; i++) { child = children[i]; // reset parent to prevent many _setChildrenIndices calls delete child.parent; ...
[ "function", "(", ")", "{", "var", "children", "=", "Kinetic", ".", "Collection", ".", "toCollection", "(", "this", ".", "children", ")", ";", "var", "child", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i",...
destroy all children @method @memberof Kinetic.Container.prototype
[ "destroy", "all", "children" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L7217-L7230
33,194
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(child) { if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.add(arguments[i]); } return; } if (child.getParent()) { child.moveTo(this); return; ...
javascript
function(child) { if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.add(arguments[i]); } return; } if (child.getParent()) { child.moveTo(this); return; ...
[ "function", "(", "child", ")", "{", "if", "(", "arguments", ".", "length", ">", "1", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "arguments", ".", "length", ";", "i", "++", ")", "{", "this", ".", "add", "(", "arguments", "[", "...
Add node or nodes to container. @method @memberof Kinetic.Container.prototype @param {...Kinetic.Node} child @returns {Container} @example layer.add(shape1, shape2, shape3);
[ "Add", "node", "or", "nodes", "to", "container", "." ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L7240-L7262
33,195
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(node) { var parent = node.getParent(); while(parent) { if(parent._id === this._id) { return true; } parent = parent.getParent(); } return false; }
javascript
function(node) { var parent = node.getParent(); while(parent) { if(parent._id === this._id) { return true; } parent = parent.getParent(); } return false; }
[ "function", "(", "node", ")", "{", "var", "parent", "=", "node", ".", "getParent", "(", ")", ";", "while", "(", "parent", ")", "{", "if", "(", "parent", ".", "_id", "===", "this", ".", "_id", ")", "{", "return", "true", ";", "}", "parent", "=", ...
determine if node is an ancestor of descendant @method @memberof Kinetic.Container.prototype @param {Kinetic.Node} node
[ "determine", "if", "node", "is", "an", "ancestor", "of", "descendant" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L7383-L7393
33,196
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(alphaThreshold) { var threshold = alphaThreshold || 0, cachedCanvas = this._cache.canvas, sceneCanvas = this._getCachedSceneCanvas(), sceneContext = sceneCanvas.getContext(), hitCanvas = cachedCanvas.hit, hitContext = h...
javascript
function(alphaThreshold) { var threshold = alphaThreshold || 0, cachedCanvas = this._cache.canvas, sceneCanvas = this._getCachedSceneCanvas(), sceneContext = sceneCanvas.getContext(), hitCanvas = cachedCanvas.hit, hitContext = h...
[ "function", "(", "alphaThreshold", ")", "{", "var", "threshold", "=", "alphaThreshold", "||", "0", ",", "cachedCanvas", "=", "this", ".", "_cache", ".", "canvas", ",", "sceneCanvas", "=", "this", ".", "_getCachedSceneCanvas", "(", ")", ",", "sceneContext", "...
draw hit graph using the cached scene canvas @method @memberof Kinetic.Shape.prototype @param {Integer} alphaThreshold alpha channel threshold that determines whether or not a pixel should be drawn onto the hit graph. Must be a value between 0 and 255. The default is 0 @returns {Kinetic.Shape} @example shape.cache(); ...
[ "draw", "hit", "graph", "using", "the", "cached", "scene", "canvas" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L7822-L7861
33,197
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(container) { if( typeof container === STRING) { var id = container; container = Kinetic.document.getElementById(container); if (!container) { throw 'Can not find container in document with id ' + id; } }...
javascript
function(container) { if( typeof container === STRING) { var id = container; container = Kinetic.document.getElementById(container); if (!container) { throw 'Can not find container in document with id ' + id; } }...
[ "function", "(", "container", ")", "{", "if", "(", "typeof", "container", "===", "STRING", ")", "{", "var", "id", "=", "container", ";", "container", "=", "Kinetic", ".", "document", ".", "getElementById", "(", "container", ")", ";", "if", "(", "!", "c...
set container dom element which contains the stage wrapper div element @method @memberof Kinetic.Stage.prototype @param {DomElement} container can pass in a dom element or id string
[ "set", "container", "dom", "element", "which", "contains", "the", "stage", "wrapper", "div", "element" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L9059-L9069
33,198
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function() { var layers = this.children, len = layers.length, n; for(n = 0; n < len; n++) { layers[n].clear(); } return this; }
javascript
function() { var layers = this.children, len = layers.length, n; for(n = 0; n < len; n++) { layers[n].clear(); } return this; }
[ "function", "(", ")", "{", "var", "layers", "=", "this", ".", "children", ",", "len", "=", "layers", ".", "length", ",", "n", ";", "for", "(", "n", "=", "0", ";", "n", "<", "len", ";", "n", "++", ")", "{", "layers", "[", "n", "]", ".", "cle...
clear all layers @method @memberof Kinetic.Stage.prototype
[ "clear", "all", "layers" ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L9118-L9127
33,199
freiksenet/react-kinetic
vendor/kinetic-v5.1.0.js
function(config) { config = config || {}; var mimeType = config.mimeType || null, quality = config.quality || null, x = config.x || 0, y = config.y || 0, canvas = new Kinetic.SceneCanvas({ width: config.width ||...
javascript
function(config) { config = config || {}; var mimeType = config.mimeType || null, quality = config.quality || null, x = config.x || 0, y = config.y || 0, canvas = new Kinetic.SceneCanvas({ width: config.width ||...
[ "function", "(", "config", ")", "{", "config", "=", "config", "||", "{", "}", ";", "var", "mimeType", "=", "config", ".", "mimeType", "||", "null", ",", "quality", "=", "config", ".", "quality", "||", "null", ",", "x", "=", "config", ".", "x", "||"...
Creates a composite data URL and requires a callback because the composite is generated asynchronously. @method @memberof Kinetic.Stage.prototype @param {Object} config @param {Function} config.callback function executed when the composite has completed @param {String} [config.mimeType] can be "image/png" or "image/jpe...
[ "Creates", "a", "composite", "data", "URL", "and", "requires", "a", "callback", "because", "the", "composite", "is", "generated", "asynchronously", "." ]
de0db477141e26d9a07162ef096984bb3f068cec
https://github.com/freiksenet/react-kinetic/blob/de0db477141e26d9a07162ef096984bb3f068cec/vendor/kinetic-v5.1.0.js#L9190-L9227