conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add missing jshint override and always use string `displayValue`.\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n define(\n [\n 'lodash',\n 'knockout'\n ],\n function (_, ko) {\n retur...
javascript
chosen
[ { "from": "system", "value": "Move target in level 1\n" }, { "from": "human", "value": "const levels = [\n {\n targets: [\n [4, 3],\n [4, 10],\n ],\n },\n {\n targets: [\n [21, 3],\n [13, 7],\n ],\n },\n];\n\nexport default levels.map(level => ({\n ...level,\...
javascript
chosen
[ { "from": "system", "value": "Optimize code and use less variables\n" }, { "from": "human", "value": "var nextHighestNumber = function (number) {\n var numberString = ('' + number),\n length = numberString.length,\n currNumber, prevNumber;\n\n while (length--) {\n currNumber...
javascript
chosen
[ { "from": "system", "value": "Add UUID to the Volume Details section\n" }, { "from": "human", "value": "define(function (require) {\n\n var React = require('react/addons'),\n Backbone = require('backbone'),\n ResourceDetail = require('components/projects/common/ResourceDetail.react'),\n ...
javascript
chosen
[ { "from": "system", "value": "Fix login button on refresh\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module(\"myApp.navbar\", [\"myApp.services.authenticationHandler\"])\n\n.controller(\"NavbarController\", function($scope, authenticationHandler) {\n $scope.valid = false;\n...
javascript
chosen
[ { "from": "system", "value": "Add a second param for the protocol\n" }, { "from": "human", "value": "addEventListener('load', function () {\n if(reqUri = getRequestURIFromString(location.href))\n readWSStream(reqUri, appendToBody)\n else\n appendToBody('No URL given <br>')\n})\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Fix bug in football module caching\n" }, { "from": "human", "value": "angular.module('notificationApp.footballController', []).\ncontroller('footballController', function($scope, $interval, $timeout, footballFactory) {\n\n $scope.currentTeam = footballFactory.get...
javascript
chosen
[ { "from": "system", "value": "Move file save response into close callback.\n" }, { "from": "human", "value": "\n'use strict';\n\n// Modules\nvar fs = require('fs');\nvar get_filepath = require('../functions/get_filepath.js');\n\nfunction route_page_create (config) {\n return function ...
javascript
chosen
[ { "from": "system", "value": "Sort posts by submitted timestamp.\n\nchapter7-7\n" }, { "from": "human", "value": "Template.postsList.helpers({\n posts: function() {\n return Posts.find();\n }\n});" }, { "from": "gpt", "value": "Template.postsList.helpers({\n posts: function() {...
javascript
chosen
[ { "from": "system", "value": "Move @private to the end of the jsdoc" }, { "from": "human", "value": "/*global define*/\ndefine([], function() {\n \"use strict\";\n\n /**\n * @private\n *\n * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into\n * a dic...
javascript
chosen
[ { "from": "system", "value": "Fix ServiceWorker https protocol check\n" }, { "from": "human", "value": "(function() {\n function install(options, callback, errback) {\n callback || (callback = function() {});\n errback || (errback = function() {});\n\n <% if (ServiceWorker) { %>\n ...
javascript
chosen
[ { "from": "system", "value": "Make base directory configurable from command line\n" }, { "from": "human", "value": "var readFileSync = require(\"fs\").readFileSync;\n\nexports.defineTags = function(dictionary) {\n\tdictionary.defineTag(\"externalExample\", {\n\t\tmustHaveValue: true,\n\t\tisName...
javascript
chosen
[ { "from": "system", "value": "Move crawl options to crawl command\n" }, { "from": "human", "value": "#! /usr/bin/env node\n'use strict';\n\n(function () {\n\n var yargs = require('yargs');\n var packageJson = require('../package.json');\n var version = packageJson.version;\n\n var argv = yar...
javascript
chosen
[ { "from": "system", "value": "Trim surrounding whitespace before validating HTML with slowparse\n\nSlowparse incorrectly reports an error if the `DOCTYPE` is preceded by a\nline of whitespace.\n" }, { "from": "human", "value": "var Promise = require('es6-promise').Promise;\nvar groupBy = require...
javascript
chosen
[ { "from": "system", "value": "Fix container dot click for VM\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { isAlternate } from 'ui/utils/platform';\n\nexport default Ember.Component.extend({\n resourceActions: Ember.inject.service('resource-actions'),\n\n model: null,\...
javascript
chosen
[ { "from": "system", "value": "Update gravity dependency and add spec\n" }, { "from": "human", "value": "import DataLoader from 'dataloader';\nimport gravity from './gravity';\nimport {\n map,\n find,\n extend,\n first,\n} from 'lodash';\n\nconst savedArtworkLoader = new DataLoader(keys => {\...
javascript
chosen
[ { "from": "system", "value": "Remove very verbose importer log\n\nThis line was causing many thousands of log entries to be printed during\nevery import.\n" }, { "from": "human", "value": "const logger = require('pelias-logger').get('openaddresses');\nconst through2 = require( 'through2' );\ncon...
javascript
chosen
[ { "from": "system", "value": "Send HTTP response on TCP channels\n\nThe load testing tools don't support plain TCP.\n\nOHM-556\n" }, { "from": "human", "value": "'use strict'\n\nconst DELAY = parseInt(process.env.DELAY, 10) || 2000\n\nconst bigBuff = Buffer.alloc(2 * 1024 * 1024, 'HellWorld ')\n...
javascript
chosen
[ { "from": "system", "value": "Set preferBuiltins to silence a rollup warning.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst pathModule = require('path');\n\nconst plugins = [\n /* eslint import/no-extraneous-dependencies: [\"error\", {\"devDependencies\": true}] */\n requ...
javascript
chosen
[ { "from": "system", "value": "Work around sometimes getting invalid coordinates\n" }, { "from": "human", "value": "/**\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * ...
javascript
chosen
[ { "from": "system", "value": "Remove OpenSSL from about dialog\n\nit is implied by the Node version\n" }, { "from": "human", "value": "const electron = require('electron')\nconst app = require('electron').app\nconst dialog = electron.dialog\nconst Channel = require('./channel')\nconst path = req...
javascript
chosen
[ { "from": "system", "value": "Add correct folders to compressJS\n" }, { "from": "human", "value": "var gulp = require ('gulp'),\n\tuglify = require('gulp-uglify');;\n\ngulp.task('default', function() {\n\tconsole.log('Hello, world!');\n});\n \ngulp.task('compress', function() {\n return gulp.sr...
javascript
chosen
[ { "from": "system", "value": "Add test for ensuring non-zero return code on test failures\n" }, { "from": "human", "value": "const fs = require('fs');\nconst xsd = require('libxml-xsd');\nconst cwd = process.cwd();\nconst reporter = require('../../index');\nconst { failedCase, pendingCase, passi...
javascript
chosen
[ { "from": "system", "value": "Fix firefox Date.parse() problem with iso dates\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('stockApp')\n .factory('bitcoinData', function ($http, YAHOO_API, BITCOIN_CSV) {\n\n var bitcoinData = {\n yql: function () {\n\n var q...
javascript
chosen
[ { "from": "system", "value": "Update up to changes to QueryHandler\n" }, { "from": "human", "value": "// Handle search query states\n// Listens for changes in query string, then ensures that provided values are coherent,\n// and if all is fine emits valid query objects\n// (which are usually con...
javascript
chosen
[ { "from": "system", "value": "Handle the case of rendering Google Maps without any location.\n" }, { "from": "human", "value": "// Google Maps JavaScript API is referenced by <script> tag below in index.html\r\n// <script src=\"http://maps.google.com/maps/api/js?sensor=false\" type=\"text/javasc...
javascript
chosen
[ { "from": "system", "value": "Increase distance of traversal when key is presesd\n" }, { "from": "human", "value": "function Game(){\n this.$track = $('#racetrack');\n this.finishLine = this.$track.width() - 54;\n}\n\nfunction Player(id){\n this.player = $('.player')[id - 1];\n this.position...
javascript
chosen
[ { "from": "system", "value": "Add image fields to v2/groupRequests response\n" }, { "from": "human", "value": "import _ from 'lodash'\n\nimport { dbAdapter } from '../../../models'\nimport exceptions from '../../../support/exceptions'\n\n\nexport default class GroupsController {\n static async ...
javascript
chosen
[ { "from": "system", "value": "Handle 'sort' parametr of search endpoint\n\n" }, { "from": "human", "value": "import compose from 'koa-compose';\n\nimport { dbAdapter } from '../../../models';\nimport { serializeFeed } from '../../../serializers/v2/post';\nimport { monitored } from '../../middlew...
javascript
chosen
[ { "from": "system", "value": "Use fbjs preset in jest cache key\n" }, { "from": "human", "value": "/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this sou...
javascript
chosen
[ { "from": "system", "value": "Fix a typo in the test.\n" }, { "from": "human", "value": "var vows = require('vows'),\n assert = require('assert'),\n events = require('events'),\n load = require('./load'),\n suite = vows.describe('brushModes');\n\nfunction d3Parcoords() {\n var promi...
javascript
chosen
[ { "from": "system", "value": "Fix for inserting null locations(in case of twitter) for indexed field\n" }, { "from": "human", "value": "\"use strict\";\n\nlet mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nlet pokemonSighting = new Schema({\n source : {type: String...
javascript
chosen
[ { "from": "system", "value": "Add problem.set call in removeMember ajax callback to set store value to null (without saving) so data on page simulates Parse data\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n actions: {\n removeMember: ...
javascript
chosen
[ { "from": "system", "value": "Add scope to status node\n" }, { "from": "human", "value": "/**\n * Copyright 2015 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of t...
javascript
chosen
[ { "from": "system", "value": "Update guard to ensure enabledFeatures isArray.\n" }, { "from": "human", "value": "/**\n * Feature Flags hook.\n *\n * Site Kit by Google, Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this fi...
javascript
chosen
[ { "from": "system", "value": "Make exec play nicely with gulp\n" }, { "from": "human", "value": "'use strict';\n\nconst { exec } = require('child_process');\nconst gutil = require('gulp-util');\n\nmodule.exports = (gulp) => {\n\n /**\n * Sync the site (_site/) with the S3 bucket\n */\n gul...
javascript
chosen
[ { "from": "system", "value": "Move app name log to timestamp\n" }, { "from": "human", "value": "'use strict';\n\nconst winston = require('winston');\n\n// Setup winston default instance\nconst LOGGER_LEVEL = process.env.LOGGER_LEVEL || 'info';\nconst LOGGER_TIMESTAMP = !(process.env.LOGGER_TIMES...
javascript
chosen
[ { "from": "system", "value": "Change 'babel-core' import to '@babel/core'\n\nThe other imports refer to the 7.x major version; `gatsby-mdx` does not work unless I make this change." }, { "from": "human", "value": "const babel = require(\"babel-core\");\nconst babelReact = require(\"@babel/preset...
javascript
chosen
[ { "from": "system", "value": "Update default dev user data\n" }, { "from": "human", "value": "/**\n * This script automatically creates a default Admin user when an\n * empty database is used for the first time. You can use this\n * technique to insert data into any List you have defined.\n */\n...
javascript
chosen
[ { "from": "system", "value": "Add callback to updateStateValue function\n" }, { "from": "human", "value": "import React from 'react';\nimport curry from 'lodash/function/curry';\nimport isFunction from 'lodash/lang/isFunction';\nimport wrapDisplayName from './wrapDisplayName';\n\nexport const wi...
javascript
chosen
[ { "from": "system", "value": "Add router logger for developing\n\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { AppContainer } from 'react-hot-loader'\nimport store from './lib/redux/store'\nimport { hashHistory } from 'react-router'\nimp...
javascript
chosen
[ { "from": "system", "value": "Return a cloned model.attributes by default\n" }, { "from": "human", "value": "Minionette.ModelView = Minionette.View.extend({\n\n // Listen to the default events\n modelEvents: {\n 'change': 'render',\n 'destroy': 'remove'\n },\n\n // The ...
javascript
chosen
[ { "from": "system", "value": "Add tests for roller root command" }, { "from": "human", "value": "var slackBot = require('../slackbot/handler').slackBot;\nvar chai = require('chai');\nvar expect = chai.expect;\n\nchai.use(require('dirty-chai'));\n\ndescribe('slackbot', function () {\n var receiv...
javascript
chosen
[ { "from": "system", "value": "Update grunt file to generate coverage reports\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n allFiles: ['Gruntfile.j...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix testing race condition bug for DB Create Table\n" }, { "from": "human", "value": "/**\n * @fileoverview Database table utilities\n *\n * @author Scott Nath\n * @author Sam Richard\n *\n */\n'use strict';\n\n/*\n Create a table in the database\n\n ##...
javascript
chosen
[ { "from": "system", "value": "Add a build for a concat without minifying.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n watch: {\n js: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the deprecated \"base_path\" in Grunt\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n\tgrunt.initConfig({\n\t\ttypescript: {\n\t\t\tbase: {\n\t\t\t\tsrc: ['src/**/*.ts'],\n\t\t\t\tdest: 'bin',\n\t\t\t\toptions: {\n\t\t\t\t\tmodule: 'co...
javascript
chosen
[ { "from": "system", "value": "Fix cleaning for Node 5\n" }, { "from": "human", "value": "/*\n * grunt-google-site-verification\n * https://github.com/sbstnmsch/grunt-google-site-verification\n *\n * Copyright (c) 2016 Sebastian Misch\n * Licensed under the MIT license.\n */\n\nmodule.exports = f...
javascript
chosen
[ { "from": "system", "value": "Fix old JS runtimes support\n" }, { "from": "human", "value": "const Declaration = require('../declaration');\n\nclass Animation extends Declaration {\n\n static names = ['animation', 'animation-direction'];\n\n /**\n * Don’t add prefixes for modern values...
javascript
chosen
[ { "from": "system", "value": "Mark channel message as sent once received by app server.\n" }, { "from": "human", "value": "UserChannelLogs.allow({\n insert: function (userId, log) {\n log.status = 'sent';\n log.created = new Date();\n log.last_updated = new Date();\n var user = Mete...
javascript
chosen
[ { "from": "system", "value": "Revert \"Use Meteor.wrapAsync instead of Fibers.\"\n\nThis reverts commit b7e5328913c05a016ec760dc47431c7320af514a.\n" }, { "from": "human", "value": "// Get our NPM stuff.\nrequest = Npm.require(\"request\");\n\n// Wrap request with something that can be `Meteor.wr...
javascript
chosen
[ { "from": "system", "value": "Hide scroll indicator during video also on iOS\n\nOtherwise, when using slim player controls, it is not displayed again\non pause or when the video ends.\n" }, { "from": "human", "value": "import togglePlaying from './togglePlaying';\nimport muteBackgroundMediaOnPla...
javascript
chosen
[ { "from": "system", "value": "Simplify Context.merge - reuse Context.etend\n" }, { "from": "human", "value": "var _ = require('underscore');\n\nfunction Context(fields) {\n this.fields = _.clone(fields);\n}\n\n/**\n * @param {Object} fields\n * @returns {Context}\n */\nContext.prototype.extend ...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where reported threads had incomplete urls\n" }, { "from": "human", "value": "'use strict';\nconst r = require('../services/reddit');\nlet reportedItemNames = new Set();\nlet hasFinishedFirstRun = false;\n\nconst SUBREDDITS = ['pokemontrades', 'SVExchan...
javascript
chosen
[ { "from": "system", "value": "Fix export of RGBLED command object\n" }, { "from": "human", "value": "var commandAndEvents = require('./command-and-events'),\n actions = require('../static/actions/rgb-led.json'),\n system = commandAndEvents.create(actions);\n\nmodule.expo...
javascript
chosen
[ { "from": "system", "value": "Update case of vars to match steam API\n" }, { "from": "human", "value": "\"use strict\";\n\nvar redis = require('redis');\n\nclass redisWrapper {\n\tconstructor(options, readyCallback) {\n\t\tthis.conString = options.connectionString;\n\t\tthis.redis = redis.create...
javascript
chosen
[ { "from": "system", "value": "Fix responsive shit for the carousel\n" }, { "from": "human", "value": "// NOVA JavaScript\n// Author: shadowfacts\n$(document).ready(function() {\n\t$(\".nova-use-id\").each(function (i) {\n\t\t$(this).text(i + 1);\n\t})\n\n\t$('.nova-slider').slick({\n\t\tcenterMo...
javascript
chosen
[ { "from": "system", "value": "Expand selected mutation's row on load\n" }, { "from": "human", "value": "var MutationTable = function ()\n{\n var element\n\n function detailFormatter(index, row, element)\n {\n var impact = row[4]\n var affected_sites_count = row[5]\n ...
javascript
chosen
[ { "from": "system", "value": "Fix indentation of JS file\n" }, { "from": "human", "value": "(function (window) {\n\n 'use strict';\n\n var $ = window.jQuery;\n var Modernizr = window.Modernizr;\n var moment = window.moment;\n\n function renderMoment() {\n $('.moment').text(...
javascript
chosen
[ { "from": "system", "value": "Use object instead of string\n" }, { "from": "human", "value": "const h = require('virtual-dom/h');\n\nmodule.exports = function (data) {\n return h('div', {className: 'new-player'}, [\n h('form', {method: 'post', action: '/new-player/' + data}, [\n h('labe...
javascript
chosen
[ { "from": "system", "value": "add: Test unmount and data events\n" }, { "from": "human", "value": "import expect from 'expect'\nimport React from 'react'\nimport {render, unmountComponentAtNode} from 'react-dom'\n\nimport Zeitline from 'src/'\n\ndescribe('Zeitline', () => {\n let node\n\n befo...
javascript
chosen
[ { "from": "system", "value": "Update Current user dialog to access sub\n" }, { "from": "human", "value": "import Service, { inject as service } from '@ember/service';\nimport { isEmpty } from '@ember/utils';\nimport RSVP from 'rsvp';\n\nexport default Service.extend({\n session: service('sessio...
javascript
chosen
[ { "from": "system", "value": "Add semi-colon at end of return statement" }, { "from": "human", "value": "import * as React from \"react\";\n\n/**\n * Container Component for BuildSnapshots.\n * \n * @param {*} props input property containing an array of build data to be\n * rendered through Buil...
javascript
chosen
[ { "from": "system", "value": "Switch to more visible touchablehighlight\n" }, { "from": "human", "value": "import React, {\n Component,\n PropTypes,\n} from 'react';\nimport {\n Button,\n View,\n Text,\n} from 'react-native';\n\nimport { add1Action } from './actions';\nimport styles from '....
javascript
chosen
[ { "from": "system", "value": "Remove unused export of BookmarkletController\n\n" }, { "from": "human", "value": "/* eslint babel/semi: \"error\" */\nexport AttachmentsController from './controllers/api/v1/AttachmentsController';\nexport BookmarkletController from './controllers/api/v1/Bookmarkle...
javascript
chosen
[ { "from": "system", "value": "Use map fnct v any helper fncts instead of any loops\n" }, { "from": "human", "value": "import React from 'react';\nimport VideoListItem from './video_list_item';\n\nconst VideoList = (props) => {\n const videoItems = props.videos.map((video) => {\n return...
javascript
chosen
[ { "from": "system", "value": "Change let to const in \"Extract EXIF\"\n" }, { "from": "human", "value": "import * as ExifParser from \"exif-parser\";\nimport Utils from \"../Utils.js\";\n\n\n/**\n * Image operations.\n *\n * @author tlwr [toby@toby.codes]\n * @copyright Crown Copyright 2017\n * ...
javascript
chosen
[ { "from": "system", "value": "Use `map` instead of `reduce`\n" }, { "from": "human", "value": "const fs = require(\"fs\")\nconst glob = require(\"glob\")\nconst path = require(\"path\")\nconst reactDocs = require(\"react-docgen\")\nconst {toCode} = require(\"./utils\")\n\nmodule.exports = functi...
javascript
chosen
[ { "from": "system", "value": "Fix routing conflict between sign-in and slug-based content pages\n" }, { "from": "human", "value": "orion.users.configure({\n // Allow users to create accounts, but don't give them any admin permissions\n forbidClientAccountCreation: false,\n defaultPermissions:...
javascript
chosen
[ { "from": "system", "value": "Remove semicolon to match lint guidelines" }, { "from": "human", "value": "const isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));\nconst event = isTouch ? 'touchstart' : 'click'\n\nconst directive = {\n instances: []\n}\n\ndirective.onEve...
javascript
chosen
[ { "from": "system", "value": "Fix enum literal value parsing\n" }, { "from": "human", "value": "import { getDescription } from 'graphql/utilities/buildASTSchema';\nimport produceType from './produceType';\n\nexport const buildFieldConfigArgumentMap = (fieldAST, types) =>\n fieldAST.arguments.re...
javascript
chosen
[ { "from": "system", "value": "Refactor to ES6 arrow functions to make things a bit more concise\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\n//class-based component (ES6)\nclass SearchBar extends Component {\n render() { //method definition in ES6\n return <...
javascript
chosen
[ { "from": "system", "value": "Enable source-map-support in entry point\n\nThis appears to have been removed erroneously. Although we are not\ntranspiling the entry point, we are still transpiling the rest of the\nsource and enabling source maps could add value in debugging any\npotential errors that are thr...
javascript
chosen
[ { "from": "system", "value": "Replace missing callback from condition\n" }, { "from": "human", "value": "const { isEmpty } = require('lodash')\nconst logger = require('../config/logger')\n\nmodule.exports = (queryParam) => (req, res, next) => {\n const { features } = res.locals\n res.locals.is...
javascript
chosen
[ { "from": "system", "value": "Modify files in v7 static package.\n" }, { "from": "human", "value": "require.config({baseUrl:\"js/modules\",paths:{l:\"../libs\",c:\"../common\"}}),YYMG.modules.push(\"base\"),require(YYMG.modules,function(){for(var arg=arguments,argLen=arg.length,i=0;argLen>i;i++)...
javascript
chosen
[ { "from": "system", "value": "Set next target to server\n" }, { "from": "human", "value": "const withPlugins = require('next-compose-plugins')\nconst optimizedImages = require('next-optimized-images')\nconst withCSS = require('@zeit/next-css')\n\nconst nextConfig = {\n target: 'serverless',\n ...
javascript
chosen
[ { "from": "system", "value": "Rename user_id to id parameter\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies\n */\nimport * as mongo from 'mongodb';\nimport User from '../../models/user';\nimport serialize from '../../serializers/user';\n\n/**\n * Show a user\n *\...
javascript
chosen
[ { "from": "system", "value": "Add control specific CSS class\n" }, { "from": "human", "value": "TC.control = TC.control || {};\n\nif (!TC.control.TabContainer) {\n TC.syncLoadJS(TC.apiLocation + 'TC/control/TabContainer');\n}\n\nTC.control.DataLoader = function () {\n const self = this;\n...
javascript
chosen
[ { "from": "system", "value": "Fix glyphicon to 'OK' and success.\n" }, { "from": "human", "value": "AutoForm.hooks({\n 'guestbook--add_entry_form': {\n onSuccess: function (formType, result) {\n $.notify({\n \tmessage: 'Thank you ! Your entry will be shown after the admin validated...
javascript
chosen
[ { "from": "system", "value": "Add source maps in dev\n" }, { "from": "human", "value": "const path = require(\"path\");\nconst webpack = require(\"webpack\");\n\nmodule.exports = {\n resolve: {\n extensions: [\".js\"]\n },\n module: {\n rules: [\n {\n test: /\\.css$/,\n ...
javascript
chosen
[ { "from": "system", "value": "Change to minify-plugin from babili\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst BabiliPlugin = require('babili-webpack-plugin');\n\nconst isProd = process.env.NODE_ENV === 'PRODUCTION';\n\nconst output...
javascript
chosen
[ { "from": "system", "value": "Add error state to DateFieldw\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport styles from 'molecules/formfields/shared/formfields.module.scss';\n\nfunction DateField(p...
javascript
chosen
[ { "from": "system", "value": "docs: Remove extra junk from examples\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('myApp.controllers', []).\n\n controller('ExBasicCtrl', [function() {\n // You were expecting maybe The Adams Family?\n }])\n\n // That's all folks\n ;\n"...
javascript
chosen
[ { "from": "system", "value": "Make the skeleton survey script use the new melange.template namespace.\n" }, { "from": "human", "value": "/* Copyright 2011 the Melange authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compli...
javascript
chosen
[ { "from": "system", "value": "Fix line too long error\n" }, { "from": "human", "value": "/**\n * Bootstraps and starts the http server\n */\n \n'use strict';\n\n/**\n * Module dependencies\n * @private\n */\nvar connect = require('connect');\nvar http = require('http');\nvar morgan = require('m...
javascript
chosen
[ { "from": "system", "value": "Update user rank and score function\n" }, { "from": "human", "value": "<script>\nconst getUserRankAndScore = function() {\n const currentUserName = '{{ current_user.name }}' || null;\n let def = $.Deferred();\n $.ajax({\n url: '/leaderboard/',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix require of package.json for global installs\n" }, { "from": "human", "value": "const program = require('commander')\nconst loadInit = require('./init')\nconst loadStart = require('./start')\nconst { spawnSync } = require('child_process')\n\nmodule.exports = func...
javascript
chosen
[ { "from": "system", "value": "Add a second integration test for the error case." }, { "from": "human", "value": "var scripty = require('../../index')\nvar fs = require('fs')\nvar intercept = require('intercept-stdout')\nvar assert = require('assert')\nvar _ = require('lodash')\n\nvar stdout, sto...
javascript
chosen
[ { "from": "system", "value": "Add userstats emit to disconnect\n" }, { "from": "human", "value": "/*\n Created by 'myth' on July 3. 2015\n\n CognacTime is licenced under the MIT licence.\n*/\n\nvar log = require('./logging')\nvar util = require('../client/util')\n\n// Start by defining the con...
javascript
chosen
[ { "from": "system", "value": "Fix for text truncation where null or undefined descriptions are used.\n" }, { "from": "human", "value": "(function () {\n angular\n .module('GVA.Common')\n .directive('truncatedText', truncatedText);\n\n truncatedText.$inject = ['$parse'];\n\n ...
javascript
chosen
[ { "from": "system", "value": "Update comments in event signatures" }, { "from": "human", "value": "//setup connection\nvar client = new Client(\"demo_test_username\", 'http://localhost', 8000);\nclient.addMessageListener(function(msg)\n{\n\t//TODO Your code here!\n\t//message recieved\n\tconsole...
javascript
chosen
[ { "from": "system", "value": "Stop processing after trailing slash handler has redirected.\n" }, { "from": "human", "value": "// DecentCMS (c) 2014 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.\n'use strict';\n\n/**\n * @description\n * This handler registers itself as an Ex...
javascript
chosen
[ { "from": "system", "value": "Add missing '&' to area query in Aliss\n" }, { "from": "human", "value": "module.exports = {\n getDetails:function(id,callback){\n callback({});\n },\n query:function(qo,callback){\n var query=qo.query,area=qo.area;\n let path = \"/api/...
javascript
chosen
[ { "from": "system", "value": "Add Prescriber selector for fetching data\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nexport const selectCurrentPrescriber = ({ prescriber }) => {\n const { currentPrescriber } = prescriber;\n return c...
javascript
chosen
[ { "from": "system", "value": "Remove logging statement of geocoding results\n" }, { "from": "human", "value": "$(function () {\n $(\"#guess\").click(function () {\n getCurrent(function (pos) {\n $.ajax({\n type: 'GET',\n url: '/bathrooms/nearby',\n data: {search: 't...
javascript
chosen
[ { "from": "system", "value": "Fix build to add back the roboto font and bootstrap fonts.\n" }, { "from": "human", "value": "// Copies files not processed by requirejs optimization from source to dist so other tasks can process them\nmodule.exports = {\n dist: {\n files: [{\n expand: tru...
javascript
chosen
[ { "from": "system", "value": "Support configuring style include paths\n" }, { "from": "human", "value": "const browser = require('browser-sync');\nconst config = require('../../config');\nconst gulp = require('gulp');\nconst handleError = require('../../utilities/handleError');\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug causing multiple food selected to be selected\n" }, { "from": "human", "value": "Handlebars.registerHelper('select_list', function(select_options, id) {\n var template = HandlebarsTemplates['recipes/foods_select'];\n\n var list = $.map(select_options, func...
javascript
chosen
[ { "from": "system", "value": "Disable form submitting when personal request selected\n\nFor keyboard using people (like me) this avoids a confusing situation\nwhere you hit enter for some reason on the form and it submits.\n" }, { "from": "human", "value": "$(document).ready(function() {\n $swi...
javascript
chosen
[ { "from": "system", "value": "[+] Add a filter for the dates\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport App from './App'\nimport rou...
javascript
chosen