Show
Ignore:
Timestamp:
09/01/2007 12:19:19 AM (15 months ago)
Author:
Shadowhand
Message:

A few small changes:

  • Removed Core language file
  • Added Exceptions language file
  • Added Kohana_Exception class
  • Updated some Kohana:: functions to use Exceptions, and catch them
  • Updated Kohana::find_file() to not attach the EXT extension on filenames (4th parameter, boolean)
  • Updated View class to allow serving of GIF, JPG, and PNG files through fpassthru() (with correct headers of course!)

A few small changes to the User Guide:

  • Updated menu effects: collapses the entire submenu together, rather than "stacking" the effects, removed "sticky" window.onScroll function, changed the loading panel to use an AJAX spinner, rather than text, added a menu hovering fade
  • Updated layout styles: changed the background color be light, updated menu colors to match, changed to a full-width design
Location:
trunk/modules/user_guide
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/user_guide/controllers/user_guide.php

    r450 r455  
    7272        public function _tags() 
    7373        { 
    74                 Kohana::$output = preg_replace_callback('!<(benchmark|event|file|definition)>.+?</[^>]+>!', array($this, '_tag_update'), Kohana::$output); 
     74                self::$output = preg_replace_callback('!<(benchmark|event|file|definition)>.+?</[^>]+>!', array($this, '_tag_update'), self::$output); 
    7575        } 
    7676 
     
    9999                header('Content-type: text/javascript'); 
    100100 
    101                 $this->_media('js', preg_replace('/\.js$/', '', $filename)); 
     101                $this->_media('js', preg_replace('/\.js$/D', '', $filename)); 
    102102        } 
    103103 
     
    106106                header('Content-type: text/css'); 
    107107 
    108                 $this->_media('css', preg_replace('/\.css$/', '', $filename)); 
     108                $this->_media('css', preg_replace('/\.css$/D', '', $filename)); 
    109109        } 
    110110 
     
    118118                        $this->load->view('user_guide/'.$type.'/'.$filename)->render(TRUE); 
    119119                } 
    120                 catch (file_not_found $exception) 
     120                catch (Kohana_Exception $exception) 
    121121                { 
    122122                        print '/* script not found */'; 
  • trunk/modules/user_guide/views/user_guide/css/layout.php

    r452 r455  
    99Default Styles 
    1010*/ 
    11 body { background: #111; color: #111; font-size: 82%; line-height: 140%; font-family: "Lucida Grande", Arial, Verdana, sans-serif; } 
     11body { background: #f7fbf1; color: #111; font-size: 82%; line-height: 140%; font-family: "Lucida Grande", Arial, Verdana, sans-serif; } 
    1212a { color: #449; text-decoration: none; } 
    1313h1 { border-bottom: solid 1px #999; font-size: 2.5em; text-align: center; color: #b43f11; } 
     
    2222Template Styles 
    2323*/ 
    24 #container { position: relative; width: 70%; min-width: 30em; max-width: 60em; margin: 0 auto; } 
    25 #menu { position: absolute; right: -10.1em; width: 10em; padding: 0.2em 0; } 
     24#container { position: relative; margin: 0 12em 2em 1em; border: solid 0 #e7f5d7; border-width: 0 0.2em 0.3em 0.2em; } 
     25#menu { position: fixed; top: 0; right: 1.5em; width: 10em; padding: 0.2em 0; } 
    2626#menu ul { margin: 0 0.2em; list-style: none; color: #b43f11; } 
    27 #menu li ul { padding: 0.1em 0; margin-right: 0; font-size: 0.8em; color: #444; } 
     27#menu li.first { font-size: 1.4em; padding-top: 0.2em; } 
    2828#menu li.active li.lite { color: #b43f11; } 
    29 #menu li ul a { color: #666; } 
    30 #menu ul a:hover { text-decoration: underline; color: #45721d; } 
    31 #menu li.first { font-size: 1.2em; } 
     29#menu li ul { padding: 0.1em 0; margin-right: 0; font-size: 0.7em; color: #444; } 
     30#menu li ul a { color: #333; } 
     31#menu li ul a:hover { font-weight: bold; color: #2f4f14; } 
    3232#menu li span { cursor: pointer; } 
    33 #body, #footer { padding: 0 0.5em; background: #eee; } 
     33#body { padding: 0.3em 1em; background: #fff; } 
    3434#body ol, #body ul { margin: 1em; margin-left: 2.5em; } 
    3535#body ol { list-style: decimal; } 
    3636#body ul { list-style: circle; } 
    3737#body li { padding: 0.1em 0; } 
    38 #loading { position: absolute; top: 0; right: 0; z-index: 9999; padding: 0.5em 2em; background: #fff; border: solid 0 #aaa; border-width: 0 0 1px 1px; text-align: center; text-transform: uppercase; font-size: 0.7em; } 
     38#footer { padding: 0 1em; background: #fff; line-height: 2em; } 
     39#loading { position: absolute; top: 0; right: 0; z-index: 9999; width: 32px; height: 32px; background: transparent url(spinner.gif) center center no-repeat; } 
    3940#loading span { color: #400; } 
    4041/* 
  • trunk/modules/user_guide/views/user_guide/js/effects.php

    r452 r455  
    11// $Id$ 
    22$(document).ready(function(){ 
     3        // Menu opacity hover effect, much fancy pants! 
     4        $('#menu').css('opacity', 0.75).hover(function(){ 
     5                $(this).fadeTo(100, 0.9); 
     6        }, function(){ 
     7                $(this).fadeTo(300, 0.7) 
     8        }); 
    39        // Append the AJAX loader 
    4         $('#container').append('<div id="loading"><span>&hellip;loading</span></div>'); 
    5         // To prevent extra querying 
    6         Kohana.loading = $('#loading').hide().css('opacity', 0.85); 
    7         // Make the menu sticky 
    8         $(window).scroll(function(){ 
    9                 $('#menu').css('top', $(window).scrollTop()); 
    10         }); 
    11         // Apply menu effects 
    12         $('#menu li.first li') 
    13         .hide()   // Hide these li's 
    14         .parent() // Parent ul 
    15         .parent() // Parent li 
    16         .click(function(){ 
    17                         // Hover affects the ul > li inside of this li 
    18                         var curr = $('#menu li.active'); 
    19                         var self = $(this); 
    20                         // Clicks to the same element will do nothing 
    21                         if (self.is('.active') == false) 
    22                         { 
    23                                 // Hide the current elements 
    24                                 curr.removeClass('active') 
    25                                 .find('ul > li') 
    26                                 .stack('animate', {height: 'hide', width: 'hide'}, 100); 
    27                                 // Show the new elements 
    28                                 self.addClass('active') 
    29                                 .find('ul > li') 
    30                                 .stack('animate', {height: 'show', width: 'show'}, 100); 
    31                         } 
     10        $('#container').append('<div id="loading">&nbsp;</div>'); 
     11        // To prevent extra querying, add the loading element to Kohana after hiding it 
     12        Kohana.loading = $('#loading').hide(); 
     13        // Apply menu sliding effect 
     14        $('#menu li.first').click(function(){ 
     15                // Define the current menu and the clicked menu 
     16                var curr = $('#menu li.active'); 
     17                var self = $(this); 
     18                // Clicks to the same menu will do nothing 
     19                if (self.is('.active') == false) 
     20                { 
     21                        // Hide the current elements 
     22                        curr.removeClass('active') 
     23                        .find('ul') 
     24                        .slideUp(250); 
     25                        // Show the new elements 
     26                        self.addClass('active') 
     27                        .find('ul') 
     28                        .slideDown(250); 
    3229                } 
    33         ). 
    34         // Find links in the menu 
    35         find('a') 
    36         .click(function(){ 
     30        }) 
     31        // Find and hide the sub menus that are not in the active menu 
     32        .not('.active').find('ul').hide(); 
     33        // Add AJAX functionality to the menu links 
     34        $('#menu a').click(function(){ 
    3735                // Show loading 
    3836                Kohana.toggleLoading(true); 
    3937                // Fetch the current link 
    4038                var link = $(this); 
    41                 // Make AJAX request 
     39                // Make AJAX request, using ?ajax=true 
    4240                $.get(link.attr('href'), {ajax: 'true'}, function(data) { 
    43                         // Add the "lite" class to the current link 
    44                         $('#menu li.active li.lite').removeClass('lite'); 
     41                        // Add the hilight class to the current link 
     42                        $('#menu ul li.lite').removeClass('lite'); 
    4543                        link.parent().addClass('lite'); 
    4644                        // Load new AJAX content 
     
    5149                return false; 
    5250        }); 
    53         // Show the active menu 
    54         $('#menu li.active ul > li') 
    55         .stack('animate', {height: 'show', width: 'show'}, 100); 
    5651}); 
    5752// Special Kohana functions 
     
    6257                // If we are waiting for an animation, retry in 5ms 
    6358                if (Kohana.waiting == true) { 
    64                         setTimeout('Kohana.toggleLoading('+on+')', 100); 
     59                        setTimeout('Kohana.toggleLoading('+on+')', 20); 
    6560                        return false; 
    6661                } 
     
    6863                Kohana.waiting = true; 
    6964                if (on == true) { // Show loading 
    70                         this.loading.slideDown(200, function() { 
     65                        this.loading.slideDown(250, function() { 
    7166                                Kohana.waiting = false; 
    7267                        }); 
    7368                } else { // Hide loading 
    74                         this.loading.slideUp(200, function() { 
     69                        this.loading.slideUp(250, function() { 
    7570                                Kohana.waiting = false; 
    7671                        });