<commit_before>ART.WindowManager = new Class({

	Extends: Stacker,

	initialize: function(widget, options){
		this.parent(options);
		this.keyboard = new Keyboard({
			active: true,
			manager: widget ? widget.keyboard : null
		});
		this.keyboard.widget = widget || 'window manager';
	},

	register: function(instance){
		this.parent.apply(this, arguments);
		this.keyboard.manage(instance.keyboard);
	},

	unregister: function(instance) {
		this.parent.apply(this, arguments);
		Keyboard.manager.drop(instance.keyboard);
	}

});

ART.StickyWin = new Class({

	Extends: ART.Widget,

	name: 'stickywin',

	options: { 
		/*
		inject: {
			target: document.body,
			where: 'bottom'
		},
		content: null,
		timeout: 0,
		width: null,
		height: null,
		iframeShimSelector: '',
		closeOnClickOut: false,
		closeOnEsc: false,
		windowManager: instanceOfStacker,
		destroyOnClose: false,
		windowManagerLayer: 'default',
		
		//events:
		'drag:start': $empty,
		'drag:move': $empty(x,y),
		'drag:end': $empty,
		'shade': $empty

		//these are the defaults for Element.position anyway
		************************************************
		edge: false, //see Element.position
		position: 'center', //center, corner == upperLeft, upperRight, bottomLeft, bottomRight
		offset: {x:0,y:0},
		relativeTo: document.body,
		allowNegative: false,
		posMin: {x: , y:}, //passed as 'minimum' to element.position
		posMax: {x: , y: },//passed as 'maximum' to element.position
		************************************************

		mask: false,
		maskTarget: document.body,
		*/
		maskOptions: {},
		hideOnMaskClick: true,
		greyContentsOnDrag: true,
		closeClass: 'closeWin',
		close: true,
		draggable: false,
		dragHandle: false,
		showNow: true,
		useIframeShim: true,
		cascaded: false,
		constrainToContainer: false
	},

	hidden: true,

	initialize: function(options) {
		this.requireToRender('window:managed', 'window:displayed');
		if (!this.options.inject) {
			this.options.inject = {
				target: document.body,
				where: 'bottom'
			};
		}
		options = options || {};
		this.windowManager = options.windowManager || this.options.windowManager || ART.StickyWin.DefaultManager;
		delete this.options.windowManager;
		delete options.windowManager;
		//the window manager enables the windows; so we must start with disabled = true
		this.disabled = true;
		this.parent(options);
		this.element.store('StickyWin', this);
		this.build();
		this.windowManager.register(this, this.options.windowManagerLayer);
		this.readyToRender('window:managed');
		<commit_msg>managing keyboard options to avoid recursion bug in $merge (when you have an instance of a class pointer in options)<commit_after>ART.WindowManager = new Class({

	Extends: Stacker,

	initialize: function(widget, options){
		this.parent(options);
		this.keyboard = new Keyboard({
			active: true,
			manager: widget ? widget.keyboard : null
		});
		this.keyboard.widget = widget || 'window manager';
	},

	register: function(instance){
		this.parent.apply(this, arguments);
		this.keyboard.manage(instance.keyboard);
	},

	unregister: function(instance) {
		this.parent.apply(this, arguments);
		Keyboard.manager.drop(instance.keyboard);
	}

});

ART.StickyWin = new Class({

	Extends: ART.Widget,

	name: 'stickywin',

	options: { 
		/*
		inject: {
			target: document.body,
			where: 'bottom'
		},
		content: null,
		timeout: 0,
		width: null,
		height: null,
		iframeShimSelector: '',
		closeOnClickOut: false,
		closeOnEsc: false,
		windowManager: instanceOfStacker,
		destroyOnClose: false,
		windowManagerLayer: 'default',
		
		//events:
		'drag:start': $empty,
		'drag:move': $empty(x,y),
		'drag:end': $empty,
		'shade': $empty

		//these are the defaults for Element.position anyway
		************************************************
		edge: false, //see Element.position
		position: 'center', //center, corner == upperLeft, upperRight, bottomLeft, bottomRight
		offset: {x:0,y:0},
		relativeTo: document.body,
		allowNegative: false,
		posMin: {x: , y:}, //passed as 'minimum' to element.position
		posMax: {x: , y: },//passed as 'maximum' to element.position
		************************************************

		mask: false,
		maskTarget: document.body,
		*/
		maskOptions: {},
		hideOnMaskClick: true,
		greyContentsOnDrag: true,
		closeClass: 'closeWin',
		close: true,
		draggable: false,
		dragHandle: false,
		showNow: true,
		useIframeShim: true,
		cascaded: false,
		constrainToContainer: false
	},

	hidden: true,

	initialize: function(options) {
		this.requireToRender('window:managed', 'window:displayed');
		if (!this.options.inject) {
			this.options.inject = {
				target: document.body,
				where: 'bottom'
			};
		}
		options = options || {};
		this.windowManager = options.windowManager || this.options.windowManager || ART.StickyWin.DefaultManager;
		delete this.options.windowManager;
		delete options.windowManager;
		if (!options.keyboardOptions) options.keyboardOptions = {};
		options.keyboardOptions.manager = options.keyboardOptions.manager || this.windowManager.keyboard;
		//the window manager enables the windows; so we must start with disabled = true
		this.disabled = true;
		this.parent(options);
		this.element.store('StickyWin', this);
		this.build();
		this.windowManager.register(this, this.options.windowManagerLayer);
		this.readyToRender('window:managed');
		
{'fraction_non_alphanumeric': 0.16813002054922474, 'fraction_numerical': 0.0011208668036614981, 'mean_word_length': 4.386317907444668, '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': '3927658', 'n_tokens_mistral': 1900, 'n_tokens_neox': 1670, 'n_words': 393}