_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q61300
createVinylFile
validation
async function createVinylFile(filePath, options) { options.lookup.set(filePath, vinylFile.read(filePath, options)); if (options.debugVcjd) debug(`Reading contents of: ${filePath}`); return await options.lookup.get(filePath); }
javascript
{ "resource": "" }
q61301
getVinylFiles
validation
function getVinylFiles(files, options) { return Promise.all(files.map(file=>getVinylFile(file, options))); }
javascript
{ "resource": "" }
q61302
resolveModule
validation
async function resolveModule(moduleId, options, root=options.base) { if (options.lookup.has(moduleId)) return options.lookup.get(moduleId); const absolutePath = await options.resolver(moduleId, root); if (options.mapper.hasOwnProperty(absolutePath)) return options.mapper[absolutePath]; if (options.lookup.has(absolu...
javascript
{ "resource": "" }
q61303
getRequires
validation
function getRequires(file, options) { return [...fileRequires(file, options)].map(async (moduleId)=>{ if (options.internalOnly && (moduleId.charAt(0) !== '.') && (moduleId.charAt(0) !== '/')) { if (options.mapper[moduleId] !== true) return undefined; } if (options.mapper.hasOwnProperty(moduleId) && !(options...
javascript
{ "resource": "" }
q61304
filterDuplicateFiles
validation
function filterDuplicateFiles() { const lookup = new Map(); return value=>{ if (lookup.has(value)) return false; return lookup.set(value, true); } }
javascript
{ "resource": "" }
q61305
getFiles
validation
async function getFiles(paths, options) { const files = (await getVinylFiles(paths, options)) .map(file=>[file, ...getRequires(file, options)]); return (await promiseFlatten(files)).filter(file=>file).filter(filterDuplicateFiles()); }
javascript
{ "resource": "" }
q61306
getAllFiles
validation
async function getAllFiles(file, options) { let files = await getFiles([file], options); while (hasUnloaded(files)) files = await getFiles(files, options); return files; }
javascript
{ "resource": "" }
q61307
srcFilePusher
validation
function srcFilePusher(options) { return through.obj(function(file, encoding, done) { getAllFiles(file, options).then(files=>{ files.forEach(file=>this.push(file)); done(); }, err=>{}); }) }
javascript
{ "resource": "" }
q61308
createResolver
validation
function createResolver(options) { return (moduleId, base)=>new Promise((resolve, reject)=>{ const resolver = new Resolver(options.resolver?options.resolver:{}); resolver.resolve(moduleId, base, (err, absolutePath)=>{ if (err) { if (options.debugVcjd) debug(`Could not resolve path to module: ${moduleId}\n\t...
javascript
{ "resource": "" }
q61309
parseOptions
validation
function parseOptions(options={}, vinylCjsDeps) { const _options = Object.assign({ gulp: vinylCjsDeps.gulp || require('gulp'), base: options.cwd || process.cwd(), cwd: options.base || process.cwd(), internalOnly: false, debugVcjd: false }, options); _options.mapper = Object.assign({}, options.mapper || {}...
javascript
{ "resource": "" }
q61310
validation
function(){ var me = this, prev = me.store.currentPage - 1; if (prev > 0) { if (me.fireEvent('beforechange', me, prev) !== false) { me.store.previousPage(); } } }
javascript
{ "resource": "" }
q61311
validation
function(){ var me = this, total = me.getPageData().pageCount, next = me.store.currentPage + 1; if (next <= total) { if (me.fireEvent('beforechange', me, next) !== false) { me.store.nextPage(); } } }
javascript
{ "resource": "" }
q61312
validation
function(){ var me = this, last = me.getPageData().pageCount; if (me.fireEvent('beforechange', me, last) !== false) { me.store.loadPage(last); } }
javascript
{ "resource": "" }
q61313
validation
function(){ var me = this, current = me.store.currentPage; if (me.fireEvent('beforechange', me, current) !== false) { me.store.loadPage(current); } }
javascript
{ "resource": "" }
q61314
validation
function(fromClass, members) { //<debug> Ext.classSystemMonitor && Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments); //</debug> var prototype = this.prototype, fromPrototype = fromClass.prototype, //<debug> ...
javascript
{ "resource": "" }
q61315
getOptions
validation
function getOptions(opts) { opts = opts || {}; // command line arguments override options _.extend(opts, argv); delete opts.$0; delete opts._; // these values are used in multiple tasks, so set defaults here opts.unitTestCode = opts.unitTestCode || 'test/unit/**/*.js'; opts.unitTargetC...
javascript
{ "resource": "" }
q61316
getPlugins
validation
function getPlugins(opts) { var batterRootDir = __dirname.replace(delim + 'lib', ''); var batterTasks = { rootDir: batterRootDir }; var currentProject = { rootDir: opts.rootDir }; var plugins = opts.plugins || []; // tasks in batter go to the front of the list; current project at the end (i.e. most...
javascript
{ "resource": "" }
q61317
whip
validation
function whip(gulp, taste, opts) { opts = getOptions(opts); opts.taste = taste; var tasks = _.extend({}, opts.tasksets); // loop through plugins so we can get tasks from them _.each(getPlugins(opts), function (plugin) { var pluginRoot = plugin.rootDir; var pluginBuildDir = pluginRo...
javascript
{ "resource": "" }
q61318
validation
function(module, method) { var all = {urlparams:[]} for(var i=2;i<u.length;i++) all.urlparams.push(decodeURIComponent(u[i])); req.cookies = {} req.headers.cookie && ...
javascript
{ "resource": "" }
q61319
validation
function(request){ var me = this, requests = me.requests, key; if (request) { if (!request.id) { request = requests[request]; } me.handleAbort(request); } else { for (key in requests) { if (r...
javascript
{ "resource": "" }
q61320
validation
function(result, request){ var success = true; if (request.timeout) { clearTimeout(request.timeout); } delete this[request.callbackName]; delete this.requests[request.id]; this.cleanupErrorHandling(request); Ext.fly(request.script).remove(); ...
javascript
{ "resource": "" }
q61321
validation
function(url, params, options) { var script = document.createElement('script'); script.setAttribute("src", Ext.urlAppend(url, Ext.Object.toQueryString(params))); script.setAttribute("async", true); script.setAttribute("type", "text/javascript"); return script; }
javascript
{ "resource": "" }
q61322
createTableGrid
validation
function createTableGrid(node) { var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); if (tblElm) return new TableGrid(tblElm, ed.dom, selection); }
javascript
{ "resource": "" }
q61323
fixTableCellSelection
validation
function fixTableCellSelection(ed) { if (!tinymce.isWebKit) return; var rng = ed.selection.getRng(); var n = ed.selection.getNode(); var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); if (!tableCellSelected(ed, rng, n, currentCell)) return; if (!currentCell...
javascript
{ "resource": "" }
q61324
fixTableCaretPos
validation
function fixTableCaretPos() { var last; // Skip empty text nodes form the end for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; if (last && last.nodeName == 'TABLE') { if (ed.settings.forced_root_block) ed.dom.add(...
javascript
{ "resource": "" }
q61325
validation
function(column) { var result = column.width || 0, subcols, len, i; // <debug> if (column.flex) { Ext.Error.raise("Columns which are locked do NOT support a flex width. You must set a width on the " + column.text + "column."); } // </debug> if (!r...
javascript
{ "resource": "" }
q61326
validation
function(activeHd, toIdx) { var me = this, normalGrid = me.normalGrid, lockedGrid = me.lockedGrid, normalHCt = normalGrid.headerCt, lockedHCt = lockedGrid.headerCt, refreshFlags, ownerCt; activeHd = activeHd || normalHCt....
javascript
{ "resource": "" }
q61327
validation
function(store, columns) { var me = this, oldStore = me.store, lockedGrid = me.lockedGrid, normalGrid = me.normalGrid; Ext.suspendLayouts(); if (columns) { lockedGrid.headerCt.removeAll(); normalGrid.headerCt.removeAll(); ...
javascript
{ "resource": "" }
q61328
defaultTransformer
validation
function defaultTransformer(...args) { try { let [record, ...rest] = args try { record = typeof record === 'string' ? JSON.parse(record) : record } catch(err) { return { type: 'bunyan', record: { err: new Error('Could not parse message.') } } } return { type: 'bunyan', record } } cat...
javascript
{ "resource": "" }
q61329
getString
validation
function getString(ref) { try { if (ref) { try { return ref; } catch (e) { return ref.toString(); } } else { try { return ref.toString(); } catch (e) { return "undefined"; } } } catch (e) { // if we ...
javascript
{ "resource": "" }
q61330
clickMe
validation
function clickMe (print_r, str) { return (function(){ print_r.objRef = eval(str); print_r.strObjRef = str; print_r.refresh(); }); }
javascript
{ "resource": "" }
q61331
arrSort
validation
function arrSort(a,b) { var acomp = a['name'].toString(10); var bcomp = b['name'].toString(10); if (!isNaN(Number(acomp))) { acomp = Number(acomp); } if (!isNaN(Number(bcomp))) { bcomp = Number(bcomp); } if (acomp < bcomp) { return -1; } if (acomp > bcomp) { return 1; } return...
javascript
{ "resource": "" }
q61332
validation
function(filter, index, list) { // Shortcuts if (filter === 'combine') { list[index] = self.filters.combine; return; } // Solfege URI if (typeof filter === 'string' && self.application.isSolfegeUri(filter)) { list[index] = self.application.res...
javascript
{ "resource": "" }
q61333
getCurrentExpectedTypes
validation
function getCurrentExpectedTypes(type) { var currentType; var expectedType; if (type.name) { currentType = type.name; } else if (type.expression) { currentType = type.expression.name; } expectedType = currentType && preferType[currentType]; return { currentType: currentType, expectedType: e...
javascript
{ "resource": "" }
q61334
validateType
validation
function validateType(jsdocNode, type) { if (!type || !canTypeBeValidated(type.type)) { return; } var typesToCheck = []; var elements = []; switch (type.type) { case 'TypeApplication': // {Array.<String>} elements = type.applications[0].type === 'UnionType' ? type.applications[0].elements : type....
javascript
{ "resource": "" }
q61335
requireJsDoc
validation
function requireJsDoc(node, isVirtual, paramsToCheck) { var lines = sourceCode.lines; var index = node.loc.start.line; lines = lines.slice(0, index); var matches = lines.filter(function(line) { return line.match(/\/\*\*/gi); }); var lastIndex = lines.lastIndexOf(matches[matches.length - 1]); var jsdo...
javascript
{ "resource": "" }
q61336
SelectionType
validation
function SelectionType(typeSpec) { if (!Array.isArray(typeSpec.data) && typeof typeSpec.data !== 'function') { throw new Error('instances of SelectionType need typeSpec.data to be an array or function that returns an array:' + JSON.stringify(typeSpec)); } Object.keys(typeSpec).forEach(function(key) ...
javascript
{ "resource": "" }
q61337
DeferredType
validation
function DeferredType(typeSpec) { if (typeof typeSpec.defer !== 'function') { throw new Error('Instances of DeferredType need typeSpec.defer to be a function that returns a type'); } Object.keys(typeSpec).forEach(function(key) { this[key] = typeSpec[key]; }, this); }
javascript
{ "resource": "" }
q61338
ArrayType
validation
function ArrayType(typeSpec) { if (typeSpec instanceof Type) { this.subtype = typeSpec; } else if (typeof typeSpec === 'string') { this.subtype = types.getType(typeSpec); if (this.subtype == null) { throw new Error('Unknown array subtype: ' + typeSpec); } } ...
javascript
{ "resource": "" }
q61339
validation
function() { var conversion = this.parse(''); if (lastSetting) { var current = lastSetting.get(); if (conversion.predictions.length === 0) { conversion.predictions.push(current); } else { // Remove current from predictions ...
javascript
{ "resource": "" }
q61340
ConversionHint
validation
function ConversionHint(conversion, arg) { this.status = conversion.status; this.message = conversion.message; if (arg) { this.start = arg.start; this.end = arg.end; } else { this.start = 0; this.end = 0; } this.predictions = conversion.predictions; }
javascript
{ "resource": "" }
q61341
Argument
validation
function Argument(emitter, text, start, end, prefix, suffix) { this.emitter = emitter; this.setText(text); this.start = start; this.end = end; this.prefix = prefix; this.suffix = suffix; }
javascript
{ "resource": "" }
q61342
validation
function(text) { if (text == null) { throw new Error('Illegal text for Argument: ' + text); } var ev = { argument: this, oldText: this.text, text: text }; this.text = text; this.emitter._dispatchEvent('argumentChange', ev); }
javascript
{ "resource": "" }
q61343
validation
function(command, arg) { var docs = []; docs.push('<strong><tt> &gt; '); docs.push(command.name); if (command.params && command.params.length > 0) { command.params.forEach(function(param) { if (param.defaultValue === undefined) { docs.push(...
javascript
{ "resource": "" }
q61344
validation
function(assignment) { // This is all about re-creating Assignments if (assignment.param.name !== '__command') { return; } this._assignments = {}; if (assignment.value) { assignment.value.params.forEach(function(param) { this._assignments...
javascript
{ "resource": "" }
q61345
validation
function(nameOrNumber) { var name = (typeof nameOrNumber === 'string') ? nameOrNumber : Object.keys(this._assignments)[nameOrNumber]; return this._assignments[name]; }
javascript
{ "resource": "" }
q61346
validation
function() { // TODO: work out when to clear this out for the plain Requisition case // this._hints = []; this.getAssignments(true).forEach(function(assignment) { this._hints.push(assignment.getHint()); }, this); Hint.sort(this._hints); // We would like to pu...
javascript
{ "resource": "" }
q61347
validation
function() { var args = {}; this.getAssignments().forEach(function(assignment) { args[assignment.param.name] = assignment.value; }, this); return args; }
javascript
{ "resource": "" }
q61348
validation
function(includeCommand) { var args = []; if (includeCommand === true) { args.push(this.commandAssignment); } Object.keys(this._assignments).forEach(function(name) { args.push(this.getAssignment(name)); }, this); return args; }
javascript
{ "resource": "" }
q61349
validation
function() { var line = []; line.push(this.commandAssignment.value.name); Object.keys(this._assignments).forEach(function(name) { var assignment = this._assignments[name]; var type = assignment.param.type; // TODO: This will cause problems if there is a non-de...
javascript
{ "resource": "" }
q61350
CliView
validation
function CliView(cli, env) { cli.cliView = this; this.cli = cli; this.doc = document; this.win = dom.getParentWindow(this.doc); this.env = env; // TODO: we should have a better way to specify command lines??? this.element = this.doc.getElementById('cockpitInput'); if (!this.element) { ...
javascript
{ "resource": "" }
q61351
validation
function() { // Certain browsers have a bug such that scrollHeight is too small // when content does not fill the client area of the element var scrollHeight = Math.max(this.output.scrollHeight, this.output.clientHeight); this.output.scrollTop = scrollHeight - this.output.clientHeight; ...
javascript
{ "resource": "" }
q61352
validation
function() { var rect = this.element.getClientRects()[0]; this.completer.style.top = rect.top + 'px'; var height = rect.bottom - rect.top; this.completer.style.height = height + 'px'; this.completer.style.lineHeight = height + 'px'; this.completer.style.left = rect.left ...
javascript
{ "resource": "" }
q61353
validation
function(ev, hashId, keyCode) { var stopEvent; if (keyCode === keys.TAB || keyCode === keys.UP || keyCode === keys.DOWN) { stopEvent = true; } else if (hashId != 0 || keyCode != 0) { stopEvent = canon.execKeyCommand(this.env, 'cli', hashId,...
javascript
{ "resource": "" }
q61354
validation
function(ev) { var handled; /* var handled = keyboardManager.processKeyEvent(ev, this, { isCommandLine: true, isKeyUp: true }); */ // RETURN does a special exec/highlight thing if (ev.keyCode === keys.RETURN) { var worst = this.cli.getWors...
javascript
{ "resource": "" }
q61355
validation
function() { this.isUpdating = true; var input = { typed: this.element.value, cursor: { start: dom.getSelectionStart(this.element), end: dom.getSelectionEnd(this.element.selectionEnd) } }; this.cli.update(input); ...
javascript
{ "resource": "" }
q61356
validation
function(scores) { var completion = ''; // Create mark-up var i = 0; var lastStatus = -1; while (true) { if (lastStatus !== scores[i]) { completion += '<span class=' + scores[i].toString() + '>'; lastStatus = scores[i]; } ...
javascript
{ "resource": "" }
q61357
validation
function(ev) { if (this.isUpdating) { return; } var prefix = this.element.value.substring(0, ev.argument.start); var suffix = this.element.value.substring(ev.argument.end); var insert = typeof ev.text === 'string' ? ev.text : ev.text.name; this.element.value ...
javascript
{ "resource": "" }
q61358
RequestView
validation
function RequestView(request, cliView) { this.request = request; this.cliView = cliView; this.imageUrl = imageUrl; // Elements attached to this by the templater. For info only this.rowin = null; this.rowout = null; this.output = null; this.hide = null; this.show = null; this.dur...
javascript
{ "resource": "" }
q61359
validation
function(ev) { this.cliView.cli.update({ typed: this.request.typed, cursor: { start:0, end:0 } }); this.cliView.cli.exec(); }
javascript
{ "resource": "" }
q61360
validation
function(member, clone, ref) { ref.parentNode.insertBefore(clone, ref); data[paramName] = member; self.processNode(clone, data); delete data[paramName]; }
javascript
{ "resource": "" }
q61361
string
validation
function string(state) { return [ { token : "string", regex : '".*?"' }, { token : "string", // multi line string start regex : '["].*$', next : state + "-qqstring" }, { token : "string", regex : "'.*...
javascript
{ "resource": "" }
q61362
validation
function(data, hashId, key) { // If we pressed any command key but no other key, then ignore the input. // Otherwise "shift-" is added to the buffer, and later on "shift-g" // which results in "shift-shift-g" which doesn't make senese. if (hashId != 0 && (key == "" || String.fromCharCode...
javascript
{ "resource": "" }
q61363
validation
function(model, req) { if(!model) return {} var fields = {} ,queryFieldSet if(req) { if(req.fieldSet) { queryFieldSet = {} try { queryFieldSet = JSON.parse(req.fieldSet) } catch(e) {queryFieldSet = null} ...
javascript
{ "resource": "" }
q61364
validation
function(grid) { var me = this; if (grid.rendered) { me.grid = grid; grid.getView().on({ render: function(v) { me.view = v; Ext.ux.dd.CellFieldDropZone.superclass.constructor.call(me, me.view.el); }, ...
javascript
{ "resource": "" }
q61365
validation
function(target, dd, e, dragData) { delete this.dropOK; if (!target) { return; } // Check that a field is being dragged. var f = dragData.field; if (!f) { return; } // Check whether the data type of the column being dropped on accepts t...
javascript
{ "resource": "" }
q61366
validation
function(target, dd, e, dragData) { if (this.dropOK) { var value = dragData.field.getValue(); target.record.set(target.fieldName, value); this.onCellDrop(target.fieldName, value); return true; } }
javascript
{ "resource": "" }
q61367
validation
function(cssText, id) { var ss, head = doc.getElementsByTagName("head")[0], styleEl = doc.createElement("style"); styleEl.setAttribute("type", "text/css"); if (id) { styleEl.setAttribute("id", id); } if (Ext.isI...
javascript
{ "resource": "" }
q61368
validation
function(id) { var existing = doc.getElementById(id); if (existing) { existing.parentNode.removeChild(existing); } }
javascript
{ "resource": "" }
q61369
validation
function(id, url) { var ss; CSS.removeStyleSheet(id); ss = doc.createElement("link"); ss.setAttribute("rel", "stylesheet"); ss.setAttribute("type", "text/css"); ss.setAttribute("id", id); ss.setAttribute("href", url); doc.ge...
javascript
{ "resource": "" }
q61370
validation
function(refreshCache) { var result = {}, selector; if (rules === null || refreshCache) { CSS.refreshCache(); } for (selector in rules) { result[selector] = rules[selector].cssRule; } return result; ...
javascript
{ "resource": "" }
q61371
validation
function(styleSheet, selector, cssText) { var result, ruleSet = styleSheet.cssRules || styleSheet.rules, index = ruleSet.length; if (styleSheet.insertRule) { styleSheet.insertRule(selector + '{' + cssText + '}', index); } else { ...
javascript
{ "resource": "" }
q61372
cloneObject
validation
function cloneObject( obj ) { if ( obj === null || typeof obj !== 'object' ) { return obj; } var temp = obj.constructor( ); // give temp the original obj's constructor for ( var key in obj ) { temp[ key ] = cloneObject( obj[ key ] ); } return temp; }
javascript
{ "resource": "" }
q61373
validation
function(node, callback, scope, args) { var me = this, reader, dataRoot, data, callbackArgs; // Children are loaded go ahead with expand if (node.isLoaded()) { callbackArgs = [node.childNodes]; if (args) { callbackArgs.push...
javascript
{ "resource": "" }
q61374
validation
function(node1, node2) { return node1[node1.persistenceProperty].index - node2[node2.persistenceProperty].index; }
javascript
{ "resource": "" }
q61375
init
validation
function init(tag, attrs, params) { // {{{2 /** * View constructor * * @copyParams ose-html5.lib.wrap/constructor * * @method constructor */ O.inherited(this)(tag || 'ul', attrs, params); this.updating = 0; this.hook(); this.text('Loading ...'); }
javascript
{ "resource": "" }
q61376
validation
function(req, res, runMethod) { var form = new formidable.IncomingForm() ,files = {} ,fields = {} ,size = 0 for(var i in formConfig) { form[i] = formConfig[i] } form.on('file', function(field, file) { size += file.size if(size > maxUploadS...
javascript
{ "resource": "" }
q61377
sortArgs
validation
function sortArgs(app, argv, options) { options = options || []; var first = options.first || []; var last = options.last || []; var cliKeys = []; if (app.cli && app.cli.keys) { cliKeys = app.cli.keys; } var keys = utils.union(first, cliKeys, Object.keys(argv)); keys = utils.diff(keys, last); k...
javascript
{ "resource": "" }
q61378
validation
function() { var me = this, picker = new Ext.tree.Panel({ shrinkWrapDock: 2, store: me.store, floating: true, displayField: me.displayField, columns: me.columns, minHeight: me.minPickerHeight, ...
javascript
{ "resource": "" }
q61379
validation
function() { var style = this.picker.getView().getEl().dom.style; // can't use Element.repaint because it contains a setTimeout, which results in a flicker effect style.display = style.display; }
javascript
{ "resource": "" }
q61380
validation
function() { var me = this, picker; if (me.isExpanded) { picker = me.getPicker(); if (me.matchFieldWidth) { // Auto the height (it will be constrained by max height) picker.setWidth(me.bodyEl.getWidth()); } if (...
javascript
{ "resource": "" }
q61381
validation
function(e, el) { var key = e.getKey(); if(key === e.ENTER || (key === e.TAB && this.selectOnTab)) { this.selectItem(this.picker.getSelectionModel().getSelection()[0]); } }
javascript
{ "resource": "" }
q61382
validation
function(record) { var me = this; me.setValue(record.getId()); me.picker.hide(); me.inputEl.focus(); me.fireEvent('select', me, record) }
javascript
{ "resource": "" }
q61383
validation
function() { var me = this, picker = me.picker, store = picker.store, value = me.value, node; if (value) { node = store.getNodeById(value); } if (!node) { node = store.getRootNode(); } ...
javascript
{ "resource": "" }
q61384
validation
function(value) { var me = this, record; me.value = value; if (me.store.loading) { // Called while the Store is loading. Ensure it is processed by the onLoad method. return me; } // try to find a record in the store that matches ...
javascript
{ "resource": "" }
q61385
validation
function(key) { var pos = key.indexOf('['); if (pos === -1) return { type: 'string', val: key }; return { type: 'array', val: key.substr(0, pos) }; }
javascript
{ "resource": "" }
q61386
validation
function(direction) { var me = this; me.direction = direction ? direction.toUpperCase() : direction; me.updateSortFunction(); }
javascript
{ "resource": "" }
q61387
validation
function() { var me = this; me.direction = Ext.String.toggle(me.direction, "ASC", "DESC"); me.updateSortFunction(); }
javascript
{ "resource": "" }
q61388
validation
function(fn) { var me = this; fn = fn || me.sorterFn || me.defaultSorterFn; me.sort = me.createSortFunction(fn); }
javascript
{ "resource": "" }
q61389
Recurring
validation
function Recurring(str) { var parts = str.split('/'); if(str.charAt(0) != 'R' || parts.length != 3) { throw new Error('Invalid Recurring Date'); } // We must have start and end. error if both aren't set if(!parts[1] || !parts[2]) { throw new Error('Recurring must have a start and end'); } va...
javascript
{ "resource": "" }
q61390
iopaStaticSend
validation
function iopaStaticSend(context, path, opts) { opts = opts || {}; return new Promise(function iopaStaticLoad(resolve, reject){ var root = opts.root ? normalize(pathResolve(opts.root)) : ''; var index = opts.index; var maxage = opts.maxage...
javascript
{ "resource": "" }
q61391
validation
function(ed) { var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; self.key = PLUGIN_NAME + ed.id; // Loop though each storage engine type until we find one that works tinymce.each([ function() { // Try HTML5 Local Storage if (localStorage) { localStorage.setIte...
javascript
{ "resource": "" }
q61392
validation
function() { var self = this, storage = self.storage, editor = self.editor, expires, content; // Is the contents dirty if (storage) { // If there is no existing key and the contents hasn't been changed since // it's original value then there is no point in saving a draft if (!storage.getIte...
javascript
{ "resource": "" }
q61393
validation
function() { var self = this, storage = self.storage, content; if (storage) { content = storage.getItem(self.key); if (content) { self.editor.setContent(content); self.onRestoreDraft.dispatch(self, { content : content }); } } }
javascript
{ "resource": "" }
q61394
validation
function() { var self = this, storage = self.storage, key = self.key, content; if (storage) { // Get current contents and remove the existing draft content = storage.getItem(key); storage.removeItem(key); storage.removeItem(key + "_expires"); // Dispatch remove event if we had any c...
javascript
{ "resource": "" }
q61395
validation
function(e) { var msg; tinymce.each(tinyMCE.editors, function(ed) { // Store a draft for each editor instance if (ed.plugins.autosave) ed.plugins.autosave.storeDraft(); // Never ask in fullscreen mode if (ed.getParam("fullscreen_is_enabled")) return; // Setup ...
javascript
{ "resource": "" }
q61396
request
validation
function request(url){ return new Promise(function(resolve, reject) { _request(url, function (error, response, body) { if(error) return reject(error); resolve({response, body}) }); }); }
javascript
{ "resource": "" }
q61397
validation
function (grid, state) { var filters = {}; this.filters.each(function (filter) { if (filter.active) { filters[filter.dataIndex] = filter.getValue(); } }); return (state.filters = filters); }
javascript
{ "resource": "" }
q61398
validation
function(store) { var me = this; // Unbind from the old Store if (me.store && me.storeListeners) { me.store.un(me.storeListeners); } // Set up correct listeners if (store) { me.storeListeners = { scope: me }; ...
javascript
{ "resource": "" }
q61399
validation
function () { var me = this, headerCt = me.view.headerCt; if (headerCt) { headerCt.items.each(function(header) { var filter = me.getFilter(header.dataIndex); header[filter && filter.active ? 'addCls' : 'removeCls'](me.filterCls); }); ...
javascript
{ "resource": "" }