_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q61000 | TripCase | validation | function TripCase (options) {
if (!options || !options.email || !options.password) throw 'Missing required options';
this.email = options.email;
this.password = options.password;
this.session = null;
return this;
} | javascript | {
"resource": ""
} |
q61001 | trmv | validation | function trmv (A, x, isLower) {
var dot = blas1.dot;
var n = A.shape[1];
var i = 0;
if (isLower) {
for (i = n - 1; i >= 0; i--) {
x.set(i, dot(A.pick(i, null).hi(i + 1), x.hi(i + 1)));
}
} else {
for (i = 0; i < n; i++) {
x.set(i, dot(A.pick(i, null).lo(i), x.lo(i)));
}
}
retur... | javascript | {
"resource": ""
} |
q61002 | validation | function () {
this.TYPE = {
TAG: 'tag',
USER: 'user'
}
this.urlRules = {
tag: {
rule: /((https?):\/\/)?(www\.)?instagram.com\/explore\/tags\/([\w_]+)/mi
},
user: {
rule: /((https?):\/\/)?(www\.)?instagram\.com\/([\w._]+)\/?/mi
}
}
} | javascript | {
"resource": ""
} | |
q61003 | siteAppsAdmin | validation | function siteAppsAdmin(req, res, cb) {
var { themeData } = res.locals;
const { apps, getInheritTheme, themes } = req.app.locals;
if (!themeData.managingSite) cb();
else {
// provide function for apps/themes to add pages
res.locals.addPages = function(appPages) {
addPages(req, res, appPages);
... | javascript | {
"resource": ""
} |
q61004 | sanitize | validation | function sanitize(str) {
const symbolMap = {
'\'': '\\textquotesingle{}',
'"': '\\textquotedbl{}',
'`': '\\textasciigrave{}',
'^': '\\textasciicircum{}',
'~': '\\textasciitilde{}',
'<': '\\textless{}',
'>': '\\textgreater{}',
'|': '\\textbar{}',
'\\': '\\textbackslash{}',
'{': ... | javascript | {
"resource": ""
} |
q61005 | execute | validation | function execute(target, prop, ...args) {
return _.isFunction(target[prop]) ? target[prop](...args) : target[prop];
} | javascript | {
"resource": ""
} |
q61006 | loadUsrInfo | validation | function loadUsrInfo(token, app, zlSite, next) {
app.models.zlUser.findById(token.userId, (err, usr) => {
if (err) next(err);
else if (usr) {
zlSite.user = _.cloneDeep(usr);
if (!zlSite.user.usrPhoto && zlSite.user.email) {
// use gravatar
let graHash = md5(zlSite.user.email.toLowe... | javascript | {
"resource": ""
} |
q61007 | metaData | validation | function metaData(req, res, next) {
var zlSite = res.locals.zlSite;
// favicons
if (zlSite.zsOptions && zlSite.zsOptions.favicons) {
res.locals.favicons = zlSite.zsOptions.favicons;
}
// title
res.locals.title = zlSite.zsName;
// robots: default for seo (themes like Admin may set beforehand)
if (... | javascript | {
"resource": ""
} |
q61008 | trsv | validation | function trsv (A, x, isLower) {
var dot = blas1.dot;
var n = A.shape[1];
var i = 0;
if (isLower) {
x.set(0, x.get(0) / A.get(0, 0));
for (i = 1; i < n; i++) {
x.set(i, (x.get(i) - dot(A.pick(i, null).hi(i), x.hi(i))) / A.get(i, i));
}
} else {
x.set(n - 1, x.get(n - 1) / A.get(n - 1, n -... | javascript | {
"resource": ""
} |
q61009 | validation | function(scContent) {
if (_.isEmpty(scContent['data'])) {
return;
}
let columns = [];
if (scContent['columns']) {
// already have columns
columns = scContent['columns'];
}
else {
// make columns headers from data
let model = this._modelInfo(scC... | javascript | {
"resource": ""
} | |
q61010 | validation | function(modelData, scContent) {
if (scContent['treeData']) {
// this data must be represented as hierarchical data (tree)
let parentColumn = scContent.treeData.parentColumn;
let rootParent = (scContent.treeData['root'])?scContent.treeData['root']:0;
let childColumn = scContent.idC... | javascript | {
"resource": ""
} | |
q61011 | validation | function(res, scContent, post, cb) {
let model = this._modelInfo(scContent['forModel']);
// get list of expected model props
let fields = this.makeFormFields(res, scContent);
let data = {};
let where = null;
_.forEach(fields, function(val) {
if (val.isId) {
if (post... | javascript | {
"resource": ""
} | |
q61012 | validation | function(forModel) {
let model = {
model: app.models[forModel],
prop: app.models[forModel].definition.properties,
settings: app.models[forModel].settings,
meta: app.models[forModel].settings.zlMeta,
ns: ''
};
if (model.meta && model.meta['Namespace']) {
... | javascript | {
"resource": ""
} | |
q61013 | validation | function (modMeth, filter, cb = (err, val, cb) => cb()) {
this.promises.push( new Promise((resolve, reject) => {
modMeth(...filter, (err, val) => {
cb(err, val, resolve);
});
}));
} | javascript | {
"resource": ""
} | |
q61014 | _embedGetter | validation | function _embedGetter(self, fields, embedGetter, key) {
let allOpts = [];
self.res.locals.emiter.emit('get-options', embedGetter, allOpts);
if (allOpts) {
allOpts.forEach(function(obj) { obj.embedIn = key; });
fields.push(...allOpts);
}
} | javascript | {
"resource": ""
} |
q61015 | shouldFetchContents | validation | function shouldFetchContents(state, scsId) {
const page = state.pages[scsId];
if (page.contents.length === 0) {
return true
} else if (page.isFetching) {
return false
} else {
return page.didInvalidate
}
} | javascript | {
"resource": ""
} |
q61016 | bundleServer | validation | function bundleServer(app, promises) {
var { themes, config } = app.locals;
// iterate all themes
_.forEach(themes, function(val, theme) {
promises.push( new Promise(function(resolve) {
// make bundle config for server-renderer
readyBundle(app, '', theme, resolve, (wpConfig, sitePath, appBundled,... | javascript | {
"resource": ""
} |
q61017 | validation | function(active, suppressEvent){
if(this.active != active){
this.active = active;
if (suppressEvent !== true) {
this.fireEvent(active ? 'activate' : 'deactivate', this);
}
}
} | javascript | {
"resource": ""
} | |
q61018 | validation | function(dataview) {
/**
* @property dataview
* @type Ext.view.View
* The DataView bound to this instance
*/
this.dataview = dataview;
dataview.mon(dataview, {
beforecontainerclick: this.cancelClick,
scope: this,
render: {
... | javascript | {
"resource": ""
} | |
q61019 | hmacSign | validation | function hmacSign (input, algorithm, secret) {
return crypto.createHmac(algorithm, secret).update(input).digest('base64')
} | javascript | {
"resource": ""
} |
q61020 | sign | validation | function sign (input, algorithm, secret) {
const alg = algorithmMap[algorithm]
if (!alg) {
throw new Error(errorMap['002'].message)
}
const type = typeMap[algorithm]
let signature
switch (type) {
case 'hmac':
signature = hmacSign(input, alg, secret)
break
case 'sign':
signat... | javascript | {
"resource": ""
} |
q61021 | hmacVerify | validation | function hmacVerify (input, algorithm, secret, signature) {
try {
const verify = signature === hmacSign(input, algorithm, secret)
if (!verify) {
errorMap['006'].message = 'Unvalid secret for hmac verify, signature verification failed'
errorMap['006'].error = new Error(errorMap['006'].message)
... | javascript | {
"resource": ""
} |
q61022 | rsaVerify | validation | function rsaVerify (input, algorithm, publicSecret, signature) {
try {
// verify with rsa_public_key.pem
const verify = crypto.createVerify(algorithm).update(input).verify(
publicSecret,
base64URLUnescape(signature),
'base64'
)
if (!verify) {
errorMap['006'].message = 'Unvalid ... | javascript | {
"resource": ""
} |
q61023 | verify | validation | function verify (input, algorithm, secret, signature) {
const alg = algorithmMap[algorithm]
if (!alg) {
errorMap['006'].message = 'Algorithm not recognized, signature verification failed'
errorMap['006'].message = new Error(errorMap['006'].message)
return false
}
const type = typeMap[algorithm]
... | javascript | {
"resource": ""
} |
q61024 | getType | validation | function getType(v) {
var result = '';
if (v == null) {
result = v + '';
}
else {
result = typeof v;
if (result == 'object' || result == 'function') {
result = illa.classByType[illa.classByType.toString.call(v)] || 'object';
... | javascript | {
"resource": ""
} |
q61025 | addProps | validation | function addProps(obj) {
var rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
rest[_i - 1] = arguments[_i];
}
for (var i = 0, n = rest.length; i < n; i += 2) {
if (illa.isString(rest[i])) {
obj[rest[i]] = rest[i + 1];
... | javascript | {
"resource": ""
} |
q61026 | validation | function(type) {
var me = this,
oldType = me.type;
me.type = type;
if (me.rendered) {
if (oldType) {
me.toolEl.removeCls(me.baseCls + '-' + oldType);
}
me.toolEl.addCls(me.baseCls + '-' + type);
} else {
me.rend... | javascript | {
"resource": ""
} | |
q61027 | validation | function () {
var me = this,
locked = me.lockable.lockedGrid.headerCt.getColumnsState(),
normal = me.lockable.normalGrid.headerCt.getColumnsState();
return locked.concat(normal);
} | javascript | {
"resource": ""
} | |
q61028 | it | validation | function it(type, value) {
var i, t;
if (type === '(color)' || type === '(range)') {
t = {type: type};
} else if (type === '(punctuator)' ||
(type === '(identifier)' && is_own(syntax, value))) {
t = syntax[value] || syntax['(error)'... | javascript | {
"resource": ""
} |
q61029 | advance | validation | function advance(id, t) {
switch (token.id) {
case '(number)':
if (nexttoken.id === '.') {
warning(
"A dot following a number can be confused with a decimal point.", token);
}
break;
case '-':
if (nexttoken.id === '-' || nexttoken.i... | javascript | {
"resource": ""
} |
q61030 | doBegin | validation | function doBegin(n) {
if (n !== 'html' && !option.fragment) {
if (n === 'div' && option.adsafe) {
error("ADSAFE: Use the fragment option.");
} else {
error("Expected '{a}' and instead saw '{b}'.",
token, 'html', n);
}
... | javascript | {
"resource": ""
} |
q61031 | validation | function(records) {
var ghost = this.createGhost(records),
store = ghost.store;
store.removeAll();
store.add(records);
return ghost.getEl();
} | javascript | {
"resource": ""
} | |
q61032 | visibilityChange | validation | function visibilityChange(ev) { // {{{2
var that = this;
if (this.visibilityTimeout) {
clearTimeout(this.visibilityTimeout);
this.visibilityTimeout = undefined;
}
switch (document.visibilityState) {
case 'hidden':
// console.log('DOCUMENT HIDE');
// Wait 10 seconds before peer disconnect.
... | javascript | {
"resource": ""
} |
q61033 | validation | function (key, done) {
var val = null;
if(cache.hasOwnProperty(key)) {
val = cache[key];
}
return done(null, val);
} | javascript | {
"resource": ""
} | |
q61034 | _returnMap | validation | function _returnMap(callback, file, created){
if(typeof file === 'string'){
var map = foldermap.mapSync(file);
Object.defineProperty(map, '_created', {value:created});
} else {
var map = {};
for(var i in file){
map[i] = foldermap.mapSync(file[i]);
Object.defineProperty(map[i], '_created'... | javascript | {
"resource": ""
} |
q61035 | readyCb | validation | function readyCb(cb){
//if(opened) return
//opened = true
if(exports.slowGet){//special debug hook - specifies millisecond delay for testing
setTimeout(function(){
cb(undefined, api.getView(viewId, historicalKey))
},exports.slowGet)
}else{
var viewObj = api.getView(viewId, historicalKey)
if(... | javascript | {
"resource": ""
} |
q61036 | fileStatus | validation | function fileStatus(prev, stat, filename, dir, fn) {
var fullname = path.join(dir, filename)
// is a deleted file?
/*if (!fs.existsSync(fullname)) {
return fn && fn(null, { stats: undefined, code: -1});
}*/
// is a file added?
if (prev === undefined || prev === null) {
fn && fn(null, {... | javascript | {
"resource": ""
} |
q61037 | getFiles | validation | function getFiles(dir, pattern, fn) {
if ("function" === typeof pattern) {
fn = pattern;
pattern = undefined;
}
pattern = pattern || /.*/ig;
fs.readdir(dir, function(err, files){
if (err) return fn && fn(err);
async.map(
files,
function(f, cb) {
fs.stat(pat... | javascript | {
"resource": ""
} |
q61038 | validation | function(key, value) {
// if we have no value, it means we need to get the key from the object
if (value === undefined) {
value = key;
key = this.getKey(value);
}
return [key, value];
} | javascript | {
"resource": ""
} | |
q61039 | validation | function(key) {
var me = this,
value;
if (me.containsKey(key)) {
value = me.map[key];
delete me.map[key];
--me.length;
if (me.hasListeners.remove) {
me.fireEvent('remove', me, key, value);
}
return true;... | javascript | {
"resource": ""
} | |
q61040 | validation | function(fn, scope) {
// copy items so they may be removed during iteration.
var items = Ext.apply({}, this.map),
key,
length = this.length;
scope = scope || this;
for (key in items) {
if (items.hasOwnProperty(key)) {
if (fn.call(scope... | javascript | {
"resource": ""
} | |
q61041 | validation | function() {
var hash = new this.self(this.initialConfig),
map = this.map,
key;
hash.suspendEvents();
for (key in map) {
if (map.hasOwnProperty(key)) {
hash.add(key, map[key]);
}
}
hash.resumeEvents();
retur... | javascript | {
"resource": ""
} | |
q61042 | validation | function (astList, context, callback) {
var retval = new Array(astList.length);
asyncEach(astList, function (ast, i, done) {
run(ast, context, function (err, val) {
if (err) {
callback(err);
} else {
retval[i] = val;
done();
}
});
}, callback, null, retval);
} | javascript | {
"resource": ""
} | |
q61043 | validation | function (astList, context, callback) {
var retval = new Array(2);
var i = 0;
var getOpArgs2_callback = function (err, val) {
if (err) {
callback(err);
} else {
retval[i] = val;
i++;
if (i >= 2) callback(null, retval);
}
};
run(astList[1], context, getOpArgs2_callback);
run(astList[2], context, ... | javascript | {
"resource": ""
} | |
q61044 | peekTokenNoLineTerminator | validation | function peekTokenNoLineTerminator() {
var t = peekToken();
var start = lastToken.location.end.offset;
var end = t.location.start.offset;
for (var i = start; i < end; i++) {
var code = input.charCodeAt(i);
if (isLineTerminator(code))
return null;
// If we have a block comment we need to skip ... | javascript | {
"resource": ""
} |
q61045 | validation | function () {
// create new instance based on class meta data
var instance = _.clone(modelView)
// get number of args
var numArgs = arguments.length
// if function is passed a single object then these arguments will
// be passed directly to the view instance func
... | javascript | {
"resource": ""
} | |
q61046 | CI | validation | function CI(pull_request, branch, build_number, builder) {
this.pull_request = pull_request;
this.branch = branch;
this.build_number = build_number;
this.builder = builder;
this.GetVersion = GetVersion;
this.GetPullRequest = GetPullRequest;
this.PublishGitTag = PublishGitTag;
this.MergeDownstream = MergeDownst... | javascript | {
"resource": ""
} |
q61047 | validation | function(table, config) {
config = Ext.apply({}, config);
table = this.table = Ext.get(table);
var configFields = config.fields || [],
configColumns = config.columns || [],
fields = [],
cols = [],
headers = table.query("thead th"),
i =... | javascript | {
"resource": ""
} | |
q61048 | weight | validation | function weight(word) {
return HAMMING_TABLE[ (word >> 0x00) & 0xF ] +
HAMMING_TABLE[ (word >> 0x04) & 0xF ] +
HAMMING_TABLE[ (word >> 0x08) & 0xF ] +
HAMMING_TABLE[ (word >> 0x0C) & 0xF ] +
HAMMING_TABLE[ (word >> 0x10) & 0xF ] +
HAMMING_TABLE[ (word >> 0x14) & 0xF ] +
... | javascript | {
"resource": ""
} |
q61049 | highest | validation | function highest(word) {
word |= word >> 1;
word |= word >> 2;
word |= word >> 4;
word |= word >> 8;
word |= word >> 16;
// We have to use a zero-fill right shift here, or the word will overflow when
// the highest bit is in the leftmost position.
return position((word >>> 1) + 1);
} | javascript | {
"resource": ""
} |
q61050 | onSelection | validation | function onSelection(ev) { // {{{2
if (ev) {
ev.stopPropagation();
ev.stopImmediatePropagation();
ev.preventDefault();
}
setTimeout(function() {
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelect... | javascript | {
"resource": ""
} |
q61051 | multiplyDuration | validation | function multiplyDuration(startDuration, multiplier) {
if(!isFinite(multiplier) || multiplier <= 0) {
throw new Error('Invalid Multiplier');
}
var newDuration = {},
hasTime = false,
duration = '';
if(startDuration.getSeconds()) {
newDuration.seconds = Math.round(startDuration.getSeconds()... | javascript | {
"resource": ""
} |
q61052 | zipDates | validation | function zipDates(start, end) {
if(start.month != undefined && end.month == undefined) {
end.month = 1;
}
if(start.month == undefined && end.month != undefined) {
start.month = 1;
}
if(start.day != undefined && end.day == undefined) {
end.day = 1;
}
if(start.day == undefined && end.day != und... | javascript | {
"resource": ""
} |
q61053 | zipDuration | validation | function zipDuration(date, duration) {
var toSet = {};
if(duration.getSeconds()) {
toSet = {
seconds: true,
minutes: true,
hours: true,
days: true,
months: true
};
} else if(duration.getMinutes()) {
toSet = {
minutes: true,
hours: true,
days: true,
... | javascript | {
"resource": ""
} |
q61054 | getObjFromDate | validation | function getObjFromDate(date, adjustTimezone) {
var obj = {
year: date.getYear(),
month: date.getMonth(),
day: date.getDay(),
hours: date.getHours(),
minutes: date.getMinutes(),
seconds: date.getSeconds()
}
if(adjustTimezone) {
if(obj.minutes != undefined && date.getTZMinutes() != und... | javascript | {
"resource": ""
} |
q61055 | Range | validation | function Range(str) {
var range = str;
// If range starts with A, its approximate
if(range.charAt(0) == 'A') {
this._approximate = true;
range = str.substr(1);
}
var parts = range.split('/');
if(parts.length != 2 || (!parts[0] && !parts[1])) {
throw new Error('Invalid Date Range');
}
if... | javascript | {
"resource": ""
} |
q61056 | validation | function() {
Ext.data.flash.BinaryXhr.flashPluginActive = true;
Ext.data.flash.BinaryXhr.flashPlugin = document.getElementById("ext-flash-polyfill");
Ext.globalEvents.fireEvent("flashready"); // let all pending connections know
} | javascript | {
"resource": ""
} | |
q61057 | validation | function(javascriptId, state, data) {
var connection;
// Identify the request this is for
connection = this.liveConnections[Number(javascriptId)]; // Make sure its a native number
if (connection) {
connection.onFlashStateChange(state, data);
} ... | javascript | {
"resource": ""
} | |
q61058 | validation | function (body) {
var me = this;
me.body = body;
if (!Ext.data.flash.BinaryXhr.flashPluginActive) {
Ext.globalEvents.addListener("flashready", me.onFlashReady, me);
} else {
this.onFlashReady();
}
} | javascript | {
"resource": ""
} | |
q61059 | validation | function() {
var me = this, req, status;
me.javascriptId = Ext.data.flash.BinaryXhr.registerConnection(me);
// Create the request object we're sending to flash
req = {
method: me.method, // ignored since we always POST binary data
url: me.url,
... | javascript | {
"resource": ""
} | |
q61060 | validation | function (state) {
var me = this;
if (me.readyState != state) {
me.readyState = state;
me.onreadystatechange();
}
} | javascript | {
"resource": ""
} | |
q61061 | validation | function (data) {
var me = this;
// parse data and set up variables so that listeners can use this XHR
this.status = data.status || 0;
// we get back no response headers, so fake what we know:
me.responseHeaders = {};
if (me.mimeType) {
me.responseHeaders["co... | javascript | {
"resource": ""
} | |
q61062 | consume_string | validation | function consume_string (proc_stack) {
let delim = proc_stack.tAccept();
let str = delim;
let escaping = 0;
let done = false;
while (!done) {
let c = proc_stack.tAccept();
if (c == "\\") {
escaping ^= 1;
} else {
if (c == delim && !escaping) {
done = true;
} else if (... | javascript | {
"resource": ""
} |
q61063 | consume_template | validation | function consume_template (proc_stack) {
let template = "`";
proc_stack.tSkip(1);
let escaping = 0;
let done = false;
while (!done) {
let c = proc_stack.tAccept();
if (c == "\\") {
escaping ^= 1;
} else {
if (c == "`" && !escaping) {
done = true;
}
escaping = 0;... | javascript | {
"resource": ""
} |
q61064 | HttpLog | validation | function HttpLog ()
{
var args = arguer.apply(_constructorFormat, arguments);
if (args instanceof Error)
return httpLog(args);
if (args.response instanceof Http.IncomingMessage && args.response.statusCode)
return httpLog(args.response.statusCode, Http.STATUS_CODES[args.response.statusCode]);
if (args.error in... | javascript | {
"resource": ""
} |
q61065 | validation | function(animate){
var me = this;
me.setVisible(!me.isVisible(), me.anim(animate));
return me;
} | javascript | {
"resource": ""
} | |
q61066 | skipWhitespaceNodes | validation | function skipWhitespaceNodes(e, next) {
while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
e = next(e);
}
return e;
} | javascript | {
"resource": ""
} |
q61067 | createNewLi | validation | function createNewLi(ed, e) {
if (isEnterWithoutShift(e) && isEndOfListItem()) {
var node = ed.selection.getNode();
var li = ed.dom.create("li");
var parentLi = ed.dom.getParent(node, 'li');
ed.dom.insertAfter(li, parentLi);
// Move caret to new list element.
if (tinymce.isIE6 || tiny... | javascript | {
"resource": ""
} |
q61068 | setCursorPositionToOriginalLi | validation | function setCursorPositionToOriginalLi(li) {
var list = ed.dom.getParent(li, 'ol,ul');
if (list != null) {
var lastLi = list.lastChild;
// Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
... | javascript | {
"resource": ""
} |
q61069 | listener | validation | function listener(bot) {
return function(buffer) {
var line = buffer.toString();
var truncatedLine = line.slice(0,line.length-1);
if (current_actions && !isNaN(parseInt(truncatedLine)) &&
parseInt(truncatedLine) < current_actions.length) {
var action = current_actions[parseInt(truncatedLine)... | javascript | {
"resource": ""
} |
q61070 | validation | function(uuid) {
if ( ! uuid.match(UUID.rvalid))
{ //Need a real UUID for this...
return false;
}
// Get hexadecimal components of uuid
var hex = uuid.replace(/[\-{}]/g, '');
// Binary Value
var bin = '';
for (var i = 0; i < hex.length; i += 2)
{ // Convert each character to a bit
bin += String.fromChar... | javascript | {
"resource": ""
} | |
q61071 | validation | function(c) { // (note parentheses for precence)
var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);
return String.fromCharCode(cc); } | javascript | {
"resource": ""
} | |
q61072 | validation | function( obj ) {
if ( !obj ) {
obj = promise;
} else {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
}
}
return obj;
} | javascript | {
"resource": ""
} | |
q61073 | validation | function(config) {
var me = this,
comp;
if (arguments.length === 2) {
//<debug>
if (Ext.isDefined(Ext.global.console)) {
Ext.global.console.warn('Ext.LoadMask: LoadMask now uses a standard 1 arg constructor: use the target config');
}
... | javascript | {
"resource": ""
} | |
q61074 | validation | function(store, initial) {
var me = this;
me.mixins.bindable.bindStore.apply(me, arguments);
store = me.store;
if (store && store.isLoading()) {
me.onBeforeLoad();
}
} | javascript | {
"resource": ""
} | |
q61075 | callback | validation | function callback (key, err, result)
{
delete waiting[key];
results[key] = result;
context.log(err);
checkDone();
} | javascript | {
"resource": ""
} |
q61076 | validation | function (events) {
var me = this,
i, event, stateEventsByName;
if (me.stateful && me.getStateId()) {
if (typeof events == 'string') {
events = Array.prototype.slice.call(arguments, 0);
}
stateEventsByName = me.stateEventsByName || (me.st... | javascript | {
"resource": ""
} | |
q61077 | validation | function(){
var me = this,
id = me.stateful && me.getStateId(),
hasListeners = me.hasListeners,
state;
if (id) {
state = Ext.state.Manager.get(id);
if (state) {
state = Ext.apply({}, state);
if (!hasListeners.be... | javascript | {
"resource": ""
} | |
q61078 | validation | function (propName, state, stateName) {
var me = this,
value = me[propName],
config = me.initialConfig;
if (me.hasOwnProperty(propName)) {
if (!config || config[propName] !== value) {
if (state) {
state[stateName || propName] = val... | javascript | {
"resource": ""
} | |
q61079 | validation | function (propNames, state) {
var me = this,
i, n;
if (typeof propNames == 'string') {
me.savePropToState(propNames, state);
} else {
for (i = 0, n = propNames.length; i < n; ++i) {
me.savePropToState(propNames[i], state);
}
... | javascript | {
"resource": ""
} | |
q61080 | validation | function(){
var me = this,
task = me.stateTask;
if (task) {
task.destroy();
me.stateTask = null;
}
me.clearListeners();
} | javascript | {
"resource": ""
} | |
q61081 | validation | function () {
var me = this;
if (!me.active) {
me.active = new Date();
me.startTime = me.getTime();
me.onStart();
me.fireEvent('start', me);
}
} | javascript | {
"resource": ""
} | |
q61082 | validation | function () {
var me = this;
if (me.active) {
me.active = null;
me.onStop();
me.fireEvent('stop', me);
}
} | javascript | {
"resource": ""
} | |
q61083 | enter | validation | function enter(node, parent) {
if(!node.body)return;
for(var i = 0; i < node.body.length; i++){
// Function to append a statement after the current statement
var append = [].splice.bind(node.body, i+1, 0);
// Get all comments associated with the current statement
var current = node.bo... | javascript | {
"resource": ""
} |
q61084 | parseComment | validation | function parseComment(comment, append){
// separatet so that this code could be parsed
var escapedollar = '----esacepedollar'+'---'+'jsdoc-at-examples---';
function unescape(result){
return result.replace(new RegExp(escapedollar,'g'), '$$');
}
// escape $ in comments
comment.value = comment.value.repl... | javascript | {
"resource": ""
} |
q61085 | parseExampleLine | validation | function parseExampleLine(left, right, result){
if(!left || !right)return false; // did not find test
if(right === 'setup' || right === 'teardown'){
result[right].push(left);
}else{
var test = {
left: wrapEval(left),
title: (left + ' // ' + right).replace(/"/g, '\\"')
};
if(right =... | javascript | {
"resource": ""
} |
q61086 | matchIdentifierName | validation | function matchIdentifierName(name){
var noid = identifier().replace('[', '[^');
noid = '(^|$|' + noid + ')';
return noid+name+noid;
} | javascript | {
"resource": ""
} |
q61087 | validation | function(index, silent) {
var me = this;
if (!index) {
index = 0;
} else if (!Ext.isNumber(index)) {
index = Ext.Array.indexOf(me.items, index);
}
me.items[index].disabled = false;
me.up('tablepanel').el.select('.' + Ext.baseCSSPrefix + 'action-co... | javascript | {
"resource": ""
} | |
q61088 | validation | function(index, silent) {
var me = this;
if (!index) {
index = 0;
} else if (!Ext.isNumber(index)) {
index = Ext.Array.indexOf(me.items, index);
}
me.items[index].disabled = true;
me.up('tablepanel').el.select('.' + Ext.baseCSSPrefix + 'action-col... | javascript | {
"resource": ""
} | |
q61089 | validation | function(readOnly) {
var me = this,
inputEl = me.inputEl;
readOnly = !!readOnly;
me[readOnly ? 'addCls' : 'removeCls'](me.readOnlyCls);
me.readOnly = readOnly;
if (inputEl) {
inputEl.dom.readOnly = readOnly;
} else if (me.rendering) {
m... | javascript | {
"resource": ""
} | |
q61090 | validation | function(active){
var me = this,
msgTarget = me.msgTarget,
prop;
if (me.rendered) {
if (msgTarget == 'title' || msgTarget == 'qtip') {
if (me.rendered) {
prop = msgTarget == 'qtip' ? 'data-errorqtip' : 'title';
... | javascript | {
"resource": ""
} | |
q61091 | validation | function(){
var sorters = this.sorters.items,
len = sorters.length,
i = 0,
sorter;
for (; i < len; ++i) {
sorter = sorters[i];
if (!sorter.isGrouper) {
return sorter;
}
}
return null;... | javascript | {
"resource": ""
} | |
q61092 | getPreviewCss | validation | function getPreviewCss(ed, fmt) {
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
previewStyles = ed.settings.preview_styles;
// No preview forced
if (previewStyles === false)
return '';
// Default preview
if (!previewStyles)
previewStyles = 'font-... | javascript | {
"resource": ""
} |
q61093 | HTTPError | validation | function HTTPError() {
var args = Array.prototype.slice.call(arguments);
if(!(this instanceof HTTPError)) {
var self = new HTTPError();
return FUNCTION(self).apply(self, args);
}
var headers, msg, code;
ARRAY(args).forEach(function HTTPError_foreach(arg) {
if(typeof arg === 'object') {
headers = arg;
}... | javascript | {
"resource": ""
} |
q61094 | validation | function() {
var tip = this.tip;
if (!tip) {
tip = this.tip = Ext.create('Ext.tip.QuickTip', {
ui: 'form-invalid'
});
tip.tagConfig = Ext.apply({}, {attribute: 'errorqtip'}, tip.tagConfig);
}
} | javascript | {
"resource": ""
} | |
q61095 | validation | function() {
var doc = me.getDoc();
if (doc.body || doc.readyState === 'complete') {
Ext.TaskManager.stop(task);
me.setDesignMode(true);
Ext.defer(me.initEditor, 10, me);
}
} | javascript | {
"resource": ""
} | |
q61096 | validation | function(sourceEditMode) {
var me = this,
iframe = me.iframeEl,
textarea = me.textareaEl,
hiddenCls = Ext.baseCSSPrefix + 'hidden',
btn = me.getToolbar().getComponent('sourceedit');
if (!Ext.isBoolean(sourceEditMode)) {
sourceEditMode = !me.so... | javascript | {
"resource": ""
} | |
q61097 | validation | function() {
var me = this,
i, l, btns, doc, name, queriedName, fontSelect,
toolbarSubmenus;
if (me.readOnly) {
return;
}
if (!me.activated) {
me.onFirstFocus();
return;
}
btns = me.getToolbar().items.map;
... | javascript | {
"resource": ""
} | |
q61098 | validation | function(input) {
this.reset();
// Prepare form
this.form = {
signature: utils.sha256(input),
text: input,
html: {
prompt: '',
template: '',
solution: ''
},
controls: []
};
// Inject formCompiler into inline compiler
this.inline.formCompiler ... | javascript | {
"resource": ""
} | |
q61099 | validation | function(type) {
var ctl = { type: type };
var idx = this.form.controls.length;
var id = this.form.signature + ':' + idx;
ctl.id = 'c-' + utils.sha256(id).substring(0, 8);
this.form.controls.push(ctl);
return ctl;
} | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.