From 3a50f869ba6a3b4db94ea782d79c0d469cbda8f3 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Mon, 15 Jun 2020 15:24:33 +0200 Subject: [PATCH] DOC: add deprecated warning for css class .caosdb-property-text-value --- CHANGELOG.md | 4 ++++ src/core/css/webcaosdb.css | 3 +++ src/core/js/caosdb.js | 3 +++ src/core/js/ext_cosmetics.js | 5 ++++- src/core/xsl/entity.xsl | 6 ++++++ test/core/html/form_elements_example_1.html | 3 +++ test/core/js/modules/entity.xsl.js | 3 +++ 7 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c392d043..645616eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated (for soon-to-be removed features) +* css class `caosdb-property-text-value` is deprecated because different + functionality interpreted it differently and most of the uses of this class + have already been removed and replaced by specialized classes. + ### Removed (for now removed features) ### Fixed diff --git a/src/core/css/webcaosdb.css b/src/core/css/webcaosdb.css index d598e817..a7a17cd1 100644 --- a/src/core/css/webcaosdb.css +++ b/src/core/css/webcaosdb.css @@ -49,6 +49,9 @@ body { display: initial; } +/* DEPRECATED css class .caosdb-property-text-value - Use +* .caosdb-f-property-single-raw-value or introduce new +* .caosdb-v-property-text-value */ .caosdb-property-text-value { white-space: pre-line; } diff --git a/src/core/js/caosdb.js b/src/core/js/caosdb.js index 648e8249..ac2b1c75 100644 --- a/src/core/js/caosdb.js +++ b/src/core/js/caosdb.js @@ -631,6 +631,9 @@ function setPropertySafe(valueelement, property, propold) { preview.init(); } } else { + /* DEPRECATED css class .caosdb-property-text-value - Use + * .caosdb-f-property-single-raw-value or introduce new + * .caosdb-v-property-text-value */ valueelement.innerHTML = "<span class='caosdb-property-text-value'>" + property.value + "</span>"; } } diff --git a/src/core/js/ext_cosmetics.js b/src/core/js/ext_cosmetics.js index fe1819ed..3913a37b 100644 --- a/src/core/js/ext_cosmetics.js +++ b/src/core/js/ext_cosmetics.js @@ -4,6 +4,9 @@ var cosmetics = new function() { } this.linkify = function() { + /* DEPRECATED css class .caosdb-property-text-value - Use + * .caosdb-f-property-single-raw-value or introduce new + * .caosdb-v-property-text-value */ $('.caosdb-property-text-value').each(function(index) { if (/^https?:\/\//.test(this.innerText)) { var uri = this.innerText; @@ -20,4 +23,4 @@ var cosmetics = new function() { $(document).ready(function() { cosmetics.init(); -}); \ No newline at end of file +}); diff --git a/src/core/xsl/entity.xsl b/src/core/xsl/entity.xsl index 6b709d0e..c43b2e8b 100644 --- a/src/core/xsl/entity.xsl +++ b/src/core/xsl/entity.xsl @@ -285,6 +285,9 @@ <xsl:otherwise> <xsl:element name="span"> <xsl:attribute name="class"> + <!-- DEPRECATED css class .caosdb-property-text-value - Use + .caosdb-f-property-single-raw-value or introduce new + .caosdb-v-property-text-value --> <xsl:value-of select="'caosdb-f-property-single-raw-value caosdb-property-text-value'"/> </xsl:attribute> <xsl:call-template name="trim"> @@ -297,6 +300,9 @@ </xsl:choose> </xsl:when> <xsl:otherwise> + <!-- DEPRECATED css class .caosdb-property-text-value - Use + .caosdb-f-property-single-raw-value or introduce new + .caosdb-v-property-text-value --> <span class="caosdb-f-property-single-raw-value caosdb-property-text-value"/> </xsl:otherwise> </xsl:choose> diff --git a/test/core/html/form_elements_example_1.html b/test/core/html/form_elements_example_1.html index aa10ac55..9977e5d9 100644 --- a/test/core/html/form_elements_example_1.html +++ b/test/core/html/form_elements_example_1.html @@ -1,4 +1,7 @@ <div class="caosdb-f-form-wrapper"> + <!-- DEPRECATED css class .caosdb-property-text-value - Use + .caosdb-f-property-single-raw-value or introduce new + .caosdb-v-property-text-value --> <form action="#" class="form-horizontal" method="post" name="sample_creation.py"> <div class="form-group caosdb-f-field caosdb-f-entity-property caosdb-f-form-field-required caosdb-f-form-field-cached" data-field-name="ice_core" data-groups="(part1)"> <label class="control-label col-sm-3" data-property-name="ice_core" for="ice_core">Ice Core</label> diff --git a/test/core/js/modules/entity.xsl.js b/test/core/js/modules/entity.xsl.js index 9b790a00..e9e50955 100644 --- a/test/core/js/modules/entity.xsl.js +++ b/test/core/js/modules/entity.xsl.js @@ -162,6 +162,9 @@ QUnit.test("LIST Property", function(assert) { }); QUnit.test("single-value template with reference property.", function(assert) { + /* DEPRECATED css class .caosdb-property-text-value - Use + * .caosdb-f-property-single-raw-value or introduce new + * .caosdb-v-property-text-value */ assert.equal(xml2str(callTemplate(this.entityXSL, 'single-value', { 'value': '', 'reference': 'true', -- GitLab