_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q15800
askForDockerRepositoryName
train
function askForDockerRepositoryName() { if (this.regenerate) return; const done = this.async(); const prompts = [ { type: 'input', name: 'dockerRepositoryName', message: 'What should we use for the base Docker repository name?', default: this.dockerR...
javascript
{ "resource": "" }
q15801
askForDockerPushCommand
train
function askForDockerPushCommand() { if (this.regenerate) return; const done = this.async(); const prompts = [ { type: 'input', name: 'dockerPushCommand', message: 'What command should we use for push Docker image to repository?', default: this.docke...
javascript
{ "resource": "" }
q15802
getAppFolders
train
function getAppFolders(input, deploymentApplicationType) { const destinationPath = this.destinationPath(input); const files = shelljs.ls('-l', destinationPath); const appsFolders = []; files.forEach(file => { if (file.isDirectory()) { if (shelljs.test('-f', `${destinationPath}/${fil...
javascript
{ "resource": "" }
q15803
configureImageNames
train
function configureImageNames() { for (let i = 0; i < this.appsFolders.length; i++) { const originalImageName = this.appConfigs[i].baseName.toLowerCase(); const targetImageName = this.dockerRepositoryName ? `${this.dockerRepositoryName}/${originalImageName}` : originalImageName; this.appConfi...
javascript
{ "resource": "" }
q15804
setAppsFolderPaths
train
function setAppsFolderPaths() { if (this.applicationType) return; this.appsFolderPaths = []; for (let i = 0; i < this.appsFolders.length; i++) { const path = this.destinationPath(this.directoryPath + this.appsFolders[i]); this.appsFolderPaths.push(path); } }
javascript
{ "resource": "" }
q15805
loadConfigs
train
function loadConfigs() { this.appConfigs = []; this.gatewayNb = 0; this.monolithicNb = 0; this.microserviceNb = 0; this.uaaNb = 0; // Loading configs this.debug(`Apps folders: ${this.appsFolders}`); this.appsFolders.forEach(appFolder => { const path = this.destinationPath(`${thi...
javascript
{ "resource": "" }
q15806
shouldSkipCommit
train
function shouldSkipCommit(logLine, mode) { const parsedCommit = parser.sync(logLine.message, parserOpts); return (parsedCommit.type === 'feat' && mode === 'patch') || // feature commit parsedCommit.notes.find((note) => note.title === 'BREAKING CHANGE') || // breaking change commit (parsedCommit.type === 'ch...
javascript
{ "resource": "" }
q15807
attemptCherryPicks
train
async function attemptCherryPicks(tag, list, mode) { const results = { successful: [], conflicted: [], skipped: [], }; console.log(`Checking out ${tag}`); await simpleGit.checkout([tag]); for (const logLine of list) { if (shouldSkipCommit(logLine, mode)) { results.skipped.push(logLine)...
javascript
{ "resource": "" }
q15808
dtsBundler
train
function dtsBundler() { const packageDirectories = fs.readdirSync(D_TS_DIRECTORY); packageDirectories.forEach((packageDirectory) => { const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory); const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name; const ...
javascript
{ "resource": "" }
q15809
verifyPath
train
function verifyPath(packageJson, jsonPath, packagePropertyKey) { const isAtRoot = packagePropertyKey === 'module'; const packageJsonPropPath = path.join(path.dirname(jsonPath), packageJson[packagePropertyKey]); let isInvalid = false; if (!isAtRoot && packageJsonPropPath.indexOf('dist') === -1) { isInvalid =...
javascript
{ "resource": "" }
q15810
timeFormat
train
function timeFormat(time, options) { // Video's duration is Infinity in GiONEE(金立) device if (!isFinite(time) || time < 0) { time = 0; } // Get hours var _time = options.alwaysShowHours ? [0] : []; if (Math.floor(time / 3600) % 24) { _time.push(Math.floor(time / 3600) % 24) } // Get minutes _time.push(Math...
javascript
{ "resource": "" }
q15811
getTypeFromFileExtension
train
function getTypeFromFileExtension(url) { url = url.toLowerCase().split('?')[0]; var _ext = url.substring(url.lastIndexOf('.') + 1); var _av = /mp4|m4v|ogg|ogv|m3u8|webm|webmv|wmv|mpeg|mov/gi.test(_ext) ? 'video/' : 'audio/'; switch (_ext) { case 'mp4': case 'm4v': case 'm4a': return _av + 'mp4'; case 'w...
javascript
{ "resource": "" }
q15812
getType
train
function getType(url, type) { // If no type is specified, try to get from the extension if (url && !type) { return getTypeFromFileExtension(url) } else { // Only return the mime part of the type in case the attribute contains the codec // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.ht...
javascript
{ "resource": "" }
q15813
detectType
train
function detectType(media, options, src) { var mediaFiles = []; var i; var n; var isCanPlay; // Get URL and type if (options.type) { // Accept either string or array of types if (typeof options.type == 'string') { mediaFiles.push({ type: options.type, url: src }); } else { for (i = 0; i < ...
javascript
{ "resource": "" }
q15814
ClassList
train
function ClassList (el) { if (!el || !el.nodeType) { throw new Error('A DOM element reference is required') } this.el = el this.list = el.classList }
javascript
{ "resource": "" }
q15815
parseDateString
train
function parseDateString (dateString) { // Pass through when a native object is sent if (dateString instanceof Date) { return dateString } // Caste string to date object if (String(dateString).match(matchers)) { // If looks like a milisecond value cast to number before // final casting (Thanks to ...
javascript
{ "resource": "" }
q15816
strftime
train
function strftime (offsetObject) { return function (format) { var directives = format.match(/%(-|!)?[A-Z]{1}(:[^]+)?/gi) var d2h = false if (directives.indexOf('%D') < 0 && directives.indexOf('%H') >= 0) { d2h = true } if (directives) { for (var i = 0, len = directives.length; i < len;...
javascript
{ "resource": "" }
q15817
train
function (finalDate, option) { option = option || {} this.PRECISION = option.precision || 100 // 0.1 seconds, used to update the DOM this.interval = null this.offset = {} // Register this instance this.instanceNumber = instances.length instances.push(this) // Set the final date and start this.setFinal...
javascript
{ "resource": "" }
q15818
getBabelLoader
train
function getBabelLoader(projectRoot, name, isDev) { name = name || 'vux' if (!projectRoot) { projectRoot = path.resolve(__dirname, '../../../') if (/\.npm/.test(projectRoot)) { projectRoot = path.resolve(projectRoot, '../../../') } } let componentPath let regex if (!isDev) { ...
javascript
{ "resource": "" }
q15819
match
train
function match (el, selector) { if (!el || el.nodeType !== 1) return false if (vendor) return vendor.call(el, selector) var nodes = all(selector, el.parentNode) for (var i = 0; i < nodes.length; ++i) { if (nodes[i] === el) return true } return false }
javascript
{ "resource": "" }
q15820
Events
train
function Events (el, obj) { if (!(this instanceof Events)) return new Events(el, obj) if (!el) throw new Error('element required') if (!obj) throw new Error('object required') this.el = el this.obj = obj this._events = {} }
javascript
{ "resource": "" }
q15821
parse
train
function parse (event) { var parts = event.split(/ +/) return { name: parts.shift(), selector: parts.join(' ') } }
javascript
{ "resource": "" }
q15822
Prompt
train
function Prompt({ message, when = true }) { return ( <RouterContext.Consumer> {context => { invariant(context, "You should not use <Prompt> outside a <Router>"); if (!when || context.staticContext) return null; const method = context.history.block; return ( <Life...
javascript
{ "resource": "" }
q15823
Guide
train
function Guide({ match, data }) { const { params: { mod, header: headerParam, environment } } = match; const doc = data.guides.find(doc => mod === doc.title.slug); const header = doc && headerParam ? doc.headers.find(h => h.slug === headerParam) : null; return !doc ? ( <Redirect to={`/${environmen...
javascript
{ "resource": "" }
q15824
generatePath
train
function generatePath(path = "/", params = {}) { return path === "/" ? path : compilePath(path)(params, { pretty: true }); }
javascript
{ "resource": "" }
q15825
withRouter
train
function withRouter(Component) { const displayName = `withRouter(${Component.displayName || Component.name})`; const C = props => { const { wrappedComponentRef, ...remainingProps } = props; return ( <RouterContext.Consumer> {context => { invariant( context, `...
javascript
{ "resource": "" }
q15826
train
function(id, obj) { if (isFunction(obj)) obj = { run: obj }; if (!obj.stop) obj.noStop = 1; delete obj.initialize; obj.id = id; commands[id] = CommandAbstract.extend(obj); return this; }
javascript
{ "resource": "" }
q15827
drawPoints
train
function drawPoints(ctx, points, radius, color) { const data = points.buffer().values; for (let i = 0; i < data.length; i += 2) { const pointY = data[i]; const pointX = data[i + 1]; if (pointX !== 0 && pointY !== 0) { ctx.beginPath(); ctx.arc(pointX, pointY, radius, 0, 2 * Math.PI); ...
javascript
{ "resource": "" }
q15828
setupFPS
train
function setupFPS() { stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom if (guiState.showFps) { document.body.appendChild(stats.dom); } }
javascript
{ "resource": "" }
q15829
segmentBodyInRealTime
train
function segmentBodyInRealTime() { const canvas = document.getElementById('output'); // since images are being fed from a webcam async function bodySegmentationFrame() { // if changing the model or the camera, wait a second for it to complete // then try again. if (state.changingArchitecture || state...
javascript
{ "resource": "" }
q15830
getCanvasClickRelativeXCoordinate
train
function getCanvasClickRelativeXCoordinate(canvasElement, event) { let x; if (event.pageX) { x = event.pageX; } else { x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; } x -= canvasElement.offsetLeft; return x / canvasElement.width; }
javascript
{ "resource": "" }
q15831
drawResults
train
function drawResults(canvas, poses, minPartConfidence, minPoseConfidence) { renderImageToCanvas(image, [513, 513], canvas); poses.forEach((pose) => { if (pose.score >= minPoseConfidence) { if (guiState.showKeypoints) { drawKeypoints( pose.keypoints, minPartConfidence, canvas.getContext...
javascript
{ "resource": "" }
q15832
drawSinglePoseResults
train
function drawSinglePoseResults(pose) { const canvas = singlePersonCanvas(); drawResults( canvas, [pose], guiState.singlePoseDetection.minPartConfidence, guiState.singlePoseDetection.minPoseConfidence); const {part, showHeatmap, showOffsets} = guiState.visualizeOutputs; // displacements not used for...
javascript
{ "resource": "" }
q15833
drawMultiplePosesResults
train
function drawMultiplePosesResults(poses) { const canvas = multiPersonCanvas(); drawResults( canvas, poses, guiState.multiPoseDetection.minPartConfidence, guiState.multiPoseDetection.minPoseConfidence); const {part, showHeatmap, showOffsets, showDisplacements} = guiState.visualizeOutputs; cons...
javascript
{ "resource": "" }
q15834
visualizeOutputs
train
function visualizeOutputs( partId, drawHeatmaps, drawOffsetVectors, drawDisplacements, ctx) { const {heatmapScores, offsets, displacementFwd, displacementBwd} = modelOutputs; const outputStride = +guiState.outputStride; const [height, width] = heatmapScores.shape; ctx.globalAlpha = 0; const heatma...
javascript
{ "resource": "" }
q15835
decodeSinglePoseAndDrawResults
train
async function decodeSinglePoseAndDrawResults() { if (!modelOutputs) { return; } const pose = await posenet.decodeSinglePose( modelOutputs.heatmapScores, modelOutputs.offsets, guiState.outputStride); drawSinglePoseResults(pose); }
javascript
{ "resource": "" }
q15836
decodeMultiplePosesAndDrawResults
train
async function decodeMultiplePosesAndDrawResults() { if (!modelOutputs) { return; } const poses = await posenet.decodeMultiplePoses( modelOutputs.heatmapScores, modelOutputs.offsets, modelOutputs.displacementFwd, modelOutputs.displacementBwd, guiState.outputStride, guiState.multiPoseDetecti...
javascript
{ "resource": "" }
q15837
detectPoseInRealTime
train
function detectPoseInRealTime(video, net) { const canvas = document.getElementById('output'); const ctx = canvas.getContext('2d'); // since images are being fed from a webcam const flipHorizontal = true; canvas.width = videoWidth; canvas.height = videoHeight; async function poseDetectionFrame() { if...
javascript
{ "resource": "" }
q15838
scrollToPageBottom
train
function scrollToPageBottom() { const scrollingElement = (document.scrollingElement || document.body); scrollingElement.scrollTop = scrollingElement.scrollHeight; }
javascript
{ "resource": "" }
q15839
getDateString
train
function getDateString() { const d = new Date(); const year = `${d.getFullYear()}`; let month = `${d.getMonth() + 1}`; let day = `${d.getDate()}`; if (month.length < 2) { month = `0${month}`; } if (day.length < 2) { day = `0${day}`; } let hour = `${d.getHours()}`; if (hour.length < 2) { ...
javascript
{ "resource": "" }
q15840
setupGui
train
function setupGui() { // Create training buttons and info texts for (let i = 0; i < NUM_CLASSES; i++) { const div = document.createElement('div'); document.body.appendChild(div); div.style.marginBottom = '10px'; // Create training button const button = document.createElement('button'); butt...
javascript
{ "resource": "" }
q15841
animate
train
async function animate() { stats.begin(); // Get image data from video element const image = tf.browser.fromPixels(video); let logits; // 'conv_preds' is the logits activation of MobileNet. const infer = () => mobilenet.infer(image, 'conv_preds'); // Train class if one of the buttons is held down if (...
javascript
{ "resource": "" }
q15842
request
train
async function request(url, options) { const response = await fetch(url, options); checkStatus(response); const data = await response.json(); const ret = { data, headers: {}, }; if (response.headers.get('x-total-count')) { ret.headers['x-total-count'] = response.headers.get('x-total-count');...
javascript
{ "resource": "" }
q15843
addNodeTo
train
function addNodeTo ( target, className ) { var div = document.createElement('div'); addClass(div, className); target.appendChild(div); return div; }
javascript
{ "resource": "" }
q15844
offset
train
function offset ( elem, orientation ) { var rect = elem.getBoundingClientRect(), doc = elem.ownerDocument, docElem = doc.documentElement, pageOffset = getPageOffset(); // getBoundingClientRect contains left scroll in Chrome on Android. // I haven't found a f...
javascript
{ "resource": "" }
q15845
Spectrum
train
function Spectrum ( entry, snap, direction, singleStep ) { this.xPct = []; this.xVal = []; this.xSteps = [ singleStep || false ]; this.xNumSteps = [ false ]; this.xHighestCompleteStep = []; this.snap = snap; this.direction = direction; var index, ordere...
javascript
{ "resource": "" }
q15846
addOrigin
train
function addOrigin ( base, handleNumber ) { var origin = addNodeTo(base, options.cssClasses.origin); var handle = addNodeTo(origin, options.cssClasses.handle); addNodeTo(handle, options.cssClasses.handleTouchArea); handle.setAttribute('data-handle', handleNumber); ...
javascript
{ "resource": "" }
q15847
addConnect
train
function addConnect ( base, add ) { if ( !add ) { return false; } return addNodeTo(base, options.cssClasses.connect); }
javascript
{ "resource": "" }
q15848
addElements
train
function addElements ( connectOptions, base ) { scope_Handles = []; scope_Connects = []; scope_Connects.push(addConnect(base, connectOptions[0])); // [::::O====O====O====] // connectOptions = [0, 1, 1, 1] for ( var i = 0; i < options.handles; i...
javascript
{ "resource": "" }
q15849
addSlider
train
function addSlider ( target ) { // Apply classes and data to the target. addClass(target, options.cssClasses.target); if ( options.dir === 0 ) { addClass(target, options.cssClasses.ltr); } else { addClass(target, options.cssClasses.rtl); ...
javascript
{ "resource": "" }
q15850
tooltips
train
function tooltips ( ) { // Tooltips are added with options.tooltips in original order. var tips = scope_Handles.map(addTooltip); bindEvent('update', function(values, handleNumber, unencoded) { if ( !tips[handleNumber] ) { return; ...
javascript
{ "resource": "" }
q15851
baseSize
train
function baseSize ( ) { var rect = scope_Base.getBoundingClientRect(), alt = 'offset' + ['Width', 'Height'][options.ort]; return options.ort === 0 ? (rect.width||scope_Base[alt]) : (rect.height||scope_Base[alt]); }
javascript
{ "resource": "" }
q15852
attachEvent
train
function attachEvent ( events, element, callback, data ) { // This function can be used to 'filter' events to the slider. // element is a node, not a nodeList var method = function ( e ){ if ( scope_Target.hasAttribute('disabled') ) { return fal...
javascript
{ "resource": "" }
q15853
train
function ( e ){ if ( scope_Target.hasAttribute('disabled') ) { return false; } // Stop if an active 'tap' transition is taking place. if ( hasClass(scope_Target, options.cssClasses.tap) ) { return false; ...
javascript
{ "resource": "" }
q15854
fixEvent
train
function fixEvent ( e, pageOffset ) { // Prevent scrolling and panning on touch events, while // attempting to slide. The tap event also depends on this. e.preventDefault(); // Filter the event to register the type, which can be // touch, mouse or pointer. O...
javascript
{ "resource": "" }
q15855
calcPointToPercentage
train
function calcPointToPercentage ( calcPoint ) { var location = calcPoint - offset(scope_Base, options.ort); var proposal = ( location * 100 ) / baseSize(); return options.dir ? 100 - proposal : proposal; }
javascript
{ "resource": "" }
q15856
getClosestHandle
train
function getClosestHandle ( proposal ) { var closest = 100; var handleNumber = false; scope_Handles.forEach(function(handle, index){ // Disabled handles are ignored if ( handle.hasAttribute('disabled') ) { return; ...
javascript
{ "resource": "" }
q15857
fireEvent
train
function fireEvent ( eventName, handleNumber, tap ) { Object.keys(scope_Events).forEach(function( targetEvent ) { var eventType = targetEvent.split('.')[0]; if ( eventName === eventType ) { scope_Events[targetEvent].forEach(function( callback ) { ...
javascript
{ "resource": "" }
q15858
documentLeave
train
function documentLeave ( event, data ) { if ( event.type === "mouseout" && event.target.nodeName === "HTML" && event.relatedTarget === null ){ eventEnd (event, data); } }
javascript
{ "resource": "" }
q15859
eventMove
train
function eventMove ( event, data ) { // Fix #498 // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty). // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero ...
javascript
{ "resource": "" }
q15860
eventEnd
train
function eventEnd ( event, data ) { // The handle is no longer active, so remove the class. if ( scope_ActiveHandle ) { removeClass(scope_ActiveHandle, options.cssClasses.active); scope_ActiveHandle = false; } // Remove cursor styles and ...
javascript
{ "resource": "" }
q15861
eventStart
train
function eventStart ( event, data ) { if ( data.handleNumbers.length === 1 ) { var handle = scope_Handles[data.handleNumbers[0]]; // Ignore 'disabled' handles if ( handle.hasAttribute('disabled') ) { return false; } ...
javascript
{ "resource": "" }
q15862
eventTap
train
function eventTap ( event ) { // The tap event shouldn't propagate up event.stopPropagation(); var proposal = calcPointToPercentage(event.calcPoint); var handleNumber = getClosestHandle(proposal); // Tackle the case that all handles are 'disabled'. ...
javascript
{ "resource": "" }
q15863
bindSliderEvents
train
function bindSliderEvents ( behaviour ) { // Attach the standard drag event to the handles. if ( !behaviour.fixed ) { scope_Handles.forEach(function( handle, index ){ // These events are only bound to the visual handle // element, not th...
javascript
{ "resource": "" }
q15864
checkHandlePosition
train
function checkHandlePosition ( reference, handleNumber, to, lookBackward, lookForward ) { // For sliders with multiple handles, limit movement to the other handle. // Apply the margin option by adding it to the handle positions. if ( scope_Handles.length > 1 ) { if ...
javascript
{ "resource": "" }
q15865
updateHandlePosition
train
function updateHandlePosition ( handleNumber, to ) { // Update locations. scope_Locations[handleNumber] = to; // Convert the value to the slider stepping/range. scope_Values[handleNumber] = scope_Spectrum.fromStepping(to); // Called synchronously or on the ...
javascript
{ "resource": "" }
q15866
train
function() { scope_Handles[handleNumber].style[options.style] = toPct(to); updateConnect(handleNumber); updateConnect(handleNumber + 1); }
javascript
{ "resource": "" }
q15867
setHandle
train
function setHandle ( handleNumber, to, lookBackward, lookForward ) { to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward); if ( to === false ) { return false; } updateHandlePosition(handleNumber, to); retur...
javascript
{ "resource": "" }
q15868
updateConnect
train
function updateConnect ( index ) { // Skip connects set to false if ( !scope_Connects[index] ) { return; } var l = 0; var h = 100; if ( index !== 0 ) { l = scope_Locations[index - 1]; } if...
javascript
{ "resource": "" }
q15869
valueSet
train
function valueSet ( input, fireSetEvent ) { var values = asArray(input); var isInit = scope_Locations[0] === undefined; // Event fires by default fireSetEvent = (fireSetEvent === undefined ? true : !!fireSetEvent); values.forEach(setValue); // ...
javascript
{ "resource": "" }
q15870
valueGet
train
function valueGet ( ) { var values = scope_Values.map(options.format.to); // If only one handle is used, return a single value. if ( values.length === 1 ){ return values[0]; } return values; }
javascript
{ "resource": "" }
q15871
destroy
train
function destroy ( ) { for ( var key in options.cssClasses ) { if ( !options.cssClasses.hasOwnProperty(key) ) { continue; } removeClass(scope_Target, options.cssClasses[key]); } while (scope_Target.firstChild) { scope_Target.removeChi...
javascript
{ "resource": "" }
q15872
getCurrentStep
train
function getCurrentStep ( ) { // Check all locations, map them to their stepping point. // Get the step point, then find it in the input list. return scope_Locations.map(function( location, index ){ var nearbySteps = scope_Spectrum.getNearbySteps( location ); ...
javascript
{ "resource": "" }
q15873
bindEvent
train
function bindEvent ( namespacedEvent, callback ) { scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || []; scope_Events[namespacedEvent].push(callback); // If the event bound is 'update,' fire it immediately for all handles. if ( namespacedEvent.split('.')[0...
javascript
{ "resource": "" }
q15874
removeEvent
train
function removeEvent ( namespacedEvent ) { var event = namespacedEvent && namespacedEvent.split('.')[0]; var namespace = event && namespacedEvent.substring(event.length); Object.keys(scope_Events).forEach(function( bind ){ var tEvent = bind.split('.')[0], ...
javascript
{ "resource": "" }
q15875
initialize
train
function initialize ( target, originalOptions ) { if ( !target.nodeName ) { throw new Error('noUiSlider.create requires a single element.'); } if (originalOptions.tooltips === undefined) { originalOptions.tooltips = true; } // Test the options and creat...
javascript
{ "resource": "" }
q15876
rgb2hex
train
function rgb2hex(rgb) { if (/^#[0-9A-F]{6}$/i.test(rgb)) { return rgb; } rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); if (rgb === null) { return 'N/A'; } function hex(x) { return ('0' + parseInt(x).toString(16)).slice(-2); } return '#' ...
javascript
{ "resource": "" }
q15877
train
function (eventName, data) { if (document.createEvent) { var evt = document.createEvent('HTMLEvents'); evt.initEvent(eventName, true, false); evt = this.extend(evt, data); return this.each(function (v) { return v.dispatchEvent(evt); }); } }
javascript
{ "resource": "" }
q15878
Component
train
function Component(classDef, el, options) { _classCallCheck(this, Component); // Display error if el is valid HTML Element if (!(el instanceof Element)) { console.error(Error(el + ' is not an HTML Element')); } // If exists, destroy and reinitialize in child var ins = classDef.getInstanc...
javascript
{ "resource": "" }
q15879
Modal
train
function Modal(el, options) { _classCallCheck(this, Modal); var _this13 = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, Modal, el, options)); _this13.el.M_Modal = _this13; /** * Options for the modal * @member Modal#options ...
javascript
{ "resource": "" }
q15880
train
function () { if (typeof _this14.options.onOpenEnd === 'function') { _this14.options.onOpenEnd.call(_this14, _this14.el, _this14._openingTrigger); } }
javascript
{ "resource": "" }
q15881
train
function () { _this15.el.style.display = 'none'; _this15.$overlay.remove(); // Call onCloseEnd callback if (typeof _this15.options.onCloseEnd === 'function') { _this15.options.onCloseEnd.call(_this15, _this15.el); } }
javascript
{ "resource": "" }
q15882
Materialbox
train
function Materialbox(el, options) { _classCallCheck(this, Materialbox); var _this16 = _possibleConstructorReturn(this, (Materialbox.__proto__ || Object.getPrototypeOf(Materialbox)).call(this, Materialbox, el, options)); _this16.el.M_Materialbox = _this16; /** * Options for the modal ...
javascript
{ "resource": "" }
q15883
_createToast
train
function _createToast() { var toast = document.createElement('div'); toast.classList.add('toast'); // Add custom classes onto toast if (!!this.options.classes.length) { $(toast).addClass(this.options.classes); } // Set content if (typeof HTMLElement ==...
javascript
{ "resource": "" }
q15884
Sidenav
train
function Sidenav(el, options) { _classCallCheck(this, Sidenav); var _this31 = _possibleConstructorReturn(this, (Sidenav.__proto__ || Object.getPrototypeOf(Sidenav)).call(this, Sidenav, el, options)); _this31.el.M_Sidenav = _this31; _this31.id = _this31.$el.attr('id'); /** * Optio...
javascript
{ "resource": "" }
q15885
ScrollSpy
train
function ScrollSpy(el, options) { _classCallCheck(this, ScrollSpy); var _this35 = _possibleConstructorReturn(this, (ScrollSpy.__proto__ || Object.getPrototypeOf(ScrollSpy)).call(this, ScrollSpy, el, options)); _this35.el.M_ScrollSpy = _this35; /** * Options for the modal * @memb...
javascript
{ "resource": "" }
q15886
Slider
train
function Slider(el, options) { _classCallCheck(this, Slider); var _this40 = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, Slider, el, options)); _this40.el.M_Slider = _this40; /** * Options for the modal * @member Slider#options ...
javascript
{ "resource": "" }
q15887
Pushpin
train
function Pushpin(el, options) { _classCallCheck(this, Pushpin); var _this47 = _possibleConstructorReturn(this, (Pushpin.__proto__ || Object.getPrototypeOf(Pushpin)).call(this, Pushpin, el, options)); _this47.el.M_Pushpin = _this47; /** * Options for the modal * @member Pushpin#o...
javascript
{ "resource": "" }
q15888
FloatingActionButton
train
function FloatingActionButton(el, options) { _classCallCheck(this, FloatingActionButton); var _this48 = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options)); _this48.el.M_FloatingActionButton =...
javascript
{ "resource": "" }
q15889
CharacterCounter
train
function CharacterCounter(el, options) { _classCallCheck(this, CharacterCounter); var _this61 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options)); _this61.el.M_CharacterCounter = _this61; /** ...
javascript
{ "resource": "" }
q15890
Carousel
train
function Carousel(el, options) { _classCallCheck(this, Carousel); var _this62 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options)); _this62.el.M_Carousel = _this62; /** * Options for the carousel * @member ...
javascript
{ "resource": "" }
q15891
TapTarget
train
function TapTarget(el, options) { _classCallCheck(this, TapTarget); var _this67 = _possibleConstructorReturn(this, (TapTarget.__proto__ || Object.getPrototypeOf(TapTarget)).call(this, TapTarget, el, options)); _this67.el.M_TapTarget = _this67; /** * Options for the select * @mem...
javascript
{ "resource": "" }
q15892
FormSelect
train
function FormSelect(el, options) { _classCallCheck(this, FormSelect); // Don't init if browser default version var _this68 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options)); if (_this68.$el.hasClass('browser-defa...
javascript
{ "resource": "" }
q15893
train
function(target) { parentNode = target.parentNode; if (parentNode) { if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNode; } else { parentNode = parentNode.parentNode; if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNode; } } } }
javascript
{ "resource": "" }
q15894
computedStyle
train
function computedStyle(elem, pseudo, prop) { var result; if ('getComputedStyle' in window) { result = getComputedStyle.call(window, elem, pseudo); var console = window.console; if (result !== null) { if (prop) { result = result.getPropertyValue(prop); } } else...
javascript
{ "resource": "" }
q15895
getBody
train
function getBody() { // After page load injecting a fake body doesn't work so check if body exists var body = document.body; if (!body) { // Can't use the real body create a fake one. body = createElement(isSVG ? 'svg' : 'body'); body.fake = true; } return body; }
javascript
{ "resource": "" }
q15896
modify
train
function modify(modifier, source, index, shift) { if ( !this.isEnabled() && source === Emitter.sources.USER && !this.allowReadOnlyEdits ) { return new Delta(); } let range = index == null ? null : this.getSelection(); const oldDelta = this.editor.delta; const change = modifier(); if (range...
javascript
{ "resource": "" }
q15897
blockDelta
train
function blockDelta(blot, filter = true) { return blot .descendants(LeafBlot) .reduce((delta, leaf) => { if (leaf.length() === 0) { return delta; } return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter)); }, new Delta()) .insert('\n', bubbleFormats(blot)); }
javascript
{ "resource": "" }
q15898
train
function (quote) { var str; var n = this.html.indexOf(quote, this.currentChar); if (n === -1) { this.currentChar = this.html.length; str = null; } else { str = this.html.substring(this.currentChar, n); this.currentChar = n + 1; } return str; }
javascript
{ "resource": "" }
q15899
train
function (retPair) { var c = this.nextChar(); // Read the Element tag name var strBuf = this.strBuf; strBuf.length = 0; while (whitespace.indexOf(c) == -1 && c !== ">" && c !== "/") { if (c === undefined) return false; strBuf.push(c); c = this.nextChar();...
javascript
{ "resource": "" }