From adb7d3d98fd44ab1dc3bf875cab0b8d086e0ef1f Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Fri, 29 Aug 2014 22:07:42 +0100 Subject: [PATCH] Removed Shadow DOM from . Closes #267. --- resources/report/css/style.css | 23 +++++++++++++++++++++++ resources/report/js/custom.js | 8 ++++---- resources/report/js/plugin.js | 8 ++++---- resources/report/report.html | 29 +---------------------------- 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index d4182607..716b3ae7 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -443,4 +443,27 @@ progress::-webkit-progress-value, .progress .value { } #progressDialog[open] > .progress > .value { -webkit-animation-play-state: running; +} + +:host > span { + display: inline-block; + width: 1.2em; +} +li[is=plugin-li][data-bsa=false] > .loadsBSA, +li[is=plugin-li][data-dummy=false] > .dummyPlugin, +li[is=plugin-li][data-edits=false] > .hasUserEdits, +li[is=plugin-li][data-global-priority=false] > .hasGlobalPriority, +li[is=plugin-li] > .hasPriority:not([title^=Priority]) { + visibility: hidden; +} +li[is=plugin-li] > a { + text-decoration: none; + color: black; +} +li[is=plugin-li] > .hasGlobalPriority, li[is=plugin-li] > .hasPriority { + display:none; +} +body.editMode li[is=plugin-li] > .hasGlobalPriority, +body.editMode li[is=plugin-li] > .hasPriority { + display: inline-block; } \ No newline at end of file diff --git a/resources/report/js/custom.js b/resources/report/js/custom.js index 35805cee..4d6ee7b2 100644 --- a/resources/report/js/custom.js +++ b/resources/report/js/custom.js @@ -621,7 +621,7 @@ var pluginLIProto = Object.create(HTMLLIElement.prototype, { handleDragStart: { value: function(evt) { evt.dataTransfer.effectAllowed = 'copy'; - evt.dataTransfer.setData('text/plain', evt.target.textContent); + evt.dataTransfer.setData('text/plain', evt.currentTarget.getElementsByTagName('a')[0].textContent); } }, @@ -631,13 +631,13 @@ var pluginLIProto = Object.create(HTMLLIElement.prototype, { var template = document.getElementById('pluginLI'); var clone = document.importNode(template.content, true); - this.createShadowRoot().appendChild(clone); + this.appendChild(clone); } }, attachedCallback: { value: function() { - var hoverTargets = this.shadowRoot.querySelectorAll('[title]'); + var hoverTargets = this.querySelectorAll('[title]'); for (var i = 0; i < hoverTargets.length; ++i) { hoverTargets[i].addEventListener('mouseenter', showHoverText, false); hoverTargets[i].addEventListener('mouseleave', hideHoverText, false); @@ -647,7 +647,7 @@ var pluginLIProto = Object.create(HTMLLIElement.prototype, { detachedCallback: { value: function() { - var hoverTargets = this.shadowRoot.querySelectorAll('[title]'); + var hoverTargets = this.querySelectorAll('[title]'); for (var i = 0; i < hoverTargets.length; ++i) { hoverTargets[i].removeEventListener('mouseenter', showHoverText, false); hoverTargets[i].removeEventListener('mouseleave', hideHoverText, false); diff --git a/resources/report/js/plugin.js b/resources/report/js/plugin.js index 485dc835..73514acd 100644 --- a/resources/report/js/plugin.js +++ b/resources/report/js/plugin.js @@ -162,15 +162,15 @@ function Plugin(obj) { var li = new PluginListItem(); this.li = li; - li.shadowRoot.getElementsByTagName('a')[0].href = '#' + this.id; + li.getElementsByTagName('a')[0].href = '#' + this.id; - li.textContent = this.name; + li.getElementsByTagName('a')[0].textContent = this.name; li.setAttribute('data-dummy', this.isDummy); li.setAttribute('data-bsa', this.loadsBSA); li.setAttribute('data-edits', this.userlist != undefined); li.setAttribute('data-global-priority', this.isGlobalPriority); - li.shadowRoot.getElementsByClassName('hasPriority')[0].title = this.getPriorityString(); + li.getElementsByClassName('hasPriority')[0].title = this.getPriorityString(); document.getElementById('pluginsNav').appendChild(li); } @@ -181,7 +181,7 @@ function Plugin(obj) { change.object.li.setAttribute('data-edits', change.object[change.name] != undefined); change.object.card.setAttribute('data-edits', change.object[change.name] != undefined); } else if (change.name == 'modPriority') { - change.object.li.shadowRoot.getElementsByClassName('hasPriority')[0].title = this.getPriorityString(); + change.object.li.getElementsByClassName('hasPriority')[0].title = this.getPriorityString(); change.object.card.shadowRoot.getElementById('priorityValue').value = change.object[change.name]; } else if (change.name == 'isGlobalPriority') { change.object.li.setAttribute('data-global-priority', change.object[change.name]); diff --git a/resources/report/report.html b/resources/report/report.html index 87ec5666..149d936c 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -285,39 +285,12 @@