Changeset 455 for trunk/modules/user_guide
- Timestamp:
- 09/01/2007 12:19:19 AM (15 months ago)
- Location:
- trunk/modules/user_guide
- Files:
-
- 1 added
- 3 modified
-
controllers/user_guide.php (modified) (4 diffs)
-
views/user_guide/css/layout.php (modified) (2 diffs)
-
views/user_guide/css/spinner.gif (added)
-
views/user_guide/js/effects.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/user_guide/controllers/user_guide.php
r450 r455 72 72 public function _tags() 73 73 { 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); 75 75 } 76 76 … … 99 99 header('Content-type: text/javascript'); 100 100 101 $this->_media('js', preg_replace('/\.js$/ ', '', $filename));101 $this->_media('js', preg_replace('/\.js$/D', '', $filename)); 102 102 } 103 103 … … 106 106 header('Content-type: text/css'); 107 107 108 $this->_media('css', preg_replace('/\.css$/ ', '', $filename));108 $this->_media('css', preg_replace('/\.css$/D', '', $filename)); 109 109 } 110 110 … … 118 118 $this->load->view('user_guide/'.$type.'/'.$filename)->render(TRUE); 119 119 } 120 catch ( file_not_found$exception)120 catch (Kohana_Exception $exception) 121 121 { 122 122 print '/* script not found */'; -
trunk/modules/user_guide/views/user_guide/css/layout.php
r452 r455 9 9 Default Styles 10 10 */ 11 body { background: # 111; color: #111; font-size: 82%; line-height: 140%; font-family: "Lucida Grande", Arial, Verdana, sans-serif; }11 body { background: #f7fbf1; color: #111; font-size: 82%; line-height: 140%; font-family: "Lucida Grande", Arial, Verdana, sans-serif; } 12 12 a { color: #449; text-decoration: none; } 13 13 h1 { border-bottom: solid 1px #999; font-size: 2.5em; text-align: center; color: #b43f11; } … … 22 22 Template Styles 23 23 */ 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; } 26 26 #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; } 28 28 #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; } 32 32 #menu li span { cursor: pointer; } 33 #body , #footer { padding: 0 0.5em; background: #eee; }33 #body { padding: 0.3em 1em; background: #fff; } 34 34 #body ol, #body ul { margin: 1em; margin-left: 2.5em; } 35 35 #body ol { list-style: decimal; } 36 36 #body ul { list-style: circle; } 37 37 #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; } 39 40 #loading span { color: #400; } 40 41 /* -
trunk/modules/user_guide/views/user_guide/js/effects.php
r452 r455 1 1 // $Id$ 2 2 $(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 }); 3 9 // Append the AJAX loader 4 $('#container').append('<div id="loading"><span>…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"> </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); 32 29 } 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(){ 37 35 // Show loading 38 36 Kohana.toggleLoading(true); 39 37 // Fetch the current link 40 38 var link = $(this); 41 // Make AJAX request 39 // Make AJAX request, using ?ajax=true 42 40 $.get(link.attr('href'), {ajax: 'true'}, function(data) { 43 // Add the "lite"class to the current link44 $('#menu li.activeli.lite').removeClass('lite');41 // Add the hilight class to the current link 42 $('#menu ul li.lite').removeClass('lite'); 45 43 link.parent().addClass('lite'); 46 44 // Load new AJAX content … … 51 49 return false; 52 50 }); 53 // Show the active menu54 $('#menu li.active ul > li')55 .stack('animate', {height: 'show', width: 'show'}, 100);56 51 }); 57 52 // Special Kohana functions … … 62 57 // If we are waiting for an animation, retry in 5ms 63 58 if (Kohana.waiting == true) { 64 setTimeout('Kohana.toggleLoading('+on+')', 100);59 setTimeout('Kohana.toggleLoading('+on+')', 20); 65 60 return false; 66 61 } … … 68 63 Kohana.waiting = true; 69 64 if (on == true) { // Show loading 70 this.loading.slideDown(2 00, function() {65 this.loading.slideDown(250, function() { 71 66 Kohana.waiting = false; 72 67 }); 73 68 } else { // Hide loading 74 this.loading.slideUp(2 00, function() {69 this.loading.slideUp(250, function() { 75 70 Kohana.waiting = false; 76 71 });
