bootstrap javascript?

Permalink
I can find the boostrap css, but I can seem to find boostrap js, is it shipped with 5.7 ? if so how can we require it in the edit dialog of a bloc ?

 
c5box replied on at Permalink Reply
c5box
hi,

i believe it is already activated by default in edit mode. have you tried watching the new videos?
http://www.concrete5.org/about/blog/concrete5-sightings/5-7-develop...
it helped me a lot working on 5.7. it also has guides on managing assets.
i hope this helps you. good luck :)
goutnet replied on at Permalink Reply
Yes I did but only bootstrap CSS is started, the js part is not even present in the archive ...

--
Florian Delizy


Le vendredi 3 octobre 2014 à 12:50, concrete5 Community a écrit :
mesuva replied on at Permalink Reply
mesuva
My impression looking the /concrete/config/app.php file and /concrete/js/bootstrap directory is that the Bootstraps javascript files are individually pulled in, as opposed to the complete set via a single bootstrap.js file. There are appear to be some of the common js component, but they're not all there.

So if you are needing one of the scripts included with c5, I believe you can make some calls in your block controller's add and edit functions like:
$this->requireAsset('bootstrap/alert');
or
$this->requireAsset('bootstrap/tooltip');

But if you're needing a bootstrap script that isn't included, I think you'll need to include it with your block/package.

Boostrap.js isn't very big, even when it's not compressed, so I would have thought it would have been easier to just include the whole thing, but I guess the individual scripts mean that things can be as lightweight as possible. ¯\_(ツ)_/¯
andrew replied on at Permalink Reply
andrew
Heh. We wanted to include them individually so that they could be referenced individually and then turned off individually if a theme includes them in its
Js files. If you enable asset caching on the cache page in the dashboard they should be combined and minified on the fly.
Korvin replied on at Permalink Reply
Korvin
The bootstrap javascript files we have can be found here: https://github.com/concrete5/concrete5-5.7.0/tree/develop/web/concre...

You can see their asset configuration here:https://github.com/concrete5/concrete5-5.7.0/blob/develop/web/concre...

Best wishes,
Korvin
goutnet replied on at Permalink Reply
Hum, checked it but could not find them all, for instance the tab script is missing.

Should I create a pull request?
andrew replied on at Permalink Reply
andrew
We don't include the tab script in the core because we don't use it. A third party theme is free to include it, however. That's the purpose of the asset registries in the page theme classes. For example, if your third party theme relies on bootstrap javascript we don't ship in the core, they can include the full bootstrap.js, and register in their theme class that the theme provides all the bootstrap assets. Then, the core won't include our own versions of bootstrap/popover.js, etc... because we know the theme has them.
FrankX replied on at Permalink Reply
Hi, can you give an actual example how to tell the core system that the theme already provides the entire Bootstrap JS library?
andrew replied on at Permalink Reply
andrew
Check out this documentation:

http://www.concrete5.org/documentation/developers/5.7/designing-for...

Specifically, search for the lines

$this->providesAsset('javascript', 'bootstrap/*');
    $this->providesAsset('css', 'bootstrap/*');