simplecov-html-formatter 0.12.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.github/workflows/main.yml +33 -0
  4. data/.gitignore +26 -0
  5. data/.rubocop.yml +76 -0
  6. data/.tool-versions +1 -0
  7. data/CHANGELOG.md +81 -0
  8. data/Gemfile +23 -0
  9. data/Gemfile.lock +68 -0
  10. data/Guardfile +14 -0
  11. data/LICENSE +20 -0
  12. data/README.md +30 -0
  13. data/Rakefile +46 -0
  14. data/assets/javascripts/application.js +122 -0
  15. data/assets/javascripts/libraries/jquery-3.4.1.js +10598 -0
  16. data/assets/javascripts/plugins/highlight.pack.js +1 -0
  17. data/assets/javascripts/plugins/jquery.colorbox.js +1105 -0
  18. data/assets/javascripts/plugins/jquery.dataTables.js +15008 -0
  19. data/assets/javascripts/plugins/jquery.timeago.js +232 -0
  20. data/assets/stylesheets/application.css +3 -0
  21. data/assets/stylesheets/plugins/datatables.css +462 -0
  22. data/assets/stylesheets/plugins/highlight.css +129 -0
  23. data/assets/stylesheets/plugins/jquery-ui-1.8.4.custom.css +295 -0
  24. data/assets/stylesheets/plugins/jquery.colorbox.css +52 -0
  25. data/assets/stylesheets/reset.css +103 -0
  26. data/assets/stylesheets/screen.css +316 -0
  27. data/lib/simplecov-html/version.rb +9 -0
  28. data/lib/simplecov-html.rb +135 -0
  29. data/public/DataTables-1.10.20/images/sort_asc.png +0 -0
  30. data/public/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  31. data/public/DataTables-1.10.20/images/sort_both.png +0 -0
  32. data/public/DataTables-1.10.20/images/sort_desc.png +0 -0
  33. data/public/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  34. data/public/application.css +1 -0
  35. data/public/application.js +7 -0
  36. data/public/colorbox/border.png +0 -0
  37. data/public/colorbox/controls.png +0 -0
  38. data/public/colorbox/loading.gif +0 -0
  39. data/public/colorbox/loading_background.png +0 -0
  40. data/public/favicon_green.png +0 -0
  41. data/public/favicon_red.png +0 -0
  42. data/public/favicon_yellow.png +0 -0
  43. data/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  44. data/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  45. data/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  46. data/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  47. data/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  48. data/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  49. data/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  50. data/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  51. data/public/images/ui-icons_222222_256x240.png +0 -0
  52. data/public/images/ui-icons_2e83ff_256x240.png +0 -0
  53. data/public/images/ui-icons_454545_256x240.png +0 -0
  54. data/public/images/ui-icons_888888_256x240.png +0 -0
  55. data/public/images/ui-icons_cd0a0a_256x240.png +0 -0
  56. data/public/loading.gif +0 -0
  57. data/public/magnify.png +0 -0
  58. data/simplecov-html.gemspec +23 -0
  59. data/test/helper.rb +6 -0
  60. data/test/test_simple_cov-html.rb +10 -0
  61. data/views/covered_percent.erb +3 -0
  62. data/views/file_list.erb +78 -0
  63. data/views/layout.erb +41 -0
  64. data/views/source_file.erb +54 -0
  65. metadata +108 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b2c8d25d29656b21dd0d340f869278d64b115d85212b226ab653607ce50dc592
