diff --git a/NOTICE.md b/NOTICE.md index 24210951c..40f7f3859 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -323,6 +323,11 @@ bootstrap * License: MIT License * Homepage: https://getbootstrap.com/ * More information in folder: doc/3rd-party-licenses/bootstrap + +crosshair + * License: MIT License + * Homepage: https://eschmann.dev/crosshair.js/ + * More information in folder: doc/3rd-party-licenses/crosshair harPreview diff --git a/config/testreport/css/default.css b/config/testreport/css/default.css index 2a6b2af0d..37a5ea800 100644 --- a/config/testreport/css/default.css +++ b/config/testreport/css/default.css @@ -1775,3 +1775,33 @@ tr:hover .infinity { background: linear-gradient(rgb(200,120,120), rgba(0,0,0,0) transform: rotate(360deg); } } + +.crosshair { + display: block; + position: relative; + overflow: hidden; +} +.crosshair img { + width: 100%; +} +.crosshair .hair { + display: none; + position: absolute; + top: 0; + left: 0; + margin-top: -1px; + margin-left: -1px; + background: transparent; + border-top: 1px solid black; + border-left: 1px solid black; + pointer-events: none; + z-index: 2; + opacity: 0.3; +} +.crosshair .hair.hair-vertical { + height: 100%; +} +.crosshair .hair.hair-horizontal { + width: 100%; +} + diff --git a/config/testreport/js/crosshair.js b/config/testreport/js/crosshair.js new file mode 100644 index 000000000..26b1cd70d --- /dev/null +++ b/config/testreport/js/crosshair.js @@ -0,0 +1,64 @@ +/* + * Based on crosshair.js - v0.1.0 + * https://github.com/eschmar/crosshair + */ + +(function ($) { + // constructor + function Plugin(element){ + $(element).wrap('
'); + this.element = $(element).parent(); + this.init(); + } + + Plugin.prototype = { + init: function() { + var app = this; + this.spawnCrosshair(); + + // hide crosshair onmouseleave + this.element.hover(function() { + app.element.find('.hair').show(); + }, function() { + app.element.find('.hair').hide(); + }); + }, + + spawnCrosshair: function() { + this.element.append(''); + this.element.append(''); + + this.initCrosshair(); + }, + + initCrosshair: function() { + var app = this; + $(this.element).on('mousemove touchmove', function(event) { + // calculate relative position + var offset, left, top; + offset = app.element.offset(); + left = event.pageX - offset.left; + top = event.pageY - offset.top; + + // update position + app.element.find('.hair.hair-horizontal').css('top', top); + app.element.find('.hair.hair-vertical').css('left', left); + + event.stopPropagation(); + }); + } + } + + // lightweight plugin wrapper, preventing against multiple instantiations + $.fn["crosshair"] = function () { + return this.each(function() { + if (!$.data(this, "crosshair")) { + $.data(this, "crosshair", new Plugin(this)) + }; + }); + }; + + $(function(){ + $('.chart').crosshair(); + }); +})( jQuery ); diff --git a/config/xsl/common/sections/head.xsl b/config/xsl/common/sections/head.xsl index 737bcaf75..2286bb2d7 100644 --- a/config/xsl/common/sections/head.xsl +++ b/config/xsl/common/sections/head.xsl @@ -36,6 +36,7 @@ + diff --git a/doc/3rd-party-licenses/crosshair/LICENSE b/doc/3rd-party-licenses/crosshair/LICENSE new file mode 100644 index 000000000..9e4f245cd --- /dev/null +++ b/doc/3rd-party-licenses/crosshair/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Marcel Eschmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/doc/internal-doc/licenses/licenses.csv b/doc/internal-doc/licenses/licenses.csv index a38958ebd..adf230238 100644 --- a/doc/internal-doc/licenses/licenses.csv +++ b/doc/internal-doc/licenses/licenses.csv @@ -49,6 +49,7 @@ xerces,Apache License 2.0,http://xerces.apache.org/xerces2-j/, xstream,BSD 3-Clause License,https://x-stream.github.io/, ,,, bootstrap,MIT License,https://getbootstrap.com/, +crosshair,MIT License,https://eschmann.dev/crosshair.js/, harPreview,BSD 3-Clause License,https://github.com/janodvarko/harviewer, headroomjs,MIT License,http://wicky.nillia.ms/headroom.js/, highlightjs,BSD 3-Clause License,https://highlightjs.org/, diff --git a/pom.xml b/pom.xml index 73d69ec8c..b2f1e171b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@