_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q64800 | getDefinedNames | test | function getDefinedNames() {
return Object.keys(primitives).concat(Object.keys(registry).map(function (type) {
return registry[type].type;
}));
} | javascript | {
"resource": ""
} |
q64801 | test | function(comment) {
const isLicense =
comment.toLowerCase().includes("license") ||
comment.toLowerCase().includes("copyright");
if (isLicense === false) {
return false;
}
if (lastLicense !== comment) {
... | javascript | {
"resource": ""
} | |
q64802 | get | test | function get(k) {
if(!k) return _SETTINGS
let v = _.get(_SETTINGS, k)
if(!v) return
if(_.isString(k) && k.indexOf('paths.') !== 0) return v
let args = _.drop(_.toArray(arguments))
let argsLength = args.unshift(v)
return path.join.apply(path, args)
} | javascript | {
"resource": ""
} |
q64803 | load | test | function load(src) {
if(!src || !_.isString(src)) return
let file = _.attempt(require, src)
if(!file || _.isError(file) || !_.isPlainObject(file)) return
return _.merge(_SETTINGS, file)
} | javascript | {
"resource": ""
} |
q64804 | test | function(size, units) {
// Size set to a value which means "auto"
if (size === "" || size == "auto" || size === undefined || size === null) {
return size || '';
}
// Otherwise, warn if it's not a valid CSS measurement
if (Ext.isNumber(size) || this.numberRe.test(size... | javascript | {
"resource": ""
} | |
q64805 | test | function(form) {
var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements,
hasSubmit = false,
encoder = encodeURIComponent,
name,
data = '',
type,
hasValue;
Ext.each(fElements, function(element) {
... | javascript | {
"resource": ""
} | |
q64806 | test | function() {
//<debug warn>
Ext.Logger.deprecate("Ext.Element.getDocumentWidth() is no longer supported. " +
"Please use Ext.Viewport#getWindowWidth() instead", this);
//</debug>
return Math.max(!Ext.isStrict ? document.body.scrollWidth : document.documentElement.scrollWidth,... | javascript | {
"resource": ""
} | |
q64807 | test | function() {
//<debug warn>
Ext.Logger.deprecate("Ext.Element.getOrientation() is no longer supported. " +
"Please use Ext.Viewport#getOrientation() instead", this);
//</debug>
if (Ext.supports.OrientationChange) {
return (window.orientation == 0) ? 'portrait' : '... | javascript | {
"resource": ""
} | |
q64808 | test | function(el, config) {
config = config || {};
Ext.apply(this, config);
this.addEvents(
/**
* @event sortstart
* @param {Ext.Sortable} this
* @param {Ext.event.Event} e
*/
'sortstart',
/**
* @eve... | javascript | {
"resource": ""
} | |
q64809 | test | function() {
this.el.on(this.startEventName, this.onStart, this, {delegate: this.itemSelector, holdThreshold: this.getDelay()});
this.disabled = false;
} | javascript | {
"resource": ""
} | |
q64810 | _compareMaps | test | function _compareMaps(a,b, options) {
debug(a,b);
let alength = a.size === undefined ? a.length : a.size;
let blength = b.size === undefined ? b.length : b.size;
if (alength === 0 && blength === 0) return ops.NOP;
// ops.Map([...b]) and not just ops.Rpl(b) because if b is a map it's not good JSON... | javascript | {
"resource": ""
} |
q64811 | compare | test | function compare(a,b,options) {
debug('compare %j,%j options: %j', a, b, options);
options = Options.addDefaults(options);
debug('compare - options %j', options);
if (a === b)
return ops.NOP;
if (b === undefined)
return ops.DEL;
if (a === undefined)
return new ops.Rpl... | javascript | {
"resource": ""
} |
q64812 | fromJSON | test | function fromJSON(object) {
if (object instanceof ops.Op) return object; // If already patch, return it
if (object === undefined) return ops.NOP;
if (object.op) {
if (object.op === ops.Rpl.name)
return new ops.Rpl(object.data);
if (object.op === ops.Ins.na... | javascript | {
"resource": ""
} |
q64813 | test | function(sorterFn) {
var me = this,
items = me.items,
keys = me.keys,
length = items.length,
temp = [],
i;
//first we create a copy of the items array so that we can sort it
for (i = 0; i < length; i++) {
temp[i] =... | javascript | {
"resource": ""
} | |
q64814 | test | function(mapping) {
var me = this,
items = me.items,
index = 0,
length = items.length,
order = [],
remaining = [],
oldIndex;
me.suspendEvents();
//object of {oldPosition: newPosition} reversed to {newPosition: oldPosition}... | javascript | {
"resource": ""
} | |
q64815 | apply | test | function apply (func, args, self) {
return (typeof func === 'function')
? func.apply(self, array(args))
: func
} | javascript | {
"resource": ""
} |
q64816 | detectDeviceClass | test | function detectDeviceClass() {
var body = document.body;
if (isMobile.any()) {
body.classList.add('mobile');
}
if (isMobile.Android()) {
body.classList.add('android');
}
if (isTablet.any()) {
body.classList.add('tablet');
}
} | javascript | {
"resource": ""
} |
q64817 | detectWindowWidth | test | function detectWindowWidth() {
var mobileWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 730;
var isMobileWidth = window.innerWidth < mobileWidth;
var body = document.body;
if (isMobileWidth) {
body.classList.add('is-mobile-width');
} else {
body.classLis... | javascript | {
"resource": ""
} |
q64818 | test | function(config,callback,scope) {
var changed= false;
if (config) {
config.config_id= 'csv';
Ext.data.CSV.superclass.constructor.call(this, config);
if (config.v) {
this.v= [];
this.do_add(config.v);
}
}
if (this.v===undefined) {
this.v= [];
changed= true;
}
this.writeAndCallback(c... | javascript | {
"resource": ""
} | |
q64819 | test | function(array, insert, at) {
at = Math.min(Math.max(at, 0), array.length);
var tail = Array(array.length - at);
var length = insert.length;
for (var i = 0; i < tail.length; i++) tail[i] = array[i + at];
for (i = 0; i < length; i++) array[i + at] = insert[i];
for (i = 0; i < tail.length; i++) ar... | javascript | {
"resource": ""
} | |
q64820 | test | function(models, options) {
options = _.extend({}, options);
var singular = !_.isArray(models);
models = singular ? [models] : _.clone(models);
var removed = this._removeModels(models, options);
if (!options.silent && removed) this.trigger('update', this, options);
return singular ? ... | javascript | {
"resource": ""
} | |
q64821 | test | function(models, options) {
var removed = [];
for (var i = 0; i < models.length; i++) {
var model = this.get(models[i]);
if (!model) continue;
var index = this.indexOf(model);
this.models.splice(index, 1);
this.length--;
if (!options.silent) {
opti... | javascript | {
"resource": ""
} | |
q64822 | test | function() {
var path = this.decodeFragment(this.location.pathname);
var root = path.slice(0, this.root.length - 1) + '/';
return root === this.root;
} | javascript | {
"resource": ""
} | |
q64823 | getViewTemplateData | test | function getViewTemplateData ( view, viewOptions ) {
var data,
meta = view.declarativeViews.meta;
if ( ! meta.processed ) {
if ( view.template && _.isString( view.template ) ) {
meta.originalTemplateProp = view.template;
data = getTemplateData(... | javascript | {
"resource": ""
} |
q64824 | clearCache | test | function clearCache ( fromMarionette ) {
templateCache = {};
if ( ! fromMarionette && Backbone.Marionette && Backbone.Marionette.TemplateCache ) Backbone.Marionette.TemplateCache.clear();
} | javascript | {
"resource": ""
} |
q64825 | clearCachedTemplate | test | function clearCachedTemplate ( templateProp ) {
var fromMarionette = false,
args = _.toArray( arguments ),
lastArg = _.last( args );
// When called from Marionette, or called recursively, the last argument is a "fromMarionette" boolean. Splice
// it off before proceedin... | javascript | {
"resource": ""
} |
q64826 | clearViewTemplateCache | test | function clearViewTemplateCache ( view ) {
var meta = view.declarativeViews.meta;
if ( meta.processed ) {
if ( meta.inGlobalCache ) _clearCachedTemplate( meta.originalTemplateProp );
} else if ( view.template && _.isString( view.template ) ) {
_clearCachedTemplate( view.... | javascript | {
"resource": ""
} |
q64827 | _copyCacheEntry | test | function _copyCacheEntry ( cacheEntry ) {
var copy = _.clone( cacheEntry );
if ( _.isObject( copy.attributes ) ) copy.attributes = _.clone( copy.attributes );
return copy;
} | javascript | {
"resource": ""
} |
q64828 | _createTemplateCache | test | function _createTemplateCache( templateProp, view, viewOptions ) {
var $template, data, html,
customLoader = Backbone.DeclarativeViews.custom.loadTemplate,
defaultLoader = Backbone.DeclarativeViews.defaults.loadTemplate,
modifiedDefaultLoader = defaultLoader !== loadTemplate... | javascript | {
"resource": ""
} |
q64829 | _updateJQueryDataCache | test | function _updateJQueryDataCache ( $elem ) {
var add = {},
remove = [];
if ( $.hasData( $elem[0] ) ) {
// A jQuery data cache exists. Update it for the el properties (and attribute names registered by a plugin).
// Primitive data types. Normally, this will read the ... | javascript | {
"resource": ""
} |
q64830 | _registerCacheAlias | test | function _registerCacheAlias( namespaceObject, instanceCachePropertyName ) {
namespaceObject.getCachedTemplate = Backbone.DeclarativeViews.getCachedTemplate;
namespaceObject.clearCachedTemplate = Backbone.DeclarativeViews.clearCachedTemplate;
namespaceObject.clearCache = Backbone.DeclarativeView... | javascript | {
"resource": ""
} |
q64831 | _isDeclarativeViewsErrorType | test | function _isDeclarativeViewsErrorType ( error ) {
return error instanceof GenericError ||
error instanceof TemplateError ||
error instanceof CompilerError ||
error instanceof CustomizationError ||
error instanceof ConfigurationError;
} | javascript | {
"resource": ""
} |
q64832 | createCustomErrorType | test | function createCustomErrorType ( name ) {
function CustomError ( message ) {
this.message = message;
if ( Error.captureStackTrace ) {
Error.captureStackTrace( this, this.constructor );
} else {
this.stack = ( new Error() ).stack;
... | javascript | {
"resource": ""
} |
q64833 | test | function(name) {
var config = this._wreqrHandlers[name];
if (!config) {
return;
}
return function() {
return config.callback.apply(config.context, arguments);
};
} | javascript | {
"resource": ""
} | |
q64834 | test | function(name) {
name = arguments[0];
var args = _.rest(arguments);
if (this.hasHandler(name)) {
this.getHandler(name).apply(this, args);
} else {
this.storage.addCommand(name, args);
}
} | javascript | {
"resource": ""
} | |
q64835 | test | function(type, hash, context) {
if (!hash) {
return;
}
context = context || this;
var method = type === "vent" ? "on" : "setHandler";
_.each(hash, function(fn, eventName) {
this[type][method](eventName, _.bind(fn, context));
}, this);
... | javascript | {
"resource": ""
} | |
q64836 | iterateEvents | test | function iterateEvents(target, entity, bindings, functionCallback, stringCallback) {
if (!entity || !bindings) { return; }
// type-check bindings
if (!_.isObject(bindings)) {
throw new Marionette.Error({
message: 'Bindings must be an object or function.',
url: 'marionett... | javascript | {
"resource": ""
} |
q64837 | test | function(callback, contextOverride) {
var promise = _.result(this._deferred, 'promise');
this._callbacks.push({cb: callback, ctx: contextOverride});
promise.then(function(args) {
if (contextOverride) { args.context = contextOverride; }
callback.call(args.context, args.options);
... | javascript | {
"resource": ""
} | |
q64838 | test | function(view, options) {
if (!this._ensureElement()) {
return;
}
this._ensureViewIsIntact(view);
Marionette.MonitorDOMRefresh(view);
var showOptions = options || {};
var isDifferentView = view !== this.currentView;
var preventDestroy = !!showOptions.preventD... | javascript | {
"resource": ""
} | |
q64839 | test | function(options) {
var view = this.currentView;
var emptyOptions = options || {};
var preventDestroy = !!emptyOptions.preventDestroy;
// If there is no view in the region
// we should not remove anything
if (!view) { return this; }
view.off('destroy', this.empty, this);... | javascript | {
"resource": ""
} | |
q64840 | test | function(regionDefinitions, defaults) {
regionDefinitions = Marionette._getValue(regionDefinitions, this, arguments);
return _.reduce(regionDefinitions, function(regions, definition, name) {
if (_.isString(definition)) {
definition = {selector: definition};
}
if (definit... | javascript | {
"resource": ""
} | |
q64841 | test | function(name, definition) {
var region;
if (definition instanceof Marionette.Region) {
region = definition;
} else {
region = Marionette.Region.buildRegion(definition, Marionette.Region);
}
this.triggerMethod('before:add:region', name, region);
region._paren... | javascript | {
"resource": ""
} | |
q64842 | test | function() {
var regions = this.getRegions();
_.each(this._regions, function(region, name) {
this._remove(name, region);
}, this);
return regions;
} | javascript | {
"resource": ""
} | |
q64843 | test | function(name, region) {
this.triggerMethod('before:remove:region', name, region);
region.empty();
region.stopListening();
delete region._parent;
delete this._regions[name];
this.length--;
this.triggerMethod('remove:region', name, region);
} | javascript | {
"resource": ""
} | |
q64844 | test | function(templateId, options) {
var cachedTemplate = this.templateCaches[templateId];
if (!cachedTemplate) {
cachedTemplate = new Marionette.TemplateCache(templateId);
this.templateCaches[templateId] = cachedTemplate;
}
return cachedTemplate.load(options);
} | javascript | {
"resource": ""
} | |
q64845 | test | function(options) {
// Guard clause to prevent loading this template more than once
if (this.compiledTemplate) {
return this.compiledTemplate;
}
// Load the template and compile it
var template = this.loadTemplate(this.templateId, options);
this.compiledTemplate = this.com... | javascript | {
"resource": ""
} | |
q64846 | test | function(template, data) {
if (!template) {
throw new Marionette.Error({
name: 'TemplateNotFoundError',
message: 'Cannot render the template since its false, null or undefined.'
});
}
var templateFunc = _.isFunction(template) ? template : Marionette.TemplateCache... | javascript | {
"resource": ""
} | |
q64847 | test | function(target) {
target = target || {};
var templateHelpers = this.getOption('templateHelpers');
templateHelpers = Marionette._getValue(templateHelpers, this);
return _.extend(target, templateHelpers);
} | javascript | {
"resource": ""
} | |
q64848 | test | function(events) {
this._delegateDOMEvents(events);
this.bindEntityEvents(this.model, this.getOption('modelEvents'));
this.bindEntityEvents(this.collection, this.getOption('collectionEvents'));
_.each(this._behaviors, function(behavior) {
behavior.bindEntityEvents(this.model, behavior... | javascript | {
"resource": ""
} | |
q64849 | test | function(eventsArg) {
var events = Marionette._getValue(eventsArg || this.events, this);
// normalize ui keys
events = this.normalizeUIKeys(events);
if (_.isUndefined(eventsArg)) {this.events = events;}
var combinedEvents = {};
// look up if this view has behavior events
... | javascript | {
"resource": ""
} | |
q64850 | test | function() {
Backbone.View.prototype.undelegateEvents.apply(this, arguments);
this.unbindEntityEvents(this.model, this.getOption('modelEvents'));
this.unbindEntityEvents(this.collection, this.getOption('collectionEvents'));
_.each(this._behaviors, function(behavior) {
behavior.unbi... | javascript | {
"resource": ""
} | |
q64851 | test | function() {
if (this.isDestroyed) { return this; }
var args = _.toArray(arguments);
this.triggerMethod.apply(this, ['before:destroy'].concat(args));
// mark as destroyed before doing the actual destroy, to
// prevent infinite loops within "destroy" event handlers
// that ar... | javascript | {
"resource": ""
} | |
q64852 | test | function() {
if (!this.ui) { return; }
// store the ui hash in _uiBindings so they can be reset later
// and so re-rendering the view will be able to find the bindings
if (!this._uiBindings) {
this._uiBindings = this.ui;
}
// get the bindings result, as a function or ot... | javascript | {
"resource": ""
} | |
q64853 | test | function() {
var ret = Marionette._triggerMethod(this, arguments);
this._triggerEventOnBehaviors(arguments);
this._triggerEventOnParentLayout(arguments[0], _.rest(arguments));
return ret;
} | javascript | {
"resource": ""
} | |
q64854 | test | function() {
var children = this._getImmediateChildren();
if (!children.length) { return children; }
return _.reduce(children, function(memo, view) {
if (!view._getNestedViews) { return memo; }
return memo.concat(view._getNestedViews());
}, children);
} | javascript | {
"resource": ""
} | |
q64855 | test | function() {
if (!this.model && !this.collection) {
return {};
}
var args = [this.model || this.collection];
if (arguments.length) {
args.push.apply(args, arguments);
}
if (this.model) {
return this.serializeModel.apply(this, args);
} else {
... | javascript | {
"resource": ""
} | |
q64856 | test | function() {
var template = this.getTemplate();
// Allow template-less item views
if (template === false) {
return;
}
if (!template) {
throw new Marionette.Error({
name: 'UndefinedTemplateError',
message: 'Cannot render the template since it is nul... | javascript | {
"resource": ""
} | |
q64857 | test | function() {
if (this.collection) {
this.listenTo(this.collection, 'add', this._onCollectionAdd);
this.listenTo(this.collection, 'remove', this._onCollectionRemove);
this.listenTo(this.collection, 'reset', this.render);
if (this.getOption('sort')) {
this.listenTo(this.... | javascript | {
"resource": ""
} | |
q64858 | test | function(child, collection, opts) {
// `index` is present when adding with `at` since BB 1.2; indexOf fallback for < 1.2
var index = opts.at !== undefined && (opts.index || collection.indexOf(child));
// When filtered or when there is no initial index, calculate index.
if (this.getOption('fil... | javascript | {
"resource": ""
} | |
q64859 | test | function() {
var models = this._filteredSortedModels();
// check for any changes in sort order of views
var orderChanged = _.find(models, function(item, index) {
var view = this.children.findByModel(item);
return !view || view._index !== index;
}, this);
if (orderChan... | javascript | {
"resource": ""
} | |
q64860 | test | function() {
this.destroyEmptyView();
this.destroyChildren({checkEmpty: false});
if (this.isEmpty(this.collection)) {
this.showEmptyView();
} else {
this.triggerMethod('before:render:collection', this);
this.startBuffering();
this.showCollection();
this... | javascript | {
"resource": ""
} | |
q64861 | test | function() {
var ChildView;
var models = this._filteredSortedModels();
_.each(models, function(child, index) {
ChildView = this.getChildView(child);
this.addChild(child, ChildView, index);
}, this);
} | javascript | {
"resource": ""
} | |
q64862 | test | function(addedAt) {
var viewComparator = this.getViewComparator();
var models = this.collection.models;
addedAt = Math.min(Math.max(addedAt, 0), models.length - 1);
if (viewComparator) {
var addedModel;
// Preserve `at` location, even for a sorted view
if (addedAt) {
... | javascript | {
"resource": ""
} | |
q64863 | test | function() {
var EmptyView = this.getEmptyView();
if (EmptyView && !this._showingEmptyView) {
this.triggerMethod('before:render:empty');
this._showingEmptyView = true;
var model = new Backbone.Model();
this.addEmptyView(model, EmptyView);
this.triggerMethod('... | javascript | {
"resource": ""
} | |
q64864 | test | function(child, ChildView, index) {
var childViewOptions = this.getOption('childViewOptions');
childViewOptions = Marionette._getValue(childViewOptions, this, [child, index]);
var view = this.buildChildView(child, ChildView, childViewOptions);
// increment indices of views after this one
... | javascript | {
"resource": ""
} | |
q64865 | test | function(view, index) {
// Only trigger attach if already shown, attached, and not buffering, otherwise endBuffer() or
// Region#show() handles this.
var canTriggerAttach = this._isShown && !this.isBuffering && Marionette.isNodeAttached(this.el);
var nestedViews;
// set up the child vie... | javascript | {
"resource": ""
} | |
q64866 | test | function(view, index) {
if (!view.supportsRenderLifecycle) {
Marionette.triggerMethodOn(view, 'before:render', view);
}
view.render();
if (!view.supportsRenderLifecycle) {
Marionette.triggerMethodOn(view, 'render', view);
}
this.attachHtml(this, view, index);
re... | javascript | {
"resource": ""
} | |
q64867 | test | function(child, ChildViewClass, childViewOptions) {
var options = _.extend({model: child}, childViewOptions);
var childView = new ChildViewClass(options);
Marionette.MonitorDOMRefresh(childView);
return childView;
} | javascript | {
"resource": ""
} | |
q64868 | test | function(view) {
if (!view) { return view; }
this.triggerMethod('before:remove:child', view);
if (!view.supportsDestroyLifecycle) {
Marionette.triggerMethodOn(view, 'before:destroy', view);
}
// call 'destroy' or 'remove', depending on which is found
if (view.destroy) {... | javascript | {
"resource": ""
} | |
q64869 | test | function() {
var elBuffer = document.createDocumentFragment();
_.each(this._bufferedChildren, function(b) {
elBuffer.appendChild(b.el);
});
return elBuffer;
} | javascript | {
"resource": ""
} | |
q64870 | test | function(collectionView, childView, index) {
if (collectionView.isBuffering) {
// buffering happens on reset events and initial renders
// in order to reduce the number of inserts into the
// document, which are expensive.
collectionView._bufferedChildren.splice(index, 0, childView... | javascript | {
"resource": ""
} | |
q64871 | test | function(childView, index) {
var currentView;
var findPosition = this.getOption('sort') && (index < this.children.length - 1);
if (findPosition) {
// Find the view after this one
currentView = this.children.find(function(view) {
return view._index === index + 1;
});
... | javascript | {
"resource": ""
} | |
q64872 | test | function() {
if (this.isDestroyed) { return this; }
this.triggerMethod('before:destroy:collection');
this.destroyChildren({checkEmpty: false});
this.triggerMethod('destroy:collection');
return Marionette.View.prototype.destroy.apply(this, arguments);
} | javascript | {
"resource": ""
} | |
q64873 | test | function(options) {
var destroyOptions = options || {};
var shouldCheckEmpty = true;
var childViews = this.children.map(_.identity);
if (!_.isUndefined(destroyOptions.checkEmpty)) {
shouldCheckEmpty = destroyOptions.checkEmpty;
}
this.children.each(this.removeChildView,... | javascript | {
"resource": ""
} | |
q64874 | test | function() {
// Bind only after composite view is rendered to avoid adding child views
// to nonexistent childViewContainer
if (this.collection) {
this.listenTo(this.collection, 'add', this._onCollectionAdd);
this.listenTo(this.collection, 'remove', this._onCollectionRemove);
... | javascript | {
"resource": ""
} | |
q64875 | test | function() {
var data = {};
if (this.model) {
data = _.partial(this.serializeModel, this.model).apply(this, arguments);
}
return data;
} | javascript | {
"resource": ""
} | |
q64876 | test | function() {
this._ensureViewIsIntact();
this._isRendering = true;
this.resetChildViewContainer();
this.triggerMethod('before:render', this);
this._renderTemplate();
this._renderChildren();
this._isRendering = false;
this.isRendered = true;
this.triggerMeth... | javascript | {
"resource": ""
} | |
q64877 | test | function() {
var data = {};
data = this.serializeData();
data = this.mixinTemplateHelpers(data);
this.triggerMethod('before:render:template');
var template = this.getTemplate();
var html = Marionette.Renderer.render(template, data, this);
this.attachElContent(html);
... | javascript | {
"resource": ""
} | |
q64878 | test | function(options) {
options = options || {};
this._firstRender = true;
this._initializeRegions(options);
Marionette.ItemView.call(this, options);
} | javascript | {
"resource": ""
} | |
q64879 | test | function() {
this._ensureViewIsIntact();
if (this._firstRender) {
// if this is the first render, don't do anything to
// reset the regions
this._firstRender = false;
} else {
// If this is not the first render call, then we need to
// re-initialize the `el` ... | javascript | {
"resource": ""
} | |
q64880 | test | function() {
if (this.isDestroyed) { return this; }
// #2134: remove parent element before destroying the child views, so
// removing the child views doesn't retrigger repaints
if (this.getOption('destroyImmediate') === true) {
this.$el.remove();
}
this.regionManager.destroy(... | javascript | {
"resource": ""
} | |
q64881 | test | function(regions) {
var defaults = {
regionClass: this.getOption('regionClass'),
parentEl: _.partial(_.result, this, 'el')
};
return this.regionManager.addRegions(regions, defaults);
} | javascript | {
"resource": ""
} | |
q64882 | test | function(options) {
var regions;
this._initRegionManager();
regions = Marionette._getValue(this.regions, this, [options]) || {};
// Enable users to define `regions` as instance options.
var regionOptions = this.getOption.call(options, 'regions');
// enable region options to ... | javascript | {
"resource": ""
} | |
q64883 | test | function() {
this.regionManager = this.getRegionManager();
this.regionManager._parent = this;
this.listenTo(this.regionManager, 'before:add:region', function(name) {
this.triggerMethod('before:add:region', name);
});
this.listenTo(this.regionManager, 'add:region', function(na... | javascript | {
"resource": ""
} | |
q64884 | test | function(options, key) {
if (options.behaviorClass) {
return options.behaviorClass;
}
// Get behavior class can be either a flat object or a method
return Marionette._getValue(Behaviors.behaviorsLookup, this, [options, key])[key];
} | javascript | {
"resource": ""
} | |
q64885 | test | function(view, behaviors) {
return _.chain(behaviors).map(function(options, key) {
var BehaviorClass = Behaviors.getBehaviorClass(options, key);
var behavior = new BehaviorClass(options, view);
var nestedBehaviors = Behaviors.parseBehaviors(view, _.result(behavior, 'behaviors'))... | javascript | {
"resource": ""
} | |
q64886 | test | function(behavior, i) {
var triggersHash = _.clone(_.result(behavior, 'triggers')) || {};
triggersHash = Marionette.normalizeUIKeys(triggersHash, getBehaviorsUI(behavior));
_.each(triggersHash, _.bind(this._setHandlerForBehavior, this, behavior, i));
} | javascript | {
"resource": ""
} | |
q64887 | test | function(behavior, i, eventName, trigger) {
// Unique identifier for the `this._triggers` hash
var triggerKey = trigger.replace(/^\S+/, function(triggerName) {
return triggerName + '.' + 'behaviortriggers' + i;
});
this._triggers[triggerKey] = this._view._buildViewTrigger(ev... | javascript | {
"resource": ""
} | |
q64888 | test | function(routeName, routeArgs) {
// make sure an onRoute before trying to call it
if (_.isFunction(this.onRoute)) {
// find the path that matches the current route
var routePath = _.invert(this.getOption('appRoutes'))[routeName];
this.onRoute(routeName, routePath, routeArgs);
}... | javascript | {
"resource": ""
} | |
q64889 | test | function(moduleNames, moduleDefinition) {
// Overwrite the module class if the user specifies one
var ModuleClass = Marionette.Module.getClass(moduleDefinition);
var args = _.toArray(arguments);
args.unshift(this);
// see the Marionette.Module object for more information
ret... | javascript | {
"resource": ""
} | |
q64890 | test | function(options) {
var regions = _.isFunction(this.regions) ? this.regions(options) : this.regions || {};
this._initRegionManager();
// Enable users to define `regions` in instance options.
var optionRegions = Marionette.getOption(options, 'regions');
// Enable region options to ... | javascript | {
"resource": ""
} | |
q64891 | test | function() {
this._regionManager = this.getRegionManager();
this._regionManager._parent = this;
this.listenTo(this._regionManager, 'before:add:region', function() {
Marionette._triggerMethod(this, 'before:add:region', arguments);
});
this.listenTo(this._regionManager, 'add:re... | javascript | {
"resource": ""
} | |
q64892 | test | function() {
this.channelName = _.result(this, 'channelName') || 'global';
this.channel = _.result(this, 'channel') || Backbone.Wreqr.radio.channel(this.channelName);
this.vent = _.result(this, 'vent') || this.channel.vent;
this.commands = _.result(this, 'commands') || this.channel.commands;
... | javascript | {
"resource": ""
} | |
q64893 | test | function() {
// if we are not initialized, don't bother finalizing
if (!this._isInitialized) { return; }
this._isInitialized = false;
this.triggerMethod('before:stop');
// stop the sub-modules; depth-first, to make sure the
// sub-modules are stopped / finalized before parents
... | javascript | {
"resource": ""
} | |
q64894 | test | function(app, moduleNames, moduleDefinition) {
var module = app;
// get the custom args passed in after the module definition and
// get rid of the module name and definition function
var customArgs = _.drop(arguments, 3);
// Split the module names and get the number of submodules.
... | javascript | {
"resource": ""
} | |
q64895 | test | function(parentModule, module, def, args) {
var fn = this._getDefine(def);
var startWithParent = this._getStartWithParent(def, module);
if (fn) {
module.addDefinition(fn, args);
}
this._addStartWithParent(parentModule, module, startWithParent);
} | javascript | {
"resource": ""
} | |
q64896 | _sigName | test | function _sigName(src) {
if (!_.isFunction(src)) return ''
let ret = _.trim(_.replace(src.toString(), 'function', ''))
ret = ret.substr(0, ret.indexOf('('))
return ret || ''
} | javascript | {
"resource": ""
} |
q64897 | test | function() {
var components = this.path.split('/');
for (var i = components.length - 1; i >= 0; --i) {
if (components[i].length > 0) {
return components[i];
}
}
return '/';
} | javascript | {
"resource": ""
} | |
q64898 | test | function(config) {
if (config.parent == null) {
Ext.Logger.error('Ext.device.filesystem.Entry#moveTo: You must specify a new `parent` of the entry.');
return null;
}
var me = this;
this.getEntry(
... | javascript | {
"resource": ""
} | |
q64899 | test | function(config) {
if (!config.success) {
Ext.Logger.error('Ext.device.filesystem.Entry#getParent: You must specify a `success` callback.');
return null;
}
var me = this;
this.getEntry(
{
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.