Fragment and compartmentalize the code #569

Open
opened 2026-02-20 10:18:46 -05:00 by deekerman · 2 comments
Owner

Originally created by @RaphaelAlvez on GitHub (Sep 16, 2022).

@mousewax

Originally created by @RaphaelAlvez on GitHub (Sep 16, 2022). @mousewax
Author
Owner

@mousewax commented on GitHub (Sep 16, 2022):

I simple string replace might suffice similar to <script type="module"> //*** CONFIG ***// //*** JS ***// </script>

Search for [tmplt file="example.html"] in the room.html and replace the entire string with the contents of templates/example.html. It doesn't have to be an html file. It can be a js, css, or simple text.

For example:

 <title>[tmplt file="title.txt"]</title>

or

<div id="emptyRoom">
  [tmplt file="emptyroomheader.html"]
  <div class="emptyRoomOptions">...

If the file does not exist, it just removes the string and displays nothing there.

@mousewax commented on GitHub (Sep 16, 2022): I simple string replace might suffice similar to `<script type="module"> //*** CONFIG ***// //*** JS ***// </script>` Search for `[tmplt file="example.html"]` in the room.html and replace the entire string with the contents of `templates/example.html`. It doesn't have to be an html file. It can be a js, css, or simple text. For example: ``` <title>[tmplt file="title.txt"]</title> ``` or ``` <div id="emptyRoom"> [tmplt file="emptyroomheader.html"] <div class="emptyRoomOptions">... ``` If the file does not exist, it just removes the string and displays nothing there.
Author
Owner

@robartsd commented on GitHub (Sep 17, 2022):

So the interest here is breaking room.html into parts that could be individually modified (primarily for the benefit of those maintaining customized servers).

@robartsd commented on GitHub (Sep 17, 2022): So the interest here is breaking room.html into parts that could be individually modified (primarily for the benefit of those maintaining customized servers).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/virtualtabletop#569
No description provided.