_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q30700 | train | function () {
YAHOO.util.Event.purgeElement(this.select); | javascript | {
"resource": ""
} | |
q30701 | train | function(wiringConfig, frameLevel, parentFrame, parentIndex) {
// save the initial config
this.wiringConfig = wiringConfig;
// save the parent frame
this.frameLevel = frameLevel || 0;
this.parentFrame = parentFrame;
| javascript | {
"resource": ""
} | |
q30702 | train | function(url, callback) {
if (this.cache[url]) {
return callback && callback(null, this.cache[url]);
}
debug('GET ' + url);
var protocol = this._getProtocol(url);
protocol.get(url, function(res) {
if (res.statusCode !== 200) {
return callback && callback(
new Error('Ba... | javascript | {
"resource": ""
} | |
q30703 | train | function(url, dest, callback, count) {
if (isNaN(count)) {
count = 10;
}
if (this.cache[url]) {
return fs.writeFile(dest, this.cache[url], callback);
}
fs.exists(dest, function(exists) {
if (exists) {
// No need to download :).
return callback && callback();
... | javascript | {
"resource": ""
} | |
q30704 | train | function(url) {
var protocol;
if (url.indexOf('http://') !== -1) {
protocol = http;
} else if (url.indexOf('https://') !== -1) {
protocol = https;
| javascript | {
"resource": ""
} | |
q30705 | LogReader | train | function LogReader(elContainer, oConfigs) {
this._sName = LogReader._index;
LogReader._index++;
this._init.apply(this,arguments);
/**
* Render the LogReader immediately upon | javascript | {
"resource": ""
} |
q30706 | train | function() {
this._elConsole.style.display = "none";
if(this._elFt) {
this._elFt.style.display = "none";
| javascript | {
"resource": ""
} | |
q30707 | train | function() {
this._elConsole.style.display = "block";
if(this._elFt) {
this._elFt.style.display = "block";
} | javascript | {
"resource": ""
} | |
q30708 | train | function(sCategory) {
var filtersArray = this._categoryFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sCategory) > -1) {
return;
}
}
... | javascript | {
"resource": ""
} | |
q30709 | train | function(sCategory) {
var filtersArray = this._categoryFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sCategory == filtersArray[i]) {
filtersArray.splice(i, 1);
break;
}
}
this._filterLogs();
| javascript | {
"resource": ""
} | |
q30710 | train | function(sSource) {
var filtersArray = this._sourceFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sSource) > -1) {
return;
}
}
/... | javascript | {
"resource": ""
} | |
q30711 | train | function(sSource) {
var filtersArray = this._sourceFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sSource == filtersArray[i]) {
| javascript | {
"resource": ""
} | |
q30712 | train | function() {
// Default the container if unset or not a div
if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) {
this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild);
// Only position absolutely if an in-DOM element is not supplied
D... | javascript | {
"resource": ""
} | |
q30713 | train | function() {
// Destroy header if present
if(this._elHd) {
// Unhook DOM events
Event.purgeElement(this._elHd, true);
// Remove DOM elements
this._elHd.innerHTML = "";
}
// Create header
// TODO: refactor this into an inne... | javascript | {
"resource": ""
} | |
q30714 | train | function() {
// Destroy console
if(this._elConsole) {
// Unhook DOM events
Event.purgeElement(this._elConsole, true);
// Remove DOM elements
this._elConsole.innerHTML = "";
}
// Ceate console
this._elConsole = make("div", { classN... | javascript | {
"resource": ""
} | |
q30715 | train | function() {
// If Drag and Drop utility is available...
// ...and draggable is true...
// ...then make the header draggable
if(u.DD && this.draggable | javascript | {
"resource": ""
} | |
q30716 | train | function() {
// Initialize category filters
this._categoryFilters = [];
var aInitialCategories = Logger.categories;
for(var j=0; j < aInitialCategories.length; j++) {
var sCategory = aInitialCategories[j];
// Add category to the internal array of filters
... | javascript | {
"resource": ""
} | |
q30717 | train | function() {
// Initialize source filters
this._sourceFilters = [];
var aInitialSources = Logger.sources;
for(var j=0; j < aInitialSources.length; j++) {
var sSource = aInitialSources[j];
// Add source to the internal array of filters
| javascript | {
"resource": ""
} | |
q30718 | train | function(sCategory) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sCategory + this._sName,
className: "yui-log-filter-" + sCategory,
type: "... | javascript | {
"resource": ""
} | |
q30719 | train | function(sSource) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sSource + this._sName,
className: "yui-log-filter-" + sSource,
type: "checkb... | javascript | {
"resource": ""
} | |
q30720 | train | function() {
this._timeout = null;
if(this._elConsole !== null) {
var thresholdMax = this.thresholdMax;
thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
if(this._consoleMsgCount < thresholdMax) {
var entries = [];
... | javascript | {
"resource": ""
} | |
q30721 | train | function(aEntries) {
// Manage the number of messages displayed in the console
var entriesLen = aEntries.length,
df = d.createDocumentFragment(),
msgHTML = [],
thresholdMin = this.thresholdMin,
sourceFiltersLen = ... | javascript | {
"resource": ""
} | |
q30722 | train | function(sType, aArgs, oSelf) {
var source = aArgs[0];
// Add source to the internal array of filters
oSelf._sourceFilters.push(source);
| javascript | {
"resource": ""
} | |
q30723 | train | function(sType, aArgs, oSelf) {
var logEntry = aArgs[0];
oSelf._buffer.push(logEntry);
if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
| javascript | {
"resource": ""
} | |
q30724 | train | function() {
inputEx.KeyValueField.superclass.initEvents.call(this); | javascript | {
"resource": ""
} | |
q30725 | train | function(e, params) {
var value = params[0];
var f = this.nameIndex[value];
var lastInput = this.inputs[this.inputs.length-1];
var next = this.divEl.childNodes[inputEx.indexOf(lastInput.getEl(), this.divEl.childNodes)+1];
lastInput.destroy();
this.inputs.pop();
| javascript | {
"resource": ""
} | |
q30726 | maybeMkdir | train | function maybeMkdir(path, opts, callback) {
if (typeof opts === 'function') {
callback = opts;
opts = null;
}
fs.exists(path, function(exists) {
if (opts && opts.purge) {
rimraf.sync(path);
} else {
if (exists) {
| javascript | {
"resource": ""
} |
q30727 | train | function() {
if (this._shimActive) {
YAHOO.log('Sizing Shim', 'info', 'DragDropMgr');
var s = this._shim;
s.style.height = Dom.getDocumentHeight() + 'px';
| javascript | {
"resource": ""
} | |
q30728 | train | function() {
if (this.useShim) {
YAHOO.log('Activating Shim', 'info', 'DragDropMgr');
if (!this._shim) {
this._createShim();
}
this._shimActive = true;
var s = this._shim,
o = '0';
... | javascript | {
"resource": ""
} | |
q30729 | train | function(sMethod, args) {
for (var i in this.ids) {
for (var j in this.ids[i]) {
var oDD = this.ids[i][j];
if (! this.isTypeOfDD(oDD)) {
| javascript | {
"resource": ""
} | |
q30730 | train | function() {
this.init();
YAHOO.log("DragDropMgr onload", "info", "DragDropMgr");
Event.on(document, "mouseup", this.handleMouseUp, this, true);
| javascript | {
"resource": ""
} | |
q30731 | train | function(oDD, sGroup) {
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
}
var obj = this.ids[sGroup];
| javascript | {
"resource": ""
} | |
q30732 | train | function(oDD) {
for (var g in oDD.groups) {
if (g) {
var item = this.ids[g];
if (item && item[oDD.id]) {
| javascript | {
"resource": ""
} | |
q30733 | train | function(p_oDD, bTargetsOnly) {
var oDDs = [];
for (var i in p_oDD.groups) {
for (var j in this.ids[i]) {
var dd = this.ids[i][j];
if (! this.isTypeOfDD(dd)) {
continue;
}
| javascript | {
"resource": ""
} | |
q30734 | train | function (oDD, oTargetDD) {
var targets = this.getRelated(oDD, true);
for (var i=0, len=targets.length;i<len;++i) {
| javascript | {
"resource": ""
} | |
q30735 | train | function(id) {
for (var i in this.ids) {
if (this.ids[i][id]) {
| javascript | {
"resource": ""
} | |
q30736 | train | function(e, oDD) {
//this._activateShim();
this.currentTarget = YAHOO.util.Event.getTarget(e);
this.dragCurrent = oDD;
var el = oDD.getEl();
// track start position
this.startX = YAHOO.util.Event.getPageX(e);
this.startY = YAHOO.uti... | javascript | {
"resource": ""
} | |
q30737 | train | function(x, y) {
if (this.dragCurrent && this.dragCurrent.useShim) {
this._shimState = this.useShim;
this.useShim = true;
}
this._activateShim();
YAHOO.log("firing drag start events", "info", "DragDropMgr");
clearTimeout(this.cl... | javascript | {
"resource": ""
} | |
q30738 | train | function(e) {
if (this.dragCurrent) {
clearTimeout(this.clickTimeout);
if (this.dragThreshMet) {
YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
if (this.fromTimeout) {
YAHOO.log('fromTim... | javascript | {
"resource": ""
} | |
q30739 | train | function(e) {
if (this.stopPropagation) {
YAHOO.util.Event.stopPropagation(e);
| javascript | {
"resource": ""
} | |
q30740 | train | function(e) {
//YAHOO.log("handlemousemove");
var dc = this.dragCurrent;
if (dc) {
// YAHOO.log("no current drag obj");
// var button = e.which || e.button;
// YAHOO.log("which: " + e.which + ", button: "+ e.button);
... | javascript | {
"resource": ""
} | |
q30741 | train | function(el) {
try {
if (el) {
var parent = el.offsetParent;
if (parent) {
return true;
}
}
} catch(e) {
| javascript | {
"resource": ""
} | |
q30742 | train | function(oDD) {
if (! this.isTypeOfDD(oDD)) {
YAHOO.log(oDD + " is not a DD obj", "info", "DragDropMgr");
return null;
}
var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
try {
pos= YAHOO.util.Dom.getXY(el);
... | javascript | {
"resource": ""
} | |
q30743 | train | function(pt, oTarget, intersect, curRegion) {
// use cache if available
var loc = this.locationCache[oTarget.id];
if (!loc || !this.useCache) {
YAHOO.log("cache not populated", "info", "DragDropMgr");
loc = this.getLocation(oTarget);
th... | javascript | {
"resource": ""
} | |
q30744 | train | function(id) {
var oWrapper = this.elementCache[id];
if (!oWrapper || !oWrapper.el) {
oWrapper = this.elementCache[id] =
| javascript | {
"resource": ""
} | |
q30745 | train | function(n1, n2) {
if (n1.swapNode) {
n1.swapNode(n2);
} else {
var p = n2.parentNode;
var s = n2.nextSibling;
if (s == n1) {
p.insertBefore(n1, n2);
} else if (n2 == n1.nextSibling) {
... | javascript | {
"resource": ""
} | |
q30746 | train | function () {
var t, l, dde=document.documentElement, db=document.body;
if (dde && (dde.scrollTop || dde.scrollLeft)) {
t = dde.scrollTop;
l = dde.scrollLeft;
} else if (db) {
t = db.scrollTop;
l = db.scrollLeft;
... | javascript | {
"resource": ""
} | |
q30747 | train | function() {
var DDM = YAHOO.util.DDM;
if ( YAHOO.util.Event && document ) {
DDM._onLoad();
} else {
if (DDM._timeoutCount > 2000) {
YAHOO.log("DragDrop requires the Event Utility", "error", "DragDropMgr");
} else {
... | javascript | {
"resource": ""
} | |
q30748 | train | function(node, id) {
if (this.isHandle(id, node.id)) {
YAHOO.log("clicked node is a handle", "info", "DragDropMgr");
return true;
} else {
// check to see if this is a text node child of the one we want
var p = node.parentNode;
... | javascript | {
"resource": ""
} | |
q30749 | train | function(id, sGroup, config) {
this.initTarget(id, sGroup, config);
Event.on(this._domRef || this.id, "mousedown",
this.handleMouseDown, this, true);
| javascript | {
"resource": ""
} | |
q30750 | train | function(id, sGroup, config) {
// configuration attributes
this.config = config || {};
this.events = {};
// create a local reference to the drag and drop manager
this.DDM = YAHOO.util.DDM;
// initialize the groups object
this.groups = {};
// assume t... | javascript | {
"resource": ""
} | |
q30751 | train | function(diffX, diffY) {
var el = this.getEl();
if (!this.DDM.verifyEl(el)) {
if (el && el.style && (el.style.display == 'none')) {
this.logger.log(this.id + " can not get initial position, element style is display: none");
} else {
this.logger.lo... | javascript | {
"resource": ""
} | |
q30752 | train | function(pos) {
var p = pos || Dom.getXY(this.getEl());
this.deltaSetXY = null;
| javascript | {
"resource": ""
} | |
q30753 | train | function(sGroup) {
this.logger.log("Removing from group: " + sGroup);
if (this.groups[sGroup]) | javascript | {
"resource": ""
} | |
q30754 | train | function(id) {
if (typeof id !== "string") {
YAHOO.log("id is not a string, assuming it is an HTMLElement");
id = | javascript | {
"resource": ""
} | |
q30755 | train | function(id) {
if (typeof id !== "string") {
YAHOO.log("id is not a string, assuming it is an HTMLElement");
id = Dom.generateId(id);
}
this.logger.log("Adding outer handle event: " + id);
Event.on(id, "mousedown",
| javascript | {
"resource": ""
} | |
q30756 | train | function() {
this.logger.log("DragDrop obj cleanup " + this.id);
Event.removeListener(this.id, "mousedown",
| javascript | {
"resource": ""
} | |
q30757 | train | function(e, oDD) {
var button = e.which || e.button;
this.logger.log("button: " + button);
if (this.primaryButtonOnly && button > 1) {
this.logger.log("Mousedown was not produced by the primary button");
return;
}
if (this.isLocked()) {
this... | javascript | {
"resource": ""
} | |
q30758 | train | function(id) {
if (typeof id !== "string") {
YAHOO.log("id is not a string, assuming it is an HTMLElement");
id | javascript | {
"resource": ""
} | |
q30759 | train | function(cssClass) {
for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
if (this.invalidHandleClasses[i] == cssClass) {
| javascript | {
"resource": ""
} | |
q30760 | train | function(node) {
var valid = true;
// var n = (node.nodeName == "#text") ? node.parentNode : node;
var nodeName;
try {
nodeName = node.nodeName.toUpperCase();
} catch(e) {
nodeName = node.nodeName;
}
valid = valid && !this.invalidHandleTyp... | javascript | {
"resource": ""
} | |
q30761 | train | function(iLeft, iRight, iTickSize) {
this.leftConstraint = parseInt(iLeft, 10);
this.rightConstraint = parseInt(iRight, 10);
this.minX = this.initPageX - this.leftConstraint;
this.maxX = this.initPageX + this.rightConstraint;
if (iTickSize) { this.setXTicks(this.initPageX, iTick... | javascript | {
"resource": ""
} | |
q30762 | train | function(iUp, iDown, iTickSize) {
this.logger.log("setYConstraint: " + iUp + "," + iDown + "," + iTickSize);
this.topConstraint = parseInt(iUp, 10);
this.bottomConstraint = parseInt(iDown, 10);
this.minY = this.initPageY - this.topConstraint;
this.maxY = this.initPageY + this.bo... | javascript | {
"resource": ""
} | |
q30763 | train | function(el, iPageX, iPageY) {
var oCoord = this.getTargetCoord(iPageX, iPageY);
// this.logger.log("****alignElWithMouse : " + el.id + ", " + aCoord + ", " + el.style.display);
if (!this.deltaSetXY) {
var aCoord = [oCoord.x, oCoord.y];
YAHOO.util.Dom.setXY(el, aCoord);
... | javascript | {
"resource": ""
} | |
q30764 | train | function(iPageX, iPageY) {
if (iPageX) {
this.lastPageX = iPageX;
this.lastPageY = iPageY;
| javascript | {
"resource": ""
} | |
q30765 | train | function(x, y, h, w) {
if (this.scroll) {
// The client height
var clientH = this.DDM.getClientHeight();
// The client width
var clientW = this.DDM.getClientWidth();
// The amt scrolled down
var st = this.DDM.getScrollTop();
... | javascript | {
"resource": ""
} | |
q30766 | train | function(iPageX, iPageY) {
var el = this.getEl();
var dragEl = this.getDragEl();
var s = dragEl.style;
this._resizeProxy();
if (this.centerFrame) {
this.setDelta( Math.round(parseInt(s.width, 10)/2),
| javascript | {
"resource": ""
} | |
q30767 | train | function() {
if (this.resizeFrame) {
var DOM = YAHOO.util.Dom;
var el = this.getEl();
var dragEl = this.getDragEl();
var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth" ), 10);
var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth" ... | javascript | {
"resource": ""
} | |
q30768 | train | function(e) {
this.setStartPosition();
var x = YAHOO.util.Event.getPageX(e);
var y = YAHOO.util.Event.getPageY(e);
this.autoOffset(x, y);
// This causes | javascript | {
"resource": ""
} | |
q30769 | train | function(e) {
var DOM = YAHOO.util.Dom;
this.logger.log(this.id + " endDrag");
var lel = this.getEl();
var del = this.getDragEl();
// Show the drag frame briefly so we can get its position
// del.style.visibility = "";
DOM.setStyle(del, "visibility", "");
| javascript | {
"resource": ""
} | |
q30770 | train | function(options) {
inputEx.Lens.superclass.setOptions.call(this, options);
var lens = "";
if( !lang.isString(options.lens) ) {
for(var i = 0 ; i < this.options.fields.length ; i++) {
lens += "<div class='field-"+this.options.fields[i].name+"'></div>";
}
| javascript | {
"resource": ""
} | |
q30771 | train | function(parentEl) {
parentEl.innerHTML = this.options.lens;
for(var i = 0 ; i < this.options.fields.length ; i++) {
var els = YAHOO.util.Dom.getElementsByClassName( "field-"+this.options.fields[i].name, "div", parentEl);
var el = els[0];
var params = { parentEl: el, editorField: this.optio... | javascript | {
"resource": ""
} | |
q30772 | train | function (func, args)
{
if (this._swf[func]) {
return(this._swf[func].apply(this._swf, | javascript | {
"resource": ""
} | |
q30773 | train | function(options) {
inputEx.MapField.superclass.setOptions.call(this, options);
this.options.className = options.className || 'inputEx-Field inputEx-MapField';
this.options.width = options.width || '400px';
this.options.height = options.height || '400px';
this.options.loading = options.loading || 'loading... | javascript | {
"resource": ""
} | |
q30774 | train | function() {
if(inputEx.MapFieldsNumber == undefined) { inputEx.MapFieldsNumber = -1; }
inputEx.MapFieldsNumber += 1;
this.apid = this.virtualearth;
if (this.options.api == "virtualearth") {
this.apid = this.virtualearth;
} else if (this.options.api == "google") {
this.apid = this.google;
} else if (... | javascript | {
"resource": ""
} | |
q30775 | train | function() {
if (!this.elLat) return {};
return {
lat : parseFloat(this.elLat.value),
lon : parseFloat(this.elLon.value),
| javascript | {
"resource": ""
} | |
q30776 | train | function(_this) {
if (this == window) {
_this.wait_create(_this);
return;
}
if (document.getElementById(this.el.id)) {
| javascript | {
"resource": ""
} | |
q30777 | train | function(superwrapper) {
if (window.VEMap) {
return;
}
var preloader = 'MapVEPreloader_' + inputEx.MapFieldsNumber;
inputEx[preloader] = function() {
superwrapper.wait_create();
};
/*
* Fixes the 'p_elSource.attachEvent is not a function' error
* http://www.google.ca/search?hl=en&q=... | javascript | {
"resource": ""
} | |
q30778 | train | function(options) {
inputEx.FileField.superclass.setOptions.call(this, options);
this.options.size | javascript | {
"resource": ""
} | |
q30779 | train | function() {
var columndefs = inputEx.widget.dtInPlaceEdit.superclass.setColumnDefs.call(this);
// index fields declaration by keys
var fieldsByKey = {};
for(var k = 0 ; k < this.options.fields.length ; k++) {
// Retro-compatibility with inputParms
if (lang.isObject(this.options.fields[k]... | javascript | {
"resource": ""
} | |
q30780 | train | function(ev, rowIndex) {
// Get a particular CellEditor
var elCell = ev.target, oColumn;
elCell = this.datatable.getTdEl(elCell);
if(elCell) {
oColumn = this.datatable.getColumn(elCell);
if(oColumn && oColumn.editor) {
var oCellEditor = this.datatable._oCellEditor;
// Clean up active CellEditor... | javascript | {
"resource": ""
} | |
q30781 | train | function(record,target){
var targetNode = target.childNodes[0];
// Only if the row has an id && isn't already being removed
if( !lang.isUndefined(record.getData('id')) && this.deleteLinkNode != targetNode ){
if (confirm(inputEx.messages.confirmDeletion)) {
| javascript | {
"resource": ""
} | |
q30782 | train | function(){
this.deleteLinkNode.innerHTML = inputEx.messages.deleteText;
| javascript | {
"resource": ""
} | |
q30783 | train | function(e) {
// If insertWithDialog
if(this.options.insertWithDialog) {
inputEx.widget.dtInPlaceEdit.superclass.onInsertButton.call(this, e);
return;
}
var tbl = this.datatable;
// Insert a new row
tbl.addRow({});
// Select the new row
var lastRow = tbl.getLastTrEl();
tbl.sele... | javascript | {
"resource": ""
} | |
q30784 | train | function(e) {
Event.stopEvent(e);
var target = Event.getTarget(e),
record = this.datatable.getRecord(target),
field, requiredFields = [];
for(var i=0, fieldsLength = this.options.fields.length; i<fieldsLength; i++){
field = this.options.fields[i];
// Retro-compatibility with inputParms
... | javascript | {
"resource": ""
} | |
q30785 | train | function(e) {
Event.stopEvent(e);
var target = Event.getTarget(e); | javascript | {
"resource": ""
} | |
q30786 | train | function(){
if(this.options.insertWithDialog) {
this.datatable.deleteRow(this.selectedRecord);
return;
}
| javascript | {
"resource": ""
} | |
q30787 | train | function(record, oArgs){
var itemContainer = oArgs.editor.getTdEl().childNodes[0]; | javascript | {
"resource": ""
} | |
q30788 | train | function(record, oData) {
var nodes = this.datatable.getElementsByClassName("inputEx-dtInPlaceEdit-onModifyItem");
// Remove CSS
for(i=0,nodesLength = nodes.length; i<nodesLength; i++){
Dom.removeClass(nodes[i], "inputEx-dtInPlaceEdit-onModifyItem");
}
// If we want | javascript | {
"resource": ""
} | |
q30789 | train | function() {
// Build the inputEx field
this._inputExField = inputEx(this._inputExFieldDef);
this.getContainerEl().appendChild(this._inputExField.getEl());
// Locals for Save/Cancel | javascript | {
"resource": ""
} | |
q30790 | train | function(selector) {
var token = {}, // one token per simple selector (left selector holds combinator)
tokens = [], // array of tokens
id, // unique id for the simple selector (if found)
found = false, // whether or not any matches were found this pass
... | javascript | {
"resource": ""
} | |
q30791 | train | function() {
WireIt.CanvasContainer.superclass.render.call(this);
this.canvasEl = new WireIt.CanvasElement(this.bodyEl); | javascript | {
"resource": ""
} | |
q30792 | train | function(event, args) {
WireIt.CanvasContainer.superclass.onResize.call(this, event, args);
var size = args[0];
// resize the canvas
// TODO: do | javascript | {
"resource": ""
} | |
q30793 | train | function() {
var ctx = this.canvasEl.getContext('2d');
ctx.strokeStyle = "#5B81AD";
ctx.lineWidth= 2;
ctx.save();
ctx.translate( this.canvasWidth/2, this.canvasHeight/2);
ctx.scale(this.canvasWidth/2-5, this.canvasHeight/2-5);
ctx.arc(0, 0, | javascript | {
"resource": ""
} | |
q30794 | get_wiring_collection | train | function get_wiring_collection(req, res, next) {
app.db.collection('wirings', function(error, wiring_collection) {
if(error) { throw error; }
else {
| javascript | {
"resource": ""
} |
q30795 | get_wiring | train | function get_wiring( req, res, next) {
req.wiring_collection.findOne({
user_id: req.current_user._id,
_id: ObjectID.createFromHexString(req.param('id'))
| javascript | {
"resource": ""
} |
q30796 | run_wiring | train | function run_wiring(wiring, req, res, format) {
var filteredParams = req.query;
// TODO
/*filteredParams = params.dup
filteredParams.delete("id")
filteredParams.delete("action")
filteredParams.delete("controller")
filteredParams.delete("callback")
filteredParams.delete("format")*/
mySi... | javascript | {
"resource": ""
} |
q30797 | 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": ""
} |
q30798 | licenses | train | function licenses(data) {
if ('string' === typeof data && data) return data;
if ('type' in data && data.type) return data.type;
//
// Common typo's
| javascript | {
"resource": ""
} |
q30799 | get | train | function get(data) {
var parser = this
, matches = [];
//
// Another npm oddity, it allows licenses to be specified in to different
// properties. Because why the fuck not?
//
['license', 'licenses'].forEach(function each(key) {
if ('string' === typeof data[key]) {
return ma... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.