├── darkfish_preview.png ├── lib └── rdoc │ ├── generator │ ├── template │ │ ├── darkfish.rhtml │ │ └── darkfish │ │ │ ├── images │ │ │ ├── bug.png │ │ │ ├── date.png │ │ │ ├── find.png │ │ │ ├── ruby.png │ │ │ ├── zoom.png │ │ │ ├── brick.png │ │ │ ├── package.png │ │ │ ├── plugin.png │ │ │ ├── wrench.png │ │ │ ├── tag_green.png │ │ │ ├── brick_link.png │ │ │ ├── bullet_black.png │ │ │ ├── macFFBgHack.png │ │ │ ├── page_green.png │ │ │ ├── wrench_orange.png │ │ │ ├── loadingAnimation.gif │ │ │ ├── page_white_text.png │ │ │ ├── page_white_width.png │ │ │ ├── bullet_toggle_minus.png │ │ │ └── bullet_toggle_plus.png │ │ │ ├── index.rhtml │ │ │ ├── js │ │ │ ├── quicksearch.js │ │ │ ├── darkfish.js │ │ │ ├── thickbox-compressed.js │ │ │ └── jquery.js │ │ │ ├── filepage.rhtml │ │ │ ├── classpage.rhtml │ │ │ └── rdoc.css │ └── darkfish.rb │ └── discover.rb ├── config.yml.example ├── project.yml ├── Rakefile.local ├── experiments └── can_you_override.rb ├── LICENSE ├── spec └── rdoc │ └── generator │ └── darkfish_spec.rb ├── README ├── misc └── index-prototype.html ├── Rakefile └── ChangeLog /darkfish_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/darkfish_preview.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish.rhtml: -------------------------------------------------------------------------------- 1 | 2 | <%= content %> 3 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/bug.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/date.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/find.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/ruby.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/zoom.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/brick.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/package.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/plugin.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/wrench.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/tag_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/tag_green.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/brick_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/brick_link.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/bullet_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/bullet_black.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/macFFBgHack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/page_green.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/wrench_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/wrench_orange.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/page_white_text.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/page_white_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/page_white_width.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ged/darkfish/HEAD/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png -------------------------------------------------------------------------------- /config.yml.example: -------------------------------------------------------------------------------- 1 | wrapper: darkfish.rhtml 2 | static: 3 | - css/ 4 | - js/ 5 | - img/ 6 | data: 7 | package: Darkfish 8 | rubyforge_name: darkfish 9 | url: deveiate.org/projects/Darkfish-Rdoc 10 | description: a customizable RDoc generator 11 | -------------------------------------------------------------------------------- /project.yml: -------------------------------------------------------------------------------- 1 | --- 2 | excluded_pkgfiles: [] 3 | 4 | rubyforge_project: darkfish-rdoc 5 | project_requirements: {} 6 | 7 | project_pubdir: /usr/local/www/public/code 8 | project_description: "A complete replacement for the default HTML generator for Rdoc, the\n\ 9 | API documentation-extraction system for Ruby. " 10 | rubyforge_group: deveiate 11 | project_pubhost: deveiate 12 | project_homepage: http://deveiate.org/projects/Darkfish-Rdoc/ 13 | project_dependencies: 14 | rdoc: ">= 2.3" 15 | project_summary: A pretty (different) Rdoc HTML generator 16 | project_name: Darkfish-Rdoc 17 | version_file: rdoc/generator/darkfish.rb 18 | additional_pkgfiles: 19 | - lib/rdoc/generator/**/*.{css,rhtml,png,js} 20 | dev_dependencies: {} 21 | 22 | authors: 23 | Michael Granger: ged@FaerieMUD.org 24 | post_install_message: To use the Darkfish formatter, just add '-f darkfish' to your rdoc command of choice. 25 | -------------------------------------------------------------------------------- /lib/rdoc/discover.rb: -------------------------------------------------------------------------------- 1 | # Bootstrap file for the Darkfish RDoc generator. Tell RubyGems about Darkfish 2 | # via autodiscovery. 3 | 4 | gem 'darkfish-rdoc' 5 | 6 | if Gem.respond_to?( :promote_load_path ) 7 | Gem.promote_load_path( 'darkfish-rdoc', 'rdoc' ) 8 | else 9 | # move darkfish-rdoc before rdoc in the load path so ours gets picked up first 10 | # NOTE: This was added as Gem::promote_load_path in RubyGems 1.4 11 | rdoc = Gem.loaded_specs['rdoc'] 12 | darkfish = Gem.loaded_specs['darkfish-rdoc'] 13 | 14 | last_darkfish_path = File.join( darkfish.full_gem_path, 15 | darkfish.require_paths.last ) 16 | 17 | rdoc_paths = rdoc.require_paths.map do |path| 18 | File.join( rdoc.full_gem_path, path ) 19 | end 20 | 21 | rdoc_paths.each do |path| 22 | $LOAD_PATH.delete( path ) 23 | end 24 | 25 | darkfish_path_index = $LOAD_PATH.index( last_darkfish_path ) + 1 26 | 27 | $LOAD_PATH.insert( darkfish_path_index, *rdoc_paths ) 28 | end 29 | 30 | require 'rdoc/generator/darkfish' 31 | 32 | -------------------------------------------------------------------------------- /Rakefile.local: -------------------------------------------------------------------------------- 1 | 2 | task :debug do 3 | $DEBUG = true 4 | end 5 | 6 | task :coverage do 7 | trace "No coverage generated" 8 | end 9 | 10 | namespace :release do 11 | task :project => [ :cleanup_rdoc_output ] 12 | 13 | # Need to clean up .svn directories under the Rdoc output before publishing 14 | task :cleanup_rdoc_output do 15 | outputdir = DOCSDIR + 'html' 16 | Pathname.glob( outputdir + '**/.svn' ).each do |pn| 17 | rm_rf pn, :verbose => true, :noop => $DEBUG 18 | end 19 | end 20 | end 21 | 22 | task :install do 23 | log "Installing template files" 24 | sitelib = Pathname.new( CONFIG['sitelibdir'] ) 25 | sitearch = Pathname.new( CONFIG['sitearchdir'] ) 26 | 27 | Dir.chdir( LIBDIR ) do 28 | EXTRA_PKGFILES.each do |templatefile| 29 | relpath = templatefile.relative_path_from( LIBDIR ) 30 | target = sitelib + relpath 31 | FileUtils.mkpath target.dirname, 32 | :mode => 0755, :verbose => true, :noop => $dryrun unless target.dirname.directory? 33 | FileUtils.install relpath, target, 34 | :mode => 0644, :verbose => true, :noop => $dryrun 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /experiments/can_you_override.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'enumerator' 4 | 5 | # This is an experiment to see what operator methods from the pickaxe 6 | # (3ed) you can override. The theory being that if you can override 7 | # it using define_method, you can certainly override it using 8 | # rb_define_method(). 9 | 10 | OPERATORS = [ 11 | '<<', '_lshift', 12 | '>>', '_rshift', 13 | '[]=', '_aset', 14 | '[]', '_aref', 15 | '**', '_pow', 16 | '~', '_complement', 17 | '!', '_bang', 18 | '+@', '_uplus', 19 | '-@', '_uminus', 20 | '+', '_add', 21 | '-', '_sub', 22 | '*', '_mult', 23 | '/', '_div', 24 | '%', '_mod', 25 | '<=>', '_comp', 26 | '==', '_equal', 27 | '===', '_eqq', 28 | '>', '_gt', 29 | '>=', '_ge', 30 | '<', '_lt', 31 | '<=', '_le', 32 | '&', '_and', 33 | '|', '_or', 34 | '^', '_xor', 35 | '=~', '_match', 36 | ] 37 | 38 | class Playground 39 | 40 | OPERATORS.each_slice( 2 ) do |op, name| 41 | define_method( op ) do 42 | puts "Method #{name} works." 43 | end 44 | end 45 | 46 | end 47 | 48 | o = Playground.new 49 | 50 | o =~ 1 51 | o << 1 52 | o >> 1 53 | o[1]= 1 54 | o[1] 55 | o ** 1 56 | if !o; whee!; end 57 | ~o 58 | +o 59 | -o 60 | o + 1 61 | o - 1 62 | o * 1 63 | o / 1 64 | o % 1 65 | o <=> 1 66 | o == 1 67 | o === 1 68 | o > 1 69 | o >= 1 70 | o < 1 71 | o <= 1 72 | o | 1 73 | o & 1 74 | o ^ 1 75 | o =~ 1 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2010, Michael Granger. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | * Neither the name of the author/s, nor the names of the project's 14 | contributors may be used to endorse or promote products derived from this 15 | software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /spec/rdoc/generator/darkfish_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | BEGIN { 4 | require 'pathname' 5 | basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent 6 | 7 | libdir = basedir + "lib" 8 | 9 | $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir ) 10 | } 11 | 12 | require 'spec' 13 | require 'rdoc' 14 | require 'rdoc/generator/darkfish' 15 | 16 | 17 | describe RDoc::Generator::Darkfish do 18 | 19 | it "can create an instance via the generator factory method" do 20 | options = RDoc::Options.new 21 | RDoc::Generator::Darkfish.for( options ). 22 | should be_an_instance_of( RDoc::Generator::Darkfish ) 23 | end 24 | 25 | 26 | describe "an instance" do 27 | 28 | before( :each ) do 29 | $dryrun = true 30 | @options = RDoc::Options.new 31 | @generator = RDoc::Generator::Darkfish.for( @options ) 32 | end 33 | 34 | 35 | it "generates the required subdirectories" do 36 | outputdir = mock( "mock outputdir" ) 37 | outputdir.should_receive( :mkpath ) 38 | 39 | @generator.instance_variable_set( :@outputdir, outputdir ) 40 | @generator.gen_sub_directories 41 | end 42 | 43 | 44 | it "copies static files over during #write_style_sheet" do 45 | FileUtils.should_receive( :cp_r ). 46 | with( an_instance_of(Pathname), '.', :verbose => $DEBUG, :noop => $dryrun ). 47 | exactly( 3 ).times 48 | @generator.write_style_sheet 49 | end 50 | 51 | it "adjusts to changes in RDoc 2.2.0 (::build_indices vs. ::build_indicies)" do 52 | RDoc::Generator::Context.should_receive( :respond_to? ).with( :build_indicies ). 53 | and_return( false ) 54 | RDoc::Generator::Context.should_receive( :build_indices ).with( :toplevels, @options ). 55 | and_return([ {}, {} ]) 56 | 57 | @generator.generate( :toplevels ) 58 | end 59 | 60 | end 61 | end 62 | 63 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/index.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | <%= h options.title %> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | <% $stderr.sync = true %> 22 |

<%= h options.title %>

23 | 24 | <% if options.main_page && files.key?( options.main_page ) %> 25 |
26 | <%= files[ options.main_page ][:description].sub(%r{^\s*}i, '') %> 27 |
28 | <% else %> 29 |

This is the API documentation for '<%= options.title %>'.

30 | <% end %> 31 | 32 | <% simple_files = files.select {|_, file| file[:parser] == RDoc::Parser::Simple } %> 33 | <% unless simple_files.empty? then %> 34 |

Files

35 | 40 | <% end %> 41 | 42 |

Classes/Modules

43 | 50 | 51 |
52 |

[Validate]

53 |

Generated with the Darkfish 54 | Rdoc Generator <%= RDoc::Generator::Darkfish::VERSION %>.

