<commit_before><?php
	require_once("TinyAjaxBehavior.php");
	require_once("vars.php");
	require_once("tools/lessc.inc.php");
	require_once("includes/Mobile_Detect.php");

	function getThemeName(){
		if(isset($_COOKIE['theme'])){
			$theme = $_COOKIE['theme'];
		}else{
			$theme = "default";
		}
		return $theme;
	}

	function applyDefaultTheme() {
		$less = new lessc();
		try {
			$less->checkedCompile("./themes/default/main.less","./themes/default/style.css");
			$less->checkedCompile("./themes/default/m_main.less","./themes/default/m_style.css");
		} catch (exception $e) {
			echo ($e->getMessage());
		}
	}

	function getTheme() {
		$detect = new Mobile_Detect;
		applyDefaultTheme();
		
		$theme = getThemeName();

		if ($detect->isMobile() && !$detect->isTablet()) {
			return "themes/$theme/m_style.css";
		}else{	
			return "themes/$theme/style.css";
		}
	}
?><commit_msg>move stylesheets to a theme folder (prep for multiple themes)<commit_after><?php
	require_once("TinyAjaxBehavior.php");
	require_once("vars.php");
	require_once("tools/lessc.inc.php");
	require_once("includes/Mobile_Detect.php");

	function getThemeName(){
		if(isset($_COOKIE['theme'])){
			$theme = $_COOKIE['theme'];
		}else{
			$theme = "default";
		}
		return $theme;
	}

	function compileTheme($theme) {
		$less = new lessc();
		try {
			$less->checkedCompile("./themes/$theme/main.less","./themes/$theme/style.css");
			$less->checkedCompile("./themes/$theme/m_main.less","./themes/$theme/m_style.css");
		} catch (exception $e) {
			echo ($e->getMessage());
		}
	}

	function getTheme() {
		$detect = new Mobile_Detect;
		$theme = getThemeName();
		compileTheme($theme);
		if ($detect->isMobile() && !$detect->isTablet()) {
			return "themes/$theme/m_style.css";
		}else{	
			return "themes/$theme/style.css";
		}
	}
?>
{'fraction_non_alphanumeric': 0.20309050772626933, 'fraction_numerical': 0.0, 'mean_word_length': 4.33235294117647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '4281288', 'n_tokens_mistral': 729, 'n_tokens_neox': 639, 'n_words': 97}