# Popup warning for NSFW category

**URL:** https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296
**Category:** Feature
**Created:** [10월 19, 2014, 12:18오후 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296 "2014-10-19T12:18:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ximi](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@ximi](https://meta.discourse.org/u/ximi)
#### Post date: [10월 19, 2014, 12:18오후 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/1 "2014-10-19T12:18:48Z")

</div>

Suppose we have a category for NSFW content, is a popup warning before entry easy to implement? Something that tells the user he/she is entering NSFW category, something like:

“The content of this section is for mature audiences only and may not be suitable for minors. If you are a minor or if it is illegal for you to access mature images and language, do not proceed.”

---

<div class="post-metadata">

### Author: ![lidel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lidel/32/115991_2.png) [@lidel](https://meta.discourse.org/u/lidel)
#### Post date: [10월 19, 2014, 5:02오후 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/2 "2014-10-19T17:02:09Z")

</div>

I think you could trigger popup with custom JS snippet added in `/admin/customize/css_html`.

For example, if your category name is _nsfw_, try something along this lines (when `document` is ready):

```javascript
  if ($('#topic-title a.badge-category:contains("nsfw")').length) { 
   console.log('This post belongs to NSFW category'); 
  }

```

---

<div class="post-metadata">

### Author: ![ximi](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@ximi](https://meta.discourse.org/u/ximi)
#### Post date: [10월 20, 2014, 11:42오전 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/3 "2014-10-20T11:42:03Z")

</div>

Thanks for replying. 😄

If I understand you correctly, the popup comes when you finish writing your post, am I right? That’s not quite what I have in mind.

What I was thinking is, for example you have categories like: Meta, Games, Anime, and Sex. You want a popup warning to appear when people click on Sex, warning them of explicit content.

---

<div class="post-metadata">

### Author: ![lidel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lidel/32/115991_2.png) [@lidel](https://meta.discourse.org/u/lidel)
#### Post date: [10월 20, 2014, 12:19오후 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/4 "2014-10-20T12:19:48Z")

</div>

Hm.. to facilitate your requirement you can add jQuery `.on('click')` listener to every link of a topic from NSFW category.  
It would trigger a custom popup requiring confirmation before going further.  
You could even store confirmation in a cookie, so that on this specific machine user does not have to confirm each time.

I don’t know if such feature will arrive to upstream any time soon.  
If you really need this feature custom JS is the easiest way to go IMO.  
If you need more specific help (eg. custom code for your forum) feel free to PM me 😉

---

<div class="post-metadata">

### Author: ![nekodroid](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nekodroid/32/154550_2.png) [@nekodroid](https://meta.discourse.org/u/nekodroid)
#### Post date: [1월 3, 2020, 10:49오후 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/5 "2020-01-03T22:49:42Z")

</div>

늦게 봤네요. 이 기능은 분명히 유용할 것 같습니다!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 6, 2020, 5:30오전 UTC](https://meta.discourse.org/t/popup-warning-for-nsfw-category/21296/6 "2020-01-06T05:30:52Z")

</div>

테마 컴포넌트는 비교적 쉽게 만들 수 있으므로, #marketplace에서 200달러의 보상을 권장합니다.
