<commit_before>;(function ($, window, document, undefined) {
	"use strict";
	$.widget("mm.explorpc", {
		options: {
			// FIELD SETTERS
			type: "raw",
			httpMethod: "post",
			auth: "",
			url: "",
			method: "",
			body: "",
			username: "",
			password: "",

			// MISC OPTIONS
			autocompleteSource: null,
			permalinkHandler: null,
			indent: 3,
			timeout: 5 * 1000,
			subdomainTunneling: false,
			autoPrettyPrint: false,
			tunnelFilepath: "/tunnel.html"
		},
		// field names
		paramNames: ['type', 'httpMethod', 'auth', 'url', 'method', 'body', 'username', 'password'],
		// codemirror instance for request body
		_requestBodyEditor: null,
		// codemirror instance for response
		_responseEditor: null,
		// last response/request data, used by "view raw request/response" dialog and permalink functionality
		_lastResponse: null,
		_lastRequestParams: null,
		// Cache of the jQuery.ajax objects provided by tunnel.html, as served by each of the
		// subdomains we've connected to. This means we only have to fetch tunnel.html once
		// for each subdomain request.
		_subdomainAjax: {},

		_create: function() {
			// initialize CodeMirror instances
			this._initRequestBody();
			this._initResponse();

			// register events
			this.element
				.resize($.proxy(this._adjustDimensions, this))
				.on('change', '[name=type]', $.proxy(this._typeChanged, this))
				.on('change', '[name=httpMethod]', $.proxy(this._httpMethodChanged, this))
				.on('change', '[name=auth]', $.proxy(this._authChanged, this))
				.on('change', '[name=url]', $.proxy(this._urlChanged, this))
				.on('click', '[name=request]:not(.ui-state-disabled)', $.proxy(this._requestClicked, this))
				.on('click', '.explorpc-expand', $.proxy(this.toggleExpand, this))
				.on('click', '.explorpc-h-expand', $.proxy(this.toggleHorizontalExpand, this))
				.on('click', '.explorpc-viewraw:not(.ui-state-disabled)', $.proxy(this.viewRaw, this))
				.on('click', '.explorpc-prettyprint:not(.ui-state-disabled)', $.proxy(this.prettyPrintResponse, this))
				.on('click', '.explorpc-permalink:not(.ui-state-disabled)', $.proxy(this.generatePermanentLink, this))
				.on('hover', '.explorpc-expand, .explorpc-viewraw, .explorpc-prettyprint', this._buttonHover);
			
			// initialize elements
			this.element
				.toggleClass('explorpc-autoprettyprint', this.option('autoPrettyPrint'))
				.toggleClass('explorpc-canpermalink', this.option('permalinkHandler') !== null)
				.resizable({ handles: 'se' }) // not sure how useful this is. Keep?
				.find('.ui-resizable-se')
					.addClass('ui-icon-grip-diagonal-se') // I want the bigger grip icon (default is too small)
					.end()
				.find('button')
					.button({ disabled: true });
			this._initAutocomplete();
			this._initFields();

			this._horizontalExpandChanged();
			this._adjustDimensions();
		},

		_initRequestBody: function() {
			this._requestBodyEditor = CodeMirror.fromTextArea(this.element.find('[name=body]')[0], {
				lineNumbers: false,<commit_msg>Fix permalink button so it's highlighed on hover<commit_after>;(function ($, window, document, undefined) {
	"use strict";
	$.widget("mm.explorpc", {
		options: {
			// FIELD SETTERS
			type: "raw",
			httpMethod: "post",
			auth: "",
			url: "",
			method: "",
			body: "",
			username: "",
			password: "",

			// MISC OPTIONS
			autocompleteSource: null,
			permalinkHandler: null,
			indent: 3,
			timeout: 5 * 1000,
			subdomainTunneling: false,
			autoPrettyPrint: false,
			tunnelFilepath: "/tunnel.html"
		},
		// field names
		paramNames: ['type', 'httpMethod', 'auth', 'url', 'method', 'body', 'username', 'password'],
		// codemirror instance for request body
		_requestBodyEditor: null,
		// codemirror instance for response
		_responseEditor: null,
		// last response/request data, used by "view raw request/response" dialog and permalink functionality
		_lastResponse: null,
		_lastRequestParams: null,
		// Cache of the jQuery.ajax objects provided by tunnel.html, as served by each of the
		// subdomains we've connected to. This means we only have to fetch tunnel.html once
		// for each subdomain request.
		_subdomainAjax: {},

		_create: function() {
			// initialize CodeMirror instances
			this._initRequestBody();
			this._initResponse();

			// register events
			this.element
				.resize($.proxy(this._adjustDimensions, this))
				.on('change', '[name=type]', $.proxy(this._typeChanged, this))
				.on('change', '[name=httpMethod]', $.proxy(this._httpMethodChanged, this))
				.on('change', '[name=auth]', $.proxy(this._authChanged, this))
				.on('change', '[name=url]', $.proxy(this._urlChanged, this))
				.on('click', '[name=request]:not(.ui-state-disabled)', $.proxy(this._requestClicked, this))
				.on('click', '.explorpc-expand', $.proxy(this.toggleExpand, this))
				.on('click', '.explorpc-h-expand', $.proxy(this.toggleHorizontalExpand, this))
				.on('click', '.explorpc-viewraw:not(.ui-state-disabled)', $.proxy(this.viewRaw, this))
				.on('click', '.explorpc-prettyprint:not(.ui-state-disabled)', $.proxy(this.prettyPrintResponse, this))
				.on('click', '.explorpc-permalink:not(.ui-state-disabled)', $.proxy(this.generatePermanentLink, this))
				.on('hover', '.explorpc-permalink, .explorpc-expand, .explorpc-viewraw, .explorpc-prettyprint', this._buttonHover);
			
			// initialize elements
			this.element
				.toggleClass('explorpc-autoprettyprint', this.option('autoPrettyPrint'))
				.toggleClass('explorpc-canpermalink', this.option('permalinkHandler') !== null)
				.resizable({ handles: 'se' }) // not sure how useful this is. Keep?
				.find('.ui-resizable-se')
					.addClass('ui-icon-grip-diagonal-se') // I want the bigger grip icon (default is too small)
					.end()
				.find('button')
					.button({ disabled: true });
			this._initAutocomplete();
			this._initFields();

			this._horizontalExpandChanged();
			this._adjustDimensions();
		},

		_initRequestBody: function() {
			this._requestBodyEditor = CodeMirror.fromTextArea(this.element.find('[name=body]')[0], {
				lineNumbers: false,
{'fraction_non_alphanumeric': 0.16948030453492222, 'fraction_numerical': 0.0023171135385633896, 'mean_word_length': 3.9818631492168177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '55280', 'n_tokens_mistral': 2263, 'n_tokens_neox': 1903, 'n_words': 429}