moved to reference tether from bower, and stop copying the file from BS. Templates updated to reference bower version of tether from the cdn.

This commit is contained in:
Kevin Ross 2015-12-23 17:53:20 -06:00
parent 9d1eb6e2da
commit 7d1f0ffe36
9 changed files with 20 additions and 19 deletions

View File

@ -256,7 +256,7 @@ module.exports = function (grunt) {
uglify: { uglify: {
options: { options: {
compress: { compress: {
warnings: false warnings: true
}, },
mangle: true, mangle: true,
preserveComments: /^!|@preserve|@license|@cc_on/i preserveComments: /^!|@preserve|@license|@cc_on/i
@ -386,7 +386,9 @@ module.exports = function (grunt) {
expand: true, expand: true,
cwd: '../bootstrap/docs/assets/js/vendor', cwd: '../bootstrap/docs/assets/js/vendor',
src: [ src: [
'**/*' '**/*',
'!tether.min.js',
'!jquery.min.js'
], ],
dest: 'docs/assets/js/vendor/' dest: 'docs/assets/js/vendor/'
}, },

View File

@ -58,7 +58,8 @@ cdn:
# VERSION is substituted in variables.rb and these are made available as site.data.cdn.* # VERSION is substituted in variables.rb and these are made available as site.data.cdn.*
jquery: https://ajax.googleapis.com/ajax/libs/jquery/VERSION/jquery.min.js jquery: https://ajax.googleapis.com/ajax/libs/jquery/VERSION/jquery.min.js
bootstrap: https://cdn.rawgit.com/twbs/bootstrap/VERSION/dist/js/bootstrap.js bootstrap: https://cdn.rawgit.com/twbs/bootstrap/VERSION/dist/js/bootstrap.min.js
tether: https://cdn.rawgit.com/HubSpot/tether/vVERSION/dist/js/tether.min.js

View File

@ -32,6 +32,7 @@
"test-infra" "test-infra"
], ],
"dependencies": { "dependencies": {
"bootstrap": "v4-dev" "bootstrap": "v4-dev",
"tether": "^1.1"
} }
} }

View File

@ -18,9 +18,7 @@
<script src="{{ site.data.cdn.jquery }}"></script> <script src="{{ site.data.cdn.jquery }}"></script>
<!--<script>window.jQuery || document.write('<script src="{{ site.baseurl }}/assets/js/vendor/jquery.min.js"><\/script>')</script>--> <script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.baseurl }}/assets/js/vendor/tether.min.js"></script>
<script src="{{ site.data.cdn.bootstrap }}"></script> <script src="{{ site.data.cdn.bootstrap }}"></script>
{% if site.data.minified %} {% if site.data.minified %}

View File

@ -18,7 +18,8 @@ module Variables
metadata_files = { metadata_files = {
'bower' => '../bower.json', 'bower' => '../bower.json',
'package' => '../package.json', 'package' => '../package.json',
'bower_jquery' => '../bower_components/jquery/bower.json' 'bower_jquery' => '../bower_components/jquery/bower.json',
'bower_tether' => '../bower_components/tether/bower.json'
} }
metadata_files.each do |metadata, path| metadata_files.each do |metadata, path|
@ -30,11 +31,13 @@ module Variables
name = site.data['package']['name'] name = site.data['package']['name']
version = site.data['package']['version'] version = site.data['package']['version']
bootstrap_version = site.data['bower']['dependencies']['bootstrap'] bootstrap_version = site.data['bower']['dependencies']['bootstrap']
tether_version = site.data['bower_tether']['version']
jquery_version = site.data['bower_jquery']['version'] jquery_version = site.data['bower_jquery']['version']
site.data['name'] = name site.data['name'] = name
site.data['version'] = version site.data['version'] = version
site.data['bootstrap_version'] = bootstrap_version site.data['bootstrap_version'] = bootstrap_version
site.data['tether_version'] = tether_version
site.data['jquery_version'] = jquery_version site.data['jquery_version'] = jquery_version
@ -47,7 +50,8 @@ module Variables
site.data['cdn'] = { site.data['cdn'] = {
'jquery' => site.config['cdn']['jquery'].gsub(/VERSION/, jquery_version), 'jquery' => site.config['cdn']['jquery'].gsub(/VERSION/, jquery_version),
'bootstrap' => site.config['cdn']['bootstrap'].gsub(/VERSION/, bootstrap_version) 'bootstrap' => site.config['cdn']['bootstrap'].gsub(/VERSION/, bootstrap_version),
'tether' => site.config['cdn']['tether'].gsub(/VERSION/, tether_version)
} }
# #

View File

@ -28,7 +28,7 @@ class Application {
}) })
// Insert copy to clipboard button before .highlight // Insert copy to clipboard button before .highlight
$('.highlight').each(() => { $('.highlight').each(function () {
let btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>' let btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>'
$(this).before(btnHtml) $(this).before(btnHtml)
$('.btn-clipboard').tooltip() $('.btn-clipboard').tooltip()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@ Add jQuery, Bootstrap, and our Javascript plugins near the end of your pages, ri
<script src="{{ site.data.cdn.bootstrap }}"></script> <script src="{{ site.data.cdn.bootstrap }}"></script>
<script src="{{ site.cdn.js }}"></script> <script src="{{ site.cdn.js }}"></script>
<script> <script>
$.bootstrapMaterialDesign() $('body').bootstrapMaterialDesign()
</script> </script>
{% endhighlight %} {% endhighlight %}
@ -74,12 +74,13 @@ Put it all together and your pages should look like this:
<body> <body>
<h1>Hello, world!</h1> <h1>Hello, world!</h1>
<!-- jQuery first, then Bootstrap and Material Design for Bootstrap JS. --> <!-- jQuery first, optional tether for tooltips, then Bootstrap and Material Design for Bootstrap JS. -->
<script src="{{ site.data.cdn.jquery }}"></script> <script src="{{ site.data.cdn.jquery }}"></script>
<script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.data.cdn.bootstrap }}"></script> <script src="{{ site.data.cdn.bootstrap }}"></script>
<script src="{{ site.cdn.js }}"></script> <script src="{{ site.cdn.js }}"></script>
<script> <script>
$.bootstrapMaterialDesign() $('body').bootstrapMaterialDesign()
</script> </script>
</body> </body>
</html> </html>