mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-29 04:54:12 +03:00
added bootstrap docs sync for scss (with the exception of docs.scss which is customized). Moved the rest of application to the es6 class for uniformity
This commit is contained in:
parent
132fa6bb30
commit
b06051e179
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,7 @@
|
|||
# temp during major v4 development - tired of these showing up ready to commit
|
||||
dist/**/*
|
||||
|
||||
# Ignore docs dist files
|
||||
docs/dist/**/*
|
||||
docs/assets/css/*
|
||||
docs/assets/js/dist/*
|
||||
|
|
13
Gruntfile.js
13
Gruntfile.js
|
@ -340,6 +340,15 @@ module.exports = function (grunt) {
|
|||
],
|
||||
dest: 'docs/dist/'
|
||||
},
|
||||
'bs-docs-scss': {
|
||||
expand: true,
|
||||
cwd: '../bootstrap/docs/assets/scss',
|
||||
src: [
|
||||
'**/*',
|
||||
'!docs.scss' // keep variable customizations
|
||||
],
|
||||
dest: 'docs/assets/scss/'
|
||||
},
|
||||
'bs-docs-components': {
|
||||
expand: true,
|
||||
cwd: '../bootstrap/docs/components',
|
||||
|
@ -572,7 +581,9 @@ module.exports = function (grunt) {
|
|||
grunt.registerTask('docs-css', ['sass:docs', 'postcss:docs', 'postcss:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']);
|
||||
grunt.registerTask('docs-js', ['babel:docs', 'uglify:docsJs']);
|
||||
grunt.registerTask('lint-docs-js', ['jscs:assets']);
|
||||
grunt.registerTask('docs', ['copy:bs-docs-components', 'copy:bs-docs-content', 'docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs']);
|
||||
grunt.registerTask('docs-copy-bootstrap', ['copy:bs-docs-scss', 'copy:bs-docs-components', 'copy:bs-docs-content']);
|
||||
|
||||
grunt.registerTask('docs', ['docs-copy-bootstrap', 'docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs']);
|
||||
|
||||
grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']);
|
||||
|
||||
|
|
|
@ -1,8 +1,29 @@
|
|||
import Style from './style'
|
||||
import Clipboard from 'clipboard'
|
||||
|
||||
class Application {
|
||||
|
||||
constructor() {
|
||||
|
||||
// Tooltip and popover demos
|
||||
$('.tooltip-demo').tooltip({
|
||||
selector: '[data-toggle="tooltip"]',
|
||||
container: 'body'
|
||||
})
|
||||
|
||||
$('[data-toggle="popover"]').popover()
|
||||
|
||||
// Demos within modals
|
||||
$('.tooltip-test').tooltip()
|
||||
$('.popover-test').popover()
|
||||
|
||||
// Indeterminate checkbox example
|
||||
$('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true)
|
||||
|
||||
// Disable empty links in docs examples
|
||||
$('.bd-example [href=#]').click((e) => {
|
||||
e.preventDefault()
|
||||
})
|
||||
}
|
||||
|
||||
displayTypographyProperties() {
|
||||
|
@ -10,12 +31,49 @@ class Application {
|
|||
return $element.closest('tr').find('td.type-info')
|
||||
})
|
||||
}
|
||||
|
||||
clipboard() {
|
||||
// Insert copy to clipboard button before .highlight
|
||||
$('.highlight').each(function () {
|
||||
let btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>'
|
||||
$(this).before(btnHtml)
|
||||
$('.btn-clipboard').tooltip()
|
||||
})
|
||||
|
||||
let clipboard = new Clipboard('.btn-clipboard', {
|
||||
target: (trigger) => {
|
||||
return trigger.parentNode.nextElementSibling
|
||||
}
|
||||
})
|
||||
|
||||
clipboard.on('success', (e) => {
|
||||
$(e.triggerStart)
|
||||
.attr('title', 'Copied!')
|
||||
.tooltip('_fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('_fixTitle')
|
||||
|
||||
e.clearSelection()
|
||||
})
|
||||
|
||||
clipboard.on('error', (e) => {
|
||||
let fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'Press \u2318 to copy' : 'Press Ctrl-C to copy'
|
||||
|
||||
$(e.triggerStart)
|
||||
.attr('title', fallbackMsg)
|
||||
.tooltip('_fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('_fixTitle')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$(() => {
|
||||
let app = new Application()
|
||||
app.displayTypographyProperties()
|
||||
|
||||
app.clipboard()
|
||||
// $.bootstrapMaterialDesign()
|
||||
|
||||
})
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
/*!
|
||||
* JavaScript for Bootstrap's docs (http://getbootstrap.com)
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
|
||||
/* global Clipboard, anchors */
|
||||
|
||||
!function ($) {
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
|
||||
// Tooltip and popover demos
|
||||
$('.tooltip-demo').tooltip({
|
||||
selector: '[data-toggle="tooltip"]',
|
||||
container: 'body'
|
||||
})
|
||||
|
||||
$('[data-toggle="popover"]').popover()
|
||||
|
||||
// Demos within modals
|
||||
$('.tooltip-test').tooltip()
|
||||
$('.popover-test').popover()
|
||||
|
||||
// Indeterminate checkbox example
|
||||
$('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true)
|
||||
|
||||
// Disable empty links in docs examples
|
||||
$('.bd-example [href=#]').click(function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
// Insert copy to clipboard button before .highlight
|
||||
$('.highlight').each(function () {
|
||||
var btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>'
|
||||
$(this).before(btnHtml)
|
||||
$('.btn-clipboard').tooltip()
|
||||
})
|
||||
|
||||
var clipboard = new Clipboard('.btn-clipboard', {
|
||||
target: function (trigger) {
|
||||
return trigger.parentNode.nextElementSibling
|
||||
}
|
||||
})
|
||||
|
||||
clipboard.on('success', function (e) {
|
||||
$(e.triggerStart)
|
||||
.attr('title', 'Copied!')
|
||||
.tooltip('_fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('_fixTitle')
|
||||
|
||||
e.clearSelection()
|
||||
})
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
var fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'Press \u2318 to copy' : 'Press Ctrl-C to copy'
|
||||
|
||||
$(e.triggerStart)
|
||||
.attr('title', fallbackMsg)
|
||||
.tooltip('_fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('_fixTitle')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}(jQuery)
|
||||
|
||||
;(function () {
|
||||
'use strict';
|
||||
|
||||
anchors.options.placement = 'left';
|
||||
anchors.add('.bd-content > h1, .bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5')
|
||||
})();
|
6
docs/assets/scss/.READONLY-MOSTLY.txt
Normal file
6
docs/assets/scss/.READONLY-MOSTLY.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
DO NOT edit files in this folder EXCEPT docs.scss.
|
||||
|
||||
These files are copied using
|
||||
grunt copy:bs-docs-scss
|
||||
|
||||
This is done to keep samples in sync with the upstream bs4.
|
|
@ -13,7 +13,7 @@
|
|||
line-height: 1rem !important;
|
||||
color: $bd-purple-light !important;
|
||||
text-align: left;
|
||||
background-color: darken($bd-purple, 10%) !important;
|
||||
background: darken($bd-purple, 10%) !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
|
||||
&.active {
|
||||
font-weight: 500;
|
||||
color: darken($gray-dark, 25%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// This is the only customized file in this directory.
|
||||
|
||||
/*!
|
||||
* Bootstrap Docs (http://getbootstrap.com)
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
|
|
Loading…
Reference in New Issue
Block a user