Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to exclude Bootstrap/jQuery CSS/JS/Image files? #197

Closed
TheGeekPharaoh opened this issue Oct 15, 2015 · 13 comments
Closed

Ability to exclude Bootstrap/jQuery CSS/JS/Image files? #197

TheGeekPharaoh opened this issue Oct 15, 2015 · 13 comments
Assignees
Milestone

Comments

@TheGeekPharaoh
Copy link

I'd love to see the ability (if it doesn't already exist in Bootsfaces) to exclude the actual Bootstrap/jQuery libraries themselves when rendering the page. That is, I'd like to be able to exclude the CSS, JS, and images files themselves and get them from an alternative URL. We make use of a CDN to improve load times on our pages. If we could tell Bootsfaces not to load these files that would improve our page rendering time and we could just get these files from our CDN.

Is there a context-param value we can set to achieve this?

@stephanrauh
Copy link
Collaborator

This issue is partially covered by #121.

@TheGeekPharaoh
Copy link
Author

I fail to see how.  I want the bootstrap and jQuery CSS and JS files included within the Bootsfaces distribution to be excluded ENTIRELY so that I can instead load them from a CDN or other source.  The order of the CSS files isn't really an issue.  I want them gone altogether so I can reference them from a different URL.

@stephanrauh
Copy link
Collaborator

Before starting to implement your feature request, let me summary what we already have:

  • The context parameter BootsFaces_USETHEMEallows you to deactivate the theme.
  • The context parameter net.bootsfaces.get_fontawesome_from_cdn allows you to suppress loading the FontAwesome.css of BootsFaces.
  • If your XHTML page loads a resource called "jquery*.js", the jquery implementation of BootsFaces is not loaded.
  • The your XHTML page loads a resource called "font-awesome_.css" or "fontawesome_.css", BootsFaces doesn't load FontAwesome itself.

What we didn't implement yet:

  • You can't suppress loading our jquery-ui.js files. Adding insult to injury, BootsFaces doesn't use the all-in-one jquery-ui.js file, but loads the modules individually if necessary. That's good with respect to memory and network traffic, but bad with respect to network latency and the ability to add a custom jquery-ui.js file.

@stephanrauh
Copy link
Collaborator

Added three context parameters and a jQueryUI detection:

  • If your XHTML page loads a jqueryUi*.js file, BootsFaces doesn't add its own jQueryUI file.
  • net.bootsfaces.get_bootstrap_from_cdn suppresses loading the Bootstrap files of BootsFaces
  • net.bootsfaces.get_jquery_from_cdn suppresses loading the jQuery.js file of BootsFaces
  • net.bootsfaces.get_jqueryui_from_cdn suppresses loading the jQueryUi*.js files of BootsFaces

@stephanrauh
Copy link
Collaborator

   <context-param>
        <param-name>net.bootsfaces.get_jquery_from_cdn</param-name>
        <param-value>true</param-value>
    </context-param>
   <context-param>
        <param-name>net.bootsfaces.get_jqueryui_from_cdn</param-name>
        <param-value>true</param-value>
    </context-param>
   <context-param>
        <param-name>net.bootsfaces.get_bootstrap_from_cdn</param-name>
        <param-value>true</param-value>
    </context-param>

@stephanrauh
Copy link
Collaborator

I've uploaded a new developer snapshot. @sdnakhla , would you mind to test it and tell me if my solution suits your needs?

@stephanrauh stephanrauh added this to the v0.8.0 milestone Oct 28, 2015
@stephanrauh stephanrauh self-assigned this Oct 28, 2015
@TheGeekPharaoh
Copy link
Author

Absolutely.  Where/how do I go about downloading it?  I'm using Maven to build my project.

 On Wednesday, October 28, 2015 6:44 PM, Stephan Rauh <[email protected]> wrote:

I've uploaded a new developer snapshot. @sdnakhla , would you mind to test it and tell me if my solution suits your needs?—
Reply to this email directly or view it on GitHub.

@stephanrauh
Copy link
Collaborator

Oh, sorry, I forgot to mention I described this in issue #151. For the sake of convenience, I'll copy the text here:

Important: Do not use these snapshots in production!

https://oss.sonatype.org/content/repositories/snapshots/net/bootsfaces/bootsfaces/0.8.0-SNAPSHOT/

You can access this in your pom.xml after adding a new repository:

     <repositories>
        <repository>
          <id>central</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
    </repositories>

The download coordinates of the snapshot version are:

<dependency>
    <groupId>net.bootsfaces</groupId>
    <artifactId>bootsfaces</artifactId>
    <version>0.8.0-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>

@TheGeekPharaoh
Copy link
Author

I tried it and everything looks good.  Thanks so much for including this!

@stephanrauh
Copy link
Collaborator

Great! Actually, we've added a few lines of CSS code to the original CSS files, so chances are you'll encounter minor difficulties. For instance, the date picker may open the date picker window in the background where it's invisible.

@stephanrauh
Copy link
Collaborator

ToDo left: document the new feature.

@TheCoder4eu TheCoder4eu modified the milestones: v0.9.0, v0.8.0 Nov 1, 2015
@vsvetoslavov
Copy link
Contributor

Are all the parameters documented somewhere? If they are not I think they should - they seem very helpful to me. Hope we get a 0.8.0.final soon :)

@stephanrauh
Copy link
Collaborator

I've just documented the parameters (and several others): http://bootsfaces.net/Staging/layout/resourcemanagement.jsf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants