_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q35700 | prepareResponse | train | function prepareResponse(response) {
Safe.log('Received response: ', response);
return response.text().then(function(text) {
// If we get a 2xx...
Safe.log('Launcher returned status '+response.status);
if (response.ok) {
// If not an authorized request, or not encrypted, no decryption necessary
... | javascript | {
"resource": ""
} |
q35701 | parseSafeMessage | train | function parseSafeMessage(message, status) {
if (typeof message === 'object') {
return | javascript | {
"resource": ""
} |
q35702 | train | function(next) {
if (!extension[type] || typeof extension[type] !== 'function') {
return next();
}
// Invoke type hook implemetation.
extension[type](result, function(error, newItems) {
if (error) {
| javascript | {
"resource": ""
} | |
q35703 | CHS | train | function CHS( cylinder, head, sector ) {
if( !(this instanceof CHS) )
return new CHS( cylinder, head, sector )
if( Buffer.isBuffer( cylinder ) )
return CHS.fromBuffer( cylinder )
/** @type {Number} Cylinder */
| javascript | {
"resource": ""
} |
q35704 | train | function( target ) {
target.cylinder = this.cylinder
target.head = this.head
| javascript | {
"resource": ""
} | |
q35705 | train | function( buffer, offset ) {
if( !Buffer.isBuffer( buffer ) )
throw new TypeError( 'Value must be a buffer' )
offset = offset || 0
| javascript | {
"resource": ""
} | |
q35706 | compose | train | function compose(...fns) {
return function(x) {
| javascript | {
"resource": ""
} |
q35707 | tickify | train | function tickify(fn, {delay} = {}) {
delay = delay || 10;
return function() {
return | javascript | {
"resource": ""
} |
q35708 | memoify | train | function memoify(fn, {hash, cache} = {}) {
hash = hash || identify;
cache = cache = {};
function memoified(...args) {
var key = hash(...args);
return key in cache ? | javascript | {
"resource": ""
} |
q35709 | logify | train | function logify(fn) {
return function() {
console.log("entering", fn.name);
var ret = fn.apply(this, arguments); | javascript | {
"resource": ""
} |
q35710 | onceify | train | function onceify(f) {
var ran, ret;
return function() {
return ran ? ret | javascript | {
"resource": ""
} |
q35711 | wrapify | train | function wrapify(fn, before = noop, after = noop) {
return function(...args) {
before.call(this);
| javascript | {
"resource": ""
} |
q35712 | parseBody | train | function parseBody(fn){
//get arguments to function as array of strings
var body=fn.body=fn.body|| //cache result in `body` property of function
fn.toString() //get string version of function
.replace(/\/\/.*$|\/\*[\s\S]*?\*\//mg, '') //strip comments
.replace(/^\s*$/mg, '') ... | javascript | {
"resource": ""
} |
q35713 | convertProfNode | train | function convertProfNode (node) {
var res = {
functionName: node.functionName,
lineNumber: node.lineNumber,
callUID: node.callUid,
hitCount: node.selfSamplesCount,
url: node.scriptName,
children: []
};
for (var i | javascript | {
"resource": ""
} |
q35714 | writeProfile | train | function writeProfile() {
var format;
if (/\.cpuprofile$/.test(argv.o)) {
format = 'cpuprofile';
}
var prof = stopCPU('global', format);
fs.writeFileSync(argv.o, prof);
var fname | javascript | {
"resource": ""
} |
q35715 | walkBemJson | train | function walkBemJson(bemJson, cb) {
let result;
if (Array.isArray(bemJson)) {
result = [];
bemJson.forEach((childBemJson, i) => {
result[i] = walkBemJson(childBemJson, cb);
| javascript | {
"resource": ""
} |
q35716 | AdapterJsRTCObjectFactory | train | function AdapterJsRTCObjectFactory(logger) {
Utils.checkArguments(arguments, 1);
this.createIceServers = function (urls, username, password) {
if (typeof(createIceServers) !== "undefined") {
return createIceServers(urls, username, password);
}
else {
logger.erro... | javascript | {
"resource": ""
} |
q35717 | onlySmHere | train | function onlySmHere(jsonFileName,isIndent,outFileName){
if (fs.existsSync(jsonFileName)) {
var fcount = JSON.parse(fs.readFileSync(jsonFileName));
var foooo = [];
if(fs.existsSync('SUMMARY.md')){
fcount = lodash.without(fcount,...haslisted.hasListed('SUMMARY.md'));
}
... | javascript | {
"resource": ""
} |
q35718 | State | train | function State(config) {
this._ = require('lodash');
this._name = config.name;
this._isInitial = config.isInitial;
this._isTerminal = config.isTerminal;
this._outgoingTransitions = config.outgoingTransitions;
this.accept = config.accept;
this._validateConfig(config);
| javascript | {
"resource": ""
} |
q35719 | removeDir | train | function removeDir(dirPath, cleanOnly) {
var files;
try {
files = fs.readdirSync(dirPath);
} catch(e) {
return;
}
if (files.length > 0) {
for (var i = 0; i < files.length; i++) {
var filePath = path.join(dirPath, | javascript | {
"resource": ""
} |
q35720 | loadAndSaveShoots | train | function loadAndSaveShoots(settings, folderPath) {
var promisesPool = [];
var semaphore = new Semaphore({rooms: 6});
settings.pages.forEach((page) => {
settings.sizes.forEach((size) => {
promisesPool.push(semaphore.add(() => {
return new Promise((resolve, reject) => {
console.log(`S... | javascript | {
"resource": ""
} |
q35721 | getModule | train | function getModule (filename) {
const file = files(filename)
const module = file.default || file
if (module.commit) {
throw new Error('[vssr] <%= dir.store %>/' + filename.replace('./', '') + ' should export a method which returns a Vuex instance.')
}
if | javascript | {
"resource": ""
} |
q35722 | filenamify | train | function filenamify(url) {
let res = filenamifyUrl(url);
if (res.length >= 60) {
res = res.substr(0, 60) +
'-md5-' +
| javascript | {
"resource": ""
} |
q35723 | hasExpired | train | function hasExpired(headers, refresh) {
if (!headers) {
log('response is not in cache');
return true;
}
if (refresh === 'force') {
log('response in cache but refresh requested');
return true;
}
if (refresh === 'never') {
log('response in cache and considered to be alway... | javascript | {
"resource": ""
} |
q35724 | addPendingFetch | train | function addPendingFetch(url) {
let resolve = null;
let reject = null;
let promise = new Promise((innerResolve, innerReject) => {
resolve = innerResolve;
| javascript | {
"resource": ""
} |
q35725 | fetchWithRetry | train | async function fetchWithRetry(url, options, remainingAttempts) {
try {
return await baseFetch(url, options);
}
catch (err) {
if (remainingAttempts <= 0) throw err;
log('fetch attempt failed, sleep and | javascript | {
"resource": ""
} |
q35726 | train | function(pModel)
{
// First create a "lookup" of primary keys that point back to tables
console.log('--> ... creating contextual Index ==> Table lookups ...');
var tmpIndices = {};
for(var tmpTable in pModel.Tables)
{
for (var j = 0; j < pModel.Tables[tmpTable].Columns.length; j++)
| javascript | {
"resource": ""
} | |
q35727 | _delete | train | function _delete(name) {
observers[name].unobserve();
delete observers[name];
| javascript | {
"resource": ""
} |
q35728 | add | train | function add(name) {
function set(v) {
var oldValue = shadow[name];
if (oldValue === v) return;
o[name] = v;
notifier.notify({type: 'update', object: u, name, oldValue});
shadow[name] = oldValue.change(v);
}
// When property on upwardable object is accessed, report it and ret... | javascript | {
"resource": ""
} |
q35729 | objectObserver | train | function objectObserver(changes) {
changes.forEach(({type, name}) => {
switch (type) {
case 'add': o[name] = u[name]; break;
| javascript | {
"resource": ""
} |
q35730 | buildMessageBuilder | train | function buildMessageBuilder(section) {
const logOptions = process.env.X2_LOG || '';
const msgBuilder = new Array();
if (!/(^|,)nots(,|$)/i.test(logOptions))
msgBuilder.push(() => (new Date()).toISOString());
if (!/(^|,)nopid(,|$)/i.test(logOptions))
msgBuilder.push(() => String(process.pid));
let m;
con... | javascript | {
"resource": ""
} |
q35731 | makeSheet | train | function makeSheet(scope) {
var style = document.createElement('style');
document.head.appendChild(style);
var sheet = style.sheet;
if (scope) {
style.setAttribute('scoped', "scoped"); | javascript | {
"resource": ""
} |
q35732 | Concept | train | function Concept(concept) {
if (!(concept.prefLabel && concept.id && concept.type === 'Concept')) {
throw new Error('Invalid concept: "' + concept.id + '"');
}
this.id = concept.id;
this.prefLabel = concept.prefLabel;
this.altLabel = concept.altLabel;
this.hiddenLabel = concept.hiddenLabel;
this.defin... | javascript | {
"resource": ""
} |
q35733 | train | function () {
// Get stored auth data.
var stored = this.storage.get();
// If nothing stored, proceed with new authorization
if (!stored) {
this.log('No auth data stored, starting authorization from scratch...');
return this.auth.authorize();
}
// Otherwise, set the auth data on th... | javascript | {
"resource": ""
} | |
q35734 | train | function () {
this.log('Authorizing...');
// Generate new asymmetric key pair and nonce, e.g. public-key encryption
var asymKeys = nacl.box.keyPair(),
asymNonce = nacl.randomBytes(nacl.box.nonceLength);
// The payload for the request
var authPayload = {
app: this.app,
publicKey... | javascript | {
"resource": ""
} | |
q35735 | train | function () {
this.log('Checking if authorized...');
return this.Request.get('/auth').auth().execute()
// let's use our own function here, that resolve true or false,
// rather than throwing an error if invalid token
.then(function () {
this.log('Authorized');
return true;
... | javascript | {
"resource": ""
} | |
q35736 | train | function () {
this.log('Deauthorizing...');
return this.Request.delete('/auth').auth().execute()
.then(function (response) {
// Clear auth data from storage upon deauthorization
this.storage.clear();
| javascript | {
"resource": ""
} | |
q35737 | model | train | function model(M, prop) {
const bmiLens = L(
prop,
// if we don't have <prop> property yet, then use these default values
L.defaults({weight: 80, height: 180}),
// add "read-only" bmi property to our BMI model that is | javascript | {
"resource": ""
} |
q35738 | beginsWith | train | function beginsWith(haystack, needles) {
let needle;
for (let i = 0, u = needles.length; i < u; ++i) {
needle = needles[i];
| javascript | {
"resource": ""
} |
q35739 | mergeQuery | train | function mergeQuery(path, newQuery) {
let parsed, properties, query, queryString;
// Return the original path if the query to merge is empty.
if (Object.keys(newQuery).length === 0) {
return path;
}
// Parse the original path.
parsed = url.parse(path, true);
// Merge the queries to f... | javascript | {
"resource": ""
} |
q35740 | runSync | train | function runSync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
try
{
if (requiresContext)
{
result = func.call(null, context);
}
else
{
result = func.call(context);
}
}
| javascript | {
"resource": ""
} |
q35741 | runAsync | train | function runAsync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
if (requiresContext)
{
result = func.call(null, context, callback); | javascript | {
"resource": ""
} |
q35742 | async | train | function async(func)
{
function wrapper()
{
var context = this;
var args = arguments;
process.nextTick(function()
{
| javascript | {
"resource": ""
} |
q35743 | traceSources | train | function traceSources(node, original) {
var i,
source,
sources;
if (!(node instanceof EffectNode) && !(node instanceof TransformNode)) {
return false;
}
sources = node.sources;
for (i in sources) {
if (sources.hasOwnProperty(i)) {
source = sources[i];
| javascript | {
"resource": ""
} |
q35744 | makePolygonsArray | train | function makePolygonsArray(poly) {
if (!poly || !poly.length || !Array.isArray(poly)) {
return [];
}
if (!Array.isArray(poly[0])) {
return [poly];
| javascript | {
"resource": ""
} |
q35745 | longestCommonPathPrefix | train | function longestCommonPathPrefix(stra, strb) {
const minlen = min(stra.length, strb.length);
let common = 0;
let lastSep = -1;
for (; common < minlen; ++common) {
const chr = stra[common];
if (chr !== strb[common]) {
break;
}
if (chr === sep) {
lastSep = common; | javascript | {
"resource": ""
} |
q35746 | relpath | train | function relpath(basePath, absPath) {
let base = dedot(basePath);
let abs = dedot(absPath);
// Find the longest common prefix that ends with a separator.
const commonPrefix = longestCommonPathPrefix(base, abs);
// Remove the common path elements.
base = apply(substring, base, [ commonPrefix ]);
abs = appl... | javascript | {
"resource": ""
} |
q35747 | createOptionsForServerSpec | train | function createOptionsForServerSpec(serverSpec) {
var options = {
forceNew: true, // Make a new connection each time
reconnection: false // Don't try and reconnect automatically | javascript | {
"resource": ""
} |
q35748 | Chickadee | train | function Chickadee(options) {
var self = this;
options = options || {};
self.associations = options.associationManager ||
new associationManager(options);
self.routes = {
"/associations": require('./routes/associations'), | javascript | {
"resource": ""
} |
q35749 | convertOptionsParamsToIds | train | function convertOptionsParamsToIds(req, instance, options, callback) {
var err;
if(options.id) {
var isValidID = reelib.identifier.isValid(options.id);
if(!isValidID) {
err = 'Invalid id';
}
options.ids = [options.id];
delete options.id;
callback(err);
}
else if(options.directory)... | javascript | {
"resource": ""
} |
q35750 | hex | train | function hex(n) {
return crypto.randomBytes(Math.ceil(n | javascript | {
"resource": ""
} |
q35751 | exportKs | train | function exportKs (password, privateKey, salt, iv, type, option = {}) {
if (!password || !privateKey || !type) {
throw new Error('Missing parameter! Make sure password, privateKey and type provided')
}
if (!crypto.isPrivateKey(privateKey)) {
| javascript | {
"resource": ""
} |
q35752 | verifyAndDecrypt | train | function verifyAndDecrypt(derivedKey, iv, ciphertext, algo, mac) {
if (typeof algo !== 'string') {
throw new Error('Cipher method is invalid. Unable to proceed')
}
var key;
if (crypto.createMac(derivedKey, ciphertext) !== mac) {
throw new Error('message authentication code | javascript | {
"resource": ""
} |
q35753 | buildJs | train | function buildJs() {
// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.
var sourceStream = gulp.src( config.Sources.Scripts, {
cwd : config.WorkingDirectory,
read : true
} );
return sourceStream
.pipe( jscs() )
.pipe( jscs.reporter() )
.pipe( jsVa... | javascript | {
"resource": ""
} |
q35754 | _fetchSubreddit | train | function _fetchSubreddit(subreddit) {
const reducer = (prev, {data: {url}}) => prev.push(url) && prev;
const jsonUri = `https://www.reddit.com/r/${subreddit}/.json`;
| javascript | {
"resource": ""
} |
q35755 | _fetchRandomSubreddit | train | function _fetchRandomSubreddit(count=1, subreddit='random', fetchOpts={}) {
const _fetchSubredditUrl = (subreddit, fetchOpts) => {
return fetch(`https://www.reddit.com/r/${subreddit}`, fetchOpts)
| javascript | {
"resource": ""
} |
q35756 | getSubredditName | train | function getSubredditName(url) {
try {
// This will throw a `TypeError: Cannot read property 'Symbol(Symbol.iterator)' of | javascript | {
"resource": ""
} |
q35757 | relativePosition | train | function relativePosition(rect, targetRect, rel) {
var x, y, w, h, targetW, targetH;
x = targetRect.x;
y = targetRect.y;
w = rect.w;
h = rect.h;
targetW = targetRect.w;
targetH = targetRect.h;
rel = (rel || '').split('');
if (rel[0] === 'b') {
y += target... | javascript | {
"resource": ""
} |
q35758 | inflate | train | function inflate(rect, w, h) {
return create(rect.x - w, rect.y - | javascript | {
"resource": ""
} |
q35759 | intersect | train | function intersect(rect, cropRect) {
var x1, y1, x2, y2;
x1 = max(rect.x, cropRect.x);
y1 = max(rect.y, cropRect.y);
x2 = min(rect.x + rect.w, cropRect.x + cropRect.w);
y2 = min(rect.y + rect.h, cropRect.y + | javascript | {
"resource": ""
} |
q35760 | clamp | train | function clamp(rect, clampRect, fixedSize) {
var underflowX1, underflowY1, overflowX2, overflowY2,
x1, y1, x2, y2, cx2, cy2;
x1 = rect.x;
y1 = rect.y;
x2 = rect.x + rect.w;
y2 = rect.y + rect.h;
cx2 = clampRect.x + clampRect.w;
cy2 = clampRect.y + clampRect.h;
u... | javascript | {
"resource": ""
} |
q35761 | fromClientRect | train | function fromClientRect(clientRect) {
return create(clientRect.left, | javascript | {
"resource": ""
} |
q35762 | train | function (callback, element) {
if (requestAnimationFramePromise) {
requestAnimationFramePromise.then(callback);
return;
}
requestAnimationFramePromise = new Promise(function (resolve) {
if (!element) {
| javascript | {
"resource": ""
} | |
q35763 | train | function (editor, callback, time) {
var timer;
timer = wrappedSetInterval(function () {
if (!editor.removed) {
callback();
} else {
| javascript | {
"resource": ""
} | |
q35764 | addEvent | train | function addEvent(target, name, callback, capture) {
if (target.addEventListener) {
target.addEventListener(name, callback, capture || false);
| javascript | {
"resource": ""
} |
q35765 | removeEvent | train | function removeEvent(target, name, callback, capture) {
if (target.removeEventListener) {
target.removeEventListener(name, callback, capture || false);
| javascript | {
"resource": ""
} |
q35766 | getTargetFromShadowDom | train | function getTargetFromShadowDom(event, defaultTarget) {
var path, target = defaultTarget;
// When target element is inside Shadow DOM we need to take first element from path
// otherwise we'll get Shadow Root parent, not actual target element
// Normalize target for WebComponents v0 implementa... | javascript | {
"resource": ""
} |
q35767 | fix | train | function fix(originalEvent, data) {
var name, event = data || {}, undef;
// Dummy function that gets replaced on the delegation state functions
function returnFalse() {
return false;
}
// Dummy function that gets replaced on the delegation state functions
function returnTru... | javascript | {
"resource": ""
} |
q35768 | is | train | function is(obj, type) {
if (!type) {
return obj !== undefined;
}
if (type == 'array' && Arr.isArray(obj)) {
| javascript | {
"resource": ""
} |
q35769 | create | train | function create(s, p, root) {
var self = this, sp, ns, cn, scn, c, de = 0;
// Parse : <prefix> <class>:<super class>
s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
// Create namespace for new class
ns = self.createNS(s[3].replace... | javascript | {
"resource": ""
} |
q35770 | walk | train | function walk(o, f, n, s) {
s = s || this;
if (o) {
if (n) {
o = o[n];
}
| javascript | {
"resource": ""
} |
q35771 | createNS | train | function createNS(n, o) {
var i, v;
o = o || window;
n = n.split('.');
for (i = 0; i < n.length; i++) {
v = n[i];
if (!o[v]) {
| javascript | {
"resource": ""
} |
q35772 | resolve | train | function resolve(n, o) {
var i, l;
o = o || window;
n = n.split('.');
| javascript | {
"resource": ""
} |
q35773 | train | function (selector, context) {
var self = this, match, node;
if (!selector) {
return self;
}
if (selector.nodeType) {
self.context = self[0] = selector;
self.length = 1;
return self;
}
if (context && context.nodeType) {
... | javascript | {
"resource": ""
} | |
q35774 | train | function (items, sort) {
var self = this, nodes, i;
if (isString(items)) {
return self.add(DomQuery(items));
}
if (sort !== false) {
nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
self.length = nodes.length;
for (i = 0... | javascript | {
"resource": ""
} | |
q35775 | train | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
Event.clean(node);
if (node.parentNode) {
| javascript | {
"resource": ""
} | |
q35776 | train | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
while (node.firstChild) {
| javascript | {
"resource": ""
} | |
q35777 | train | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
try {
while (i--) {
self[i].innerHTML = value;
| javascript | {
"resource": ""
} | |
q35778 | train | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
while (i--) {
if ("innerText" in self[i]) {
| javascript | {
"resource": ""
} | |
q35779 | train | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, | javascript | {
"resource": ""
} | |
q35780 | train | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, | javascript | {
"resource": ""
} | |
q35781 | train | function (className, state) {
var self = this;
// Functions are not supported
if (typeof className != 'string') {
return self;
}
if (className.indexOf(' ') !== -1) {
each(className.split(' '), function () {
self.toggleClass(this, state);
... | javascript | {
"resource": ""
} | |
q35782 | train | function (name) {
return this.each(function () {
if (typeof name == 'object') {
Event.fire(this, name.type, name);
| javascript | {
"resource": ""
} | |
q35783 | train | function (selector) {
var i, l, ret = [];
for (i = 0, l = this.length; i | javascript | {
"resource": ""
} | |
q35784 | train | function (selector) {
if (typeof selector == 'function') {
return DomQuery(grep(this.toArray(), function (item, | javascript | {
"resource": ""
} | |
q35785 | train | function (selector) {
var result = [];
if (selector instanceof DomQuery) {
selector = selector[0];
}
this.each(function (i, node) {
while (node) {
if (typeof selector == 'string' && DomQuery(node).is(selector)) {
result.push(node);
... | javascript | {
"resource": ""
} | |
q35786 | train | function (node) {
return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || | javascript | {
"resource": ""
} | |
q35787 | nativeDecode | train | function nativeDecode(text) {
var elm;
elm = document.createElement("div");
| javascript | {
"resource": ""
} |
q35788 | train | function (text, attr) {
return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
// Multi byte sequence convert it to a single entity
if (chr.length > 1) {
return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + | javascript | {
"resource": ""
} | |
q35789 | train | function (text) {
return text.replace(entityRegExp, function (all, numeric) {
if (numeric) {
if (numeric.charAt(0).toLowerCase() === 'x') {
numeric = parseInt(numeric.substr(1), 16);
} else {
numeric = parseInt(numeric, 10);
}
... | javascript | {
"resource": ""
} | |
q35790 | wait | train | function wait(testCallback, waitCallback) {
if (!testCallback()) {
// Wait for timeout
if ((new Date().getTime()) - startTime < maxLoadTime) {
| javascript | {
"resource": ""
} |
q35791 | waitForGeckoLinkLoaded | train | function waitForGeckoLinkLoaded() {
wait(function () {
try {
// Accessing the cssRules will throw an exception until the CSS file is loaded
var cssRules = style.sheet.cssRules;
passed(); | javascript | {
"resource": ""
} |
q35792 | DOMUtils | train | function DOMUtils(doc, settings) {
var self = this, blockElementsMap;
self.doc = doc;
self.win = window;
self.files = {};
self.counter = 0;
self.stdMode = !isIE || doc.documentMode >= 8;
self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
self.styleS... | javascript | {
"resource": ""
} |
q35793 | train | function (win) {
var doc, rootElm;
win = !win ? this.win : win;
doc = win.document;
rootElm = this.boxModel ? doc.documentElement : doc.body;
// Returns viewport size excluding scrollbars
return {
x: win.pageXOffset || rootElm.scrollLeft,
| javascript | {
"resource": ""
} | |
q35794 | train | function (elm) {
var self = this, pos, size;
elm = self.get(elm);
pos = self.getPos(elm);
size = self.getSize(elm);
| javascript | {
"resource": ""
} | |
q35795 | train | function (elm) {
var self = this, w, h;
elm = self.get(elm);
w = self.getStyle(elm, 'width');
h = self.getStyle(elm, 'height');
// Non pixel value, then force offset/clientWidth
if (w.indexOf('px') === -1) {
w = 0;
}
// Non pixel value, then f... | javascript | {
"resource": ""
} | |
q35796 | train | function (node, selector, root, collect) {
var self = this, selectorVal, result = [];
node = self.get(node);
collect = collect === undefined;
// Default root on inline mode
root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
// Wrap n... | javascript | {
"resource": ""
} | |
q35797 | train | function (elm) {
var name;
if (elm && this.doc && typeof elm == 'string') {
name = elm;
elm = this.doc.getElementById(elm);
// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the | javascript | {
"resource": ""
} | |
q35798 | train | function (name, attrs, html) {
return th | javascript | {
"resource": ""
} | |
q35799 | train | function (name, attrs, html) {
var outHtml = '', key;
outHtml += '<' + name;
for (key in attrs) {
if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
}
| javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.