From 86fde45a5287f141dee0c04809162939369984d2 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Thu, 3 Nov 2022 21:23:45 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=81=D1=8B=D0=BB=D0=BA=D0=B0=20=D0=B8?= =?UTF-8?q?=D1=81=D1=87=D0=B5=D0=B7=D0=B0=D0=B5=D1=82=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5=20?= =?UTF-8?q?=D0=B3=D0=B0=D0=BB=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BD=D0=B0=20che?= =?UTF-8?q?ckbox=20#128?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/repo/competences/list.tmpl | 2 +- web_src/js/index.js | 3 ++- web_src/js/markup/content.js | 5 +++++ web_src/js/markup/trust_props.js | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 web_src/js/markup/trust_props.js diff --git a/templates/repo/competences/list.tmpl b/templates/repo/competences/list.tmpl index 4fd7110c38..88f7100933 100644 --- a/templates/repo/competences/list.tmpl +++ b/templates/repo/competences/list.tmpl @@ -3,7 +3,7 @@ {{template "repo/header" .}}

{{.i18n.Tr "repo.competences"}}

-
+
{{$.RenderedCompetences | Str2html}}
{{$.TransformedTrustProps}}
diff --git a/web_src/js/index.js b/web_src/js/index.js index 8ea30f1fca..8330ac87c1 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -19,7 +19,7 @@ import {initMarkupAnchors} from './markup/anchors.js'; import {initNotificationCount, initNotificationsTable} from './features/notification.js'; import {initRepoIssueContentHistory} from './features/repo-issue-content.js'; import {initStopwatch} from './features/stopwatch.js'; -import {initCommentContent, initMarkupContent} from './markup/content.js'; +import {initCommentContent, initMarkupContent, initTrustPropsContent} from './markup/content.js'; import {initUserAuthLinkAccountView, initUserAuthOauth2} from './features/user-auth.js'; import { @@ -105,6 +105,7 @@ $(document).ready(() => { initFootLanguageMenu(); initCommentContent(); + initTrustPropsContent() initContextPopups(); initHeatmap(); initImageDiff(); diff --git a/web_src/js/markup/content.js b/web_src/js/markup/content.js index ef5067fd66..16875903a3 100644 --- a/web_src/js/markup/content.js +++ b/web_src/js/markup/content.js @@ -1,6 +1,7 @@ import {renderMermaid} from './mermaid.js'; import {renderCodeCopy} from './codecopy.js'; import {initMarkupTasklist} from './tasklist.js'; +import {initMarkupTrustProps} from './trust_props.js' // code that runs for all markup content export function initMarkupContent() { @@ -12,3 +13,7 @@ export function initMarkupContent() { export function initCommentContent() { initMarkupTasklist(); } + +export function initTrustPropsContent() { + initMarkupTrustProps(); +} diff --git a/web_src/js/markup/trust_props.js b/web_src/js/markup/trust_props.js new file mode 100644 index 0000000000..f4ceb04470 --- /dev/null +++ b/web_src/js/markup/trust_props.js @@ -0,0 +1,5 @@ +export function initMarkupTrustProps() { + $('.trust-props input[type="checkbox"]').click((e) => { + $(e.target).parent().find('a').remove() + }) +}