Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Given a hash of CSS properties, returns a string of CSS. Uses property names asis (no camelcase conversion). Will not make statements for null/undefined values.
function cssToStr(cssProps) { var statements = []; for (var name_1 in cssProps) { var val = cssProps[name_1]; if (val != null && val !== '') { statements.push(name_1 + ':' + val); } } return statements.join(';'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssToStr(cssProps) {\n var statements = [];\n\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n\n return statements.join(';');\n } // Given an object hash...
[ "0.73140204", "0.7179752", "0.7159448", "0.7159448", "0.7159448", "0.7159448", "0.708191", "0.70214397", "0.69848025", "0.69848025", "0.69848025", "0.69848025", "0.69848025", "0.69848025", "0.69848025", "0.69848025", "0.6977314", "0.6977314", "0.6975481", "0.6921566", "0.6891...
0.69908786
10
Given an object hash of HTML attribute names to values, generates a string that can be injected between in HTML
function attrsToStr(attrs) { var parts = []; for (var name_2 in attrs) { var val = attrs[name_2]; if (val != null) { parts.push(name_2 + '="' + htmlEscape(val) + '"'); } } return parts.join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_hashTag(tag, attrs, isVoid) {\n const start = `<${tag}`;\n const strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join('');\n const end = isVoid ? '/>' : `></${tag}>`;\n return start + strAttrs + end;\n }", "_hashTag(tag, attrs, isVoid) {\n cons...
[ "0.6485755", "0.6485755", "0.6485755", "0.6485755", "0.6485111", "0.6445947", "0.6396426", "0.6333782", "0.6333782", "0.61989754", "0.6172342", "0.6092175", "0.6072262", "0.60631484", "0.60631484", "0.6054279", "0.6043974", "0.6042282", "0.5949147", "0.59302217", "0.5894648",...
0.55336237
44
prevent against problems with <2 args!
function combineEventUis(uis) { return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (args.length % 2 !== 0) {\n throw new Error('layout must have even number of arguments.');\n }", "function get_arg_2() { return arguments[2]; }", "function isTwoPassed(){\n var args = Array.prototype.slice.call(arguments);\n return args.indexOf(2) != -1;\n}", "function args2(...args) {...
[ "0.66999125", "0.66169", "0.66078186", "0.62619156", "0.6085757", "0.6078876", "0.60607874", "0.6044875", "0.6013319", "0.6013319", "0.6001775", "0.5957773", "0.59493506", "0.59154224", "0.58943975", "0.5889102", "0.58630645", "0.58504117", "0.5838746", "0.5819491", "0.576943...
0.0
-1
Will NOT populate extendedProps with the leftover properties. Will NOT populate daterelated props. The EventNonDateInput has been normalized (id => publicId, etc).
function parseEventDef(raw, sourceId, allDay, hasEnd, calendar) { var leftovers = {}; var def = pluckNonDateProps(raw, calendar, leftovers); def.defId = String(uid++); def.sourceId = sourceId; def.allDay = allDay; def.hasEnd = hasEnd; for (var _i = 0, _a = calendar.pluginSystem.hooks.eventDefParsers; _i < _a.length; _i++) { var eventDefParser = _a[_i]; var newLeftovers = {}; eventDefParser(def, leftovers, newLeftovers); leftovers = newLeftovers; } def.extendedProps = __assign(leftovers, def.extendedProps || {}); // help out EventApi from having user modify props Object.freeze(def.ui.classNames); Object.freeze(def.extendedProps); return def; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeEventDates(eventProps) {\n\n\t\t\tnormalizeEventTimes(eventProps);\n\n\t\t\tif (eventProps.end && !eventProps.end.isAfter(eventProps.start)) {\n\t\t\t\teventProps.end = null;\n\t\t\t}\n\n\t\t\tif (!eventProps.end) {\n\t\t\t\tif (t.options.forceEventDuration) {\n\t\t\t\t\teventProps.end = t.getDef...
[ "0.59947246", "0.59789807", "0.59692705", "0.59692705", "0.5950584", "0.5950584", "0.57311106", "0.57311106", "0.57311106", "0.57311106", "0.57311106", "0.5709819", "0.56334805", "0.5550468", "0.5527125", "0.55047715", "0.5489118", "0.5481354", "0.5481354", "0.5481024", "0.54...
0.55435896
16
TODO: pass around as EventDefHash!!!
function parseBusinessHours(input, calendar) { return parseEvents(refineInputs(input), '', calendar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventDict() {}", "function EventInfo() { }", "function EventInfo() { }", "function InternalEvent() {}", "function EventHelper (possibleEvents) {\n }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "fun...
[ "0.7220342", "0.6360154", "0.6360154", "0.6247587", "0.61533606", "0.61468875", "0.61468875", "0.61468875", "0.61468875", "0.61468875", "0.6139239", "0.6128923", "0.6122797", "0.6094675", "0.6094675", "0.6094675", "0.6079078", "0.60606396", "0.6058764", "0.60245997", "0.60245...
0.0
-1
Computes HTML classNames for a singleday element
function getDayClasses(date, dateProfile, context, noThemeHighlight) { var calendar = context.calendar, options = context.options, theme = context.theme, dateEnv = context.dateEnv; var classes = []; var todayStart; var todayEnd; if (!rangeContainsMarker(dateProfile.activeRange, date)) { classes.push('fc-disabled-day'); } else { classes.push('fc-' + DAY_IDS[date.getUTCDay()]); if (options.monthMode && dateEnv.getMonth(date) !== dateEnv.getMonth(dateProfile.currentRange.start)) { classes.push('fc-other-month'); } todayStart = startOfDay(calendar.getNow()); todayEnd = addDays(todayStart, 1); if (date < todayStart) { classes.push('fc-past'); } else if (date >= todayEnd) { classes.push('fc-future'); } else { classes.push('fc-today'); if (noThemeHighlight !== true) { classes.push(theme.getClass('today')); } } } return classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCSSClassesNames() {\n var classNames = 'article__textarea article__textarea--style';\n switch (this.state.cssCheck) {\n case 'OK':\n classNames += ' article__textarea--correct';\n break;\n case 'KO':\n classNames += ' article__textarea--wrong';\n break;\n default...
[ "0.6859277", "0.6847218", "0.6847218", "0.6847218", "0.6847218", "0.6847218", "0.67655474", "0.6733248", "0.6733248", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", "0.6713478", ...
0.0
-1
given a function that resolves a result asynchronously. the function can either call passedin success and failure callbacks, or it can return a promise. if you need to pass additional params to func, bind them first.
function unpromisify(func, success, failure) { // guard against success/failure callbacks being called more than once // and guard against a promise AND callback being used together. var isResolved = false; var wrappedSuccess = function () { if (!isResolved) { isResolved = true; success.apply(this, arguments); } }; var wrappedFailure = function () { if (!isResolved) { isResolved = true; if (failure) { failure.apply(this, arguments); } } }; var res = func(wrappedSuccess, wrappedFailure); if (res && typeof res.then === 'function') { res.then(wrappedSuccess, wrappedFailure); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapFunction(func, args) {\n return new Promise((resolve, reject) => {\n func(args, (success) => resolve(success), (error) => reject(error))\n })\n}", "function wrapInPromise(func){\r\n var promise = new Promise((resolve, reject) => {\r\n resolve(func);\r\n });\r\n return pr...
[ "0.68739843", "0.66578454", "0.6600192", "0.6565478", "0.64963", "0.64120704", "0.6393519", "0.63857806", "0.62969637", "0.6258028", "0.6121857", "0.60591346", "0.6023949", "0.6022415", "0.60093975", "0.59958893", "0.59958893", "0.59743434", "0.5956957", "0.5956957", "0.59193...
0.0
-1
Reuses old values when equal. If anything is unequal, returns newProps asis. Great for PureComponent, but won't be feasible with React, so just eliminate and use React's DOM diffing.
function recycleProps(oldProps, newProps, equalityFuncs) { var comboProps = {}; // some old, some new var anyChanges = false; for (var key in newProps) { if (key in oldProps && (oldProps[key] === newProps[key] || (equalityFuncs[key] && equalityFuncs[key](oldProps[key], newProps[key])))) { // equal to old? use old prop comboProps[key] = oldProps[key]; } else { comboProps[key] = newProps[key]; anyChanges = true; } } for (var key in oldProps) { if (!(key in newProps)) { anyChanges = true; break; } } return { anyChanges: anyChanges, comboProps: comboProps }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recycleProps(oldProps, newProps, equalityFuncs) {\n var comboProps = {}; // some old, some new\n\n var anyChanges = false;\n\n for (var key in newProps) {\n if (key in oldProps && (oldProps[key] === newProps[key] || equalityFuncs[key] && equalityFuncs[key](oldProps[key], newProps[key...
[ "0.7148955", "0.71309936", "0.71008986", "0.7022676", "0.64896524", "0.62703806", "0.6210929", "0.61837065", "0.6136289", "0.6065854", "0.6040945", "0.6032967", "0.5946066", "0.5941736", "0.5941736", "0.5883722", "0.5865939", "0.5819483", "0.5808472", "0.58005476", "0.5792497...
0.7121926
4
shortcoming: won't remove plugins
function handlePlugins(inputs, calendar) { calendar.addPluginInputs(inputs); // will gracefully handle duplicates }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deletePlugin() {}", "initPlugins() {}", "initPlugins() {}", "function clearPluginList() {\n $(\"#plugin-list #plugin-list-item\").remove();\n}", "function removePlugins() {\n\tconsole.log(\"list existing plugins:\");\n\texec(\"cordova plugin list\", function (error, stdout, stderr){\n\t\tconsole.log(std...
[ "0.76378304", "0.6961709", "0.6961709", "0.6931631", "0.68965787", "0.6792424", "0.67370474", "0.6627023", "0.6521384", "0.6490166", "0.648618", "0.6441604", "0.6341382", "0.62808794", "0.6222282", "0.6209466", "0.6172541", "0.6159131", "0.6159131", "0.6159131", "0.6159131", ...
0.5735734
56
Merges an array of option objects into a single object
function mergeOptions(optionObjs) { return mergeProps(optionObjs, complexOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeOptions(optionObjs){return util_1.mergeProps(optionObjs,complexOptions);}", "function combineOpts() {\n var opts = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n opts[_i] = arguments[_i];\n }\n var validOpts = [];\n for (var i = 0, size = opts....
[ "0.74278957", "0.73415136", "0.7241968", "0.723458", "0.72201705", "0.72201705", "0.72201705", "0.72201705", "0.72200483", "0.71633273", "0.71632963", "0.71536505", "0.71536505", "0.71536505", "0.71536505", "0.71536505", "0.71536505", "0.71536505", "0.71536505", "0.71286154", ...
0.7006645
24
TODO: find a way to avoid comparing DateProfiles. it's tedious
function isDateProfilesEqual(p0, p1) { return rangesEqual(p0.validRange, p1.validRange) && rangesEqual(p0.activeRange, p1.activeRange) && rangesEqual(p0.renderRange, p1.renderRange) && durationsEqual(p0.minTime, p1.minTime) && durationsEqual(p0.maxTime, p1.maxTime); /* TODO: compare more? currentRange: DateRange currentRangeUnit: string isRangeAllDay: boolean isValid: boolean dateIncrement: Duration */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDateProfilesEqual(p0, p1) {\n return rangesEqual(p0.activeRange, p1.activeRange) &&\n rangesEqual(p0.validRange, p1.validRange) &&\n durationsEqual(p0.minTime, p1.minTime) &&\n durationsEqual(p0.maxTime, p1.maxTime);\n }", "function isDateProfilesEqual(p0, p1...
[ "0.70069826", "0.69912595", "0.68671584", "0.65773696", "0.57456386", "0.5635219", "0.5573025", "0.55383563", "0.55383563", "0.55370533", "0.550376", "0.54983395", "0.5423133", "0.5423133", "0.5367248", "0.5354451", "0.5335503", "0.5323803", "0.5323346", "0.5313888", "0.52937...
0.6989276
3
TODO: somehow combine with parseRange? Will return null if the start/end props were present but parsed invalidly.
function parseOpenDateSpan(raw, dateEnv) { var leftovers = {}; var standardProps = refineProps(raw, STANDARD_PROPS, {}, leftovers); var startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null; var endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null; var allDay = standardProps.allDay; if (allDay == null) { allDay = (startMeta && startMeta.isTimeUnspecified) && (!endMeta || endMeta.isTimeUnspecified); } // use this leftover object as the selection object leftovers.range = { start: startMeta ? startMeta.marker : null, end: endMeta ? endMeta.marker : null }; leftovers.allDay = allDay; return leftovers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseRange(text) {\n\t\t\tvar dateFormat = options.altFormat,\n\t\t\t range = null;\n\t\t\tif (text) {\n\t\t\t\ttry {\n\t\t\t\t\trange = JSON.parse(text, function (key, value) {\n\t\t\t\t\t\treturn key ? $.datepicker.parseDate(dateFormat, value) : value;\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {}\n\t\t\t}\...
[ "0.6514588", "0.64976966", "0.62338793", "0.6220001", "0.6104322", "0.6081215", "0.6059758", "0.6041337", "0.5999766", "0.58622545", "0.5855005", "0.5855005", "0.5839032", "0.5823618", "0.5784511", "0.5784511", "0.5771456", "0.5771456", "0.5771456", "0.5771456", "0.577073", ...
0.0
-1
Title and Date Formatting Computes what the title at the top of the calendar should be for this view
function computeTitle(dateProfile, viewOptions) { var range; // for views that span a large unit of time, show the proper interval, ignoring stray days before and after if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) { range = dateProfile.currentRange; } else { // for day units or smaller, use the actual day range range = dateProfile.activeRange; } return this.context.dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || computeTitleFormat(dateProfile), viewOptions.titleRangeSeparator), { isEndExclusive: dateProfile.isRangeAllDay }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTitle2(date) {\n let currentDate = new Date();\n currentDate.setHours(0, 0, 0, 0);\n let cpd = new Date(date);\n cpd.setHours(0, 0, 0, 0);\n let diff = (currentDate.getTime() - cpd.getTime()) / (1000 * 3600 * 24);\n let t = '';\n if (diff == 0) t = \"Today\";else...
[ "0.7253568", "0.71165115", "0.7083522", "0.69508946", "0.68761724", "0.68477166", "0.6827454", "0.6805223", "0.67304003", "0.6695786", "0.6685525", "0.66567934", "0.66482526", "0.6564499", "0.6530174", "0.64815193", "0.64802957", "0.64749545", "0.6450433", "0.64376086", "0.64...
0.6548306
15
Generates the format string that should be used to generate the title for the current date range. Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.
function computeTitleFormat(dateProfile) { var currentRangeUnit = dateProfile.currentRangeUnit; if (currentRangeUnit === 'year') { return { year: 'numeric' }; } else if (currentRangeUnit === 'month') { return { year: 'numeric', month: 'long' }; // like "September 2014" } else { var days = diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end); if (days !== null && days > 1) { // multi-day range. shorter, like "Sep 9 - 10 2014" return { year: 'numeric', month: 'short', day: 'numeric' }; } else { // one day. longer, like "September 9 2014" return { year: 'numeric', month: 'long', day: 'numeric' }; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeTitle(dateProfile, viewOptions) {\n var range; // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\n\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\n range = dateProfile.currentRange;\n } else {\n // ...
[ "0.6709017", "0.6700918", "0.66948307", "0.6687392", "0.6499849", "0.6409251", "0.6343078", "0.61702216", "0.61702216", "0.6164502", "0.61305416", "0.60829943", "0.59611887", "0.59603775", "0.58671", "0.58123463", "0.5805132", "0.5787246", "0.5778863", "0.5706741", "0.5704804...
0.63512546
8
build a context scoped to the view
function buildComponentContext(context, viewSpec, view) { return context.extend(viewSpec.options, view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Context(view, parentContext) {\n this.view = view;\n this.cache = {\n '.': this.view,\n '@each': function each() {\n var returns = [];\n for (var k in this) {\n returns.push({ '@key': k, '@value': this[k] });\n ...
[ "0.67516714", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66615003", "0.66227895", "0.66227895"...
0.64101183
31
returns a object with all primitive props that can be compared
function buildSegCompareObj(seg) { var eventDef = seg.eventRange.def; var range = seg.eventRange.instance.range; var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events var end = range.end ? range.end.valueOf() : 0; // " return __assign({}, eventDef.extendedProps, eventDef, { id: eventDef.publicId, start: start, end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg // for later retrieval }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_computeProps() {\n\t for (let i=0; i<this.attributes.length; i++) {\n\t\t const attr = this.attributes[i];\n\t\t if ( ! attr.value) {\n\t\t\t // the attribute has no value but it is present\n\t\t\t // so we assume the prop value is true\n\t\t\t this.props[__camelize(attr.name)] = true\n\t\t\t continue;\n\t...
[ "0.59689367", "0.58157927", "0.5705963", "0.56940496", "0.56593007", "0.56593007", "0.5583846", "0.55661565", "0.55661565", "0.55661565", "0.55661565", "0.55446625", "0.54885584", "0.54885584", "0.54128736", "0.54128736", "0.54128736", "0.54128736", "0.54128736", "0.5386847", ...
0.0
-1
TODO: more DRY and optimized
function buildDateEnv$1(settings) { var locale = buildLocale(settings.locale || 'en', parseRawLocales([]).map); // TODO: don't hardcode 'en' everywhere // ensure required settings settings = __assign({ timeZone: globalDefaults.timeZone, calendarSystem: 'gregory' }, settings, { locale: locale }); return new DateEnv(settings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "obtain(){}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient fina...
[ "0.6013705", "0.5974352", "0.58496135", "0.5534971", "0.54541767", "0.54532677", "0.5404893", "0.5324127", "0.53050864", "0.5216274", "0.5194364", "0.5120933", "0.50673854", "0.5006476", "0.49746144", "0.4956971", "0.49246246", "0.49142396", "0.4887098", "0.48696885", "0.4855...
0.0
-1
Computes a default column header formatting string if `colFormat` is not explicitly defined
function computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt) { // if more than one week row, or if there are a lot of columns with not much space, // put just the day numbers will be in each cell if (!datesRepDistinctDays || dayCnt > 10) { return { weekday: 'short' }; // "Sat" } else if (dayCnt > 1) { return { weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }; // "Sat 11/12" } else { return { weekday: 'long' }; // "Saturday" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createDefaultHeaderText() {\n const name = this.name;\n if (!name && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getTableTextColumnMissingNameError();\n }\n if (this._options && this._options.defaultHeaderTextTransform) {\n return this._options.defa...
[ "0.6629276", "0.63437927", "0.59950995", "0.5975986", "0.59356874", "0.57671523", "0.56975234", "0.5680987", "0.5678322", "0.5566068", "0.55608535", "0.5555714", "0.5520117", "0.54572755", "0.5372534", "0.5315968", "0.52629995", "0.52458084", "0.52457035", "0.5220479", "0.521...
0.5468727
15
for incorporating minTime/maxTime if appropriate TODO: should be part of DateProfile! TimelineDateProfile already does this btw
function computeActiveRange(dateProfile, isComponentAllDay) { var range = dateProfile.activeRange; if (isComponentAllDay) { return range; } return { start: addMs(range.start, dateProfile.minTime.milliseconds), end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_homogonizeMinMaxTimestamps () {\n const minTimes = this.tierNameList.map(tierName => this.tierDict[tierName].minTimestamp);\n const maxTimes = this.tierNameList.map(tierName => this.tierDict[tierName].maxTimestamp);\n\n const minTimestamp = Math.min(...minTimes);\n const maxTimestamp = Math.max(...max...
[ "0.69175416", "0.63997513", "0.63008296", "0.6137315", "0.6129289", "0.6018443", "0.601448", "0.60069543", "0.59492534", "0.5930201", "0.5925246", "0.5924318", "0.5895317", "0.5850802", "0.5850802", "0.5850802", "0.5850802", "0.5850802", "0.58504224", "0.5841004", "0.5827201"...
0.0
-1
populates empty cells from the current column (`col`) to `endCol`
function emptyCellsUntil(endCol) { while (col < endCol) { // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell td = (loneCellMatrix[i - 1] || [])[col]; if (td) { td.rowSpan = (td.rowSpan || 1) + 1; } else { td = document.createElement('td'); tr.appendChild(td); } cellMatrix[i][col] = td; loneCellMatrix[i][col] = td; col++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpa...
[ "0.7578882", "0.75454706", "0.75454706", "0.75454706", "0.75454706", "0.7543037", "0.75387543", "0.7455521", "0.7455521", "0.7455521", "0.7455521", "0.7455521", "0.7455521", "0.7455521", "0.7455521", "0.74241924", "0.70568347", "0.70191866", "0.6973319", "0.6926354", "0.69263...
0.7590672
2
Computes whether two segments' columns collide. They are assumed to be in the same row.
function isDaySegCollision(seg, otherSegs) { var i; var otherSeg; for (i = 0; i < otherSegs.length; i++) { otherSeg = otherSegs[i]; if (otherSeg.firstCol <= seg.lastCol && otherSeg.lastCol >= seg.firstCol) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function haveCollided(r1, r2) {\r\n\t\treturn !(r2.left > r1.right || r2.right < r1.left || r2.top > r1.bottom || r2.bottom < r1.top)\r\n\t}", "function collides(l1\n/*: LayoutItem*/\n, l2\n/*: LayoutItem*/\n)\n/*: boolean*/\n{\n if (l1.i === l2.i) return false; // same element\n\n if (l1.x + l1.w <= l2.x) ret...
[ "0.7159878", "0.6964363", "0.6820563", "0.6793647", "0.67334104", "0.67165005", "0.66782117", "0.6668968", "0.6668968", "0.6668968", "0.6637565", "0.6637565", "0.6623807", "0.6621723", "0.6621723", "0.6621723", "0.6621723", "0.6621723", "0.659456", "0.6586153", "0.6578231", ...
0.6327876
64
A cmp function for determining the leftmost event
function compareDaySegCols(a, b) { return a.leftCol - b.leftCol; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ya(a,b){// put wider events first\n// if tie, put all-day events first (booleans cast to 0/1)\n// if a tie, sort by event start date\nreturn b.rightCol-b.leftCol-(a.rightCol-a.leftCol)||b.event.allDay-a.event.allDay||a.event.start-b.event.start||(a.event.title||\"\").localeCompare(b.event.title)}", "fun...
[ "0.70130354", "0.6486962", "0.64742804", "0.6474233", "0.6474233", "0.6424697", "0.6407531", "0.6407531", "0.6407531", "0.6340511", "0.6306749", "0.61612266", "0.6138099", "0.6133441", "0.6055893", "0.6034904", "0.6024256", "0.60227823", "0.60227823", "0.6013692", "0.59532785...
0.0
-1
Injects a string like "arg=value" into the querystring of a URL TODO: move to a general util file?
function injectQsComponent(url, component) { // inject it after the querystring but before the fragment return url.replace(/(\?.*?)?(#|$)/, function (whole, qs, hash) { return (qs ? qs + '&' : '?') + component + hash; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addURLQueryString(key, value) {\n const searchParams = new URL.URLSearchParams(this.urlObj.search);\n searchParams.append(key, value);\n this.urlObj.search = searchParams.toString();\n }", "function add_query_arg(key, value, sourceURL) {\r\n\r\n return sourceURL + '&' + key + '=' + value;\r\n\r\...
[ "0.71564186", "0.7144755", "0.70305985", "0.7028031", "0.6966995", "0.6966995", "0.6752298", "0.673164", "0.66991687", "0.6690159", "0.6687221", "0.668199", "0.6677056", "0.6666224", "0.6658319", "0.66147095", "0.65504956", "0.65395045", "0.65088856", "0.6503151", "0.65009284...
0.64495176
29
which elements accept event actions
function computeDateVars(dateProfile) { var dayStart = core.startOfDay(dateProfile.renderRange.start); var viewEnd = dateProfile.renderRange.end; var dayDates = []; var dayRanges = []; while (dayStart < viewEnd) { dayDates.push(dayStart); dayRanges.push({ start: dayStart, end: core.addDays(dayStart, 1) }); dayStart = core.addDays(dayStart, 1); } return { dayDates: dayDates, dayRanges: dayRanges }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "$attachEventListeners() {\n\t\tlet action = (event, key) => {\n\t\t\ttry {\n\t\t\t\tlet target = event.composedPath()[0];\n\t\t\t\t// let target = event.target;\n\t\t\t\tlet action = target.closest(`[${key}]`);\n\t\t\t\t// console.log('EEE', key, event.composedPath(), target, action, 'called by', this, event)\n\t\...
[ "0.62784487", "0.6259815", "0.6204584", "0.60370433", "0.5960339", "0.5942536", "0.5870385", "0.5858289", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", "0.5806052", ...
0.0
-1
Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is lefttoright, or the rightmost if the calendar is righttoleft. Assumes the segments are already ordered by date.
function buildSlotSegLevels(segs) { var levels = []; var i; var seg; var j; for (i = 0; i < segs.length; i++) { seg = segs[i]; // go through all the levels and stop on the first level where there are no collisions for (j = 0; j < levels.length; j++) { if (!computeSlotSegCollisions(seg, levels[j]).length) { break; } } seg.level = j; (levels[j] || (levels[j] = [])).push(seg); } return levels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSlotSegLevels(segs) {\n var levels = [];\n var i;\n var seg;\n var j;\n\n for (i = 0; i < segs.length; i++) {\n seg = segs[i]; // go through all the levels and stop on the first level where there are no collisions\n\n for (j = 0; j < levels.length;...
[ "0.6706573", "0.65856165", "0.6553435", "0.6537174", "0.6524828", "0.6496966", "0.6496966", "0.6496966", "0.6496966", "0.6496966", "0.6496966", "0.6496966", "0.6496966", "0.64836776", "0.64836776", "0.64836776", "0.64836776", "0.64836776", "0.6477766", "0.6477766", "0.6477766...
0.6527723
6
For every segment, figure out the other segments that are in subsequent levels that also occupy the same vertical space. Accumulate in seg.forwardSegs
function computeForwardSlotSegs(levels) { var i; var level; var j; var seg; var k; for (i = 0; i < levels.length; i++) { level = levels[i]; for (j = 0; j < level.length; j++) { seg = level[j]; seg.forwardSegs = []; for (k = i + 1; k < levels.length; k++) { computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeSlotSegPressures(seg){var forwardSegs=seg.forwardSegs;var forwardPressure=0;var i;var forwardSeg;if(seg.forwardPressure===undefined){// not already computed\nfor(i=0;i<forwardSegs.length;i++){forwardSeg=forwardSegs[i];// figure out the child's maximum forward path\ncomputeSlotSegPressures(forwardSe...
[ "0.71576595", "0.6984047", "0.6755502", "0.67453086", "0.6745045", "0.67234623", "0.6717402", "0.6717402", "0.6717402", "0.6717402", "0.6717402", "0.66804534", "0.6664366", "0.6614513", "0.6614513", "0.6614513", "0.6614513", "0.6614513", "0.6614513", "0.6614513", "0.6614513",...
0.67486435
5
Figure out which path forward (via seg.forwardSegs) results in the longest path until the furthest edge is reached. The number of segments in this path will be seg.forwardPressure
function computeSlotSegPressures(seg) { var forwardSegs = seg.forwardSegs; var forwardPressure = 0; var i; var forwardSeg; if (seg.forwardPressure === undefined) { // not already computed for (i = 0; i < forwardSegs.length; i++) { forwardSeg = forwardSegs[i]; // figure out the child's maximum forward path computeSlotSegPressures(forwardSeg); // either use the existing maximum, or use the child's forward pressure // plus one (for the forwardSeg itself) forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure); } seg.forwardPressure = forwardPressure; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeForwardSlotSegs(levels){var i;var level;var j;var seg;var k;for(i=0;i<levels.length;i++){level=levels[i];for(j=0;j<level.length;j++){seg=level[j];seg.forwardSegs=[];for(k=i+1;k<levels.length;k++){computeSlotSegCollisions(seg,levels[k],seg.forwardSegs);}}}}// Figure out which path forward (via seg.f...
[ "0.6252813", "0.60432595", "0.6039703", "0.59666926", "0.5960505", "0.5913167", "0.5913167", "0.58984184", "0.5851599", "0.5851599", "0.5851599", "0.58244866", "0.581787", "0.581787", "0.581787", "0.581787", "0.581787", "0.581787", "0.581787", "0.581787", "0.581787", "0.581...
0.5915288
7
Find all the segments in `otherSegs` that vertically collide with `seg`. Append into an optionallysupplied `results` array and return.
function computeSlotSegCollisions(seg, otherSegs, results) { if (results === void 0) { results = []; } for (var i = 0; i < otherSegs.length; i++) { if (isSlotSegCollision(seg, otherSegs[i])) { results.push(otherSegs[i]); } } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeSlotSegCollisions(seg, otherSegs, results) {\n if (results === void 0) {\n results = [];\n }\n\n for (var i = 0; i < otherSegs.length; i++) {\n if (isSlotSegCollision(seg, otherSegs[i])) {\n results.push(otherSegs[i]);\n }\n }\n\n ...
[ "0.7555702", "0.7555433", "0.73929", "0.72135836", "0.716213", "0.716213", "0.716213", "0.716213", "0.716213", "0.7154244", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133", "0.71091133"...
0.7177639
6
Do these segments occupy the same vertical space?
function isSlotSegCollision(seg1, seg2) { return seg1.bottom > seg2.top && seg1.top < seg2.bottom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveSegmentSegment(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n const result = [];\n const isHorizontal1 = ax2 - ax1 > ay2 - ay1;\n const isHorizontal2 = bx2 - bx1 > by2 - by1;\n\n if (isHorizontal1 && isHorizontal2 &&\n by1 === ay1 &&\n ((ax1 <= bx2 && ax1 >= bx...
[ "0.64230865", "0.6271409", "0.61475646", "0.6019541", "0.5960251", "0.5878266", "0.58621514", "0.58603257", "0.5844158", "0.58419555", "0.58341056", "0.583265", "0.5799967", "0.57981145", "0.5783428", "0.57212204", "0.57212204", "0.5703831", "0.5703831", "0.5703831", "0.56836...
0.0
-1
MODAL PLUGIN DEFINITION =======================
function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option](_relatedTarget) else if (options.show) data.show(_relatedTarget) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this);var data=$this.data('bs.modal');var options=$.extend({},Modal.DEFAULTS,$this.data(),(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option);if(!data)$this.data('bs.modal',data=new Modal(this,options));if(typeo...
[ "0.7613195", "0.76106924", "0.70632553", "0.6971759", "0.6971759", "0.6971759", "0.6971759", "0.6971759", "0.696315", "0.6952324", "0.6952324", "0.6952324", "0.6952324", "0.6952324", "0.6940254", "0.6925037", "0.68329084", "0.68329084", "0.68329084", "0.68329084", "0.68329084...
0.68679523
25
TAB PLUGIN DEFINITION =====================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tab');if(!data)$this.data('bs.tab',data=new Tab(this));if(typeof option=='string')data[option]();});}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tab');if(!data)$this...
[ "0.74222374", "0.74222374", "0.692559", "0.68413377", "0.68389773", "0.68262935", "0.667987", "0.667987", "0.667987", "0.667987", "0.66649354", "0.6643321", "0.6643321", "0.6643321", "0.6643321", "0.6643321", "0.66032135", "0.6584301", "0.65660053", "0.6557222", "0.65411276",...
0.0
-1
TOOLTIP PLUGIN DEFINITION =========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "get tooltip() {}", "function tooltips() {\r\n\t$('.tooltip-link')...
[ "0.7193489", "0.7177543", "0.71230096", "0.7107687", "0.7008811", "0.69535863", "0.6937391", "0.6877154", "0.685422", "0.68206614", "0.6799643", "0.6799365", "0.6754513", "0.6752117", "0.6705143", "0.6687539", "0.6659539", "0.66462636", "0.6641098", "0.66409045", "0.66404915"...
0.0
-1
Easy API for creating new setFilters
function setFilters() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}" ]
[ "0.8424095", "0.8424095", "0.8424095", "0.8424095", "0.8424095", "0.8424095", "0.8424095", "0.8424095", "0.8424095" ]
0.0
-1
Implement the identical functionality for filter and not
function winnow( elements, qualifier, not ) { if ( isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { return !!qualifier.call( elem, i, elem ) !== not; } ); } // Single element if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } // Arraylike of elements (jQuery, arguments, Array) if ( typeof qualifier !== "string" ) { return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) > -1 ) !== not; } ); } // Filtered directly for both simple and complex selectors return jQuery.filter( qualifier, elements, not ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "function filter() {\n \n}", "function filterFunction() {\n \n}", "function Nothing$prototype$filter(pred) {\n return this;\n }", "removeAllFilters() {}", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n ...
[ "0.74149454", "0.74149454", "0.719128", "0.68614864", "0.6764592", "0.66512936", "0.6457615", "0.6457615", "0.6457615", "0.6457615", "0.6295093", "0.6292765", "0.62562424", "0.624675", "0.6208189", "0.61978525", "0.6192146", "0.6189551", "0.6183979", "0.6165194", "0.61502874"...
0.0
-1
Convert Stringformatted options into Objectformatted ones
function createOptions( options ) { var object = {}; jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeOption(option){if(isString(option)){return normalizeStringOption(option);}else if(isGroup(option)){var title=option.title,options=option.options;return{title:title,options:options.map(function(option){return isString(option)?normalizeStringOption(option):option;})};}return option;}", "function ...
[ "0.6646514", "0.66005486", "0.66005486", "0.66005486", "0.649457", "0.63181406", "0.62969595", "0.62960297", "0.62944365", "0.62496066", "0.62457913", "0.61913466", "0.615734", "0.6145045", "0.61051947", "0.60929805", "0.6089481", "0.6005777", "0.59753966", "0.59635246", "0.5...
0.0
-1
The ready event handler and self cleanup method
function completed() { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); jQuery.ready(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readyCallBack() {\n}", "static ready() { }", "onReady() {}", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\...
[ "0.72463065", "0.7211212", "0.7172562", "0.7149137", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.70596856", "0.7042607", "0.7042607", "0.7042607", "0.7042607", "0....
0.0
-1
Used by camelCase as callback to replace()
function fcamelCase( _all, letter ) { return letter.toUpperCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function camelCase(name) { return name.replace(/-([a-z])/g,camelCase_replace); }", "function camelize() {\n return function (str) {\n var i;\n // Split string into substring's without \"-\".\n str = str.split(\"-\");\n for (i = 0; i < str.length; i += 1) {\n ...
[ "0.71807325", "0.7025946", "0.69724524", "0.6946594", "0.691589", "0.69047016", "0.6889518", "0.6856401", "0.67825854", "0.6759434", "0.6723883", "0.6723883", "0.6720404", "0.6720404", "0.668707", "0.663834", "0.6632068", "0.66314816", "0.66314816", "0.6629163", "0.6625131", ...
0.0
-1
Convert dashed to camelCase; used by the css and data modules Support: IE <=9 11, Edge 12 15 Microsoft forgot to hump their vendor prefix (9572)
function camelCase( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fcamelCase(all,letter){return letter.toUpperCase();}// Convert dashed to camelCase; used by the css and data modules", "function fcamelCase(all, letter) {\n return letter.toUpperCase();\n } // Convert dashed to camelCase; used by the css and data modules", "function fcamelCase(all, letter) {\n ...
[ "0.87719417", "0.82715935", "0.82715935", "0.8218914", "0.8218914", "0.8218914", "0.8218914", "0.8218914", "0.8218914", "0.7790995", "0.74233943", "0.7285127", "0.72805285", "0.72805285", "0.7242771", "0.72315544", "0.72315544", "0.72315544", "0.72315544", "0.72315544", "0.72...
0.0
-1
Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomQuery_1.ExtDomQuery(...this.internalContext.getIf(Const_1.DEFERRED_HEAD_INSERTS).value);\n insertHeadElems.runHeadInserts(true);\n // phas...
[ "0.5987435", "0.5798831", "0.5772783", "0.57142234", "0.5673525", "0.56659687", "0.5592892", "0.5492997", "0.5467838", "0.53731847", "0.5336245", "0.5309647", "0.5303123", "0.52803385", "0.52720535", "0.52717704", "0.52695596", "0.52677536", "0.52672625", "0.52672625", "0.525...
0.0
-1
Support: IE <=9 11+ focus() and blur() are asynchronous, except when they are noop. So expect focus to be synchronous when the element is already active, and blur to be synchronous when the element is not already active. (focus and blur are always synchronous in other supported browsers, this just defines when we can count on it).
function expectSync( elem, type ) { return ( elem === safeActiveElement() ) === ( type === "focus" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusAsync(element) {\r\n if (element) {\r\n // An element was already queued to be focused, so replace that one with the new element\r\n if (targetToFocusOnNextRepaint) {\r\n targetToFocusOnNextRepaint = element;\r\n return;\r\n }\r\n targetToFocusOnNe...
[ "0.66768336", "0.66768336", "0.65990996", "0.6543436", "0.654141", "0.6531115", "0.6531115", "0.63578004", "0.63578004", "0.63578004", "0.63578004", "0.63578004", "0.63578004", "0.63578004", "0.63578004", "0.6164437", "0.6159174", "0.61418015", "0.6100893", "0.60965294", "0.6...
0.0
-1
Support: IE <=9 only Accessing document.activeElement can throw unexpectedly
function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}catch(err){}}", "function safeActiveElement(){try{return document.activeElement;}ca...
[ "0.877296", "0.877296", "0.877296", "0.877296", "0.877296", "0.877296", "0.877296", "0.8555537", "0.84866536", "0.84145314", "0.83721894", "0.83460915", "0.83449954", "0.8336473", "0.8319321", "0.8313553", "0.8287411", "0.82829833", "0.82829833", "0.82829833", "0.82829833", ...
0.0
-1
Ensure the presence of an event listener that handles manuallytriggered synthetic events by interrupting progress until reinvoked in response to native events that it fires directly, ensuring that state changes have already occurred before other listeners are invoked.
function leverageNative( el, type, expectSync ) { // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add if ( !expectSync ) { if ( dataPriv.get( el, type ) === undefined ) { jQuery.event.add( el, type, returnTrue ); } return; } // Register the controller as a special universal handler for all event namespaces dataPriv.set( el, type, false ); jQuery.event.add( el, type, { namespace: false, handler: function( event ) { var notAsync, result, saved = dataPriv.get( this, type ); if ( ( event.isTrigger & 1 ) && this[ type ] ) { // Interrupt processing of the outer synthetic .trigger()ed event // Saved data should be false in such cases, but might be a leftover capture object // from an async native handler (gh-4350) if ( !saved.length ) { // Store arguments for use when handling the inner native event // There will always be at least one argument (an event object), so this array // will not be confused with a leftover capture object. saved = slice.call( arguments ); dataPriv.set( this, type, saved ); // Trigger the native event and capture its result // Support: IE <=9 - 11+ // focus() and blur() are asynchronous notAsync = expectSync( this, type ); this[ type ](); result = dataPriv.get( this, type ); if ( saved !== result || notAsync ) { dataPriv.set( this, type, false ); } else { result = {}; } if ( saved !== result ) { // Cancel the outer synthetic event event.stopImmediatePropagation(); event.preventDefault(); // Support: Chrome 86+ // In Chrome, if an element having a focusout handler is blurred by // clicking outside of it, it invokes the handler synchronously. If // that handler calls `.remove()` on the element, the data is cleared, // leaving `result` undefined. We need to guard against this. return result && result.value; } // If this is an inner synthetic event for an event with a bubbling surrogate // (focus or blur), assume that the surrogate already propagated from triggering the // native event and prevent that from happening again here. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the // bubbling surrogate propagates *after* the non-bubbling base), but that seems // less bad than duplication. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { event.stopPropagation(); } // If this is a native event triggered above, everything is now in order // Fire an inner synthetic event with the original arguments } else if ( saved.length ) { // ...and capture the result dataPriv.set( this, type, { value: jQuery.event.trigger( // Support: IE <=9 - 11+ // Extend with the prototype to reset the above stopImmediatePropagation() jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), saved.slice( 1 ), this ) } ); // Abort handling of the native event event.stopImmediatePropagation(); } } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dumbListener2(event) {}", "function dumbListener2(event) {}", "async function handleListenerStartedEvent() {\n logger.verbose( `handleListenerStartedEvent` );\n\n try {\n await switchListener( true );\n }\n catch ( e ) {\n /**\n * @todo\n */\n }\n}", "#setupTriggerEventListener() ...
[ "0.5891748", "0.5891748", "0.5798613", "0.57236135", "0.565704", "0.56017524", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", "0.5593466", ...
0.0
-1
Prefer a tbody over its parent table for containing new rows
function manipulationTarget( elem, content ) { if ( nodeName( elem, "table" ) && nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { return jQuery( elem ).children( "tbody" )[ 0 ] || elem; } return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function r(a,b){return fa.nodeName(a,\"table\")&&fa.nodeName(11!==b.nodeType?b:b.firstChild,\"tr\")?a.getElementsByTagName(\"tbody\")[0]||a.appendChild(a.ownerDocument.createElement(\"tbody\")):a}", "_createDataRows(tbody) {\r\n const that = this,\r\n rowDetailTemplate = that.rowDetailTemplate,...
[ "0.71068895", "0.70123374", "0.69515854", "0.67283845", "0.6453831", "0.64362985", "0.6406883", "0.6403995", "0.6383349", "0.6368027", "0.6368027", "0.6327824", "0.63271356", "0.63271356", "0.6291889", "0.62862366", "0.62862366", "0.6275941", "0.62185556", "0.6214741", "0.621...
0.0
-1
Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disableScript( elem ) {\r\n\tvar attr = elem.getAttributeNode(\"type\");\r\n\telem.type = ( attr && attr.specified ) + \"/\" + elem.type;\r\n\treturn elem;\r\n}", "function disableScript( elem ) {\n\tvar attr = elem.getAttributeNode(\"type\");\n\telem.type = ( attr && attr.specified ) + \"/\" + elem.typ...
[ "0.7015204", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6983948", "0.6941072", "0.69362515", "0.69002753", "0.68869877", "0.68869877", "0.68869877", "0.6885398", "0.6884041", "0.68813604", "0.6873264...
0.0
-1
Fix IE bugs, see support tests
function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IEcompatibility() {\n\t// Only do anything if this is IE\n\tif(Browser.ie){\n\t\tvar __fix = $$(\"#kbbcode-size-options\", \"#kbbcode-size-options span\", \n\t\t\t\t\t\t\"#kbbcode-colortable\", \"#kbbcode-colortable td\");\n\t\tif (__fix) {\n\t\t\t__fix.setProperty('unselectable', 'on');\n\t\t}\n\t}\n}", ...
[ "0.7220337", "0.70940924", "0.699044", "0.68625945", "0.66801953", "0.6574329", "0.6557123", "0.65142417", "0.65142417", "0.64660573", "0.64034224", "0.6379892", "0.6297539", "0.6296395", "0.62622595", "0.6166529", "0.6163856", "0.61358476", "0.61114734", "0.6054131", "0.6026...
0.0
-1
Executing both pixelPosition & boxSizingReliable tests require only one layout so they're executed at the same time to save the second computation.
function computeStyleTests() { // This is a singleton, we need to execute it only once if ( !div ) { return; } container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0"; div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + "margin:auto;border:1px;padding:1px;" + "width:60%;top:1%"; documentElement.appendChild( container ).appendChild( div ); var divStyle = window.getComputedStyle( div ); pixelPositionVal = divStyle.top !== "1%"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 // Some styles come back with percentage values, even though they shouldn't div.style.right = "60%"; pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; // Support: IE 9 - 11 only // Detect misreporting of content dimensions for box-sizing:border-box elements boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; // Support: IE 9 only // Detect overflow:scroll screwiness (gh-3699) // Support: Chrome <=64 // Don't get tricked when zoom affects offsetWidth (gh-4029) div.style.position = "absolute"; scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; documentElement.removeChild( container ); // Nullify the div so it wouldn't be stored in the memory and // it will also be a sign that checks already performed div = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computePixelPositionAndBoxSizingReliable() {\n\t\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +...
[ "0.721427", "0.7209085", "0.7209085", "0.72081125", "0.72081125", "0.7152082", "0.7152082", "0.7149793", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", "0.7133515", ...
0.0
-1
Return a vendorprefixed property or undefined
function vendorPropName( name ) { // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a pro...
[ "0.7707262", "0.7707262", "0.75569034", "0.751308", "0.74200445", "0.7405853", "0.7405853", "0.7405853", "0.7405853", "0.7405853", "0.7405853", "0.7405853", "0.7405853", "0.73776484", "0.73769224", "0.736673", "0.72982275", "0.718422", "0.7151027", "0.71010363", "0.7096066", ...
0.0
-1
Return a potentiallymapped jQuery.cssProps or vendor prefixed property
function finalPropName( name ) { var final = jQuery.cssProps[ name ] || vendorProps[ name ]; if ( final ) { return final; } if ( name in emptyStyle ) { return name; } return vendorProps[ name ] = vendorPropName( name ) || name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a pro...
[ "0.78410184", "0.78410184", "0.7469924", "0.7469924", "0.7469924", "0.7469924", "0.7469924", "0.7469924", "0.7469924", "0.7469924", "0.726086", "0.726086", "0.71604884", "0.6958364", "0.6876957", "0.6747684", "0.6747684", "0.6747684", "0.6747684", "0.6747684", "0.6747684", ...
0.0
-1
Animations created synchronously will run synchronously
function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = Date.now() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this...
[ "0.72297084", "0.7172655", "0.6751781", "0.6701827", "0.66490537", "0.6644208", "0.66413045", "0.65767395", "0.6515558", "0.64943016", "0.64906734", "0.6407048", "0.6392758", "0.6383256", "0.63779354", "0.6373179", "0.63684577", "0.6353303", "0.63494754", "0.6331653", "0.6321...
0.0
-1
Generate parameters to create a standard animation
function genFx( type, includeWidth ) { var which, i = 0, attrs = { height: type }; // If we include width, step value is 1 to do all cssExpand values, // otherwise step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "function generateAnimationPara...
[ "0.6477499", "0.6449747", "0.6239411", "0.62102515", "0.62051743", "0.6019592", "0.599829", "0.594838", "0.5940393", "0.5940393", "0.5912163", "0.5873654", "0.5832134", "0.5828958", "0.58236474", "0.5820797", "0.5813001", "0.579854", "0.57910967", "0.57835335", "0.5780475", ...
0.0
-1
Strip and collapse whitespace according to HTML spec
function stripAndCollapse( value ) { var tokens = value.match( rnothtmlwhite ) || []; return tokens.join( " " ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \"...
[ "0.79224557", "0.79224557", "0.79224557", "0.76790833", "0.75981474", "0.7587476", "0.7583516", "0.7560448", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", "0.75548595", ...
0.0
-1
Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; if ( isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType[ 0 ] === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.config = Config.ajax;\n this.xhr;\n this.Serialize;\n }", "function AjaxPipelineConstructor() {\r\n BaseObject.call(this,arguments);\r\n }", "function Ajax(__constructor) {\r\n if (Params.env.isFirefox) return GM_xmlhttpRequest(__constructor);\r\n ...
[ "0.69918233", "0.6821871", "0.63700444", "0.61642385", "0.59259677", "0.5838953", "0.5837507", "0.5837507", "0.5830251", "0.5830251", "0.5830251", "0.5830251", "0.5830251", "0.5830251", "0.5798855", "0.5788467", "0.5788467", "0.5743906", "0.5731205", "0.573042", "0.56617373",...
0.0
-1
Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\n\n var inspected = {},\n seekin...
[ "0.6271232", "0.62278324", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.6089844", "0.607385", "0.60586876", "0.60586876", "0.6036968", "0.601241", "0.601241", "0.601241", "0.601241", "0.601241", "0.6...
0.0
-1
A special extend for ajax options that takes "flat" options (not to be deep extended) Fixes 9887
function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}}", "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettin...
[ "0.76669925", "0.7610233", "0.7565974", "0.7565974", "0.7565974", "0.7565974", "0.7565974", "0.7565974", "0.75467765", "0.75467765", "0.7526759", "0.7455252", "0.7317883", "0.7311789", "0.72914684", "0.72906107", "0.72556823", "0.7241331", "0.7240382", "0.7240382", "0.7225590...
0.0
-1
Handles responses to an ajax request: finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
function ajaxHandleResponses( s, jqXHR, responses ) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}...
[ "0.78496015", "0.7837405", "0.7837405", "0.77763313", "0.7761825", "0.7757081", "0.7718662", "0.77154136", "0.76727474", "0.7629757", "0.76141524", "0.7604442", "0.7600189", "0.75992036", "0.7597217", "0.7597217", "0.7597217", "0.7597217", "0.7597217", "0.7597217", "0.7597217...
0.0
-1
Chain conversions given the request and the original response Also sets the responseXXX fields on the jqXHR instance
function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s.throws ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLo...
[ "0.62697154", "0.62630993", "0.6203375", "0.6193772", "0.6193154", "0.6177705", "0.6177705", "0.6174955", "0.61516523", "0.60946137", "0.6089439", "0.6086175", "0.6086175", "0.6086175", "0.6086175", "0.6086175", "0.60740083", "0.60740083", "0.60740083", "0.60494006", "0.60179...
0.0
-1
Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Ignore repeat invocations if ( completed ) { return; } completed = true; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Use a noop converter for missing script but not if jsonp if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 && jQuery.inArray( "json", s.dataTypes ) < 0 ) { s.converters[ "text script" ] = function() {}; } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // Extract error from statusText and normalize for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function done() {}", "function finished(err){\n }", "onFinish() {}", "function AllDone(){\n \n}", "async onFinished() {}", "done() {}", "_onEnd() {}", "done () {}", "complete() {}", "function onFinish() {\n console.log('finished!');\n}", "function complete(){\r\n ...
[ "0.7607877", "0.73473793", "0.73289984", "0.7317956", "0.7304225", "0.72417575", "0.7235767", "0.69856775", "0.68565404", "0.6855536", "0.6845145", "0.6817738", "0.6773241", "0.6773241", "0.6773241", "0.6773241", "0.677228", "0.67654777", "0.67654777", "0.6763289", "0.6711056...
0.0
-1
This is just a junk drawer, containing anything used across multiple classes. Because Luxon is small(ish), this should stay small and we won't worry about splitting it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.
function isUndefined(o) { return typeof o === "undefined"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function featuresDiv() {\n let classFeatures;\n if (classes === 'Fighter') {\n classFeatures =\n `\n <h3>Class Features</h3>\n <p>Hit Points at 1st Level: 10 + your Constitution modifier</p>\n <p class=\"underline\">Proficiency</p>\n <ul>\n <li class=\"profskills\">${fighterSkill1}</li>\...
[ "0.6091004", "0.58595735", "0.553654", "0.55306345", "0.55298185", "0.5506889", "0.54659706", "0.5441621", "0.54200846", "0.5391406", "0.5383551", "0.53450567", "0.53435653", "0.5343159", "0.5328044", "0.5322372", "0.5320054", "0.5310372", "0.52833444", "0.52764565", "0.52728...
0.0
-1
clone really means "create another instance just like this one, but with these changes"
function clone(dur, alts, clear) { if (clear === void 0) { clear = false; } // deep merge for vals var conf = { values: clear ? alts.values : Object.assign({}, dur.values, alts.values || {}), loc: dur.loc.clone(alts.loc), conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy }; return new Duration(conf); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone(){\n }", "function Clone() { }", "function Clone() { }", "function Clone() { }", "clone() {\n return new this.constructor(this);\n }", "Clone() {\n\n }", "Clone() {\n\n }"...
[ "0.8517643", "0.8517643", "0.8517643", "0.8517643", "0.8398923", "0.8337403", "0.8337403", "0.8337403", "0.81964403", "0.8071195", "0.8071195", "0.8071195", "0.8071195", "0.8048976", "0.78545654", "0.7840554", "0.7828258", "0.7826537", "0.77119964", "0.7394785", "0.7385902", ...
0.0
-1
checks if the start is equal to or before the end
function validateStartEnd(start, end) { if (!start || !start.isValid) { return Interval.invalid("missing or invalid start"); } else if (!end || !end.isValid) { return Interval.invalid("missing or invalid end"); } else if (end < start) { return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStart(value, start, end) {\n return end !== null && start !== end && value < end && value === start;\n}", "function isStart(value, start, end) {\n return end !== null && start !== end && value < end && value === start;\n}", "function isStart(value, start, end) {\n return end !== null && start...
[ "0.7910362", "0.7910362", "0.79102963", "0.7202752", "0.7188376", "0.71393454", "0.71393454", "0.7124153", "0.7089423", "0.7089423", "0.7082911", "0.6991141", "0.6988255", "0.6874217", "0.6845974", "0.68382925", "0.68267137", "0.6826206", "0.67953295", "0.6751445", "0.6711845...
0.61919224
57
to create a new object while only changing some of the properties
function clone$1(inst, alts) { var current = { ts: inst.ts, zone: inst.zone, c: inst.c, o: inst.o, loc: inst.loc, invalid: inst.invalid }; return new DateTime(Object.assign({}, current, alts, { old: current })); } // find the right offset a given local time. The o input is our guess, which determines which
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getNewProperties() {\n return {};\n }", "function NewObj(){}", "function changeProp(obj) {\n return {\n ...obj,\n name: 'Jen'\n };\n // obj.name = 'Jen';\n //return obj\n}", "function makeObj() {\n return {\n propA: 10,\n propB: 20,\n };\n}", "function createAnother(origi...
[ "0.6274014", "0.62712884", "0.60936064", "0.60454816", "0.59555525", "0.59144175", "0.5889698", "0.58792293", "0.5870448", "0.585065", "0.5847218", "0.58256686", "0.58036286", "0.5801606", "0.5800577", "0.5786137", "0.5778846", "0.57778525", "0.5764114", "0.5764114", "0.57567...
0.0
-1
offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)
function fixOffset(localTS, o, tz) { // Our UTC time is just a guess because our offset is just a guess var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done if (o === o2) { return [utcGuess, o]; } // If not, change the ts by the difference in the offset utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done var o3 = tz.offset(utcGuess); if (o2 === o3) { return [utcGuess, o2]; } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; } // convert an epoch timestamp into a calendar object with the given offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function checkOffset(offset){\n if(offset && offset >= 0){\n return offset;\n }\n else{\n return 0;\n }\n }", "function getOffset(diff){\n\n\t\t\tvar offs...
[ "0.64174575", "0.63720465", "0.62933534", "0.6174761", "0.6018188", "0.5834882", "0.5774075", "0.5758565", "0.5741714", "0.57082075", "0.5705983", "0.5676555", "0.5664049", "0.56598896", "0.56491846", "0.56379485", "0.5618729", "0.5610561", "0.55883324", "0.55858034", "0.5583...
0.55477524
29
by handling the zone options
function parseDataToDateTime(parsed, parsedZone, opts, format, text) { var setZone = opts.setZone, zone = opts.zone; if (parsed && Object.keys(parsed).length !== 0) { var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(Object.assign(parsed, opts, { zone: interpretationZone, // setZone is a valid option in the calling methods, but not in fromObject setZone: undefined })); return setZone ? inst : inst.setZone(zone); } else { return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); } } // if you want to output a technical format (e.g. RFC 2822), this helper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadZoneDetails() {\n refreshZoneDetails()\n }", "getZone() {\n return this._zone;\n }", "function _zonePointSelectionChanged(ndx) \n{\n // 1) [Geozone.js] _zonePointSelectionChanged\n // 2) [jsmap.js] mapProviderParseZones\n // 3) [jsmap.js] jsmParseGeozones\n // 4) [...
[ "0.6625593", "0.6239862", "0.6121021", "0.6073431", "0.6073431", "0.6073431", "0.6073431", "0.6073431", "0.60722363", "0.6031178", "0.5992536", "0.5958643", "0.5859132", "0.58356327", "0.5808946", "0.57686645", "0.5720743", "0.57059675", "0.5690443", "0.56650555", "0.56397057...
0.0
-1
helps handle the details
function toTechFormat(dt, format, allowZ) { if (allowZ === void 0) { allowZ = true; } return dt.isValid ? Formatter.create(Locale.create("en-US"), { allowZ: allowZ, forceSimple: true }).formatDateTimeFromString(dt, format) : null; } // technical time formats (e.g. the time part of ISO 8601), take some options
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleInfo() {\n\t\t// setJob({\n\t\t// \tjob: 'Front-end developer',\n\t\t// \tlang: 'JS',\n\t\t// });\n\n\t\tsetPerson({\n\t\t\tname: 'Sina',\n\t\t\temail: 'sina.mail.programming@gmail.com',\n\t\t});\n\t}", "function Details() {\r\n}", "function getDetails() {\n\n}", "function trapItemDetails() {\...
[ "0.71270645", "0.6746913", "0.6561305", "0.63605773", "0.60238266", "0.5900586", "0.5862907", "0.5837985", "0.5795267", "0.57751864", "0.5749872", "0.5739743", "0.5729432", "0.5728283", "0.5707446", "0.57074034", "0.5692112", "0.5669809", "0.5665414", "0.5657836", "0.5657536"...
0.0
-1
and this commonizes their handling
function toTechTimeFormat(dt, _ref) { var _ref$suppressSeconds = _ref.suppressSeconds, suppressSeconds = _ref$suppressSeconds === void 0 ? false : _ref$suppressSeconds, _ref$suppressMillisec = _ref.suppressMilliseconds, suppressMilliseconds = _ref$suppressMillisec === void 0 ? false : _ref$suppressMillisec, includeOffset = _ref.includeOffset, _ref$includePrefix = _ref.includePrefix, includePrefix = _ref$includePrefix === void 0 ? false : _ref$includePrefix, _ref$includeZone = _ref.includeZone, includeZone = _ref$includeZone === void 0 ? false : _ref$includeZone, _ref$spaceZone = _ref.spaceZone, spaceZone = _ref$spaceZone === void 0 ? false : _ref$spaceZone, _ref$format = _ref.format, format = _ref$format === void 0 ? "extended" : _ref$format; var fmt = format === "basic" ? "HHmm" : "HH:mm"; if (!suppressSeconds || dt.second !== 0 || dt.millisecond !== 0) { fmt += format === "basic" ? "ss" : ":ss"; if (!suppressMilliseconds || dt.millisecond !== 0) { fmt += ".SSS"; } } if ((includeZone || includeOffset) && spaceZone) { fmt += " "; } if (includeZone) { fmt += "z"; } else if (includeOffset) { fmt += format === "basic" ? "ZZZ" : "ZZ"; } var str = toTechFormat(dt, fmt); if (includePrefix) { str = "T" + str; } return str; } // defaults for unspecified units in the supported calendars
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function customHandling() { }", "protected internal function m252() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "function _____SHARED_functions_____(){}", "transient protected internal function m189() {}", "private public function m246() {}", ...
[ "0.5676095", "0.5626806", "0.53722394", "0.53318346", "0.5197178", "0.51467043", "0.5120553", "0.49524674", "0.49363863", "0.49082074", "0.49078873", "0.49005833", "0.48705915", "0.48443982", "0.47343245", "0.46473324", "0.46456856", "0.45747054", "0.45685592", "0.4560121", "...
0.0
-1
standardize case and plurality in units
function normalizeUnit(unit) { var normalized = { year: "year", years: "year", month: "month", months: "month", day: "day", days: "day", hour: "hour", hours: "hour", minute: "minute", minutes: "minute", quarter: "quarter", quarters: "quarter", second: "second", seconds: "second", millisecond: "millisecond", milliseconds: "millisecond", weekday: "weekday", weekdays: "weekday", weeknumber: "weekNumber", weeksnumber: "weekNumber", weeknumbers: "weekNumber", weekyear: "weekYear", weekyears: "weekYear", ordinal: "ordinal" }[unit.toLowerCase()]; if (!normalized) throw new InvalidUnitError(unit); return normalized; } // this is a dumbed down version of fromObject() that runs about 60% faster
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pluralize(name) {\n const plural = this.pluralNames[name];\n if (plural) {\n return plural;\n }\n // singular and plural are the same\n if (uncountable.indexOf(name.toLowerCase()) >= 0) {\n return name;\n // vowel + y\n }\n else if (...
[ "0.68932784", "0.68764114", "0.6856109", "0.6782922", "0.64469224", "0.6387845", "0.632334", "0.63024986", "0.62655085", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6195872", "0.6178826", "0.6176442",...
0.5839228
61
but doesn't do any validation, makes a bunch of assumptions about what units are present, and so on.
function quickDT(obj, zone) { // assume we have the higher-order units for (var _iterator = _createForOfIteratorHelperLoose(orderedUnits$1), _step; !(_step = _iterator()).done;) { var u = _step.value; if (isUndefined(obj[u])) { obj[u] = defaultUnitValues[u]; } } var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); if (invalid) { return DateTime.invalid(invalid); } var tsNow = Settings.now(), offsetProvis = zone.offset(tsNow), _objToTS = objToTS(obj, offsetProvis, zone), ts = _objToTS[0], o = _objToTS[1]; return new DateTime({ ts: ts, zone: zone, o: o }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkUnits(){\n let logger = this.namespace.container.logger;\n\n let leftSideUnit = this.unitsParsed;\n if (typeof leftSideUnit === 'undefined') {\n logger.warn(`No units set for \"${this.index}\"`);\n }\n for (const scope in this.assignments) {\n let rightSideExpr = this.assignments[scop...
[ "0.68548477", "0.6810661", "0.6603468", "0.6580972", "0.65439767", "0.6519883", "0.64602107", "0.64602107", "0.6458794", "0.63897", "0.63897", "0.63836765", "0.63763237", "0.63479966", "0.63232195", "0.63232195", "0.63090533", "0.62811875", "0.6256365", "0.6234015", "0.621338...
0.0
-1
Creates a infoPanel Object
constructor() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInfoPanel() {\n return new Ext.Panel({\n border: true,\n id: 'infoPanel',\n baseCls: 'md-info',\n autoWidth: true,\n contentEl: 'infoContent',\n autoLoad: {\n url: '../../apps/search/home_' + catalogue.LANG + '.h...
[ "0.84340686", "0.7034731", "0.7026478", "0.68441755", "0.6605936", "0.65441495", "0.6499732", "0.64882267", "0.6450804", "0.64504594", "0.6449084", "0.6363273", "0.6264746", "0.62492585", "0.62476665", "0.62244296", "0.6217169", "0.6211066", "0.620403", "0.61944", "0.6164216"...
0.0
-1
Update the info panel to show info about the currently selected world cup
updateInfo(oneWorldCup) { d3.select("#edition").html(oneWorldCup['EDITION']); d3.select("#host").html(oneWorldCup['host']); d3.select("#winner").html(oneWorldCup['winner']); d3.select("#silver").html(oneWorldCup['runner_up']); let teamsString = "<ul>"; for (let i = 0; i < oneWorldCup['teams_names'].length; i++) { teamsString += "<li>" + oneWorldCup['teams_names'][i] + "</li>"; } teamsString += "</ul>"; d3.select("#teams").html(teamsString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateInfo(oneWorldCup) {\n\n // ******* TODO: PART II *******\n\n // Update the text elements in the infoBox to reflect:\n // World Cup Title, host, winner, runner_up, and all participating teams that year\n\n // Hint: For the list of teams, you can create an list element for each team.\n ...
[ "0.7387405", "0.6920616", "0.66400254", "0.6191368", "0.616562", "0.6162544", "0.6073907", "0.604219", "0.6023963", "0.60224044", "0.6016215", "0.5994222", "0.59736544", "0.5911498", "0.58990014", "0.5830945", "0.581699", "0.58131087", "0.5804958", "0.5801024", "0.5739823", ...
0.7060216
1
getting all the movies
function GetFilms() { $.ajax({ url: "/api/films", type: "GET", contentType: "application/json", success: function (films) { let rows = ""; $.each(films, function (index, film) { rows += row(film); }); $("table tbody").append(rows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllMovies() {\n Movie.find()\n .then(allMovies => console.log('here are all the movies', allMovies))\n .catch(err => console.log('could not get all movies', err))\n}", "async function getMovies() {\n // TODO: fetch movies from wp headless and call appendMovies\n // https://movie-api.cederdor...
[ "0.7896138", "0.750089", "0.7351434", "0.7349381", "0.72145504", "0.7166099", "0.71202743", "0.71134067", "0.7093998", "0.7093998", "0.70887476", "0.70783573", "0.70686984", "0.7050777", "0.70307463", "0.69881386", "0.6978392", "0.697382", "0.6973663", "0.6956961", "0.6948063...
0.0
-1
add movies in database
function CreateFilm(data) { $.ajax({ url: "/api/film", contentType: "application/json", method: "POST", data: JSON.stringify({ nameUa: data.nameUa, nameEn: data.nameEn, sourseImg: data.sourseImg, sourseVideo: data.sourseVideo, qualityVideo: data.qualityVideo, translation: data.translation, motto: data.motto, year: data.year, country: data.country, genre: data.genre, category: data.category, producer: data.producer, duration: data.duration, age: data.age, firstRun: data.firstRun }), success: function (film) { reset(); $("table tbody").append(row(film)); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertMovies(db) {\n movies.forEach(movie => {\n const sql = 'INSERT INTO movies(link, id, metascore, rating, synopsis, title, votes, year) ' +\n 'VALUES(\"' + movie.link + '\", \"' + movie.id + '\", ' + movie.metascore + ', ' + movie.rating +\n ', \"' + movie.synopsis + '\...
[ "0.74622643", "0.72914994", "0.7277064", "0.7015771", "0.69821036", "0.6808858", "0.68001604", "0.6787975", "0.6787099", "0.67457294", "0.66903883", "0.66018206", "0.6544292", "0.6490752", "0.6459", "0.64228904", "0.6392001", "0.6366013", "0.6353019", "0.6334467", "0.63167465...
0.5448181
98
clean input at form
function reset() { let form = document.forms["filmForm"]; form.reset(); form.elements["id"].value = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanAdvancedQueryForm() {\n $('[name=p1]').val('')\n }", "function cleanFormulaire() {\n input_matricule.value = '';\n input_prenom.value = '';\n input_nom.value = '';\n select_sexe.value = '';\n input_datenaissance.value = '';\n input_lieunaissance.value = '';\n ...
[ "0.7225071", "0.7145315", "0.70979565", "0.7060485", "0.7043496", "0.70128393", "0.6939596", "0.6908066", "0.6856607", "0.6823294", "0.6803133", "0.6793964", "0.674776", "0.67107254", "0.6665976", "0.6645781", "0.6635197", "0.6616442", "0.6565005", "0.65594757", "0.6533194", ...
0.0
-1
This function grabs posts from the database and updates the view
function getPosts(author) { authorId = author || ""; if (authorId) { authorId = "/?author_id=" + authorId; } $.get("/api/posts" + authorId, function(data) { console.log("Posts", data); posts = data; if (!posts || !posts.length) { displayEmpty(author); } else { initializeRows(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPosts() {\n $.get('/api/posts/', function (data) {\n var postsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n\n newPost = data[i];\n\n postsToAdd.push(createPostDiv(newPost));\n renderPost(postsToAdd);\n }\n ...
[ "0.6727598", "0.6654995", "0.6590465", "0.6505052", "0.646554", "0.6461123", "0.64192784", "0.6374767", "0.63645476", "0.6364195", "0.6347832", "0.63456726", "0.6330478", "0.63288283", "0.6318959", "0.6315574", "0.63108397", "0.62578136", "0.6257761", "0.62432706", "0.6204357...
0.5928775
52
This function does an API call to delete posts InitializeRows handles appending all of our constructed post HTML inside blogContainer
function initializeRows() { blogContainer.empty(); var postsToAdd = []; for (var i = 0; i < posts.length; i++) { postsToAdd.push(createNewRow(posts[i])); } blogContainer.append(postsToAdd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeRows() {\n blogContainer.empty();\n var postsToAdd = [];\n var reversePoststoAdd\n for (var i = 0; i < post.length; i++) {\n postsToAdd.push(createNewRow(post[i]));\n }\n reversePoststoAdd = postsToAdd.reverse()\n blogContainer.append(reversePoststoAdd);\n }", "funct...
[ "0.6730714", "0.65798175", "0.646155", "0.6374156", "0.6374156", "0.63092834", "0.6309041", "0.63025695", "0.62781805", "0.6271256", "0.62627643", "0.6240731", "0.62363905", "0.6223824", "0.6137714", "0.61287135", "0.6128233", "0.60775584", "0.6076449", "0.6048756", "0.604516...
0.6947592
0
This function constructs a post's HTML
function createNewRow(post) { var formattedDate = new Date(post.createdAt); formattedDate = moment(formattedDate).format("MMMM Do YYYY"); var newPostPanel = $("<div>"); newPostPanel.addClass("blog-container"); var newPostPanelHeading = $("<div>"); newPostPanelHeading.addClass("panel-heading"); var newPostTitle = $("<h2>"); var newPostDate = $("<small>"); var newPostAuthor = $("<h5>"); newPostAuthor.text("Written by: " + post.Author.name); newPostAuthor.css({ float: "right", color: "pink", "margin-top": "-10px" }); var newPostPanelBody = $("<div>"); newPostPanelBody.addClass("blog-container"); var newPostBody = $("<p>"); newPostTitle.text(post.title + " "); newPostBody.text(post.body); newPostDate.text(formattedDate); newPostTitle.append(newPostDate); newPostPanelHeading.append(newPostTitle); newPostPanelHeading.append(newPostAuthor); newPostPanelBody.append(newPostBody); newPostPanel.append(newPostPanelHeading); newPostPanel.append(newPostPanelBody); newPostPanel.data("post", post); return newPostPanel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postHTML(post){\n return `\n <div class=\"card\">\n <div class=\"card-content\">\n <span class=\"card-title\">${post.title}</span>\n <p>${post.author}</p>\n <p>${post.content}</p>\n <button class=\"colorButton\">Change Background</button>\n </div>\n </div>\n \n `\n}", "fun...
[ "0.76431787", "0.75064105", "0.7470904", "0.7450804", "0.73155046", "0.7254313", "0.71349424", "0.71274376", "0.6976102", "0.69743454", "0.68133074", "0.6801224", "0.6789249", "0.6787127", "0.67849565", "0.6755449", "0.6735643", "0.6734232", "0.672879", "0.67183894", "0.67100...
0.0
-1
This function displays a messgae when there are no posts
function displayEmpty(id) { var query = window.location.search; var partial = ""; if (id) { partial = " for Author #" + id; } blogContainer.empty(); var messageh2 = $("<h2>"); messageh2.css({ "text-align": "center", "margin-top": "50%" }); messageh2.html("This NerdGirl has not posted anything yet." ); blogContainer.append(messageh2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayEmpty() {\n blogContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\",\"color\":\"gray\" });\n messageH2.html('No posts yet for this category. Click \"Add Post\" at top of page');\n blogContainer.append(messageH2);\n ...
[ "0.74588084", "0.69013363", "0.6767553", "0.65592355", "0.65546995", "0.65341586", "0.6472723", "0.6362076", "0.63145685", "0.6266904", "0.6246553", "0.622791", "0.621313", "0.61999077", "0.61548173", "0.6151635", "0.61148363", "0.61038643", "0.60918754", "0.6072007", "0.6071...
0.64505893
7
prevent a player from clicking on 2 parts to addclasslist add selected class, on click set a condition, not to execute img src change, if the box already ahs the class target .box to display x when clicked
function addXsAndOs(){ for (var i =0; i<oneBox.length; i++) { oneBox[i].square = i; oneBox[i].addEventListener('click',function(){ if (!this.move){ this.querySelector('img').src = letter; this.move = letter; //currentPlayer.indexString = true if(turn){ playerX[this.square] = true; }else{ playerO[this.square] = true; } turnChanger(); changeTurn(); winningCombination(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickedBox(element) {\r\n console.log(element);\r\n if(players.classList.contains(\"player\")) {\r\n element.innerHTML = `<i class=\"${playerOIcon}\"></i>`;\r\n players.classList.add(\"active\");\r\n } else {\r\n element.innerHTML = `<i class=\"${playerXIcon}\"></i>`;\r\n ...
[ "0.65079087", "0.64757144", "0.6464441", "0.6430988", "0.6419099", "0.6229779", "0.62190425", "0.6189169", "0.61679804", "0.6041993", "0.5988708", "0.597747", "0.59698343", "0.59338707", "0.5932756", "0.59186476", "0.5915373", "0.59063154", "0.59047467", "0.58931607", "0.5873...
0.0
-1
Render and update each star
display() { // Lerp to proper colors if (blackStarfield) { this.alpha = 127; this.bg = color(0); this.color = color(255); } else { this.alpha = lerp(this.alpha, curLevel.alpha, STARFIELD_LERP); this.bg = lerpColor(this.bg, color(curLevel.bg), STARFIELD_LERP); this.color = lerpColor(this.color, color(curLevel.color), STARFIELD_LERP); } // Skip rendering stars if low graphics mode if (!showStars) return; // Render stars for (let i = 0; i < this.stars.length; i++) { let s = this.stars[i]; // Render star this.color.setAlpha(this.alpha * noise(s.noise)); fill(this.color); noStroke(); ellipse(s.x, s.y, s.r, s.r); // Update position if (!paused) { s.y += s.dy * dt(); if (s.y - s.r > height) { s.r = random(2); s.x = random(width); s.y = 0; s.dy = random(this.speed); } } // Update noise s.noise += s.deltaNoise; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render_stars(){\n \n}", "function drawStars() {\n translate(width / 2, height / 2);\n for (var i = 0; i < stars.length; i++) {\n stars[i].update();\n stars[i].show();\n }\n}", "function renderStars() {\n var canv = document.getElementById('star-canvas');\n\n // check if the canvas ex...
[ "0.76497924", "0.7639961", "0.7323112", "0.70052344", "0.6998917", "0.697177", "0.6949528", "0.6925531", "0.6915522", "0.6860622", "0.6836881", "0.6821338", "0.6811593", "0.67965996", "0.6764044", "0.67459244", "0.67275316", "0.67196304", "0.6657981", "0.66561586", "0.6653371...
0.71064484
3
function for creating new shopping list
function creatNewList(newItem){ //localStorage.removeItem("ekShoppingList"); var existingEntries = JSON.parse(localStorage.getItem(myShoppingLists)); if(existingEntries == null){ existingEntries = {} }; var newShoppingList = {}; newShoppingList[newItem] = []; //existingEntries[newItem] = newShoppingList; $.extend(existingEntries, newShoppingList ); localStorage.setItem(myShoppingLists, JSON.stringify(existingEntries)); // return JSON.stringify(existingEntries) console.log(existingEntries); return existingEntries; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createShoppingList(data) {\n const response = await apiReq.post(API_ROUTES.shoppingLists, data);\n return response.data;\n }", "function NewList() {\r\n}", "function newList(){\n let obj = {\n title: listTitleInput.value,\n listItems: []\n }\n exampleData.push(obj);\n sav...
[ "0.7192332", "0.70064694", "0.6830746", "0.6791286", "0.6781548", "0.6717105", "0.6711765", "0.6663963", "0.66310936", "0.6592421", "0.6590341", "0.65873086", "0.6561819", "0.65436167", "0.6533186", "0.6528961", "0.64702594", "0.6441108", "0.6430826", "0.6420733", "0.6419674"...
0.65058905
16
adding item to a shopping list require: listName
function addItem(listName, item, quantity){ console.log(listName, item, quantity); //return false; var myShoppingLists = "ekShoppingList"; var existingEntries = JSON.parse(localStorage.getItem("ekShoppingList")); /*var entryItem = $("#item").val(); var entryQty = $("#quantity").val();*/ //console.log(typeof existingEntries); //console.log(existingEntries[listName]); //return false; var len = existingEntries[listName].length-1; var i = 0; if(len == -1){ i=1 }else{ //$.each(existingEntries[listName], function(index, result) { for(var j = 0; j < existingEntries[listName].length; j++){ if(existingEntries[listName][j].item == item){ var itemIndex = existingEntries[listName][j].id; //existingEntries[listName].splice(index,1); quantity = Number(existingEntries[listName][j].quantity) + Number(quantity); existingEntries[listName][j].quantity = quantity; localStorage.setItem(myShoppingLists, JSON.stringify(existingEntries)); console.log(itemIndex, quantity, listName); console.log('good'); var returnData = { 'status' : 'updated', 'quantity' : quantity } return returnData; //break; //deleteItem(listName, itemIndex); } } /*if (result.item == item) { console.log(index); //existingEntries[listName].splice(index,1); deleteItem(listName, item); quantity = result.quantity + quantity; //return false; }*/ //}); i = existingEntries[listName][len]; i = i.id + 1; //i = i+1; } //console("not good"); //return false; console.log(i); var itemToAdd = {"id": i, "item": item, "quantity": quantity, "status": "new"}; existingEntries[listName].push(itemToAdd); localStorage.setItem(myShoppingLists, JSON.stringify(existingEntries)); console.log(JSON.stringify(existingEntries)); //showHomepage(); $('#index').trigger('refresh'); itemToAdd.itemCount = i + 1; return itemToAdd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToList(newName, newPrice, newIsTaxable){\n\tif (newName.length > 0 && isNaN(newPrice) === false) {\n\t\tshoppingCart[shoppingCart.length] = {\n\t\t\tname: newName,\n\t\t\tprice: newPrice,\n\t\t\tisTaxable: newIsTaxable\n\t\t}\n\t} else {\n\t\talert('Please input an item name and valid dollar amount.');...
[ "0.7390823", "0.73492944", "0.73435456", "0.7271558", "0.7251157", "0.71057373", "0.7060767", "0.70528793", "0.700025", "0.699257", "0.69490236", "0.6935935", "0.6929857", "0.6928292", "0.69147563", "0.6836777", "0.6799491", "0.6749974", "0.67492914", "0.67391473", "0.6738114...
0.0
-1
display current day at top of calender
function displayDate() { let currentDay = $("#currentDay").text(momentVar); return currentDay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderCurrentDay() {\n currentday.text(curday);\n }", "function displayCurrentDate() {\n\n\t\tvar currentDate = new Date();\n\n\t\tvar day = currentDate.getDay();\n\n\t\tvar date = currentDate.getDate();\n\n\t\tvar month = currentDate.getMonth();\n\n\t\tvar year = currentDate.getFullYear();\n\...
[ "0.7309398", "0.6870157", "0.67809737", "0.6743349", "0.6711506", "0.6674878", "0.6672412", "0.66686124", "0.6658594", "0.66434824", "0.66394395", "0.65384156", "0.6495639", "0.64832294", "0.6470111", "0.64699394", "0.64534974", "0.6441912", "0.63844097", "0.6372117", "0.6362...
0.6144247
36
It will call the "main" function when ready. This function will be called when CrossBrowdy is ready:
function main() { //Function to execute when a canvas is created: var canvasLoaded = 0; var onLoadCanvas = function() { if (CB_REM.DEBUG_MESSAGES) { CB_console("Canvas '" + this.getId() + "' loaded! Mode used: " + this.getMode()); } canvasLoaded++; //Gets the "context" object to start working with the canvas: var canvasContext = this.getContext(); if (!canvasContext) { CB_console("ERROR: canvas context could not be obtained! Drawing cannot be performed."); return; } //Stores the canvas in the 'canvases' object: canvases[this.getId()] = this; //If both canvas (normal and buffer) have been created, proceeds with the rendering: if (canvasLoaded >= 2) { //When the screen changes its size or its orientation, both canvases will be re-adapted: var onResizeOrChangeOrientationTimeout = null; var onResizeOrChangeOrientation = function() { clearTimeout(onResizeOrChangeOrientationTimeout); onResizeOrChangeOrientationTimeout = setTimeout //NOTE: needs a delay as some clients on iOS update the screen size information in two or more steps (last step is the correct value). ( function() { //Resizes the canvas: canvases["my_canvas"].setWidth(CB_Screen.getWindowWidth()); canvases["my_canvas"].setHeight(CB_Screen.getWindowHeight()); canvases["my_canvas"].clear(); canvases["my_canvas"].disableAntiAliasing(); //Resizes the buffer canvas: canvases["my_canvas_buffer"].setWidth(CB_Screen.getWindowWidth()); canvases["my_canvas_buffer"].setHeight(CB_Screen.getWindowHeight()); canvases["my_canvas_buffer"].clear(); canvases["my_canvas_buffer"].disableAntiAliasing(); } ); }; CB_Screen.onResize(onResizeOrChangeOrientation); //Clears both canvas: canvases["my_canvas"].clear(); canvases["my_canvas_buffer"].clear(); //Disables anti-aliasing to avoid problems with adjacent sprites: canvases["my_canvas"].disableAntiAliasing(); canvases["my_canvas_buffer"].disableAntiAliasing(); //Creates the sprites groups: var graphicSpritesSceneObject = createSpritesGroups(); //Caches all needed images (performance purposes) and starts rendering sprites groups when all are loaded: myREM = new CB_REM(); myREM.cacheImages ( graphicSpritesSceneObject, //CB_GraphicSpritesSceneObject. undefined, //reload. function(imagesLoaded) //onLoad. { //Sets the current time as the start time to start counting the FPS (erased each second automatically): myREM._startTimeFPS = CB_Device.getTiming(); //Show the FPS (Frames Per Second) every time there is a new value: myREM.onUpdatedFPS(function(FPS) { graphicSpritesSceneObject.getById("fps_group").getById("fps").src = "FPS: " + FPS; }); //Processes the sprites groups: if (CB_REM.DEBUG_MESSAGES) { CB_console("Starts processing graphic sprites scene ('CB_GraphicSpritesScene' object) constantly..."); } processSpritesGroups(graphicSpritesSceneObject, canvases["my_canvas"], canvases["my_canvas"].getContext(), canvases["my_canvas_buffer"], canvases["my_canvas_buffer"].getContext()); } ); } }; //Creates the canvases: var canvases = {}; canvases["my_canvas"] = new CB_Canvas ( "my_canvas", //canvasId. Unique required parameter. "2d", //contextType. NOTE: some emulation methods only support "2d". Default: "2d". CB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT. CB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT. onLoadCanvas, //onLoad. function(error) { CB_console("Canvas object problem! Error: " + error); }, //onError. undefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method. ); canvases["my_canvas_buffer"] = new CB_Canvas ( "my_canvas_buffer", //canvasId. Unique required parameter. "2d", //contextType. NOTE: some emulation methods only support "2d". Default: "2d". CB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT. CB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT. onLoadCanvas, //onLoad. function(error) { CB_console("Canvas object problem! Error: " + error); }, //onError. undefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method. ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function callMain() {\n console.log(documentReady);\n if(documentReady>=1) {\n\n window.main && window.main();\n } else {\n documentReady+=1;\n }\n\n }", ...
[ "0.7388551", "0.7341496", "0.7240387", "0.71667963", "0.70972764", "0.69723034", "0.69498205", "0.69498205", "0.69498205", "0.69498205", "0.69498205", "0.69498205", "0.69498205", "0.69498205", "0.6814466", "0.67987233", "0.6794886", "0.67812496", "0.6779183", "0.67769635", "0...
0.0
-1
Creates the sprites groups:
function createSpritesGroups() { //Defines the sprites groups information ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): /* Note: 1) Sprites groups, sprites and sub-sprites are always automatically ordered internally by their z-index (remember to use the 'setZIndex' method of each if you want to modify it). The elements of the scene will be rendered respecting this order. 2) We will use 'duration' in the 'data' property to disable a sprite or sub-sprite (if it is set to null, it will never be disabled). If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed. 3) We will use the 'timeResetAndEnableAfter' in the 'data' property to enable again a sprite or sub-sprite (if it is set to null, it will never be enabled). It also resets the 'time' property of the sprite or sub-sprite. If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed. 4) We will use 'skipAfter' in the 'data' property of a sprite to jump to the next one (if it is set to null, it will never jump automatically). * If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed. 5) We can use 'beforeDrawing' and 'afterDrawing' callbacks defined in the 'data' object to be called before drawing an element or after doing it, respectively. For bitmaps, a 'beforeDrawingElement' callback can be used to call before drawing each map element. 6) We can set 'onlyUseInMap' to true in the 'data' object to just draw that element when it is being drawn as a part of a map (a map is an element whose 'srcType' equals to 'CB_GraphicSprites.SRC_TYPES.MAP'). 7) We can set 'loop' to true in the 'data' object to loop sprites infinitely instead of stopping at the last one. 8) We can set a number (which belongs to the index of a sprite) or a function returning a number in the 'pointerNext' property of the 'data' object to indicate the desired next sprite. 9) We can set a desired canvas filter (similar to CSS filters) in the 'filter' property of the 'data' object. 10) We can set 'positionAbsolute' to true in the 'data' object to do not have in mind the element's parent position to calculate the position of the element. 11) We can set 'hidden' to true in the 'data' object to skip that element so it will not be drawn. 12) To rotate an element, we can set the 'rotation' property in the 'data' object to rotate that element: * If the 'rotationUseDegrees' property is set to true, the value set in 'rotation' will be considered degrees, otherwise it will be considered radians. * To set the coordinates of the rotation axis (for rotation the canvas, internally), use the 'rotationX' and 'rotationY' properties. If any of them is not set, the rotation coordinate will be considered the center (horizontal or vertical) of the element. 13) Some properties in the 'data' object can be either a static value or a callback function (as for example the 'style' property). 14) The 'clearPreviousFirst' property in the 'data' object can be set to true to accomplish the following: * If it is a sprite, it will clean the space used by the previous sprite before drawing this sprite. * If it is a sub-sprite, it will clean the space that will be used by this sub-sprite. * If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed. 15) We can set the 'parseIntLeft' and 'parseIntTop' properties to true in the 'data' object to use integer numbers internally for the position of the elements when drawing them. This can prevent some problems as for example tile maps with tiles separated in some screen resolutions. 16) We can set the 'avoidClearingCanvas' property to true in the 'data' object of the 'spritesGroupsData' to avoid clearing the canvas each cycle. */ var spritesGroupsData = { //'my_sprites_groups_1' ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object). Some missing or non-valid properties will get a default value: id: "my_sprites_groups_1", //Identifier of the sprites groups object (also used for the 'CB_GraphicSpritesScene' object). Optional but recommended. It should be unique. By default, it is generated automatically. srcWidth: 40, //The value for the "srcWidth" property which will be used as default if not provided (or the provided one was wrong) in the given 'CB_GraphicSprites.SPRITES_OBJECT' objects. Default: CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 40, //The value for the "srcHeight" property which will be used as default if not provided (or the provided one was wrong) in the given 'CB_GraphicSprites.SPRITES_OBJECT' objects. Default: CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. data: { skipAfter: null, duration: null, timeResetAndEnableAfter: null, loop: true, clearPreviousFirst: false }, //Object with any additional data desired which can be any kind. Default: { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }. //Numeric array containing 'CB_GraphicSprites.SPRITES_OBJECT' objects with all the sprites groups that will be used (their "parent" property will be set to point the current 'CB_GraphicSpritesScene' object which contains them): spritesGroups: [ //'bird_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "bird_sprites", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/bird_sprites.gif", //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || "". srcWidth: 38, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 36, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. left: 300, //Left (horizontal) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. width: 190, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 160, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. //Object with any additional data desired which can be any kind: //NOTE: it will always have a "that" property pointing to the 'CB_GraphicSprites.SPRITES_OBJECT' object where it belongs to and a function in its "getThis" property returning the same value (added automatically). data: { skipAfter: 600, clearPreviousFirst: true, onlyUseInMap: false /* Set to true to only display in maps */ }, //Object with any additional data desired which can be any kind. Default: CB_combineJSON(this.parent.data, this.data) || this.parent.data || { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }. //Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used: sprites: [ //'bird_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bird_sprite_1", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. //Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses: subSprites: [ //'bird_sprite_1_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_1_subsprite_1", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/sol.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. left: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. top: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: 200, timeResetAndEnableAfter: 200 }, zIndex: 2 }, //'bird_sprite_1_subsprite_2' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_1_subsprite_2", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/seta.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. top: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: null, beforeDrawing: function(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element. { this.height = this.width = this.width === 12 ? 15 : 12; if (drawingMap && this._attributes) { this.data._alternating = !this.data._alternating; this._attributes.width = this.data._alternating ? 60 : 50; this._attributes.height = this.data._alternating ? 90 : 80; } return this; //Same as 'element'. Must return the element to draw. Return null to skip drawing it. }, afterDrawing: function(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement, onDrawn) //Called after drawing the element. { //Here we could perform any tasks. } } } ] }, //'bird_sprite_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bird_sprite_2", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. srcLeft: 38, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. //Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses: subSprites: [ //'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_2_subsprite_1", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/sol.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. left: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. top: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: 200, timeResetAndEnableAfter: 200 }, zIndex: 2 }, //'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_2_subsprite_2", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/seta.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. top: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: null } } ] }, //'bird_sprite_3' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bird_sprite_3", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. srcLeft: 38 * 2, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. //Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses: subSprites: [ //'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_3_subsprite_1", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/sol.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. left: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. top: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: 200, timeResetAndEnableAfter: 200 }, zIndex: 2 }, //'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_3_subsprite_2", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/seta.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. top: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: null } } ] }, //'bird_sprite_4' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bird_sprite_4", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. srcLeft: 38 * 3, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. //Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses: subSprites: [ //'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_4_subsprite_1", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/sol.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. left: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. top: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: 200, timeResetAndEnableAfter: 200 }, zIndex: 2 }, //'bird_sprite_2_subsprite_4' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite: { id: "bird_sprite_4_subsprite_2", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/seta.gif", srcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT. srcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT. srcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT. srcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT. top: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. data: { duration: null } } ] } ] }, //'panda_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "panda_sprites", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically. width: 80, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 80, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. zIndex: 3, //The z-index for the destiny. Only numeric values allowed. Default: this.parent.zIndex || CB_GraphicSprites.ZINDEX_DEFAULT. //Object with any additional data desired which can be any kind: //NOTE: it will always have a "that" property pointing to the 'CB_GraphicSprites.SPRITES_OBJECT' object where it belongs to and a function in its "getThis" property returning the same value (added automatically). data: { skipAfter: 500 }, //Object with any additional data desired which can be any kind. Default: CB_combineJSON(this.parent.data, this.data) || this.parent.data || { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }. //Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used: sprites: [ //'panda_sprites_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "panda_sprites_sprite_1", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/panda_1.gif" //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || "". }, //'panda_sprites_sprite_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "panda_sprites_sprite_2", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/panda_2.gif" //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || "". } ] }, //'ranisima_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "ranisima_sprites", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically. src: "img/ranisima.gif", //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || "". left: 110, //Left (horizontal) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT. top: 80, //Top (vertical) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT. width: 160, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT. height: 160, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT. zIndex: 2, //The z-index for the destiny. Only numeric values allowed. Default: this.parent.zIndex || CB_GraphicSprites.ZINDEX_DEFAULT. data: { rotation: 0, rotationX: undefined, rotationY: undefined, rotationUseDegrees: true, duration: 1000, timeResetAndEnableAfter: 250, clearPreviousFirst: true, opacity: 0.2, beforeDrawing: function(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element. { element.data.rotation++; return element; //Same as 'element'. Must return the element to draw. Return null to skip drawing it. } }, //Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used: sprites: [ //'ranisima_sprites_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "ranisima_sprites_sprite_1" //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically. } ] }, //'text_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "text_group", srcType: CB_GraphicSprites.SRC_TYPES.TEXT, zIndex: 3, data: { skipAfter: 2000, clearPreviousFirst: true }, sprites: [ //'text_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "text_1", src: "Hello, CrossBrowdy!", left: 100, top: 24, data: { fontSize: "26px", fontFamily: "courier", style: "#ffff00", fontStyle: "normal", fontVariant: "normal", fontWeight: "bold", caption: null, smallCaption: null, icon: null, menu: null, messageBox: null, statusBar: null } }, //'text_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "text_2", src: "Stroke text", left: 100, top: 60, data: { fontSize: "48px", fontFamily: "arial", style: "#ff0000", stroke: true, fontStyle: "italic", fontVariant: "small-caps", fontWeight: "lighter", caption: null, smallCaption: null, icon: null, menu: null, messageBox: null, statusBar: null } } ] }, //'fps_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "fps_group", srcType: CB_GraphicSprites.SRC_TYPES.TEXT, zIndex: 3, sprites: [ //'fps' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "fps", src: "FPS: Calculating...", left: 110, top: 0, data: { fontSize: "26px", fontFamily: "courier", style: "#aa00dd", fontStyle: "normal", fontVariant: "normal", fontWeight: "bold", caption: null, smallCaption: null, icon: null, menu: null, messageBox: null, statusBar: null } } ] }, //'pixel_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "pixel_group", srcType: CB_GraphicSprites.SRC_TYPES.PIXEL, sprites: [ //'pixel_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "pixel_1", left: 85, top: 25, data: { style: "#ff00ff" }, subSprites: [ { id: "pixel_1_subsprite_1", top: 2 }, { id: "pixel_1_subsprite_2", top: 4 }, { id: "pixel_1_subsprite_3", top: 6 }, { id: "pixel_1_subsprite_4", top: 8 } ] } ] }, //'rectangle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "rectangle_group", srcType: CB_GraphicSprites.SRC_TYPES.RECTANGLE, sprites: [ //'rectangle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "rectangle_1", left: 400, top: 170, width: 60, height: 60, data: { style: "#00aa00" }, subSprites: [ { id: "rectangle_1_subsprite_1", left: 70, data: { style: function(element, canvasContext, canvasBufferContext, userBuffer) { var gradient = canvasContext.createLinearGradient(element.left, element.top, element.left + element.width, element.top + element.height); gradient.addColorStop(0, "#aa0000"); gradient.addColorStop(1, "#aaaa00"); return gradient; } } }, { id: "rectangle_1_subsprite_2", left: 140, data: { stroke: true, style: function(element, canvasContext, canvasBufferContext, userBuffer) { var gradient = canvasContext.createLinearGradient(element.left, element.top, element.left + element.width, element.top + element.height); gradient.addColorStop(0, "#00aa00"); gradient.addColorStop(1, "#00ffaa"); return gradient; } } }, { id: "rectangle_1_subsprite_3", left: 210, data: { filter: "sepia(1)", //Adds the desired filter. style: function(element, canvasContext, canvasBufferContext, userBuffer) { var src = "img/seta.gif"; var image = CB_REM._IMAGES_CACHE[src]; if (!image) { image = new Image() image.src = src; } return canvasContext.createPattern(image, 'repeat'); } } } ] } ] }, //'circle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "circle_group", srcType: CB_GraphicSprites.SRC_TYPES.CIRCLE, data: { radius: 30, style: "#00aa00", opacity: 0.5 }, sprites: [ //'circle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "circle_1", left: 35, top: 120, subSprites: [ { id: "circle_1_subsprite_1", top: 70, data: { style: function(element, canvasContext, canvasBufferContext, userBuffer) { var gradient = canvasContext.createRadialGradient(element.left, element.top, 10, element.left + 10, element.top + 10, 80); gradient.addColorStop(0, "red"); gradient.addColorStop(0.5, "black"); return gradient; } } }, { id: "circle_1_subsprite_2", top: 140, data: { style: "#aa0000", stroke: true } } ] } ] }, //'arc_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "arc_group", srcType: CB_GraphicSprites.SRC_TYPES.ARC, data: { radius: 10, startAngle: 2, endAngle: 11, style: "#00aa00" }, sprites: [ //'arc_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "arc_1", left: 80, top: 150, subSprites: [ { id: "arc_1_subsprite_1", top: 30 }, { id: "arc_1_subsprite_2", top: 60, data: { style: "#aa0000", stroke: true } } ] } ] }, //'ellipse_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "ellipse_group", srcType: CB_GraphicSprites.SRC_TYPES.ELLIPSE, data: { radiusX: 3, radiusY: 8, ellipseRotation: 20, startAngle: 2, endAngle: 11, anticlockwise: false, style: "#00aa00" }, sprites: [ //'ellipse_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "ellipse_1", left: 350, top: 100, subSprites: [ { id: "ellipse_1_subsprite_1", top: 20 }, { id: "ellipse_1_subsprite_2", top: 40, data: { style: "#aa0000", stroke: true } } ] } ] }, //'triangle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "triangle_group", srcType: CB_GraphicSprites.SRC_TYPES.TRIANGLE, data: { x1: 3, y1: 8, x2: 20, y2: 2, style: "#00aa00" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top. sprites: [ //'triangle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "triangle_1", left: 370, top: 190, subSprites: [ { id: "triangle_1_subsprite_1", top: 20 }, { id: "triangle_1_subsprite_2", top: 40, data: { style: "#aa0000", stroke: true } } ] } ] }, //'segment_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "segment_group", srcType: CB_GraphicSprites.SRC_TYPES.SEGMENT, width: 10, data: { x1: 3, y1: 8, x2: 200, y2: 20, style: "#00aa00" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top. sprites: [ //'segment_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "segment_1", left: 370, top: 250, subSprites: [ { id: "segment_1_subsprite_1", top: 20 }, { id: "segment_1_subsprite_2", top: 40, data: { style: "#aa0000" } } ] } ] }, //'bezier_curve_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "bezier_curve_group", srcType: CB_GraphicSprites.SRC_TYPES.BEZIER_CURVE, width: 5, data: { x1: 0, y1: 50, x2: 220, y2: 20, x3: 100, y3: 10, style: "#00aa00" }, //The (x1, y1), (x2, y2) and (x3, y3) points are relative to the element left and top. sprites: [ //'bezier_curve_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bezier_curve_1", left: 0, top: 280, subSprites: [ { id: "bezier_curve_1_subsprite_1", top: 30 }, { id: "bezier_curve_1_subsprite_2", top: 60, data: { style: "#aa0000" } } ] } ] }, //'quadratic_bezier_curve_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "quadratic_bezier_curve_group", srcType: CB_GraphicSprites.SRC_TYPES.QUADRATIC_BEZIER_CURVE, width: 2, data: { x1: 0, y1: 50, x2: 220, y2: 20, style: "#00aa00" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top. sprites: [ //'quadratic_bezier_curve_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "quadratic_bezier_curve_1", left: 150, top: 250, subSprites: [ { id: "quadratic_bezier_curve_1_subsprite_1", top: 30 }, { id: "quadratic_bezier_curve_1_subsprite_2", top: 60, data: { style: "#aa0000" } } ] } ] }, //'bitmap_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "bitmap_group", srcType: CB_GraphicSprites.SRC_TYPES.BITMAP, top: 340, left: 300, width: 10, //It will be updated when calling 'beforeDrawingElement'. height: 10, //It will be updated when calling 'beforeDrawingElement'. data: { beforeDrawingElement: function(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element. The 'element' and 'mapElement' will be the same. { this.width = 30; this.height = 20; return this; //Same as 'element'. Must return the element to draw. Return null to skip drawing it. } }, sprites: [ //Maps with string aliases: //'bitmap_current' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "bitmap_current", //Current map which will be displayed (it will be modified according to the position of the player and the other elements). src: [ [ true, true, true, true, true ], [ true, false, true, false, true ], [ true, false, true, false, true ] ] } ] }, //'map_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object): { id: "map_group", src: //Map with string aliases: [ [ "#", "$", "@", "#", "", "@", "", "|", "!" ], [ 3, "%", "#", "@", "#", "@", "!", "", 1 ] ], srcType: CB_GraphicSprites.SRC_TYPES.MAP, left: 20, top: 400, width: 20, height: 20, data: { //References sprites or sub-sprites by their index or identifier. Define a "parentId" (parent identifier of the 'CB_GraphicSprites' object or of the 'CB_GraphicSprites.SPRITE_OBJECT' object) to improve performance. elementsData: { //Each property name is an alias which can be used in the map (in the "src" property). "1" : { index: 1, leftDependsOnPreviousElement: true, topDependsOnPreviousElement: true, parentId: "circle_1" }, //Has in mind the position of the last element to calculate its left and top. "3" : { index: 3, leftDependsOnPreviousElement: true, topDependsOnUpperElement: true, parentId: "bird_sprites" }, //Has in mind the position of the last element to calculate its left but to calculate its top has in mind the element above. "|": { id: "bird_sprites", leftDependsOnPreviousElement: true, //Has in mind the left position of the last element to calculate its left. topDependsOnPreviousElement: true //Has in mind the top position of the last element to calculate its top. }, "@": { id: "panda_sprites_sprite_1" }, "#": { id: "panda_sprites_sprite_2" }, "$": //If defined left and/or top, the position will always be that one (fixed). { id: "bird_sprite_2_subsprite_1", width: 120, height: 50, left: function(alias, element, elementData, elementMapParent, elementLoopLeftNext, x, y) { return 500; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. top: 0, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. //Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered: renewCache: true }, "%": { id: "bird_sprite_1", //Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered: renewCache: true, destroyOnRewnew: true //Destroys the previous stored element before renewing the internal cache. }, "!": { id: "bird_sprite_1_subsprite_2", width: function(alias, element, elementData, elementMapParent, elementLoopWidthDefault, x, y) { return 50; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. height: 80, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. leftDependsOnPreviousElement: true, //Has in mind the left position of the last element to calculate its left. topDependsOnPreviousElement: true, //Has in mind the top position of the last element to calculate its top. //Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered: renewCache: true } }, elementsWidth: 40, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. elementsHeight: function(alias, element, elementData, elementMapParent, elementLoopHeightDefault, x, y) { return 50; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. /* Note: The "elementsLeft" and "elementsTop" properties can also be defined and can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop. Uncomment them try: */ //elementsLeft: function(alias, element, elementData, elementMapParent, elementLoopLeftNext, x, y) { return 200; }, //elementsTop: 20, skipAfter: 5000 }, sprites: [ //'map_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "map_1" }, //'map_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "map_2", src: [ [ "", "%", "@", "#", "@", "#", "!" ], [ "$", "@", "#", "@", "|", "" ] ] }, //'map_3' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "map_3", left: 120, top: 100 }, //'map_4' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group: { id: "map_4", left: 120, top: 100, src: [ [ "", "%", "@", "#", "@", "#", "!" ], [ "$", "@", "#", "@", "|", "" ] ] } ] } ] }; //Creates the graphic sprites object: return new CB_GraphicSpritesScene(spritesGroupsData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "group(...sprites) {\n let container = new this.Container();\n sprites.forEach(sprite => {\n container.addChild(sprite);\n });\n return container;\n }", "defineGroups(){\n //creating invisible walls\n //don't forget to make these, ya know, actually invisible\n this.invisible...
[ "0.7431676", "0.71432704", "0.70899177", "0.67510474", "0.66869855", "0.6623713", "0.65672684", "0.63094056", "0.63021356", "0.62748915", "0.62720567", "0.6195247", "0.6189155", "0.6186244", "0.6172514", "0.61686933", "0.6164667", "0.6128131", "0.6123609", "0.61069924", "0.60...
0.84762454
0
Adds the sub gallery to the page and populates it
async function AddSubGallery() { var SubGallerySection = document.createElement("div"); SubGallerySection.setAttribute("id", "sub_gallery"); var Gallery_Header = document.createElement("div"); Gallery_Header.setAttribute("id", "gallery_header"); var GalleryHeaderText = document.createElement("span"); GalleryHeaderText.setAttribute("id", "title_subs"); GalleryHeaderText.innerHTML = "Subscriptions"; //Append the header and header text to the gallery Gallery_Header.appendChild(GalleryHeaderText); SubGallerySection.appendChild(Gallery_Header); var Gallery_Body = document.createElement("div"); Gallery_Body.setAttribute("id", "gallery_body"); SubGallerySection.appendChild(Gallery_Body); //Wait for all subs have been added to the gallery //TODO: Set a timeout to ~1s or something, to prevent infinitely trying add the sub gallery // The timeout can be implemented by racing 2 promises (a setTimeout vs the wanted functionality) // https://italonascimento.github.io/applying-a-timeout-to-your-promises/ let r = await MakeSubGallery(Gallery_Body).catch((error) => { alert(error); }); //Then add the gallery to the page primaryArea.appendChild(SubGallerySection); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupGallery() {\n\t\t if($(\".photogallery\").length) {\n\t\t\tvar globaltitle = $(\".photogallery h2\").text();\n\t\t\t$(\".photogallery h2\").css(\"display\", \"none\");\n\t\t\t$('.photogallery ul').wrap(\"<div class=\\\"scroller\\\"/>\");\n\t\t\t$('.photogallery img').attr(\"width\", \"106\");\n\t\t\...
[ "0.68302476", "0.65773296", "0.6453437", "0.6437196", "0.6399625", "0.63163126", "0.62797135", "0.6272924", "0.6259257", "0.6169252", "0.61688775", "0.6164419", "0.61253667", "0.6116688", "0.6099463", "0.6036562", "0.60344017", "0.6031933", "0.6019306", "0.60041046", "0.59522...
0.70198363
0
Ajout des logos SVG.
function createSVG(where, className) { var svg = "<svg class=\"" + className + "\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\"><path class=\"ldp-icon-color\" d=\"M3.352,48.296l28.56-28.328l28.58,28.347c0.397,0.394,0.917,0.59,1.436,0.59c0.52,0,1.04-0.196,1.436-0.59 c0.793-0.787,0.793-2.062,0-2.849l-29.98-29.735c-0.2-0.2-0.494-0.375-0.757-0.475c-0.75-0.282-1.597-0.107-2.166,0.456 L0.479,45.447c-0.793,0.787-0.793,2.062,0,2.849C1.273,49.082,2.558,49.082,3.352,48.296z\"></svg>"; // Insère directement dans l'HTML la variable ci-dessus. where.insertAdjacentHTML("afterbegin", svg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostra_home(){\n\tvar a = \"<svg height = '3.125em' width = 'auto'>\"+\n\t\"<text x='0' y='1.0em' font-size = '2.5em' fill='blue'>Home del sito</text>\" +\n\t \"</svg>\"+\n\"<h3>Informazioni</h3>\"+\n\"<p>Sul nostro sito puoi effettuare le seguenti operazioni:\"+\n\"-Versamento di somme di senaro\"+\n\...
[ "0.6382193", "0.620573", "0.6199003", "0.60123366", "0.6010524", "0.5950502", "0.59124583", "0.59076923", "0.5895215", "0.58555305", "0.57687503", "0.5733721", "0.5699193", "0.5681278", "0.5652285", "0.5629113", "0.56253165", "0.56233585", "0.5622724", "0.5611103", "0.5594232...
0.6220469
1
To append the datas which user targets on current operand
static appendc(data) { // To ensure that user does'nt input multiple decimal points if (curr_o.includes(".") && data === ".") return; // To ensure that user does'nt input any operators at the begining if (curr_o === "" && operators.includes(data)) return; // Convert to proper decimal '0.' if user starts with decimal accidentally if (curr_o.indexOf(".") === 0) { curr_o = "0."; } curr_o += data; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushOp( node, btc,target) {\n var reg1 = uniquegen()\n expnode(node.operand1, reg1, btc)\n var reg2 = uniquegen()\n expnode(node.operand2, reg2, btc)\n btc.push({\"type\":node.type,\"operand1\":reg1,\"operand2\":reg2,\"target\":target})\n }", "function addTargetsToLineItem(){...
[ "0.59933394", "0.54315037", "0.5428083", "0.54070413", "0.5333663", "0.52508116", "0.5235776", "0.5218469", "0.5158101", "0.51533484", "0.5138131", "0.51328987", "0.51048094", "0.51021886", "0.5094715", "0.50831187", "0.50570714", "0.50561976", "0.5053642", "0.5045771", "0.50...
0.0
-1
To append the datas which user targets on previous operand
static appendp(data) { // To ensure that user does'nt input multiple decimal points if (prev_o.includes(".") && data === ".") return; // To ensure that user does'nt input any further operators when there is one if (operators.includes(prev_o[prev_o.length - 1])) { if (operators.includes(data)) return; } prev_o += data; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushOp( node, btc,target) {\n var reg1 = uniquegen()\n expnode(node.operand1, reg1, btc)\n var reg2 = uniquegen()\n expnode(node.operand2, reg2, btc)\n btc.push({\"type\":node.type,\"operand1\":reg1,\"operand2\":reg2,\"target\":target})\n }", "function addOper(someOper) {\r\r...
[ "0.5753061", "0.5468519", "0.5438667", "0.5438431", "0.5436923", "0.5434635", "0.53866976", "0.5374656", "0.5373852", "0.53490996", "0.5337552", "0.5325287", "0.53213465", "0.531767", "0.5314726", "0.53021276", "0.529382", "0.5292804", "0.5255077", "0.5247281", "0.5245845", ...
0.5555597
1
To display the datas on the current screen
static dispcurr(data) { current.innerText = data; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayToScreen() {\n\n\n\t}", "function display() {\n lcd.clear();\n lcd.cursor(0, 0).print(displayDate());\n lcd.cursor(1, 0).print(displayMeasure());\n }", "renderScreenContent(){}", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(l...
[ "0.72951066", "0.69376045", "0.6763091", "0.6742459", "0.6726904", "0.65684867", "0.6566253", "0.65434", "0.646144", "0.64559853", "0.64172024", "0.64154035", "0.64042187", "0.63075227", "0.6293393", "0.62826455", "0.6269951", "0.62629807", "0.62561005", "0.6244766", "0.62342...
0.0
-1
To display the datas on the previous screen
static dispprev(data) { previous.innerText = data; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onProductDetailsBack(){\n hideDownArrow();\n ProductDetailsScreen.LblTotalReviews.text = \"\";\n reviewarr = [];\n ProductDetailsScreen.SegmentReview.setData(reviewarr);\n reviewsMoveDown();\n ProductListScreen.show();\n}", "back()\n{\n this.selectedDate='';\n this.selectedSlot='';\n this...
[ "0.66777146", "0.66404724", "0.6378126", "0.63713676", "0.6370584", "0.6362762", "0.63521254", "0.6326518", "0.6323591", "0.6299277", "0.6235751", "0.62192", "0.61922556", "0.61868465", "0.61750406", "0.61692476", "0.6147598", "0.61275655", "0.6127148", "0.6109295", "0.608941...
0.5794649
67
To restore all datas and output on the screens to their original values
static clear() { curr_o = ""; prev_o = ""; oppr = ""; res = 0; check = 0; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset(){\n clearCanvas();\n outputPad.fromData([]);\n }", "restoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}", "function restoreDefault(){\n restoreDefaultScores();\n lizardLizard();...
[ "0.67376155", "0.6591362", "0.65084296", "0.63358605", "0.62794125", "0.6271271", "0.62353593", "0.6158511", "0.60702324", "0.6069507", "0.603432", "0.60128284", "0.60108113", "0.60071677", "0.5997313", "0.59836876", "0.5953426", "0.5945969", "0.59354866", "0.5929513", "0.589...
0.0
-1
To pop the last character out from either screens
static delete() { // Ensuring that the current screen is NOT empty if (curr_o !== "") { // By chance if the last character is an operator, oppr is assigned none if (operators.includes(curr_o[curr_o.length - 1])) { oppr = ""; } curr_o = curr_o.substr(0, curr_o.length - 1); Calc.dispcurr(curr_o); } // Pop the last character from previous screen if the current screen is empty else { // By chance if the last character is an operator if (operators.includes(prev_o[prev_o.length - 1])) { oppr = ""; } prev_o = prev_o.substr(0, prev_o.length - 1); Calc.dispprev(prev_o); } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function back(){\n const x = document.getElementById('screen').value.slice(0,-1);\n document.getElementById('screen').value = x;\n}", "function endScreen() {\n push();\n textSize(30);\n fill(255, 0, 0);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You lost!`, width / 2, heigh...
[ "0.64838797", "0.6233625", "0.6125296", "0.6124654", "0.610153", "0.6020568", "0.6008827", "0.5905893", "0.5893261", "0.5810154", "0.57862633", "0.57749254", "0.57467604", "0.5738636", "0.57350886", "0.5732955", "0.5726936", "0.57004523", "0.5688792", "0.5676933", "0.5663937"...
0.5970382
7
To perform any arithmetic operations on both operands Arguments: a & b => both operands : data => any operator : n => new operator (if any) : f => depends on e.target("result" or "operation") within which it is called. : "result" will pass '1'; otherwise none, since default value = 0;
static operation(a, b, data, n, f = "0") { // Ensures that the current screen is NOT empty if (curr_o != "") { // Performs the operation through switch function switch (data) { case "+": res = b + a; check = 1; break; case "x": res = b * a; check = 1; break; case "/": res = b / a; check = 1; break; case "-": res = b - a; check = 1; break; case "%": res = (b * a) / 100; check = 1; break; case "^": res = Math.pow(b, a); check = 1; } } // If this function was called from "result" target, display the final result on the current screen if (f === "1") { prev_o = res.toString(); curr_o = prev_o; prev_o = ""; Calc.dispprev(prev_o); Calc.dispcurr(curr_o); } // If not then retain the current result on the previous screen followed by any new operator else { // Ensures that some operation is performed successfully if (check === 1) { prev_o = res.toString(); check = 0; } // Calls this function to append the new operator on previous screen Calc.appendp(n); Calc.dispprev(prev_o); // Makes the current screen empty curr_o = ""; Calc.dispcurr(curr_o); // Asigns the value of oppr to none oppr = ""; } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function operate(operator, a, b) {\n a = Number(a);\n b = Number(b);\n switch (operator) {\n case \"+\":\n return add(a, b);\n case \"-\":\n return subtract(a, b);\n case \"*\":\n return mult(a, b);\n case \"÷\":\n if (b === 0) return...
[ "0.7363224", "0.7347489", "0.72949564", "0.7289821", "0.72420293", "0.7233502", "0.72312033", "0.7179186", "0.7168168", "0.7165991", "0.7155161", "0.7138982", "0.71343684", "0.7123653", "0.7105101", "0.70822686", "0.7078338", "0.7069497", "0.70669675", "0.7044465", "0.7040862...
0.72916645
3
calculates the quad key for a given point. The point is not(!) in lat/lng format.
function pointToQuadKey(x, y, zoom) { return zoom + "_" + x + "_" + y;; // var quadkey = []; // for(var c = zoom; c > 0; c--) { // // +-------+ quadrants are probably ordered like this // // | 0 | 1 | // // |---|---| // // | 2 | 3 | // // |---|---| // var quadrant = 0; // var e = 1 << c - 1; // (x & e) != 0 && quadrant++; // push right // (y & e) != 0 && (quadrant++, quadrant++); // push down // quadkey.push(quadrant); // } // return quadkey.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointToKey(x, y) {\n return `${x},${y}`;\n}", "function tileXYToQuadKey( tx,ty,zoom )\n {\n var quadKey = '';\n for ( var i = zoom; i > 0; i-- )\n {\n var digit = 0;\n var mask = 1 << ( i - 1 );\n if( ( tx & mask ) != 0 )\n {\n ...
[ "0.5835798", "0.57781154", "0.57781154", "0.56111366", "0.55796146", "0.5552593", "0.5474579", "0.54660785", "0.52860177", "0.52860177", "0.5278514", "0.51965135", "0.51932204", "0.51521134", "0.51271904", "0.5105125", "0.50668883", "0.5062905", "0.50373286", "0.5035259", "0....
0.76186514
0
given quadkey and bounds, returns the format as required by the Ingress API to request map data.
function generateBoundsParams(quadkey, bounds) { return { id: quadkey, qk: quadkey, minLatE6: Math.round(bounds.sw.lat * 1E6), minLngE6: Math.round(bounds.sw.lng * 1E6), maxLatE6: Math.round(bounds.ne.lat * 1E6), maxLngE6: Math.round(bounds.ne.lng * 1E6) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeBounds(bounds) {\n\tconst southwest = bounds.southwest;\n\tconst northeast = bounds.northeast;\n\treturn `${encodeURIComponent(southwest.lat)},${encodeURIComponent(southwest.lng)}|${encodeURIComponent(northeast.lat)},${encodeURIComponent(northeast.lng)}`;\n}", "function serializeBounds (bounds) {\...
[ "0.6350161", "0.6110648", "0.571756", "0.5590648", "0.5467104", "0.5467104", "0.5390251", "0.5374224", "0.5359655", "0.5318514", "0.5254317", "0.52510005", "0.5219175", "0.51373595", "0.5121585", "0.511986", "0.5104239", "0.50820076", "0.5062027", "0.5062027", "0.5045888", ...
0.7414753
0
UI Helper functions / Given the result of a GET against a namespace, this function displays any child namespaces and tags. path: the path of the namespace that is currently being displayed data: the results from FluidDB containing the contents of the namespace context: the Sammy context
function update_tags(path, data, context){ var obj = JSON.parse(data); // empty the helpful text message element $('#tag_content').empty(); // Populate some of the items $('textarea#namespace_description_textarea').val(obj.description); $('#namespace_description').html(obj.description); $('#path').html(path); $('#namespace_path').html(path); // cache the two jQuery objects $namespace_list = $('#namespace_list'); $tag_list = $('#tag_list'); // add namespace $.each(obj.namespaceNames, function(n, namespace) { var item = { "name": namespace, "path": path}; context.partial('templates/namespace.template', { item: item}, function(rendered) { $namespace_list.append(rendered)}); }); // add tags $.each(obj.tagNames, function(t, tag) { var item = { "name": tag, "path": path}; context.partial('templates/tag.template', { item: item}, function(rendered) { $tag_list.append(rendered)}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "viewNestedArea (baseUrl,username,spacename,area,child,query){\n browser.get(baseUrl + username + \"/\" + spacename +\"/areas/\" + area + \"/\" + child + \"/q=\" +query);\n }", "function getDirContent(path) {\n\t\tshowLoading();\n\t\tcontext_element = {};\n\t\tpath = HTMLDecode(path || cur_path);\n\t\tsendXMLHt...
[ "0.5499581", "0.54704106", "0.5433094", "0.5021069", "0.50201297", "0.49823117", "0.49371448", "0.48635447", "0.48339528", "0.48253956", "0.4808618", "0.48020738", "0.48020738", "0.47845978", "0.47799504", "0.47679135", "0.47676986", "0.47321117", "0.4727076", "0.47170094", "...
0.57480055
0
Displays the results of a search of FluidDB
function search_results(data, context){ var obj = JSON.parse(data); // cache the jQuery object var $search_results = $('#search_results'); // empty the element $search_results.empty(); // add the results $search_results.append('<h2>Results</h2><p>Objects with the following ids match your query:</p><ul>'); if (obj.ids.length>0) { $.each(obj.ids, function(o, object_id) { context.partial('templates/result.template', { obj: object_id}, function(rendered) { $search_results.append(rendered)}); }); } else { $search_results.append('<li>None found. Please try again...</li>'); } $search_results.append('</ul>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not ...
[ "0.7220859", "0.717913", "0.69690764", "0.6891735", "0.6891278", "0.6820409", "0.67163646", "0.6665844", "0.665335", "0.66240984", "0.65953904", "0.6540478", "0.65337664", "0.65191954", "0.65070724", "0.65012985", "0.6496936", "0.64881307", "0.64848953", "0.6466934", "0.64570...
0.63568443
29
This file is automatically included by javascript_include_tag :defaults
function selectPeople(select) { if (select.options[select.selectedIndex].value == "") { // The prompt option has no value and thus can't be added. return; } var option = select.options[select.selectedIndex]; var ul = document.getElementById('people-list'); var choices = ul.getElementsByTagName('input'); for (var i = 0; i < choices.length; i++) if (choices[i].value == option.value) return; var image = document.createElement('img'); image.setAttribute('src', '/images/cancel.png'); var li = document.createElement('li'); var input = document.createElement('input'); var text = document.createTextNode(option.firstChild.data); input.type = 'hidden'; input.name = 'people[]'; input.value = option.value; li.appendChild(input); li.appendChild(image); li.appendChild(text); li.setAttribute('onclick', 'this.parentNode.removeChild(this);'); ul.appendChild(li); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsOnLoad(){\n\n}", "function setJs() {\n\t\t\tvar body = document.getElementsByTagName(\"body\")[0];\n\t\t\taddClass(body,'js');\n\t\t}", "function PaginaInicial_elementsExtraJS() {\n // screen (PaginaInicial) extra code\n\n }", "function Introducao_elementsExtraJS() {\n // screen (...
[ "0.58667916", "0.5809452", "0.5691467", "0.55791026", "0.54832417", "0.5441119", "0.5424961", "0.5365284", "0.53516793", "0.5348419", "0.5323757", "0.5307114", "0.530026", "0.5284755", "0.5272971", "0.5245144", "0.5240868", "0.5212524", "0.52064997", "0.5201398", "0.51995724"...
0.0
-1
This material is proprietary to Lawson Software, and is not to be reproduced or disclosed except in accordance with software contract provisions, or upon written authorization from Lawson Software. Copyright (C) 20012007 by Lawson Software. All Rights Reserved. Saint Paul, Minnesota Description: This function determines if a white or black font color should be used with the corresponding background color. Arguments: The Background color in hex triplets ex. 'c0c0c0'
function fontBright(thecolor) { var drd = 0 var dgr = 0 var dbl = 0 var brightness = 0 // hrd = thecolor.substring(0,2) // hgr = thecolor.substring(2,4) // hbl = thecolor.substring(4,6) drd = parseInt(thecolor.substring(0,2),16) dgr = parseInt(thecolor.substring(2,4),16) dbl = parseInt(thecolor.substring(4,6),16) brightness = eval(0.212671 * drd + 0.715160 * dgr + 0.072169 * dbl) if (brightness >= 128) return '000000' else return 'FFFFFF' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidColor(text) {\n return hexColorRegEx.test(text);\n}", "function bgColorToTextColor(bg) {\n if ((parseInt(bg.substring(0,2), 16) + parseInt(bg.substring(2,4), 16) + parseInt(bg.substring(4,6), 16)) < 128 * 3) {\n return 'ffffff';\n } else {\n return '000000';\n }\n}", "fu...
[ "0.6609497", "0.64297247", "0.64067775", "0.6096098", "0.60119206", "0.595266", "0.5937559", "0.58918947", "0.58866966", "0.58602107", "0.5845899", "0.5838103", "0.58225995", "0.5806666", "0.576732", "0.57668984", "0.57601666", "0.5739534", "0.57319903", "0.5712443", "0.57113...
0.54944146
38
Updates data after asynchronous data load
componentWillReceiveProps(nextProps) { this.setState(nextProps); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "function updateData() \n{\n\tObject.keys(raidApp.selectedLocations).forEach((key) => \n\t{\n\t\tconst raid = raidApp.selectedLocations[key];\n\t\tconst card = getRaidCard(raid);\n\t\t// CODELAB: Add code to call getForecastFromCache\n\n\t\t// Get th...
[ "0.81581765", "0.7244727", "0.71804595", "0.69931304", "0.699033", "0.6860745", "0.6850716", "0.67512196", "0.67452353", "0.6678395", "0.6640566", "0.66004074", "0.65766424", "0.65616494", "0.655694", "0.6555777", "0.65052265", "0.6495275", "0.6421862", "0.64195395", "0.64179...
0.0
-1
colors assinged by quartiles
function colors() { map.getLayer('countylayer').style('fill', function(data) { var ddi = parseFloat(data.ddi); if (ddi <= 38.12357875) { //1st quartile return "#fef0d9"; } else if (ddi <= 50.8602104) { return "#fdcc8a"; } else if (ddi <= 64.03133336 ) { return "#fc8d59"; } else { //4th quartile return "#d7301f"; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quakeColor(mag) {\n if (mag > 5) {\n return 'red'\n }\n else if (mag > 4) {\n return '#d5995d'\n }\n else if (mag > 3) {\n return 'darkorange'\n }\n else if (mag > 2) {\n return 'greenyellow'\n }\n else {\n return '#99ff33'\n }\n}", "function Qcolor(magnitude) {\n if (magnitu...
[ "0.6680838", "0.66190636", "0.64805543", "0.6340362", "0.6220522", "0.61402154", "0.60816324", "0.60437167", "0.601559", "0.6007904", "0.59848905", "0.5972039", "0.59578395", "0.5955354", "0.5952719", "0.5950934", "0.5935897", "0.5934338", "0.5905693", "0.58892167", "0.588912...
0.6826832
0