From 1f488845fea00390f9a5aa16cefaff1c4e130ac1 Mon Sep 17 00:00:00 2001 From: Yannick Kuypers Date: Fri, 16 Sep 2022 10:27:37 +0200 Subject: [PATCH 01/12] #17 zichtbaarheidstekst & css toegevoegd --- Urireferencer.js | 14 +++++++++++++- resources/css/urireferencer.css | 4 ++++ resources/scss/urireferencer.scss | 6 +++++- templates/Urireferencer.html | 5 ++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Urireferencer.js b/Urireferencer.js index 2913984..f2acb9d 100644 --- a/Urireferencer.js +++ b/Urireferencer.js @@ -42,6 +42,12 @@ define([ startup: function () { this.controller.checkUri(this.checkUri).then(lang.hitch(this, function(data) { this.referenceCount.innerHTML = data.count; + + if (data.zichtbaarheid_tekst) { + this.zichtbaarheidsNode.innerHTML = data.zichtbaarheid_tekst; + domClass.remove(this.zichtbaarheidsNodeContainer, 'hide'); + } + array.forEach(data.applications, lang.hitch(this, function(app) { this._createExpanderElement(app); })); @@ -53,11 +59,17 @@ define([ recheckUri: function(uri) { this.referenceLoadingMessage.style.display = 'block'; this.expanderControls.style.display = 'none'; - + domClass.add(this.zichtbaarheidsNodeContainer, 'hide'); domConstruct.empty(this.expanderContainer); this.controller.checkUri(uri).then(lang.hitch(this, function(data) { this.referenceCount.innerHTML = data.count; + + if (data.zichtbaarheid_tekst) { + this.zichtbaarheidsNode.innerHTML = data.zichtbaarheid_tekst; + domClass.remove(this.zichtbaarheidsNodeContainer, 'hide'); + } + array.forEach(data.applications, lang.hitch(this, function(app) { this._createExpanderElement(app); })); diff --git a/resources/css/urireferencer.css b/resources/css/urireferencer.css index debb853..65305bc 100644 --- a/resources/css/urireferencer.css +++ b/resources/css/urireferencer.css @@ -59,6 +59,10 @@ border-bottom: 1px solid lightgray; } +.expander-controls i.fa { + color: #753f7f; +} + .expander-controls a { float: right; color: gray; diff --git a/resources/scss/urireferencer.scss b/resources/scss/urireferencer.scss index 441d3bb..54b2c73 100644 --- a/resources/scss/urireferencer.scss +++ b/resources/scss/urireferencer.scss @@ -57,10 +57,14 @@ width: 100%; padding-bottom: 10px; border-bottom: 1px solid $light-gray; + + i.fa { + color: #753f7f; + } } .expander-controls a { float: right; color: gray; padding-right: 18px; -} \ No newline at end of file +} diff --git a/templates/Urireferencer.html b/templates/Urireferencer.html index ddd2184..c19d368 100644 --- a/templates/Urireferencer.html +++ b/templates/Urireferencer.html @@ -8,7 +8,10 @@ Alles verbergen Alles tonen -
(Max. 5 referenties per applicatie getoond)
+
(Max. 5 referenties per applicatie getoond)
+
+ +
From 2615cd3346b44fa4d615ff83116ba7aafeab9cd5 Mon Sep 17 00:00:00 2001 From: Yannick Kuypers Date: Fri, 23 Sep 2022 17:05:52 +0200 Subject: [PATCH 02/12] #17 zichtbaarheidstekst fix --- Urireferencer.js | 68 ++++++++---------------------------- controllers/UriController.js | 37 -------------------- templates/Urireferencer.html | 3 +- 3 files changed, 15 insertions(+), 93 deletions(-) delete mode 100644 controllers/UriController.js diff --git a/Urireferencer.js b/Urireferencer.js index f2acb9d..794de77 100644 --- a/Urireferencer.js +++ b/Urireferencer.js @@ -5,7 +5,6 @@ define([ 'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dojo/text!./templates/Urireferencer.html', - './controllers/UriController', 'dojo/dom-construct', 'dojo/dom-class', 'dojo/on', @@ -18,7 +17,6 @@ define([ WidgetBase, TemplatedMixin, template, - UriController, domConstruct, domClass, on, @@ -27,55 +25,28 @@ define([ return declare([WidgetBase, TemplatedMixin], { templateString: template, - uriUrl: null, - controller: null, - checkUri: null, - totalCount: 0, + totalRefTekst: null, + applications: null, + zichtbaarheidTekst: null, postCreate: function () { this.inherited(arguments); - this.controller = new UriController({ - uriUrl: this.uriUrl - }); }, startup: function () { - this.controller.checkUri(this.checkUri).then(lang.hitch(this, function(data) { - this.referenceCount.innerHTML = data.count; - - if (data.zichtbaarheid_tekst) { - this.zichtbaarheidsNode.innerHTML = data.zichtbaarheid_tekst; - domClass.remove(this.zichtbaarheidsNodeContainer, 'hide'); - } + this.referenceCount.innerHTML = data.count; - array.forEach(data.applications, lang.hitch(this, function(app) { - this._createExpanderElement(app); - })); - this.referenceLoadingMessage.style.display = 'none'; - this.expanderControls.style.display = 'inline-block'; - })); - }, - - recheckUri: function(uri) { - this.referenceLoadingMessage.style.display = 'block'; - this.expanderControls.style.display = 'none'; - domClass.add(this.zichtbaarheidsNodeContainer, 'hide'); - domConstruct.empty(this.expanderContainer); - - this.controller.checkUri(uri).then(lang.hitch(this, function(data) { - this.referenceCount.innerHTML = data.count; - - if (data.zichtbaarheid_tekst) { - this.zichtbaarheidsNode.innerHTML = data.zichtbaarheid_tekst; - domClass.remove(this.zichtbaarheidsNodeContainer, 'hide'); - } + if (zichtbaarheidTekst) { + this.zichtbaarheidsNode.innerHTML = zichtbaarheidTekst; + domClass.remove(this.zichtbaarheidsNodeContainer, 'hide'); + } + this.referenceCount.innerHTML = totalRefTekst; - array.forEach(data.applications, lang.hitch(this, function(app) { - this._createExpanderElement(app); - })); - this.referenceLoadingMessage.style.display = 'none'; - this.expanderControls.style.display = 'inline-block'; + array.forEach(applications, lang.hitch(this, function (app) { + this._createExpanderElement(app); })); + this.referenceLoadingMessage.style.display = 'none'; + this.expanderControls.style.display = 'inline-block'; }, _createExpanderElement: function(app) { @@ -116,18 +87,7 @@ define([ _toggleExpander: function(evt) { evt ? evt.preventDefault() : null; var expander = evt.target.closest('.expander'); - //var container = expander.closest('.expander-container'); - - // Close other expanded elements // Excluded here because of showAll/closeAll - //query(container).children('.expander').forEach(function(child) { - // if (child != expander) { - // if (domClass.contains(child, 'expander-expanded')){ - // domClass.remove(child, 'expander-expanded'); - // } - // } - //}); - - // Toggle this element + if (domClass.contains(expander, 'expander-expanded')) { domClass.remove(expander, 'expander-expanded'); } else { diff --git a/controllers/UriController.js b/controllers/UriController.js deleted file mode 100644 index 2f900fd..0000000 --- a/controllers/UriController.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @module controllers/UriController - */ -define([ - 'dojo/_base/declare', - 'dojo/request/xhr' -], function( - declare, - xhr -) { - return declare(null, /** @lends module:controllers/UriController# */ { - - uriUrl: null, - _target: '/references?uri=', - - /** - * Module die instaat voor de 'ajax calls' die naar de server gemaakt worden voor het controleren van de uri. - * @constructs - * @param args Options - */ - constructor: function (args) { - declare.safeMixin(this, args); - }, - - checkUri: function(uri) { - return xhr(this.uriUrl + this._target + uri, { - method: 'GET', - handleAs: 'json', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json' - } - }); - } - - }); -}); \ No newline at end of file diff --git a/templates/Urireferencer.html b/templates/Urireferencer.html index c19d368..6299ddb 100644 --- a/templates/Urireferencer.html +++ b/templates/Urireferencer.html @@ -4,11 +4,10 @@