# Hulp nodig bij het integreren van code geschreven op EditText in Discourse

**URL:** https://meta.discourse.org/t/need-help-integrating-code-wrote-on-edittext-to-the-discourse/285204
**Category:** Development
**Created:** [11 november 2023 om 20:05 UTC](https://meta.discourse.org/t/need-help-integrating-code-wrote-on-edittext-to-the-discourse/285204 "2023-11-11T20:05:13Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [12 november 2023 om 19:31 UTC](https://meta.discourse.org/t/need-help-integrating-code-wrote-on-edittext-to-the-discourse/285204/4 "2023-11-12T19:31:35Z")

</div>

Yes, your code is being blocked by CSP. (see security settings)  
You could whitelist `unsafe-inline` in the settings, but that doesn’t sound like a good idea.  
In your case, to make your code work with CSP enabled, i believe you need to [handle the click differently](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243?discovery%2Flist%3Aorder=posts&discovery%2Flist%3Aascending=false#h-2-inline-on-event-handlers-6).

* * *

On a side note, here is a [theme component](https://github.com/Arkshine/discourse-timer-component) using your code: `https://github.com/Arkshine/discourse-timer-component`.  
Feel free to [fork](https://github.com/Arkshine/discourse-timer-component/fork) it and [install](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966#import-new-themes-and-theme-components-8) it on your Discourse.

Hopefully, my code is not too horrible, but this would be the preferred way as opposition adding plain JavaScript in this context.  
It should work the same with extra reactivity stuff, settings, and locale.

It may be overwhelming, but it is an excellent opportunity to dig into [theme component development](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648/1)! Do not hesitate to ask if you don’t understand something. 🙂

I highly recommend using the [Discourse Theme CLI](https://meta.discourse.org/t/install-the-discourse-theme-cli-console-app-to-help-you-build-themes/82950) if you want to work with it locally. It’s handy!

---

_[View the full topic](https://meta.discourse.org/t/need-help-integrating-code-wrote-on-edittext-to-the-discourse/285204)._
