From 1ccab1b29f39e1ee510f078777669bba85cfb515 Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Fri, 31 Mar 2006 20:27:58 +0000 Subject: [PATCH] big updates --- Rakefile | 2 +- bin/railscov | 29 +- lib/insurance.rb | 4 +- lib/insurance/analyzer.rb | 23 +- lib/insurance/formatter.rb | 84 +- .../rails/insurance/templates/insurance.rake | 46 +- lib/insurance/templates/assets/bg_body.jpg | Bin 0 -> 4068 bytes lib/insurance/templates/assets/bg_body2.jpg | Bin 0 -> 615 bytes lib/insurance/templates/assets/bg_header.jpg | Bin 0 -> 932 bytes lib/insurance/templates/assets/bg_header2.jpg | Bin 0 -> 523 bytes .../templates/assets/header_header.jpg | Bin 0 -> 1254 bytes lib/insurance/templates/assets/left.jpg | Bin 0 -> 380 bytes lib/insurance/templates/assets/li_bullet.gif | Bin 0 -> 49 bytes .../templates/assets/logo_greenery.gif | Bin 0 -> 767 bytes lib/insurance/templates/assets/menu_tab.gif | Bin 0 -> 196 bytes lib/insurance/templates/assets/prototype.js | 1959 +++++++++++++++++ lib/insurance/templates/assets/right.jpg | Bin 0 -> 362 bytes lib/insurance/templates/assets/rounded_bl.gif | Bin 0 -> 70 bytes lib/insurance/templates/assets/rounded_br.gif | Bin 0 -> 70 bytes lib/insurance/templates/assets/rounded_tl.gif | Bin 0 -> 70 bytes lib/insurance/templates/assets/rounded_tr.gif | Bin 0 -> 70 bytes lib/insurance/templates/assets/ruby.css | 76 + lib/insurance/templates/assets/screen5.css | 415 ++++ lib/insurance/templates/code-page.rhtml | 133 +- lib/insurance/templates/index.rhtml | 116 +- 25 files changed, 2717 insertions(+), 170 deletions(-) create mode 100644 lib/insurance/templates/assets/bg_body.jpg create mode 100644 lib/insurance/templates/assets/bg_body2.jpg create mode 100644 lib/insurance/templates/assets/bg_header.jpg create mode 100644 lib/insurance/templates/assets/bg_header2.jpg create mode 100644 lib/insurance/templates/assets/header_header.jpg create mode 100644 lib/insurance/templates/assets/left.jpg create mode 100644 lib/insurance/templates/assets/li_bullet.gif create mode 100644 lib/insurance/templates/assets/logo_greenery.gif create mode 100644 lib/insurance/templates/assets/menu_tab.gif create mode 100644 lib/insurance/templates/assets/prototype.js create mode 100644 lib/insurance/templates/assets/right.jpg create mode 100644 lib/insurance/templates/assets/rounded_bl.gif create mode 100644 lib/insurance/templates/assets/rounded_br.gif create mode 100644 lib/insurance/templates/assets/rounded_tl.gif create mode 100644 lib/insurance/templates/assets/rounded_tr.gif create mode 100644 lib/insurance/templates/assets/ruby.css create mode 100644 lib/insurance/templates/assets/screen5.css diff --git a/Rakefile b/Rakefile index a78010d..612a114 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,7 @@ rescue Exception nil end -PKG_VERSION = "0.3" +PKG_VERSION = "0.3.3" desc "Default Task" task :default => :test diff --git a/bin/railscov b/bin/railscov index 914fd09..b131ad8 100644 --- a/bin/railscov +++ b/bin/railscov @@ -22,13 +22,23 @@ EOF 'Currently only works with Rails apps.' ) { |value| options[:apply_to] = value } + opts.separator '' + opts.on('-r', '--report [DATABASE]', + 'Generate a report using the optional file.') do |value| + options[:report] = true + options[:report_db] = value + end + opts.on('-o', '--output DIRECTORY', + 'Directory for report output.') { |value| options[:report_out] = value } + opts.separator '' opts.on_tail('-h', '--help', 'Show this message') do puts opts - exit + exit!(0) end opts.on_tail('--version', 'Show version') do puts "Insurance #{Insurance::VERSION}, #{Insurance::RELEASE_DATE}" + exit!(0) end end opts.parse! ARGV @@ -36,12 +46,21 @@ opts.parse! ARGV if options[:apply_to] require 'insurance/generators/rails/loader' InsuranceLoader::Generators::RailsLoader.load! options - exit + exit!(0) +end + +if options[:report] + reportdb = options[:report_db] || 'insurance.db' + outdir = options[:report_out] || 'insurance' + + puts "Running the report from #{reportdb}, output to #{outdir}" + Insurance::Formatter.run(reportdb, outdir) + exit!(0) end unless File.exist?('config/environment.rb') puts 'Please run railscov from your RAILS_ROOT' - exit + exit!(0) end @@ -82,4 +101,6 @@ module Test end end -Insurance::RailsAnalyzer.run(Dir['test/unit/**/*.rb'] + Dir['test/functional/**/*.rb']) +Insurance::RailsAnalyzer.run(ARGV[0]) + +#Insurance::RailsAnalyzer.run(Dir['test/unit/**/*.rb'] + Dir['test/functional/**/*.rb']) diff --git a/lib/insurance.rb b/lib/insurance.rb index 3d4c688..990dce5 100644 --- a/lib/insurance.rb +++ b/lib/insurance.rb @@ -4,6 +4,6 @@ require 'insurance/formatter' module Insurance - VERSION = '0.1' - RELEASE_DATE = '28 Oct 2005' + VERSION = '0.3.3' + RELEASE_DATE = '30 March 2006' end diff --git a/lib/insurance/analyzer.rb b/lib/insurance/analyzer.rb index f9ec16e..abfa0c6 100644 --- a/lib/insurance/analyzer.rb +++ b/lib/insurance/analyzer.rb @@ -5,9 +5,20 @@ module Insurance END { Insurance.set_trace_func nil - Dir.mkdir('insurance') unless File.exist?('insurance') + section = ARGV[0].split('/').last.to_sym + x = {} + FILELIST.each do |k,v| + x[k] = v.lines + end + + if File.exist?('insurance.db') + data = Marshal.load(open('insurance.db')) + else + data = {} + end + data[section] = x - Insurance::Formatter.run(Insurance::FILELIST) + open('insurance.db', 'w').write(Marshal.dump(data)) } class Analyzer @@ -51,7 +62,11 @@ def self.filter(file) end end - def self.run(files) + def self.run(dir) + $thedirname = dir + files = Dir["#{dir}/**/*.rb"] + puts files.inspect + # The rails analyzer does not need to set the trace func, because that is # done in the perversion of Test::Unit::TestCase. @@ -60,6 +75,8 @@ def self.run(files) # all of the application's models and controllers so that we can trace things # at the class level. This is just easier to do than to try and figure out # what should really be marked as hit in the output stage. + +# files.each { |f| load f } pipe = IO.popen('-', 'w+') if pipe diff --git a/lib/insurance/formatter.rb b/lib/insurance/formatter.rb index 2ea9e97..6a94c35 100644 --- a/lib/insurance/formatter.rb +++ b/lib/insurance/formatter.rb @@ -6,35 +6,85 @@ module Insurance class Formatter include ERB::Util - def self.run(filelist) - files = filelist.keys.sort + def self.svn_blame_for(file) + if File.exist?(File.dirname(File.expand_path(file)) + '/.svn') + `svn blame #{file}`.split("\n").map {|l| l.split[1]}.map { |l| l.split('@')[0] } + else + [] + end + end + + def self.run(dbfile, outputdir) + raw = Marshal.load(open(dbfile)) + + unless File.exist?(outputdir) + Dir.mkdir(outputdir) + end + + asset_dir = File.dirname(__FILE__) + "/templates/assets" + + files = raw.keys.inject([]) { |arr, k| arr += raw[k].keys; arr }.uniq.sort project_name = File.basename Dir.pwd - File.open("insurance/index.html", 'w') do |f| + File.open("#{outputdir}/index.html", 'w') do |f| f.write ERB.new(File.read("#{File.dirname(__FILE__)}/templates/index.rhtml")).result(binding) - puts "Wrote insurance/index.html" + puts "Wrote #{outputdir}/index.html" end - filelist.each do |file, sf| - sf.post_analyze! + files.each do |file, lines| + contents = File.open(file, 'r').readlines + lines = [] + contents.each_with_index do |line, num| + sline = line.strip + lines << num + 1 if sline.empty? + lines << num + 1 if sline =~ /^#/ + lines << num + 1 if sline =~ /^\s*(?:end|\})\s*(?:#.*)?$/ + lines << num + 1 if sline =~ /^(public|private|protected)/ + lines << num + 1 if sline =~ /^(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ + lines << num + 1 if sline =~ /^(?:rescue)/ + lines << num + 1 if sline =~ /^case\s*(?:#.*)?$/ + lines << num + 1 if sline =~ /^(\)|\]|\})(?:#.*)?$/ + end + [:unit, :functional, :integration].each do |suite| + if raw[suite][file] + raw[suite][file] += lines + end + end + end + + # Create html output + files.each do |file, lines| + blame = svn_blame_for(file) - file_under_test = sf.name - percentage = sf.coverage_percent + file_under_test = file + percentage = 0 # XXX + File.open("#{outputdir}/#{file.gsub('/', '-')}.html", 'w') do |f| + + contents = File.open(file, 'r').readlines + + body = "\n" - File.open("insurance/#{sf.name.gsub('/', '-')}.html", 'w') do |f| - contents = File.open(sf.name, 'r').readlines - body = "
\n"
           contents.each_with_index do |line, num|
