<commit_before>moduleAid.VERSION = '1.0.1';

this.__defineGetter__('slimChromeClipPathURLBarWrapper', function() { return $(objName+'-slimChrome-clipPath-urlbar-wrapper-path'); });
this.__defineGetter__('slimChromeClipPathContainer', function() { return $(objName+'-slimChrome-clipPath-container-path'); });
this.__defineGetter__('slimChromeSVGBefore', function() { return $(objName+'-slimChrome-svg-before-path'); });
this.__defineGetter__('slimChromeSVGAfter', function() { return $(objName+'-slimChrome-svg-after-path'); });

this.AUSTRALIS_BORDER_WIDTH = 26; // the size of the border element, basically how far it extends
this.AUSTRALIS_BORDER_WIDTH_INCR = 6; // how much should the border extend with each toolbar added, so that it doesn't distort
this.AUSTRALIS_BORDER_OFFSET_X1 = 0.015; // percentage by which the border svg should be offset of the actual clipPath, so that it looks thicker (top)
this.AUSTRALIS_BORDER_OFFSET_Y1 = 0.03; // percentage by which the border svg ends should be offset of the actual clipPath (top)
this.AUSTRALIS_BORDER_OFFSET_X2 = 0.02; // percentage by which the border svg should be offset of the actual clipPath, so that it looks thicker (bottom)
this.AUSTRALIS_BORDER_OFFSET_Y2 = 0.02; // percentage by which the border svg ends should be offset of the actual clipPath (bottom)
this.AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR = -12; // this is added to AUSTRALIS_BORDER_WIDTH and that is applied as the navbar's padding
this.AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS = -5; // this is added to AUSTRALIS_BORDER_WIDTH and that is applied as all toolbars' padding

// the following define the shape and curvature of the australis-style container borders; values are a decimal percentage of the total border size
// used as "M COORD_X1,COORD_Y1 C CURVE1_X1,CURVE1_Y1 CURVE1_X2,CURVE1_Y2 COORD_X2,COORD_Y2 CURVE1_X1,CURVE1_Y1 CURVE2_X2,CURVE2_Y2 COORD_X3,COORD_Y3";
// see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths

this.AUSTRALIS_BORDER_CURVE1_X1 = 0.4;
this.AUSTRALIS_BORDER_CURVE1_Y1 = 0.05;
this.AUSTRALIS_BORDER_CURVE1_X2 = 0.48;
this.AUSTRALIS_BORDER_CURVE1_Y2 = 0.30;

this.AUSTRALIS_BORDER_CURVE2_X1 = 0.55;
this.AUSTRALIS_BORDER_CURVE2_Y1 = 0.5;
this.AUSTRALIS_BORDER_CURVE2_X2 = 0.45;
this.AUSTRALIS_BORDER_CURVE2_Y2 = 1;

this.AUSTRALIS_BORDER_COORD_X1 = 0;
this.AUSTRALIS_BORDER_COORD_Y1 = 0;
this.AUSTRALIS_BORDER_COORD_X2 = 0.5;
this.AUSTRALIS_BORDER_COORD_Y2 = 0.5;
this.AUSTRALIS_BORDER_COORD_X3 = 1;
this.AUSTRALIS_BORDER_COORD_Y3 = 1;

