<commit_before>/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, window */

/**
* Brackets extension to reposition Working Files in sidebar and make it resizable.
*
* <NAME> <<EMAIL>>
**/
define(function (require, exports, module) {
	"use strict";

	var Resizer = brackets.getModule("utils/Resizer");

	var CommandManager = brackets.getModule("command/CommandManager"),
			Menus = brackets.getModule("command/Menus"),
			PreferencesManager = brackets.getModule("preferences/PreferencesManager"),
			prefs = PreferencesManager.getExtensionPrefs("resizeBottomWorkingFiles"),
			menu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU);

	// menu handlers
	CommandManager.register("Bottom Working Files", 'pessotti.bottom-working-files', function() {
		prefs.set('bottomWorkingFiles', !prefs.get('bottomWorkingFiles'));
		prefs.save();
	});
	menu.addMenuItem('pessotti.bottom-working-files');

	CommandManager.register("Resizable Working Files", 'pessotti.resize-working-files', function() {
		prefs.set('resizeWorkingFiles', !prefs.get('resizeWorkingFiles'));
		prefs.save();
	});
	menu.addMenuItem('pessotti.resize-working-files');

	// set handlers when preferences are changed
	prefs.definePreference('bottomWorkingFiles', 'boolean', 'false').on('change', function() {
		CommandManager.get('pessotti.bottom-working-files').setChecked(prefs.get('bottomWorkingFiles'));

		if (prefs.get('bottomWorkingFiles')) {
			$("#sidebar").append($('#working-set-list-container'));

			if (prefs.get('resizeWorkingFiles')) {
				Resizer.removeSizable($('#working-set-list-container'));
				Resizer.makeResizable($('#working-set-list-container'), "vert", "top", 75);
			}
		}
		else {
			$("#sidebar").prepend($('#working-set-list-container'));

			if (prefs.get('resizeWorkingFiles')) {
				Resizer.removeSizable($('#working-set-list-container'));
				Resizer.makeResizable($('#working-set-list-container'), "vert", "bottom", 75);
			}
		}
	});

	prefs.definePreference('resizeWorkingFiles', 'boolean', 'false').on('change', function() {
		CommandManager.get('pessotti.resize-working-files').setChecked(prefs.get('resizeWorkingFiles'));

		Resizer.removeSizable($('#working-set-list-container'));

		if (prefs.get('resizeWorkingFiles')) {
			if (prefs.get('bottomWorkingFiles'))
				Resizer.makeResizable($('#working-set-list-container'), "vert", "top", 75);
			else
				Resizer.makeResizable($('#working-set-list-container'), "vert", "bottom", 75);
		}
	});
});<commit_msg>auto-enable on install fix width of current working file selection when resizing the working files panel<commit_after>/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, window */

/**
* Brackets extension to reposition Working Files in sidebar and make it resizable.
*
* <NAME> <<EMAIL>>
**/
define(function (require, exports, module) {
	"use strict";

	var Resizer = brackets.getModule("utils/Resizer");

	var CommandManager = brackets.getModule("command/CommandManager"),
		Menus = brackets.getModule("command/Menus"),
		PreferencesManager = brackets.getModule("preferences/PreferencesManager"),
		prefs = PreferencesManager.getExtensionPrefs("resizeBottomWorkingFiles"),
		menu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU);

	// fix width of current working file selection when resizing the working files panel
	var sidebar_selection = $('.sidebar-selection');
	sidebar_selection[0].style.setProperty('width','100%','important');

	// menu handlers
	CommandManager.register("Bottom Working Files", 'pessotti.bottom-working-files', function() {
		prefs.set('bottomWorkingFiles', !prefs.get('bottomWorkingFiles'));
		prefs.save();
	});
	menu.addMenuItem('pessotti.bottom-working-files');

	CommandManager.register("Resizable Working Files", 'pessotti.resize-working-files', function() {
		prefs.set('resizeWorkingFiles', !prefs.get('resizeWorkingFiles'));
		prefs.save();
	});
	menu.addMenuItem('pessotti.resize-working-files');

	// set handlers when preferences are changed
	prefs.definePreference('bottomWorkingFiles', 'boolean', 'true').on('change', function() {
		CommandManager.get('pessotti.bottom-working-files').setChecked(prefs.get('bottomWorkingFiles'));

		if (prefs.get('bottomWorkingFiles')) {
			$("#sidebar").append($('#working-set-list-container'));

			if (prefs.get('resizeWorkingFiles')) {
				Resizer.removeSizable($('#working-set-list-container'));
				Resizer.makeResizable($('#working-set-list-container'), "vert", "top", 75);
			}
		}
		else {
			$("#sidebar").prepend($('#working-set-list-container'));

			if (prefs.get('resizeWorkingFiles')) {
				Resizer.removeSizable($('#working-set-list-container'));
				Resizer.makeResizable($('#working-set-list-container'), "vert", "bottom", 75);
			}
		}
	});

	prefs.definePreference('resizeWorkingFiles', 'boolean', 'true').on('change', function() {
		CommandManager.get('pessotti.resize-working-files').setChecked(prefs.get('resizeWorkingFiles'));

		Resizer.removeSizable($('#working-set-list-container'));

		if (prefs.get('resizeWorkingFiles')) {
			if (prefs.get('bottomWorkingFiles'))
				Resizer.makeResizable($('#working-set-list-container'), "vert", "top", 75);
			else
				Resizer.makeResizable($('#working-set-list-container'), "vert", "bottom", 75);
		}
	});
});
{'fraction_non_alphanumeric': 0.18124184225247064, 'fraction_numerical': 0.004848032817452918, 'mean_word_length': 5.824427480916031, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4339347', 'n_tokens_mistral': 1825, 'n_tokens_neox': 1617, 'n_words': 276}