<commit_before>function WindowStack() {

	// The navigation object for iOS
	var navigationWindow = null,
		// Windows array for history pepuse
		windows = [];

	this.setNavigationWindow = function(_navigationWindow) {
		navigationWindow = _navigationWindow;
	}

	this.open = function(_window, drawer) {

		windows.push(_window);

		if (OS_IOS) {

			// Create navigationWindow if we don't have
			if (navigationWindow === null || drawer) {
				navigationWindow = Ti.UI.iOS.createNavigationWindow({
					window: _window
				});

				if (drawer) {
					drawer.setCenterWindow(navigationWindow);
				} else {
					navigationWindow.open();
				}
			} else {

				// Or just push new window to the stack
				navigationWindow.openWindow(_window);
			}
		} else {

			if (drawer) {
				drawer.setCenterWindow(_window);
			} else {
				_window.open();
			}
		}

		// On close the window update the windows array
		_window.addEventListener('close', function() {
			windows = _.without(windows, _window);
		});
	};

	this.close = function(_window) {

		if (OS_IOS) {
			navigationWindow.closeWindow(_window);
		} else if (OS_MOBILEWEB) {
			navigationWindow.close(_window);
		} else {
			_window.close();
		}
	};

	this.back = function() {
		// Get last window in the stack
		var _window = _.last(windows);
		this.close(_window);
	};
<commit_msg>On Android, WindowStack can set title, keepScreenOn and exitOnClose for the drawable window<commit_after>function WindowStack() {

	// The navigation object for iOS
	var navigationWindow = null,
		// Windows array for history pepuse
		windows = [];

	this.setNavigationWindow = function(_navigationWindow) {
		navigationWindow = _navigationWindow;
	}

	this.open = function(_window, drawer) {

		windows.push(_window);

		if (OS_IOS) {

			// Create navigationWindow if we don't have
			if (navigationWindow === null || drawer) {
				navigationWindow = Ti.UI.iOS.createNavigationWindow({
					window: _window
				});

				if (drawer) {
					drawer.setCenterWindow(navigationWindow);
				} else {
					navigationWindow.open();
				}
			} else {

				// Or just push new window to the stack
				navigationWindow.openWindow(_window);
			}
		} else {

			if (drawer) {

				_.extend(drawer.window, _.pick(_window, ['title', 'keepScreenOn', 'exitOnClose']));

				drawer.setCenterWindow(_window);
			} else {
				_window.open();
			}
		}

		// On close the window update the windows array
		_window.addEventListener('close', function() {
			windows = _.without(windows, _window);
		});
	};

	this.close = function(_window) {

		if (OS_IOS) {
			navigationWindow.closeWindow(_window);
		} else if (OS_MOBILEWEB) {
			navigationWindow.close(_window);
		} else {
			_window.close();
		}
	};

	this.back = function() {
		// Get last window in the stack
		var _window = _.last(windows);
		this.close(_window);
	};

{'fraction_non_alphanumeric': 0.12464788732394366, 'fraction_numerical': 0.0, 'mean_word_length': 3.221396731054978, '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': '5486558', 'n_tokens_mistral': 1059, 'n_tokens_neox': 867, 'n_words': 211}