Page level apps
Clone this wiki locally
Currently, there is no not-shitty way to run different apps for different pages. The user must simply define the apps that will load application wide.
This document will propose one or more solutions:
The existing difficulty with defining apps at the page level is the nature of LESS variables. They can only be set once and cannot be concatenated.
kickstrap.less while defining apps that should run in addition on the page?
This can be done as such:
<script type="text/kickstrap"> @appList: "chosen, pinesnotify, knockoutjs"; </script>
I've already got this up and working and may go with this instead:
Anywhere on the page, you can declare "pageApps." This will be automatically added to the apps you already have defined in kickstrap.less
<script>var pageApps = ["pinesnotify", "knockoutjs"]</script>
I believe this offers the greatest flexibility since it's not a made-up language and it is the most configurable. If a developer just wanted to avoid having to go into kickstrap.less altogether, she could just put
.concat() for other apps she wants to run page-by-page.
<!-- This is in the header of every page of the site--!> <script>var pageApps = ["pinesnotify", "knockoutjs"]</script> <!-- .... --> <!-- This is only on this page. --> <script> pageApps = pageApps.concat(["qunit"])</script>