this.slimChromeClipPaths = function() {
	if(prefAid.slimStyle == 'compact') {
		var d = !DARWIN ? 'm 1,-5 l 0,7.8 l 0,0.2 l 0,22l10000,0 l 0,-50 l -10000,0 z' : 'M 1,-5 l 0,34 l 10000,0 l 0,-34 l -10000,0 z';
		setAttribute(slimChromeClipPathURLBarWrapper, 'd', d);
		
		return;
	}
	
	if(prefAid.slimStyle != 'australis' || typeof(lastSlimChromeStyle) == 'undefined' || !lastSlimChromeStyle) { return; }
	
	var width = AUSTRALIS_BORDER_WIDTH;
	for(var i=0; i<slimChromeToolbars.childNodes.length; i++) {
		if(!slimChromeToolbars.childNodes[i].hidden && !slimChromeToolbars.childNodes[i].collapsed) {
			width += AUSTRALIS_BORDER_WIDTH_INCR;
		}
	}
	
	// don't bother if nothing changed in the meantime
	if(slimChromeContainer._borderSize == width && slimChromeContainer._lastSize == lastSlimChromeStyle.width) { return; }
	slimChromeContainer._borderSize = width;
	slimChromeContainer._lastSize = lastSlimChromeStyle.width;
	
	// first bit, define the initial point
	var d = "M "+AUSTRALIS_BORDER_COORD_X1+","+(AUSTRALIS_BORDER_COORD_Y1-AUSTRALIS_BORDER_OFFSET_Y1);
	
	// next bit, the left border
	var aC = width /lastSlimChromeStyle.width;
	d += " C";
	d += " "+(AUSTRALIS_BORDER_CURVE1_X1*aC)+","+AUSTRALIS_BORDER_CURVE1_Y1;
	d += " "+(AUSTRALIS_BORDER_CURVE1_X2*aC)+","+AUSTRALIS_BORDER_CURVE1_Y2;
	d += " "+(AUSTRALIS_BORDER_COORD_X2*aC)+","+AUSTRALIS_BORDER_COORD_Y2;
	d += " "+(AUSTRALIS_BORDER_CURVE2_X1*aC)+","+AUSTRALIS_BORDER_CURVE2_Y1;
	d += " "+(AUSTRALIS_BORDER_CURVE2_X2*aC)+","+AUSTRALIS_BORDER_CURVE2_Y2;
	d += " "+(AUSTRALIS_BORDER_COORD_X3*aC)+","+AUSTRALIS_BORDER_COORD_Y3;
	
	// next bit, the full container
	var bC = (lastSlimChromeStyle.width -width) /lastSlimChromeStyle.width;
	d += " L "+aC+",1 "+bC+",1";
	
	// next bit, the right border
	d += " C";
	d += " "+(((1-AUSTRALIS_BORDER_CURVE2_X2)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE2_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE2_X1)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE2_Y1;
	d += " "+(((1-AUSTRALIS_BORDER_COORD_X2)*aC)+bC)+","+AUSTRALIS_BORDER_COORD_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE1_X2)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE1_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE1_X1)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE1_Y1;
	d += " "+(((1-AUSTRALIS_BORDER_COORD_X1)*aC)+bC)+","+(AUSTRALIS_BORDER_COORD_Y1-AUSTRALIS_BORDER_OFFSET_Y1);
	
	// last bit, wrap the whole path
	d += " L 1,0 "+AUSTRALIS_BORDER_COORD_X1+","+AUSTRALIS_BORDER_COORD_Y1+" z";
	
	setAttribute(slimChromeClipPathContainer, 'd', d);
	
	// define the DOM nodes sizes first
	styleAid.unload('slimChromeSVG_'+_UUID);
	
	var sscode = '/*The Fox, Only Better CSS declarations of variable values*/\n';
	sscode += '@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\n';
	sscode += '@-moz-document url("'+document.baseURI+'") {\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars-before,\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars-after {\n';
	sscode += '		width: ' + width + 'px;\n';
	sscode += '	}\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars > *:not(#nav-bar) {\n';
	sscode += '		padding-left: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS) + 'px;\n';
	sscode += '		padding-right: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS) + 'px;\n';
	sscode += '	}\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars > #nav-bar {\n';
	sscode += '		padding-left: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR) + 'px;\n';
	sscode += '		padding-right: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR) + 'px;\n';
	sscode += '	}\n';<commit_msg>Closes #44 toolbars truncated in australis style<commit_after>moduleAid.VERSION = '1.0.2';

this.__defineGetter__('slimChromeClipPathURLBarWrapper', function() { return $(objName+'-slimChrome-clipPath-urlbar-wrapper-path'); });
this.__defineGetter__('slimChromeClipPathContainer', function() { return $(objName+'-slimChrome-clipPath-container-path'); });
this.__defineGetter__('slimChromeSVGBefore', function() { return $(objName+'-slimChrome-svg-before-path'); });
this.__defineGetter__('slimChromeSVGAfter', function() { return $(objName+'-slimChrome-svg-after-path'); });

