_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10600 | Columns | train | function Columns(props) {
// require and bind methods
//----------------------------------------------------------
[ 'bindState'
, 'solve'
].forEach(method =>
this.constructor.prototype[method] = | javascript | {
"resource": ""
} |
q10601 | train | function(str, maxLength, where) {
if (!_.isString(str)) {
return str;
}
var strLength = str.length;
if (strLength <= maxLength) {
return str;
}
// limit the length of the series name by dropping characters and inserting an ELLIPSIS where... | javascript | {
"resource": ""
} | |
q10602 | processContents | train | function processContents(
contentDir, contentRoot,
submenuFile, contentStock, menuStock,
references, language, renderer
) {
var typeName = 'Content';
// Read directory items.
var items = fs.readdirSync( path.join( process.cwd(), contentDir ) );
items.forEach( function ( item ) {
// Get full path o... | javascript | {
"resource": ""
} |
q10603 | toState | train | function toState (preset) {
if (preset) {
const norm = (preset.replace(/[^012345678]/g, "") + "000000000").slice(0, 9)
const | javascript | {
"resource": ""
} |
q10604 | train | function (name, extension, engine) {
// add to storage
this[name] = engine.render || engine;
| javascript | {
"resource": ""
} | |
q10605 | train | function (name, options, cb) {
var engine = enginesByExtension[this.ext],
that = this,
// queue
stack = [],
ctx = {
name : name,
options : options,
c... | javascript | {
"resource": ""
} | |
q10606 | addListener | train | function addListener(uid) {
var addedListener = false;
if(typeof(dashboardListeners[uid]) === 'undefined') {
dashboardListeners[uid] = {
'startTime': new Date(), | javascript | {
"resource": ""
} |
q10607 | removeListener | train | function removeListener(uid) {
var removedListener = false;
if(typeof(dashboardListeners[uid]) !== 'undefined') {
dashboardListeners[uid] = undefined;
| javascript | {
"resource": ""
} |
q10608 | dataCollectorHandler | train | function dataCollectorHandler(data) {
// debugDDC('New data', data['FIO0']);
var diffObj = _.diff(data, self.dataCache);
// console.log('Data Difference - diff', diffObj);
// Clean the object to get rid of empty results.
diffObj = _.pickBy(diffObj, function(value, key) {
return Object.keys(value).length >... | javascript | {
"resource": ""
} |
q10609 | innerStart | train | function innerStart (bundle) {
var defered = q.defer();
// Device Type is either T4, T5, or T7
var deviceType = self.savedAttributes.deviceTypeName;
// Save the created data collector object
dataCollector = new dashboard_data_collector.create(deviceType);
// Listen to only the next 'data' event emitted b... | javascript | {
"resource": ""
} |
q10610 | train | function(k, i) {
var rval;
if(typeof(k) === 'undefined') {
rval = frag.query;
} else {
rval = frag.query[k];
| javascript | {
"resource": ""
} | |
q10611 | _expandKey | train | function _expandKey(key, decrypt) {
// copy the key's words to initialize the key schedule
var w = key.slice(0);
/* RotWord() will rotate a word, moving the first byte to the last
byte's position (shifting the other bytes left).
We will be getting the value of Rcon at i / Nk. 'i' will iterate
... | javascript | {
"resource": ""
} |
q10612 | _update | train | function _update(s, w, bytes) {
// consume 512 bit (64 byte) chunks
var t, a, b, c, d, f, r, i;
var len = bytes.length();
while(len >= 64) {
// initialize hash value for this chunk
a = s.h0;
b = s.h1;
c = s.h2;
d = s.h3;
// round 1
for(i = 0; i < 16; ++i) {
w[i] =... | javascript | {
"resource": ""
} |
q10613 | _reseed | train | function _reseed(callback) {
if(ctx.pools[0].messageLength >= 32) {
_seed();
return callback();
}
// not enough seed data...
var needed = (32 - ctx.pools[0].messageLength) << 5;
ctx.seedFile(needed, function(err, bytes) {
| javascript | {
"resource": ""
} |
q10614 | train | function(e) {
var data = e.data;
if(data.forge && data.forge.prng) {
ctx.seedFile(data.forge.prng.needed, function(err, | javascript | {
"resource": ""
} | |
q10615 | train | function(iv, output) {
if(iv) {
/* CBC mode */
if(typeof iv === 'string') {
iv = forge.util.createBuffer(iv);
}
}
_finish = false;
_input = forge.util.createBuffer();
| javascript | {
"resource": ""
} | |
q10616 | generateRandom | train | function generateRandom(bits, rng) {
var num = new BigInteger(bits, rng);
// force MSB set
var bits1 = bits - 1;
if(!num.testBit(bits1)) {
num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num);
| javascript | {
"resource": ""
} |
q10617 | train | function(md) {
// get the oid for the algorithm
var oid;
if(md.algorithm in pki.oids) {
oid = pki.oids[md.algorithm];
} else {
var error = new Error('Unknown message digest algorithm.');
error.algorithm = md.algorithm;
throw error;
}
var oidBytes = asn1.oidToDer(oid).getBytes();
... | javascript | {
"resource": ""
} | |
q10618 | _getAttribute | train | function _getAttribute(obj, options) {
if(typeof options === 'string') {
options = {shortName: options};
}
var rval = null;
var attr;
for(var i = 0; rval === null && i < obj.attributes.length; ++i) {
attr = obj.attributes[i];
if(options.type && options.type === attr.type) {
rval =... | javascript | {
"resource": ""
} |
q10619 | train | function(oid, obj, fillDefaults) {
var params = {};
if(oid !== oids['RSASSA-PSS']) {
return params;
}
if(fillDefaults) {
params = {
hash: {
algorithmOid: oids['sha1']
},
mgf: {
algorithmOid: oids['mgf1'],
hash: {
algorithmOid: oids['sh... | javascript | {
"resource": ""
} | |
q10620 | _dnToAsn1 | train | function _dnToAsn1(obj) {
// create an empty RDNSequence
var rval = asn1.create(
asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
// iterate over attributes
var attr, set;
var attrs = obj.attributes;
for(var i = 0; i < attrs.length; ++i) {
attr = attrs[i];
var value = attr.value;
... | javascript | {
"resource": ""
} |
q10621 | _signatureParametersToAsn1 | train | function _signatureParametersToAsn1(oid, params) {
switch(oid) {
case oids['RSASSA-PSS']:
var parts = [];
if(params.hash.algorithmOid !== undefined) {
parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
... | javascript | {
"resource": ""
} |
q10622 | _getBagsByAttribute | train | function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {
var result = [];
for(var i = 0; i < safeContents.length; i ++) {
for(var j = 0; j < safeContents[i].safeBags.length; j ++) {
var bag = safeContents[i].safeBags[j];
if(bagType !== undefined && bag.type | javascript | {
"resource": ""
} |
q10623 | train | function(c, record, s) {
var rval = false;
try {
var bytes = c.inflate(record.fragment.getBytes());
record.fragment = forge.util.createBuffer(bytes);
record.length = bytes.length;
| javascript | {
"resource": ""
} | |
q10624 | train | function(b, lenBytes) {
var len = 0;
switch(lenBytes) {
case 1:
len = b.getByte();
break;
case 2:
len = b.getInt16();
break;
case 3:
len = b.getInt24();
break;
case 4:
len = b.getInt32();
| javascript | {
"resource": ""
} | |
q10625 | train | function(b, lenBytes, v) {
// encode length at the start of the vector, where the number of bytes for
// the length is the maximum number of bytes it would take to encode the
| javascript | {
"resource": ""
} | |
q10626 | train | function(desc) {
switch(desc) {
case true:
return true;
case tls.Alert.Description.bad_certificate:
return forge.pki.certificateError.bad_certificate;
case tls.Alert.Description.unsupported_certificate:
return forge.pki.certificateError.unsupported_certificate;
case tls.Alert.Description.c... | javascript | {
"resource": ""
} | |
q10627 | train | function(c, record) {
// get record handler (align type in table by subtracting lowest)
var aligned = record.type - tls.ContentType.change_cipher_spec;
var handlers = ctTable[c.entity][c.expect];
if(aligned in handlers) {
| javascript | {
"resource": ""
} | |
q10628 | train | function(c) {
var rval = 0;
// get input buffer and its length
var b = c.input;
var len = b.length();
// need at least 5 bytes to initialize a record
if(len < 5) {
rval = 5 - len;
} else {
// enough bytes for header
// initialize record
c.record = {
... | javascript | {
"resource": ""
} | |
q10629 | train | function(c) {
var rval = 0;
// ensure there is enough input data to get the entire record
var b = c.input;
var len = b.length();
if(len < c.record.length) {
// not enough data yet, return how much is required
rval = c.record.length - len;
} else {
// there is enough ... | javascript | {
"resource": ""
} | |
q10630 | encrypt_aes_cbc_sha1_padding | train | function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) {
/* The encrypted data length (TLSCiphertext.length) is one more than the sum
of SecurityParameters.block_length, TLSCompressed.length,
SecurityParameters.mac_length, and padding_length.
The padding may be any length up to 255 bytes long... | javascript | {
"resource": ""
} |
q10631 | compareMacs | train | function compareMacs(key, mac1, mac2) {
var hmac = forge.hmac.create();
hmac.start('SHA1', key);
hmac.update(mac1);
mac1 = hmac.digest().getBytes();
hmac.start(null, | javascript | {
"resource": ""
} |
q10632 | _createKDF | train | function _createKDF(kdf, md, counterStart, digestLength) {
/**
* Generate a key of the specified length.
*
* @param x the binary-encoded byte string to generate a key from.
* @param length the number of bytes to generate (the size of the key).
*
* @return the key as a binary-encoded string.
... | javascript | {
"resource": ""
} |
q10633 | train | function(logger, message) {
forge.log.prepareStandardFull(message);
| javascript | {
"resource": ""
} | |
q10634 | train | function(cert) {
// convert from PEM
if(typeof cert === 'string') {
| javascript | {
"resource": ""
} | |
q10635 | train | function(cert) {
var sAttr = cert.issuer.attributes;
for(var i = 0; i < msg.recipients.length; ++i) {
var r = msg.recipients[i];
var rAttr = r.issuer;
if(r.serialNumber !== cert.serialNumber) {
continue;
}
if(rAttr.length !== sAttr.length) {
... | javascript | {
"resource": ""
} | |
q10636 | train | function(recipient, privKey) {
if(msg.encryptedContent.key === undefined && recipient !== undefined &&
privKey !== undefined) {
switch(recipient.encryptedContent.algorithm) {
case forge.pki.oids.rsaEncryption:
case forge.pki.oids.desCBC:
var key = privKey.decr... | javascript | {
"resource": ""
} | |
q10637 | train | function(key, cipher) {
// Part 1: Symmetric encryption
if(msg.encryptedContent.content === undefined) {
cipher = cipher || msg.encryptedContent.algorithm;
key = key || msg.encryptedContent.key;
var keyLen, ivLen, ciphFn;
switch(cipher) {
case forge.pki.oid... | javascript | {
"resource": ""
} | |
q10638 | _recipientFromAsn1 | train | function _recipientFromAsn1(obj) {
// validate EnvelopedData content block and capture data
var capture = {};
var errors = [];
if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {
var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +
'ASN.1 object is not an PKCS#7 Re... | javascript | {
"resource": ""
} |
q10639 | _recipientToAsn1 | train | function _recipientToAsn1(obj) {
return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
// Version
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
asn1.integerToDer(obj.version).getBytes()),
// IssuerAndSerialNumber
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQU... | javascript | {
"resource": ""
} |
q10640 | _recipientsFromAsn1 | train | function _recipientsFromAsn1(infos) {
var ret = [];
for(var i = 0; i < infos.length; ++i) {
| javascript | {
"resource": ""
} |
q10641 | _recipientsToAsn1 | train | function _recipientsToAsn1(recipients) {
var ret = [];
for(var i = 0; i < recipients.length; ++i) {
| javascript | {
"resource": ""
} |
q10642 | _signerFromAsn1 | train | function _signerFromAsn1(obj) {
// validate EnvelopedData content block and capture data
var capture = {};
var errors = [];
if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {
var error = new Error('Cannot read PKCS#7 SignerInfo. ' +
'ASN.1 object is not an PKCS#7 SignerInfo.... | javascript | {
"resource": ""
} |
q10643 | _signerToAsn1 | train | function _signerToAsn1(obj) {
// SignerInfo
var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
// version
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
asn1.integerToDer(obj.version).getBytes()),
// issuerAndSerialNumber
asn1.create(asn1.Class.UNIVERS... | javascript | {
"resource": ""
} |
q10644 | _signersFromAsn1 | train | function _signersFromAsn1(signerInfoAsn1s) {
var ret = [];
for(var i = 0; i < signerInfoAsn1s.length; ++i) {
| javascript | {
"resource": ""
} |
q10645 | _signersToAsn1 | train | function _signersToAsn1(signers) {
var ret = [];
for(var i = 0; i < signers.length; ++i) {
| javascript | {
"resource": ""
} |
q10646 | _attributeToAsn1 | train | function _attributeToAsn1(attr) {
var value;
// TODO: generalize to support more attributes
if(attr.type === forge.pki.oids.contentType) {
value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
asn1.oidToDer(attr.value).getBytes());
} else if(attr.type === forge.pki.oids.messageDigest... | javascript | {
"resource": ""
} |
q10647 | _encryptedContentToAsn1 | train | function _encryptedContentToAsn1(ec) {
return [
// ContentType, always Data for the moment
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
asn1.oidToDer(forge.pki.oids.data).getBytes()),
// ContentEncryptionAlgorithmIdentifier
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, t... | javascript | {
"resource": ""
} |
q10648 | _sha1 | train | function _sha1() {
var sha = forge.md.sha1.create();
var num = arguments.length;
| javascript | {
"resource": ""
} |
q10649 | train | function(options) {
// task id
this.id = -1;
// task name
this.name = options.name || sNoTaskName;
// task has no parent
this.parent = options.parent || null;
// save run function
this.run = options.run;
// create a queue of subtasks to run
this.subtasks = [];
// error flag
... | javascript | {
"resource": ""
} | |
q10650 | train | function(task) {
task.error = false;
task.state = sStateTable[task.state][START];
setTimeout(function() {
if(task.state === RUNNING) {
task.swapTime = +new | javascript | {
"resource": ""
} | |
q10651 | bundle | train | function bundle() {
return browserify( config.inputDir + config.inputFile ).bundle()
.pipe(
source( config.outputFile )
)
.pipe(
rename( config.outputFile )
)
.pipe(
gulp.dest( config.outputDir ) // Create the .devel.js
)
.pipe(
streamify( jsmin() )
)
.pipe(... | javascript | {
"resource": ""
} |
q10652 | GhPolyglot | train | function GhPolyglot (input, token, host) {
var splits = input.split("/");
this.user = splits[0];
this.repo = splits[1]; | javascript | {
"resource": ""
} |
q10653 | getInnerLimit | train | function getInnerLimit() {
var items = getItems();
var notInDeck = 0;
if (items.length) {
do {
notInDeck = notInDeck + 1;
var cont = false;
var item = items[items.length - notInDeck];
if (item) {
var area = getArea(item);
| javascript | {
"resource": ""
} |
q10654 | addEventListeners | train | function addEventListeners() {
ctrl.ngelt.on('wheel', wheelOnElt);
ctrl.ngelt.on('computegrabbersizes', ctrl.updateSize);
// ctrl.elt.addEventListener("wheel", function (event) {
// boxesScrollServices.execAndApplyIfScrollable($scope, this, wheel, [event]);
// }, {passive: true, capture: true});
ctrl.ng... | javascript | {
"resource": ""
} |
q10655 | keydown | train | function keydown(event) {
var inc = 0;
if (ctrl.horizontal) {
if (event.which === 37) { // LEFT
inc = -1;
} else if (event.which === 39) { // RIGHT
inc = 1;
}
} else {
var innerLimit = ctrl.getInnerLimit();
if (event.which === 38) { // UP
inc = -1;
} else if (event.which ... | javascript | {
"resource": ""
} |
q10656 | isScrollbarOver | train | function isScrollbarOver(m) {
return | javascript | {
"resource": ""
} |
q10657 | updateGrabberSizes | train | function updateGrabberSizes() {
if (ctrl.horizontal !== undefined) {
var bgSizeElt = ctrl.ngelt.css('background-size');
var bgSizeSb = ctrl.ngsb.css('background-size');
var grabbersizePixel = '100%';
if(getInnerLimit() !== $scope.total) {
grabbersizePixel = getGrabberSizePixelFromPercent(getGra... | javascript | {
"resource": ""
} |
q10658 | getGrabberOffsetPixelFromPercent | train | function getGrabberOffsetPixelFromPercent(percentOffset) {
var sbLenght = getHeightArea(); // Longueur de la scrollbar
var | javascript | {
"resource": ""
} |
q10659 | getOffsetPixelContainerBeforeItem | train | function getOffsetPixelContainerBeforeItem(item) {
if (ctrl.horizontal) {
return getArea(item).left - getEltArea().left;
| javascript | {
"resource": ""
} |
q10660 | train | function(file, enc, cb) {
if (
!file.isNull() &&
!file.isDirectory() &&
options.extensions.some(function(ext) {
return path.extname(file.path).substr(1).toLowerCase() === ext;
})
) {
file = retina.tapFile(file, cb);
| javascript | {
"resource": ""
} | |
q10661 | joinParts | train | function joinParts(entrances) {
var parts = [];
parts.push(Buffer(content.substring(0, matches.index)));
parts.push(Buffer('styles: [`'));
for (var i=0; i<entrances.length; i++) {
parts.push(Buffer(entrances[i].replace(/\n/g, '')));
if (i < entrances.length - 1)... | javascript | {
"resource": ""
} |
q10662 | train | function (subject) {
var t = kb.findTypeURIs(subject)
if (t[ns.vcard('Individual').uri]) return 'Contact'
if (t[ns.vcard('Organization').uri]) return 'contact'
if (t[ns.foaf('Person').uri]) return 'Person'
if (t[ns.schema('Person').uri]) return 'Person'
if | javascript | {
"resource": ""
} | |
q10663 | train | function (books, context, options) {
kb.fetcher.load(books).then(function (xhr) {
| javascript | {
"resource": ""
} | |
q10664 | findBookFromGroups | train | function findBookFromGroups (book) {
if (book) {
return book
}
var g
for (let gu in selectedGroups) {
g = kb.sym(gu)
let b = kb.any(undefined, ns.vcard('includesGroup'), g)
if (b) return b | javascript | {
"resource": ""
} |
q10665 | train | function (book, name, selectedGroups, callbackFunction) {
book = findBookFromGroups(book)
var nameEmailIndex = kb.any(book, ns.vcard('nameEmailIndex'))
var uuid = UI.utils.genUuid()
var person = kb.sym(book.dir().uri + 'Person/' + uuid + '/index.ttl#this')
var doc = person.doc()... | javascript | {
"resource": ""
} | |
q10666 | train | function (book, name, callbackFunction) {
var gix = kb.any(book, ns.vcard('groupIndex'))
var x = book.uri.split('#')[0]
var gname = name.replace(' ', '_')
var doc = kb.sym(x.slice(0, x.lastIndexOf('/') + 1) + 'Group/' + gname + '.ttl')
var group = kb.sym(doc.uri + '#this')
... | javascript | {
"resource": ""
} | |
q10667 | train | function (x) {
var name = kb.any(x, ns.vcard('fn')) ||
kb.any(x, | javascript | {
"resource": ""
} | |
q10668 | deleteThing | train | function deleteThing (x) {
console.log('deleteThing: ' + x)
var ds = kb.statementsMatching(x).concat(kb.statementsMatching(undefined, undefined, x))
var targets = {}
ds.map(function (st) { targets[st.why.uri] = st })
var agenda = [] // sets of statements of same dcoument to delet... | javascript | {
"resource": ""
} |
q10669 | deleteRecursive | train | function deleteRecursive (kb, folder) {
return new Promise(function (resolve, reject) {
kb.fetcher.load(folder).then(function () {
let promises = kb.each(folder, ns.ldp('contains')).map(file => {
if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
... | javascript | {
"resource": ""
} |
q10670 | train | function (uris) {
uris.forEach(function (u) {
console.log('Dropped on group: ' + u)
var thing = kb.sym(u)
var toBeFetched = [thing.doc(), group.doc()]
kb.fetcher.load(toBeFetched).then(function (xhrs) {
var type... | javascript | {
"resource": ""
} | |
q10671 | train | function (uris) {
uris.map(function (u) {
var thing = $rdf.sym(u) // Attachment needs text label to disinguish I think not icon.
console.log('Dropped on mugshot thing ' + thing) // icon was: UI.icons.iconBase + 'noun_25830.svg'
if (u.startsWith('http') && u.indexOf('#') < 0) { // P... | javascript | {
"resource": ""
} | |
q10672 | train | function (files) {
for (var i = 0; i < files.length; i++) {
let f = files[i]
console.log(' meeting: Filename: ' + f.name + ', type: ' + (f.type || 'n/a') +
' size: ' + f.size + ' bytes, last modified: ' +
(f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() :... | javascript | {
"resource": ""
} | |
q10673 | train | function (thing, group) {
var pname = kb.any(thing, ns.vcard('fn'))
var gname = kb.any(group, ns.vcard('fn'))
var groups = kb.each(null, ns.vcard('hasMember'), thing)
if (groups.length < 2) {
alert('Must be a member of at least one group. Add to another gro... | javascript | {
"resource": ""
} | |
q10674 | diff | train | function diff( a, b ) {
let i, j, found = false, result = [];
for ( i = 0; i < a.length; i++ ) {
found = false;
for ( j = 0; j < b.length; j++ ) {
if ( a[ i ] === b[ j ] ) {
found | javascript | {
"resource": ""
} |
q10675 | train | function(thingy) {
// simple DOM lookup utility function
if (typeof(thingy) == 'string') {
thingy = document.getElementById(thingy);
}
if (!thingy.addClass) {
// extend element with a few useful methods
thingy.hide = function() { this.style.display = 'none'; };
thingy.show = function() { this.style.... | javascript | {
"resource": ""
} | |
q10676 | train | function ( filtered )
{
var
out = [],
data = this.s.dt.aoData,
displayed = this.s.dt.aiDisplay,
i, iLen;
if ( filtered )
{
// Only consider filtered rows
for ( i=0, iLen=displayed.length ; i<iLen ; i++ )
{
if ( data[ displayed[i] ]._DTTT_selected )
{
out.push( displayed[i] );
... | javascript | {
"resource": ""
} | |
q10677 | train | function ( n )
{
var pos = this.s.dt.oInstance.fnGetPosition( n );
| javascript | {
"resource": ""
} | |
q10678 | train | function( oConfig )
{
var sTitle = "";
if ( typeof oConfig.sTitle != 'undefined' && oConfig.sTitle !== "" ) {
sTitle = oConfig.sTitle;
} else {
var anTitle = document.getElementsByTagName('title');
if ( anTitle.length > 0 )
{
sTitle = anTitle[0].innerHTML;
}
}
/* Strip characters which th... | javascript | {
"resource": ""
} | |
q10679 | train | function ( oConfig )
{
var
aoCols = this.s.dt.aoColumns,
aColumnsInc = this._fnColumnTargets( oConfig.mColumns ),
aColWidths = [],
iWidth = 0, iTotal = 0, i, iLen;
for ( i=0, iLen=aColumnsInc.length ; i<iLen ; i++ )
{
if ( aColumnsInc[i] )
{
iWidth = aoCols[i].nTh.offsetWidth;
iTotal +... | javascript | {
"resource": ""
} | |
q10680 | train | function ()
{
for ( var cli in ZeroClipboard_TableTools.clients )
{
if ( cli )
{
var client = ZeroClipboard_TableTools.clients[cli];
if ( typeof client.domElement != 'undefined' &&
client.domElement.parentNode | javascript | {
"resource": ""
} | |
q10681 | train | function ( bView, oConfig )
{
if ( oConfig === undefined )
{
oConfig = {};
}
if ( bView === undefined || bView )
{
| javascript | {
"resource": ""
} | |
q10682 | train | function ( message, time ) {
var info = $('<div/>')
.addClass( this.classes.print.info )
.html( message | javascript | {
"resource": ""
} | |
q10683 | train | function ( oOpts )
{
/* Is this the master control instance or not? */
if ( typeof this.s.dt._TableToolsInit == 'undefined' )
{
this.s.master = true;
this.s.dt._TableToolsInit = true;
}
/* We can use the table node from comparisons to group controls */
this.dom.table = this.s.dt.nTable;
/* Clone ... | javascript | {
"resource": ""
} | |
q10684 | train | function ( buttonSet, wrapper )
{
var buttonDef;
for ( var i=0, iLen=buttonSet.length ; i<iLen ; i++ )
{
if ( typeof buttonSet[i] == "string" )
{
if ( typeof TableTools.BUTTONS[ buttonSet[i] ] == 'undefined' )
{
alert( "TableTools: Warning - unknown button type: "+buttonSet[i] );
continu... | javascript | {
"resource": ""
} | |
q10685 | train | function ( oConfig, bCollectionButton )
{
var nButton = this._fnButtonBase( oConfig, bCollectionButton );
if ( oConfig.sAction.match(/flash/) )
{
if ( ! this._fnHasFlash() ) {
return false;
}
this._fnFlashConfig( nButton, oConfig );
}
else if ( oConfig.sAction == "text" )
{
this._fnTextC... | javascript | {
"resource": ""
} | |
q10686 | train | function ( o, bCollectionButton )
{
var sTag, sLiner, sClass;
if ( bCollectionButton )
{
sTag = o.sTag && o.sTag !== "default" ? o.sTag : this.s.tags.collection.button;
sLiner = o.sLinerTag && o.sLinerTag !== "default" ? o.sLiner : this.s.tags.collection.liner;
sClass = this.classes.collection.buttons.... | javascript | {
"resource": ""
} | |
q10687 | train | function ( nButton, oConfig )
{
var
that = this,
oPos = $(nButton).offset(),
nHidden = oConfig._collection,
iDivX = oPos.left,
iDivY = oPos.top + $(nButton).outerHeight(),
iWinHeight = $(window).height(), iDocHeight = $(document).height(),
iWinWidth = $(window).width(), iDocWidth = $(document).w... | javascript | {
"resource": ""
} | |
q10688 | train | function ( nButton, oConfig )
{
if ( oConfig !== null && oConfig.sExtends == 'collection' )
{
return;
}
if ( this.dom.collection.collection !== null )
{
$(this.dom.collection.collection).animate({"opacity": 0}, 500, function (e) {
this.style.display = "none";
} );
| javascript | {
"resource": ""
} | |
q10689 | train | function ( src )
{
var out = [], pos, i, iLen;
if ( src.nodeName )
{
// Single node
pos = this.s.dt.oInstance.fnGetPosition( src );
out.push( this.s.dt.aoData[pos] );
}
else if ( typeof src.length !== 'undefined' )
{
// jQuery object or an array of nodes, or aoData points
for ( i=0, iLen=sr... | javascript | {
"resource": ""
} | |
q10690 | train | function ( nButton, oConfig )
{
var that = this;
var flash = new ZeroClipboard_TableTools.Client();
if ( oConfig.fnInit !== null )
{
oConfig.fnInit.call( this, nButton, oConfig );
}
flash.setHandCursor( true );
if ( oConfig.sAction == "flash_save" )
{
flash.setAction( 'save' );
flash.setCha... | javascript | {
"resource": ""
} | |
q10691 | train | function ( clip, sData )
{
var asData = this._fnChunkData( sData, 8192 );
clip.clearText();
for ( var i=0, | javascript | {
"resource": ""
} | |
q10692 | train | function ( sData, sBoundary, regex )
{
if ( sBoundary === "" )
{
return sData; | javascript | {
"resource": ""
} | |
q10693 | train | function ( sData, iSize )
{
var asReturn = [];
var iStrlen = sData.length;
for ( var i=0 ; i<iStrlen ; i+=iSize )
{
if ( i+iSize < iStrlen )
{
asReturn.push( | javascript | {
"resource": ""
} | |
q10694 | train | function ( sData )
{
if ( sData.indexOf('&') === -1 )
{
return sData;
}
var n = document.createElement('div');
return sData.replace( /&([^\s]*?);/g, function( match, match2 ) {
if ( match.substr(1, 1) === '#' )
| javascript | {
"resource": ""
} | |
q10695 | train | function ( e )
{
var that = this;
var oSetDT = this.s.dt;
var oSetPrint = this.s.print;
var oDomPrint = this.dom.print;
/* Show all hidden nodes */
this._fnPrintShowNodes();
/* Restore DataTables' scrolling */
if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
{
$(this.s.dt.nTable).unbi... | javascript | {
"resource": ""
} | |
q10696 | train | function ()
{
var
oSetDT = this.s.dt,
nScrollHeadInner = oSetDT.nScrollHead.getElementsByTagName('div')[0],
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
nScrollBody = oSetDT.nTable.parentNode,
nTheadSize, nTfootSize;
/* Copy the header in the thead in the body table, this w... | javascript | {
"resource": ""
} | |
q10697 | train | function ()
{
var
oSetDT = this.s.dt,
nScrollBody = oSetDT.nTable.parentNode;
if ( oSetDT.oScroll.sX !== "" )
{
nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX );
nScrollBody.style.overflow = "auto";
}
if ( oSetDT.oScroll.sY !== | javascript | {
"resource": ""
} | |
q10698 | train | function ( )
{
var anHidden = this.dom.print.hidden;
for ( var i=0, iLen=anHidden.length ; i<iLen ; i++ )
{
| javascript | {
"resource": ""
} | |
q10699 | train | function ( nNode )
{
var anHidden = this.dom.print.hidden;
var nParent = nNode.parentNode;
var nChildren = nParent.childNodes;
for ( var i=0, iLen=nChildren.length ; i<iLen ; i++ )
{
if ( nChildren[i] != nNode && nChildren[i].nodeType == 1 )
{
/* If our node is shown (don't want to show nodes whic... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.