55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | = Darkfish Rdoc Generator 2 | 3 | This is a complete replacement for the default HTML generator for Rdoc 2. 4 | 5 | I created it with a few goals in mind: 6 | 7 | * Replace the four-frame layout with three different indexes with a single-page, 8 | class/module-focused view. 9 | 10 | * I helped write what became the default look and feel for Rdoc, but it's 11 | starting to show its age. I wanted to update it with new CSS and Javascript 12 | for modern browsers. 13 | 14 | * Add some of the nifty searching and index-on-the-side stuff I liked from the 15 | modified Allison template (http://www.superalloy.nl/blog/?p=7) Eloy 16 | Duran came up with. 17 | 18 | * Implemented using separate ERB template files instead of Rdoc's 19 | constants-in-a-module style templating. 20 | 21 | I think I mostly succeeded, and it's nice enough that I wanted to use it for all 22 | my documentation, and I thought you might want to, too. Or at least be able to 23 | tweak it to generate your own spiffy docs. 24 | 25 | It looks like this: 26 | 27 | http://deveiate.org/darkfish_preview.png 28 | 29 | == Getting Started 30 | 31 | If you haven't installed it yet, you can install it via RubyGems: 32 | 33 | $ sudo gem install darkfish-rdoc 34 | 35 | Or download the source and do: 36 | 37 | $ sudo rake install 38 | 39 | == Usage 40 | 41 | If you're using RDoc 2.3 or later, the Darkfish formatter will be automatically discovered when RDoc 42 | is loaded, so you only have to specify that you want the 'darkfish' formatter: 43 | 44 | $ rdoc -w 4 -SHN -f darkfish -m README README lib 45 | 46 | It's equally easy to specify from a Rakefile in an RDocTask: 47 | 48 | ### Task: rdoc 49 | require 'rake/rdoctask' 50 | gem 'darkfish-rdoc' # Omit this if it's installed as a regular library 51 | 52 | Rake::RDocTask.new do |rdoc| 53 | rdoc.title = "My Awesome SnoCone Library" 54 | 55 | rdoc.options += [ 56 | '-w', '4', 57 | '-SHN', 58 | '-f', 'darkfish', # This bit 59 | '-m', 'README', 60 | ] 61 | 62 | rdoc.rdoc_files.include 'README' 63 | rdoc.rdoc_files.include 'lib/snocone.rb' 64 | end 65 | 66 | 67 | That's it. 68 | 69 | == Feedback 70 | 71 | I'd be happy to have feedback via email (ged at FaerieMUD dot org) 72 | or a ticket on the project's Trac: 73 | 74 | http://deveiate.org/projects/Darkfish-RDoc/ 75 | 76 | == License 77 | 78 | See the LICENSE file included with the distribution for copyright and licensing details. 79 | 80 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/js/quicksearch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * JQuery QuickSearch - Hook up a form field to hide non-matching elements. 4 | * $Id$ 5 | * 6 | * Author: Michael Granger 7 | * 8 | */ 9 | jQuery.fn.quicksearch = function( target, searchElems, options ) { 10 | // console.debug( "Quicksearch fn" ); 11 | 12 | var settings = { 13 | delay: 250, 14 | clearButton: false, 15 | highlightMatches: false, 16 | focusOnLoad: false, 17 | noSearchResultsIndicator: null 18 | }; 19 | if ( options ) $.extend( settings, options ); 20 | 21 | return jQuery(this).each( function() { 22 | // console.debug( "Creating a new quicksearch on %o for %o", this, searchElems ); 23 | new jQuery.quicksearch( this, searchElems, settings ); 24 | }); 25 | }; 26 | 27 | 28 | jQuery.quicksearch = function( searchBox, searchElems, settings ) { 29 | var timeout; 30 | var boxdiv = $(searchBox).parents('div').eq(0); 31 | 32 | function init() { 33 | setupKeyEventHandlers(); 34 | focusOnLoad(); 35 | }; 36 | 37 | function setupKeyEventHandlers() { 38 | // console.debug( "Hooking up the 'keypress' event to %o", searchBox ); 39 | $(searchBox). 40 | unbind( 'keyup' ). 41 | keyup( function(e) { return onSearchKey( e.keyCode ); }); 42 | $(searchBox). 43 | unbind( 'keypress' ). 44 | keypress( function(e) { 45 | switch( e.which ) { 46 | // Execute the search on Enter, Tab, or Newline 47 | case 9: 48 | case 13: 49 | case 10: 50 | clearTimeout( timeout ); 51 | e.preventDefault(); 52 | doQuickSearch(); 53 | break; 54 | 55 | // Allow backspace 56 | case 8: 57 | return true; 58 | break; 59 | 60 | // Only allow valid search characters 61 | default: 62 | return validQSChar( e.charCode ); 63 | } 64 | }); 65 | }; 66 | 67 | function focusOnLoad() { 68 | if ( !settings.focusOnLoad ) return false; 69 | $(searchBox).focus(); 70 | }; 71 | 72 | function onSearchKey ( code ) { 73 | clearTimeout( timeout ); 74 | // console.debug( "...scheduling search." ); 75 | timeout = setTimeout( doQuickSearch, settings.delay ); 76 | }; 77 | 78 | function validQSChar( code ) { 79 | var c = String.fromCharCode( code ); 80 | return ( 81 | (c == ':') || 82 | (c >= 'a' && c <= 'z') || 83 | (c >= 'A' && c <= 'Z') 84 | ); 85 | }; 86 | 87 | function doQuickSearch() { 88 | var searchText = searchBox.value; 89 | var pat = new RegExp( searchText, "im" ); 90 | var shownCount = 0; 91 | 92 | if ( settings.noSearchResultsIndicator ) { 93 | $('#' + settings.noSearchResultsIndicator).hide(); 94 | } 95 | 96 | // All elements start out hidden 97 | $(searchElems).each( function(index) { 98 | var str = $(this).text(); 99 | 100 | if ( pat.test(str) ) { 101 | shownCount += 1; 102 | $(this).fadeIn(); 103 | } else { 104 | $(this).hide(); 105 | } 106 | }); 107 | 108 | if ( shownCount == 0 && settings.noSearchResultsIndicator ) { 109 | $('#' + settings.noSearchResultsIndicator).slideDown(); 110 | } 111 | }; 112 | 113 | init(); 114 | }; 115 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/js/darkfish.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Darkfish Page Functions 4 | * $Id$ 5 | * 6 | * Author: Michael Granger 7 | * 8 | */ 9 | 10 | /* Provide console simulation for firebug-less environments */ 11 | if (!("console" in window) || !("firebug" in console)) { 12 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", 13 | "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; 14 | 15 | window.console = {}; 16 | for (var i = 0; i < names.length; ++i) 17 | window.console[names[i]] = function() {}; 18 | }; 19 | 20 | 21 | /** 22 | * Unwrap the first element that matches the given @expr@ from the targets and return them. 23 | */ 24 | $.fn.unwrap = function( expr ) { 25 | return this.each( function() { 26 | $(this).parents( expr ).eq( 0 ).after( this ).remove(); 27 | }); 28 | }; 29 | 30 | 31 | function showSource( e ) { 32 | var target = e.target; 33 | var codeSections = $(target). 34 | parents('.method-detail'). 35 | find('.method-source-code'); 36 | 37 | $(target). 38 | parents('.method-detail'). 39 | find('.method-source-code'). 40 | slideToggle(); 41 | }; 42 | 43 | function hookSourceViews() { 44 | $('.method-description,.method-heading').click( showSource ); 45 | }; 46 | 47 | function toggleDebuggingSection() { 48 | $('.debugging-section').slideToggle(); 49 | }; 50 | 51 | function hookDebuggingToggle() { 52 | $('#debugging-toggle img').click( toggleDebuggingSection ); 53 | }; 54 | 55 | function hookQuickSearch() { 56 | $('.quicksearch-field').each( function() { 57 | var searchElems = $(this).parents('.section').find( 'li' ); 58 | var toggle = $(this).parents('.section').find('h3 .search-toggle'); 59 | // console.debug( "Toggle is: %o", toggle ); 60 | var qsbox = $(this).parents('form').get( 0 ); 61 | 62 | $(this).quicksearch( this, searchElems, { 63 | noSearchResultsIndicator: 'no-class-search-results', 64 | focusOnLoad: false 65 | }); 66 | $(toggle).click( function() { 67 | // console.debug( "Toggling qsbox: %o", qsbox ); 68 | $(qsbox).toggle(); 69 | }); 70 | }); 71 | }; 72 | 73 | function highlightTarget( anchor ) { 74 | console.debug( "Highlighting target '%s'.", anchor ); 75 | 76 | $("a[name=" + anchor + "]").each( function() { 77 | if ( !$(this).parent().parent().hasClass('target-section') ) { 78 | console.debug( "Wrapping the target-section" ); 79 | $('div.method-detail').unwrap( 'div.target-section' ); 80 | $(this).parent().wrap( '
' ); 81 | } else { 82 | console.debug( "Already wrapped." ); 83 | } 84 | }); 85 | }; 86 | 87 | function highlightLocationTarget() { 88 | console.debug( "Location hash: %s", window.location.hash ); 89 | if ( ! window.location.hash || window.location.hash.length == 0 ) return; 90 | 91 | var anchor = window.location.hash.substring(1); 92 | console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" ); 93 | 94 | highlightTarget( anchor ); 95 | }; 96 | 97 | function highlightClickTarget( event ) { 98 | console.debug( "Highlighting click target for event %o", event.target ); 99 | try { 100 | var anchor = $(event.target).attr( 'href' ).substring(1); 101 | console.debug( "Found target anchor: %s", anchor ); 102 | highlightTarget( anchor ); 103 | } catch ( err ) { 104 | console.error( "Exception while highlighting: %o", err ); 105 | }; 106 | }; 107 | 108 | 109 | $(document).ready( function() { 110 | hookSourceViews(); 111 | hookDebuggingToggle(); 112 | hookQuickSearch(); 113 | highlightLocationTarget(); 114 | 115 | $('ul.link-list a, a.xref').bind( "click", highlightClickTarget ); 116 | }); 117 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/filepage.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | <%= fileinfo[:title] %> 10 | 11 | 12 | 13 | 15 | 17 | 19 | 21 | 22 | 23 | <% if fileinfo[:parser] == RDoc::Parser::Simple %> 24 | 25 |
26 |
27 | <% simple_files = files.select {|_, file| file[:parser] == RDoc::Parser::Simple } %> 28 | <% unless simple_files.empty? then %> 29 |
30 |

Files

31 | 37 |
38 | <% end %> 39 | 40 |
41 |

Class Index 42 | [+]

45 |
46 |
47 | Quicksearch 48 | 50 |
51 |
52 | 53 | 59 | 60 |
61 | 62 | <% if $DEBUG %> 63 |
toggle debugging
65 | <% end %> 66 |
67 |
68 | 69 |
70 | <%= fileinfo[:description] %> 71 |
72 | 73 |
74 |

[Validate]

75 |

Generated with the Darkfish 76 | Rdoc Generator <%= RDoc::Generator::Darkfish::VERSION %>.

77 |
78 | 79 | <% else %> 80 | 81 |
82 |
83 |
Last Modified
84 |
<%= fileinfo[:dtm_modified] %>
85 | 86 | <% if fileinfo[:requires] %> 87 |
Requires
88 |
89 |
    90 | <% fileinfo[:requires].each do |dependency| %> 91 |
  • <%= dependency[:name] %>
  • 92 | <% end %> 93 |
94 |
95 | <% end %> 96 | 97 | <% if fileinfo[:cvsurl] %> 98 |
Trac URL
99 |
<%= fileinfo[:cvsurl] %>
101 | <% end %> 102 |
103 | 104 | <% if fileinfo[:description] %> 105 |
106 |

Description

