ThingFish is a highly-accessible network store for cataloging large files and their
25 | associated metadata.
26 |
27 |
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 |
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 |
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 |
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 |
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 |
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+">"+tag+">";});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(/