<commit_before>/**
 * breezeTabs.js
 *
 * The purpose of this file is handling tabs on user's profile
 * @package Breeze mod
 * @version 1.0 Beta 3
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2013 <NAME>
 * @license http://www.mozilla.org/MPL/MPL-1.1.html
 */

/*
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is http://missallsunday.com code.
 *
 * The Initial Developer of the Original Code is
 * <NAME>.
 * Portions created by the Initial Developer are Copyright (c) 2012, 2013
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 */

 jQuery(document).ready(function(){

	var tabs = {};

	var tabChange = function (newTab){

		currentActive = getCurrentActive();

		// Tell whatever tab is active at the moment to get lost...
		tabs[currentActive].active = false;
		jQuery(tabs[currentActive].href).fadeOut('slow', function() {

			jQuery(tabs[newTab].href).fadeIn('slow', function() {});
		});

		// And set this as the active one...
		tabs[newTab].active = true;
	}

	var getCurrentActive = function (){

		var output = null,
			key;

		for (key in tabs) {
			if (tabs.hasOwnProperty(key)) {
				if (tabs[key].active == true){
					output = tabs[key].name;
				}
			}
		}

		return output;
	};

	// Get all available <li> tags
	jQuery('ul.breezeTabs li').each(function(){

		tabs[jQuery(this).attr('class')] = {
			href : jQuery(this).find('a').attr('href'),
			name : jQuery(this).attr('class'),
			active : (jQuery(this).attr('class') == 'wall') ? true : false
		};

		// Hide all tabs by default
		jQuery(tabs[jQuery(this).attr('class')].href).hide();

		// Make the wall page the active tab...
		jQuery(tabs['wall'].href).show();
	});

	// The Wall tab
	jQuery('li.wall a').click(function (e) {

		// Is it active already?
		if (tabs['wall'].active == true)
			return false;

		else
		{
			tabChange('wall');
		}

		e.preventDefault();
	});

	// Buddies tab
	jQuery('li.buddies a').click(function (e) {

		// Is it active already?
		if (tabs['buddies'].active == true)
			return false;

		else
		{
			tabChange('buddies');
		}

		e.preventDefault();
	});

	// Visits tab
	jQuery('li.visits a').click(function (e) {

		// Is it active already?
		if (tabs['visits'].active == true)
			return false;

		else
		{
			tabChange('visits');
		}

		e.preventDefault();
	});

	jQuery(window).hashchange();
 });<commit_msg>Done with the tabs script...<commit_after>/**
 * breezeTabs.js
 *
 * The purpose of this file is handling tabs on user's profile
 * @package Breeze mod
 * @version 1.0 Beta 3
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2013 <NAME>
 * @license http://www.mozilla.org/MPL/MPL-1.1.html
 */

/*
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is http://missallsunday.com code.
 *
 * The Initial Developer of the Original Code is
 * <NAME>.
 * Portions created by the Initial Developer are Copyright (c) 2012, 2013
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 */

 jQuery(document).ready(function(){

	var tabs = {};

	var tabChange = function (newTab){

		currentActive = getCurrentActive();

		// Tell whatever tab is active at the moment to get lost...
		tabs[currentActive].active = false;
		jQuery(tabs[currentActive].href).fadeOut('slow', function() {

			// Remove the active class and add it to the newtab
			jQuery('li.'+ currentActive +' a').removeClass('active');
			jQuery('li.'+ newTab +' a').addClass('active');

			jQuery(tabs[newTab].href).fadeIn('slow', function() {});
		});

		// And set this as the active one...
		tabs[newTab].active = true;
	}

	var getCurrentActive = function (){

		var output = null,
			key;

		for (key in tabs) {
			if (tabs.hasOwnProperty(key)) {
				if (tabs[key].active == true){
					output = tabs[key].name;
				}
			}
		}

		return output;
	};

	// Get all available <li> tags
	jQuery('ul.breezeTabs li').each(function(){

		tabs[jQuery(this).attr('class')] = {
			href : jQuery(this).find('a').attr('href'),
			name : jQuery(this).attr('class'),
			active : (jQuery(this).attr('class') == 'wall') ? true : false
		};

		// Hide all tabs by default
		jQuery(tabs[jQuery(this).attr('class')].href).hide();

		// Make the wall page the active tab...
		jQuery(tabs['wall'].href).show();
	});

	// The Wall tab
	jQuery('li.wall a').click(function (e) {

		// Is it active already?
		if (tabs['wall'].active == true)
			return false;

		else
		{
			tabChange('wall');
		}

		e.preventDefault();
	});

	// Buddies tab
	jQuery('li.buddies a').click(function (e) {

		// Is it active already?
		if (tabs['buddies'].active == true)
			return false;

		else
		{
			tabChange('buddies');
		}

		e.preventDefault();
	});

	// Visits tab
	jQuery('li.visits a').click(function (e) {

		// Is it active already?
		if (tabs['visits'].active == true){
			return false;
		}

		else {
			tabChange('visits');
		}

		e.preventDefault();
	});

	jQuery(window).hashchange();
 });
{'fraction_non_alphanumeric': 0.15745479358580688, 'fraction_numerical': 0.007164790174002047, 'mean_word_length': 3.2485507246376812, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4127913', 'n_tokens_mistral': 2111, 'n_tokens_neox': 1839, 'n_words': 576}