-            unless sf.lines.include?(num + 1)
-              body << "#{'%3s' % (num + 1).to_s}  #{Syntax::Convertors::HTML.for_syntax('ruby').convert(line.chomp, false)}\n"
-            else
-              body << "#{'%3s' % (num + 1).to_s}  #{Syntax::Convertors::HTML.for_syntax('ruby').convert(line, false)}"
+            classes = []
+            [:unit, :functional, :integration].each do |suite|
+              if raw[suite][file] && raw[suite][file].include?(num+1)
+                classes << suite.to_s
+              end
+            end
+            lineno = (num + 1).to_s
+            body << "
" + unless blame.empty? + body << "" end + body << "" end - body << "" + body << "
" + body << "#{lineno}" + body << "#{blame[num]}
  #{Syntax::Convertors::HTML.for_syntax('ruby').convert(line, false)}"
+            body << "
" f.write ERB.new(File.read("#{File.dirname(__FILE__)}/templates/code-page.rhtml")).result(binding) - puts "Wrote insurance/#{sf.name.gsub('/', '-')}.html" + puts "Wrote #{outputdir}/#{file.gsub('/', '-')}.html" end end end diff --git a/lib/insurance/generators/rails/insurance/templates/insurance.rake b/lib/insurance/generators/rails/insurance/templates/insurance.rake index ab65f82..0804bfe 100644 --- a/lib/insurance/generators/rails/insurance/templates/insurance.rake +++ b/lib/insurance/generators/rails/insurance/templates/insurance.rake @@ -1,7 +1,41 @@ -desc 'Run Insurnace coverage analysis' -task :insurance => [ :prepare_test_database ] do - puts - puts 'You may want to get a beverage while this runs. It could take a while!' - puts - system 'railscov' +namespace 'insurance' do + + task :banner do + puts '' + puts 'You might want to get a beverage. This could take a while!' + puts '' + end + + desc 'Run Insurnace coverage analysis on unit tests' + task :units => :banner do + puts 'Analyzing unit suite' + sh %{railscov test/unit} + end + + desc 'Run Insurnace coverage analysis on functional tests' + task :functionals => :banner do + puts 'Analyzing functional suite' + sh %{railscov test/functional} + end + + desc 'Run Insurnace coverage analysis on integration tests' + task :integration => :banner do + puts 'Analyzing integration suite' + sh %{railscov test/integration} + end + + desc 'Clean up Insurance temporary database' + task :clean do + rm_f 'insurance.db' + end + + desc 'Generate the Insurance report' + task :report do + sh %{railscov -r} + end end + +desc 'Run Insurnace coverage analysis' +task :insurance => ['insurance:banner', 'insurance:clean', + 'insurance:units', 'insurance:functionals', + 'insurance:integration', 'insurance:report'] \ No newline at end of file diff --git a/lib/insurance/templates/assets/bg_body.jpg b/lib/insurance/templates/assets/bg_body.jpg new file mode 100644 index 0000000000000000000000000000000000000000..26eeb1181e34234f3fa9a77e27ce1378c54fa5d1 GIT binary patch literal 4068 zcmah~c|4SB`+uI<3}bmrV;Q8Gu{)6%ML1?G8C$j};be_O*;2F^`w$sBWi-}9i=rZ; zBnjEFM3h3Lj!7ayct_{=tM~omyzljVp6hdc?(6z|@9%Zp&-1-EhBn>;kl9|-y#NS; z0FChvwtM@bRGq1Ox>I1hAWi`)QjX zAQFj0^Pq+J_=K=R{6bh!5w3}f{;c_*!A27xj0OZz6gVghz=T1#Fu2hS;5Vsmvi)Ts z430u@Q@HDxC0On|}FH7KrX+;O0}LjsYo zvZAQTamBZ_>s@pmWm zAG^arP#>g4{Fe&Y&kAJ-0O2qM0tNp$3lI`^3nbW7KEe_UKEtT4L6NCyJ1PIy7fK&C z)MY8c&QOdiJL1!0hSS{JhZLxs8IDkQ>X+6JTGy-Oq_`&wl&2QreEiKNaoXRR!{r|C zF*n;&7lzB@_FGl$KNNKA!i)EU2H4_vBbffNRs++vveII5)=A=@{N$`h z;=QBnxz&uMz^He3G;@{B4Q;L#*PvN^>ibjoZP`1UtDTnoIESU`)Vdj}=z9yghtzU= zR@m$a0r33#gh4=^%1Fp{?*ETTpQxL?>&8z+UC&jhh(qt|czQv)Pto5l<#1q-`5&u22T9eNMeLS#J^N)ZM|CR~ejLZJ zaZK&V`{O`4{R zLuR{Igd(rZsZI)7lng2RiQHb(cd^wzNGgUU(h<-{!`lbO5h@k564 zHCl_sQa5hkT8^9io?gG@Nv0`wD>=waDtaQSwEg~&lVg}Q>VuQ}_e9@Ft*z&KYAHi2s4+GP%hHhxIkCbh6(C=& z(3)K*k^Pbf&A1}L{)V^b&t!>6h)zEkk4v5$=iQoij+rLVttGaY2;Y|RAtq~j8DTj2T9_V1n6iH2Tr zjG4&CLrTx3K6Evu;>EXJF9!NPmwJl}o({9{wf}Pt15MtMsbZc%DkgWqSqyuzT|6af z39fwSaUJcqf-9%?*I(@`GBz%BGSDFsXOMej&c>a?;H|t`8b8mlqB8H;X(UD}cyyG9 zIqLdcFKCnC@ze%;-VpX>W=uI-YygfrsKyq-bl@3$Mz=j{&kJ3jZw}V)lHpa{|M$nO z18nLRMCX+SXb3C~K}QqPKv^tW7NGppvwsfI0NoUkMg_1G0t^7KrU*I}NTbL`nG(_f z0yhQFWFa(y{?7pao}q6NATX)20D9BIXoUYFz?%{c{ZEPhyFwn~-mV}Vj{JEigIqlW zHU%v*wV?9R=jUT{u0Qn*iav-$tTr*zDlVO8$q1p*0HRn59+Bm`MT=g|w(}e|@t2EYpU?U<4Qo%1=_kq^ubs}%`WC-NZ-P= zs#X93fY}Oy58JHoPectzTBaY}dM8oYfLRXg?{x4m-HXk$b!XD)NIs8hCJc~h1W(fQ zACiRM#*H(1-FvS*wmAkO?>94t>$zxRHgEstHh&t?C9YD&=XaUGDMpYI4T_0&s@GdC zVia&W#RLLKwFvE{+=7b(m>H|Xsf+=sH20XwqY;m-%|$RZ3B>l>R(QM@mk4 zriJj9675Gy*GOM7Ga%ubN>wcCZg2Z7Hmg5Jb`$K6VL%Y@0eEid2gy3$Ym+CCo?~K^Rip)5$zqsB1M_@#_XaPP2!u`MTrPuXdcR5Xs_IqfscZ z=;dN`0GtBo#eXWKLO$wgOh#qXM*&w9@2NH}(n*}NHG`&j)iR}%t(h0Bz!RL-rc_XWBLY`JPol(m)w)Hy( zpgAw^^2VE@Y0b5EV)6%S+HW|%O-Dr{(2vTPbc`!y(QknUw{2!oxuVYXPG<~dZ(iznld9YwKQPDOTY0HTF0%WQHq z{|CI9<35;#?_jV^GTL%vGMms@=Wgkh!>nSkeL@g<`x^-gb!)u`4v}p=hpmMr$vZK* z4mgXdw?Xg6`;ENGD5e{WRQlWl60Rd=`+5ws z3Z(RG0G*&1P6Umu+c7e3q^K?1<^>5$N-Xuzou5$(y~I$Q?xsUPm$d*Ps=?R$LFz$% z8MJWXp6C;dLQ|u(<8oY1507UwxK@%pVUYzJfF}2u2t%z0^)1?b4hr z#Mfq8vp3*!a#8=?hDKJ>sg?KwLnfb!dxyvbB}n|T z%6;?CE0qDnsDj_E(60=LpHfP zT2fBC%uiLH;@nYNb_QHsI_Jvr_iiE3EZg3YCdkSd4e;FoVc*nM=!K_O?uL54vGURuuNgwK8Pw*G_=&oD6+rn}Or zf6fkSu+iG|U_!TV_JIQXsI6nV2RQl8qv^2EqilC5Pdha8MFab#{60HxYVe3cws23+ zG2}aBi2iHTX=1LQ`tU+n+ZWRbTj!cDZjqx4sr0Bb_pMI)JeY}BJtXMlIpr%TfI4`B zsbTn#WkYBi`_iDGwM|LaAvc2~GZw%1Bq4Cxq_{5FsVe+7Vr_Z}r`K=dVXSfaB5e4t z0$03N#A|ze!&3MH>%5rI8cN~t!0L33O5-<;J`*X`&MQ+%ZAtYzCd*7;YpjJmKVtqi zJX5&k=0rf73O_!|Zk@T4Y_?MS_bsfi~aV+f-I1(qUoNi5|z}v$jSF>%Gu2camM0n zryWW#t=PlWiry5ZHvel58#_sNw z?G=F%&5nEZofz22yfL}O`e_-6ryO3-uWteGT`JgdQbc>6ZFt$~wdv^B+W8JB6jPFa z*5`Hc#YZx5jk6m-iG0gv8gaYzH(ve=%ZODk literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/bg_body2.jpg b/lib/insurance/templates/assets/bg_body2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..09f8462107a5ddd9d89393f5d8be2a4a31441f49 GIT binary patch literal 615 zcmex=lk!=2{JMZGX6ipAO?0S0}^0lW&?_g06l;P{@-HYVP<4t5?~f!U|>AYAZia( zCoaIqz>K1hkwHKasFVX}03$2YOo#O#(*)5?QvfSrW@NNyl*glh38p|wfPsk#)gnd4 zLdV33P^;MNnHI-tGfk@p8YTx)i=rCnV@1P2$Ha{vKEj-4uc#QY_@(S*-B}NeeoE(e ze>nHB)QkHtd+m9k3a~%H{t{^N$KyPZ`vnNOAFM!D02m%XHzC4-QBcv4!Lf1T!w+yL s3A~tb_TrAo#qr%!Pc@{xXYtqj;V>yqXNrHia=nEsb2(p6b@Bh30915o!~g&Q literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/bg_header.jpg b/lib/insurance/templates/assets/bg_header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..22366fdfe7a41797f78b3b81c4b0d643662ce8bf GIT binary patch literal 932 zcmex=lk!=2{JMZGX6ipAO&(N2r$3_BNGcV2P;rc0$qlIfsu)o?f)$X9%e=cCIMyv zpumSudjwfs8_sG87P)qsCQcH%8Cc|9rsJF<)prfX$(Z-98`ihyT zT*=s!u`+3zS8!yoqe+NsSI{C2d!XAT1%O@xx)K2x8CXpN5`d290Ln13GQBW1PTu;j zUU7qx@=(zz{t!JP`nA|AU1oZDVa`{vdp`$T$}<{4{{`m z`Tzz21p}CRMtj9e2hB5I%?Rr;QmThV3D^Sy_1o{NC;$ z?2QY1k~cm4&j9iPIFOL-Vq_2qShx`pMgkM~SWEY^idm$9LP$mc7++uj*TX2_Xc(xF za1a)0_5udUGtFikGd%BRIB%9=pIx6}fAjjq5+HwG{!ygAj90KT1Z(=r7L?VJ_EU&E9vv7PJ2Ll5GD}xXtGe`=I4S_0U zfNU=yHUhFmfHY7sgD?|9O=dd_SZx(h90VMlT@->Vi%U{-ixpfl(=$sFa}+#t6Vo&E z(iw~l49u(y46O_-6^sn6Ow6oI4S_Z?OkihV0qQg`GBTJji3!X$G_Yh~S^zQGfsKKI z8OjE^j1|h>17w2$6VQH$t{_VbAPZ`mp@9KJ9_Y^l41ydCjBF0fj7khlf{e_9jQ?*l zv@o!FVlAD;k;@YMW^2=xQ@^b93|a^2-Sd$~kDOXgiP${vTmn1Pp3cMlgUmmywAX=rDE; zPA+Z%1|~*kW+oP9R#p~Z7%|oYR;@QBE$5`HGdRHf`Rrb=&qGJ9iyAeB|h{<0np@ zx^(%<)oa&p+`RSh(c>pipFMx^^3}&rpTB(l_Wj4tUyKaQ5bppwu`BM9^l6AKG7 z3p>a^j7;S~%q+;ls%Xe29sEI5e!94``&;MHtJj}opCde$vV9)UG#iFjCn~!m6ENY+;p1~>-=)kJ0s>`4& z66nFyrLlli%uu>K*gdM0K_t+XI{5OnxxTg;42!xnNXAQ+E?LGD=qkd1gc~##burKa H|Gxi3*BJDIfzy2uD#7 z!~l|D0M`y-{6D}T$iX1Qz{kue$iO7X$SlbC{|JLP0|PT70}5bfX9G&83NSFTFfel> zBpDf)m{|mc3|ZOOg%tw}Cm#F&R3--WDMAUz97a|Kpt!UkP?#AA5rC12MUYuY@&7Fb z9-x&>g3N*p_6!F?wr8z5lyzyBrCWdIfqsr1-ycU_wQt}3UhhViSNPoCUysd=9ln*w nJ9Tee`Fc|Mz__+ literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/li_bullet.gif b/lib/insurance/templates/assets/li_bullet.gif new file mode 100644 index 0000000000000000000000000000000000000000..fc25cc1190855a3b341157f23de7129e57f50b3f GIT binary patch literal 49 zcmZ?wbhEHbL literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/logo_greenery.gif b/lib/insurance/templates/assets/logo_greenery.gif new file mode 100644 index 0000000000000000000000000000000000000000..e0858e92e3e1be78d2e2ef24e75e6d66a468036d GIT binary patch literal 767 zcmVX2(NSzcO{!P;SvmCZ7g&*HJ2o z4;*>}A%6#B#Xu{f3PG_SL$e__s}?Gu2}r3aWXeE!)l`7qTT-twO}Z;Ns~3LUSu>{+ zHPiM?SCxr}V!bDcU zGcBVHB7g~P&qzeGB6`+UVaGi?tr2k4=ke# zRlhNO+g41eEqd8hW63{Bswy<76Gx;daMDXGix6DBIxmeBZqP|(!9#S_Peh|7B7g{B zy*@9b4rR+hannpTsT4h$AUc^GF^?83iV*Mz1cl*WA^8LV00000EC2ui z05Sj_000O7fPaF6goTEOh>41ejE#VhhwxK0Tvjv1pqc@eK3Dr zC>NX10ZyVBBnBI_G5|3OeN2B!ef4I~zdNE5bq5Z#eux0z&@41 z9RZ-F-UI>+64nC}Csu%eejebE0MHK-04Mq^AV5%Ky&SO)ghKGE9zL-;;1yMd4A!4g@O4_V*pC$xI{s8} xnWhCa4HWVS7)@G$n>{rOjYvobgk)%tMD*F>8g?fU6>RI?&AYen-;x3W06Xq=DN6tV literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/menu_tab.gif b/lib/insurance/templates/assets/menu_tab.gif new file mode 100644 index 0000000000000000000000000000000000000000..637c6695fb68cd2bef1e8a63164fa2582a200227 GIT binary patch literal 196 zcmZ?wbhEHbbZ6jTIKsf-73>~WI@&l2@+ap4vCT2E6_RrCCY)Z@omlf{|6Qnn0Klqh#e?6nZqQ?KJD;>HBmE} b+_)C*soHPr`Si + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.0_pre0', + ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', + + emptyFunction: function() {}, + K: function(x) {return x} +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +} + +Object.inspect = function(object) { + try { + if (object == undefined) return 'undefined'; + if (object == null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } +} + +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this; + return function(event) { + return __method.call(object, event || window.event); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() { + var digits = this.toString(16); + if (this < 16) return '0' + digits; + return digits; + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + } +}); + +var Try = { + these: function() { + var returnValue; + + for (var i = 0; i < arguments.length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(); + } finally { + this.currentlyExecuting = false; + } + } + } +} +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += (replacement(match) || '').toString(); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(eval); + }, + + escapeHTML: function() { + var div = document.createElement('div'); + var text = document.createTextNode(this); + div.appendChild(text); + return div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; + }, + + toQueryParams: function() { + var pairs = this.match(/^\??(.*)$/)[1].split('&'); + return pairs.inject({}, function(params, pairString) { + var pair = pairString.split('='); + params[pair[0]] = pair[1]; + return params; + }); + }, + + toArray: function() { + return this.split(''); + }, + + camelize: function() { + var oStringList = this.split('-'); + if (oStringList.length == 1) return oStringList[0]; + + var camelizedString = this.indexOf('-') == 0 + ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) + : oStringList[0]; + + for (var i = 1, len = oStringList.length; i < len; i++) { + var s = oStringList[i]; + camelizedString += s.charAt(0).toUpperCase() + s.substring(1); + } + + return camelizedString; + }, + + inspect: function() { + return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'"; + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (typeof replacement == 'function') return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.prototype = { + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + return this.template.gsub(this.pattern, function(match) { + var before = match[1]; + if (before == '\\') return match[2]; + return before + (object[match[3]] || '').toString(); + }); + } +} + +var $break = new Object(); +var $continue = new Object(); + +var Enumerable = { + each: function(iterator) { + var index = 0; + try { + this._each(function(value) { + try { + iterator(value, index++); + } catch (e) { + if (e != $continue) throw e; + } + }); + } catch (e) { + if (e != $break) throw e; + } + }, + + all: function(iterator) { + var result = true; + this.each(function(value, index) { + result = result && !!(iterator || Prototype.K)(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator) { + var result = true; + this.each(function(value, index) { + if (result = !!(iterator || Prototype.K)(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator) { + var results = []; + this.each(function(value, index) { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function (iterator) { + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator) { + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(pattern, iterator) { + var results = []; + this.each(function(value, index) { + var stringValue = value.toString(); + if (stringValue.match(pattern)) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function(object) { + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inject: function(memo, iterator) { + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.collect(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (value >= (result || value)) + result = value; + }); + return result; + }, + + min: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (value <= (result || value)) + result = value; + }); + return result; + }, + + partition: function(iterator) { + var trues = [], falses = []; + this.each(function(value, index) { + ((iterator || Prototype.K)(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value, index) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator) { + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator) { + return this.collect(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.collect(Prototype.K); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (typeof args.last() == 'function') + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + inspect: function() { + return '#'; + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); +var $A = Array.from = function(iterable) { + if (!iterable) return []; + if (iterable.toArray) { + return iterable.toArray(); + } else { + var results = []; + for (var i = 0; i < iterable.length; i++) + results.push(iterable[i]); + return results; + } +} + +Object.extend(Array.prototype, Enumerable); + +Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0; i < this.length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != undefined || value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(value.constructor == Array ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + indexOf: function(object) { + for (var i = 0; i < this.length; i++) + if (this[i] == object) return i; + return -1; + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + shift: function() { + var result = this[0]; + for (var i = 0; i < this.length - 1; i++) + this[i] = this[i + 1]; + this.length--; + return result; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + } +}); +var Hash = { + _each: function(iterator) { + for (key in this) { + var value = this[key]; + if (typeof value == 'function') continue; + + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + merge: function(hash) { + return $H(hash).inject($H(this), function(mergedHash, pair) { + mergedHash[pair.key] = pair.value; + return mergedHash; + }); + }, + + toQueryString: function() { + return this.map(function(pair) { + return pair.map(encodeURIComponent).join('='); + }).join('&'); + }, + + inspect: function() { + return '#'; + } +} + +function $H(object) { + var hash = Object.extend({}, object || {}); + Object.extend(hash, Enumerable); + Object.extend(hash, Hash); + return hash; +} +ObjectRange = Class.create(); +Object.extend(ObjectRange.prototype, Enumerable); +Object.extend(ObjectRange.prototype, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + do { + iterator(value); + value = value.succ(); + } while (this.include(value)); + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +} + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')}, + function() {return new XMLHttpRequest()} + ) || false; + }, + + activeRequestCount: 0 +} + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responderToAdd) { + if (!this.include(responderToAdd)) + this.responders.push(responderToAdd); + }, + + unregister: function(responderToRemove) { + this.responders = this.responders.without(responderToRemove); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (responder[callback] && typeof responder[callback] == 'function') { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) {} + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { + Ajax.activeRequestCount++; + }, + + onComplete: function() { + Ajax.activeRequestCount--; + } +}); + +Ajax.Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(options) { + this.options = { + method: 'post', + asynchronous: true, + parameters: '' + } + Object.extend(this.options, options || {}); + }, + + responseIsSuccess: function() { + return this.transport.status == undefined + || this.transport.status == 0 + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + responseIsFailure: function() { + return !this.responseIsSuccess(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + initialize: function(url, options) { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function(url) { + var parameters = this.options.parameters || ''; + if (parameters.length > 0) parameters += '&_='; + + try { + this.url = url; + if (this.options.method == 'get' && parameters.length > 0) + this.url += (this.url.match(/\?/) ? '&' : '?') + parameters; + + Ajax.Responders.dispatch('onCreate', this, this.transport); + + this.transport.open(this.options.method, this.url, + this.options.asynchronous); + + if (this.options.asynchronous) { + this.transport.onreadystatechange = this.onStateChange.bind(this); + setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); + } + + this.setRequestHeaders(); + + var body = this.options.postBody ? this.options.postBody : parameters; + this.transport.send(this.options.method == 'post' ? body : null); + + } catch (e) { + this.dispatchException(e); + } + }, + + setRequestHeaders: function() { + var requestHeaders = + ['X-Requested-With', 'XMLHttpRequest', + 'X-Prototype-Version', Prototype.Version, + 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*']; + + if (this.options.method == 'post') { + requestHeaders.push('Content-type', + 'application/x-www-form-urlencoded'); + + /* Force "Connection: close" for Mozilla browsers to work around + * a bug where XMLHttpReqeuest sends an incorrect Content-length + * header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType) + requestHeaders.push('Connection', 'close'); + } + + if (this.options.requestHeaders) + requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); + + for (var i = 0; i < requestHeaders.length; i += 2) + this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState != 1) + this.respondToReadyState(this.transport.readyState); + }, + + header: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) {} + }, + + evalJSON: function() { + try { + return eval(this.header('X-JSON')); + } catch (e) {} + }, + + evalResponse: function() { + try { + return eval(this.transport.responseText); + } catch (e) { + this.dispatchException(e); + } + }, + + respondToReadyState: function(readyState) { + var event = Ajax.Request.Events[readyState]; + var transport = this.transport, json = this.evalJSON(); + + if (event == 'Complete') { + try { + (this.options['on' + this.transport.status] + || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(transport, json); + } catch (e) { + this.dispatchException(e); + } + + if ((this.header('Content-type') || '').match(/^text\/javascript/i)) + this.evalResponse(); + } + + try { + (this.options['on' + event] || Prototype.emptyFunction)(transport, json); + Ajax.Responders.dispatch('on' + event, this, transport, json); + } catch (e) { + this.dispatchException(e); + } + + /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ + if (event == 'Complete') + this.transport.onreadystatechange = Prototype.emptyFunction; + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Updater = Class.create(); + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function(container, url, options) { + this.containers = { + success: container.success ? $(container.success) : $(container), + failure: container.failure ? $(container.failure) : + (container.success ? null : $(container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function(transport, object) { + this.updateContent(); + onComplete(transport, object); + }).bind(this); + + this.request(url); + }, + + updateContent: function() { + var receiver = this.responseIsSuccess() ? + this.containers.success : this.containers.failure; + var response = this.transport.responseText; + + if (!this.options.evalScripts) + response = response.stripScripts(); + + if (receiver) { + if (this.options.insertion) { + new this.options.insertion(receiver, response); + } else { + Element.update(receiver, response); + } + } + + if (this.responseIsSuccess()) { + if (this.onComplete) + setTimeout(this.onComplete.bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function(container, url, options) { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(request) { + if (this.options.decay) { + this.decay = (request.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), + this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $() { + var results = [], element; + for (var i = 0; i < arguments.length; i++) { + element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + results.push(Element.extend(element)); + } + return results.length < 2 ? results[0] : results; +} + +document.getElementsByClassName = function(className, parentElement) { + var children = ($(parentElement) || document.body).getElementsByTagName('*'); + return $A(children).inject([], function(elements, child) { + if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) + elements.push(Element.extend(child)); + return elements; + }); +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Element) + var Element = new Object(); + +Element.extend = function(element) { + if (!element) return; + + if (!element._extended && element.tagName && element != window) { + var methods = Element.Methods; + for (property in methods) { + var value = methods[property]; + if (typeof value == 'function') + element[property] = value.bind(null, element); + } + } + + element._extended = true; + return element; +} + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + Element[Element.visible(element) ? 'hide' : 'show'](element); + } + }, + + hide: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = 'none'; + } + }, + + show: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = ''; + } + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + update: function(element, html) { + $(element).innerHTML = html.stripScripts(); + setTimeout(function() {html.evalScripts()}, 10); + }, + + replace: function(element, html) { + element = $(element); + if (element.outerHTML) { + element.outerHTML = html.stripScripts(); + } else { + var range = element.ownerDocument.createRange(); + range.selectNodeContents(element); + element.parentNode.replaceChild( + range.createContextualFragment(html.stripScripts()), element); + } + setTimeout(function() {html.evalScripts()}, 10); + }, + + getHeight: function(element) { + element = $(element); + return element.offsetHeight; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).include(className); + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).add(className); + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).remove(className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + }, + + empty: function(element) { + return $(element).innerHTML.match(/^\s*$/); + }, + + childOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + while (element = element.parentNode) + if (element == ancestor) return true; + return false; + }, + + scrollTo: function(element) { + element = $(element); + var x = element.x ? element.x : element.offsetLeft, + y = element.y ? element.y : element.offsetTop; + window.scrollTo(x, y); + }, + + getStyle: function(element, style) { + element = $(element); + var value = element.style[style.camelize()]; + if (!value) { + if (document.defaultView && document.defaultView.getComputedStyle) { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css.getPropertyValue(style) : null; + } else if (element.currentStyle) { + value = element.currentStyle[style.camelize()]; + } + } + + if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) + if (Element.getStyle(element, 'position') == 'static') value = 'auto'; + + return value == 'auto' ? null : value; + }, + + setStyle: function(element, style) { + element = $(element); + for (name in style) + element.style[name.camelize()] = style[name]; + }, + + getDimensions: function(element) { + element = $(element); + if (Element.getStyle(element, 'display') != 'none') + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = ''; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = 'none'; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (window.opera) { + element.style.top = 0; + element.style.left = 0; + } + } + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return; + element._overflow = element.style.overflow; + if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') + element.style.overflow = 'hidden'; + }, + + undoClipping: function(element) { + element = $(element); + if (element._overflow) return; + element.style.overflow = element._overflow; + element._overflow = undefined; + } +} + +Object.extend(Element, Element.Methods); + +var Toggle = new Object(); +Toggle.display = Element.toggle; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function(adjacency) { + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function(element, content) { + this.element = $(element); + this.content = content.stripScripts(); + + if (this.adjacency && this.element.insertAdjacentHTML) { + try { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } catch (e) { + if (this.element.tagName.toLowerCase() == 'tbody') { + this.insertContent(this.contentFromAnonymousTable()); + } else { + throw e; + } + } + } else { + this.range = this.element.ownerDocument.createRange(); + if (this.initializeRange) this.initializeRange(); + this.insertContent([this.range.createContextualFragment(this.content)]); + } + + setTimeout(function() {content.evalScripts()}, 10); + }, + + contentFromAnonymousTable: function() { + var div = document.createElement('div'); + div.innerHTML = '' + this.content + '
'; + return $A(div.childNodes[0].childNodes[0].childNodes); + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() { + this.range.setStartBefore(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, this.element); + }).bind(this)); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function(fragments) { + fragments.reverse(false).each((function(fragment) { + this.element.insertBefore(fragment, this.element.firstChild); + }).bind(this)); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.appendChild(fragment); + }).bind(this)); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() { + this.range.setStartAfter(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, + this.element.nextSibling); + }).bind(this)); + } +}); + +/*--------------------------------------------------------------------------*/ + +Element.ClassNames = Class.create(); +Element.ClassNames.prototype = { + initialize: function(element) { + this.element = $(element); + }, + + _each: function(iterator) { + this.element.className.split(/\s+/).select(function(name) { + return name.length > 0; + })._each(iterator); + }, + + set: function(className) { + this.element.className = className; + }, + + add: function(classNameToAdd) { + if (this.include(classNameToAdd)) return; + this.set(this.toArray().concat(classNameToAdd).join(' ')); + }, + + remove: function(classNameToRemove) { + if (!this.include(classNameToRemove)) return; + this.set(this.select(function(className) { + return className != classNameToRemove; + }).join(' ')); + }, + + toString: function() { + return this.toArray().join(' '); + } +} + +Object.extend(Element.ClassNames.prototype, Enumerable); +var Selector = Class.create(); +Selector.prototype = { + initialize: function(expression) { + this.params = {classNames: []}; + this.expression = expression.toString().strip(); + this.parseExpression(); + this.compileMatcher(); + }, + + parseExpression: function() { + function abort(message) { throw 'Parse error in selector: ' + message; } + + if (this.expression == '') abort('empty expression'); + if (this.expression == '*') return this.params.wildcard = true; + + var params = this.params, expr = this.expression, match, modifier, clause, rest; + while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { + modifier = match[1], clause = match[2], rest = match[3]; + switch (modifier) { + case '#': params.id = clause; break; + case '.': params.classNames.push(clause); break; + case '': + case undefined: params.tagName = clause.toUpperCase(); break; + default: abort(expr.inspect()); + } + expr = rest; + } + + if (expr.length > 0) abort(expr.inspect()); + }, + + buildMatchExpression: function() { + var params = this.params, conditions = [], clause; + + if (params.wildcard) + return 'true'; + + if (clause = params.id) + conditions.push('element.id == ' + clause.inspect()); + if (clause = params.tagName) + conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); + if ((clause = params.classNames).length > 0) + for (var i = 0; i < clause.length; i++) + conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')'); + + return conditions.join(' && '); + }, + + compileMatcher: function() { + this.match = new Function('element', 'if (!element.tagName) return false; \ + return ' + this.buildMatchExpression()); + }, + + findElements: function(scope) { + var element; + + if (element = $(this.params.id)) + if (this.match(element)) + if (!scope || Element.childOf(element, scope)) + return [element]; + + scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); + + var results = []; + for (var i = 0; i < scope.length; i++) + if (this.match(element = scope[i])) + results.push(Element.extend(element)); + + return results; + }, + + toString: function() { + return this.expression; + } +} + +function $$() { + return $A(arguments).map(function(expression) { + return expression.strip().split(/\s+/).inject([null], function(results, expr) { + var selector = new Selector(expr); + return results.map(selector.findElements.bind(selector)).flatten(); + }); + }).flatten(); +} +var Field = { + clear: function() { + for (var i = 0; i < arguments.length; i++) + $(arguments[i]).value = ''; + }, + + focus: function(element) { + $(element).focus(); + }, + + present: function() { + for (var i = 0; i < arguments.length; i++) + if ($(arguments[i]).value == '') return false; + return true; + }, + + select: function(element) { + $(element).select(); + }, + + activate: function(element) { + element = $(element); + element.focus(); + if (element.select) + element.select(); + } +} + +/*--------------------------------------------------------------------------*/ + +var Form = { + serialize: function(form) { + var elements = Form.getElements($(form)); + var queryComponents = new Array(); + + for (var i = 0; i < elements.length; i++) { + var queryComponent = Form.Element.serialize(elements[i]); + if (queryComponent) + queryComponents.push(queryComponent); + } + + return queryComponents.join('&'); + }, + + getElements: function(form) { + form = $(form); + var elements = new Array(); + + for (tagName in Form.Element.Serializers) { + var tagElements = form.getElementsByTagName(tagName); + for (var j = 0; j < tagElements.length; j++) + elements.push(tagElements[j]); + } + return elements; + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) + return inputs; + + var matchingInputs = new Array(); + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || + (name && input.name != name)) + continue; + matchingInputs.push(input); + } + + return matchingInputs; + }, + + disable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.blur(); + element.disabled = 'true'; + } + }, + + enable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.disabled = ''; + } + }, + + findFirstElement: function(form) { + return Form.getElements(form).find(function(element) { + return element.type != 'hidden' && !element.disabled && + ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + Field.activate(Form.findFirstElement(form)); + }, + + reset: function(form) { + $(form).reset(); + } +} + +Form.Element = { + serialize: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) { + var key = encodeURIComponent(parameter[0]); + if (key.length == 0) return; + + if (parameter[1].constructor != Array) + parameter[1] = [parameter[1]]; + + return parameter[1].map(function(value) { + return key + '=' + encodeURIComponent(value); + }).join('&'); + } + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) + return parameter[1]; + } +} + +Form.Element.Serializers = { + input: function(element) { + switch (element.type.toLowerCase()) { + case 'submit': + case 'hidden': + case 'password': + case 'text': + return Form.Element.Serializers.textarea(element); + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + } + return false; + }, + + inputSelector: function(element) { + if (element.checked) + return [element.name, element.value]; + }, + + textarea: function(element) { + return [element.name, element.value]; + }, + + select: function(element) { + return Form.Element.Serializers[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + }, + + selectOne: function(element) { + var value = '', opt, index = element.selectedIndex; + if (index >= 0) { + opt = element.options[index]; + value = opt.value; + if (!value && !('value' in opt)) + value = opt.text; + } + return [element.name, value]; + }, + + selectMany: function(element) { + var value = new Array(); + for (var i = 0; i < element.length; i++) { + var opt = element.options[i]; + if (opt.selected) { + var optValue = opt.value; + if (!optValue && !('value' in opt)) + optValue = opt.text; + value.push(optValue); + } + } + return [element.name, value]; + } +} + +/*--------------------------------------------------------------------------*/ + +var $F = Form.Element.getValue; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() {} +Abstract.TimedObserver.prototype = { + initialize: function(element, frequency, callback) { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() {} +Abstract.EventObserver.prototype = { + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + var elements = Form.getElements(this.element); + for (var i = 0; i < elements.length; i++) + this.registerCallback(elements[i]); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + case 'password': + case 'text': + case 'textarea': + case 'select-one': + case 'select-multiple': + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) { + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + + element: function(event) { + return event.target || event.srcElement; + }, + + isLeftClick: function(event) { + return (((event.which) && (event.which == 1)) || + ((event.button) && (event.button == 1))); + }, + + pointerX: function(event) { + return event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function(event) { + return event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function(event) { + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.returnValue = false; + event.cancelBubble = true; + } + }, + + // find the first node with the given tagName, starting from the + // node the event was triggered on; traverses the DOM upwards + findElement: function(event, tagName) { + var element = Event.element(event); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function(element, name, observer, useCapture) { + if (!this.observers) this.observers = []; + if (element.addEventListener) { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } else if (element.attachEvent) { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() { + if (!Event.observers) return; + for (var i = 0; i < Event.observers.length; i++) { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.attachEvent)) + name = 'keydown'; + + this._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.detachEvent)) + name = 'keydown'; + + if (element.removeEventListener) { + element.removeEventListener(name, observer, useCapture); + } else if (element.detachEvent) { + element.detachEvent('on' + name, observer); + } + } +}); + +/* prevent memory leaks in IE */ +Event.observe(window, 'unload', Event.unloadCache, false); +var Position = { + // set to true if needed, warning: firefox performance problems + // NOT neeeded for page scrolling, only if draggable contained in + // scrollable elements + includeScrollOffsets: false, + + // must be called before calling withinIncludingScrolloffset, every time the + // page is scrolled + prepare: function() { + this.deltaX = window.pageXOffset + || document.documentElement.scrollLeft + || document.body.scrollLeft + || 0; + this.deltaY = window.pageYOffset + || document.documentElement.scrollTop + || document.body.scrollTop + || 0; + }, + + realOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [valueL, valueT]; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [valueL, valueT]; + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + p = Element.getStyle(element, 'position'); + if (p == 'relative' || p == 'absolute') break; + } + } while (element); + return [valueL, valueT]; + }, + + offsetParent: function(element) { + if (element.offsetParent) return element.offsetParent; + if (element == document.body) return element; + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return element; + + return document.body; + }, + + // caches x/y coordinate pair to use with overlap + within: function(element, x, y) { + if (this.includeScrollOffsets) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && + y < this.offset[1] + element.offsetHeight && + x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function(element, x, y) { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && + this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && + this.xcomp < this.offset[0] + element.offsetWidth); + }, + + // within must be called directly before + overlap: function(mode, element) { + if (!mode) return 0; + if (mode == 'vertical') + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / + element.offsetHeight; + if (mode == 'horizontal') + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / + element.offsetWidth; + }, + + clone: function(source, target) { + source = $(source); + target = $(target); + target.style.position = 'absolute'; + var offsets = this.cumulativeOffset(source); + target.style.top = offsets[1] + 'px'; + target.style.left = offsets[0] + 'px'; + target.style.width = source.offsetWidth + 'px'; + target.style.height = source.offsetHeight + 'px'; + }, + + page: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent==document.body) + if (Element.getStyle(element,'position')=='absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } while (element = element.parentNode); + + return [valueL, valueT]; + }, + + clone: function(source, target) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || {}) + + // find page position of source + source = $(source); + var p = Position.page(source); + + // find coordinate system to use + target = $(target); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(target,'position') == 'absolute') { + parent = Position.offsetParent(target); + delta = Position.page(parent); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if(options.setWidth) target.style.width = source.offsetWidth + 'px'; + if(options.setHeight) target.style.height = source.offsetHeight + 'px'; + }, + + absolutize: function(element) { + element = $(element); + if (element.style.position == 'absolute') return; + Position.prepare(); + + var offsets = Position.positionedOffset(element); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px';; + element.style.left = left + 'px';; + element.style.width = width + 'px';; + element.style.height = height + 'px';; + }, + + relativize: function(element) { + element = $(element); + if (element.style.position == 'relative') return; + Position.prepare(); + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + } +} + +// Safari returns margins on body which is incorrect if the child is absolutely +// positioned. For performance reasons, redefine Position.cumulativeOffset for +// KHTML/WebKit only. +if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { + Position.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return [valueL, valueT]; + } +} \ No newline at end of file diff --git a/lib/insurance/templates/assets/right.jpg b/lib/insurance/templates/assets/right.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c666d380a80cc855323bd4d71414ba12891189da GIT binary patch literal 362 zcmex=i3*BJDIfzy2uD#7 z!~l|D0M`y-{6D}T$iX1Qz{kue$iO7X$SlbC{|JKw0|OH?0}5bdVqpWyC<=O!l+YJ1av?ING$_1 Tx5sw#nx``l^k_1vFjxZsYpxL< literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/rounded_br.gif b/lib/insurance/templates/assets/rounded_br.gif new file mode 100644 index 0000000000000000000000000000000000000000..a39ad1875ba03fda06a1d980275f6628c486aa76 GIT binary patch literal 70 zcmZ?wbhEHbWMyDwSj51Pl9Cb<5)u~|7ZVecoSf|A+YJ1av?ING$_1 TcSY3(^>u3!PG}rcVXy`OZJ!aa literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/rounded_tl.gif b/lib/insurance/templates/assets/rounded_tl.gif new file mode 100644 index 0000000000000000000000000000000000000000..1d95c05c3770a781ab72efe477ebd39e689f3cc1 GIT binary patch literal 70 zcmZ?wbhEHbWMyDwSj51Pl9Cb<5)u~|7ZVecoSf|A+YJ1av?ING$_1 ScSe}AnEEscR@(<^4AuZzqz{Jx literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/rounded_tr.gif b/lib/insurance/templates/assets/rounded_tr.gif new file mode 100644 index 0000000000000000000000000000000000000000..f075cf334c8d298ccdb397f45db54f4cb2bdaeb3 GIT binary patch literal 70 zcmZ?wbhEHbWMyDwSj51Pl9Cb<5)u~|7ZVecoSf|A+YJ1av?ING$_1 TH%Cy~_k(+bpGi(rVXy`OYl0D! literal 0 HcmV?d00001 diff --git a/lib/insurance/templates/assets/ruby.css b/lib/insurance/templates/assets/ruby.css new file mode 100644 index 0000000..930d8f6 --- /dev/null +++ b/lib/insurance/templates/assets/ruby.css @@ -0,0 +1,76 @@ +.ruby .normal { color: #ffffff; } +.ruby .comment { color: #615960; font-style: italic; } +.ruby .keyword { color: #d7ab5d; font-weight: bold; } +.ruby .method { color: #a77233; } +.ruby .class { color: #a77233; } +.ruby .module { color: #a77233; } +.ruby .punct { color: #ffffff; font-weight: bold; } +.ruby .symbol { color: #ec673e; } +.ruby .string { color: #85a264; } +.ruby .char { color: #85a264; } +.ruby .ident { color: #7085aa; } +.ruby .constant { color: #ec673e; } +.ruby .regex { color: #f3c54e; } +.ruby .number { color: #ec673e; } +.ruby .attribute { color: #7085aa; } +.ruby .global { color: #7085aa; } +.ruby .expr { color: #7085aa; } + +.unhit { background: #660000; } + +pre { + font: 90% verdana, arial, sans-serif; + padding: 0px; + margin: 0px; +} + +#code { + font-size: 125%; + font-weight: bold; +} + +table.ruby { + border-collapse: collapse; +} + +table.ruby td { + margin: 0px; +} + +table.ruby td.lineno, table.ruby td.blame { + font-weight: normal; + text-align: right; + padding: 0px 5px; +} + +.codeline { + background: #660000; + display: inline; +} + +body.all span.unit, body.all span.functional, body.all span.integration { + background: #444444; +} + +body.integration span.unit, body.integration span.functional { + background: #660000; +} +body.integration span.integration { + background: #444444; +} + + +body.functional span.unit, body.functional span.integration { + background: #660000; +} +body.functional span.functional { + background: #444444; +} + + +body.unit span.functional, body.unit span.integration { + background: #660000; +} +body.unit span.unit { + background: #444444; +} diff --git a/lib/insurance/templates/assets/screen5.css b/lib/insurance/templates/assets/screen5.css new file mode 100644 index 0000000..f75cde5 --- /dev/null +++ b/lib/insurance/templates/assets/screen5.css @@ -0,0 +1,415 @@ +/*************************************************** + AUTHOR: Pat Heard ( FullAhead.org ) + TEMPLATE: Greenery + DATE: 2005.11.30 + COPYRIGHT: none + ***************************************************/ + + +/*************************************************** + HTML Element Styles + ***************************************************/ + +body { + margin: 0; + text-align: center; + font: 0.62em verdana, arial, sans-serif; + line-height: 170%; + color: #EEE; +background: #585858 url(bg_body2.jpg) repeat top center; +text-align:center; +} + +.body_header { +height:3em; width:100%; text-align:center; +background: #585858 url(bg_header2.jpg) repeat top center;} + + +/*** This is where you adjust the width: Example; if you want 90% width, +just take the difference, which is 10% and put half of 10% on the left and +set your width for 90%. Done deal!!!! ***/ + +.wrap {position:absolute;top:0px; left:1.5%; width:97%; margin:0; z-index:500; +background-color: #444444; border-left:1px solid #368416; border-right: 1px solid #368416;} + + + +p { + padding-top: 10px !important; + padding-top: 3px; + padding-bottom: 10px !important; + padding-bottom: 3px; +} + + +a { + color: #86E160; +} + +a:visited { + color: #AAA; +} + +a:hover { + color: #FFF; +} + +acronym { + cursor: help; + border-bottom: 1px solid #777; +} + +input { + width: 70%; +} + +textarea { + width: 98%; + /* + IE specific to eliminate scroll bar when not needed. + Uncomment if wanted, but it is not valid CSS + + scrollbar-3dlight-color : #777; + scrollbar-arrow-color : #EEE; + scrollbar-darkshadow-color : #777; + scrollbar-face-color : #777; + scrollbar-highlight-color : #777; + scrollbar-shadow-color : #777; + scrollbar-track-color : #777; + */ +} + +input, +textarea { + padding: 1px 3px; + margin: 5px 0; + font: 1em verdana, arial, sans-serif; + color: #EEE; + background-color: #777; + border: 1px solid #999; +} + +input:hover, +input:focus, +textarea:hover, +textarea:focus { + color: #FFF; + background-color: #999; + border: 1px solid #EEE; +} + + +h1 { + clear: both; + margin: 10px 0; + font: 700 1em verdana, sans-serif; + color: #7BD32C; + background: #686868 url(rounded_tr.gif) no-repeat top right; +} + +h1 span { + display: block; + padding: 2px; + background: url(rounded_br.gif) no-repeat bottom right; +} + +#sideBar h1 { + text-align: right; + background: #686868 url(rounded_tl.gif) no-repeat top left; +} + +#sideBar h1 span { + display: block; + padding: 2px; + background: url(rounded_bl.gif) no-repeat bottom left; +} + + +#content ol li { + color: #9BE4FF; +} + +#content ol li span { + color: #EEE; +} + +#content ul { + padding-bottom: 10px; +} + +#content ul li { + list-style-image: url(li_bullet.gif); +} + +blockquote { + margin: 0; + background: #686868 url(rounded_tr.gif) no-repeat top right; +} + +blockquote span { + display: block; + padding: 5px; + background: url(rounded_br.gif) no-repeat bottom right; +} + +/*************************************************** + Layout Element Styles + ***************************************************/ + + +#header { + width: 100%; + height: 3em; + background: #585858 url(header_header.jpg) top center;} + +/*************************************************** + Header Menu + ***************************************************/ + +#menu { + width: 100%; + margin: 0 auto; + text-align: left; +} + +#menu ul { + margin: 0; + padding: 0; + line-height: normal; +} + + +/** Played with the top banner menu "width" here, +5 items at 10% = half page width **/ +#menu ul li { + width: 8%; + display: inline; + float: left; + padding-top: 0.8em; + list-style: none; + text-align: center; +} + +#menu ul li a { + display: block; + text-decoration: none; + text-transform: uppercase; + padding-bottom: 1.0em; + color: #222; +} + +#menu ul li a:hover, +#menu ul li a.active { + font-weight: bold; + color: #111; + background: url(menu_tab.gif) no-repeat bottom center; +} + + +/*************************************************** + Site Title + ***************************************************/ + +#title { + padding: 0.6em 55px 0.6em 0; + margin-right: 0.5em; + float: right; + background: url(logo_greenery.gif) no-repeat top right; +} + +#title h1 { + display: inline; + color: #222; + background-color: #86E160; + background-image: none; +} + + +/*************************************************** + Page Content + --------------------------------------------------- + 1. Left side text + 2. Dropdown image + 3. Right side bar + ***************************************************/ + + +#content { + clear: both; + width: 100%; + text-align: left; +} + +/* Left Column */ +#text { + float: left; + width: 74% !important; + width: 76%; + padding: 5px 0px; + padding-left:1.2%; + padding-right:1.2%; + display: block; +!important;/** mozilla **/ + padding: 5px 0px; padding-left:1.2%; padding-right:1.2%; /** explorer **/ + background: transparent url("left.jpg") no-repeat right top; +} + + +/** Center Column ***/ +#image { + float: left; + width: 25px; + height:700px; + vertical-align: top; + background: #87E060; /* url("plants2.jpg") no-repeat top center; */ +} + +/** Right column **/ +#sideBar { + float: left; + float:left; + width: 18% !important; /** mozilla **/ + width: 20.25%; /** explorer **/ + padding: 5px 0px; padding-left:1.2% !important;/** mozilla **/ + padding: 5px 0px; padding-left:4%;/**IE **/ + background: transparent url("right.jpg") no-repeat left top; +} + +/*************************************************** + Sidemenu Styles + ***************************************************/ + +.sideMenu { + padding: 10px 0; +} + +.sideMenu a { + display: block; + text-align: right; + text-decoration: none; + margin-bottom: 1px; +} + +.sideMenu a span { + display: block; + padding: 1px; +} + +.sideMenu a:hover { + background: #686868 url(rounded_tl.gif) no-repeat top left; +} + +.sideMenu a:hover span { + background: url(rounded_bl.gif) no-repeat bottom left; +} + +/*************************************************** + Comment Styles + ***************************************************/ + +#comments p { + padding: 0 5px; + margin-bottom: 0; + background: #686868 url(rounded_tl.gif) no-repeat top left; +} + +#comments p span.author { + display: block; + margin-top: 5px; + text-align: right; + font-weight: 700; +} + +#comments img { + margin-top: -1px; +} + +#comments a { + color: #7BD32C; +} + +#comments a:visited { + color: #AAA; +} + +#comments a:hover { + color: #FFF; +} + +/*************************************************** + Footer + ***************************************************/ + +/** No Side Pad here, unless lower percentage to account ***/ +#footer { + clear: both; + float: left; + width: 97.5%; + padding: 10px 0px; + padding-left:2%; + color: #888;} + +#footer p { + padding-top: 0 !important; + padding-top: 10px; +} + +#footer a { + color: #888; +} + +#footer a:hover { + color: #EEE; +} + +a.fullAhead { + float: left; + width: 30px; + height: 34px; + margin-right: 10px; + background: url(logo_fullahead.gif) no-repeat 0 0; +} + +a:hover.fullAhead { + background-position: -30px 0; +} + + +/*************************************************** + Generic Display Classes + ***************************************************/ + +.center { + text-align: center; +} + +.noPad { + padding: 0; + margin: 0; +} + +.left { + float: left; +} + +.right { + float: right; +} + +img.left { + padding: 5px 5px 5px 0; +} + +img.right { + padding: 5px 0 5px 5px; +} + +.button { + width: auto; + cursor: pointer; +} + +.date { + display: block; + font-weight: 700; +} \ No newline at end of file diff --git a/lib/insurance/templates/code-page.rhtml b/lib/insurance/templates/code-page.rhtml index 2909022..759ecc0 100644 --- a/lib/insurance/templates/code-page.rhtml +++ b/lib/insurance/templates/code-page.rhtml @@ -1,73 +1,68 @@ - - - - - <%= file_under_test %> - + + +
 
+
+ +
+
+

<%= file_under_test %>

+
+ <%= body %> +
+
- #graph { - padding-left: 35px; - } +
 
- /* ]]> */ - - - - - -
- - <% files.each do |f| %> - - - - - <% end %> -
"><%= f %>
-
-
-

<%= file_under_test %>

- <%= body %> -
- + +
+
+ diff --git a/lib/insurance/templates/index.rhtml b/lib/insurance/templates/index.rhtml index faf9cd8..81c837c 100644 --- a/lib/insurance/templates/index.rhtml +++ b/lib/insurance/templates/index.rhtml @@ -1,72 +1,52 @@ - - - - - Insurance - <%= project_name %> - + + +
 
+
+ +
+
+

<%= project_name %>

+
I still don't have much to put here yet. Soon.
+
- #graph { - padding-left: 35px; - } +
 
- /* ]]> */ - - - - - -
- - <% files.each do |f| %> - - - - - <% end %> -
"><%= f %>
-
-
- The next release will have much more information here. I promise! -
- + +
+
+