Show
Ignore:
Timestamp:
09/03/2007 03:37:01 PM (15 months ago)
Author:
Shadowhand
Message:

Removing AJAX from the User Guide, due to issues with bookmarking, and inline links. Overall, it causes more issues than it solves.

Location:
trunk/modules/user_guide
Files:
2 modified

Legend:

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

    r483 r484  
    4444                $content  = rtrim('user_guide/'.$locale.'content/'.$category.'/'.$section, '/'); 
    4545 
    46                 // Load session for AJAX page storage 
    47                 $this->load->library('session'); 
    48  
    4946                // Load markdown 
    5047                require Kohana::find_file('vendor', 'Markdown'); 
    5148 
    52                 // Show content 
    53                 if ($this->input->get('ajax') === 'true') 
    54                 { 
    55                         // Set the AJAX return page, for refreshing 
    56                         $this->session->set('ajax_return', $this->uri->string()); 
     49                $template          = $this->load->view('user_guide/'.$locale.'template'); 
     50                $template->menu    = $this->load->view('user_guide/'.$locale.'menu', array('active_category' => $category, 'active_section' => $section)); 
     51                $template->content = $this->load->view($content)->render(FALSE, 'Markdown'); 
    5752 
    58                         // Just the content, ma'am! 
    59                         $this->load->view($content)->render(TRUE, 'Markdown'); 
    60                 } 
    61                 else 
    62                 { 
    63                         // Return the user to the page they were on 
    64                         if ($ajax_return = $this->session->get_once('ajax_return')) 
    65                                 url::redirect($ajax_return); 
    66                          
    67                         $template          = $this->load->view('user_guide/'.$locale.'template'); 
    68                         $template->menu    = $this->load->view('user_guide/'.$locale.'menu', array('active_category' => $category, 'active_section' => $section)); 
    69                         $template->content = $this->load->view($content)->render(FALSE, 'Markdown'); 
    70  
    71                         // Display output 
    72                         $template->render(TRUE); 
    73                 } 
     53                // Display output 
     54                $template->render(TRUE); 
    7455        } 
    7556 
  • trunk/modules/user_guide/views/user_guide/js/effects.js

    r475 r484  
    11// $Id$ 
    2 // Special Kohana functions 
    3 var Kohana = { 
    4         loading: false, 
    5         waiting: false, 
    6         toggleLoading: function(on) { 
    7                 // If we are waiting for an animation, retry in 5ms 
    8                 if (Kohana.waiting == true) { 
    9                         setTimeout('Kohana.toggleLoading('+on+')', 20); 
    10                         return false; 
    11                 } 
    12                 // Toggle waiting state 
    13                 Kohana.waiting = true; 
    14                 if (on == true) { // Show loading 
    15                         this.loading.slideDown(250, function() { 
    16                                 Kohana.waiting = false; 
    17                         }); 
    18                 } else { // Hide loading 
    19                         this.loading.slideUp(250, function() { 
    20                                 Kohana.waiting = false; 
    21                         }); 
    22                 } 
    23         } 
    24 }; 
    252// Behavior attachment 
    263$(document).ready(function(){ 
     
    318                $(this).fadeTo(300, 0.7) 
    329        }); 
    33         // Append the AJAX loader 
    34         $('#container').append('<div id="loading">&nbsp;</div>'); 
    35         // To prevent extra querying, add the loading element to Kohana after hiding it 
    36         Kohana.loading = $('#loading').hide(); 
    3710        // Apply menu sliding effect 
    3811        $('#menu li.first').click(function(){ 
     
    5528        // Find and hide the sub menus that are not in the active menu 
    5629        .not('.active').find('ul').hide(); 
    57         // Add AJAX functionality to the menu links 
    58         $('#menu a').click(function(){ 
    59                 // Show loading 
    60                 Kohana.toggleLoading(true); 
    61                 // Fetch the current link 
    62                 var link = $(this); 
    63                 // Make AJAX request, using ?ajax=true 
    64                 $.get(link.attr('href'), {ajax: 'true'}, function(data) { 
    65                         // Add the hilight class to the current link 
    66                         $('#menu ul li.lite').removeClass('lite'); 
    67                         link.parent().addClass('lite'); 
    68                         // Load new AJAX content 
    69                         $('#body').html(data); 
    70                         // Hide loading 
    71                         Kohana.toggleLoading(false) 
    72                 }); 
    73                 return false; 
    74         }); 
    7530        // For syntax highlighting 
    7631        prettyPrint();