Skip to content

Commit 11106ce

Browse files
committed
docs: add section on loading classhelper.js script.
Also provide some info about precompressing and minimizing the file. Add a reference for the compression config info.
1 parent 0f159e0 commit 11106ce

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

doc/admin_guide.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ move the exsiting config.ini to config.bak and replace it with the
243243
roundup-server's config.ini. This will make the tracker in the
244244
directory fail to start util the original config.ini is restored.
245245

246+
.. _configuring-compression:
247+
246248
Configuring Compression
247249
=======================
248250

@@ -622,6 +624,33 @@ The ``','.join(search.split(',')[:-1])`` removes the last element of
622624
the search string (``roles[]``) if the user does not have the Admin
623625
role.
624626

627+
Loading the <roundup-classhelper> Script
628+
----------------------------------------
629+
630+
To make the ``<roundup-classhelper>`` wrappers work, you
631+
have to load the classhelper.js script. Add the following
632+
html script tag in the head section of page.html::
633+
634+
<script type="text/javascript" src="@@file/classhelper.js">
635+
</script>
636+
637+
You can place it anywhere before ``</head>``. This will make
638+
it available on all pages.
639+
640+
The script will also work if it is loaded at the end of the
641+
body. It can also be added to the ``more-javascript`` slot
642+
in one of the templates (see ``user.item.html`` for an
643+
example) if you don't want the overhead of loading the script
644+
on every page.
645+
646+
You may want to minimize and precompress the file. Using
647+
dynamic compression, the file is 10k when compressed with
648+
gzip (8k with brotli). If you minimize the file first with
649+
`rjsmin <https://pypi.org/project/rjsmin/>`_ and then
650+
compress it, it's about 6k. See the information about using
651+
precompressed files in the :ref:`section on compression
652+
<configuring-compression>`.
653+
625654
<roundup-classhelper> configuration
626655
-----------------------------------
627656

0 commit comments

Comments
 (0)