README.md in rack-jquery_ui-1.1.0 vs README.md in rack-jquery_ui-2.0.0
- old
+ new
@@ -18,23 +18,45 @@
* Install it (see below)
* `require 'rack/jquery_ui'`.
* Add `use Rack::JQueryUI` to your middleware stack.
* Put this in the head of your layout (the example is Haml but you can use whatever you like)
- <pre><code>
- %head
- = Rack::JQueryUI.cdn
- </code></pre>
+ %head
+ = Rack::JQueryUI.cdn
+
Now you have the script tags to Google's CDN in the head (you can also use Media Temple or Microsoft, or Cloudflare, see the docs).
It also adds in a bit of javascript that will load in a locally kept version of jQuery, just incase the CDN is unreachable. The script will use the "/js/jquery-ui/1.10.1/jquery-ui.min.js" path (or, instead of 1.10.1, whatever is in {Rack::JQuery::VERSION}). You can change the "/js" bit if you like (see the docs).
That was easy.
### Note ###
You have to have loaded jQuery _before_ using the CDN helper, as jQuery-UI relies on it. I've already mentioned [Rack::JQuery](https://github.com/yb66/rack-jquery) which you can use to do this, or load the script however you like. Just remember that it needs to be there.
+
+### When the CDN doesn't support the jQuery UI version of the library ###
+
+I made a mistake and pushed out a version of the library where not all the CDNs supported the version of jQuery UI it was using. Embarrassing.
+
+To stop this happening again I've added more checks, but there's also a choice for the library user. If you've picked a CDN to use, something like this:
+
+ %head
+ = Rack::JQueryUI.cdn :microsoft
+
+and it doesn't support the jQuery UI version, then it will silently use the default CDN (usually Google's, but it will change depending on who supports what).
+
+If you'd prefer an exception to be raised you can either do this:
+
+ use Rack::JQueryUI, :raise => true
+
+or
+
+ %head
+ = Rack::JQueryUI.cdn :microsoft, :raise => true
+
+the second way will always override the first.
+
### Version numbers ###
This library uses [semver](http://semver.org/) to version the **library**. That means the library version is ***not*** an indicator of quality but a way to manage changes. The version of jQuery UI can be found in the lib/rack/jquery_ui/version.rb file, or via the {Rack::JQueryUI::JQUERY_UI_VERSION} constant.