<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Adding custom JS to Lychee]]></title><description><![CDATA[<p dir="auto">Hello Cloudriders.</p>
<p dir="auto">I want to add a piece of custom JS (with a tiny bit of HTML) to Lychee and tried the 'add JS' function in settings. Since Cloudron has a read-only file system I wondered how this might be achieved?</p>
]]></description><link>https://forum.cloudron.io/topic/11232/adding-custom-js-to-lychee</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 19:43:33 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/11232.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Mar 2024 11:56:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Adding custom JS to Lychee on Tue, 12 Mar 2024 14:51:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/3246" aria-label="Profile: 3246">@<bdi>3246</bdi></a> Just had a quick look . It seems the script gets injected in the pages using <code>&lt;script defer type="text/javascript" src="https://xxx/dist/custom.js"&gt;&lt;/script&gt;</code> at the very top. If you put <code>alert('foo');</code> then it shows it all the pages. But the issue as you found is that the gallery page and individual photo page don't have the footer element. The footer is only in albums page it seems. I guess you have to ask upstream about this design/layout.</p>
]]></description><link>https://forum.cloudron.io/post/84896</link><guid isPermaLink="true">https://forum.cloudron.io/post/84896</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 12 Mar 2024 14:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 11 Mar 2024 17:24:55 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a>. It works on the main page but not a gallery or photo page. Also, the toolbar seems missing (it has class .h-0 == height=0px oddly???).</p>
<p dir="auto"><strong>The gallery homepage</strong><br />
<img src="/assets/uploads/files/1710177797786-desktop-screenshot-resized.png" alt="Desktop-screenshot.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>An album page</strong><br />
<img src="/assets/uploads/files/1710177816773-desktop-screenshot-1-resized.png" alt="Desktop-screenshot (1).png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is the same for individual photo pages as they get loaded in a lightbox (but seem to have their own URL).</p>
]]></description><link>https://forum.cloudron.io/post/84821</link><guid isPermaLink="true">https://forum.cloudron.io/post/84821</guid><dc:creator><![CDATA[3246]]></dc:creator><pubDate>Mon, 11 Mar 2024 17:24:55 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 11 Mar 2024 15:35:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/3246" aria-label="Profile: 3246">@<bdi>3246</bdi></a> I would simply test it step by step.</p>
<p dir="auto">For a start does a basic <code>document.getElementById("footer").innerHTML += "&lt;p&gt;FOO&lt;/p&gt;"</code> work ? If that works, then do:</p>
<pre><code>var curl_url = window.location.href;
var myHTML = "&lt;p&gt;" + curl_url + "&lt;/p&gt;";
document.getElementById("footer").innerHTML += myHTML;
</code></pre>
<p dir="auto">and so on <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=af5271e93de" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.cloudron.io/post/84812</link><guid isPermaLink="true">https://forum.cloudron.io/post/84812</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 11 Mar 2024 15:35:29 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 11 Mar 2024 14:51:57 GMT]]></title><description><![CDATA[<p dir="auto">OK, this is working and I wondered if somebody with better JS skills can help me complete this code piece to add comments to Lychee:</p>
<pre><code>document.getElementById("footer").innerHTML += " &lt;div id='cusdis_thread' data-host='https://cusdis.com' data-app-id='RANDOMSTRINGOFNUMBERS' data-page-url='URLHERE"' data-page-title='TITLEHERE'&gt;&lt;/div&gt;&lt;script async defer src='https://cusdis.com/js/cusdis.es.js'&gt;&lt;/script&gt; ";
</code></pre>
<p dir="auto">I need to include the current page URL (window.location.href) in the data-page-url attribute and title (document.title) in the data-page-title. I unsuccessfully tried my limited skills to solve this and so far only ended up including the code without the needed references on the page.</p>
<p dir="auto">Not sure where to stick this reference either to display the comment field on an individual photo page only but that's probably doable using an if statement somewhere <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=af5271e93de" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title="🤔" alt="🤔" /></p>
<p dir="auto">PS I think the lychee sidebar (lychee_sidebar) also needs a CSS style adding to scroll when the window is smaller than its contents (e.g. overflow: auto;).</p>
]]></description><link>https://forum.cloudron.io/post/84804</link><guid isPermaLink="true">https://forum.cloudron.io/post/84804</guid><dc:creator><![CDATA[3246]]></dc:creator><pubDate>Mon, 11 Mar 2024 14:51:57 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 11 Mar 2024 12:18:36 GMT]]></title><description><![CDATA[<p dir="auto">Amazing, thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a></p>
]]></description><link>https://forum.cloudron.io/post/84774</link><guid isPermaLink="true">https://forum.cloudron.io/post/84774</guid><dc:creator><![CDATA[3246]]></dc:creator><pubDate>Mon, 11 Mar 2024 12:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 04 Mar 2024 20:42:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/3246" aria-label="Profile: 3246">@<bdi>3246</bdi></a> Fixed in latest package</p>
]]></description><link>https://forum.cloudron.io/post/84426</link><guid isPermaLink="true">https://forum.cloudron.io/post/84426</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 04 Mar 2024 20:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 04 Mar 2024 16:10:20 GMT]]></title><description><![CDATA[<p dir="auto">Curiosly, the 'Personalize CSS' works. It saves it in <code>/app/data/user.css</code></p>
]]></description><link>https://forum.cloudron.io/post/84411</link><guid isPermaLink="true">https://forum.cloudron.io/post/84411</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 04 Mar 2024 16:10:20 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 04 Mar 2024 13:20:04 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a>, yes - it's to embed a commenting field <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=af5271e93de" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Ref. <a href="https://cusdis.com/doc#/advanced/sdk" target="_blank" rel="noopener noreferrer nofollow ugc">https://cusdis.com/doc#/advanced/sdk</a></p>
]]></description><link>https://forum.cloudron.io/post/84402</link><guid isPermaLink="true">https://forum.cloudron.io/post/84402</guid><dc:creator><![CDATA[3246]]></dc:creator><pubDate>Mon, 04 Mar 2024 13:20:04 GMT</pubDate></item><item><title><![CDATA[Reply to Adding custom JS to Lychee on Mon, 04 Mar 2024 12:20:36 GMT]]></title><description><![CDATA[<p dir="auto">Do you have more information on what the Add JS functionality does?</p>
]]></description><link>https://forum.cloudron.io/post/84395</link><guid isPermaLink="true">https://forum.cloudron.io/post/84395</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Mon, 04 Mar 2024 12:20:36 GMT</pubDate></item></channel></rss>