_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q29700 | setAllHeights | train | function setAllHeights(elements, height) {
for (let i = elements.length - 1; i >= 0; i--) {
elements[i].style.height = height;
}
} | javascript | {
"resource": ""
} |
q29701 | train | function (table) {
var finalLine = '+';
for (var i = 0; i < table.maxWidth.length; i++) {
finalLine += Array(table.maxWidth[i] + 3).join('-') + '+';
}
return finalLine;
} | javascript | {
"resource": ""
} | |
q29702 | train | function ( a, b) {
if (typeof reverse === 'boolean' && reverse === true) {
if (a[colindex] < b[colindex]) {
return 1;
}
else if (a[colindex] > b[colindex]) {
return -1;
}
else {
return 0;
}
... | javascript | {
"resource": ""
} | |
q29703 | paths | train | function paths (object, test) {
var p = []
if(test(object)) return []
for(var key in object) {
var value = object[key]
if(test(value)) p.push(key)
else if(isObject(value))
p = p.concat(paths(value, test).map(function (path) {
return [key].concat(path)
}))
}
return p
} | javascript | {
"resource": ""
} |
q29704 | collect | train | function collect(cells) {
var key, i, t, v;
for (key in cells) {
t = cells[key].tuple;
for (i=0; i<n; ++i) {
vals[i][(v = t[dims[i]])] = v;
}
}
} | javascript | {
"resource": ""
} |
q29705 | generate | train | function generate(base, tuple, index) {
var name = dims[index],
v = vals[index++],
k, key;
for (k in v) {
tuple[name] = v[k];
key = base ? base + '|' + k : k;
if (index < n) generate(key, tuple, index);
else if (!curr[key]) aggr.cell(key, tuple);
}
} | javascript | {
"resource": ""
} |
q29706 | Tap | train | function Tap(element, fn, preventEventDefault) {
classCallCheck(this, Tap);
this.element = element;
this.fn = fn;
this.preventEventDefault = preventEventDefault;
this.pointer = new OdoPointer(element, {
preventEventDefault: preventEventDefault
});
this._listen();
... | javascript | {
"resource": ""
} |
q29707 | getVelocity | train | function getVelocity(deltaTime, deltaX, deltaY) {
return new Coordinate(
finiteOrZero(deltaX / deltaTime),
finiteOrZero(deltaY / deltaTime),
);
} | javascript | {
"resource": ""
} |
q29708 | getDirection | train | function getDirection(coord1, coord2) {
if (Math.abs(coord1.x - coord2.x) >= Math.abs(coord1.y - coord2.y)) {
return getTheDirection(
coord1.x, coord2.x, Direction.LEFT,
Direction.RIGHT, Direction.NONE,
);
}
return getTheDirection(
coord1.y, coord2.y, Direction.UP,
Direction.DOWN, Dir... | javascript | {
"resource": ""
} |
q29709 | update | train | function update(t) {
var p, idx;
if (res.length < num) {
res.push(t);
} else {
idx = ~~((cnt + 1) * random());
if (idx < res.length && idx >= cap) {
p = res[idx];
if (map[tupleid(p)]) out.rem.push(p); // eviction
res[idx] = t;
}
}
++cnt;
} | javascript | {
"resource": ""
} |
q29710 | toPascalCase | train | function toPascalCase(name) {
return name.charAt(0).toUpperCase() + name.replace(/-(.)?/g, (match, c) => c.toUpperCase()).slice(1);
} | javascript | {
"resource": ""
} |
q29711 | TabsEvent | train | function TabsEvent(type, index) {
classCallCheck(this, TabsEvent);
this.type = type;
/** @type {number} */
this.index = index;
/** @type {boolean} Whether `preventDefault` has been called. */
this.defaultPrevented = false;
} | javascript | {
"resource": ""
} |
q29712 | Tabs | train | function Tabs(element) {
classCallCheck(this, Tabs);
/** @type {Element} */
var _this = possibleConstructorReturn(this, _TinyEmitter.call(this));
_this.element = element;
/** @private {number} */
_this._selectedIndex = -1;
/**
* List items, children of the tabs list.... | javascript | {
"resource": ""
} |
q29713 | initializeAll | train | function initializeAll() {
var elements = Array.from(document.querySelectorAll('[' + Settings.Attribute.TRIGGER + ']'));
var singleInstances = [];
var groupInstances = [];
var groupIds = [];
elements.forEach(function (item) {
var groupId = item.getAttribute(Settings.Attribute.GROUP);
i... | javascript | {
"resource": ""
} |
q29714 | getSelector | train | function getSelector(Module, selector) {
// Verify that a base selector is defined.
if (typeof selector === 'undefined') {
if (Module.Selectors && Module.Selectors.BASE) {
return Module.Selectors.BASE;
}
// Support both `ClassName` and `Classes` enumerations.
const classes = Module.ClassName ... | javascript | {
"resource": ""
} |
q29715 | validate | train | function validate(Module, selector) {
// Verify that the Module is an Object or Class.
const type = Object.prototype.toString.call(Module);
const isObject = type === '[object Object]';
const isFunction = type === '[object Function]';
if (!(isObject || isFunction)) {
throw new TypeError(`Module must be an ... | javascript | {
"resource": ""
} |
q29716 | register | train | function register(Module, selector) {
const _selector = getSelector(Module, selector);
validate(Module, _selector);
const methods = OdoModuleMethods(Module, _selector);
// Apply OdoModule static methods.
Object.keys(methods).forEach((method) => {
Module[method] = methods[method];
});
// Apply the ... | javascript | {
"resource": ""
} |
q29717 | DualViewer | train | function DualViewer(el, opts) {
classCallCheck(this, DualViewer);
var _this = possibleConstructorReturn(this, _TinyEmitter.call(this));
_this.element = el;
_this.options = Object.assign({}, DualViewer.Defaults, opts);
_this._isVertical = _this.options.isVertical;
/** @private {E... | javascript | {
"resource": ""
} |
q29718 | arrayify | train | function arrayify(thing) {
if (Array.isArray(thing)) {
return thing;
}
if (thing && typeof thing.length === 'number') {
return Array.from(thing);
}
return [thing];
} | javascript | {
"resource": ""
} |
q29719 | scrollToIndex | train | function scrollToIndex(index) {
var duration = 400;
var start = window.pageYOffset;
var end = index * window.innerHeight;
var amount = end - start;
var startTime = +new Date();
var easing = function easing(k) {
return -0.5 * (Math.cos(Math.PI * k) - 1);
};
var step = function ste... | javascript | {
"resource": ""
} |
q29720 | getHueDifference | train | function getHueDifference(value) {
return hues.reduce(function (min, hue) {
var diff = Math.abs(hue - value);
if (diff < min) {
return diff;
}
return min;
}, Infinity);
} | javascript | {
"resource": ""
} |
q29721 | adjustRange | train | function adjustRange(w, bisect) {
var r0 = w.i0,
r1 = w.i1 - 1,
c = w.compare,
d = w.data,
n = d.length - 1;
if (r0 > 0 && !c(d[r0], d[r0-1])) w.i0 = bisect.left(d, d[r0]);
if (r1 < n && !c(d[r1], d[r1+1])) w.i1 = bisect.right(d, d[r1]);
} | javascript | {
"resource": ""
} |
q29722 | makePlusMinus | train | function makePlusMinus(formatter) {
return function plusMinusWrapped(value) {
if (value != null && value > 0) {
return '+' + formatter(value);
}
return formatter(value);
};
} | javascript | {
"resource": ""
} |
q29723 | makePercent | train | function makePercent(formatter) {
return function percentWrapped(value) {
if (value != null) {
return formatter(value * 100) + '%';
}
return formatter(value);
};
} | javascript | {
"resource": ""
} |
q29724 | train | function(options) {
events.EventEmitter.call(this); // inherit from EventEmitter
TRACE = options.log;
IDX = options.idx;
STATUS = options.status;
HOST = options.host;
REQUEST = options.request;
this.domoMQTT = this.connect(HOST);
} | javascript | {
"resource": ""
} | |
q29725 | train | function () {
var c = this.findCollapsibleItem();
if (c) {
//apply movedClass is needed
if(this.movedClass && this.movedClass.length > 0 && !c.hasClass(this.movedClass)) {
c.addClass(this.movedClass);
}
// passing null to add child to the front of the control list
this.$.menu.addChild(c, null);
... | javascript | {
"resource": ""
} | |
q29726 | train | function () {
var c$ = this.$.menu.children;
var c = c$[0];
if (c) {
//remove any applied movedClass
if (this.movedClass && this.movedClass.length > 0 && c.hasClass(this.movedClass)) {
c.removeClass(this.movedClass);
}
this.$.client.addChild(c);
var p = this.$.client.hasNode();
if (p && c.ha... | javascript | {
"resource": ""
} | |
q29727 | train | function () {
if (this.$.client.hasNode()) {
var c$ = this.$.client.children;
var n = c$.length && c$[c$.length-1].hasNode();
if (n) {
this.$.client.reflow();
//Workaround: scrollWidth value not working in Firefox, so manually compute
//return (this.$.client.node.scrollWidth > this.$.client.node.... | javascript | {
"resource": ""
} | |
q29728 | tdStyle | train | function tdStyle(cellData, { columnSummary, column, rowData, isBottomData }) {
let domain;
let backgroundScale;
let colorScale;
let colorShift;
let colorScheme;
let reverseColors;
let includeBottomData;
// read in from plugin options
if (column.plugins && column.plugins.heatmap) {
domain = column... | javascript | {
"resource": ""
} |
q29729 | minMaxClassName | train | function minMaxClassName(cellData, _ref) {
var columnSummary = _ref.columnSummary;
var column = _ref.column;
var rowData = _ref.rowData;
var sortValue = Utils.getSortValueFromCellData(cellData, column, rowData);
if (sortValue === columnSummary.min) {
return 'highlight-min-max highlight-min';
} else if ... | javascript | {
"resource": ""
} |
q29730 | minClassName | train | function minClassName(cellData, _ref2) {
var columnSummary = _ref2.columnSummary;
var column = _ref2.column;
var rowData = _ref2.rowData;
var sortValue = Utils.getSortValueFromCellData(cellData, column, rowData);
if (sortValue === columnSummary.min) {
return 'highlight-min';
}
return undefined;
} | javascript | {
"resource": ""
} |
q29731 | maxClassName | train | function maxClassName(cellData, _ref3) {
var columnSummary = _ref3.columnSummary;
var column = _ref3.column;
var rowData = _ref3.rowData;
var sortValue = Utils.getSortValueFromCellData(cellData, column, rowData);
if (sortValue === columnSummary.max) {
return 'highlight-max';
}
return undefined;
} | javascript | {
"resource": ""
} |
q29732 | getCellData | train | function getCellData(column, rowData, rowNumber, tableData, columns, isBottomData) {
var value = column.value;
var id = column.id;
// if it is bottom data, just use the value directly.
if (isBottomData) {
return rowData[id];
}
// call value as a function
if (typeof value === 'function') {
retur... | javascript | {
"resource": ""
} |
q29733 | getSortValueFromCellData | train | function getSortValueFromCellData(cellData, column, rowData) {
var sortValue = column.sortValue;
if (sortValue) {
return sortValue(cellData, rowData);
}
return cellData;
} | javascript | {
"resource": ""
} |
q29734 | getSortValue | train | function getSortValue(column, rowData, rowNumber, tableData, columns) {
var cellData = getCellData(column, rowData, rowNumber, tableData, columns);
return getSortValueFromCellData(cellData, column, rowData);
} | javascript | {
"resource": ""
} |
q29735 | sortData | train | function sortData(data, columnId, sortDirection, columns) {
var column = getColumnById(columns, columnId);
if (!column) {
if (process.env.NODE_ENV !== 'production') {
console.warn('No column found by ID', columnId, columns);
}
return data;
}
// read the type from `sortType` property if defi... | javascript | {
"resource": ""
} |
q29736 | renderCell | train | function renderCell(cellData, column, rowData, rowNumber, tableData, columns, isBottomData, columnSummary) {
var renderer = column.renderer;
var renderOnNull = column.renderOnNull;
// render if not bottom data-- bottomData's cellData is already rendered.
if (!isBottomData) {
// do not render if value is n... | javascript | {
"resource": ""
} |
q29737 | validateColumns | train | function validateColumns(columns) {
if (!columns) {
return;
}
// check IDs
var ids = {};
columns.forEach(function (column, i) {
var id = column.id;
if (!ids[id]) {
ids[id] = [i];
} else {
ids[id].push(i);
}
});
Object.keys(ids).forEach(function (id) {
if (ids[id].leng... | javascript | {
"resource": ""
} |
q29738 | forEach | train | function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/* eslint no-param-reassign:0 */
obj = [obj];
}
if (Array.isArray(obj)) {
// Ite... | javascript | {
"resource": ""
} |
q29739 | watchInputs | train | function watchInputs() {
var state;
state = pfio.read_input();
if (state !== prev_state) {
EventBus.emit('pfio.inputs.changed', state, prev_state);
prev_state = state;
}
setTimeout(watchInputs, 10);
} | javascript | {
"resource": ""
} |
q29740 | meanSummarizer | train | function meanSummarizer(column, tableData, columns) {
var stats = tableData.reduce(function (stats, rowData, rowNumber) {
var sortValue = Utils.getSortValue(column, rowData, rowNumber, tableData, columns);
if (sortValue) {
if (stats.sum === null) {
stats.sum = sortValue;
} else {
... | javascript | {
"resource": ""
} |
q29741 | frequencySummarizer | train | function frequencySummarizer(column, tableData, columns) {
var mostFrequent = void 0;
var counts = tableData.reduce(function (counts, rowData, rowNumber) {
var cellData = Utils.getCellData(column, rowData, rowNumber, tableData, columns);
if (!counts[cellData]) {
counts[cellData] = 1;
} else {
... | javascript | {
"resource": ""
} |
q29742 | isRuleScopable | train | function isRuleScopable(rule){
if(rule.parent.type !== 'root') {
if (rule.parent.type === 'atrule' && conditionalGroupRules.indexOf(rule.parent.name) > -1){
return true;
}
else {
return false;
}
}
else {
return true;
}
} | javascript | {
"resource": ""
} |
q29743 | atlasPack | train | function atlasPack(img) {
var node = atlas.pack(img);
if (node === false) {
atlas = atlas.expand(img);
//atlas.tilepad = true;
}
} | javascript | {
"resource": ""
} |
q29744 | CompositeDisposable | train | function CompositeDisposable () {
var args = [], i, len;
if (Array.isArray(arguments[0])) {
args = arguments[0];
len = args.length;
} else {
len = arguments.length;
args = new Array(len);
for(i = 0; i < len; i++) { args[i] = arguments[i]; }
}
this._disposables = args;
this.isDisposed = f... | javascript | {
"resource": ""
} |
q29745 | train | function (inControl) {
var c = inControl.caption || ('Tab ' + this.lastIndex);
this.selectedId = this.lastIndex++ ;
var t = this.$.tabs.createComponent(
{
content: c,
userData: inControl.data || { },
tooltipMsg: inControl.tooltipMsg, //may be null
userId: inControl.userId, // may be null
... | javascript | {
"resource": ""
} | |
q29746 | train | function (target) {
var tab = this.resolveTab(target,'removeTab');
var tabData = {
index: tab.tabIndex,
caption: tab.content,
tooltipMsg: tab.tooltipMsg,
userId: tab.userId,
data: tab.userData
} ;
var that = this ;
if (tab) {
tabData.next = function (err) {
if (err) { throw new Err... | javascript | {
"resource": ""
} | |
q29747 | train | function () {
var result = 0;
utils.forEach(
this.$.tabs.getControls(),
function (tab){
var w = tab.origWidth() ;
// must add margin and padding of inner button and outer tab-item
result += w + 18 ;
}
);
return result;
} | javascript | {
"resource": ""
} | |
q29748 | train | function (inSender, inEvent) {
var that = this ;
var popup = this.$.popup;
for (var name in popup.$) {
if (popup.$.hasOwnProperty(name) && /menuItem/.test(name)) {
popup.$[name].destroy();
}
}
//popup.render();
utils.forEach(
this.$.tabs.getControls(),
function (tab) {
that.$.popup.cre... | javascript | {
"resource": ""
} | |
q29749 | bufferReviver | train | function bufferReviver(k, v) {
if (
v !== null &&
typeof v === 'object' &&
'type' in v &&
v.type === 'Buffer' &&
'data' in v &&
Array.isArray(v.data)) {
return new Buffer(v.data);
}
return v;
} | javascript | {
"resource": ""
} |
q29750 | MetaData | train | function MetaData() {
// the key for the storing
this.key = null;
// data to store
this.value = null;
// temporary filename for the cached file because filenames cannot represend urls completely
this.filename = null;
// expirydate of the entry
this.expires = null;
// size of the cur... | javascript | {
"resource": ""
} |
q29751 | DiskStore | train | function DiskStore(options) {
options = options || {};
this.options = extend({
path: 'cache/',
ttl: 60,
maxsize: 0,
zip: false
}, options);
// check storage directory for existence (or create it)
if (!fs.existsSync(this.options.path)) {
fs.mkdirSync(this.op... | javascript | {
"resource": ""
} |
q29752 | train | function (value) {
this.$.animator.play({
startValue: this.value,
endValue: value,
node: this.hasNode()
});
this.setValue(value);
} | javascript | {
"resource": ""
} | |
q29753 | DashDocsetTheme | train | function DashDocsetTheme(renderer, basePath) {
_super.call(this, renderer, basePath);
renderer.on(output.Renderer.EVENT_BEGIN, this.onRendererBegin, this, 1024);
this.dashIndexPlugin = new DashIndexPlugin(renderer);
this.dashAssetsPlugin = new DashAssetsPl... | javascript | {
"resource": ""
} |
q29754 | containsExternals | train | function containsExternals(modules) {
for (var index = 0, length = modules.length; index < length; index++) {
if (modules[index].flags.isExternal)
return true;
}
return false;
} | javascript | {
"resource": ""
} |
q29755 | sortReflections | train | function sortReflections(modules) {
modules.sort(function (a, b) {
if (a.flags.isExternal && !b.flags.isExternal)
return 1;
if (!a.flags.isExternal && b.flags.isExternal)
return -1;
... | javascript | {
"resource": ""
} |
q29756 | includeDedicatedUrls | train | function includeDedicatedUrls(reflection, item) {
(function walk(reflection) {
for (var key in reflection.children) {
var child = reflection.children[key];
if (child.hasOwnDocument && !child.kindOf(td.models.ReflectionKi... | javascript | {
"resource": ""
} |
q29757 | buildChildren | train | function buildChildren(reflection, parent) {
var modules = reflection.getChildrenByKind(td.models.ReflectionKind.SomeModule);
modules.sort(function (a, b) {
return a.getFullName() < b.getFullName() ? -1 : 1;
});
modu... | javascript | {
"resource": ""
} |
q29758 | buildGroups | train | function buildGroups(reflections, parent, callback) {
var state = -1;
var hasExternals = containsExternals(reflections);
sortReflections(reflections);
reflections.forEach(function (reflection) {
if (hasExternals && !... | javascript | {
"resource": ""
} |
q29759 | build | train | function build(hasSeparateGlobals) {
var root = new output.NavigationItem('Index', 'index.html');
if (entryPoint == project) {
var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
... | javascript | {
"resource": ""
} |
q29760 | jobDone | train | function jobDone(err, data) {
// TODO: check if function was already called before
// check if we close the connection after this (to prevent memory leaks)
var closing = totalRequests > REQUESTS_BEFORE_WORKER_RESTART ? true : false;
var msg = {};
if (err) {
msg.err... | javascript | {
"resource": ""
} |
q29761 | train | function (rect) {
var s = '';
for (var n in rect) {
s += (n + ':' + rect[n] + (isNaN(rect[n]) ? '; ' : 'px; '));
}
this.addStyles(s);
} | javascript | {
"resource": ""
} | |
q29762 | train | function (node) {
var r = this.getBoundingRect(node);
var pageYOffset = (window.pageYOffset === undefined) ? document.documentElement.scrollTop : window.pageYOffset;
var pageXOffset = (window.pageXOffset === undefined) ? document.documentElement.scrollLeft : window.pageXOffset;
var rHeight = (r.height === unde... | javascript | {
"resource": ""
} | |
q29763 | train | function () {
if (this.showing && this.hasNode() && this.activator) {
this.resetPositioning();
this.activatorOffset = this.getPageOffset(this.activator);
var innerWidth = this.getViewWidth();
var innerHeight = this.getViewHeight();
//These are the view "flush boundaries"
var topFlushPt = this.vertF... | javascript | {
"resource": ""
} | |
q29764 | train | function () {
this.resetPositioning();
this.addClass('vertical');
var clientRect = this.getBoundingRect(this.node);
var innerHeight = this.getViewHeight();
if (this.floating){
if (this.activatorOffset.top < (innerHeight / 2)) {
this.applyPosition({top: this.activatorOffset.top + this.activatorOffset.... | javascript | {
"resource": ""
} | |
q29765 | tryPhantomjsInLib | train | function tryPhantomjsInLib() {
return Q.fcall(function () {
return findValidPhantomJsBinary(path.resolve(__dirname, './lib/location.js'))
}).then(function (binaryLocation) {
if (binaryLocation) {
console.log('PhantomJS is previously installed at', binaryLocation)
exit(0)
}
}).fail(function... | javascript | {
"resource": ""
} |
q29766 | tryPhantomjsOnPath | train | function tryPhantomjsOnPath() {
if (getTargetPlatform() != process.platform || getTargetArch() != process.arch) {
console.log('Building for target platform ' + getTargetPlatform() + '/' + getTargetArch() +
'. Skipping PATH search')
return Q.resolve(false)
}
return Q.nfcall(which, 'phantom... | javascript | {
"resource": ""
} |
q29767 | downloadPhantomjs | train | function downloadPhantomjs() {
var downloadSpec = getDownloadSpec()
if (!downloadSpec) {
console.error(
'Unexpected platform or architecture: ' + getTargetPlatform() + '/' + getTargetArch() + '\n' +
'It seems there is no binary available for your platform/architecture\n' +
'Try to instal... | javascript | {
"resource": ""
} |
q29768 | train | function()
{
//kill the Flash Player instance
if(this._swf)
{
var container = YAHOO.util.Dom.get(this._containerID);
container.removeChild(this._swf);
}
var instanceName = this._id;
//null out properties
for(var prop in this)
{
if(YAHOO.lang.hasOwnProperty(this, prop))
{
this[prop... | javascript | {
"resource": ""
} | |
q29769 | train | function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode, buttonSkin)
{
//standard SWFObject embed
var swfObj = new YAHOO.deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor);
if(expressInstall)
{
swfObj.useExpressInstall(expressInstall);
}
//make su... | javascript | {
"resource": ""
} | |
q29770 | train | function()
{
this._initialized = false;
this._initAttributes(this._attributes);
this.setAttributes(this._attributes, true);
this._initialized = true;
this.fireEvent("contentReady");
} | javascript | {
"resource": ""
} | |
q29771 | train | function(fileID, uploadScriptPath, method, vars, fieldName)
{
this._swf.upload(fileID, uploadScriptPath, method, vars, fieldName);
} | javascript | {
"resource": ""
} | |
q29772 | train | function(fileIDs, uploadScriptPath, method, vars, fieldName)
{
this._swf.uploadThese(fileIDs, uploadScriptPath, method, vars, fieldName);
} | javascript | {
"resource": ""
} | |
q29773 | train | function(uploadScriptPath, method, vars, fieldName)
{
this._swf.uploadAll(uploadScriptPath, method, vars, fieldName);
} | javascript | {
"resource": ""
} | |
q29774 | train | function() {
var value = this.getValue();
if(value.name === "") {
this.alert("Please choose a name");
return;
}
this.tempSavedWiring = {name: value.name, working: value.working, language: this.options.languageName };
this.adapter.saveWiring(this.tempSavedWiring, {
succ... | javascript | {
"resource": ""
} | |
q29775 | train | function() {
webhookit.WiringEditor.superclass.renderButtons.call(this);
var toolbar = YAHOO.util.Dom.get('toolbar');
var editTemplateButton = new YAHOO.widget.Button({ label:"Edit template", id:"WiringEditor-templateButton", container: toolbar });
editTemplateButton.on("click", webhookit.e... | javascript | {
"resource": ""
} | |
q29776 | train | function(method, formOpts, callback) {
var options = null;
if(YAHOO.lang.isObject(formOpts) && YAHOO.lang.isArray(formOpts.fields) ) {
options = formOpts;
}
// create the form directly from the method params
else {
options = inputEx.RPC.formForMethod(method);
/... | javascript | {
"resource": ""
} | |
q29777 | train | function(method) {
// convert the method parameters into a json-schema :
var schemaIdentifierMap = {};
schemaIdentifierMap[method.name] = {
id: method.name,
type:'object',
properties:{}
};
for(var i = 0 ; i < method._parameters.length ; i++) {
var... | javascript | {
"resource": ""
} | |
q29778 | train | function(serviceName, method) {
if(this[method]){
throw new Error("WARNING: "+ serviceName+ " already exists for service. Unable to generate function");
}
method.name = serviceName;
var self = this;
var func = function(data, opts) {
var envelope = rpc.Envelope[method.envelope || self._smd... | javascript | {
"resource": ""
} | |
q29779 | train | function(callback) {
var serviceDefs = this._smd.services;
// Generate the methods to this object
for(var serviceName in serviceDefs){
if( serviceDefs.hasOwnProperty(serviceName) ) {
// Get the object that will contain the method.
// handles "namespaced" service... | javascript | {
"resource": ""
} | |
q29780 | train | function(url, callback) {
// TODO: if url is not in the same domain, we should use jsonp !
util.Connect.asyncRequest('GET', url, {
success: function(o) {
try {
this._smd = lang.JSON.parse(o.responseText);
this.process(callback);
}
... | javascript | {
"resource": ""
} | |
q29781 | train | function(r) {
return util.Connect.asyncRequest('POST', r.target, r.callback, r.data );
} | javascript | {
"resource": ""
} | |
q29782 | train | function(smd, method, data) {
var eURI = encodeURIComponent;
var params = [];
for(var name in data){
if(data.hasOwnProperty(name)){
var value = data[name];
if(lang.isArray(value)){
for(var i=0; i < value.length; i++){
... | javascript | {
"resource": ""
} | |
q29783 | train | function (owner) {
this.owner = owner;
this.configChangedEvent =
this.createEvent(Config.CONFIG_CHANGED_EVENT);
this.configChangedEvent.signature = CustomEvent.LIST;
this.queueInProgress = false;
this.config = {};
th... | javascript | {
"resource": ""
} | |
q29784 | train | function ( key, propertyObject ) {
key = key.toLowerCase();
this.config[key] = propertyObject;
propertyObject.event = this.createEvent(key, { scope: this.owner });
propertyObject.event.signature = CustomEvent.LIST;
p... | javascript | {
"resource": ""
} | |
q29785 | train | function () {
var cfg = {},
currCfg = this.config,
prop,
property;
for (prop in currCfg) {
if (Lang.hasOwnProperty(currCfg, prop)) {
property = currCfg[prop];
if (pro... | javascript | {
"resource": ""
} | |
q29786 | train | function (key) {
var property = this.config[key.toLowerCase()];
if (property && property.event) {
return property.value;
} else {
return undefined;
}
} | javascript | {
"resource": ""
} | |
q29787 | train | function (key) {
key = key.toLowerCase();
var property = this.config[key];
if (property && property.event) {
if (this.initialConfig[key] &&
!Lang.isUndefined(this.initialConfig[key])) {
this.setProp... | javascript | {
"resource": ""
} | |
q29788 | train | function (key) {
key = key.toLowerCase();
var property = this.config[key];
if (property && property.event &&
!Lang.isUndefined(property.value)) {
if (this.queueInProgress) {
this.queueProperty(key)... | javascript | {
"resource": ""
} | |
q29789 | train | function () {
var i,
queueItem,
key,
value,
property;
this.queueInProgress = true;
for (i = 0;i < this.eventQueue.length; i++) {
queueItem = this.eventQueue[i];
if (queu... | javascript | {
"resource": ""
} | |
q29790 | train | function (key, handler, obj, overrideContext) {
var property = this.config[key.toLowerCase()];
if (property && property.event) {
if (!Config.alreadySubscribed(property.event, handler, obj)) {
property.event.subscribe(handler, obj, overrideContext);
... | javascript | {
"resource": ""
} | |
q29791 | train | function (key, handler, obj) {
var property = this.config[key.toLowerCase()];
if (property && property.event) {
return property.event.unsubscribe(handler, obj);
} else {
return false;
}
} | javascript | {
"resource": ""
} | |
q29792 | train | function () {
var output = "",
queueItem,
q,
nQueue = this.eventQueue.length;
for (q = 0; q < nQueue; q++) {
queueItem = this.eventQueue[q];
if (queueItem) {
output += queueItem[0]... | javascript | {
"resource": ""
} | |
q29793 | train | function () {
var oConfig = this.config,
sProperty,
oProperty;
for (sProperty in oConfig) {
if (Lang.hasOwnProperty(oConfig, sProperty)) {
oProperty = oConfig[sProperty];
oProperty.event.uns... | javascript | {
"resource": ""
} | |
q29794 | train | function () {
var isGeckoWin = (UA.gecko && this.platform == "windows");
if (isGeckoWin) {
// Help prevent spinning loading icon which
// started with FireFox 2.0.0.8/Win
var self = this;
setTimeout(function(){self._initResizeMoni... | javascript | {
"resource": ""
} | |
q29795 | train | function() {
var oDoc,
oIFrame,
sHTML;
function fireTextResize() {
Module.textResizeEvent.fire();
}
if (!UA.opera) {
oIFrame = Dom.get("_yuiResizeMonitor");
var supportsCWResize = this._... | javascript | {
"resource": ""
} | |
q29796 | train | function (headerContent) {
var oHeader = this.header || (this.header = createHeader());
if (headerContent.nodeName) {
oHeader.innerHTML = "";
oHeader.appendChild(headerContent);
} else {
oHeader.innerHTML = headerContent;
}... | javascript | {
"resource": ""
} | |
q29797 | train | function (element) {
var oHeader = this.header || (this.header = createHeader());
oHeader.appendChild(element);
this.changeHeaderEvent.fire(element);
this.changeContentEvent.fire();
} | javascript | {
"resource": ""
} | |
q29798 | train | function (bodyContent) {
var oBody = this.body || (this.body = createBody());
if (bodyContent.nodeName) {
oBody.innerHTML = "";
oBody.appendChild(bodyContent);
} else {
oBody.innerHTML = bodyContent;
}
if (this... | javascript | {
"resource": ""
} | |
q29799 | train | function (footerContent) {
var oFooter = this.footer || (this.footer = createFooter());
if (footerContent.nodeName) {
oFooter.innerHTML = "";
oFooter.appendChild(footerContent);
} else {
oFooter.innerHTML = footerContent;
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.