<commit_before>/*
 ArrowScrollBox Scroll Helper Library

 Usage:
   XUL:
     <arrowscrollbox id="scrollbox" orient="vertical">
       <vbox>
         <checkbox/>
         <checkbox/>
         <checkbox/>
         <checkbox/>
       </vbox>
     </arrowscrollbox>

  JavaScript:
     var box = document.getElementById('scrollbox');
     var base = box.getElementsByTagName('checkbox')[0];
     new window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper(box, base);
     // 1st argument: DOMNode or ID of an element
     // 2nd argument: DOMNode, ID of an element, or local name of a child element

 license: The MIT License, Copyright (c) 2009 YUKI "Piro" Hiroshi
 original:
   http://github.com/piroor/fxaddonlib-arrowscrollbox-scroll-helper
*/
(function() {
	const currentRevision = 1;

	if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};

	var loadedRevision = 'arrowScrollBoxScrollHelper' in window['piro.sakura.ne.jp'] ?
			window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper.prototype.revision :
			0 ;
	if (loadedRevision && loadedRevision > currentRevision) {
		return;
	}

	var Cc = Components.classes;
	var Ci = Components.interfaces;

	window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper = function(aArrowScrollBox, aBase)
	{
		this._initArrowScrollBox(aArrowScrollBox);
		this._initBase(aBase);

		this._box.addEventListener('DOMMouseScroll', this, true);
		window.addEventListener('unload', this, false);
	};
	window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper.prototype = {

		revision : currentRevision,

		kBASE_PIXELS : 10,

		_initArrowScrollBox : function(aArrowScrollBox)
		{
			this._box = aArrowScrollBox;
			if (typeof this._box == 'string')
				this._box = document.getElementById(this._box);

			if (
				!this._box ||
				!(this._box instanceof Ci.nsIDOMElement) ||
				this._box.localName != 'arrowscrollbox'
				)
				throw new Error('arrowscrollbox is required!');
		},

		_initBase : function(aBase)
		{
			this._base = aBase;
			if (typeof this._base == 'string') {
				var num = Number(this._base);
				if (!isNaN(num)) {
					this._base = num;
				}
				else {<commit_msg>Detect DOM Element by DOM constructor function instead of XPCOM interface<commit_after>/*
 ArrowScrollBox Scroll Helper Library

 Usage:
   XUL:
     <arrowscrollbox id="scrollbox" orient="vertical">
       <vbox>
         <checkbox/>
         <checkbox/>
         <checkbox/>
         <checkbox/>
       </vbox>
     </arrowscrollbox>

  JavaScript:
     var box = document.getElementById('scrollbox');
     var base = box.getElementsByTagName('checkbox')[0];
     new window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper(box, base);
     // 1st argument: DOM Element or ID of an element
     // 2nd argument: DOM Element, ID of an element, or local name of a child element

 license: The MIT License, Copyright (c) 2009-2014 YUKI "Piro" Hiroshi
 original:
   http://github.com/piroor/fxaddonlib-arrowscrollbox-scroll-helper
*/
(function() {
	const currentRevision = 2;

	if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};

	var loadedRevision = 'arrowScrollBoxScrollHelper' in window['piro.sakura.ne.jp'] ?
			window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper.prototype.revision :
			0 ;
	if (loadedRevision && loadedRevision > currentRevision) {
		return;
	}

	var Cc = Components.classes;
	var Ci = Components.interfaces;

	window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper = function(aArrowScrollBox, aBase)
	{
		this._initArrowScrollBox(aArrowScrollBox);
		this._initBase(aBase);

		this._box.addEventListener('DOMMouseScroll', this, true);
		window.addEventListener('unload', this, false);
	};
	window['piro.sakura.ne.jp'].arrowScrollBoxScrollHelper.prototype = {

		revision : currentRevision,

		kBASE_PIXELS : 10,

		_initArrowScrollBox : function(aArrowScrollBox)
		{
			this._box = aArrowScrollBox;
			if (typeof this._box == 'string')
				this._box = document.getElementById(this._box);

			if (
				!this._box ||
				!(this._box instanceof Element) ||
				this._box.localName != 'arrowscrollbox'
				)
				throw new Error('arrowscrollbox is required!');
		},

		_initBase : function(aBase)
		{
			this._base = aBase;
			if (typeof this._base == 'string') {
				var num = Number(this._base);
				if (!isNaN(num)) {
					this._base = num;
				}
				else {
{'fraction_non_alphanumeric': 0.13284132841328414, 'fraction_numerical': 0.005996309963099631, 'mean_word_length': 3.550891920251836, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '4124995', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1407, 'n_words': 296}