4
+ data.tar.gz: 74413bce0029e8fa5a4ecf9a492c4284120510aea80ed957d996f4ba8a250739
5
+ SHA512:
6
+ metadata.gz: c3d8b20ea9377c8e3fe7d7432ae23ca43f04fed99496817f49e8c70b54d2d53dc4243457691fe27c60165fe5baca487828b3530ed63a42d591d52daf86a79482
7
+ data.tar.gz: 731e2b4ce802793b2b2f8a8e66f5cdb210ed8c34944e960c99f7dcb1a389c3999351757275d5efdeb17c017bd60596532d35b315fe1d6be2716ffd024afaa179
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,33 @@
1
+ name: test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ tests:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+
11
+ matrix:
12
+ ruby-version:
13
+ - '2.5'
14
+ - '2.6'
15
+ - '2.7'
16
+ - '3.0'
17
+ - '3.1'
18
+ - ruby-head
19
+ - jruby
20
+ - jruby-head
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+
25
+ - uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby-version }}
28
+ bundler-cache: true
29
+ continue-on-error: ${{ (matrix.ruby-version == 'ruby-head') || (matrix.ruby-version == 'jruby-head') }}
30
+
31
+ - run: |
32
+ bundle exec rake
33
+ continue-on-error: ${{ (matrix.ruby-version == 'ruby-head') || (matrix.ruby-version == 'jruby-head') }}
data/.gitignore ADDED
@@ -0,0 +1,26 @@
1
+ .rvmrc
2
+ .bundle
3
+
4
+ ## MAC OS
5
+ .DS_Store
6
+
7
+ ## TEXTMATE
8
+ *.tmproj
9
+ tmtags
10
+
11
+ ## EMACS
12
+ *~
13
+ \#*
14
+ .\#*
15
+
16
+ ## VIM
17
+ *.swp
18
+
19
+ ## RUBYMINE
20
+ .idea
21
+
22
+ ## PROJECT::GENERAL
23
+ coverage
24
+ rdoc
25
+ pkg
26
+ .sass-cache
data/.rubocop.yml ADDED
@@ -0,0 +1,76 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ DisplayCopNames: true
4
+
5
+ Bundler/DuplicatedGem:
6
+ Enabled: false
7
+
8
+ Gemspec/RequiredRubyVersion:
9
+ Enabled: false
10
+
11
+ Layout/AccessModifierIndentation:
12
+ EnforcedStyle: outdent
13
+
14
+ Layout/SpaceInsideHashLiteralBraces:
15
+ EnforcedStyle: no_space
16
+
17
+ Metrics/BlockNesting:
18
+ Max: 2
19
+
20
+ Layout/LineLength:
21
+ AllowURI: true
22
+ Enabled: false
23
+
24
+ Metrics/MethodLength:
25
+ CountComments: false
26
+ Max: 10
27
+
28
+ Metrics/ParameterLists:
29
+ Max: 4
30
+ CountKeywordArgs: true
31
+
32
+ Naming/FileName:
33
+ Exclude:
34
+ - "lib/simplecov-html.rb"
35
+ - "test/test_simple_cov-html.rb"
36
+
37
+ Style/CollectionMethods:
38
+ PreferredMethods:
39
+ map: "collect"
40
+ reduce: "inject"
41
+ find: "detect"
42
+ find_all: "select"
43
+
44
+ Style/Documentation:
45
+ Enabled: false
46
+
47
+ Style/DoubleNegation:
48
+ Enabled: false
49
+
50
+ Style/ExpandPathArguments:
51
+ Enabled: false
52
+
53
+ Style/FrozenStringLiteralComment:
54
+ Enabled: true
55
+
56
+ Style/MutableConstant:
57
+ Exclude:
58
+ - "lib/simplecov-html/version.rb"
59
+
60
+ Style/NumericPredicate:
61
+ Enabled: false
62
+
63
+ Style/RegexpLiteral:
64
+ Enabled: false
65
+
66
+ Style/StringLiterals:
67
+ EnforcedStyle: double_quotes
68
+
69
+ Style/SymbolArray:
70
+ Enabled: false
71
+
72
+ Style/TrailingCommaInHashLiteral:
73
+ EnforcedStyleForMultiline: "comma"
74
+
75
+ Style/TrailingCommaInArrayLiteral:
76
+ EnforcedStyleForMultiline: "comma"
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,81 @@
1
+ 0.12.3 (2020-09-23)
2
+ ==================
3
+
4
+ ## Bugfixes
5
+ * Relax ruby version requirement to work with Ruby 3.0 (next version, current `ruby-head`). Thanks [@byroot](https://github.com/byroot).
6
+
7
+ 0.12.2 (2020-02-27)
8
+ ==================
9
+
10
+ ## Bugfixes
11
+ * Refreshing the page while a source file is open works again. Thanks [@HansBug](https://github.com/HansBug) for the report [#94](https://github.com/simplecov-ruby/simplecov-html/issues/94) and [@Tietew](https://github.com/Tietew) for the fix!
12
+
13
+ 0.12.1 (2020-02-23)
14
+ ==================
15
+
16
+ Bugfix release to fix huge bugs that sadly test suit and maintainters didn't catch.
17
+
18
+ ## Bugfixes
19
+ * Disable pagination and with it all files on 2nd page+ being broken/not able to open
20
+ * Fix display of non ASCII characters, for this you have to upgrade to simplecov 0.18.3 though (it's handled in there)
21
+
22
+ 0.12.0 (2020-02-12)
23
+ ==================
24
+
25
+ This release is basically a collection of long standing PRs finally merged.
26
+ Yes it looks different, no it's not a redesign - just a side effect of lots of dependency updates to improve CSP compatibility.
27
+
28
+ ## Enhancements
29
+ * The HTML should now be servable with CSP settings of `default-src 'none'; script-src 'self'; img-src 'self'; style-src 'self';`
30
+ * File list is horizontally scrollable if the space doesn't suffice
31
+ * numbers are now right aligned and displayed with the same number of decimals for easier comparison and reading.
32
+
33
+ ## Bugfixes
34
+ * Make sorting icons appear again
35
+ * close link tag which could cause problems when parsing as xhtml/xml
36
+ * make sure encoding errors won't crash the formatter
37
+ * When viewing a short source file while you have a big file list you will no longer be able to scroll on after the source file has ended
38
+
39
+ 0.11.0 (2020-01-28)
40
+ =======
41
+
42
+ This release goes together with simplecov 0.18 to bring branch coverage support to you. Please also check the notes of the beta releases.
43
+
44
+ ## Enhancements
45
+ * Display total branch coverage percentage in the overview (if branch coverage enabled)
46
+
47
+ 0.11.0.beta2 (2020-01-19)
48
+ =======
49
+
50
+ ## Enhancements
51
+ * changed display of branch coverage to be `branch_type: hit_count` which should be more expressive and more intuitive
52
+ * Cached lookup of whether we're doing branch coverage or not (should be faster)
53
+
54
+ ## Bugfixes
55
+ * Fixed sorting of percent column (regression in previous release)
56
+
57
+ 0.11.0.beta1 (2020-01-05)
58
+ ========
59
+
60
+ Changes ruby support to 2.4+, adds branch coverage support. Meant to be used with simplecov 0.18
61
+
62
+ ## Breaking Changes
63
+ * Drops support for EOL'ed ruby versions, new support is ~> 2.4
64
+
65
+ ## Enhancements
66
+ * Support/display of branch coverage from simplecov 0.18.0.beta1, little badges saying `hit_count, positive_or_negative` will appear next to lines if branch coverage is activated. `0, +` means positive branch was never hit, `2, -` means negative branch was hit twice
67
+ * Encoding compatibility errors are now caught and printed out
68
+
69
+ 0.10.2 (2017-08-14)
70
+ ========
71
+
72
+ ## Bugfixes
73
+
74
+ * Allow usage with frozen-string-literal-enabled. See [#56](https://github.com/simplecov-ruby/simplecov-html/pull/56) (thanks @pat)
75
+
76
+ 0.10.1 (2017-05-17)
77
+ ========
78
+
79
+ ## Bugfixes
80
+
81
+ * circumvent a regression that happens in the new JRuby 9.1.9.0 release. See [#53](https://github.com/simplecov-ruby/simplecov-html/pull/53) thanks @koic
data/Gemfile ADDED
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ gem "rake", ">= 11"
8
+
9
+ # Use local copy of simplecov in development if you want to
10
+ # gem "simplecov", :path => File.dirname(__FILE__) + "/../simplecov"
11
+ gem "simplecov", git: "https://github.com/simplecov-ruby/simplecov"
12
+
13
+ group :test do
14
+ gem "minitest"
15
+ end
16
+
17
+ group :development do
18
+ gem "rubocop"
19
+ # sprockets 4.0 requires ruby 2.5+
20
+ gem "sprockets", "~> 3.7"
21
+ gem "uglifier"
22
+ gem "yui-compressor"
23
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,68 @@
1
+ GIT
2
+ remote: https://github.com/simplecov-ruby/simplecov
3
+ revision: 216b2d530bee7c4b8a8fe2898684924bfccfa79a
4
+ specs:
5
+ simplecov (0.22.0)
6
+ docile (~> 1.1)
7
+ simplecov-html (~> 0.11)
8
+ simplecov_json_formatter (~> 0.1)
9
+
10
+ PATH
11
+ remote: .
12
+ specs:
13
+ simplecov-html (0.12.3.1)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ ast (2.4.2)
19
+ concurrent-ruby (1.2.2)
20
+ docile (1.4.0)
21
+ execjs (2.8.1)
22
+ json (2.6.3)
23
+ minitest (5.18.0)
24
+ parallel (1.22.1)
25
+ parser (3.2.2.0)
26
+ ast (~> 2.4.1)
27
+ rack (2.2.6.4)
28
+ rainbow (3.1.1)
29
+ rake (13.0.6)
30
+ regexp_parser (2.7.0)
31
+ rexml (3.2.5)
32
+ rubocop (1.49.0)
33
+ json (~> 2.3)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.2.0.0)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml (>= 3.2.5, < 4.0)
39
+ rubocop-ast (>= 1.28.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 2.4.0, < 3.0)
42
+ rubocop-ast (1.28.0)
43
+ parser (>= 3.2.1.0)
44
+ ruby-progressbar (1.13.0)
45
+ simplecov_json_formatter (0.1.4)
46
+ sprockets (3.7.2)
47
+ concurrent-ruby (~> 1.0)
48
+ rack (> 1, < 3)
49
+ uglifier (4.2.0)
50
+ execjs (>= 0.3.0, < 3)
51
+ unicode-display_width (2.4.2)
52
+ yui-compressor (0.12.0)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ minitest
59
+ rake (>= 11)
60
+ rubocop
61
+ simplecov!
62
+ simplecov-html!
63
+ sprockets (~> 3.7)
64
+ uglifier
65
+ yui-compressor
66
+
67
+ BUNDLED WITH
68
+ 2.3.10
data/Guardfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A sample Guardfile
4
+ # More info at https://github.com/guard/guard#readme
5
+
6
+ guard "bundler" do
7
+ watch("Gemfile")
8
+ # Uncomment next line if Gemfile contain `gemspec' command
9
+ # watch(/^.+\.gemspec/)
10
+ end
11
+
12
+ guard "rake", task: "assets:compile" do
13
+ watch(%r{^assets/})
14
+ end
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010-2013 Christoph Olszowka
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ Default HTML formatter for SimpleCov
2
+ ====================================
3
+
4
+ ***Note: To learn more about SimpleCov, check out the main repo at https://github.com/simplecov-ruby/simplecov***
5
+
6
+ Generates a nice HTML report of your SimpleCov ruby code coverage results on Ruby 2.4+ using client-side Javascript
7
+ quite extensively.
8
+
9
+
10
+ Note on Patches/Pull Requests
11
+ -----------------------------
12
+
13
+ The formatter itself has no actual tests. Instead, it is tested in the cucumber features of simplecov itself. If you
14
+ modify the formatter, please make sure the simplecov test suites still pass by doing the following:
15
+
16
+ * Clone simplecov into the parent directory of your simplecov-html checkout
17
+ * `cd` there, run `bundle`
18
+ * You should end up with all dev dependencies installed and simplecov-html being used from your disk
19
+ * Run the tests (units and features)
20
+
21
+ Please remember to add tests if you add functionality.
22
+
23
+ **Important:** If you modify the JS/CSS assets, you'll have to precompile them using `rake assets:compile` - otherwise,
24
+ your changes will not be included in your coverage reports.
25
+
26
+
27
+ Copyright
28
+ ---------
29
+
30
+ Copyright (c) 2010-2013 Christoph Olszowka. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler"
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ # See https://github.com/simplecov-ruby/simplecov/issues/171
7
+ desc "Set permissions on all files so they are compatible with both user-local and system-wide installs"
8
+ task :fix_permissions do
9
+ system 'bash -c "find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;"'
10
+ end
11
+ # Enforce proper permissions on each build
12
+ Rake::Task[:build].prerequisites.unshift :fix_permissions
13
+
14
+ require "rake/testtask"
15
+ Rake::TestTask.new(:test) do |test|
16
+ test.libs << "lib" << "test"
17
+ test.pattern = "test/**/test_*.rb"
18
+ test.verbose = true
19
+ end
20
+
21
+ begin
22
+ require "rubocop/rake_task"
23
+ RuboCop::RakeTask.new
24
+ rescue LoadError
25
+ task :rubocop do
26
+ warn "Rubocop is disabled"
27
+ end
28
+ end
29
+
30
+ task default: [:test, :rubocop]
31
+
32
+ namespace :assets do
33
+ desc "Compiles all assets"
34
+ task :compile do
35
+ puts "Compiling assets"
36
+ require "sprockets"
37
+ assets = Sprockets::Environment.new do |env|
38
+ env.append_path "assets/javascripts"
39
+ env.append_path "assets/stylesheets"
40
+ env.js_compressor = :uglify
41
+ env.css_compressor = :yui
42
+ end
43
+ assets["application.js"].write_to("public/application.js")
44
+ assets["application.css"].write_to("public/application.css")
45
+ end
46
+ end
@@ -0,0 +1,122 @@
1
+ //= require_directory ./libraries/
2
+ //= require_directory ./plugins/
3
+ //= require_self
4
+
5
+ $(document).ready(function () {
6
+ $('.file_list').dataTable({
7
+ order: [[1, "asc"]],
8
+ paging: false
9
+ });
10
+
11
+ // Syntax highlight all files up front - deactivated
12
+ // $('.source_table pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
13
+
14
+ // Syntax highlight source files on first toggle of the file view popup
15
+ $("a.src_link").click(function () {
16
+ // Get the source file element that corresponds to the clicked element
17
+ var source_table = $($(this).attr('href'));
18
+
19
+ // If not highlighted yet, do it!
20
+ if (!source_table.hasClass('highlighted')) {
21
+ source_table.find('pre code').each(function (i, e) { hljs.highlightBlock(e, ' ') });
22
+ source_table.addClass('highlighted');
23
+ };
24
+ });
25
+
26
+ var prev_anchor;
27
+ var curr_anchor;
28
+
29
+ // Set-up of popup for source file views
30
+ $("a.src_link").colorbox({
31
+ transition: "none",
32
+ inline: true,
33
+ opacity: 1,
34
+ width: "95%",
35
+ height: "95%",
36
+ onLoad: function () {
37
+ prev_anchor = curr_anchor ? curr_anchor : window.location.hash.substring(1);
38
+ curr_anchor = this.href.split('#')[1];
39
+ window.location.hash = curr_anchor;
40
+
41
+ $('.file_list_container').hide();
42
+ },
43
+ onCleanup: function () {
44
+ if (prev_anchor && prev_anchor != curr_anchor) {
45
+ $('a[href="#' + prev_anchor + '"]').click();
46
+ curr_anchor = prev_anchor;
47
+ } else {
48
+ $('.group_tabs a:first').click();
49
+ prev_anchor = curr_anchor;
50
+ curr_anchor = "#_AllFiles";
51
+ }
52
+ window.location.hash = curr_anchor;
53
+
54
+ var active_group = $('.group_tabs li.active a').attr('class');
55
+ $("#" + active_group + ".file_list_container").show();
56
+ }
57
+ });
58
+
59
+ window.onpopstate = function (event) {
60
+ if (window.location.hash.substring(0, 2) == "#_") {
61
+ $.colorbox.close();
62
+ curr_anchor = window.location.hash.substring(1);
63
+ } else {
64
+ if ($('#colorbox').is(':hidden')) {
65
+ $('a.src_link[href="' + window.location.hash + '"]').colorbox({ open: true });
66
+ }
67
+ }
68
+ };
69
+
70
+ // Hide src files and file list container after load
71
+ $('.source_files').hide();
72
+ $('.file_list_container').hide();
73
+
74
+ // Add tabs based upon existing file_list_containers
75
+ $('.file_list_container h2').each(function () {
76
+ var container_id = $(this).parent().attr('id');
77
+ var group_name = $(this).find('.group_name').first().html();
78
+ var covered_percent = $(this).find('.covered_percent').first().html();
79
+
80
+ $('.group_tabs').append('<li><a href="#' + container_id + '">' + group_name + ' (' + covered_percent + ')</a></li>');
81
+ });
82
+
83
+ $('.group_tabs a').each(function () {
84
+ $(this).addClass($(this).attr('href').replace('#', ''));
85
+ });
86
+
87
+ // Make sure tabs don't get ugly focus borders when active
88
+ $('.group_tabs').on('focus', 'a', function () { $(this).blur(); });
89
+
90
+ var favicon_path = $('link[rel="shortcut icon"]').attr('href');
91
+ $('.group_tabs').on('click', 'a', function () {
92
+ if (!$(this).parent().hasClass('active')) {
93
+ $('.group_tabs a').parent().removeClass('active');
94
+ $(this).parent().addClass('active');
95
+ $('.file_list_container').hide();
96
+ $(".file_list_container" + $(this).attr('href')).show();
97
+ window.location.href = window.location.href.split('#')[0] + $(this).attr('href').replace('#', '#_');
98
+
99
+ // Force favicon reload - otherwise the location change containing anchor would drop the favicon...
100
+ // Works only on firefox, but still... - Anyone know a better solution to force favicon on local file?
101
+ $('link[rel="shortcut icon"]').remove();
102
+ $('head').append('<link rel="shortcut icon" type="image/png" href="' + favicon_path + '" />');
103
+ };
104
+ return false;
105
+ });
106
+
107
+ if (window.location.hash) {
108
+ var anchor = window.location.hash.substring(1);
109
+ if (anchor.length == 40) {
110
+ $('a.src_link[href="#' + anchor + '"]').click();
111
+ } else {
112
+ $('.group_tabs a.' + anchor.replace('_', '')).click();
113
+ }
114
+ } else {
115
+ $('.group_tabs a:first').click();
116
+ };
117
+
118
+ $("abbr.timeago").timeago();
119
+ $('#loading').fadeOut();
120
+ $('#wrapper').show();
121
+ $('.dataTables_filter input').focus()
122
+ });