<commit_before>/* 
*     (C) Copyright 2008 Telefonica Investigacion y Desarrollo
*     S.A.Unipersonal (Telefonica I+D)
*
*     This file is part of Morfeo EzWeb Platform.
*
*     Morfeo EzWeb Platform is free software: you can redistribute it and/or modify
*     it under the terms of the GNU Affero General Public License as published by
*     the Free Software Foundation, either version 3 of the License, or
*     (at your option) any later version.
*
*     Morfeo EzWeb Platform is distributed in the hope that it will be useful,
*     but WITHOUT ANY WARRANTY; without even the implied warranty of
*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*     GNU Affero General Public License for more details.
*
*     You should have received a copy of the GNU Affero General Public License
*     along with Morfeo EzWeb Platform.  If not, see <http://www.gnu.org/licenses/>.
*
*     Info about members and contributors of the MORFEO project
*     is available at
*
*     http://morfeo-project.org
 */

/////////////////////////////////////
// DragboardLayout
/////////////////////////////////////

/**
 * This constructor initializes the common resources of a DragboardLayout. As
 * DragboardLayout is an abstract class, this can not be called directly and is
 * intented to be used by child classes.
 *
 * @class Represents a dragboard layout to be used to place igadgets into the
 * dragboard. Despite javascript not having a way to mark classes abstract, this
 * class is abstract, so please do not try to create an instance of this class.
 *
 * @private
 *
 * @param {Dragboard} dragboard      associated dragboard
 * @param {Number}    scrollbarSpace space reserved for the right scroll bar in pixels
 */
function DragboardLayout(dragboard, scrollbarSpace) {
	if (arguments.length == 0)
		return; // Allow empty constructor (allowing hierarchy)

	this.dragboard = dragboard;
	this.scrollbarSpace = scrollbarSpace;
	this.iGadgets = new Hash();

	// Window Resize event dispacher function
	this._notifyWindowResizeEvent = function () {
		// TODO do this in a compatible fashion
		var cssStyle = document.defaultView.getComputedStyle(this.dragboard.dragboardElement, null);
		if (cssStyle.getPropertyValue("none") == "none")
			return

		this._recomputeSize();

		// Notify each igadget
		var iGadget;
		var igadgetKeys = this.iGadgets.keys();
		for (var i = 0; i < igadgetKeys.length; i++) {
			iGadget = this.iGadgets[igadgetKeys[i]];
			iGadget._notifyWindowResizeEvent();
		}
	}.bind(this);

	// TODO do this in a compatible fashion
	var cssStyle = document.defaultView.getComputedStyle(this.dragboard.dragboardElement, null);
	if (cssStyle.getPropertyValue("none") == "none")
		this.dragboardWidth = 1200; // temporal size
	else
		this._recomputeSize();

	this.dragboard.dragboardElement.observe('load', this._notifyWindowResizeEvent, true);
	Event.observe(window, 'resize', this._notifyWindowResizeEvent, true);
}
<commit_msg>refs #335. Fix typos in commit [1641].<commit_after>/* 
*     (C) Copyright 2008 Telefonica Investigacion y Desarrollo
*     S.A.Unipersonal (Telefonica I+D)
*
*     This file is part of Morfeo EzWeb Platform.
*
*     Morfeo EzWeb Platform is free software: you can redistribute it and/or modify
*     it under the terms of the GNU Affero General Public License as published by
*     the Free Software Foundation, either version 3 of the License, or
*     (at your option) any later version.
*
*     Morfeo EzWeb Platform is distributed in the hope that it will be useful,
*     but WITHOUT ANY WARRANTY; without even the implied warranty of
*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*     GNU Affero General Public License for more details.
*
*     You should have received a copy of the GNU Affero General Public License
*     along with Morfeo EzWeb Platform.  If not, see <http://www.gnu.org/licenses/>.
*
*     Info about members and contributors of the MORFEO project
*     is available at
*
*     http://morfeo-project.org
 */

/////////////////////////////////////
// DragboardLayout
/////////////////////////////////////

/**
 * This constructor initializes the common resources of a DragboardLayout. As
 * DragboardLayout is an abstract class, this can not be called directly and is
 * intented to be used by child classes.
 *
 * @class Represents a dragboard layout to be used to place igadgets into the
 * dragboard. Despite javascript not having a way to mark classes abstract, this
 * class is abstract, so please do not try to create an instance of this class.
 *
 * @private
 *
 * @param {Dragboard} dragboard      associated dragboard
 * @param {Number}    scrollbarSpace space reserved for the right scroll bar in pixels
 */
function DragboardLayout(dragboard, scrollbarSpace) {
	if (arguments.length == 0)
		return; // Allow empty constructor (allowing hierarchy)

	this.dragboard = dragboard;
	this.scrollbarSpace = scrollbarSpace;
	this.iGadgets = new Hash();

	// Window Resize event dispacher function
	this._notifyWindowResizeEvent = function () {
		// TODO do this in a compatible fashion
		var cssStyle = document.defaultView.getComputedStyle(this.dragboard.dragboardElement, null);
		if (cssStyle.getPropertyValue("display") == "none")
			return

		this._recomputeSize();

		// Notify each igadget
		var iGadget;
		var igadgetKeys = this.iGadgets.keys();
		for (var i = 0; i < igadgetKeys.length; i++) {
			iGadget = this.iGadgets[igadgetKeys[i]];
			iGadget._notifyWindowResizeEvent();
		}
	}.bind(this);

	// TODO do this in a compatible fashion
	var cssStyle = document.defaultView.getComputedStyle(this.dragboard.dragboardElement, null);
	if (cssStyle.getPropertyValue("display") == "none")
		this.dragboardWidth = 1200; // temporal size
	else
		this._recomputeSize();

	this.dragboard.dragboardElement.observe('load', this._notifyWindowResizeEvent, true);
	Event.observe(window, 'resize', this._notifyWindowResizeEvent, true);
}

{'fraction_non_alphanumeric': 0.10853104492680464, 'fraction_numerical': 0.0048796903920578834, 'mean_word_length': 3.4193308550185875, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6328865', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1668, 'n_words': 634}