_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q30000 | train | function() {
// Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)
// It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??
/*if( YAHOO.env.ua.ie && parseInt(YAHOO.env.ua.ie,10) != 7 ) {
Event.addListener(this.el, "click", function() { this.fire... | javascript | {
"resource": ""
} | |
q30001 | train | function(value, sendUpdatedEvt) {
if (value===this.checkedValue || (typeof(value) == 'string' && typeof(this.checkedValue) == 'boolean' &&
value === String(this.checkedValue))) {
this.hiddenEl.value = this.checkedValue;
// check checkbox (all browsers)
this.el.checked = true;
// hacks for IE6,... | javascript | {
"resource": ""
} | |
q30002 | train | function(text) {
var sel, startPos, endPos;
//IE support
if (document.selection) {
this.el.focus();
sel = document.selection.createRange();
sel.text = text;
}
//Mozilla/Firefox/Netscape 7+ support
else if (this.el.selectionStart || this.el.selectionStart == '0') {
startPos = this.el.select... | javascript | {
"resource": ""
} | |
q30003 | train | function() {
this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
// Render the editor field
this.editorField = inputEx(this.options.editorField,this);
var editorFieldEl = this.editorField.getEl();
this.editorContainer.appendCh... | javascript | {
"resource": ""
} | |
q30004 | train | function(e) {
if(this.colorAnim) {
this.colorAnim.stop(true);
}
inputEx.sn(this.formattedContainer, null, {backgroundColor: this.options.animColors.from });
} | javascript | {
"resource": ""
} | |
q30005 | train | function(e) {
// Start animation
if(this.colorAnim) {
this.colorAnim.stop(true);
}
this.colorAnim = new YAHOO.util.ColorAnim(this.formattedContainer, {backgroundColor: this.options.animColors}, 1);
this.colorAnim.onComplete.subscribe(function() { Dom.setStyle(this.formattedContain... | javascript | {
"resource": ""
} | |
q30006 | train | function() {
this.formattedContainer = inputEx.cn('div', {className: 'inputEx-InPlaceEdit-visu'});
if( lang.isFunction(this.options.formatDom) ) {
this.formattedContainer.appendChild( this.options.formatDom(this.options.value) );
}
else if( lang.isFunction(this.options.formatValu... | javascript | {
"resource": ""
} | |
q30007 | train | function() {
Event.addListener(this.formattedContainer, "click", this.openEditor, this, true);
// For color animation (if specified)
if (this.options.animColors) {
Event.addListener(this.formattedContainer, 'mouseover', this.onVisuMouseOver, this, true);
Event.addListe... | javascript | {
"resource": ""
} | |
q30008 | train | function() {
var value = this.getValue();
this.editorContainer.style.display = '';
this.formattedContainer.style.display = 'none';
if(!lang.isUndefined(value)) {
this.editorField.setValue(value);
}
// Set focus in the element !
this.editorField.focus();
... | javascript | {
"resource": ""
} | |
q30009 | train | function(value, sendUpdatedEvt) {
// Store the value
this.value = value;
if(lang.isUndefined(value) || value == "") {
inputEx.renderVisu(this.options.visu, inputEx.messages.emptyInPlaceEdit, this.formattedContainer);
}
else {
inputEx.renderVisu(this.options.visu, thi... | javascript | {
"resource": ""
} | |
q30010 | train | function() {
try {
// Save the previous value:
var previousVal = null;
// Close a previously created group
if(this.group) {
previousVal = this.group.getValue();
this.group.close();
this.group.destroy();
this.gr... | javascript | {
"resource": ""
} | |
q30011 | train | function() {
if (this.propertyPanel.style.display == 'none') {
this.propertyPanel.style.display = '';
Dom.addClass(this.button, "opened");
} else {
this.propertyPanel.style.display = 'none';
Dom.removeClass(this.button, "opened");
}
} | javascript | {
"resource": ""
} | |
q30012 | train | function() {
try {
// Close previous field
if(this.fieldValue) {
this.fieldValue.close();
this.fieldValue.destroy();
delete this.fieldValue;
this.fieldValueWrapper.innerHTML = '';
}
// Re-build the fieldValue
var f... | javascript | {
"resource": ""
} | |
q30013 | train | function(value, sendUpdatedEvt) {
// Set type in property panel
this.typeSelect.setValue(value.type, false);
// Rebuild the panel propertues
this.rebuildGroupOptions();
// Set the parameters value
// Retro-compatibility with deprecated inputParams Object
i... | javascript | {
"resource": ""
} | |
q30014 | train | function() {
var getDefaultValueForField = function (classObj, paramName) {
var i, length = classObj.groupOptions.length, f;
for(i = 0 ; i < length ; i++) {
f = classObj.groupOptions[i];
// Retro-compatibility with deprecated inputParams Obje... | javascript | {
"resource": ""
} | |
q30015 | train | function() {
// Render the help panel
this.renderHelpPanel();
/**
* @property layout
* @type {YAHOO.widget.Layout}
*/
this.layout = new widget.Layout(this.el, this.options.layoutOptions);
this.layout.render();
// Right accordion
this.renderPropertiesAccordion();
... | javascript | {
"resource": ""
} | |
q30016 | train | function() {
/**
* @property helpPanel
* @type {YAHOO.widget.Panel}
*/
this.helpPanel = new widget.Panel('helpPanel', {
fixedcenter: true,
draggable: true,
visible: false,
modal: true
});
this.helpPanel.render();
} | javascript | {
"resource": ""
} | |
q30017 | train | function() {
/**
* @property alertPanel
* @type {YAHOO.widget.Panel}
*/
this.alertPanel = new widget.Panel('WiringEditor-alertPanel', {
fixedcenter: true,
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.alertPanel.setH... | javascript | {
"resource": ""
} | |
q30018 | train | function() {
this.propertiesForm = new inputEx.Group({
parentEl: YAHOO.util.Dom.get('propertiesForm'),
fields: this.options.propertiesFields
});
this.propertiesForm.updatedEvt.subscribe(function() {
this.markUnsaved();
}, this, true);
} | javascript | {
"resource": ""
} | |
q30019 | train | function(e) {
WireIt.ModuleProxy.superclass.startDrag.call(this,e);
var del = this.getDragEl(),
lel = this.getEl();
del.innerHTML = lel.innerHTML;
del.className = lel.className;
} | javascript | {
"resource": ""
} | |
q30020 | train | function(e, ddTargets) {
// The layer is the only target :
var layerTarget = ddTargets[0],
layer = ddTargets[0]._layer,
del = this.getDragEl(),
pos = Dom.getXY(del),
layerPos = Dom.getXY(layer.el);
this._WiringEditor.addModule( this._module ,[pos[0]-layerPos[0]+layer.el.scrollLeft, po... | javascript | {
"resource": ""
} | |
q30021 | train | function() {
WireIt.WiringEditor.superclass.render.call(this);
/**
* @property layer
* @type {WireIt.Layer}
*/
this.layer = new WireIt.Layer(this.options.layerOptions);
this.layer.eventChanged.subscribe(this.onLayerChanged, this, true);
// Left Accordion
this.renderModulesAcc... | javascript | {
"resource": ""
} | |
q30022 | train | function() {
// Create the modules accordion DOM if not found
if(!Dom.get('modulesAccordionView')) {
Dom.get('left').appendChild( WireIt.cn('ul', {id: 'modulesAccordionView'}) );
var li = WireIt.cn('li');
li.appendChild(WireIt.cn('h2',null,null,"Main"));
var d = WireIt.cn('div');
d.appendChild( Wi... | javascript | {
"resource": ""
} | |
q30023 | train | function() {
var modules = this.modules;
for(var i = 0 ; i < modules.length ; i++) {
this.addModuleToList(modules[i]);
}
// Make the layer a drag drop target
if(!this.ddTarget) {
this.ddTarget = new YAHOO.util.DDTarget(this.layer.el, "module");
this.ddTarget._layer =... | javascript | {
"resource": ""
} | |
q30024 | train | function(module) {
try {
var div = WireIt.cn('div', {className: "WiringEditor-module"});
if(module.description) {
div.title = module.description;
}
if(module.container.icon) {
div.appendChild( WireIt.cn('img',{src: module.container.icon}) );
}
div.appendChild( WireIt.cn('span'... | javascript | {
"resource": ""
} | |
q30025 | train | function(module, pos) {
try {
var containerConfig = module.container;
containerConfig.position = pos;
containerConfig.title = module.name;
var temp = this;
containerConfig.getGrouper = function() { return temp.getCurrentGrouper(temp); };
var container = this.layer.ad... | javascript | {
"resource": ""
} | |
q30026 | train | function() {
if(this.inputFilterTimeout) {
clearTimeout(this.inputFilterTimeout);
this.inputFilterTimeout = null;
}
var that = this;
this.inputFilterTimeout = setTimeout(function() {
that.updateLoadPanelList(Dom.get('loadFilter').value);
}, 500);
} | javascript | {
"resource": ""
} | |
q30027 | train | function() {
var i;
var obj = {modules: [], wires: [], properties: null};
for( i = 0 ; i < this.layer.containers.length ; i++) {
obj.modules.push( {name: this.layer.containers[i].title, value: this.layer.containers[i].getValue(), config: this.layer.containers[i].getConfig()});
}
for( i = 0 ;... | javascript | {
"resource": ""
} | |
q30028 | train | function(group, deep, func, context)
{
if (!lang.isValue(context))
context = this;
if (lang.isValue(group.groupContainer))
func.call(context, group.groupContainer);
else
{
for (var cI in group.containers)
func.call(context, group.containers[cI].container)
if (deep)
{
... | javascript | {
"resource": ""
} | |
q30029 | train | function(group, layer)
{
group.collapsing = true;
if (lang.isValue(group.groupContainer))
layer.removeContainer(group.groupContainer);
else
{
for (var i in group.containers)
layer.removeContainer(group.containers[i])
for (var i in group.groups)
WireIt.GroupUtils.remov... | javascript | {
"resource": ""
} | |
q30030 | train | function(group, map)
{
if (!lang.isObject(map))
map = WireIt.GroupUtils.getMap(group);
var fieldConfigs = [];
var terminalConfigs = [];
var generateExternal = function(ftMap)
{
for (var cI in ftMap)
{
var c = ftMap[cI];
for (var fName in c.fields)
{
var fMap =... | javascript | {
"resource": ""
} | |
q30031 | train | function(group)
{
var bounds = {};
var setBound = function(position)
{
var left, top;
left = position[0];
top = position[1];
if ((typeof bounds["left"] == "undefined") || bounds["left"] > left)
bounds["left"] = left;
if ((typeof bounds["right"] == "undefine... | javascript | {
"resource": ""
} | |
q30032 | train | function(event) {
var elem = this.grouper.layer.el;
var rect = elem.getBoundingClientRect();
var xNoScroll = event.clientX-rect.left;
var yNoScroll = event.clientY-rect.top;
if (xNoScroll < elem.clientWidth && yNoScroll < elem.clientHeight) {
this.start();
}
} | javascript | {
"resource": ""
} | |
q30033 | train | function() {
this.show();
this.SetCanvasRegion(0, 0, this.grouper.layer.el.scrollWidth, this.grouper.layer.el.scrollHeight);
var ctxt = this.getContext();
ctxt.beginPath();
ctxt.moveTo(this.lastX, this.lastY);
this.startX = this.lastX;
this.startY = this.lastY;
this.timer =... | javascript | {
"resource": ""
} | |
q30034 | train | function(directions) {
var elem = this.grouper.layer.el;
if (directions.left)
elem.scrollLeft = Math.max(0, elem.scrollLeft-this.scrollAmount);
else if (directions.right)
elem.scrollLeft = Math.min(elem.scrollWidth, elem.scrollLeft+this.scrollAmount);
if (directions.up)
elem.scrollTop... | javascript | {
"resource": ""
} | |
q30035 | train | function() {
if (lang.isObject(this.timer)) {
this.timer.cancel();
this.timer = null;
var ctxt = this.getContext();
this.nextPoint(this.startX, this.startY);
YAHOO.lang.later(1000, this, this.hide, 0, false);
}
} | javascript | {
"resource": ""
} | |
q30036 | train | function(x, y) {
if (lang.isValue(x) && lang.isValue(y)) {
var ctxt = this.getContext();
// Draw the inner bezier curve
ctxt.lineCap= "round";
ctxt.strokeStyle="green";
ctxt.lineWidth="3";
ctxt.lineTo(x, y);
ctxt.stroke();
}
} | javascript | {
"resource": ""
} | |
q30037 | parse | train | function parse(data, options, next) {
data = this.get(data);
if ('function' === typeof options) {
next = options;
options = {};
}
//
// We cannot detect a license so we call the callback without any arguments
// which symbolises a failed attempt.
//
if (!data) return next()... | javascript | {
"resource": ""
} |
q30038 | get | train | function get(data) {
if ('string' === typeof data) return { content: data };
if (data.readme) return { content: data.readme, file: 'readme' };
if (data.content) return data;
} | javascript | {
"resource": ""
} |
q30039 | xmlValue | train | function xmlValue(node) {
if (!node) {
return '';
}
var ret = '';
if (node.nodeType == DOM_TEXT_NODE ||
node.nodeType == DOM_CDATA_SECTION_NODE) {
ret += node.nodeValue;
} else if (node.nodeType == DOM_ATTRIBUTE_NODE) {
if (ajaxsltIsIE6) {
ret += xmlValueIE6Hack(node);
} else {
... | javascript | {
"resource": ""
} |
q30040 | train | function(name, value)
{
//we must jsonify this because Flash Player versions below 9.0.60 don't handle
//complex ExternalInterface parsing correctly
value = YAHOO.lang.JSON.stringify(value);
this._swf.setStyle(name, value);
} | javascript | {
"resource": ""
} | |
q30041 | train | function(styles)
{
//we must jsonify this because Flash Player versions below 9.0.60 don't handle
//complex ExternalInterface parsing correctly
styles = YAHOO.lang.JSON.stringify(styles);
this._swf.setStyles(styles);
} | javascript | {
"resource": ""
} | |
q30042 | train | function(styles)
{
//we must jsonify this because Flash Player versions below 9.0.60 don't handle
//complex ExternalInterface parsing correctly
for(var i = 0; i < styles.length; i++)
{
styles[i] = YAHOO.lang.JSON.stringify(styles[i]);
}
this._swf.setSeriesStyles(styles);
} | javascript | {
"resource": ""
} | |
q30043 | train | function(request, response, error)
{
if(this._swf)
{
if(error)
{
}
else
{
var i;
if(this._seriesFunctions)
{
var count = this._seriesFunctions.length;
for(i = 0; i < count; i++)
{
YAHOO.widget.Chart.removeProxyFunction(this._seriesFunctions[i]);
}
this._ser... | javascript | {
"resource": ""
} | |
q30044 | train | function(value)
{
if(this._dataTipFunction)
{
YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);
}
if(value)
{
this._dataTipFunction = value = YAHOO.widget.Chart.getFunctionReference(value);
}
this._swf.setDataTipFunction(value);
} | javascript | {
"resource": ""
} | |
q30045 | train | function(value)
{
if(this._legendLabelFunction)
{
YAHOO.widget.Chart.removeProxyFunction(this._legendLabelFunction);
}
if(value)
{
this._legendLabelFunction = value = YAHOO.widget.Chart.getFunctionReference(value);
}
this._swf.setLegendLabelFunction(value);
} | javascript | {
"resource": ""
} | |
q30046 | train | function(value)
{
var clonedAxis = {};
for(var prop in value)
{
if(prop == "labelFunction")
{
if(value.labelFunction && value.labelFunction !== null)
{
clonedAxis.labelFunction = YAHOO.widget.Chart.getFunctionReference(value.labelFunction);
}
}
else
{
clonedAxis[prop] = value[... | javascript | {
"resource": ""
} | |
q30047 | train | function(axisFunctions)
{
if(axisFunctions && axisFunctions.length > 0)
{
var len = axisFunctions.length;
for(var i = 0; i < len; i++)
{
if(axisFunctions[i] !== null)
{
YAHOO.widget.Chart.removeProxyFunction(axisFunctions[i]);
}
}
axisFunctions = [];
}
} | javascript | {
"resource": ""
} | |
q30048 | train | function(value)
{
if(value.position != "bottom" && value.position != "top") value.position = "bottom";
this._removeAxisFunctions(this._xAxisLabelFunctions);
value = this._getClonedAxis(value);
this._xAxisLabelFunctions.push(value.labelFunction);
this._swf.setHorizontalAxis(value);
} | javascript | {
"resource": ""
} | |
q30049 | train | function(value)
{
this._removeAxisFunctions(this._xAxisLabelFunctions);
var len = value.length;
for(var i = 0; i < len; i++)
{
if(value[i].position == "left") value[i].position = "bottom";
value[i] = this._getClonedAxis(value[i]);
if(value[i].labelFunction) this._xAxisLabelFunctions.push(value[i].labe... | javascript | {
"resource": ""
} | |
q30050 | train | function(value)
{
this._removeAxisFunctions(this._yAxisLabelFunctions);
value = this._getClonedAxis(value);
this._yAxisLabelFunctions.push(value.labelFunction);
this._swf.setVerticalAxis(value);
} | javascript | {
"resource": ""
} | |
q30051 | train | function(value)
{
this._removeAxisFunctions(this._yAxisLabelFunctions);
var len = value.length;
for(var i = 0; i < len; i++)
{
value[i] = this._getClonedAxis(value[i]);
if(value[i].labelFunction) this._yAxisLabelFunctions.push(value[i].labelFunction);
this._swf.setVerticalAxis(value[i]);
}
} | javascript | {
"resource": ""
} | |
q30052 | train | function(index, style)
{
style = YAHOO.lang.JSON.stringify(style);
if(this._swf && this._swf.setSeriesStylesByIndex) this._swf.setSeriesStylesByIndex(index, style);
} | javascript | {
"resource": ""
} | |
q30053 | train | function (err, length, data) {
if (err) {
if (self.autoClose) {
self.destroy()
}
self.emit('error', err)
}
self.push(data)
// self.once('finish', self.close)
} | javascript | {
"resource": ""
} | |
q30054 | train | function(oConfigs) {
Prog.superclass.constructor.call(this, document.createElement('div') , oConfigs);
this._init(oConfigs);
} | javascript | {
"resource": ""
} | |
q30055 | train | function(parent,before) {
if (this._rendered) { return; }
this._rendered = true;
var direction = this.get(DIRECTION);
// If the developer set a className attribute on initialization,
// Element would have wiped out my own classNames
// So I need to insist on them, plus add the one for direction... | javascript | {
"resource": ""
} | |
q30056 | train | function() {
this.set(ANIM,false);
this.unsubscribeAll();
var el = this.get('element');
if (el.parentNode) { el.parentNode.removeChild(el); }
} | javascript | {
"resource": ""
} | |
q30057 | train | function() {
var barEl = this.get(BAR_EL);
switch (this.get(DIRECTION)) {
case DIRECTION_LTR:
case DIRECTION_RTL:
this._barSpace = parseInt(this.get(WIDTH),10) -
(parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) -
(parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0);
break;
... | javascript | {
"resource": ""
} | |
q30058 | train | function(value) {
var container = this.get('element'),
text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{
value:value,
minValue:this.get(MIN_VALUE),
maxValue:this.get(MAX_VALUE)
});
container.setAttribute('aria-valuenow',value);
container.setAttribute('aria-valuetext',text);
} | javascript | {
"resource": ""
} | |
q30059 | train | function (needle) {
var path = null, keys = [], i = 0;
if (needle) {
// Strip the ["string keys"] and [1] array indexes
needle = needle.
replace(/\[(['"])(.*?)\1\]/g,
function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}).
... | javascript | {
"resource": ""
} | |
q30060 | train | function(oRequest, oFullResponse) {
var bError = false;
var elTable = oFullResponse;
var fields = this.responseSchema.fields;
var oParsedResponse = {results:[]};
if(lang.isArray(fields)) {
// Iterate through each TBODY
for(var i=0; i<elTable.tBodies.length; i++) {
var el... | javascript | {
"resource": ""
} | |
q30061 | train | function(oRequest, oCallback, oCaller) {
var tId = DS._nTransactionId++;
this.fireEvent("requestEvent", {tId:tId,request:oRequest,callback:oCallback,caller:oCaller});
// If there are no global pending requests, it is safe to purge global callback stack and global counter
if(util.ScriptNodeDataSourc... | javascript | {
"resource": ""
} | |
q30062 | train | function() {
// Div to display the invite, then the selected text
this.el = inputEx.cn('div', {className:'inputEx-Result'}, null, this.options.typeInvite);
YAHOO.util.Dom.addClass(this.el, (this.options.menuPosition[1] == "tr") ? "inputEx-RightArrow" : "inputEx-DownArrow");
this.fieldCont... | javascript | {
"resource": ""
} | |
q30063 | train | function() {
// Keep corresponding text for each value selectable in the menu
// -> will be used to display selection after click
this._textFromValue = {};
var that = this;
/*
* Recursive function to edit a level of menuItems
*
* args :
* -> conf : an array of menu... | javascript | {
"resource": ""
} | |
q30064 | train | function(fn, obj, overrideContext) {
if (!fn) {
throw new Error("Invalid callback for subscriber to '" + this.type + "'");
}
if (this.subscribeEvent) {
this.subscribeEvent.fire(fn, obj, overrideContext);
}
var s = new YAHOO.util.Subscriber(fn, obj, overrideContext)... | javascript | {
"resource": ""
} | |
q30065 | train | function(fn, obj) {
if (!fn) {
return this.unsubscribeAll();
}
var found = false;
for (var i=0, len=this.subscribers.length; i<len; ++i) {
var s = this.subscribers[i];
if (s && s.contains(fn, obj)) {
this._delete(i);
f... | javascript | {
"resource": ""
} | |
q30066 | train | function() {
var l = this.subscribers.length, i;
for (i=l-1; i>-1; i--) {
this._delete(i);
}
this.subscribers=[];
return l;
} | javascript | {
"resource": ""
} | |
q30067 | train | function(e) {
return fn.call(context, YAHOO.util.Event.getEvent(e, el),
obj);
} | javascript | {
"resource": ""
} | |
q30068 | train | function (el, fn, obj, overrideContext) {
return this.on(el, FOCUSOUT, fn, obj, overrideContext);
} | javascript | {
"resource": ""
} | |
q30069 | train | function(ev) {
var x = ev.pageX;
if (!x && 0 !== x) {
x = ev.clientX || 0;
if ( this.isIE ) {
x += this._getScrollLeft();
}
}
return x;
} | javascript | {
"resource": ""
} | |
q30070 | train | function(ev) {
var y = ev.pageY;
if (!y && 0 !== y) {
y = ev.clientY || 0;
if ( this.isIE ) {
y += this._getScrollTop();
}
}
return y;
} | javascript | {
"resource": ""
} | |
q30071 | train | function(ev) {
var t = ev.relatedTarget;
if (!t) {
if (ev.type == "mouseout") {
t = ev.toElement;
} else if (ev.type == "mouseover") {
t = ev.fromElement;
}
}
... | javascript | {
"resource": ""
} | |
q30072 | train | function(ev) {
if (!ev.time) {
var t = new Date().getTime();
try {
ev.time = t;
} catch(ex) {
this.lastError = ex;
return t;
}
}
... | javascript | {
"resource": ""
} | |
q30073 | train | function(ev) {
var code = ev.keyCode || ev.charCode || 0;
// webkit key normalization
if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
code = webkitKeymap[code];
}
return code;
} | javascript | {
"resource": ""
} | |
q30074 | train | function(e) {
var EU = YAHOO.util.Event;
if (!EU.DOMReady) {
EU.DOMReady=true;
// Fire the content ready custom event
EU.DOMReadyEvent.fire();
// Remove the DOMContentLoaded (FF/Opera)
E... | javascript | {
"resource": ""
} | |
q30075 | train | function() {
var dd = document.documentElement, db = document.body;
if (dd && (dd.scrollTop || dd.scrollLeft)) {
return [dd.scrollTop, dd.scrollLeft];
} else if (db) {
return [db.scrollTop, db.scrollLeft];
} else {
... | javascript | {
"resource": ""
} | |
q30076 | train | function(p_type, p_fn, p_obj, overrideContext) {
this.__yui_events = this.__yui_events || {};
var ce = this.__yui_events[p_type];
if (ce) {
ce.subscribe(p_fn, p_obj, overrideContext);
} else {
this.__yui_subscribers = this.__yui_subscribers || {};
va... | javascript | {
"resource": ""
} | |
q30077 | train | function(p_type, p_fn, p_obj) {
this.__yui_events = this.__yui_events || {};
var evts = this.__yui_events;
if (p_type) {
var ce = evts[p_type];
if (ce) {
return ce.unsubscribe(p_fn, p_obj);
}
} else {
var ret = true;
... | javascript | {
"resource": ""
} | |
q30078 | handleKeyPress | train | function handleKeyPress(e, obj) {
if (! keyData.shift) {
keyData.shift = false;
}
if (! keyData.alt) {
keyData.alt = false;
}
if (! keyData.ctrl) {
keyData.ctrl = false;
}
// check held down modifying keys first
... | javascript | {
"resource": ""
} |
q30079 | train | function (pairCode, linkUrl, includeStyles) {
/** @type {string} Pair code. */
this.pairCode = pairCode;
/** @type {string} URL for 'Connect' button. */
this.linkUrl = linkUrl;
/** @type {Element} Overlay element. */
this.el = document.createElement('div');
/** @type {Element} Overlay stylesheet. */
this... | javascript | {
"resource": ""
} | |
q30080 | train | function(codeText) {
this.textarea = WireIt.cn('textarea', null, {width: "90%", height: "70px", border: "0", padding: "5px"}, codeText);
this.setBody(this.textarea);
YAHOO.util.Event.addListener(this.textarea, 'change', this.createTerminals, this, true);
} | javascript | {
"resource": ""
} | |
q30081 | train | function() {
var width = WireIt.getIntStyle(this.el, "width");
var inputsIntervall = Math.floor(width/(this.nParams+1));
for(var i = 1 ; i < this.terminals.length ; i++) {
var term = this.terminals[i];
YAHOO.util.Dom.setStyle(term.el, "left", (inputsIntervall*(i))-15+"px" );
... | javascript | {
"resource": ""
} | |
q30082 | train | function() {
var obj = jsBox.Container.superclass.getConfig.call(this);
obj.codeText = this.textarea.value;
return obj;
} | javascript | {
"resource": ""
} | |
q30083 | train | function () {
// Grab the first callback in the queue
var c = this.q[0],
fn;
// If there is no callback in the queue or the Chain is currently
// in an execution mode, return
if (!c) {
this.fireEvent('end');
return this;
} else if (th... | javascript | {
"resource": ""
} | |
q30084 | train | function(tree) {
var maxRowDepth = 1;
var currentRow;
var currentColumn;
// Calculate the max depth of descendants for this row
var countMaxRowDepth = function(row, tmpRowDepth) {
tmpRowDepth = tmpRowDepth || 1;
for(var n=0; n... | javascript | {
"resource": ""
} | |
q30085 | train | function(row, tmpRowDepth) {
tmpRowDepth = tmpRowDepth || 1;
for(var n=0; n<row.length; n++) {
var col = row[n];
// Column has children, so keep counting
if(YAHOO.lang.isArray(col.children)) {
tmpRowDept... | javascript | {
"resource": ""
} | |
q30086 | train | function(i, oColumn) {
headers[i].push(oColumn.getSanitizedKey());
if(oColumn._oParent) {
recurseAncestorsForHeaders(i, oColumn._oParent);
}
} | javascript | {
"resource": ""
} | |
q30087 | train | function() {
var aDefinitions = this._aDefinitions;
// Internal recursive function to define Column instances
var parseColumns = function(nodeList, oSelf) {
// Parse each node at this depth for attributes and any children
for(var j=0; j<nodeList.length; j++) {
... | javascript | {
"resource": ""
} | |
q30088 | train | function(column) {
if(YAHOO.lang.isString(column)) {
var allColumns = this.flat;
for(var i=allColumns.length-1; i>-1; i--) {
if(allColumns[i]._sId === column) {
return allColumns[i];
}
}
}
return null;
} | javascript | {
"resource": ""
} | |
q30089 | train | function(column) {
if(YAHOO.lang.isNumber(column) && this.keys[column]) {
return this.keys[column];
}
else if(YAHOO.lang.isString(column)) {
var allColumns = this.flat;
var aColumns = [];
for(var i=0; i<allColumns.length; i++) {
if(... | javascript | {
"resource": ""
} | |
q30090 | train | function() {
var oDefinition = {};
// Update the definition
oDefinition.abbr = this.abbr;
oDefinition.className = this.className;
oDefinition.editor = this.editor;
oDefinition.editorOptions = this.editorOptions; //TODO: deprecated
oDefinition.field = this... | javascript | {
"resource": ""
} | |
q30091 | train | function(e) {
this.startWidth = this.headCellLiner.offsetWidth;
this.startX = YAHOO.util.Event.getXY(e)[0];
this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0) +
(parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"padd... | javascript | {
"resource": ""
} | |
q30092 | train | function() {
// Shrinks height of all resizer els to not hold open TH els
var allKeys = this.datatable.getColumnSet().keys,
thisKey = this.column.getKeyIndex(),
col;
for(var i=0, len=allKeys.length; i<len; i++) {
col = allKeys[i];
... | javascript | {
"resource": ""
} | |
q30093 | train | function(e) {
var newX = YAHOO.util.Event.getXY(e)[0];
if(newX > YAHOO.util.Dom.getX(this.headCellLiner)) {
var offsetX = newX - this.startX;
var newWidth = this.startWidth + offsetX - this.nLinerPadding;
if(newWidth > 0) {
this... | javascript | {
"resource": ""
} | |
q30094 | train | function(index, range) {
if(!lang.isNumber(range) || (range < 0)) {
range = 1;
}
this._records.splice(index, range);
//this._length = this._length - range;
} | javascript | {
"resource": ""
} | |
q30095 | train | function(record) {
var i;
if(record instanceof widget.Record) {
for(i=0; i<this._records.length; i++) {
if(this._records[i] && (this._records[i]._sId === record._sId)) {
return record;
}
}
}
else if(lang.isNumber... | javascript | {
"resource": ""
} | |
q30096 | train | function(index, range) {
if(!lang.isNumber(index)) {
return this._records;
}
if(!lang.isNumber(range)) {
return this._records.slice(index);
}
return this._records.slice(index, index+range);
} | javascript | {
"resource": ""
} | |
q30097 | train | function (index, range) {
var recs = this.getRecords(index,range);
for (var i = 0; i < range; ++i) {
if (typeof recs[i] === 'undefined') {
return false;
}
}
return true;
} | javascript | {
"resource": ""
} | |
q30098 | train | function(oRecord) {
if(oRecord) {
for(var i=this._records.length-1; i>-1; i--) {
if(this._records[i] && oRecord.getId() === this._records[i].getId()) {
return i;
}
}
}
return null;
} | javascript | {
"resource": ""
} | |
q30099 | train | function(aData, index) {
if(lang.isArray(aData)) {
var newRecords = [],
idx,i,len;
index = lang.isNumber(index) ? index : this._records.length;
idx = index;
// Can't go backwards bc we need to preserve order
for(i=0,len=aData.length; ... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.