this.AUSTRALIS_BORDER_WIDTH = 26; // the size of the border element, basically how far it extends
this.AUSTRALIS_BORDER_WIDTH_INCR = 6; // how much should the border extend with each toolbar added, so that it doesn't distort
this.AUSTRALIS_BORDER_OFFSET_X1 = 0.015; // percentage by which the border svg should be offset of the actual clipPath, so that it looks thicker (top)
this.AUSTRALIS_BORDER_OFFSET_Y1 = 0.03; // percentage by which the border svg ends should be offset of the actual clipPath (top)
this.AUSTRALIS_BORDER_OFFSET_X2 = 0.02; // percentage by which the border svg should be offset of the actual clipPath, so that it looks thicker (bottom)
this.AUSTRALIS_BORDER_OFFSET_Y2 = 0.02; // percentage by which the border svg ends should be offset of the actual clipPath (bottom)
this.AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR = -12; // this is added to AUSTRALIS_BORDER_WIDTH and that is applied as the navbar's padding
this.AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS = -5; // this is added to AUSTRALIS_BORDER_WIDTH and that is applied as all toolbars' padding

// the following define the shape and curvature of the australis-style container borders; values are a decimal percentage of the total border size
// used as "M COORD_X1,COORD_Y1 C CURVE1_X1,CURVE1_Y1 CURVE1_X2,CURVE1_Y2 COORD_X2,COORD_Y2 CURVE1_X1,CURVE1_Y1 CURVE2_X2,CURVE2_Y2 COORD_X3,COORD_Y3";
// see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths

this.AUSTRALIS_BORDER_CURVE1_X1 = 0.4;
this.AUSTRALIS_BORDER_CURVE1_Y1 = 0.05;
this.AUSTRALIS_BORDER_CURVE1_X2 = 0.48;
this.AUSTRALIS_BORDER_CURVE1_Y2 = 0.30;

this.AUSTRALIS_BORDER_CURVE2_X1 = 0.55;
this.AUSTRALIS_BORDER_CURVE2_Y1 = 0.5;
this.AUSTRALIS_BORDER_CURVE2_X2 = 0.45;
this.AUSTRALIS_BORDER_CURVE2_Y2 = 1;

this.AUSTRALIS_BORDER_COORD_X1 = 0;
this.AUSTRALIS_BORDER_COORD_Y1 = 0;
this.AUSTRALIS_BORDER_COORD_X2 = 0.5;
this.AUSTRALIS_BORDER_COORD_Y2 = 0.5;
this.AUSTRALIS_BORDER_COORD_X3 = 1;
this.AUSTRALIS_BORDER_COORD_Y3 = 1;

