giterlizzi / dokuwiki-plugin-datatables

Add DataTables support to DokuWiki
GNU General Public License v2.0
10 stars 10 forks source link

Make loaded js files configurable, e.g. for ip-address support #56

Open mbunkus opened 3 years ago

mbunkus commented 3 years ago

jQuery's DataTables comes with various plugins. One we'd really like to use is ip-address.js and the corresponding auto-detection as we have a lot of tables with IP addresses. Without auto-detecting the type 10.0.0.2 will be sorted after 10.0.0.10 whereas including both the ip-address/ip-address.js and ip-address-type-detection/ip-address.js plugins causes sorting to be correct: 10.0.0.2 comes before 10.0.0.10.

I've worked around this by patching action.php and adding the following two lines:

        $dt_scripts[] = "$base_url/datatables/plugins/ip-adress/ip-adress.js";
        $dt_scripts[] = "$base_url/datatables/plugins/ip-adress-type-detection/ip-adress.js";

This feature request is therefore asking one of these things:

  1. (Preferable) Make the list of included plugins configurable via the plugin's configuration.
  2. (Not tried myself, might be harmful) Include all existing plugins all the time.
  3. (Fallback) Only include the two lines I've pasted above.

Thanks for considering it.

tmo26 commented 3 years ago

One more reason to make plugins configurable: Turn off functions that are not needed (e.g. PDF make), in order to save transfer volume.

GET /lib/plugins/datatables/assets/pdfmake/build/pdfmake.min.js HTTP/1.1" 200 1178225

1,1MB is quite heavy, and if possible, I would like to avoid it.

I prefer

1) Make the list of included plugins configurable via the plugin's configuration.