_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q11000 | manageEvents | train | function manageEvents(els, evList, cb, method, options) {
els = domToArray(els)
split(evList).forEach((e) => {
| javascript | {
"resource": ""
} |
q11001 | WriteData | train | function WriteData(Register, ByteArray, Callback)
{
i2cdevice.writeBytes(Register, | javascript | {
"resource": ""
} |
q11002 | createLazyBlock | train | function createLazyBlock(
{ resolver, chunkName, initModel, loadingView, messages } = {}
) {
const resolveState = { resolver: null, block: null, msgs: [], chunkName };
resolveState.resolver = createBlockResolver(resolver, resolveState);
const lazyLogic = createLazyLogic(resolveState, initModel);
const lazyVie... | javascript | {
"resource": ""
} |
q11003 | train | function(arg) {
var hash = crypto.createHash('md5')
.update(JSON.stringify(arg))
| javascript | {
"resource": ""
} | |
q11004 | error | train | function error(opts) {
//define your custom views
opts = opts || {};
//custom views
if(!opts.custom)
opts.custom={};
// better to disable layout in not explicity set, in case there are error in it
if(!opts.layout)
opts.layout= false;
// @todo to be easier to install, should render from this module... | javascript | {
"resource": ""
} |
q11005 | train | function(addresses) {
var defered = q.defer();
var currentStep = 0;
var numSteps = addresses.length;
var results = [];
var handleReadSuccess = function(res) {
results.push({'address': addresses[currentStep], 'isErr': false, 'data': res});
if(currentStep < numSteps) {
currentStep += 1;
performRe... | javascript | {
"resource": ""
} | |
q11006 | unpack | train | function unpack(kind, root, target, proto, source){
if (ownp(kind)) do_unpack(proto, source, methodize)
| javascript | {
"resource": ""
} |
q11007 | unpack_all | train | function unpack_all(kind, global) {
keys(this).forEach(function(module) {
module = this[module]
if (!fnp(module)) unpack( kind
, global || top
| javascript | {
"resource": ""
} |
q11008 | methodize | train | function methodize(fn) {
return function() { var args
args = slice.call(arguments)
| javascript | {
"resource": ""
} |
q11009 | createReadManufacturingInfoBundle | train | function createReadManufacturingInfoBundle() {
debugRMIOps('in createReadManufacturingInfoBundle');
// Initialize the bundle object with some basic data.
var bundle = {
'info': {},
'infoString': '',
'manufacturingData': manufacturingData,
'isError': false,
'errorStep': '',
'error': undefined,... | javascript | {
"resource": ""
} |
q11010 | readManufacturingInfoFlashData | train | function readManufacturingInfoFlashData(bundle) {
debugRMIOps('in readManufacturingInfoFlashData');
var defered = q.defer();
var startingAddress = 0x3C6000;
var numIntsToRead = 8*8;
self.readFlash(startingAddress, numIntsToRead)
.then(function(res) {
// res is an object with an attribute "results" that i... | javascript | {
"resource": ""
} |
q11011 | train | function(element, rule){
var elementClassName = element.className,
elementID = element.id,
elementTagName = element.tagName,
elementDisplayName = element.constructor.displayName;
if(rule.tagName && !this.tagName(rule.tagName, elementTagName, elementDisplayName)){
... | javascript | {
"resource": ""
} | |
q11012 | train | function(pseudoRule, element, elementTagName){
if(pseudoRule.name === 'checked'){
return this.checked(element, elementTagName);
}
| javascript | {
"resource": ""
} | |
q11013 | train | function(attributeRules, element){
for(var i = 0; i < attributeRules.length; i++){
var attributeName = attributeRules[i].name,
objectToCheck = element;
if(typeof element.context === 'undefined'){
//Native DOM node
if(_.startsWith(attributeN... | javascript | {
"resource": ""
} | |
q11014 | train | function(ruleClassName, elementClassName){
if(!elementClassName){
return false;
}
for(var i = 0; i < ruleClassName.length; i++){
if((' ' + elementClassName | javascript | {
"resource": ""
} | |
q11015 | train | function(element, tagName){
if(!tagName || tagName.toLowerCase() !== 'input'){
return false;
}
var inputType = element.type.toLowerCase();
if(inputType !== 'checkbox' && | javascript | {
"resource": ""
} | |
q11016 | train | function(property, operator, value){
if(operator === '='){
return this.compareElementPropertyEquality(property, value);
}
if(operator === '~='){
return String(property).split(" ").indexOf(value) !== -1;
| javascript | {
"resource": ""
} | |
q11017 | train | function(property, value){
//When doing direct comparisons, do some conversions between numbers, booleans, null/undefined since
//the value in the selector always comes through as a string
if(_.isNumber(property)){
return property === parseInt(value);
}
else if(_.isBo... | javascript | {
"resource": ""
} | |
q11018 | isVersionAtLeast | train | function isVersionAtLeast(dottedVersion, major, minor, patch){
var i, v, t,
verParts = $.map($.trim(dottedVersion).split("."), function(e){ return parseInt(e, 10); }),
testParts = $.map(Array.prototype.slice.call(arguments, 1), function(e){ return parseInt(e, 10); });
for( i = 0; i | javascript | {
"resource": ""
} |
q11019 | train | function(targetNode, mode, map) {
if(mode === undefined || mode === "over"){
mode = "child";
}
var pos,
prevParent = this.parent,
targetParent = (mode === "child") ? targetNode : targetNode.parent;
if(this === targetNode){
return;
}else if( !this.parent ){
throw "Cannot move system root";
}... | javascript | {
"resource": ""
} | |
q11020 | train | function(stopOnParents) {
var nodeList = [];
this.rootNode.visit(function(node){
if( node.selected ) {
nodeList.push(node);
if( stopOnParents === true ){
| javascript | {
"resource": ""
} | |
q11021 | train | function(setFocus) {
var node = this.activeNode;
if( node ) {
this.activeNode | javascript | {
"resource": ""
} | |
q11022 | train | function(ctx) {
// TODO: return promise?
if( ctx.targetType === "title" && ctx.options.clickFolderMode === 4) {
// this.nodeSetFocus(ctx);
// this._callHook("nodeSetActive", | javascript | {
"resource": ""
} | |
q11023 | train | function(ctx) {
var node = ctx.node;
// FT.debug("nodeRemoveChildMarkup()", node.toString());
// TODO: Unlink attr.ftnode to support GC
if(node.ul){
if( node.isRoot() ) {
$(node.ul).empty();
| javascript | {
"resource": ""
} | |
q11024 | train | function(ctx, flag) {
// ctx.node.debug("nodeSetFocus(" + flag + ")");
var ctx2,
tree = ctx.tree,
node = ctx.node;
flag = (flag !== false);
// Blur previous node if any
if(tree.focusNode){
if(tree.focusNode === node && flag){
// node.debug("nodeSetFocus(" + flag + "): nothing to do");
retur... | javascript | {
"resource": ""
} | |
q11025 | train | function(el){
if(el instanceof FancytreeNode){
return el; // el already was a FancytreeNode
}else if(el.selector !== undefined){
el = el[0]; // el was a jQuery object: use the DOM element
}else if(el.originalEvent !== undefined){
el | javascript | {
"resource": ""
} | |
q11026 | train | function(ctx, title) {
var node = ctx.node,
extOpts = ctx.options.childcounter,
count = (node.data.childCounter == null) ? node.countChildren(extOpts.deep) : +node.data.childCounter;
// Let the base implementation render the title
this._super(ctx, title);
// Append a counter badge
if( | javascript | {
"resource": ""
} | |
q11027 | train | function(event) {
var sourceNode = $.ui.fancytree.getNode(event.target);
if(!sourceNode){ // Dynatree issue 211
// might happen, if dragging a table *header*
return "<div>ERROR?: helper requested but sourceNode not found</div>"; | javascript | {
"resource": ""
} | |
q11028 | isResolved | train | function isResolved(schema, schemas) {
return (schema.deps || []).every(_.partial(function | javascript | {
"resource": ""
} |
q11029 | listDir | train | function listDir (path, originalPath) {
if (!originalPath) {
originalPath = path + separator;
}
// promises for sub listDir calls
var dirs = [];
return Promise.resolve(fs.readdir(path))
// include only files
.filter(function (item) {
var absolutePath = join(path, item);
return fs.st... | javascript | {
"resource": ""
} |
q11030 | read | train | function read(src, basedir, callback){
var page = | javascript | {
"resource": ""
} |
q11031 | apier | train | function apier(config) {
// on server start..
db.connect(config.mongoUrl);
accessVerifier.init(config.access);
schemaExtender.handleErrors = true;
reqlog.info('apier initialized!!');
var app = function(req, res) {
// this is the final handler | javascript | {
"resource": ""
} |
q11032 | endpoint | train | function endpoint(options) {
// find the middlewares
options.permissions = options.permissions || ['null'];
options.middlewares = options.middlewares || [];
options.middlewares.unshift([permissioner(options.permissions)]);
for (var i = 0, length = options.methods.length; i < length; i++) {
var | javascript | {
"resource": ""
} |
q11033 | routerCallback | train | function routerCallback(req, res, callback) {
var innerSelf = {
req: req,
res: res,
send: function(data) {
send.call(this, data);
},
setStatusCode: function(statusCode) {
setStatusCode.call(this, statusCode);
}
}; | javascript | {
"resource": ""
} |
q11034 | sync | train | function sync(schemas) {
var resolver = new Resolver(schemas);
// Reduce force sequential execution.
return Promise.resolve(Promise.reduce(resolver.resolve(), syncSchema.bind(this), []))
.tap(function () {
var knex = this.knex;
| javascript | {
"resource": ""
} |
q11035 | syncSchema | train | function syncSchema(result, schema) {
var knex = this.knex;
return knex.schema.hasTable(schema.tableName)
.then(function (exists) { | javascript | {
"resource": ""
} |
q11036 | defineSchemaTable | train | function defineSchemaTable(schema) {
return function (table) {
table.timestamps();
| javascript | {
"resource": ""
} |
q11037 | train | function( data ) {
var read_buffer = read_buffers_by_connection[tcp_connection];
read_buffer += data;
//split by new lines,
var messages = read_buffer.split('\n');
//last element is either a partial message, or ''
... | javascript | {
"resource": ""
} | |
q11038 | isArrayLikeObject | train | function isArrayLikeObject (subject) {
var length = subject.length
if (
typeof subject === 'function'
|| Object(subject) !== subject
|| typeof length !== 'number'
// `window` already has a | javascript | {
"resource": ""
} |
q11039 | clonePureArray | train | function clonePureArray (subject, host) {
var i = subject.length
| javascript | {
"resource": ""
} |
q11040 | MerkleTree | train | function MerkleTree(leaves, hasher) {
if (!(this instanceof MerkleTree)) {
return new MerkleTree(leaves, hasher);
}
this._hasher = hasher || this._hasher;
this._leaves = [];
this._depth = 0;
this._rows = [];
this._count = 0;
assert(Array.isArray(leaves), 'Invalid leaves | javascript | {
"resource": ""
} |
q11041 | queueTasks | train | function queueTasks (testTasks, buildTasks) {
// Queue up test tasks, removing them if already queued up
_.forEach({ test: testTasks, build: buildTasks }, (queuingTasks, type) => {
_.forEach(queuingTasks, (task) => {
// Remove if already queued
const removed = _.remove(queue[type... | javascript | {
"resource": ""
} |
q11042 | executeQueuedTasks | train | function executeQueuedTasks () {
// Delay execution to allow for more tasks to queue up
setTimeout(() => {
// Check if already executing and if any tasks ready for execution
if (!executing && (queue.test.length || queue.build.length)) {
// Flag executing status
executing ... | javascript | {
"resource": ""
} |
q11043 | train | function () {
return {
lineSeparator: '\n', // done
maxLength: 120, // TODO
wrapIfLong: false, // TODO
indent: 4, // done
useTabIndent: false, // done
spaces: {
around: {
unaryOperators: false, // TODO
... | javascript | {
"resource": ""
} | |
q11044 | train | function (defaults, configure) {
for (var key in defaults) {
if (defaults.hasOwnProperty(key)) {
if (typeof defaults[key] === 'object') {
// recursive
if (typeof configure[key] === 'object') {
overwriteConfig(defaults[ke... | javascript | {
"resource": ""
} | |
q11045 | train | function () {
var indentStr = '';
for (var i = 0; i < indentLevel; i++) {
indentStr += INDENT;
}
| javascript | {
"resource": ""
} | |
q11046 | train | function (token) {
var inline = false;
if (token) {
if (token.type === 'LineComment') {
inline = true;
} else if (token.type === 'BlockComment') {
| javascript | {
"resource": ""
} | |
q11047 | train | function (startToken, endToken, types) {
var is = true;
var token = startToken;
while (token.next && token.next !== endToken) {
token = token.next;
| javascript | {
"resource": ""
} | |
q11048 | pathExpression | train | function pathExpression (token, tokens) {
const expression = []
while (true) {
if (!token) {
break
}
if (token === ')') {
tokens.unshift(token)
break
}
if (includes('}]', token)) {
throw new Error(`A fragment can't contain "${token}"`)
}
if (token === ',') {
... | javascript | {
"resource": ""
} |
q11049 | context | train | function context(str) {
var arr = code(str);
var len = arr.length, i = 0;
var res = {};
while (len--) {
var ele = arr[i++];
| javascript | {
"resource": ""
} |
q11050 | format | train | function format(obj, opts, fn) {
if (typeof opts === 'function') {
fn = opts; opts = {};
}
opts = opts || {};
if (Array.isArray(opts.filter) || typeof opts.filter === 'string') {
obj = filter(obj, opts.filter);
}
var keys = Object.keys(obj);
var len = keys.length, i = 0;
var str = '';
var to... | javascript | {
"resource": ""
} |
q11051 | listify | train | function listify(fp, methods, ctx) {
var len = methods.length, i = 0;
var res = [''];
while (len--) {
var method = methods[i++];
var line = ctx[method];
var item = line ? linkify('.' | javascript | {
"resource": ""
} |
q11052 | tableize | train | function tableize(tableData) {
var table = new Table({
head: Object.keys(tableData[0]),
chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''},
style: { 'padding-left': 0, 'padding-right': 0 | javascript | {
"resource": ""
} |
q11053 | CreateSchemedProperty | train | function CreateSchemedProperty(object, scheme, schema_name, index) {
if (object[schema_name])
return;
Object.defineProperty(object, schema_name, {
configurable: false,
enumerable: true,
get: function() {
return this.getHook(schema_name, this.prop_array[index]);
... | javascript | {
"resource": ""
} |
q11054 | CreateModelProperty | train | function CreateModelProperty(object, model, schema_name, index) {
Object.defineProperty(object, schema_name, {
configurable: false,
enumerable: true,
get: function() {
let m = this.prop_array[index];
if (!m) {
let address = this.address.slice();
... | javascript | {
"resource": ""
} |
q11055 | train | function(node = this.fch) {
if (node && node.nxt != this.fch && this.fch)
| javascript | {
"resource": ""
} | |
q11056 | train | function(index, node = this.fch) {
if(node.par !== this)
node = this.fch;
let first = node;
let i = 0;
while (node && node != first) {
if (i++ == index)
| javascript | {
"resource": ""
} | |
q11057 | JSExpressionIdentifiers | train | function JSExpressionIdentifiers(lex) {
let _identifiers_ = [];
let model_cache = {};
let IN_OBJ = false,
CAN_BE_ID = true;
while (!lex.END) {
switch (lex.ty) {
case lex.types.id:
if (!IN_OBJ || CAN_BE_ID) {
let id = lex.tx;
... | javascript | {
"resource": ""
} |
q11058 | TransformTo | train | function TransformTo(element_from, element_to, duration = 500, easing = Animation.easing.linear, HIDE_OTHER) {
let rect = element_from.getBoundingClientRect();
let cs = window.getComputedStyle(element_from, null);
let margin_left = parseFloat(cs.getPropertyValue("margin"));
let seq = Animation.cre... | javascript | {
"resource": ""
} |
q11059 | CreateHTMLNode | train | function CreateHTMLNode(tag) {
//jump table.
switch (tag[0]) {
case "w":
switch (tag) {
case "w-s":
return new SourceNode$1(); //This node is used to
case "w-c":
return new SourceTemplateNode$1(); //This node is used to... | javascript | {
"resource": ""
} |
q11060 | CompileSource | train | function CompileSource(SourcePackage, presets, element, url, win = window) {
let lex;
if (element instanceof whind$1.constructor) {
lex = element;
} else if (typeof(element) == "string")
lex = whind$1(element);
else if (element instanceof EL) {
if (element.tagName == "TEMPLATE") | javascript | {
"resource": ""
} |
q11061 | parseCSSSelector | train | function parseCSSSelector(selector) {
const match = SELECTOR_RE.exec(selector);
if (!match) {
throw new Error("Unsupported or invalid CSS selector: " + selector);
}
const res = { nodeName: match[1].trim() };
if (match[2]) {
const attr = [match[2]];
if (match[3]) { attr.push(m... | javascript | {
"resource": ""
} |
q11062 | train | function(type, listener) {
checkListener(listener);
var events = this.$e;
var listeners;
if (events && (listeners = events[type])) {
if (isFunction(listeners)) {
if (listeners === listener) {
delete events[type];
}
... | javascript | {
"resource": ""
} | |
q11063 | FindFreePortSync | train | function FindFreePortSync(options = {}) {
this.defaultOptions = {
// port start for scan
start: 1,
// port end for scan
end: 65534,
// ports number for scan
num: 1,
// specify ip for scan
ip: '0.0.0.0|127.0.0.1',
// for inner usage, some platfo... | javascript | {
"resource": ""
} |
q11064 | train | function(name, val, options) {
debug('.generator', name, val);
if (this.hasGenerator(name)) {
| javascript | {
"resource": ""
} | |
q11065 | train | function(name, val, options) {
debug('.setGenerator', name);
if (this.hasGenerator(name)) {
return this.findGenerator(name);
}
// ensure local sub-generator paths are resolved
| javascript | {
"resource": ""
} | |
q11066 | fn | train | function fn(name, options) {
debug('.findGenerator', name);
if (utils.isObject(name)) {
return name;
}
if (Array.isArray(name)) {
name = name.join('.');
}
if (typeof name !== 'string') {
throw new TypeError('expected name to be a string');
... | javascript | {
"resource": ""
} |
q11067 | train | function(name, options) {
if (this.generators.hasOwnProperty(name)) {
return this.generators[name];
}
if (~name.indexOf('.')) {
return this.getSubGenerator.apply(this, arguments);
}
var opts = utils.extend({}, this.options, options);
if (typeof opts.... | javascript | {
"resource": ""
} | |
q11068 | train | function(name, options) {
debug('.getSubGenerator', name);
var segs = name.split('.');
var len = segs.length;
var idx = -1;
var app = this;
while (++idx < len) {
| javascript | {
"resource": ""
} | |
q11069 | train | function(name, options, fn) {
debug('.lookupGenerator', name);
if (typeof options === 'function') {
fn = options;
options = {};
}
if (typeof fn !== 'function') {
throw new TypeError('expected `fn` to be a lookup function');
}
options = opti... | javascript | {
"resource": ""
} | |
q11070 | train | function(name, options) {
if (typeof name === 'function') {
this.use(name, options);
return this;
}
if (Array.isArray(name)) {
var len = name.length;
var idx = -1;
while (++idx < len) {
this.extendWith(name[idx], options);
... | javascript | {
"resource": ""
} | |
q11071 | train | function(name, options) {
if (typeof options === 'function') {
return options(name);
}
if (options && typeof options.toAlias === 'function') | javascript | {
"resource": ""
} | |
q11072 | map | train | function map() {
var cache = {};
if (!cache.extensions) cache.extensions = require('./lib/exts.json');
if | javascript | {
"resource": ""
} |
q11073 | isUrl | train | function isUrl(url, error) {
if (!Assertions.urlPattern.test(url)) {
if (error) {
throw new Error("Given url is not valid ! URL :" + url);
| javascript | {
"resource": ""
} |
q11074 | isReactComponent | train | function isReactComponent(instance, error) {
/* disable-eslint no-underscore-dangle */
if (!(instance && instance.$$typeof)) {
if (error) {
| javascript | {
"resource": ""
} |
q11075 | extractVerticalComponent | train | function extractVerticalComponent(accelerometerData, attitudeData) {
var res=[];
var rm;
for (var i=0;i<accelerometerData.length;i++){
rm=new Matrix(module.exports.composeRotation(attitudeData[i][0],attitudeData[i][1],0));
res[i]=new | javascript | {
"resource": ""
} |
q11076 | Filter | train | function Filter(options) {
this.options = options || {};
for (var group in | javascript | {
"resource": ""
} |
q11077 | errorPage | train | function errorPage(res, err) {
if (err) {
console.error(err.message);
res.send(err, | javascript | {
"resource": ""
} |
q11078 | compileAndRender | train | function compileAndRender(templatePath, content, callback) {
if (templatePath in templates) {
return callback(null, templates[templatePath].render(content));
}
fs.readFile(templatePath, 'utf8', function(err, template) {
if (err) {
| javascript | {
"resource": ""
} |
q11079 | search | train | function search(searched, callback) {
var root = pathUtils.resolve(options.root);
// search command is platform dependant: use grep on linux, and findstr on windaube.
var command = os.platform() === 'win32' ?
'findstr /spin /c:"'+searched+'" '+ pathUtils.join(root, '*.*') :
'grep -rin "'+searched+'" '+root... | javascript | {
"resource": ""
} |
q11080 | train | function(aggregate, vm, callback) {
if(aggregate.get('destroyed')) {
var reason = {
name: 'AggregateDestroyed',
message: 'Aggregate has already been destroyed!',
aggregateRevision: aggregate.get('revision'),
... | javascript | {
"resource": ""
} | |
q11081 | train | function(aggregate, vm, callback) {
self.validate(cmd.command, cmd.payload, function(err) {
| javascript | {
"resource": ""
} | |
q11082 | train | function(aggregate, vm, callback) {
aggregate[cmd.command](cmd.payload, function(err) {
| javascript | {
"resource": ""
} | |
q11083 | train | function(aggregate, vm, callback) {
vm.set(aggregate.toJSON());
| javascript | {
"resource": ""
} | |
q11084 | acceptMatcher | train | function acceptMatcher(acc, actual) {
/* Exact match or full wildcard match on both type and subtype */
if (actual.contentType === acc.item || acc.item === '*/*') return true;
/* Otherwise check for "*" wildcard matches */
const a = acc.item.split(MIME_SUBTYPE_SEPARATOR);
const accepted = {
type: a[0],
... | javascript | {
"resource": ""
} |
q11085 | train | function (property) {
var isString;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
return this[property];
}
// avoid split if possible
var chain = isString ? property.split(".") : property,
currentValue = this,
currentProperty;
/... | javascript | {
"resource": ""
} | |
q11086 | train | function (property, value) {
var isString, hasChanged, oldValue, chain;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
hasChanged = (oldValue = this[property]) !== value;
if (hasChanged) this[property] = value;
} else {
// avoid split if pos... | javascript | {
"resource": ""
} | |
q11087 | train | function () {
var obj = {}, value;
var keys = Object.keys(this);
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
if (key.substr(0, 2) === "__") continue;
| javascript | {
"resource": ""
} | |
q11088 | cast | train | function cast(data, EntityClass) {
// Check if/how EntityClass is defined or implied
if (!EntityClass && !_lodash2.default.isArray(data)) {
// No explicit class definition, casting data not array
return _dataManagement2.default.cast(data, this);
} else if (!EntityClass && _lodash2.defa... | javascript | {
"resource": ""
} |
q11089 | getClassExtensions | train | function getClassExtensions(classes) {
// Extract property definitions from all inherited classes' static ".props" property
var extensions = _lodash2.default.reduceRight(classes, function (extensions, current) {
var | javascript | {
"resource": ""
} |
q11090 | getClassProperties | train | function getClassProperties(classes) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
extensionsManager = _ref.extensionsManager;
// Define checks for shorthand casting configurations
var isPropertyShorthandCastAsSingleEntity = function isPropertyShorthandCastAsSingleEnt... | javascript | {
"resource": ""
} |
q11091 | train | function ( settings, opts ) {
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.1' ) ) {
throw 'DataTables Responsive requires DataTables 1.10.1 or newer';
}
this.s = {
dt: new DataTable.Api( settings ),
columns: []
};
// Check if r... | javascript | {
"resource": ""
} | |
q11092 | train | function ( colIdx, name ) {
var includeIn = columns[ colIdx ].includeIn;
if ( $.inArray( name, includeIn | javascript | {
"resource": ""
} | |
q11093 | train | function ()
{
var that = this;
var dt = this.s.dt;
var details = this.c.details;
// The inline type always uses the first child as the target
if ( details.type === 'inline' ) {
details.target = 'td:first-child';
}
// type.target can be a string jQuery selector or a column index
var target ... | javascript | {
"resource": ""
} | |
q11094 | train | function ()
{
var that = this;
var dt = this.s.dt;
// Find how many columns are hidden
var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
var col = dt.column( idx );
if ( col.visible() ) {
return null;
}
// Only counts as hidden if it doesn't have the `never` class
retu... | javascript | {
"resource": ""
} | |
q11095 | train | function ( name )
{
var breakpoints = this.c.breakpoints;
for ( var i=0, ien=breakpoints.length ; i<ien ; i++ ) {
| javascript | {
"resource": ""
} | |
q11096 | train | function ()
{
var dt = this.s.dt;
var width = $(window).width();
var breakpoints = this.c.breakpoints;
var breakpoint = breakpoints[0].name;
var columns = this.s.columns;
var i, ien;
// Determine what breakpoint we are currently at
for ( i=breakpoints.length-1 ; i>=0 ; i-- ) {
if ( width <= breakpo... | javascript | {
"resource": ""
} | |
q11097 | train | function ()
{
var dt = this.s.dt;
var columns = this.s.columns;
// Are we allowed to do auto sizing?
if ( ! this.c.auto ) {
return;
}
// Are there any columns that actually need auto-sizing, or do they all
// have classes defined
if ( $.inArray( true, $.map( columns, function (c) { return c.auto; ... | javascript | {
"resource": ""
} | |
q11098 | Content | train | function Content(mimeType, content) {
var obj = {};
obj.type = mimeType + '; charset=utf-8';
obj.value | javascript | {
"resource": ""
} |
q11099 | train | function(cmdPointer, next) {
// Publish it now...
commandDispatcher.dispatch(cmdPointer.command, function(err) {
| javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.