this.slimChromeClipPaths = function() {
	if(prefAid.slimStyle == 'compact') {
		var d = !DARWIN ? 'm 1,-5 l 0,7.8 l 0,0.2 l 0,22l10000,0 l 0,-50 l -10000,0 z' : 'M 1,-5 l 0,34 l 10000,0 l 0,-34 l -10000,0 z';
		setAttribute(slimChromeClipPathURLBarWrapper, 'd', d);
		
		return;
	}
	
	if(prefAid.slimStyle != 'australis' || typeof(lastSlimChromeStyle) == 'undefined' || !lastSlimChromeStyle) { return; }
	
	var width = AUSTRALIS_BORDER_WIDTH;
	for(var i=0; i<slimChromeToolbars.childNodes.length; i++) {
		if(!slimChromeToolbars.childNodes[i].hidden && !slimChromeToolbars.childNodes[i].collapsed) {
			width += AUSTRALIS_BORDER_WIDTH_INCR;
		}
	}
	
	// don't bother if nothing changed in the meantime
	if(slimChromeContainer._borderSize == width && slimChromeContainer._lastSize == lastSlimChromeStyle.width) { return; }
	slimChromeContainer._borderSize = width;
	slimChromeContainer._lastSize = lastSlimChromeStyle.width;
	
	// first bit, define the initial point
	var d = "M "+AUSTRALIS_BORDER_COORD_X1+","+(AUSTRALIS_BORDER_COORD_Y1-AUSTRALIS_BORDER_OFFSET_Y1);
	
	// next bit, the left border
	var aC = width /lastSlimChromeStyle.width;
	d += " C";
	d += " "+(AUSTRALIS_BORDER_CURVE1_X1*aC)+","+AUSTRALIS_BORDER_CURVE1_Y1;
	d += " "+(AUSTRALIS_BORDER_CURVE1_X2*aC)+","+AUSTRALIS_BORDER_CURVE1_Y2;
	d += " "+(AUSTRALIS_BORDER_COORD_X2*aC)+","+AUSTRALIS_BORDER_COORD_Y2;
	d += " "+(AUSTRALIS_BORDER_CURVE2_X1*aC)+","+AUSTRALIS_BORDER_CURVE2_Y1;
	d += " "+(AUSTRALIS_BORDER_CURVE2_X2*aC)+","+AUSTRALIS_BORDER_CURVE2_Y2;
	d += " "+(AUSTRALIS_BORDER_COORD_X3*aC)+","+AUSTRALIS_BORDER_COORD_Y3;
	
	// next bit, the full container
	var bC = (lastSlimChromeStyle.width -width) /lastSlimChromeStyle.width;
	d += " L "+aC+",1 "+bC+",1";
	
	// next bit, the right border
	d += " C";
	d += " "+(((1-AUSTRALIS_BORDER_CURVE2_X2)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE2_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE2_X1)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE2_Y1;
	d += " "+(((1-AUSTRALIS_BORDER_COORD_X2)*aC)+bC)+","+AUSTRALIS_BORDER_COORD_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE1_X2)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE1_Y2;
	d += " "+(((1-AUSTRALIS_BORDER_CURVE1_X1)*aC)+bC)+","+AUSTRALIS_BORDER_CURVE1_Y1;
	d += " "+(((1-AUSTRALIS_BORDER_COORD_X1)*aC)+bC)+","+(AUSTRALIS_BORDER_COORD_Y1-AUSTRALIS_BORDER_OFFSET_Y1);
	
	// last bit, wrap the whole path
	d += " L 1,0 "+AUSTRALIS_BORDER_COORD_X1+","+AUSTRALIS_BORDER_COORD_Y1+" z";
	
	setAttribute(slimChromeClipPathContainer, 'd', d);
	
	// define the DOM nodes sizes first
	styleAid.unload('slimChromeSVG_'+_UUID);
	
	var sscode = '/*The Fox, Only Better CSS declarations of variable values*/\n';
	sscode += '@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\n';
	sscode += '@-moz-document url("'+document.baseURI+'") {\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars-before,\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars-after {\n';
	sscode += '		width: ' + width + 'px;\n';
	sscode += '	}\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars > *:not(#nav-bar) {\n';
	sscode += '		padding-left: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS) + 'px !important;\n';
	sscode += '		padding-right: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_OTHERS) + 'px !important;\n';
	sscode += '	}\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"]:not([chromehidden~="toolbar"]) #navigator-toolbox[slimStyle="australis"] #'+objName+'-slimChrome-container:-moz-any([hover],:not([onlyURLBar])) #'+objName+'-slimChrome-toolbars > #nav-bar {\n';
	sscode += '		padding-left: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR) + 'px !important;\n';
	sscode += '		padding-right: ' + (width +AUSTRALIS_BORDER_PADDING_ADJUST_NAVBAR) + 'px !important;\n';
	sscode += '	}\n';
{'fraction_non_alphanumeric': 0.16023892043359633, 'fraction_numerical': 0.029791313324976035, 'mean_word_length': 6.358654367878459, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5084474', 'n_tokens_mistral': 5793, 'n_tokens_neox': 5589, 'n_words': 901}