Exemplo n.º 1
0
    function tb_admin_styles_and_scripts()
    {
        ob_start();
        ?>
		<style type="text/css">
			/* =Widefat table */
			table.widefat          { margin-top: 1em; }
			table.widefat thead th { padding: 7px 9px; }
			table.widefat tbody th { width: 200px; }
			table.widefat th       { padding: 10px; }
			table.widefat td       { padding: 8px 10px; }
			/* =Tab table */
			table.tab > thead th { cursor: pointer; }
			table.tab > tbody    { display: none; }
			/* =Clear table */
			table.clear         { border-collapse: collapse; }
			table.clear td      { border: 0; padding: 0 4px 1px 0; vertical-align: middle; }
			table.clear td.bold { font-weight: bold; }
			/* =Labels */
			label + label, span + label { margin-left: 15px; }
			/* =Inputs */
			input.regular-text { width: 25em; }
			input.large-text   { width: 99%; }
			input.short-text   { width: 50px; }
			input.medium-text  { width: 100px; }
			/* =Classes */
			.submit-fixed { position: fixed; right: 18px; top: 50px; }
			.indent-1     { margin-left: 20px; }
			.indent-2     { margin-left: 40px; }
			.indent-3     { margin-left: 60px; }
		</style>
		<?php 
        echo tb_style_minify(ob_get_clean()) . "\n";
        $visible_tabs_cookie_name = tb_get_theme_cookie_name('admin_visible_tabs');
        ?>
		<script type="text/javascript">
			// Cookies
			function tbCreateCookie(name, value, time) {
				var date = new Date();
				date.setTime(date.getTime()+time*1000);
				document.cookie = name+'='+value+'; expires='+date.toGMTString()+'; path=<?php 
        echo COOKIEPATH;
        ?>
';
			}
			function tbReadCookie(name) {
				var name = name+'=';
				var cookies = document.cookie.split(';');
				for (var i in cookies) {
					var c = cookies[i];
					while (c.charAt(0) == ' ') c = c.substring(1, c.length);
					if (c.indexOf(name) == 0) {
						return c.substring(name.length, c.length);
					}
				}
				return null;
			}
			function tbEraseCookie(name) {
				tbCreateCookie(name, '', -1);
			}
			// Tabs
			jQuery(document).ready(function() {
				var tabs = jQuery('table.tab');
				function saveTabs() {
					var visible_tabs = [];
					for (var i = 0; i < tabs.length; i++) {
						if (tabs.eq(i).find('> tbody').is(':visible')) visible_tabs.push(i);
					}
					tbCreateCookie('<?php 
        echo $visible_tabs_cookie_name;
        ?>
', visible_tabs.join(','), 365*24*60*60);
				}
				function loadTabs() {
					var visible_tabs = tbReadCookie('<?php 
        echo $visible_tabs_cookie_name;
        ?>
');
					if (visible_tabs) {
						visible_tabs = visible_tabs.split(',');
						for (var i in visible_tabs) tabs.eq(visible_tabs[i]).find('> tbody').show();
					}
				}
				jQuery('table.tab > thead th').click(function() {
					jQuery(this).parentsUntil('table').last().next('tbody').toggle();
					saveTabs();
				});
				jQuery('.button-secondary.button-tab').click(function() {
					var tbody = jQuery('> tbody', tabs);
					if (jQuery(this).index() == 0) tbody.show(); else tbody.hide();
					saveTabs();
				});
				loadTabs();
			});
		</script>
		<?php 
    }
Exemplo n.º 2
0
 * @since Fast Blog 1.0
 */
?>

<?php 
ob_start();
?>
<style type="text/css">
	#header { height: <?php 
echo $header_height = fastblog_get_option('header/height');
?>
px; }
	#logo, #tagline { line-height: <?php 
echo $header_height;
?>
px; }
	#logo img { max-height: <?php 
echo $header_height;
?>
px; }
	#logo span { font-size: <?php 
echo round($header_height * 1.1);
?>
px; }
	<?php 
fastblog_option('custom_css');
?>
</style>
<?php 
echo tb_style_minify(ob_get_clean()) . "\n";