lib/slideshow.rb in slideshow-0.5 vs lib/slideshow.rb in slideshow-0.5.1
- old
+ new
@@ -56,17 +56,21 @@
if get_boolean_option( 's5', false )
headerdoc = load_template( 's5/header.html.erb' )
footerdoc = load_template( 's5/footer.html.erb' )
styledoc = load_template( 's5/style.css.erb' )
- else
+ elsif get_boolean_option( 'fuller', false ) || get_boolean_option( 'fullerscreen', false ) # use fullerscreen templates
headerdoc = load_template( 'header.html.erb' )
footerdoc = load_template( 'footer.html.erb' )
- styledoc = load_template( 'style.css.erb' )
+ styledoc = load_template( 'style.css.erb' )
+ else # use default s6 templates
+ headerdoc = load_template( 's6/header.html.erb' )
+ footerdoc = load_template( 's6/footer.html.erb' )
+ styledoc = load_template( 's6/style.css.erb' )
end
- # background theming shared between s5/s9
+ # background theming shared between s5/s6/fullerscreen
gradientdoc = load_template( 'gradient.svg.erb' )
basename = File.basename( fn, '.*' )
extname = File.extname( fn )
@@ -234,13 +238,13 @@
end
out.flush
out.close
- # copy s5 machinery to s5 folder
if get_boolean_option( 's5', false )
+ # copy s5 machinery to s5 folder
# todo/fix: is there a better way to check if the dir exists?
Dir.mkdir( 's5' ) unless File.directory?( 's5' )
[ 'opera.css', 'outline.css', 'print.css', 's5-core.css', 'slides.js' ].each do |name|
@@ -248,10 +252,24 @@
dest = "s5/#{name}"
logger.debug "copying '#{source} ' to '#{dest}'"
File.copy( source, dest )
end
+ elsif get_boolean_option( 'fuller', false ) || get_boolean_option( 'fullerscreen', false )
+ # do nothing; slideshow machinery built into plugin (requires install!)
+ else
+ # copy s6 machinery to s6 folder
+ Dir.mkdir( 's6' ) unless File.directory?( 's6' )
+
+ [ 'outline.css', 'print.css', 'slides.css', 'slides.js', 'jquery.js' ].each do |name|
+
+ source = "#{File.dirname(__FILE__)}/templates/s6/#{name}"
+ dest = "s6/#{name}"
+
+ logger.debug "copying '#{source} ' to '#{dest}'"
+ File.copy( source, dest )
+ end
end
puts "Done."
end
@@ -332,10 +350,11 @@
opts.banner = "Usage: slideshow [options] name"
#todo/fix: use -s5 option without optional hack? possible with OptionParser package/lib?
# use -5 switch instead?
opts.on( '-s[OPTIONAL]', '--s5', 'S5 Compatible Slide Show' ) { $options[ 's5' ] = true; }
+ opts.on( '-f[OPTIONAL]', '--fullerscreen', 'FullerScreen Compatible Slide Show' ) { $options[ 'fuller' ] = true; }
# opts.on( "-s", "--style STYLE", "Select Stylesheet" ) { |s| $options[:style]=s }
# opts.on( "-v", "--version", "Show version" ) {}
opts.on( "-t", "--trace", "Show debug trace" ) {
logger.datetime_format = "%H:%H:%S"
logger.level = Logger::DEBUG
@@ -357,10 +376,10 @@
}
end
opt.parse!
- puts "Slide Show (S9) Version: 0.5 on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
+ puts "Slide Show (S9) Version: 0.5.1 on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
ARGV.each { |fn| Slideshow.create_slideshow( fn ) }
end
end
\ No newline at end of file