107 | <%= fileinfo[:description] %> 108 |
109 | <% end %> 110 |
111 | 112 | <% end %> 113 | 114 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Thickbox 3 - One Box To Rule Them All. 3 | * By Cody Lindley (http://www.codylindley.com) 4 | * Copyright (c) 2007 cody lindley 5 | * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php 6 | */ 7 | 8 | var tb_pathToImage = "../images/loadingAnimation.gif"; 9 | 10 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<4 5=\'B\'><4 5=\'8\'>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'><4 5=\'8\'>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' />");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D&1d;&1d;2T &2R;"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;&2O; 2N"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"<4 5=\'2A\'>1l 1k 1j 1s");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"<4 5=\'2e\'>1l 1k 1j 1s ")}n{$("#B").N();$("#8").q(" ")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"<4 5=\'2e\'>1l 1k 1j 1s<4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i 2 | 4 | 5 | 6 | 7 | 8 | 9 | ThingFish 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 |

ThingFish

23 | 24 |

ThingFish is a highly-accessible network store for cataloging large files and their 25 | associated metadata.

26 | 27 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/classpage.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | <%= classinfo[:classmod] %>: <%= classinfo[:full_name] %> 9 | 10 | 11 | 12 | 14 | 16 | 18 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 |

In Files

28 |
29 | 35 |
36 |
37 | 38 | <% if !svninfo.empty? %> 39 |
40 |

Subversion Info

41 |
42 |
43 |
Rev
44 |
<%= svninfo[:rev] %>
45 | 46 |
Last Checked In
47 |
<%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %> 48 | (<%= svninfo[:commitdelta] %> ago)
49 | 50 |
Checked in by
51 |
<%= svninfo[:committer] %>
52 |
53 |
54 |
55 | <% end %> 56 |
57 | 58 |
59 | 60 | 61 | <% if classinfo[:classmod] == 'Class' %> 62 |
63 |

Parent

64 | <% if classinfo[:par_url] %> 65 | 66 | <% else %> 67 | 68 | <% end %> 69 |
70 | <% end %> 71 | 72 | 73 | <% if classinfo[:sections].first.key?( :classlist ) %> 74 |
75 |

Namespace

76 | 81 |
82 | <% end %> 83 | 84 | 85 | <% if classinfo.key?( :methods ) %> 86 |
87 |

Methods

88 | 93 |
94 | <% end %> 95 | 96 | 97 | <% if classinfo[:includes] %> 98 |
99 |

Included Modules

100 | 109 |
110 | <% end %> 111 |
112 | 113 |
114 | <% simple_files = files.select {|_, file| file[:parser] == RDoc::Parser::Simple } %> 115 | <% unless simple_files.empty? then %> 116 |
117 |

Files

118 | 123 |
124 | <% end %> 125 | 126 |
127 |

Class Index 128 | [+]

131 |
132 |
133 | Quicksearch 134 | 136 |
137 |
138 | 139 | 145 | 146 |
147 | 148 | <% if $DEBUG %> 149 |
toggle debugging
151 | <% end %> 152 |
153 |
154 | 155 |
156 | <% if classinfo[:classmod] == 'Class' %> 157 |

<%= classinfo[:full_name] %>

158 | <% else %> 159 |

<%= classinfo[:full_name] %>

160 | <% end %> 161 | 162 |
163 | <%= classinfo[:description] %> 164 |
165 | 166 | 167 | 168 | <% if classinfo[:sections].first[:constants] %> 169 |
170 |

Constants

171 |
172 | <% classinfo[:sections].first[:constants].each do |const| %> 173 |
<%= const[:name] %>
174 | <% if const[:desc] %> 175 |
<%= const[:desc].strip %>
176 | <% else %> 177 |
(Not documented)
178 | <% end %> 179 | <% end %> 180 |
181 |
182 | <% end %> 183 | 184 | 185 | <% if classinfo[:sections].first[:attributes] %> 186 |
187 |

Attributes

188 | 189 | <% classinfo[:sections].first[:attributes].each do |attrib| %> 190 |
191 | 192 | <% if attrib[:rw] =~ /w/i %> 193 | 194 | <% end %> 195 |
196 | <%= h attrib[:name] %>[<%= attrib[:rw] %>] 198 |
199 | 200 |
201 | <% if attrib[:a_desc] && !attrib[:a_desc].empty? %> 202 | <%= attrib[:a_desc].strip %> 203 | <% else %> 204 |

(Not documented)

205 | <% end %> 206 |
207 |
208 | <% end %> 209 |
210 | <% end %> 211 | 212 | 213 | <% if classinfo[:sections].first[:method_list] %> 214 | <% classinfo[:sections].first[:method_list].each do |methodlist| %> 215 |
216 |

<%= methodlist[:type] %> <%= methodlist[:category] %> Methods

217 | 218 | <% methodlist[:methods].each do |methodinfo| %> 219 | 220 | <% 221 | # If the method doesn't have a 'name' attribute, it's defined in C, so make one out of the 222 | # first method name in the callseq. 223 | unless methodinfo[:name] 224 | methodinfo[:name] = methodinfo[:callseq][/^.*?\.(\w+)/, 1] || methodinfo[:callseq] 225 | end 226 | 227 | %> 228 | <% if methodinfo[:m_desc] =~ /Alias for/ %> 229 |
230 | <% else %> 231 |
232 | <% end %> 233 | 234 | 235 |
236 | <% if methodinfo[:callseq] %> 237 | <%= methodinfo[:callseq].strip.gsub( /^\w.*?\./m, '') %> 238 | click to toggle source 239 | <% else %> 240 | <%= methodinfo[:name] %><%= methodinfo[:params] %> 242 | click to toggle source 243 | <% end %> 244 |
245 | 246 |
247 | <% if methodinfo[:m_desc] %> 248 | <%= methodinfo[:m_desc].strip.gsub(%r{(.*?)}) do |m| 249 | %{#$2} 250 | end 251 | %> 252 | <% else %> 253 |

(Not documented)

254 | <% end %> 255 | 256 | <% if methodinfo[:sourcecode] %> 257 |
259 |
260 | <%= methodinfo[:sourcecode] %>
261 | 
262 |
263 | <% end %> 264 |
265 | 266 | <% if methodinfo[:aka] %> 267 |
268 | Also aliased as: <%= methodinfo[:aka].collect do |aliasinfo| 269 | %{##{aliasinfo[:name]}} 270 | end.join(", ") %> 271 |
272 | <% end %> 273 |
274 | 275 | <% end %> 276 |
277 | <% end %> 278 | <% end %> 279 | 280 |
281 | 282 | 283 |
284 | <% if $DEBUG %> 285 | <% classinfo[:sections].first.keys.each do |section| %> 286 |
287 |

<%= section %>

288 | 289 |
<%= h classinfo[:sections].first[section].to_yaml %>
290 |
291 | <% end %> 292 | <% else %> 293 |

Disabled; run with $DEBUG to generate this.

294 | <% end %> 295 |
296 | 297 |
298 |

[Validate]

299 |

Generated with the Darkfish 300 | Rdoc Generator <%= RDoc::Generator::Darkfish::VERSION %>.

301 |
302 | 303 | 304 | 305 | 306 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!rake 2 | # 3 | # Darkfish-Rdoc rakefile 4 | # 5 | # Based on various other Rakefiles, especially one by Ben Bleything 6 | # 7 | # Copyright (c) 2007-2009 The FaerieMUD Consortium 8 | # 9 | # Authors: 10 | # * Michael Granger 11 | # 12 | 13 | BEGIN { 14 | require 'pathname' 15 | basedir = Pathname.new( __FILE__ ).dirname 16 | 17 | libdir = basedir + "lib" 18 | extdir = basedir + "ext" 19 | 20 | $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s ) 21 | $LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s ) 22 | } 23 | 24 | begin 25 | require 'readline' 26 | include Readline 27 | rescue LoadError 28 | # Fall back to a plain prompt 29 | def readline( text ) 30 | $stderr.print( text.chomp ) 31 | return $stdin.gets 32 | end 33 | end 34 | 35 | require 'rbconfig' 36 | require 'rake' 37 | require 'rake/testtask' 38 | require 'rake/packagetask' 39 | require 'rake/clean' 40 | # require 'rake/191_compat.rb' 41 | 42 | $dryrun = false 43 | 44 | ### Config constants 45 | BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd ) 46 | BINDIR = BASEDIR + 'bin' 47 | LIBDIR = BASEDIR + 'lib' 48 | EXTDIR = BASEDIR + 'ext' 49 | DOCSDIR = BASEDIR + 'docs' 50 | PKGDIR = BASEDIR + 'pkg' 51 | DATADIR = BASEDIR + 'data' 52 | 53 | MANUALDIR = DOCSDIR + 'manual' 54 | 55 | PROJECT_NAME = 'Darkfish-Rdoc' 56 | PKG_NAME = PROJECT_NAME.downcase 57 | PKG_SUMMARY = 'A pretty (different) Rdoc HTML generator' 58 | 59 | # Cruisecontrol stuff 60 | CC_BUILD_LABEL = ENV['CC_BUILD_LABEL'] 61 | CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' 62 | 63 | VERSION_FILE = LIBDIR + 'rdoc/generator/darkfish.rb' 64 | if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL'] 65 | PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev 66 | elsif VERSION_FILE.exist? 67 | PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] 68 | else 69 | PKG_VERSION = '0.0.0' 70 | end 71 | 72 | PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}" 73 | GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem" 74 | 75 | # Universal VCS constants 76 | DEFAULT_EDITOR = 'vi' 77 | COMMIT_MSG_FILE = 'commit-msg.txt' 78 | FILE_INDENT = " " * 12 79 | LOG_INDENT = " " * 3 80 | 81 | EXTCONF = EXTDIR + 'extconf.rb' 82 | 83 | ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS ) 84 | 85 | TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README LICENSE] ) 86 | BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" ) 87 | LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" ) 88 | EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" ) 89 | DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" ) 90 | 91 | SPECDIR = BASEDIR + 'spec' 92 | SPECLIBDIR = SPECDIR + 'lib' 93 | SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" ) 94 | 95 | TESTDIR = BASEDIR + 'tests' 96 | TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" ) 97 | 98 | RAKE_TASKDIR = BASEDIR + 'rake' 99 | RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" ) 100 | PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" ) 101 | PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist? 102 | 103 | RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs' 104 | 105 | LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local' 106 | 107 | EXTRA_PKGFILES = Rake::FileList.new 108 | EXTRA_PKGFILES.include( "#{BASEDIR}/lib/rdoc/generator/**/*.{css,rhtml,png,js}" ) 109 | 110 | RELEASE_FILES = TEXT_FILES + 111 | SPEC_FILES + 112 | TEST_FILES + 113 | BIN_FILES + 114 | LIB_FILES + 115 | EXT_FILES + 116 | DATA_FILES + 117 | RAKE_TASKLIBS + 118 | EXTRA_PKGFILES 119 | 120 | 121 | RELEASE_FILES << LOCAL_RAKEFILE.to_s if LOCAL_RAKEFILE.exist? 122 | 123 | COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0 124 | RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib' 125 | RCOV_OPTS = [ 126 | '--exclude', RCOV_EXCLUDES, 127 | '--xrefs', 128 | '--save', 129 | '--callsites', 130 | #'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0 131 | ] 132 | 133 | 134 | ### Load some task libraries that need to be loaded early 135 | if !RAKE_TASKDIR.exist? 136 | $stderr.puts "It seems you don't have the build task directory. Shall I fetch it " 137 | ans = readline( "for you? [y]" ) 138 | ans = 'y' if !ans.nil? && ans.empty? 139 | 140 | if ans =~ /^y/i 141 | $stderr.puts "Okay, fetching #{RAKE_TASKLIBS_URL} into #{RAKE_TASKDIR}..." 142 | system 'hg', 'clone', RAKE_TASKLIBS_URL, RAKE_TASKDIR 143 | if ! $?.success? 144 | fail "Damn. That didn't work. Giving up; maybe try manually fetching?" 145 | end 146 | else 147 | $stderr.puts "Then I'm afraid I can't continue. Best of luck." 148 | fail "Rake tasklibs not present." 149 | end 150 | 151 | RAKE_TASKLIBS.include( "#{RAKE_TASKDIR}/*.rb" ) 152 | end 153 | 154 | require RAKE_TASKDIR + 'helpers.rb' 155 | 156 | # Define some constants that depend on the 'svn' tasklib 157 | if hg = which( 'hg' ) 158 | id = IO.read('|-') or exec hg, 'id', '-q' 159 | PKG_BUILD = id.chomp 160 | else 161 | PKG_BUILD = 0 162 | end 163 | SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}" 164 | SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem" 165 | 166 | # Documentation constants 167 | RDOCDIR = DOCSDIR + 'api' 168 | RDOC_OPTIONS = [ 169 | '-w', '4', 170 | '-HN', 171 | '-i', '.', 172 | '-m', 'README', 173 | '-t', PKG_NAME, 174 | '-W', 'http://deveiate.org/projects/Darkfish-Rdoc/browser/' 175 | ] 176 | 177 | # Release constants 178 | SMTP_HOST = 'mail.faeriemud.org' 179 | SMTP_PORT = 465 # SMTP + SSL 180 | 181 | # Project constants 182 | PROJECT_HOST = 'deveiate' 183 | PROJECT_PUBDIR = '/usr/local/www/public/code' 184 | PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}" 185 | PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}" 186 | PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}" 187 | 188 | # Rubyforge stuff 189 | RUBYFORGE_GROUP = 'deveiate' 190 | RUBYFORGE_PROJECT = 'darkfish-rdoc' 191 | 192 | # Gem dependencies: gemname => version 193 | DEPENDENCIES = { 194 | 'rdoc' => '>= 2.3', 195 | } 196 | 197 | # Developer Gem dependencies: gemname => version 198 | DEVELOPMENT_DEPENDENCIES = { 199 | 'amatch' => '>= 0.2.3', 200 | 'rake' => '>= 0.8.1', 201 | 'rcodetools' => '>= 0.7.0.0', 202 | 'rcov' => '>= 0', 203 | 'RedCloth' => '>= 4.0.3', 204 | 'rspec' => '>= 0', 205 | 'rubyforge' => '>= 0', 206 | 'termios' => '>= 0', 207 | 'text-format' => '>= 1.0.0', 208 | 'tmail' => '>= 1.2.3.1', 209 | 'ultraviolet' => '>= 0.10.2', 210 | 'libxml-ruby' => '>= 0.8.3', 211 | 'rdoc' => '>= 2.4.3', 212 | } 213 | 214 | # Non-gem requirements: packagename => version 215 | REQUIREMENTS = { 216 | } 217 | 218 | # RubyGem specification 219 | GEMSPEC = Gem::Specification.new do |gem| 220 | gem.name = PKG_NAME.downcase 221 | gem.version = PKG_VERSION 222 | 223 | gem.summary = PKG_SUMMARY 224 | gem.description = [ 225 | "A complete replacement for the default HTML generator for Rdoc, the", 226 | "API documentation-extraction system for Ruby. ", 227 | ].join( "\n" ) 228 | gem.post_install_message = [ 229 | "To use the Darkfish formatter, just add '-f darkfish' to your rdoc command of choice.", 230 | ].join( "\n" ) 231 | 232 | gem.authors = "Michael Granger" 233 | gem.email = ["ged@FaerieMUD.org"] 234 | gem.homepage = 'http://deveiate.org/projects/Darkfish-Rdoc/' 235 | gem.rubyforge_project = RUBYFORGE_PROJECT 236 | 237 | gem.has_rdoc = true 238 | gem.rdoc_options = RDOC_OPTIONS 239 | gem.extra_rdoc_files = %w[ChangeLog README LICENSE] 240 | 241 | gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s 242 | gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }. 243 | collect {|pn| File.basename(pn) } 244 | gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s if EXTDIR.exist? 245 | 246 | if EXTCONF.exist? 247 | gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s 248 | end 249 | 250 | gem.files = RELEASE_FILES 251 | gem.test_files = SPEC_FILES 252 | 253 | DEPENDENCIES.each do |name, version| 254 | version = '>= 0' if version.length.zero? 255 | gem.add_runtime_dependency( name, version ) 256 | end 257 | 258 | # Developmental dependencies don't work as of RubyGems 1.2.0 259 | unless Gem::Version.new( Gem::RubyGemsVersion ) <= Gem::Version.new( "1.2.0" ) 260 | DEVELOPMENT_DEPENDENCIES.each do |name, version| 261 | version = '>= 0' if version.length.zero? 262 | gem.add_development_dependency( name, version ) 263 | end 264 | end 265 | 266 | REQUIREMENTS.each do |name, version| 267 | gem.requirements << [ name, version ].compact.join(' ') 268 | end 269 | end 270 | 271 | $trace = Rake.application.options.trace ? true : false 272 | $dryrun = Rake.application.options.dryrun ? true : false 273 | 274 | 275 | # Load any remaining task libraries 276 | RAKE_TASKLIBS.each do |tasklib| 277 | next if tasklib.to_s =~ %r{/helpers\.rb$} 278 | begin 279 | trace " loading tasklib %s" % [ tasklib ] 280 | import tasklib 281 | rescue ScriptError => err 282 | fail "Task library '%s' failed to load: %s: %s" % 283 | [ tasklib, err.class.name, err.message ] 284 | trace "Backtrace: \n " + err.backtrace.join( "\n " ) 285 | rescue => err 286 | log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." % 287 | [ tasklib, err.class.name, err.message ] 288 | trace "Backtrace: \n " + err.backtrace.join( "\n " ) 289 | end 290 | end 291 | 292 | # Load any project-specific rules defined in 'Rakefile.local' if it exists 293 | import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist? 294 | 295 | 296 | ##################################################################### 297 | ### T A S K S 298 | ##################################################################### 299 | 300 | ### Default task 301 | task :default => [:clean, :local, :spec, :rdoc, :package] 302 | 303 | ### Task the local Rakefile can append to -- no-op by default 304 | task :local 305 | 306 | 307 | ### Task: clean 308 | CLEAN.include 'coverage' 309 | CLOBBER.include 'artifacts', 'coverage.info', PKGDIR 310 | 311 | ### Task: changelog 312 | file 'ChangeLog' do |task| 313 | log "Updating #{task.name}" 314 | 315 | changelog = make_changelog() 316 | File.open( task.name, 'w' ) do |fh| 317 | fh.print( changelog ) 318 | end 319 | end 320 | 321 | 322 | ### Task: cruise (Cruisecontrol task) 323 | desc "Cruisecontrol build" 324 | task :cruise => [:clean, 'spec:quiet', :package] do |task| 325 | raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty? 326 | artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T')) 327 | artifact_dir.mkpath 328 | 329 | coverage = BASEDIR + 'coverage' 330 | if coverage.exist? && coverage.directory? 331 | $stderr.puts "Copying coverage stats..." 332 | FileUtils.cp_r( 'coverage', artifact_dir ) 333 | end 334 | 335 | $stderr.puts "Copying packages..." 336 | FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir ) 337 | end 338 | 339 | 340 | desc "Update the build system to the latest version" 341 | task :update_build do 342 | log "Updating the build system" 343 | run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u' 344 | log "Updating the Rakefile" 345 | sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile' 346 | end 347 | 348 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/rdoc.css: -------------------------------------------------------------------------------- 1 | /* 2 | * "Darkfish" Rdoc CSS 3 | * $Id$ 4 | * 5 | * Author: Michael Granger 6 | * 7 | */ 8 | 9 | /* Base Green is: #6C8C22 */ 10 | 11 | *{ padding: 0; margin: 0; } 12 | 13 | body { 14 | background: #efefef; 15 | font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif; 16 | } 17 | body.class, body.module, body.file { 18 | margin-left: 40px; 19 | } 20 | body.file-popup { 21 | font-size: 90%; 22 | margin-left: 0; 23 | } 24 | 25 | h1 { 26 | font-size: 300%; 27 | text-shadow: rgba(135,145,135,0.65) 2px 2px 3px; 28 | color: #6C8C22; 29 | } 30 | h2,h3,h4 { margin-top: 1.5em; } 31 | 32 | a { 33 | color: #6C8C22; 34 | text-decoration: none; 35 | } 36 | a:hover { 37 | border-bottom: 1px dotted #6C8C22; 38 | } 39 | 40 | pre { 41 | background: #ddd; 42 | padding: 0.5em 0; 43 | } 44 | 45 | 46 | /* @group Generic Classes */ 47 | 48 | .initially-hidden { 49 | display: none; 50 | } 51 | 52 | .quicksearch-field { 53 | width: 98%; 54 | background: #ddd; 55 | border: 1px solid #aaa; 56 | height: 1.5em; 57 | -webkit-border-radius: 4px; 58 | } 59 | .quicksearch-field:focus { 60 | background: #f1edba; 61 | } 62 | 63 | .missing-docs { 64 | font-size: 120%; 65 | background: white url(images/wrench_orange.png) no-repeat 4px center; 66 | color: #ccc; 67 | line-height: 2em; 68 | border: 1px solid #d00; 69 | opacity: 1; 70 | padding-left: 20px; 71 | text-indent: 24px; 72 | letter-spacing: 3px; 73 | font-weight: bold; 74 | -webkit-border-radius: 5px; 75 | -moz-border-radius: 5px; 76 | } 77 | 78 | .target-section { 79 | border: 2px solid #dcce90; 80 | border-left-width: 8px; 81 | padding: 0 1em; 82 | background: #fff3c2; 83 | } 84 | 85 | /* @end */ 86 | 87 | 88 | /* @group Index Page, Standalone file pages */ 89 | body.indexpage { 90 | margin: 1em 3em; 91 | } 92 | body.indexpage p, 93 | body.indexpage div, 94 | body.file p { 95 | margin: 1em 0; 96 | } 97 | 98 | .indexpage ul, 99 | .file #documentation ul { 100 | line-height: 160%; 101 | list-style: none; 102 | } 103 | .indexpage ul a, 104 | .file #documentation ul a { 105 | font-size: 16px; 106 | } 107 | 108 | .indexpage li, 109 | .file #documentation li { 110 | padding-left: 20px; 111 | background: url(images/bullet_black.png) no-repeat left 4px; 112 | } 113 | .indexpage li.module { 114 | background: url(images/package.png) no-repeat left 4px; 115 | } 116 | .indexpage li.class { 117 | background: url(images/ruby.png) no-repeat left 4px; 118 | } 119 | .indexpage li.file { 120 | background: url(images/page_white_text.png) no-repeat left 4px; 121 | } 122 | 123 | /* @end */ 124 | 125 | /* @group Top-Level Structure */ 126 | 127 | .class #metadata, 128 | .file #metadata, 129 | .module #metadata { 130 | float: left; 131 | width: 260px; 132 | } 133 | 134 | .class #documentation, 135 | .file #documentation, 136 | .module #documentation { 137 | margin: 2em 1em 5em 300px; 138 | min-width: 340px; 139 | } 140 | 141 | .file #metadata { 142 | margin: 0.8em; 143 | } 144 | 145 | #validator-badges { 146 | clear: both; 147 | margin: 1em 1em 2em; 148 | } 149 | 150 | /* @end */ 151 | 152 | /* @group Metadata Section */ 153 | #metadata .section { 154 | background-color: #dedede; 155 | -moz-border-radius: 5px; 156 | -webkit-border-radius: 5px; 157 | border: 1px solid #aaa; 158 | margin: 0 8px 16px; 159 | font-size: 90%; 160 | overflow: hidden; 161 | } 162 | #metadata h3.section-header { 163 | margin: 0; 164 | padding: 2px 8px; 165 | background: #ccc; 166 | color: #666; 167 | -moz-border-radius-topleft: 4px; 168 | -moz-border-radius-topright: 4px; 169 | -webkit-border-top-left-radius: 4px; 170 | -webkit-border-top-right-radius: 4px; 171 | border-bottom: 1px solid #aaa; 172 | } 173 | #metadata ul, 174 | #metadata dl, 175 | #metadata p { 176 | padding: 8px; 177 | list-style: none; 178 | } 179 | 180 | #file-metadata ul { 181 | padding-left: 28px; 182 | list-style-image: url(images/page_green.png); 183 | } 184 | 185 | dl.svninfo { 186 | color: #666; 187 | margin: 0; 188 | } 189 | dl.svninfo dt { 190 | font-weight: bold; 191 | } 192 | 193 | ul.link-list li { 194 | white-space: nowrap; 195 | } 196 | ul.link-list .type { 197 | font-size: 8px; 198 | text-transform: uppercase; 199 | color: white; 200 | background: #969696; 201 | padding: 2px 4px; 202 | -webkit-border-radius: 5px; 203 | } 204 | 205 | /* @end */ 206 | 207 | 208 | /* @group Project Metadata Section */ 209 | #project-metadata { 210 | margin-top: 3em; 211 | } 212 | 213 | .file #project-metadata { 214 | margin-top: 0em; 215 | } 216 | 217 | #project-metadata .section { 218 | border: 1px solid #aaa; 219 | } 220 | #project-metadata h3.section-header { 221 | border-bottom: 1px solid #aaa; 222 | position: relative; 223 | } 224 | #project-metadata h3.section-header .search-toggle { 225 | position: absolute; 226 | right: 5px; 227 | } 228 | 229 | 230 | #project-metadata form { 231 | color: #777; 232 | background: #ccc; 233 | padding: 8px 8px 16px; 234 | border-bottom: 1px solid #bbb; 235 | } 236 | #project-metadata fieldset { 237 | border: 0; 238 | } 239 | 240 | #no-class-search-results { 241 | margin: 0 auto 1em; 242 | text-align: center; 243 | font-size: 14px; 244 | font-weight: bold; 245 | color: #aaa; 246 | } 247 | 248 | /* @end */ 249 | 250 | 251 | /* @group Documentation Section */ 252 | #description { 253 | font-size: 100%; 254 | color: #333; 255 | } 256 | 257 | #description p { 258 | margin: 1em 0.4em; 259 | } 260 | 261 | #description ul { 262 | margin-left: 2em; 263 | } 264 | #description ul li { 265 | line-height: 1.4em; 266 | } 267 | 268 | #description dl, 269 | #documentation dl { 270 | margin: 8px 1.5em; 271 | border: 1px solid #ccc; 272 | } 273 | #description dl { 274 | font-size: 14px; 275 | } 276 | 277 | #description dt, 278 | #documentation dt { 279 | padding: 2px 4px; 280 | font-weight: bold; 281 | background: #ddd; 282 | } 283 | #description dd, 284 | #documentation dd { 285 | padding: 2px 12px; 286 | } 287 | #description dd + dt, 288 | #documentation dd + dt { 289 | margin-top: 0.7em; 290 | } 291 | 292 | #documentation .section { 293 | font-size: 90%; 294 | } 295 | #documentation h3.section-header { 296 | margin-top: 2em; 297 | padding: 0.75em 0.5em; 298 | background-color: #dedede; 299 | color: #333; 300 | font-size: 150%; 301 | border: 1px solid #bbb; 302 | -moz-border-radius: 3px; 303 | -webkit-border-radius: 3px; 304 | } 305 | 306 | #constants-list > dl, 307 | #attributes-list > dl { 308 | margin: 1em 0 2em; 309 | border: 0; 310 | } 311 | #constants-list > dl dt, 312 | #attributes-list > dl dt { 313 | padding-left: 0; 314 | font-weight: bold; 315 | font-family: Monaco, "Andale Mono"; 316 | background: inherit; 317 | } 318 | #constants-list > dl dt a, 319 | #attributes-list > dl dt a { 320 | color: inherit; 321 | } 322 | #constants-list > dl dd, 323 | #attributes-list > dl dd { 324 | margin: 0 0 1em 0; 325 | padding: 0; 326 | color: #666; 327 | } 328 | 329 | /* @group Method Details */ 330 | 331 | #documentation .method-source-code { 332 | display: none; 333 | } 334 | 335 | #documentation .method-detail { 336 | margin: 0.5em 0; 337 | padding: 0.5em 0; 338 | cursor: pointer; 339 | } 340 | #documentation .method-detail:hover { 341 | background-color: #f1edba; 342 | } 343 | #documentation .method-alias { 344 | font-style: oblique; 345 | } 346 | #documentation .method-heading { 347 | position: relative; 348 | padding: 2px 4px 0 20px; 349 | font-size: 125%; 350 | font-weight: bold; 351 | color: #333; 352 | background: url(images/brick.png) no-repeat left bottom; 353 | } 354 | #documentation .method-heading a { 355 | color: inherit; 356 | } 357 | #documentation .method-click-advice { 358 | position: absolute; 359 | top: 2px; 360 | right: 5px; 361 | font-size: 10px; 362 | color: #9b9877; 363 | visibility: hidden; 364 | padding-right: 20px; 365 | line-height: 20px; 366 | background: url(images/zoom.png) no-repeat right top; 367 | } 368 | #documentation .method-detail:hover .method-click-advice { 369 | visibility: visible; 370 | } 371 | 372 | #documentation .method-alias .method-heading { 373 | color: #666; 374 | background: url(images/brick_link.png) no-repeat left bottom; 375 | } 376 | 377 | #documentation .method-description, 378 | #documentation .aliases { 379 | margin: 0 20px; 380 | line-height: 1.2em; 381 | color: #666; 382 | } 383 | #documentation .aliases { 384 | padding-top: 4px; 385 | font-style: italic; 386 | cursor: default; 387 | } 388 | #documentation .method-description p { 389 | padding: 0; 390 | } 391 | #documentation .method-description p + p { 392 | margin-bottom: 0.5em; 393 | } 394 | 395 | #documentation .attribute-method-heading { 396 | background: url(images/tag_green.png) no-repeat left bottom; 397 | } 398 | #documentation #attribute-method-details .method-detail:hover { 399 | background-color: transparent; 400 | cursor: default; 401 | } 402 | #documentation .attribute-access-type { 403 | font-size: 60%; 404 | text-transform: uppercase; 405 | vertical-align: super; 406 | padding: 0 2px; 407 | } 408 | /* @end */ 409 | 410 | /* @end */ 411 | 412 | 413 | 414 | /* @group Source Code */ 415 | 416 | a.source-toggle { 417 | font-size: 90%; 418 | } 419 | a.source-toggle img { 420 | 421 | } 422 | 423 | div.method-source-code { 424 | background: #262626; 425 | color: #efefef; 426 | margin: 1em; 427 | padding: 0.5em; 428 | border: 1px dashed #999; 429 | overflow: hidden; 430 | } 431 | 432 | div.method-source-code pre { 433 | background: inherit; 434 | padding: 0; 435 | color: white; 436 | overflow: hidden; 437 | } 438 | 439 | /* @group Ruby keyword styles */ 440 | 441 | .standalone-code { background: #221111; color: #ffdead; overflow: hidden; } 442 | 443 | .ruby-constant { color: #7fffd4; background: transparent; } 444 | .ruby-keyword { color: #00ffff; background: transparent; } 445 | .ruby-ivar { color: #eedd82; background: transparent; } 446 | .ruby-operator { color: #00ffee; background: transparent; } 447 | .ruby-identifier { color: #ffdead; background: transparent; } 448 | .ruby-node { color: #ffa07a; background: transparent; } 449 | .ruby-comment { color: #b22222; font-weight: bold; background: transparent; } 450 | .ruby-regexp { color: #ffa07a; background: transparent; } 451 | .ruby-value { color: #7fffd4; background: transparent; } 452 | 453 | /* @end */ 454 | /* @end */ 455 | 456 | 457 | /* @group File Popup Contents */ 458 | 459 | .file #metadata, 460 | .file-popup #metadata { 461 | } 462 | 463 | .file-popup dl { 464 | font-size: 80%; 465 | padding: 0.75em; 466 | background-color: #dedede; 467 | color: #333; 468 | border: 1px solid #bbb; 469 | -moz-border-radius: 3px; 470 | -webkit-border-radius: 3px; 471 | } 472 | .file dt { 473 | font-weight: bold; 474 | padding-left: 22px; 475 | line-height: 20px; 476 | background: url(images/page_white_width.png) no-repeat left top; 477 | } 478 | .file dt.modified-date { 479 | background: url(images/date.png) no-repeat left top; 480 | } 481 | .file dt.requires { 482 | background: url(images/plugin.png) no-repeat left top; 483 | } 484 | .file dt.scs-url { 485 | background: url(images/wrench.png) no-repeat left top; 486 | } 487 | 488 | .file dl dd { 489 | margin: 0 0 1em 0; 490 | } 491 | .file #metadata dl dd ul { 492 | list-style: circle; 493 | margin-left: 20px; 494 | padding-top: 0; 495 | } 496 | .file #metadata dl dd ul li { 497 | } 498 | 499 | 500 | .file h2 { 501 | margin-top: 2em; 502 | padding: 0.75em 0.5em; 503 | background-color: #dedede; 504 | color: #333; 505 | font-size: 120%; 506 | border: 1px solid #bbb; 507 | -moz-border-radius: 3px; 508 | -webkit-border-radius: 3px; 509 | } 510 | 511 | /* @end */ 512 | 513 | 514 | 515 | 516 | /* @group ThickBox Styles */ 517 | #TB_window { 518 | font: 12px Arial, Helvetica, sans-serif; 519 | color: #333333; 520 | } 521 | 522 | #TB_secondLine { 523 | font: 10px Arial, Helvetica, sans-serif; 524 | color:#666666; 525 | } 526 | 527 | #TB_window a:link {color: #666666;} 528 | #TB_window a:visited {color: #666666;} 529 | #TB_window a:hover {color: #000;} 530 | #TB_window a:active {color: #666666;} 531 | #TB_window a:focus{color: #666666;} 532 | 533 | #TB_overlay { 534 | position: fixed; 535 | z-index:100; 536 | top: 0px; 537 | left: 0px; 538 | height:100%; 539 | width:100%; 540 | } 541 | 542 | .TB_overlayMacFFBGHack {background: url(images/macFFBgHack.png) repeat;} 543 | .TB_overlayBG { 544 | background-color:#000; 545 | filter:alpha(opacity=75); 546 | -moz-opacity: 0.75; 547 | opacity: 0.75; 548 | } 549 | 550 | * html #TB_overlay { /* ie6 hack */ 551 | position: absolute; 552 | height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); 553 | } 554 | 555 | #TB_window { 556 | position: fixed; 557 | background: #ffffff; 558 | z-index: 102; 559 | color:#000000; 560 | display:none; 561 | border: 4px solid #525252; 562 | text-align:left; 563 | top:50%; 564 | left:50%; 565 | } 566 | 567 | * html #TB_window { /* ie6 hack */ 568 | position: absolute; 569 | margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 570 | } 571 | 572 | #TB_window img#TB_Image { 573 | display:block; 574 | margin: 15px 0 0 15px; 575 | border-right: 1px solid #ccc; 576 | border-bottom: 1px solid #ccc; 577 | border-top: 1px solid #666; 578 | border-left: 1px solid #666; 579 | } 580 | 581 | #TB_caption{ 582 | height:25px; 583 | padding:7px 30px 10px 25px; 584 | float:left; 585 | } 586 | 587 | #TB_closeWindow{ 588 | height:25px; 589 | padding:11px 25px 10px 0; 590 | float:right; 591 | } 592 | 593 | #TB_closeAjaxWindow{ 594 | padding:7px 10px 5px 0; 595 | margin-bottom:1px; 596 | text-align:right; 597 | float:right; 598 | } 599 | 600 | #TB_ajaxWindowTitle{ 601 | float:left; 602 | padding:7px 0 5px 10px; 603 | margin-bottom:1px; 604 | font-size: 22px; 605 | } 606 | 607 | #TB_title{ 608 | background-color: #6C8C22; 609 | color: #dedede; 610 | height:40px; 611 | } 612 | #TB_title a { 613 | color: white !important; 614 | border-bottom: 1px dotted #dedede; 615 | } 616 | 617 | #TB_ajaxContent{ 618 | clear:both; 619 | padding:2px 15px 15px 15px; 620 | overflow:auto; 621 | text-align:left; 622 | line-height:1.4em; 623 | } 624 | 625 | #TB_ajaxContent.TB_modal{ 626 | padding:15px; 627 | } 628 | 629 | #TB_ajaxContent p{ 630 | padding:5px 0px 5px 0px; 631 | } 632 | 633 | #TB_load{ 634 | position: fixed; 635 | display:none; 636 | height:13px; 637 | width:208px; 638 | z-index:103; 639 | top: 50%; 640 | left: 50%; 641 | margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ 642 | } 643 | 644 | * html #TB_load { /* ie6 hack */ 645 | position: absolute; 646 | margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 647 | } 648 | 649 | #TB_HideSelect{ 650 | z-index:99; 651 | position:fixed; 652 | top: 0; 653 | left: 0; 654 | background-color:#fff; 655 | border:none; 656 | filter:alpha(opacity=0); 657 | -moz-opacity: 0; 658 | opacity: 0; 659 | height:100%; 660 | width:100%; 661 | } 662 | 663 | * html #TB_HideSelect { /* ie6 hack */ 664 | position: absolute; 665 | height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); 666 | } 667 | 668 | #TB_iframeContent{ 669 | clear:both; 670 | border:none; 671 | margin-bottom:-1px; 672 | margin-top:1px; 673 | _margin-bottom:1px; 674 | } 675 | 676 | /* @end */ 677 | 678 | /* @group Debugging Section */ 679 | 680 | #debugging-toggle { 681 | text-align: center; 682 | } 683 | #debugging-toggle img { 684 | cursor: pointer; 685 | } 686 | 687 | #rdoc-debugging-section-dump { 688 | display: none; 689 | margin: 0 2em 2em; 690 | background: #ccc; 691 | border: 1px solid #999; 692 | } 693 | 694 | 695 | 696 | /* @end */ 697 | -------------------------------------------------------------------------------- /lib/rdoc/generator/darkfish.rb: -------------------------------------------------------------------------------- 1 | #!ruby 2 | 3 | require 'pp' 4 | require 'pathname' 5 | require 'fileutils' 6 | require 'erb' 7 | require 'yaml' 8 | require 'enumerator' 9 | 10 | require 'rdoc/rdoc' 11 | 12 | DarkfishSuperclass = RDoc::Generator.const_defined?( "XML" ) ? RDoc::Generator::XML : Object 13 | 14 | # 15 | # Darkfish RDoc HTML Generator 16 | # 17 | # $Id$ 18 | # 19 | # == Author/s 20 | # * Michael Granger (ged@FaerieMUD.org) 21 | # 22 | # == Contributors 23 | # * Mahlon E. Smith (mahlon@martini.nu) 24 | # * Eric Hodel (drbrain@segment7.net) 25 | # 26 | # == License 27 | # 28 | # :include: LICENSE 29 | # 30 | class RDoc::Generator::Darkfish < DarkfishSuperclass 31 | 32 | RDoc::RDoc.add_generator( self ) 33 | 34 | include ERB::Util 35 | 36 | # Subversion rev 37 | SVNRev = %$Rev$ 38 | 39 | # Subversion ID 40 | SVNId = %$Id$ 41 | 42 | # Path to this file's parent directory. Used to find templates and other 43 | # resources. 44 | GENERATOR_DIR = Pathname.new( __FILE__ ).expand_path.dirname 45 | 46 | # Release Version 47 | VERSION = '1.1.7' 48 | 49 | # Directory where generated classes live relative to the root 50 | CLASS_DIR = nil 51 | 52 | # Directory where generated files live relative to the root 53 | FILE_DIR = nil 54 | 55 | # An array of transforms to run on a method name to derive a suitable 56 | # anchor name. The pairs are used in pairs as arguments to gsub. 57 | ANAME_TRANSFORMS = [ 58 | /\?$/, '_p', 59 | /\!$/, '_bang', 60 | /=$/, '_eq', 61 | /^<<$/, '_lshift', 62 | /^>>$/, '_rshift', 63 | /\[\]=/, '_aset', 64 | /\[\]/, '_aref', 65 | /\*\*/, '_pow', 66 | /^~$/, '_complement', 67 | /^!$/, '_bang', 68 | /^\+@$/, '_uplus', 69 | /^-@$/, '_uminus', 70 | /^\+$/, '_add', 71 | /^-$/, '_sub', 72 | /^\*$/, '_mult', 73 | %r{^/$}, '_div', 74 | /^%$/, '_mod', 75 | /^<=>$/, '_comp', 76 | /^==$/, '_equal', 77 | /^!=$/, '_nequal', 78 | /^===$/, '_eqq', 79 | /^>$/, '_gt', 80 | /^>=$/, '_ge', 81 | /^<$/, '_lt', 82 | /^<=$/, '_le', 83 | /^&$/, '_and', 84 | /^|$/, '_or', 85 | /^\^$/, '_xor', 86 | /^=~$/, '_match', 87 | /^!~$/, '_notmatch', 88 | ] 89 | 90 | 91 | ################################################################# 92 | ### C L A S S M E T H O D S 93 | ################################################################# 94 | 95 | ### Standard generator factory method 96 | def self::for( options ) 97 | new( options ) 98 | end 99 | 100 | 101 | ################################################################# 102 | ### I N S T A N C E M E T H O D S 103 | ################################################################# 104 | 105 | ### Initialize a few instance variables before we start 106 | def initialize( options ) 107 | @options = options 108 | @template = nil 109 | 110 | template = options.template || 'darkfish' 111 | @template_dir = (template =~ /\A\//) ? 112 | Pathname.new( template ) : 113 | GENERATOR_DIR + 'template/' + template 114 | 115 | configfile = @template_dir + 'config.yml' 116 | @config = (configfile.file?) ? YAML.load_file( configfile.to_s ) : {} 117 | 118 | @files = [] 119 | @classes = [] 120 | @hyperlinks = {} 121 | 122 | @basedir = Pathname.pwd.expand_path 123 | 124 | options.diagram = false 125 | 126 | super() 127 | end 128 | 129 | 130 | ###### 131 | public 132 | ###### 133 | 134 | # The output directory 135 | attr_reader :outputdir 136 | 137 | 138 | ### Read the spcified To be called from ERB template to import (embed) 139 | ### another template 140 | def import( erbfile ) 141 | erb = File.open( erbfile ) {|fp| ERb.new(fp.read) } 142 | return erb.run( binding() ) 143 | end 144 | 145 | 146 | ### Return the data section from the config file (if any) 147 | def data 148 | return @config['data'] 149 | end 150 | 151 | 152 | ### Output progress information if debugging is enabled 153 | def debug_msg( *msg ) 154 | return unless $DEBUG 155 | $stderr.puts( *msg ) 156 | end 157 | 158 | 159 | ### Create the directories the generated docs will live in if 160 | ### they don't already exist. 161 | def gen_sub_directories 162 | @outputdir.mkpath 163 | end 164 | 165 | 166 | ### Copy over the stylesheet into the appropriate place in the 167 | ### output directory. 168 | def write_style_sheet 169 | debug_msg "Copying over static files" 170 | staticfiles = @config['static'] || %w[rdoc.css js images] 171 | staticfiles = staticfiles.split( /\s+/ ) if staticfiles.is_a?( String ) 172 | staticfiles.each do |path| 173 | FileUtils.cp_r( @template_dir + path, '.', :verbose => $DEBUG, :noop => $dryrun ) 174 | end 175 | end 176 | 177 | 178 | 179 | ### Build the initial indices and output objects 180 | ### based on an array of TopLevel objects containing 181 | ### the extracted information. 182 | def generate( toplevels ) 183 | @outputdir = Pathname.new( @options.op_dir ).expand_path( @basedir ) 184 | if RDoc::Generator::Context.respond_to?( :build_indicies) 185 | @files, @classes = RDoc::Generator::Context.build_indicies( toplevels, @options ) 186 | else 187 | @files, @classes = RDoc::Generator::Context.build_indices( toplevels, @options ) 188 | end 189 | 190 | # Now actually write the output 191 | generate_xhtml( @options, @files, @classes ) 192 | 193 | rescue StandardError => err 194 | debug_msg "%s: %s\n %s" % [ err.class.name, err.message, err.backtrace.join("\n ") ] 195 | raise 196 | end 197 | 198 | 199 | ### No-opped 200 | def load_html_template # :nodoc: 201 | end 202 | 203 | 204 | ### Generate output 205 | def generate_xhtml( options, files, classes ) 206 | files = gen_into( @files ) 207 | classes = gen_into( @classes ) 208 | 209 | # Make a hash of class info keyed by class name 210 | classes_by_classname = classes.inject({}) {|hash, classinfo| 211 | hash[ classinfo[:full_name] ] = classinfo 212 | hash[ classinfo[:full_name] ][:outfile] = 213 | classinfo[:full_name].gsub( /::/, '/' ) + '.html' 214 | hash 215 | } 216 | 217 | # Make a hash of file info keyed by path 218 | files_by_path = files.inject({}) {|hash, fileinfo| 219 | hash[ fileinfo[:full_path] ] = fileinfo 220 | hash[ fileinfo[:full_path] ][:outfile] = fileinfo[:full_path] + '.html' 221 | hash 222 | } 223 | 224 | self.write_style_sheet 225 | self.generate_index( options, files_by_path, classes_by_classname ) 226 | self.generate_class_files( options, files_by_path, classes_by_classname ) 227 | self.generate_file_files( options, files_by_path, classes_by_classname ) 228 | end 229 | 230 | 231 | 232 | ######### 233 | protected 234 | ######### 235 | 236 | ### Return a list of the documented modules sorted by salience first, then by name. 237 | def get_sorted_module_list( classes ) 238 | nscounts = classes.keys.inject({}) do |counthash, name| 239 | toplevel = name.gsub( /::.*/, '' ) 240 | counthash[toplevel] ||= 0 241 | counthash[toplevel] += 1 242 | 243 | counthash 244 | end 245 | 246 | # Sort based on how often the toplevel namespace occurs, and then on the name 247 | # of the module -- this works for projects that put their stuff into a 248 | # namespace, of course, but doesn't hurt if they don't. 249 | return classes.keys.sort_by do |name| 250 | toplevel = name.gsub( /::.*/, '' ) 251 | [ 252 | nscounts[ toplevel ] * -1, 253 | name 254 | ] 255 | end 256 | end 257 | 258 | 259 | ### Generate an index page which lists all the classes which 260 | ### are documented. 261 | def generate_index( options, files, classes ) 262 | debug_msg "Rendering the index page..." 263 | 264 | templatefile = @template_dir + 'index.rhtml' 265 | modsort = self.get_sorted_module_list( classes ) 266 | outfile = @basedir + @options.op_dir + 'index.html' 267 | 268 | self.render_template( templatefile, binding(), outfile ) 269 | end 270 | 271 | 272 | ### Generate a documentation file for each class present in the 273 | ### given hash of +classes+. 274 | def generate_class_files( options, files, classes ) 275 | debug_msg "Generating class documentation in #@outputdir" 276 | templatefile = @template_dir + 'classpage.rhtml' 277 | outputdir = @outputdir 278 | 279 | modsort = self.get_sorted_module_list( classes ) 280 | 281 | classes.sort_by {|k,v| k }.each do |classname, classinfo| 282 | debug_msg " working on %s (%s)" % [ classname, classinfo[:outfile] ] 283 | outfile = outputdir + classinfo[:outfile] 284 | rel_prefix = outputdir.relative_path_from( outfile.dirname ) 285 | svninfo = self.get_svninfo( classinfo ) 286 | 287 | debug_msg " rendering #{outfile}" 288 | self.render_template( templatefile, binding(), outfile ) 289 | end 290 | end 291 | 292 | 293 | ### Generate a documentation file for each file present in the 294 | ### given hash of +files+. 295 | def generate_file_files( options, files, classes ) 296 | debug_msg "Generating file documentation in #@outputdir" 297 | templatefile = @template_dir + 'filepage.rhtml' 298 | 299 | modsort = self.get_sorted_module_list( classes ) 300 | 301 | files.sort_by {|k,v| k }.each do |path, fileinfo| 302 | outfile = @outputdir + fileinfo[:outfile] 303 | debug_msg " working on %s (%s)" % [ path, outfile ] 304 | rel_prefix = @outputdir.relative_path_from( outfile.dirname ) 305 | context = binding() 306 | 307 | debug_msg " rendering #{outfile}" 308 | self.render_template( templatefile, binding(), outfile ) 309 | end 310 | end 311 | 312 | 313 | ### Return a string describing the amount of time in the given number of 314 | ### seconds in terms a human can understand easily. 315 | def time_delta_string( seconds ) 316 | return 'less than a minute' if seconds < 1.minute 317 | return (seconds / 1.minute).to_s + ' minute' + (seconds/60 == 1 ? '' : 's') if seconds < 50.minutes 318 | return 'about one hour' if seconds < 90.minutes 319 | return (seconds / 1.hour).to_s + ' hours' if seconds < 18.hours 320 | return 'one day' if seconds < 1.day 321 | return 'about one day' if seconds < 2.days 322 | return (seconds / 1.day).to_s + ' days' if seconds < 1.week 323 | return 'about one week' if seconds < 2.week 324 | return (seconds / 1.week).to_s + ' weeks' if seconds < 3.months 325 | return (seconds / 1.month).to_s + ' months' if seconds < 1.year 326 | return (seconds / 1.year).to_s + ' years' 327 | end 328 | 329 | 330 | # %q$Id$" 331 | SVNID_PATTERN = / 332 | \$Id:\s 333 | (\S+)\s # filename 334 | (\d+)\s # rev 335 | (\d{4}-\d{2}-\d{2})\s # Date (YYYY-MM-DD) 336 | (\d{2}:\d{2}:\d{2}Z)\s # Time (HH:MM:SSZ) 337 | (\w+)\s # committer 338 | \$$ 339 | /x 340 | 341 | ### Try to extract Subversion information out of the first constant whose value looks like 342 | ### a subversion Id tag. If no matching constant is found, and empty hash is returned. 343 | def get_svninfo( classinfo ) 344 | return {} unless classinfo[:sections] 345 | constants = classinfo[:sections].first[:constants] or return {} 346 | 347 | constants.find {|c| c[:value] =~ SVNID_PATTERN } or return {} 348 | 349 | filename, rev, date, time, committer = $~.captures 350 | commitdate = Time.parse( date + ' ' + time ) 351 | 352 | return { 353 | :filename => filename, 354 | :rev => Integer( rev ), 355 | :commitdate => commitdate, 356 | :commitdelta => time_delta_string( Time.now.to_i - commitdate.to_i ), 357 | :committer => committer, 358 | } 359 | end 360 | 361 | 362 | ### Load and render the erb template in the given +templatefile+ within the specified 363 | ### +context+ (a Binding object) and write it out to +outfile+. Both +templatefile+ and 364 | ### +outfile+ should be Pathname-like objects. 365 | def render_template( templatefile, context, outfile ) 366 | template_src = templatefile.read 367 | template = ERB.new( template_src, nil, '<>' ) 368 | template.filename = templatefile.to_s 369 | 370 | output = begin 371 | template.result( context ) 372 | rescue NoMethodError => err 373 | raise "Error while evaluating %s: %s (at %p)" % [ 374 | templatefile.to_s, 375 | err.message, 376 | eval( "_erbout[-50,50]", context ) 377 | ] 378 | end 379 | 380 | output = self.wrap_content( output, context ) 381 | 382 | unless $dryrun 383 | outfile.dirname.mkpath 384 | outfile.open( 'w', 0644 ) do |ofh| 385 | ofh.print( output ) 386 | end 387 | else 388 | debug_msg " would have written %d bytes to %s" % 389 | [ output.length, outfile ] 390 | end 391 | end 392 | 393 | 394 | ### Load the configured wrapper file and wrap it around the given +content+. 395 | def wrap_content( output, context ) 396 | wrapper = @options.wrapper || @config['wrapper'] || 'wrapper.rhtml' 397 | wrapperfile = (wrapper =~ /\A\//) ? 398 | Pathname.new( wrapper ) : 399 | @template_dir + wrapper 400 | 401 | if wrapperfile.file? 402 | # Add 'content' to the context binding for the wrapper template 403 | eval( "content = %p" % [output], context ) 404 | 405 | template_src = wrapperfile.read 406 | template = ERB.new( template_src, nil, '<>' ) 407 | template.filename = templatefile.to_s 408 | 409 | begin 410 | return template.result( context ) 411 | rescue NoMethodError => err 412 | raise "Error while evaluating %s: %s (at %p)" % [ 413 | templatefile.to_s, 414 | err.message, 415 | eval( "_erbout[-50,50]", context ) 416 | ] 417 | end 418 | end 419 | 420 | end 421 | 422 | 423 | ####### 424 | private 425 | ####### 426 | 427 | ### Given the name of a Ruby method, return a name suitable for use as target names in 428 | ### A tags. 429 | def aname_from_method( methodname ) 430 | return ANAME_TRANSFORMS.enum_slice( 2 ).inject( methodname.to_s ) do |name, xform| 431 | name.gsub( *xform ) 432 | end 433 | end 434 | 435 | 436 | end # Roc::Generator::Darkfish 437 | 438 | # :stopdoc: 439 | 440 | ### Time constants 441 | module TimeConstantMethods # :nodoc: 442 | 443 | ### Number of seconds (returns receiver unmodified) 444 | def seconds 445 | return self 446 | end 447 | alias_method :second, :seconds 448 | 449 | ### Returns number of seconds in minutes 450 | def minutes 451 | return self * 60 452 | end 453 | alias_method :minute, :minutes 454 | 455 | ### Returns the number of seconds in hours 456 | def hours 457 | return self * 60.minutes 458 | end 459 | alias_method :hour, :hours 460 | 461 | ### Returns the number of seconds in days 462 | def days 463 | return self * 24.hours 464 | end 465 | alias_method :day, :days 466 | 467 | ### Return the number of seconds in weeks 468 | def weeks 469 | return self * 7.days 470 | end 471 | alias_method :week, :weeks 472 | 473 | ### Returns the number of seconds in fortnights 474 | def fortnights 475 | return self * 2.weeks 476 | end 477 | alias_method :fortnight, :fortnights 478 | 479 | ### Returns the number of seconds in months (approximate) 480 | def months 481 | return self * 30.days 482 | end 483 | alias_method :month, :months 484 | 485 | ### Returns the number of seconds in years (approximate) 486 | def years 487 | return (self * 365.25.days).to_i 488 | end 489 | alias_method :year, :years 490 | 491 | 492 | ### Returns the Time number of seconds before the 493 | ### specified +time+. E.g., 2.hours.before( header.expiration ) 494 | def before( time ) 495 | return time - self 496 | end 497 | 498 | 499 | ### Returns the Time number of seconds ago. (e.g., 500 | ### expiration > 2.hours.ago ) 501 | def ago 502 | return self.before( ::Time.now ) 503 | end 504 | 505 | 506 | ### Returns the Time number of seconds after the given +time+. 507 | ### E.g., 10.minutes.after( header.expiration ) 508 | def after( time ) 509 | return time + self 510 | end 511 | 512 | # Reads best without arguments: 10.minutes.from_now 513 | def from_now 514 | return self.after( ::Time.now ) 515 | end 516 | end # module TimeConstantMethods 517 | 518 | 519 | # Extend Numeric with time constants 520 | class Numeric # :nodoc: 521 | include TimeConstantMethods 522 | end 523 | 524 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | -- Wed, 07 Jan 2009 02:52:03 -0000 by deveiant (r53) ----- 2 | Added: lib/rdoc/generator/template/darkfish/images/find.png (new) 3 | lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png (new) 4 | lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png (new) 5 | Changed: lib/rdoc/generator/template/darkfish/classpage.rhtml 6 | lib/rdoc/generator/template/darkfish/js/quicksearch.js 7 | ChangeLog 8 | lib/rdoc/generator/template/darkfish/rdoc.css 9 | lib/rdoc/generator/template/darkfish/js/darkfish.js 10 | 11 | Some changes suggested by Eric Hodel (refs #5) 12 | * Moved quicksearch up to the top of the class index; still needs 13 | CSS fixing. 14 | * Fixed mistakenly-applied roundbox to DLs in simple file pages 15 | 16 | 17 | -- Wed, 07 Jan 2009 02:08:11 -0000 by deveiant (r52) ----- 18 | Changed: lib/rdoc/generator/darkfish.rb 19 | lib/rdoc/generator/template/darkfish/classpage.rhtml 20 | lib/rdoc/generator/template/darkfish/index.rhtml 21 | lib/rdoc/generator/template/darkfish/rdoc.css 22 | lib/rdoc/generator/template/darkfish/filepage.rhtml 23 | 24 | Merged patches from Eric Hodel (drbrain at segment7.net). Refs #5. 25 | 26 | 27 | -- Sat, 20 Dec 2008 21:04:57 -0000 by deveiant (r51) ----- 28 | Added: lib/rdoc/generator/template/darkfish/images/bug.png (new) 29 | Changed: lib/rdoc/generator/darkfish.rb 30 | lib/rdoc/generator/template/darkfish/classpage.rhtml 31 | lib/rdoc/generator/template/darkfish/index.rhtml 32 | ChangeLog 33 | lib/rdoc/generator/template/darkfish/rdoc.css 34 | lib/rdoc/generator/template/darkfish/filepage.rhtml (and 3 other/s) 35 | 36 | * Make the javascript headers all load the same thing. 37 | * Moved the dom-ready handler into darkfish.js instead of a script section in the head. 38 | * Insert RDoc debugging output when $DEBUG is true. 39 | * Change the email addresses in darkfish.rb from
-style to (address) as a workaround so 40 | RDoc output is valid. 41 | * Updated the instructions for use in the README. 42 | 43 | 44 | -- Thu, 18 Dec 2008 16:39:30 -0000 by deveiant (r50) ----- 45 | Changed: lib/rdoc/generator/darkfish.rb 46 | LICENSE 47 | ChangeLog 48 | lib/rdoc/generator/template/darkfish/rdoc.css 49 | README 50 | 51 | * CSS fix: Use the same formatting as the index page for content in file pages. 52 | * Merged license statements. 53 | * Added Mahlon to the contributors section. 54 | 55 | 56 | -- Thu, 18 Dec 2008 00:59:26 -0000 by deveiant (r49) ----- 57 | Changed: lib/rdoc/generator/darkfish.rb 58 | 59 | Bumping release version to 1.1.6. 60 | 61 | 62 | -- Thu, 18 Dec 2008 00:58:30 -0000 by deveiant (r48) ----- 63 | Added: lib/rdoc/generator/template/darkfish/images/page_white_text.png (new) 64 | Changed: spec/rdoc/generator/darkfish_spec.rb 65 | lib/rdoc/generator/darkfish.rb 66 | lib/rdoc/generator/template/darkfish/classpage.rhtml 67 | LICENSE 68 | Rakefile 69 | lib/rdoc/generator/template/darkfish/index.rhtml (and 6 other/s) 70 | 71 | * Merged patches from Eric Hodel for Rdoc 2.3 changes + improvements (closes #4) 72 | - Symbol keys -> strings 73 | - Added a Files list to the index page 74 | - Support Rubygems auto-discovery 75 | * Reworked the file page template so it renders differently for 'SimpleParser' pages. 76 | * Cleaned up the DL-related classes so constants don't look so weird. 77 | * Removed the box around H1s. -ETOOMANYBOXES 78 | 79 | 80 | -- Wed, 17 Dec 2008 22:26:58 -0000 by deveiant (r47) ----- 81 | Added: /branches/rdoc-2.3-changes 82 | -> renamed from /trunk@r46 83 | 84 | Making a branch for RDoc 2.3 changes so I don't break the build 85 | 86 | 87 | -- Thu, 04 Dec 2008 22:31:39 -0000 by deveiant (r46) ----- 88 | Changed: /trunk/Rakefile 89 | /trunk/project.yml 90 | 91 | Updated build system. 92 | 93 | 94 | -- Thu, 04 Dec 2008 19:12:13 -0000 by deveiant (r45) ----- 95 | Changed: /trunk/spec/rdoc/generator/darkfish_spec.rb 96 | 97 | Fixed broken expectation setup. 98 | 99 | 100 | -- Thu, 04 Dec 2008 19:07:12 -0000 by deveiant (r44) ----- 101 | Changed: /trunk 102 | /trunk/lib/rdoc/generator/template/darkfish/rdoc.css 103 | 104 | Cleaned up display of constant and attribute lists. 105 | 106 | 107 | -- Thu, 04 Dec 2008 06:50:02 -0000 by deveiant (r43) ----- 108 | Added: /trunk/lib/rdoc/discover.rb 109 | -> renamed from /trunk/lib/darkfish-rdoc.rb@r42 110 | Changed: /trunk/Rakefile 111 | /trunk/project.yml 112 | Deleted: /trunk/lib/darkfish-rdoc.rb 113 | 114 | * Integrated patch from Eric Hodel (drbrain at segment7.net) for RDoc 2.2.2 autodiscovery. Thanks 115 | Eric! 116 | * Updated build system 117 | 118 | 119 | -- Mon, 06 Oct 2008 21:33:22 -0000 by deveiant (r42) ----- 120 | Changed: /trunk/Rakefile 121 | 122 | Updated build system. 123 | 124 | 125 | -- Fri, 26 Sep 2008 06:08:54 -0000 by deveiant (r40) ----- 126 | Changed: /trunk/ChangeLog 127 | /trunk/lib/rdoc/generator/template/darkfish/rdoc.css 128 | 129 | Fixed the margin/border on constants and attributes 130 | 131 | 132 | -- Thu, 25 Sep 2008 16:50:52 -0000 by deveiant (r38) ----- 133 | Changed: /trunk/lib/rdoc/generator/template/darkfish/js/jquery.js 134 | /trunk/lib/rdoc/generator/template/darkfish/js/quicksearch.js 135 | /trunk/Rakefile.local 136 | 137 | * Updated jquery to 1.2.6 138 | * Focus the results of a quicksearch when it is off screen 139 | * Fixed the 'install' Rake task -- it now installs the templates and resources in 140 | addition to the ruby code. 141 | 142 | 143 | -- Mon, 22 Sep 2008 15:57:32 -0000 by deveiant (r36) ----- 144 | Changed: /trunk/Rakefile 145 | /trunk/ChangeLog 146 | 147 | Updated build system to add the workaround for broken developmental dependencies under RubyGems 1.2.0. 148 | 149 | 150 | -- Mon, 22 Sep 2008 15:14:43 -0000 by deveiant (r35) ----- 151 | Changed: /trunk/spec/rdoc/generator/darkfish_spec.rb 152 | /trunk/lib/rdoc/generator/darkfish.rb 153 | 154 | Updated to work under RDoc 2.2.0 (fixes #2). 155 | 156 | 157 | -- Tue, 16 Sep 2008 14:22:21 -0000 by deveiant (r34) ----- 158 | Changed: /trunk/Rakefile 159 | /trunk/project.yml 160 | 161 | Updated the build system. 162 | 163 | 164 | -- Tue, 16 Sep 2008 14:21:23 -0000 by deveiant (r33) ----- 165 | Changed: /trunk/lib/rdoc/generator/darkfish.rb 166 | /trunk/lib/rdoc/generator/template/darkfish/classpage.rhtml 167 | 168 | * Fixed method name extraction for non \w+ methods (e.g., operators) 169 | * Bumped version to 1.1.5. 170 | 171 | 172 | -- Wed, 20 Aug 2008 01:45:44 -0000 by deveiant (r32) ----- 173 | Changed: /trunk/lib/rdoc/generator/darkfish.rb 174 | /trunk/ChangeLog 175 | /trunk/lib/darkfish-rdoc.rb 176 | 177 | Updated build system. 178 | 179 | 180 | -- Wed, 20 Aug 2008 01:28:01 -0000 by deveiant (r30) ----- 181 | Changed: /trunk/Rakefile 182 | /trunk/project.yml 183 | /trunk/lib/rdoc/generator/template/darkfish/rdoc.css 184 | /trunk/lib/rdoc/generator/template/darkfish/js/darkfish.js 185 | 186 | * Updated build system 187 | * Added a fix for javascript 'console is not defined' bug in the darkfish.js file. 188 | * Fixed the mushed-together method description when it has multiple paragraphs and/or definition 189 | lists. 190 | 191 | 192 | -- Tue, 19 Aug 2008 02:37:00 -0000 by deveiant (r29) ----- 193 | Changed: /trunk/README 194 | /trunk/ChangeLog 195 | /trunk/Rakefile.local 196 | 197 | Added some local tasks to clean up .svn directories before publication. 198 | 199 | 200 | -- Tue, 19 Aug 2008 02:12:27 -0000 by deveiant (r27) ----- 201 | Changed: /trunk/lib/rdoc/generator/darkfish.rb 202 | /trunk/lib/darkfish-rdoc.rb 203 | 204 | Oops. Forgot I need to change the version string in two places. Should really figure out some better 205 | way to do this. 206 | 207 | 208 | -- Tue, 19 Aug 2008 02:10:53 -0000 by deveiant (r26) ----- 209 | Changed: /trunk/README 210 | /trunk/lib/rdoc/generator/darkfish.rb 211 | /trunk/lib/rdoc/generator/template/darkfish/classpage.rhtml 212 | /trunk/Rakefile 213 | /trunk/lib/rdoc/generator/template/darkfish/rdoc.css 214 | /trunk/ChangeLog (and 2 other/s) 215 | 216 | * Bumped version to 1.1.3 217 | * Updated build system 218 | * Fixed output for C source 219 | 220 | 221 | -- Thu, 14 Aug 2008 00:59:07 -0000 by deveiant (r24) ----- 222 | Changed: /trunk 223 | /trunk/lib/rdoc/generator/darkfish.rb 224 | /trunk/Rakefile 225 | /trunk/lib/darkfish-rdoc.rb 226 | 227 | * Updated build system 228 | 229 | 230 | -- Sat, 09 Aug 2008 01:14:22 -0000 by deveiant (r23) ----- 231 | Added: /trunk/spec/rdoc/generator (new) 232 | /trunk/spec/rdoc/generator/darkfish_spec.rb (new) 233 | /trunk/spec/rdoc (new) 234 | /trunk/spec (new) 235 | Changed: /trunk/project.yml 236 | /trunk/lib/rdoc/generator/template/darkfish/rdoc.css 237 | /trunk/lib/rdoc/generator/darkfish.rb 238 | /trunk/Rakefile 239 | /trunk/ChangeLog 240 | Deleted: /trunk/lib/rdoc/generator/template/darkfish/images/bullet_go.png 241 | /trunk/lib/rdoc/generator/template/darkfish/images/lightbulb.png 242 | /trunk/lib/rdoc/generator/template/darkfish/images/page_white_ruby.png 243 | /trunk/lib/rdoc/generator/template/darkfish/images/tag_blue.png 244 | /trunk/lib/rdoc/generator/template/darkfish/images/tag_blue_edit.png 245 | /trunk/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png (and 12 other/s) 246 | 247 | * Updated build system. 248 | * Fixed distributions, which didn't have the static files included with them. 249 | * Removed a bunch of unused static files 250 | * Fixed the path to the bg hack for Thickbox on Macs 251 | * Added the beginnings of a test suite. Don't know yet how to test the generator in isolation. 252 | 253 | 254 | -- Fri, 08 Aug 2008 13:15:20 -0000 by deveiant (r22) ----- 255 | Changed: /trunk 256 | /trunk/Rakefile 257 | /trunk/project.yml 258 | Deleted: /trunk/misc/rake 259 | 260 | Checkpoint commit 261 | 262 | 263 | -- Fri, 08 Aug 2008 02:47:22 -0000 by deveiant (r21) ----- 264 | Changed: /trunk/README 265 | /trunk/lib/rdoc/generator/template/darkfish/classpage.rhtml 266 | /trunk/Rakefile 267 | /trunk/ChangeLog 268 | /trunk/lib/rdoc/generator/template/darkfish/js/darkfish.js 269 | 270 | Checkpoint commit 271 | 272 | 273 | -- Thu, 07 Aug 2008 06:56:40 -0000 by deveiant (r18) ----- 274 | Added: /trunk/lib/rdoc/generator/darkfish.rb 275 | -> renamed from /trunk/lib/rdoc/generator/darkfish_generator.rb@r16 276 | /trunk/LICENSE (new) 277 | /trunk/project.yml (new) 278 | /trunk/ChangeLog (new) 279 | /trunk/Rakefile.local (new) 280 | /trunk/lib/rdoc/generator/template/darkfish/js/darkfish.js (new) (and 1 other/s) 281 | Changed: /trunk 282 | /trunk/lib/rdoc/generator/template/darkfish/classpage.rhtml 283 | /trunk/Rakefile 284 | /trunk/lib/darkfish-rdoc.rb 285 | Deleted: /trunk/lib/rdoc/generator/darkfish_generator.rb 286 | 287 | Integrated new Rake build system. 288 | 289 | 290 | -- Tue, 29 Jul 2008 14:52:26 -0000 by deveiant (r17) ----- 291 | Changed: /trunk/lib/darkfish-rdoc.rb 292 | 293 | Fixed bug in darkfish-rdoc: 'generators' -> 'generator' 294 | 295 | 296 | -- Mon, 30 Jun 2008 19:06:36 -0000 by deveiant (r16) ----- 297 | Added: /trunk/lib/rdoc/generator 298 | -> renamed from /trunk/lib/rdoc/generators@r14 299 | Changed: /trunk/Rakefile 300 | /trunk/lib/darkfish-rdoc.rb 301 | Deleted: /trunk/lib/rdoc/generators 302 | 303 | Beginning conversion to Rdoc 2.0. Broken for now; see tags/RDOC_1 for a working 304 | RDoc 1.x version. 305 | 306 | 307 | -- Wed, 21 May 2008 17:08:10 -0000 by deveiant (r14) ----- 308 | Added: /trunk/darkfish_preview.png (new) 309 | /trunk/lib/darkfish-rdoc.rb (new) 310 | Changed: /trunk/README 311 | /trunk 312 | /trunk/Rakefile 313 | /trunk/lib/rdoc/generators/template/darkfish/js/jquery.js 314 | /trunk/lib/rdoc/generators/template/darkfish/classpage.rhtml 315 | /trunk/lib/rdoc/generators/darkfish_generator.rb (and 2 other/s) 316 | 317 | * Added a `require`-able library that injects the generator into RDoc's known 318 | generator hash. 319 | * Modified method anchors to be the method name instead of a random number -- 320 | this will break URLs generated by RDoc, but I'd rather have sensible URLs. 321 | * Added a javascript hook that highlights the current page target if there is one. 322 | * Updated jQuery to 1.2.4 323 | 324 | 325 | -- Sat, 03 May 2008 02:56:54 -0000 by deveiant (r13) ----- 326 | Changed: /trunk/lib/rdoc/generators/darkfish_generator.rb 327 | 328 | Added some more output path debugging 329 | 330 | 331 | -- Tue, 18 Mar 2008 15:52:57 -0000 by deveiant (r12) ----- 332 | Added: /trunk/lib/rdoc/generators/template/darkfish/classpage.rhtml 333 | -> renamed from /trunk/lib/rdoc/generators/template/classpage.rhtml@r10 334 | /trunk/lib/rdoc/generators/template/darkfish/index.rhtml 335 | -> renamed from /trunk/lib/rdoc/generators/template/index.rhtml@r10 336 | /trunk/lib/rdoc/generators/template/darkfish (new) 337 | /trunk/lib/rdoc/generators/template/darkfish/filepage.rhtml 338 | -> renamed from /trunk/lib/rdoc/generators/template/filepage.rhtml@r10 339 | /trunk/lib/rdoc/generators/template/darkfish/images 340 | -> renamed from /trunk/lib/rdoc/generators/template/images@r10 341 | /trunk/lib/rdoc/generators/template/darkfish/js 342 | -> renamed from /trunk/lib/rdoc/generators/template/js@r10 (and 2 other/s) 343 | Changed: /trunk/lib/rdoc/generators/darkfish_generator.rb 344 | /trunk/Rakefile 345 | /trunk/misc/rake/svn.rb 346 | Deleted: /trunk/lib/rdoc/generators/template/js 347 | /trunk/lib/rdoc/generators/template/rdoc.css 348 | /trunk/lib/rdoc/generators/template/classpage.rhtml 349 | /trunk/lib/rdoc/generators/template/index.rhtml 350 | /trunk/lib/rdoc/generators/template/filepage.rhtml 351 | /trunk/lib/rdoc/generators/template/images (and 1 other/s) 352 | 353 | * Set up rdoc options to use itself for docs. 354 | * Set up sensible package tasks 355 | * Made the chatty output of the generator only show up if $DEBUG is turned on. 356 | * Moved everything in the `template` directory into a `darkfish` subdirectory for interoperability 357 | with other RDoc generators. 358 | 359 | 360 | -- Mon, 18 Feb 2008 14:33:06 -0000 by deveiant (r11) ----- 361 | Changed: /trunk/README 362 | /trunk/lib/rdoc/generators/template/rdoc.css 363 | 364 | * Updated README 365 | * Fixed up CSS for the index page. 366 | 367 | 368 | -- Sat, 16 Feb 2008 08:11:47 -0000 by deveiant (r10) ----- 369 | Added: /trunk/README (new) 370 | /trunk/lib/rdoc (new) 371 | /trunk/lib/rdoc/generators/template 372 | -> copied from /trunk/generators/template@r9 373 | /trunk/misc/prototype.html 374 | -> renamed from /trunk/prototype.html@r8 375 | /trunk/lib (new) 376 | /trunk/lib/rdoc/generators 377 | -> renamed from /trunk/generators@r8 (and 3 other/s) 378 | Changed: /trunk 379 | /trunk/Rakefile 380 | /trunk/misc/rake/svn.rb 381 | Deleted: /trunk/index-prototype.html 382 | /trunk/misc/rake/verifytask.rb 383 | /trunk/prototype.html 384 | /trunk/generators 385 | 386 | * Added README 387 | * Rakefile 388 | - Added an dog-food 'rdoc' task 389 | - Fixed up the 'install' task 390 | * Rearranged directories for easy building/installation. 391 | * Put prototype HTML files into misc/ 392 | 393 | 394 | -- Sat, 16 Feb 2008 06:19:51 -0000 by deveiant (r9) ----- 395 | Added: /trunk/misc/rake (new) 396 | /trunk/misc/rake/helpers.rb (new) 397 | /trunk/Rakefile (new) 398 | /trunk/misc/rake/svn.rb (new) 399 | /trunk/misc/rake/verifytask.rb (new) 400 | /trunk/misc (new) (and 1 other/s) 401 | Changed: /trunk/generators/template/rdoc.css 402 | /trunk/generators/template/classpage.rhtml 403 | /trunk/generators/darkfish_generator.rb 404 | 405 | Reorganizing for release. 406 | 407 | 408 | -- Thu, 03 Jan 2008 19:40:24 -0000 by deveiant (r8) ----- 409 | Changed: /trunk/generators/template/index.rhtml 410 | 411 | Removed the description bit from the index page -- there's just no way to make it work gracefully. 412 | 413 | 414 | -- Fri, 19 Oct 2007 01:04:31 -0000 by deveiant (r7) ----- 415 | Changed: /trunk/generators/template/rdoc.css 416 | /trunk/generators/template/classpage.rhtml 417 | 418 | Fixes for C source documentation, a few CSS tweaks 419 | 420 | 421 | -- Thu, 18 Oct 2007 15:15:47 -0000 by deveiant (r6) ----- 422 | Added: /trunk/generators/template/images/macFFBgHack.png (new) 423 | Changed: /trunk/generators/template/rdoc.css 424 | 425 | Fixed missing piece of ThickBox for FF on the Mac 426 | 427 | 428 | -- Fri, 12 Oct 2007 00:20:02 -0000 by deveiant (r5) ----- 429 | Changed: /trunk/generators/darkfish_generator.rb 430 | 431 | Add time constants for the time-detla calculations 432 | 433 | 434 | -- Thu, 11 Oct 2007 21:05:25 -0000 by deveiant (r4) ----- 435 | Changed: /trunk/generators/template/rdoc.css 436 | /trunk/generators/darkfish_generator.rb 437 | 438 | * Updated definition lists in the description to not look like ass. 439 | * Documentation touchups. 440 | 441 | 442 | -- Wed, 10 Oct 2007 20:40:20 -0000 by deveiant (r3) ----- 443 | Changed: /trunk/generators/darkfish_generator.rb 444 | 445 | Added a Generators::DARKFISHGenerators alias to work around Rdoc's assumption that all formats are acronyms. 446 | 447 | 448 | -- Wed, 10 Oct 2007 19:33:33 -0000 by deveiant (r2) ----- 449 | Added: /trunk/generators/template/images/wrench_orange.png (new) 450 | /trunk/generators/template/images/zoom.png (new) 451 | /trunk/generators/template/js (new) 452 | /trunk/generators/template/images/wrench.png (new) 453 | /trunk/generators/template/rdoc.css (new) 454 | /trunk/generators/template/images/tag_green.png (new) (and 40 other/s) 455 | 456 | Initial commit 457 | 458 | 459 | -- Wed, 10 Oct 2007 16:31:51 -0000 by deveiant (r1) ----- 460 | Added: /trunk (new) 461 | /branches (new) 462 | /tags (new) 463 | 464 | Setting up repository structure 465 | 466 | 467 | -------------------------------------------------------------------------------- /lib/rdoc/generator/template/darkfish/js/jquery.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery 1.2.6 - New Wave Javascript 3 | * 4 | * Copyright (c) 2008 John Resig (jquery.com) 5 | * Dual licensed under the MIT (MIT-LICENSE.txt) 6 | * and GPL (GPL-LICENSE.txt) licenses. 7 | * 8 | * $Date$ 9 | * $Rev$ 10 | */ 11 | (function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else 12 | return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else 13 | return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else 14 | selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else 16 | this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else 17 | return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else 18 | jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else 22 | jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else 23 | ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else 24 | while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else 26 | for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else 28 | xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else 29 | jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else 30 | for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else 31 | s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else 32 | e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); --------------------------------------------------------------------------------