Permalink
Browse files

Merge pull request #2 from stonehippo/master

Cleaned up the inline/compiled CSS logic
  • Loading branch information...
2 parents ee27f71 + 9dd696e commit 66f2068cc8c8a6b1525d3a247689539cd150b6d9 @lukebrooker committed Apr 2, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 index.php
View
17 index.php
@@ -177,18 +177,23 @@ function print_html($folder, $file, $file_path, $folder_name = null) {
echo '<pre class="prettyprint lang-html">';
echo $html_string_code;
echo '</pre></div>';
- if (file_exists($css_file) || $css_string) {
+ if ($css_string) {
echo '<div class="css code"><h5 class="pat-res-heading"><a href="'.$file.'" class="clip">CSS <span>select</span></a>';
- if($css_string): echo '<span class="inline">embedded</span>'; endif;
- if(file_exists($css_file)): echo '<span class="inline">compiled</span>'; endif;
+ echo '<span class="inline">embedded</span>';
echo '</h5>';
echo '<pre class="prettyprint lang-css">';
- echo htmlspecialchars(file_get_contents($css_file));
echo $css_string;
echo '</pre></div>';
- if($css_string): echo '<style type="text/css">';
+ echo '<style type="text/css">';
echo $css_string;
- echo '</style>'; endif;
+ echo '</style>';
+ } elseif (file_exists($css_file)) {
+ echo '<div class="css code"><h5 class="pat-res-heading"><a href="'.$file.'" class="clip">CSS <span>select</span></a>';
+ echo '<span class="inline">compiled</span>';
+ echo '</h5>';
+ echo '<pre class="prettyprint lang-css">';
+ echo htmlspecialchars(file_get_contents($css_file));
+ echo '</pre></div>';
}
echo '</div>';
echo '</div>';

0 comments on commit 66f2068

Please sign in to comment.