diff --git a/Gruntfile.js b/Gruntfile.js index 1f47d2b..0f2231a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,10 +15,9 @@ module.exports = function(grunt) { ' * <%= pkg.name %>\n' + ' * v<%= pkg.version %>\n' + ' * <%= pkg.description %>\n' + - ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' + + ' * Copyright (c) 2017 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' + ' * License: <%= pkg.license %>\n' + - ' */\n\n', - filename : 'bootstrap-tooltip-custom-class' + ' */\n\n' }, sass: sassConfig, less: lessConfig, diff --git a/README.md b/README.md index 4f25e4e..d224c35 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Bootstrap Tooltip Custom Class -Extend Bootstrap Tooltip plugin by adding custom classes to tooltips. Available for **Bootstrap 3** and **Bootstrap 4**. +Extends Bootstrap Tooltips and Popovers by adding custom classes. Available for **Bootstrap 3** and **Bootstrap 4**. -Define your own custom class or use the predefined custom classes: `.tooltip-primary`, `.tooltip-success`, `.tooltip-info`, `.tooltip-warning`, `.tooltip-danger`. +Define your own custom class or use the predefined custom classes: +- tooltips: `.tooltip-primary`, `.tooltip-success`, `.tooltip-info`, `.tooltip-warning`, `.tooltip-danger`. +- popovers: `.popover-primary`, `.popover-success`, `.popover-info`, `.popover-warning`, `.popover-danger`. ![Bootstrap Tooltip Custom Class Preview](https://i.imgur.com/CNoQ13w.png) @@ -21,7 +23,11 @@ yarn add bootstrap-tooltip-custom-class ## Setup -**Use the appropriate files according to Bootstrap version that you use.** +**The implementations for [Tooltips][1] and [Popovers][2] are independent. You can include them together or you can use them separately.** + +**Use the appropriate files according to Bootstrap version that you use: `bootstrap-v3`, `bootstrap-v4` or `bootstrap-v4-alpha`.** + +### Tooltips #### CSS Include `bootstrap-tooltip-custom-class.css` in your project or use the `.scss` file: @@ -57,6 +63,41 @@ Include the script after Bootstrap's main javascript file: ``` +### Popovers +#### CSS +Include `bootstrap-popover-custom-class.css` in your project or use the `.scss` file: +```html + +``` +#### SASS: +```sass +@import "bootstrap-popover-custom-class"; +``` +Use the mixin `popover-custom` to create styles for your custom popover: +````sass +.popover-custom { + @include popover-custom(#f2653c, #fff); +} +```` + +#### Less (only for Bootstrap v3): +```less +@import "bootstrap-popover-custom-class.less"; +``` +Use the mixin `popover-custom`: +````less +.popover-custom { + .popover-custom(#f2653c, #fff); +} +```` + +#### Javascript +Include the script after Bootstrap's main javascript file: +```html + + +``` + ## Usage - Use `data-custom-class` attribute: @@ -64,22 +105,32 @@ Include the script after Bootstrap's main javascript file: ```html ``` +```html + +``` or - Use `customClass` parameter on plugin initialization: ```javascript $(function () { - $('.my-element').tooltip({ + $('.has-tooltip').tooltip({ customClass: 'tooltip-custom' }); }); ``` +```javascript +$(function () { + $('.has-popover').popover({ + customClass: 'popover-custom' + }); +}); +``` ## Demo #### Local -Local demo files can be found in the `demo` folder of each project (`bootstrap-v3`, `bootstrap-v4`, `bootstrap-v4-alpha`). +Local demo files can be found in the `demo` folder of each project. First, execute the following instructions in the root: ``` @@ -96,3 +147,5 @@ $ npm run build-#project_alias# (or) npm run build-all - Bootstrap 3: [Codepen](https://codepen.io/andreivictor/full/gmNeJq) +[1]: #tooltips +[2]: #popovers diff --git a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css.map deleted file mode 100644 index e40af02..0000000 --- a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css.map +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 3, - "file": "bootstrap-tooltip-custom-class.min.css", - "sources": [ - "../../src/scss/main.scss", - "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss", - "../../src/scss/bootstrap-tooltip-custom-class.scss", - "../../src/scss/_variables.scss", - "../../src/scss/_mixin.scss", - "../../src/scss/_tooltips.scss" - ], - "names": [], - "m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VH,ADYE,aCZW,ADYV,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHLC,OAAO,CGM5B,ACVH,ADTE,gBCSc,CDTd,cAAc,AAAC,CACb,gBAAgB,CHaI,OAAO,CGZ3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACMH,ADJE,gBCIc,ADJb,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHQI,OAAO,CGP5B,ACEH,ADAE,gBCAc,ADAb,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHIE,OAAO,CGH5B,ACFH,ADIE,gBCJc,ADIb,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHAG,OAAO,CGC5B,ACNH,ADQE,gBCRc,ADQb,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHJC,OAAO,CGK5B,ACNH,ADbE,eCaa,CDbb,cAAc,AAAC,CACb,gBAAgB,CHcI,OAAO,CGb3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACUH,ADRE,eCQa,ADRZ,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHSI,OAAO,CGR5B,ACMH,ADJE,eCIa,ADJZ,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHKE,OAAO,CGJ5B,ACEH,ADAE,eCAa,ADAZ,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHCG,OAAO,CGA5B,ACFH,ADIE,eCJa,ADIZ,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHHC,OAAO,CGI5B" -} \ No newline at end of file diff --git a/bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.min.js deleted file mode 100644 index a73d4fa..0000000 --- a/bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * bootstrap-tooltip-custom-class - * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme - * License: MIT - */ - - -!function(o){if(void 0===o.fn.tooltip.Constructor)throw new Error("Bootstrap Tooltip must be included first!");var t=o.fn.tooltip.Constructor;o.extend(t.DEFAULTS,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){s.apply(this),this.options.customClass&&this.tip().addClass(this.options.customClass)}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v3/package.json b/bootstrap-v3/package.json index 3e35f36..1ba5f73 100644 --- a/bootstrap-v3/package.json +++ b/bootstrap-v3/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-tooltip-custom-class", - "description": "Extend Bootstrap Tooltip plugin by adding custom classes. For Bootstrap v3.", + "description": "Extends Bootstrap Tooltips and Popovers by adding custom classes. For Bootstrap v3.", "repository": { "type": "git", "url": "git+https://github.com/andreivictor/bootstrap-tooltip-custom-class.git" diff --git a/bootstrap-v3/popover/demo/demo.css b/bootstrap-v3/popover/demo/demo.css new file mode 100644 index 0000000..3dba4b0 --- /dev/null +++ b/bootstrap-v3/popover/demo/demo.css @@ -0,0 +1,88 @@ +.popover-primary .popover-title { + background: #337ab7; + color: #fff; +} + +.popover-success .popover-title { + background: #5cb85c; + color: #fff; +} + +.popover-info .popover-title { + background: #5bc0de; + color: #fff; +} + +.popover-warning .popover-title { + background: #f0ad4e; + color: #fff; +} + +.popover-danger .popover-title { + background: #d9534f; + color: #fff; +} + +.popover-custom .popover-title { + background: #f2653c; + color: #ffffff; +} + +.popover-custom-alt .popover-title { + background: #5b2da3; + color: #ffffff; +} + +body { + padding-top: 50px; +} + +#topnav { + z-index: 1061; +} + +#topnav .navbar-header { + float: left; +} + +#topnav .navbar-right { + float: right !important; + margin: 0 -15px 0 0; +} + +@media (max-width: 340px) { + #topnav .navbar-brand { + font-size: 14px; + } +} + +#topnav .navbar-nav > li > a { + padding-top: 11px; + padding-bottom: 11px; +} + +#topnav .navbar-nav > li > a > i { + font-size: 26px; +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} + +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + position: relative; + display: inline-block; + margin: 20px; +} diff --git a/bootstrap-v3/popover/demo/demo.js b/bootstrap-v3/popover/demo/demo.js new file mode 100644 index 0000000..123383b --- /dev/null +++ b/bootstrap-v3/popover/demo/demo.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + $('.btn-default').popover(); + $('.btn-custom').popover({ + customClass: 'popover-custom' + }); + $('.btn-custom-alt').popover({ + customClass: 'popover-custom-alt' + }); +}); diff --git a/bootstrap-v3/popover/demo/demo.scss b/bootstrap-v3/popover/demo/demo.scss new file mode 100644 index 0000000..926a6ed --- /dev/null +++ b/bootstrap-v3/popover/demo/demo.scss @@ -0,0 +1,64 @@ +@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; +@import "../src/scss/bootstrap-popover-custom-class"; + +.popover-custom { + @include popover-custom(#f2653c, #ffffff); +} + +.popover-custom-alt { + @include popover-custom(#5b2da3, #ffffff); +} + +//== Demo layout +// +//## +body { + padding-top: 50px; +} + +#topnav { + z-index: ($zindex-popover + 1); + + .navbar-header { + float: left; + } + .navbar-right { + float: right !important; + margin: 0 -15px 0 0; + } + @media (max-width: 340px) { + .navbar-brand { + font-size: $font-size-base; + } + } + + .navbar-nav>li>a { + padding-top: 11px; + padding-bottom: 11px; + } + + .navbar-nav>li>a>i { + font-size: 26px; + } +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + position: relative; + display: inline-block; + margin: 20px; +} diff --git a/bootstrap-v3/popover/demo/index.html b/bootstrap-v3/popover/demo/index.html new file mode 100644 index 0000000..f534efb --- /dev/null +++ b/bootstrap-v3/popover/demo/index.html @@ -0,0 +1,108 @@ + + + + + Bootstrap Popover Custom Class + + + + + + + + + + + +
+
+

Static examples

+
+
+
+

Popover primary example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+

Popover success example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+

Popover info example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+

Popover warning example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+

Popover danger example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+
+
+

Popover custom example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+

Another custom popover

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+
+

Dinamic examples

+
+ + + + + +
+
+ + +
+
+
+ + + + + + + diff --git a/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.css b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.css new file mode 100644 index 0000000..05872bd --- /dev/null +++ b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.css @@ -0,0 +1,33 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-title { + background: #337ab7; + color: #fff; +} + +.popover-success .popover-title { + background: #5cb85c; + color: #fff; +} + +.popover-info .popover-title { + background: #5bc0de; + color: #fff; +} + +.popover-warning .popover-title { + background: #f0ad4e; + color: #fff; +} + +.popover-danger .popover-title { + background: #d9534f; + color: #fff; +} diff --git a/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css new file mode 100644 index 0000000..0c7e669 --- /dev/null +++ b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css @@ -0,0 +1,12 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-title{background:#337ab7;color:#fff}.popover-success .popover-title{background:#5cb85c;color:#fff}.popover-info .popover-title{background:#5bc0de;color:#fff}.popover-warning .popover-title{background:#f0ad4e;color:#fff}.popover-danger .popover-title{background:#d9534f;color:#fff} + +/*# sourceMappingURL=bootstrap-popover-custom-class.min.css.map */ \ No newline at end of file diff --git a/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css.map b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css.map new file mode 100644 index 0000000..7aa1294 --- /dev/null +++ b/bootstrap-v3/popover/dist/css/bootstrap-popover-custom-class.min.css.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "bootstrap-popover-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss", + "../../src/scss/bootstrap-popover-custom-class.scss", + "../../src/scss/_variables.scss", + "../../src/scss/_mixin.scss", + "../../src/scss/_popovers.scss" + ], + "names": [], + "mappings": "AKIA,ADCE,gBCDc,CDCd,cAAc,AAAC,CACb,UAAU,CHWU,OAAqB,CGVzC,KAAK,CDQyB,IAAI,CCPnC,ACAH,ADHE,gBCGc,CDHd,cAAc,AAAC,CACb,UAAU,CHYU,OAAO,CGX3B,KAAK,CDQyB,IAAI,CCPnC,ACIH,ADPE,aCOW,CDPX,cAAc,AAAC,CACb,UAAU,CHaU,OAAO,CGZ3B,KAAK,CDQyB,IAAI,CCPnC,ACQH,ADXE,gBCWc,CDXd,cAAc,AAAC,CACb,UAAU,CHcU,OAAO,CGb3B,KAAK,CDQyB,IAAI,CCPnC,ACYH,ADfE,eCea,CDfb,cAAc,AAAC,CACb,UAAU,CHeU,OAAO,CGd3B,KAAK,CDQyB,IAAI,CCPnC" +} \ No newline at end of file diff --git a/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.js b/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..72a5db9 --- /dev/null +++ b/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.js @@ -0,0 +1,34 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +(function ($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend(Popover.DEFAULTS, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if (this.options.customClass) { + var $tip = this.tip(); + $tip.addClass(this.options.customClass); + } + }; + +})(window.jQuery); diff --git a/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.min.js b/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.min.js new file mode 100644 index 0000000..0389238 --- /dev/null +++ b/bootstrap-v3/popover/dist/js/bootstrap-popover-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(o){if(!o.fn.popover)throw new Error("Bootstrap Popover must be included first!");var t=o.fn.popover.Constructor;o.extend(t.DEFAULTS,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){s.apply(this),this.options.customClass&&this.tip().addClass(this.options.customClass)}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v3/popover/src/js/bootstrap-popover-custom-class.js b/bootstrap-v3/popover/src/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..c568dd0 --- /dev/null +++ b/bootstrap-v3/popover/src/js/bootstrap-popover-custom-class.js @@ -0,0 +1,25 @@ +(function ($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend(Popover.DEFAULTS, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if (this.options.customClass) { + var $tip = this.tip(); + $tip.addClass(this.options.customClass); + } + }; + +})(window.jQuery); diff --git a/bootstrap-v3/popover/src/less/bootstrap-popover-custom-class.less b/bootstrap-v3/popover/src/less/bootstrap-popover-custom-class.less new file mode 100644 index 0000000..1bd274f --- /dev/null +++ b/bootstrap-v3/popover/src/less/bootstrap-popover-custom-class.less @@ -0,0 +1,3 @@ +@import "variables.less"; +@import "mixin.less"; +@import "popovers.less"; diff --git a/bootstrap-v3/popover/src/less/main.less b/bootstrap-v3/popover/src/less/main.less new file mode 100644 index 0000000..0d73ad1 --- /dev/null +++ b/bootstrap-v3/popover/src/less/main.less @@ -0,0 +1,2 @@ +@import "../../../node_modules/bootstrap/less/variables.less"; +@import "bootstrap-popover-custom-class.less"; diff --git a/bootstrap-v3/popover/src/less/mixin.less b/bootstrap-v3/popover/src/less/mixin.less new file mode 100644 index 0000000..bbcf634 --- /dev/null +++ b/bootstrap-v3/popover/src/less/mixin.less @@ -0,0 +1,10 @@ +//== Popover Custom Mixin +// +//## + +.popover-custom(@title-bg, @title-color) { + .popover-title { + background: @title-bg; + color: @title-color; + } +} diff --git a/bootstrap-v3/popover/src/less/popovers.less b/bootstrap-v3/popover/src/less/popovers.less new file mode 100644 index 0000000..dd6ef31 --- /dev/null +++ b/bootstrap-v3/popover/src/less/popovers.less @@ -0,0 +1,23 @@ +//== Styles for predefined Popover Custom Classes +// +//## + +.popover-primary { + .popover-custom(@popover-primary-title-bg, @popover-custom-title-color); +} + +.popover-success { + .popover-custom(@popover-success-title-bg, @popover-custom-title-color); +} + +.popover-info { + .popover-custom(@popover-info-title-bg, @popover-custom-title-color); +} + +.popover-warning { + .popover-custom(@popover-warning-title-bg, @popover-custom-title-color); +} + +.popover-danger { + .popover-custom(@popover-danger-title-bg, @popover-custom-title-color); +} diff --git a/bootstrap-v3/popover/src/less/variables.less b/bootstrap-v3/popover/src/less/variables.less new file mode 100644 index 0000000..5f78e9c --- /dev/null +++ b/bootstrap-v3/popover/src/less/variables.less @@ -0,0 +1,16 @@ +//== Define Bootstrap variables for Popover +// +//## + +// Popover primary background color +@popover-primary-title-bg: @brand-primary; +// Popover success background color +@popover-success-title-bg: @brand-success; +// Popover info background color +@popover-info-title-bg: @brand-info; +// Popover warning background color +@popover-warning-title-bg: @brand-warning; +// Popover danger background color +@popover-danger-title-bg: @brand-danger; + +@popover-custom-title-color: #fff; diff --git a/bootstrap-v3/popover/src/scss/_mixin.scss b/bootstrap-v3/popover/src/scss/_mixin.scss new file mode 100644 index 0000000..5a91603 --- /dev/null +++ b/bootstrap-v3/popover/src/scss/_mixin.scss @@ -0,0 +1,10 @@ +//== Popover Custom Mixin +// +//## + +@mixin popover-custom($title-bg, $title-color) { + .popover-title { + background: $title-bg; + color: $title-color; + } +} diff --git a/bootstrap-v3/popover/src/scss/_popovers.scss b/bootstrap-v3/popover/src/scss/_popovers.scss new file mode 100644 index 0000000..f0ae5a0 --- /dev/null +++ b/bootstrap-v3/popover/src/scss/_popovers.scss @@ -0,0 +1,23 @@ +//== Styles for predefined Popover Custom Classes +// +//## + +.popover-primary { + @include popover-custom($popover-primary-title-bg, $popover-custom-title-color); +} + +.popover-success { + @include popover-custom($popover-success-title-bg, $popover-custom-title-color); +} + +.popover-info { + @include popover-custom($popover-info-title-bg, $popover-custom-title-color); +} + +.popover-warning { + @include popover-custom($popover-warning-title-bg, $popover-custom-title-color); +} + +.popover-danger { + @include popover-custom($popover-danger-title-bg, $popover-custom-title-color); +} diff --git a/bootstrap-v3/popover/src/scss/_variables.scss b/bootstrap-v3/popover/src/scss/_variables.scss new file mode 100644 index 0000000..8f33c95 --- /dev/null +++ b/bootstrap-v3/popover/src/scss/_variables.scss @@ -0,0 +1,16 @@ +//== Define Bootstrap variables for Popovers +// +//## + +// Popover primary background color +$popover-primary-title-bg: $brand-primary !default; +// Popover success background color +$popover-success-title-bg: $brand-success !default; +// Popover info background color +$popover-info-title-bg: $brand-info !default; +// Popover warning background color +$popover-warning-title-bg: $brand-warning !default; +// Popover danger background color +$popover-danger-title-bg: $brand-danger !default; + +$popover-custom-title-color: #fff !default; diff --git a/bootstrap-v3/popover/src/scss/bootstrap-popover-custom-class.scss b/bootstrap-v3/popover/src/scss/bootstrap-popover-custom-class.scss new file mode 100644 index 0000000..12c029f --- /dev/null +++ b/bootstrap-v3/popover/src/scss/bootstrap-popover-custom-class.scss @@ -0,0 +1,3 @@ +@import "variables"; +@import "mixin"; +@import "popovers"; diff --git a/bootstrap-v3/popover/src/scss/main.scss b/bootstrap-v3/popover/src/scss/main.scss new file mode 100644 index 0000000..66c9146 --- /dev/null +++ b/bootstrap-v3/popover/src/scss/main.scss @@ -0,0 +1,2 @@ +@import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; +@import "bootstrap-popover-custom-class"; diff --git a/bootstrap-v3/src/less/main.less b/bootstrap-v3/src/less/main.less deleted file mode 100644 index 5a99e8b..0000000 --- a/bootstrap-v3/src/less/main.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../node_modules/bootstrap/less/variables.less"; -@import "bootstrap-tooltip-custom-class.less"; diff --git a/bootstrap-v3/src/scss/main.scss b/bootstrap-v3/src/scss/main.scss deleted file mode 100644 index 13215d7..0000000 --- a/bootstrap-v3/src/scss/main.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; -@import "bootstrap-tooltip-custom-class"; diff --git a/bootstrap-v3/demo/demo.css b/bootstrap-v3/tooltip/demo/demo.css similarity index 100% rename from bootstrap-v3/demo/demo.css rename to bootstrap-v3/tooltip/demo/demo.css diff --git a/bootstrap-v3/demo/demo.js b/bootstrap-v3/tooltip/demo/demo.js similarity index 100% rename from bootstrap-v3/demo/demo.js rename to bootstrap-v3/tooltip/demo/demo.js diff --git a/bootstrap-v3/demo/demo.scss b/bootstrap-v3/tooltip/demo/demo.scss similarity index 91% rename from bootstrap-v3/demo/demo.scss rename to bootstrap-v3/tooltip/demo/demo.scss index 9ee5b85..bfa518a 100644 --- a/bootstrap-v3/demo/demo.scss +++ b/bootstrap-v3/tooltip/demo/demo.scss @@ -1,4 +1,4 @@ -@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; +@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; @import "../src/scss/bootstrap-tooltip-custom-class"; .tooltip-custom { diff --git a/bootstrap-v3/demo/index.html b/bootstrap-v3/tooltip/demo/index.html similarity index 92% rename from bootstrap-v3/demo/index.html rename to bootstrap-v3/tooltip/demo/index.html index 027f6ce..d44c995 100644 --- a/bootstrap-v3/demo/index.html +++ b/bootstrap-v3/tooltip/demo/index.html @@ -6,7 +6,7 @@ - + @@ -80,9 +80,9 @@

Dinamic examples

- - - + + + diff --git a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.css b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.css similarity index 90% rename from bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.css rename to bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.css index d7d66bb..50da8f6 100644 --- a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.css +++ b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css similarity index 89% rename from bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css rename to bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css index de92eeb..134480f 100644 --- a/bootstrap-v3/dist/css/bootstrap-tooltip-custom-class.min.css +++ b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map new file mode 100644 index 0000000..b652ec3 --- /dev/null +++ b/bootstrap-v3/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "bootstrap-tooltip-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss", + "../../src/scss/bootstrap-tooltip-custom-class.scss", + "../../src/scss/_variables.scss", + "../../src/scss/_mixin.scss", + "../../src/scss/_tooltips.scss" + ], + "names": [], + "mappings": "AKIA,ADEE,gBCFc,CDEd,cAAc,AAAC,CACb,gBAAgB,CHUI,OAAqB,CGTzC,KAAK,CHugBqB,IAAI,CGtgB/B,ACLH,ADOE,gBCPc,ADOb,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHKI,OAAqB,CGJ1C,ACTH,ADWE,gBCXc,ADWb,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHCE,OAAqB,CGA1C,ACbH,ADeE,gBCfc,ADeb,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHHG,OAAqB,CGI1C,ACjBH,ADmBE,gBCnBc,ADmBb,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHPC,OAAqB,CGQ1C,ACjBH,ADFE,gBCEc,CDFd,cAAc,AAAC,CACb,gBAAgB,CHWI,OAAO,CGV3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACDH,ADGE,gBCHc,ADGb,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHMI,OAAO,CGL5B,ACLH,ADOE,gBCPc,ADOb,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHEE,OAAO,CGD5B,ACTH,ADWE,gBCXc,ADWb,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHFG,OAAO,CGG5B,ACbH,ADeE,gBCfc,ADeb,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHNC,OAAO,CGO5B,ACbH,ADNE,aCMW,CDNX,cAAc,AAAC,CACb,gBAAgB,CHYI,OAAO,CGX3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACGH,ADDE,aCCW,ADDV,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHOI,OAAO,CGN5B,ACDH,ADGE,aCHW,ADGV,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHGE,OAAO,CGF5B,ACLH,ADOE,aCPW,ADOV,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHDG,OAAO,CGE5B,ACTH,ADWE,aCXW,ADWV,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHLC,OAAO,CGM5B,ACTH,ADVE,gBCUc,CDVd,cAAc,AAAC,CACb,gBAAgB,CHaI,OAAO,CGZ3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACOH,ADLE,gBCKc,ADLb,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHQI,OAAO,CGP5B,ACGH,ADDE,gBCCc,ADDb,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHIE,OAAO,CGH5B,ACDH,ADGE,gBCHc,ADGb,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHAG,OAAO,CGC5B,ACLH,ADOE,gBCPc,ADOb,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHJC,OAAO,CGK5B,ACLH,ADdE,eCca,CDdb,cAAc,AAAC,CACb,gBAAgB,CHcI,OAAO,CGb3B,KAAK,CHugBqB,IAAI,CGtgB/B,ACWH,ADTE,eCSa,ADTZ,IAAI,CAAC,cAAc,AAAC,CACnB,gBAAgB,CHSI,OAAO,CGR5B,ACOH,ADLE,eCKa,ADLZ,MAAM,CAAC,cAAc,AAAC,CACrB,kBAAkB,CHKE,OAAO,CGJ5B,ACGH,ADDE,eCCa,ADDZ,KAAK,CAAC,cAAc,AAAC,CACpB,iBAAiB,CHCG,OAAO,CGA5B,ACDH,ADGE,eCHa,ADGZ,OAAO,CAAC,cAAc,AAAC,CACtB,mBAAmB,CHHC,OAAO,CGI5B" +} \ No newline at end of file diff --git a/bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.js b/bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.js similarity index 69% rename from bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.js index d25f33e..4741afb 100644 --- a/bootstrap-v3/dist/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.js @@ -1,15 +1,15 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ (function ($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js new file mode 100644 index 0000000..6c046ed --- /dev/null +++ b/bootstrap-v3/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(t){if(!t.fn.tooltip)throw new Error("Bootstrap Tooltip must be included first!");var o=t.fn.tooltip.Constructor;t.extend(o.DEFAULTS,{customClass:""});var s=o.prototype.show;o.prototype.show=function(){s.apply(this),this.options.customClass&&this.tip().addClass(this.options.customClass)}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v3/src/js/bootstrap-tooltip-custom-class.js b/bootstrap-v3/tooltip/src/js/bootstrap-tooltip-custom-class.js similarity index 89% rename from bootstrap-v3/src/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v3/tooltip/src/js/bootstrap-tooltip-custom-class.js index 96652bf..a15339f 100644 --- a/bootstrap-v3/src/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v3/tooltip/src/js/bootstrap-tooltip-custom-class.js @@ -1,6 +1,6 @@ (function ($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v3/src/less/bootstrap-tooltip-custom-class.less b/bootstrap-v3/tooltip/src/less/bootstrap-tooltip-custom-class.less similarity index 100% rename from bootstrap-v3/src/less/bootstrap-tooltip-custom-class.less rename to bootstrap-v3/tooltip/src/less/bootstrap-tooltip-custom-class.less diff --git a/bootstrap-v3/tooltip/src/less/main.less b/bootstrap-v3/tooltip/src/less/main.less new file mode 100644 index 0000000..ec80b46 --- /dev/null +++ b/bootstrap-v3/tooltip/src/less/main.less @@ -0,0 +1,2 @@ +@import "../../../node_modules/bootstrap/less/variables.less"; +@import "bootstrap-tooltip-custom-class.less"; diff --git a/bootstrap-v3/src/less/mixin.less b/bootstrap-v3/tooltip/src/less/mixin.less similarity index 100% rename from bootstrap-v3/src/less/mixin.less rename to bootstrap-v3/tooltip/src/less/mixin.less diff --git a/bootstrap-v3/src/less/tooltips.less b/bootstrap-v3/tooltip/src/less/tooltips.less similarity index 100% rename from bootstrap-v3/src/less/tooltips.less rename to bootstrap-v3/tooltip/src/less/tooltips.less diff --git a/bootstrap-v3/src/less/variables.less b/bootstrap-v3/tooltip/src/less/variables.less similarity index 99% rename from bootstrap-v3/src/less/variables.less rename to bootstrap-v3/tooltip/src/less/variables.less index 98930d5..360ca4b 100644 --- a/bootstrap-v3/src/less/variables.less +++ b/bootstrap-v3/tooltip/src/less/variables.less @@ -2,7 +2,6 @@ // //## -// // Tooltip primary background color @tooltip-primary-bg: @brand-primary; // Tooltip success background color diff --git a/bootstrap-v3/src/scss/_mixin.scss b/bootstrap-v3/tooltip/src/scss/_mixin.scss similarity index 100% rename from bootstrap-v3/src/scss/_mixin.scss rename to bootstrap-v3/tooltip/src/scss/_mixin.scss diff --git a/bootstrap-v4-alpha/src/scss/_tooltips.scss b/bootstrap-v3/tooltip/src/scss/_tooltips.scss similarity index 99% rename from bootstrap-v4-alpha/src/scss/_tooltips.scss rename to bootstrap-v3/tooltip/src/scss/_tooltips.scss index db6cb4b..12baf6e 100644 --- a/bootstrap-v4-alpha/src/scss/_tooltips.scss +++ b/bootstrap-v3/tooltip/src/scss/_tooltips.scss @@ -1,6 +1,7 @@ //== Styles for predefined Tooltip Custom Classes // //## + .tooltip-primary { @include tooltip-custom($tooltip-primary-bg, $tooltip-color); } diff --git a/bootstrap-v4-alpha/src/scss/_variables.scss b/bootstrap-v3/tooltip/src/scss/_variables.scss similarity index 100% rename from bootstrap-v4-alpha/src/scss/_variables.scss rename to bootstrap-v3/tooltip/src/scss/_variables.scss diff --git a/bootstrap-v3/src/scss/bootstrap-tooltip-custom-class.scss b/bootstrap-v3/tooltip/src/scss/bootstrap-tooltip-custom-class.scss similarity index 100% rename from bootstrap-v3/src/scss/bootstrap-tooltip-custom-class.scss rename to bootstrap-v3/tooltip/src/scss/bootstrap-tooltip-custom-class.scss diff --git a/bootstrap-v3/tooltip/src/scss/main.scss b/bootstrap-v3/tooltip/src/scss/main.scss new file mode 100644 index 0000000..cac832c --- /dev/null +++ b/bootstrap-v3/tooltip/src/scss/main.scss @@ -0,0 +1,2 @@ +@import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables"; +@import "bootstrap-tooltip-custom-class"; diff --git a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css.map deleted file mode 100644 index 9a6800d..0000000 --- a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css.map +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": 3, - "file": "bootstrap-tooltip-custom-class.min.css", - "sources": [ - "../../src/scss/main.scss", - "../../node_modules/bootstrap/scss/_variables.scss", - "../../src/scss/bootstrap-tooltip-custom-class.scss", - "../../src/scss/_variables.scss", - "../../src/scss/_mixin.scss", - "../../src/scss/_tooltips.scss" - ], - "names": [], - "mappings": "AKGA,ADEE,gBCFc,CDEd,cAAc,AAAC,CACb,gBAAgB,CH8FX,OAAO,CG7FZ,KAAK,CHuFA,IAAI,CGtFV,ACLH,ADSI,gBCTY,ADOb,YAAY,CAEX,cAAc,AAAA,QAAQ,CCT1B,gBAAgB,ADQb,kCAAkC,CACjC,cAAc,AAAA,QAAQ,AAAC,CACrB,gBAAgB,CHuFb,OAAO,CGtFX,ACXL,ADgBI,gBChBY,ADcb,cAAc,CAEb,cAAc,AAAA,QAAQ,CChB1B,gBAAgB,ADeb,gCAAgC,CAC/B,cAAc,AAAA,QAAQ,AAAC,CACrB,kBAAkB,CHgFf,OAAO,CG/EX,AClBL,ADuBI,gBCvBY,ADqBb,eAAe,CAEd,cAAc,AAAA,QAAQ,CCvB1B,gBAAgB,ADsBb,+BAA+B,CAC9B,cAAc,AAAA,QAAQ,AAAC,CACrB,mBAAmB,CHyEhB,OAAO,CGxEX,ACzBL,AD8BI,gBC9BY,AD4Bb,aAAa,CAEZ,cAAc,AAAA,QAAQ,CC9B1B,gBAAgB,AD6Bb,iCAAiC,CAChC,cAAc,AAAA,QAAQ,AAAC,CACrB,iBAAiB,CHkEd,OAAO,CGjEX,AC5BL,ADFE,gBCEc,CDFd,cAAc,AAAC,CACb,gBAAgB,CH6FX,OAAO,CG5FZ,KAAK,CHuFA,IAAI,CGtFV,ACDH,ADKI,gBCLY,ADGb,YAAY,CAEX,cAAc,AAAA,QAAQ,CCL1B,gBAAgB,ADIb,kCAAkC,CACjC,cAAc,AAAA,QAAQ,AAAC,CACrB,gBAAgB,CHsFb,OAAO,CGrFX,ACPL,ADYI,gBCZY,ADUb,cAAc,CAEb,cAAc,AAAA,QAAQ,CCZ1B,gBAAgB,ADWb,gCAAgC,CAC/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cAAc,AAAA,QAAQ,AAAC,CACrB,iBAAiB,CH8Dd,OAAO,CG7DX" -} \ No newline at end of file diff --git a/bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.min.js deleted file mode 100644 index a25b0b5..0000000 --- a/bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * bootstrap-tooltip-custom-class - * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme - * License: MIT - */ - - -!function(o){if(void 0===o.fn.tooltip.Constructor)throw new Error("Bootstrap Tooltip must be included first!");var t=o.fn.tooltip.Constructor;o.extend(t.Default,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){if(s.apply(this),this.config.customClass){var t=this.getTipElement();o(t).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4-alpha/package.json b/bootstrap-v4-alpha/package.json index 48cca4d..db1bd28 100644 --- a/bootstrap-v4-alpha/package.json +++ b/bootstrap-v4-alpha/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-tooltip-custom-class", - "description": "Extend Bootstrap Tooltip plugin by adding custom classes. For Bootstrap v4.0.0-alpha.", + "description": "Extends Bootstrap Tooltips and Popovers by adding custom classes. For Bootstrap v4.0.0-alpha.", "repository": { "type": "git", "url": "git+https://github.com/andreivictor/bootstrap-tooltip-custom-class.git" diff --git a/bootstrap-v4-alpha/popover/demo/demo.css b/bootstrap-v4-alpha/popover/demo/demo.css new file mode 100644 index 0000000..cb48fd9 --- /dev/null +++ b/bootstrap-v4-alpha/popover/demo/demo.css @@ -0,0 +1,87 @@ +.popover-primary .popover-title { + background-color: #0275d8; + color: #fff; +} + +.popover-success .popover-title { + background-color: #5cb85c; + color: #fff; +} + +.popover-info .popover-title { + background-color: #5bc0de; + color: #fff; +} + +.popover-warning .popover-title { + background-color: #f0ad4e; + color: #fff; +} + +.popover-danger .popover-title { + background-color: #d9534f; + color: #fff; +} + +.popover-custom .popover-title { + background-color: #f2653c; + color: #ffffff; +} + +.popover-custom-alt .popover-title { + background-color: #5b2da3; + color: #ffffff; +} + +body { + padding-top: 4.5rem; +} + +#topnav { + padding-left: 0; + padding-right: 0; + z-index: 1071; +} + +#topnav > .container { + display: flex; + align-items: center; +} + +@media (max-width: 575px) { + #topnav > .container { + width: 100%; + } +} + +#topnav .nav-link > i { + font-size: 26px; +} + +@media (max-width: 390px) { + #topnav .navbar-brand { + font-size: 1rem; + } +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} + +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + display: inline-block; + position: relative; + margin: 10px 20px; +} diff --git a/bootstrap-v4-alpha/popover/demo/demo.js b/bootstrap-v4-alpha/popover/demo/demo.js new file mode 100644 index 0000000..c88c583 --- /dev/null +++ b/bootstrap-v4-alpha/popover/demo/demo.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + $('.btn-secondary').popover(); + $('.btn-custom').popover({ + customClass: 'popover-custom' + }); + $('.btn-custom-alt').popover({ + customClass: 'popover-custom-alt' + }); +}); diff --git a/bootstrap-v4-alpha/popover/demo/demo.scss b/bootstrap-v4-alpha/popover/demo/demo.scss new file mode 100644 index 0000000..7d42784 --- /dev/null +++ b/bootstrap-v4-alpha/popover/demo/demo.scss @@ -0,0 +1,64 @@ +@import "../../node_modules/bootstrap/scss/variables"; +@import "../../node_modules/bootstrap/scss/mixins"; +@import "../src/scss/bootstrap-popover-custom-class"; + +.popover-custom { + @include popover-custom(#f2653c, #ffffff); +} + +.popover-custom-alt { + @include popover-custom(#5b2da3, #ffffff); +} + +//== Demo layout +// +//## +body { + padding-top: 4.5rem; +} + +#topnav { + padding-left: 0; + padding-right: 0; + z-index: ($zindex-tooltip + 1); + + > .container { + display: flex; + align-items: center; + + @include media-breakpoint-down('xs') { + width: 100%; + } + } + + .nav-link > i { + font-size: 26px; + } + + @media (max-width: 390px) { + .navbar-brand { + font-size: $font-size-base; + } + } +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + display: inline-block; + position: relative; + margin: 10px 20px; +} diff --git a/bootstrap-v4-alpha/popover/demo/index.html b/bootstrap-v4-alpha/popover/demo/index.html new file mode 100644 index 0000000..ec3511f --- /dev/null +++ b/bootstrap-v4-alpha/popover/demo/index.html @@ -0,0 +1,102 @@ + + + + + Bootstrap v4-alpha Popover Custom Classes + + + + + + + + + + + +
+
+

Static examples

+
+
+

Popover primary example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+

Popover success example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+

Popover info example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+

Popover warning example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+

Popover danger example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+
+

Custom popover example

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+

Another custom popover

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+
+
+ +
+

Dinamic examples

+
+ + + + + +
+
+ + +
+
+
+ + + + + + + + + diff --git a/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.css b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.css new file mode 100644 index 0000000..94f801c --- /dev/null +++ b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.css @@ -0,0 +1,33 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-title { + background-color: #0275d8; + color: #fff; +} + +.popover-success .popover-title { + background-color: #5cb85c; + color: #fff; +} + +.popover-info .popover-title { + background-color: #5bc0de; + color: #fff; +} + +.popover-warning .popover-title { + background-color: #f0ad4e; + color: #fff; +} + +.popover-danger .popover-title { + background-color: #d9534f; + color: #fff; +} diff --git a/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css new file mode 100644 index 0000000..2ae8c63 --- /dev/null +++ b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css @@ -0,0 +1,12 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-title{background-color:#0275d8;color:#fff}.popover-success .popover-title{background-color:#5cb85c;color:#fff}.popover-info .popover-title{background-color:#5bc0de;color:#fff}.popover-warning .popover-title{background-color:#f0ad4e;color:#fff}.popover-danger .popover-title{background-color:#d9534f;color:#fff} + +/*# sourceMappingURL=bootstrap-popover-custom-class.min.css.map */ \ No newline at end of file diff --git a/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css.map b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css.map new file mode 100644 index 0000000..8708269 --- /dev/null +++ b/bootstrap-v4-alpha/popover/dist/css/bootstrap-popover-custom-class.min.css.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "bootstrap-popover-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap/scss/_variables.scss", + "../../src/scss/bootstrap-popover-custom-class.scss", + "../../src/scss/_variables.scss", + "../../src/scss/_mixin.scss", + "../../src/scss/_popovers.scss" + ], + "names": [], + "mappings": "AKIA,ADCE,gBCDc,CDCd,cAAc,AAAC,CACb,gBAAgB,CH8FX,OAAO,CG7FZ,KAAK,CDQ+B,IAAI,CCPzC,ACAH,ADHE,gBCGc,CDHd,cAAc,AAAC,CACb,gBAAgB,CH6FX,OAAO,CG5FZ,KAAK,CDQ+B,IAAI,CCPzC,ACIH,ADPE,aCOW,CDPX,cAAc,AAAC,CACb,gBAAgB,CH+FX,OAAO,CG9FZ,KAAK,CDQ+B,IAAI,CCPzC,ACQH,ADXE,gBCWc,CDXd,cAAc,AAAC,CACb,gBAAgB,CH2FX,OAAO,CG1FZ,KAAK,CDQ+B,IAAI,CCPzC,ACYH,ADfE,eCea,CDfb,cAAc,AAAC,CACb,gBAAgB,CH0FX,OAAO,CGzFZ,KAAK,CDQ+B,IAAI,CCPzC" +} \ No newline at end of file diff --git a/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.js b/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..37395dc --- /dev/null +++ b/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.js @@ -0,0 +1,35 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +(function($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend(Popover.Default, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if (this.config.customClass) { + var tip = this.getTipElement(); + $(tip).addClass(this.config.customClass); + } + + }; + +})(window.jQuery); diff --git a/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.min.js b/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.min.js new file mode 100644 index 0000000..c3cfe22 --- /dev/null +++ b/bootstrap-v4-alpha/popover/dist/js/bootstrap-popover-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(t){if(!t.fn.popover)throw new Error("Bootstrap Popover must be included first!");var o=t.fn.popover.Constructor;t.extend(o.Default,{customClass:""});var s=o.prototype.show;o.prototype.show=function(){if(s.apply(this),this.config.customClass){var o=this.getTipElement();t(o).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4-alpha/popover/src/js/bootstrap-popover-custom-class.js b/bootstrap-v4-alpha/popover/src/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..618cc16 --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/js/bootstrap-popover-custom-class.js @@ -0,0 +1,26 @@ +(function($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend(Popover.Default, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if (this.config.customClass) { + var tip = this.getTipElement(); + $(tip).addClass(this.config.customClass); + } + + }; + +})(window.jQuery); diff --git a/bootstrap-v4-alpha/popover/src/scss/_mixin.scss b/bootstrap-v4-alpha/popover/src/scss/_mixin.scss new file mode 100644 index 0000000..f15cb02 --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/scss/_mixin.scss @@ -0,0 +1,10 @@ +//== Popover Custom Mixin +// +//## + +@mixin popover-custom($title-bg, $title-color) { + .popover-title { + background-color: $title-bg; + color: $title-color; + } +} diff --git a/bootstrap-v4-alpha/popover/src/scss/_popovers.scss b/bootstrap-v4-alpha/popover/src/scss/_popovers.scss new file mode 100644 index 0000000..f0ae5a0 --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/scss/_popovers.scss @@ -0,0 +1,23 @@ +//== Styles for predefined Popover Custom Classes +// +//## + +.popover-primary { + @include popover-custom($popover-primary-title-bg, $popover-custom-title-color); +} + +.popover-success { + @include popover-custom($popover-success-title-bg, $popover-custom-title-color); +} + +.popover-info { + @include popover-custom($popover-info-title-bg, $popover-custom-title-color); +} + +.popover-warning { + @include popover-custom($popover-warning-title-bg, $popover-custom-title-color); +} + +.popover-danger { + @include popover-custom($popover-danger-title-bg, $popover-custom-title-color); +} diff --git a/bootstrap-v4-alpha/popover/src/scss/_variables.scss b/bootstrap-v4-alpha/popover/src/scss/_variables.scss new file mode 100644 index 0000000..ea87d6f --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/scss/_variables.scss @@ -0,0 +1,16 @@ +//== Define Bootstrap variables for Popover +// +//## + +// Popover primary background color +$popover-primary-title-bg: $brand-primary !default; +// Popover success background color +$popover-success-title-bg: $brand-success !default; +// Popover info background color +$popover-info-title-bg: $brand-info !default; +// Popover warning background color +$popover-warning-title-bg: $brand-warning !default; +// Popover danger background color +$popover-danger-title-bg: $brand-danger !default; + +$popover-custom-title-color: #fff !default; diff --git a/bootstrap-v4-alpha/popover/src/scss/bootstrap-popover-custom-class.scss b/bootstrap-v4-alpha/popover/src/scss/bootstrap-popover-custom-class.scss new file mode 100644 index 0000000..12c029f --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/scss/bootstrap-popover-custom-class.scss @@ -0,0 +1,3 @@ +@import "variables"; +@import "mixin"; +@import "popovers"; diff --git a/bootstrap-v4-alpha/popover/src/scss/main.scss b/bootstrap-v4-alpha/popover/src/scss/main.scss new file mode 100644 index 0000000..647aef5 --- /dev/null +++ b/bootstrap-v4-alpha/popover/src/scss/main.scss @@ -0,0 +1,2 @@ +@import "../../../node_modules/bootstrap/scss/variables"; +@import "bootstrap-popover-custom-class"; diff --git a/bootstrap-v4-alpha/src/scss/main.scss b/bootstrap-v4-alpha/src/scss/main.scss deleted file mode 100644 index 408180d..0000000 --- a/bootstrap-v4-alpha/src/scss/main.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import "../../node_modules/bootstrap/scss/variables"; - -@import "bootstrap-tooltip-custom-class"; diff --git a/bootstrap-v4-alpha/demo/demo.css b/bootstrap-v4-alpha/tooltip/demo/demo.css similarity index 100% rename from bootstrap-v4-alpha/demo/demo.css rename to bootstrap-v4-alpha/tooltip/demo/demo.css diff --git a/bootstrap-v4-alpha/demo/demo.js b/bootstrap-v4-alpha/tooltip/demo/demo.js similarity index 100% rename from bootstrap-v4-alpha/demo/demo.js rename to bootstrap-v4-alpha/tooltip/demo/demo.js diff --git a/bootstrap-v4-alpha/demo/demo.scss b/bootstrap-v4-alpha/tooltip/demo/demo.scss similarity index 89% rename from bootstrap-v4-alpha/demo/demo.scss rename to bootstrap-v4-alpha/tooltip/demo/demo.scss index 8cb5615..31f8175 100644 --- a/bootstrap-v4-alpha/demo/demo.scss +++ b/bootstrap-v4-alpha/tooltip/demo/demo.scss @@ -1,5 +1,5 @@ -@import "../node_modules/bootstrap/scss/variables"; -@import "../node_modules/bootstrap/scss/mixins"; +@import "../../node_modules/bootstrap/scss/variables"; +@import "../../node_modules/bootstrap/scss/mixins"; @import "../src/scss/bootstrap-tooltip-custom-class"; .tooltip-custom { diff --git a/bootstrap-v4-alpha/demo/index.html b/bootstrap-v4-alpha/tooltip/demo/index.html similarity index 92% rename from bootstrap-v4-alpha/demo/index.html rename to bootstrap-v4-alpha/tooltip/demo/index.html index 37f59e7..3d1a31d 100644 --- a/bootstrap-v4-alpha/demo/index.html +++ b/bootstrap-v4-alpha/tooltip/demo/index.html @@ -6,7 +6,7 @@ - + @@ -71,9 +71,9 @@

Dinamic examples

- - - + + + diff --git a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.css b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.css similarity index 94% rename from bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.css rename to bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.css index 11e5e75..742fa7e 100644 --- a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.css +++ b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css similarity index 94% rename from bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css rename to bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css index 7782da6..f1047ad 100644 --- a/bootstrap-v4-alpha/dist/css/bootstrap-tooltip-custom-class.min.css +++ b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map new file mode 100644 index 0000000..9a7b613 --- /dev/null +++ b/bootstrap-v4-alpha/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "bootstrap-tooltip-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap/scss/_variables.scss", + "../../src/scss/bootstrap-tooltip-custom-class.scss", + "../../src/scss/_variables.scss", + "../../src/scss/_mixin.scss", + "../../src/scss/_tooltips.scss" + ], + "names": [], + "mappings": "AKIA,ADEE,gBCFc,CDEd,cAAc,AAAC,CACb,gBAAgB,CH6FX,OAAO,CG5FZ,KAAK,CHsFA,IAAI,CGrFV,ACLH,ADSI,gBCTY,ADOb,YAAY,CAEX,cAAc,AAAA,QAAQ,CCT1B,gBAAgB,ADQb,kCAAkC,CACjC,cAAc,AAAA,QAAQ,AAAC,CACrB,gBAAgB,CHsFb,OAAO,CGrFX,ACXL,ADgBI,gBChBY,ADcb,cAAc,CAEb,cAAc,AAAA,QAAQ,CChB1B,gBAAgB,ADeb,gCAAgC,CAC/B,cAAc,AAAA,QAAQ,AAAC,CACrB,kBAAkB,CH+Ef,OAAO,CG9EX,AClBL,ADuBI,gBCvBY,ADqBb,eAAe,CAEd,cAAc,AAAA,QAAQ,CCvB1B,gBAAgB,ADsBb,+BAA+B,CAC9B,cAAc,AAAA,QAAQ,AAAC,CACrB,mBAAmB,CHwEhB,OAAO,CGvEX,ACzBL,AD8BI,gBC9BY,AD4Bb,aAAa,CAEZ,cAAc,AAAA,QA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,QAAQ,AAAC,CACrB,gBAAgB,CHkFb,OAAO,CGjFX,ACKL,ADAI,eCAW,ADFZ,cAAc,CAEb,cAAc,AAAA,QAAQ,CCA1B,eAAe,ADDZ,gCAAgC,CAC/B,cAAc,AAAA,QAAQ,AAAC,CACrB,kBAAkB,CH2Ef,OAAO,CG1EX,ACFL,ADOI,eCPW,ADKZ,eAAe,CAEd,cAAc,AAAA,QAAQ,CCP1B,eAAe,ADMZ,+BAA+B,CAC9B,cAAc,AAAA,QAAQ,AAAC,CACrB,mBAAmB,CHoEhB,OAAO,CGnEX,ACTL,ADcI,eCdW,ADYZ,aAAa,CAEZ,cAAc,AAAA,QAAQ,CCd1B,eAAe,ADaZ,iCAAiC,CAChC,cAAc,AAAA,QAAQ,AAAC,CACrB,iBAAiB,CH6Dd,OAAO,CG5DX" +} \ No newline at end of file diff --git a/bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.js b/bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.js similarity index 70% rename from bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.js index f932631..2a69696 100644 --- a/bootstrap-v4-alpha/dist/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.js @@ -1,15 +1,15 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ (function($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js new file mode 100644 index 0000000..aace40f --- /dev/null +++ b/bootstrap-v4-alpha/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(o){if(!o.fn.tooltip)throw new Error("Bootstrap Tooltip must be included first!");var t=o.fn.tooltip.Constructor;o.extend(t.Default,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){if(s.apply(this),this.config.customClass){var t=this.getTipElement();o(t).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4-alpha/src/js/bootstrap-tooltip-custom-class.js b/bootstrap-v4-alpha/tooltip/src/js/bootstrap-tooltip-custom-class.js similarity index 89% rename from bootstrap-v4-alpha/src/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v4-alpha/tooltip/src/js/bootstrap-tooltip-custom-class.js index 66520f9..66f0b7c 100644 --- a/bootstrap-v4-alpha/src/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v4-alpha/tooltip/src/js/bootstrap-tooltip-custom-class.js @@ -1,6 +1,6 @@ (function($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v4-alpha/src/scss/_mixin.scss b/bootstrap-v4-alpha/tooltip/src/scss/_mixin.scss similarity index 99% rename from bootstrap-v4-alpha/src/scss/_mixin.scss rename to bootstrap-v4-alpha/tooltip/src/scss/_mixin.scss index 8d81e99..6d1823f 100644 --- a/bootstrap-v4-alpha/src/scss/_mixin.scss +++ b/bootstrap-v4-alpha/tooltip/src/scss/_mixin.scss @@ -1,6 +1,7 @@ //== Tooltip Custom Mixin // //## + @mixin tooltip-custom($bg-color, $color) { .tooltip-inner { diff --git a/bootstrap-v3/src/scss/_tooltips.scss b/bootstrap-v4-alpha/tooltip/src/scss/_tooltips.scss similarity index 99% rename from bootstrap-v3/src/scss/_tooltips.scss rename to bootstrap-v4-alpha/tooltip/src/scss/_tooltips.scss index db6cb4b..12baf6e 100644 --- a/bootstrap-v3/src/scss/_tooltips.scss +++ b/bootstrap-v4-alpha/tooltip/src/scss/_tooltips.scss @@ -1,6 +1,7 @@ //== Styles for predefined Tooltip Custom Classes // //## + .tooltip-primary { @include tooltip-custom($tooltip-primary-bg, $tooltip-color); } diff --git a/bootstrap-v3/src/scss/_variables.scss b/bootstrap-v4-alpha/tooltip/src/scss/_variables.scss similarity index 99% rename from bootstrap-v3/src/scss/_variables.scss rename to bootstrap-v4-alpha/tooltip/src/scss/_variables.scss index 976272c..7a148f0 100644 --- a/bootstrap-v3/src/scss/_variables.scss +++ b/bootstrap-v4-alpha/tooltip/src/scss/_variables.scss @@ -2,7 +2,6 @@ // //## -// // Tooltip primary background color $tooltip-primary-bg: $brand-primary !default; // Tooltip success background color diff --git a/bootstrap-v4-alpha/src/scss/bootstrap-tooltip-custom-class.scss b/bootstrap-v4-alpha/tooltip/src/scss/bootstrap-tooltip-custom-class.scss similarity index 100% rename from bootstrap-v4-alpha/src/scss/bootstrap-tooltip-custom-class.scss rename to bootstrap-v4-alpha/tooltip/src/scss/bootstrap-tooltip-custom-class.scss diff --git a/bootstrap-v4-alpha/tooltip/src/scss/main.scss b/bootstrap-v4-alpha/tooltip/src/scss/main.scss new file mode 100644 index 0000000..4dce6ab --- /dev/null +++ b/bootstrap-v4-alpha/tooltip/src/scss/main.scss @@ -0,0 +1,3 @@ +@import "../../../node_modules/bootstrap/scss/variables"; + +@import "bootstrap-tooltip-custom-class"; diff --git a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css.map deleted file mode 100644 index eb271ea..0000000 --- a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css.map +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": 3, - "file": "bootstrap-tooltip-custom-class.min.css", - "sources": [ - "../../src/scss/main.scss", - "../../node_modules/bootstrap/scss/_functions.scss", - "../../node_modules/bootstrap/scss/_variables.scss", - "../../src/scss/bootstrap-tooltip-custom-class.scss", - "../../src/scss/_variables.scss", - "../../src/scss/_mixin.scss", - "../../src/scss/_tooltips.scss" - ], - "names": [], - "mappings": "AMGA,ADEE,gBCFc,CDEd,cAAc,AAAC,CACb,gBAAgB,CH8BV,OAAO,CG7Bb,KAAK,CHAE,IAAI,CGCZ,ACLH,ADOE,gBCPc,ADOb,eAAe,CAAC,MAAM,AAAA,OAAO,AAAC,CAC7B,gBAAgB,CHyBV,OAAO,CGxBd,ACTH,ADWE,gBCXc,ADWb,iBAAiB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC/B,kBAAkB,CHqBZ,OAAO,CGpBd,ACbH,ADeE,gBCfc,ADeb,gBAAgB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC9B,iBAAiB,CHiBX,OAAO,CGhBd,ACjBH,ADmBE,gBCnBc,ADmBb,kBAAkB,CAAC,MAAM,AAAA,OAAO,AAAC,CAChC,mBAAmB,CHab,OAAO,CGZd,ACjBH,ADFE,gBCEc,CDFd,cAAc,AAAC,CACb,gBAAgB,CHqCV,OAAO,CGpCb,KAAK,CHAE,IAAI,CGCZ,ACDH,ADGE,gBCHc,ADGb,eAAe,CAAC,MAAM,AAAA,OAAO,AAAC,CAC7B,gBAAgB,CHgCV,OAAO,CG/Bd,ACLH,ADOE,gBCPc,ADOb,iBAAiB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC/B,kBAAkB,CH4BZ,OAAO,CG3Bd,ACTH,ADWE,gBCXc,ADWb,gBAAgB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC9B,iBAAiB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AC,MAAM,AAAA,OAAO,AAAC,CAC7B,gBAAgB,CH6BV,OAAO,CG5Bd,ACOH,ADLE,eCKa,ADLZ,iBAAiB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC/B,kBAAkB,CHyBZ,OAAO,CGxBd,ACGH,ADDE,eCCa,ADDZ,gBAAgB,CAAC,MAAM,AAAA,OAAO,AAAC,CAC9B,iBAAiB,CHqBX,OAAO,CGpBd,ACDH,ADGE,eCHa,ADGZ,kBAAkB,CAAC,MAAM,AAAA,OAAO,AAAC,CAChC,mBAAmB,CHiBb,OAAO,CGhBd" -} \ No newline at end of file diff --git a/bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.min.js deleted file mode 100644 index a25b0b5..0000000 --- a/bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * bootstrap-tooltip-custom-class - * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme - * License: MIT - */ - - -!function(o){if(void 0===o.fn.tooltip.Constructor)throw new Error("Bootstrap Tooltip must be included first!");var t=o.fn.tooltip.Constructor;o.extend(t.Default,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){if(s.apply(this),this.config.customClass){var t=this.getTipElement();o(t).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4/package.json b/bootstrap-v4/package.json index d017961..70ffe7a 100644 --- a/bootstrap-v4/package.json +++ b/bootstrap-v4/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-tooltip-custom-class", - "description": "Extend Bootstrap Tooltip plugin by adding custom classes. For Bootstrap v4.", + "description": "Extends Bootstrap Tooltips and Popovers by adding custom classes. For Bootstrap v4.", "repository": { "type": "git", "url": "git+https://github.com/andreivictor/bootstrap-tooltip-custom-class.git" diff --git a/bootstrap-v4/popover/demo/demo.css b/bootstrap-v4/popover/demo/demo.css new file mode 100644 index 0000000..3e3ddf2 --- /dev/null +++ b/bootstrap-v4/popover/demo/demo.css @@ -0,0 +1,140 @@ +.popover-primary .popover-header { + background: #007bff; + color: #fff; +} + +.popover-primary.bs-popover-bottom .popover-header::before, .popover-primary.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-primary.bs-popover-bottom > .arrow::after, .popover-primary.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #007bff; +} + +.popover-success .popover-header { + background: #28a745; + color: #fff; +} + +.popover-success.bs-popover-bottom .popover-header::before, .popover-success.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-success.bs-popover-bottom > .arrow::after, .popover-success.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #28a745; +} + +.popover-info .popover-header { + background: #17a2b8; + color: #fff; +} + +.popover-info.bs-popover-bottom .popover-header::before, .popover-info.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-info.bs-popover-bottom > .arrow::after, .popover-info.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #17a2b8; +} + +.popover-warning .popover-header { + background: #ffc107; + color: #fff; +} + +.popover-warning.bs-popover-bottom .popover-header::before, .popover-warning.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-warning.bs-popover-bottom > .arrow::after, .popover-warning.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #ffc107; +} + +.popover-danger .popover-header { + background: #dc3545; + color: #fff; +} + +.popover-danger.bs-popover-bottom .popover-header::before, .popover-danger.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-danger.bs-popover-bottom > .arrow::after, .popover-danger.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #dc3545; +} + +.popover-custom .popover-header { + background: #f2653c; + color: #ffffff; +} + +.popover-custom.bs-popover-bottom .popover-header::before, .popover-custom.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-custom.bs-popover-bottom > .arrow::after, .popover-custom.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #f2653c; +} + +.popover-custom-alt .popover-header { + background: #5b2da3; + color: #ffffff; +} + +.popover-custom-alt.bs-popover-bottom .popover-header::before, .popover-custom-alt.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-custom-alt.bs-popover-bottom > .arrow::after, .popover-custom-alt.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #5b2da3; +} + +body { + padding-top: 4.5rem; +} + +#topnav { + z-index: 1061; +} + +#topnav .nav-link > i { + font-size: 26px; +} + +@media (max-width: 390px) { + #topnav .navbar-brand { + font-size: 1rem; + } +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} + +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + display: inline-block; + position: relative; + margin: 10px 20px; +} + +.bs-example--static .bs-popover-top .arrow, +.bs-example--static .bs-popover-bottom .arrow { + left: calc(50% - 1rem/2 - 0.3rem); +} + +.bs-example--static .bs-popover-right .arrow, +.bs-example--static .bs-popover-left .arrow { + top: calc(50% - 0.5rem/2 - 0.3rem); +} diff --git a/bootstrap-v4/popover/demo/demo.js b/bootstrap-v4/popover/demo/demo.js new file mode 100644 index 0000000..c88c583 --- /dev/null +++ b/bootstrap-v4/popover/demo/demo.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + $('.btn-secondary').popover(); + $('.btn-custom').popover({ + customClass: 'popover-custom' + }); + $('.btn-custom-alt').popover({ + customClass: 'popover-custom-alt' + }); +}); diff --git a/bootstrap-v4/popover/demo/demo.scss b/bootstrap-v4/popover/demo/demo.scss new file mode 100644 index 0000000..d4ff64b --- /dev/null +++ b/bootstrap-v4/popover/demo/demo.scss @@ -0,0 +1,64 @@ +@import "../../node_modules/bootstrap/scss/functions"; +@import "../../node_modules/bootstrap/scss/variables"; +@import "../src/scss/bootstrap-popover-custom-class"; + +.popover-custom { + @include popover-custom(#f2653c, #ffffff); +} + +.popover-custom-alt { + @include popover-custom(#5b2da3, #ffffff); +} + +//== Demo layout +// +//## +body { + padding-top: 4.5rem; +} + +#topnav { + z-index: ($zindex-popover + 1); + + .nav-link > i { + font-size: 26px; + } + + @media (max-width: 390px) { + .navbar-brand { + font-size: $font-size-base; + } + } +} + +.bs-example { + position: relative; + margin: 15px; + padding: 15px 15px 25px; + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; +} +.bs-example .btn { + margin: 5px; +} + +.bs-example__title { + margin-bottom: 20px; +} + +.bs-example--static .popover { + display: inline-block; + position: relative; + margin: 10px 20px; +} + +.bs-example--static .bs-popover-top .arrow, +.bs-example--static .bs-popover-bottom .arrow { + left: calc(50% - #{$popover-arrow-width}/2 - #{$border-radius-lg}); +} + +.bs-example--static .bs-popover-right .arrow, +.bs-example--static .bs-popover-left .arrow { + top: calc(50% - #{$popover-arrow-height}/2 - #{$border-radius-lg}); +} + diff --git a/bootstrap-v4/popover/demo/index.html b/bootstrap-v4/popover/demo/index.html new file mode 100644 index 0000000..ae5b5b8 --- /dev/null +++ b/bootstrap-v4/popover/demo/index.html @@ -0,0 +1,94 @@ + + + + + Bootstrap v4 Popover Custom Classes + + + + + + + + + + + +
+
+

Static examples

+
+ + + + + +
+
+ + +
+
+ +
+

Dinamic examples

+
+ + + + + +
+
+ + +
+
+
+ + + + + + + + diff --git a/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.css b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.css new file mode 100644 index 0000000..af21a80 --- /dev/null +++ b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.css @@ -0,0 +1,73 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-header { + background: #007bff; + color: #fff; +} + +.popover-primary.bs-popover-bottom .popover-header::before, .popover-primary.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-primary.bs-popover-bottom > .arrow::after, .popover-primary.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #007bff; +} + +.popover-success .popover-header { + background: #28a745; + color: #fff; +} + +.popover-success.bs-popover-bottom .popover-header::before, .popover-success.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-success.bs-popover-bottom > .arrow::after, .popover-success.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #28a745; +} + +.popover-info .popover-header { + background: #17a2b8; + color: #fff; +} + +.popover-info.bs-popover-bottom .popover-header::before, .popover-info.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-info.bs-popover-bottom > .arrow::after, .popover-info.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #17a2b8; +} + +.popover-warning .popover-header { + background: #ffc107; + color: #fff; +} + +.popover-warning.bs-popover-bottom .popover-header::before, .popover-warning.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-warning.bs-popover-bottom > .arrow::after, .popover-warning.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #ffc107; +} + +.popover-danger .popover-header { + background: #dc3545; + color: #fff; +} + +.popover-danger.bs-popover-bottom .popover-header::before, .popover-danger.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + display: none; +} + +.popover-danger.bs-popover-bottom > .arrow::after, .popover-danger.bs-popover-auto[x-placement^="bottom"] > .arrow::after { + border-bottom-color: #dc3545; +} diff --git a/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css new file mode 100644 index 0000000..7f1b8e7 --- /dev/null +++ b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css @@ -0,0 +1,12 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +.popover-primary .popover-header{background:#007bff;color:#fff}.popover-primary.bs-popover-bottom .popover-header::before,.popover-primary.bs-popover-auto[x-placement^="bottom"] .popover-header::before{display:none}.popover-primary.bs-popover-bottom>.arrow::after,.popover-primary.bs-popover-auto[x-placement^="bottom"]>.arrow::after{border-bottom-color:#007bff}.popover-success .popover-header{background:#28a745;color:#fff}.popover-success.bs-popover-bottom .popover-header::before,.popover-success.bs-popover-auto[x-placement^="bottom"] .popover-header::before{display:none}.popover-success.bs-popover-bottom>.arrow::after,.popover-success.bs-popover-auto[x-placement^="bottom"]>.arrow::after{border-bottom-color:#28a745}.popover-info .popover-header{background:#17a2b8;color:#fff}.popover-info.bs-popover-bottom .popover-header::before,.popover-info.bs-popover-auto[x-placement^="bottom"] .popover-header::before{display:none}.popover-info.bs-popover-bottom>.arrow::after,.popover-info.bs-popover-auto[x-placement^="bottom"]>.arrow::after{border-bottom-color:#17a2b8}.popover-warning .popover-header{background:#ffc107;color:#fff}.popover-warning.bs-popover-bottom .popover-header::before,.popover-warning.bs-popover-auto[x-placement^="bottom"] .popover-header::before{display:none}.popover-warning.bs-popover-bottom>.arrow::after,.popover-warning.bs-popover-auto[x-placement^="bottom"]>.arrow::after{border-bottom-color:#ffc107}.popover-danger .popover-header{background:#dc3545;color:#fff}.popover-danger.bs-popover-bottom .popover-header::before,.popover-danger.bs-popover-auto[x-placement^="bottom"] .popover-header::before{display:none}.popover-danger.bs-popover-bottom>.arrow::after,.popover-danger.bs-popover-auto[x-placement^="bottom"]>.arrow::after{border-bottom-color:#dc3545} + +/*# sourceMappingURL=bootstrap-popover-custom-class.min.css.map */ \ No newline at end of file diff --git a/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css.map b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css.map new file mode 100644 index 0000000..46cb2c0 --- /dev/null +++ b/bootstrap-v4/popover/dist/css/bootstrap-popover-custom-class.min.css.map @@ -0,0 +1,15 @@ +{ + "version": 3, + "file": "bootstrap-popover-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap/scss/_functions.scss", + "../../../node_modules/bootstrap/scss/_variables.scss", + "../../src/scss/bootstrap-popover-custom-class.scss", + "../../src/scss/_variables.scss", + "../../src/scss/_mixin.scss", + "../../src/scss/_popovers.scss" + ], + "names": [], + "mappings": "AMIA,ADCE,gBCDc,CDCd,eAAe,AAAC,CACd,UAAU,CH8BJ,OAAO,CG7Bb,KAAK,CDQ6B,IAAI,CCPvC,ACJH,ADSI,gBCTY,ADOb,kBAAkB,CAEjB,eAAe,AAAA,QAAQ,CCT3B,gBAAgB,ADQb,gBAAgB,CAAA,AAAA,WAAC,EAAa,QAAQ,AAArB,EAChB,eAAe,AAAA,QAAQ,AAAC,CACtB,OAAO,CAAE,IAAI,CACd,ACXL,ADaI,gBCbY,ADOb,kBAAkB,CAMf,MAAM,AAAA,OAAO,CCbnB,gBAAgB,ADQb,gBAAgB,CAAA,AAAA,WAAC,EAAa,QAAQ,AAArB,EAKd,MAAM,AAAA,OAAO,AAAC,CACd,mBAAmB,CHkBf,OAAO,CGjBZ,ACXL,ADHE,gBCGc,CDHd,eAAe,AAAC,CACd,UAAU,CHqCJ,OAAO,CGpCb,KAAK,CDQ6B,IAAI,CCPvC,ACAH,ADKI,gBCLY,ADGb,kBAAkB,CAEjB,eAAe,AAAA,QAAQ,CCL3B,gBAAgB,ADIb,gBAAgB,CAAA,AAAA,WAAC,EAAa,QAAQ,AAArB,EAChB,eAAe,AAAA,QAAQ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GjCb,KAAK,CDQ6B,IAAI,CCPvC,ACYH,ADPI,eCOW,ADTZ,kBAAkB,CAEjB,eAAe,AAAA,QAAQ,CCO3B,eAAe,ADRZ,gBAAgB,CAAA,AAAA,WAAC,EAAa,QAAQ,AAArB,EAChB,eAAe,AAAA,QAAQ,AAAC,CACtB,OAAO,CAAE,IAAI,CACd,ACKL,ADHI,eCGW,ADTZ,kBAAkB,CAMf,MAAM,AAAA,OAAO,CCGnB,eAAe,ADRZ,gBAAgB,CAAA,AAAA,WAAC,EAAa,QAAQ,AAArB,EAKd,MAAM,AAAA,OAAO,AAAC,CACd,mBAAmB,CHsBf,OAAO,CGrBZ" +} \ No newline at end of file diff --git a/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.js b/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..f532f2b --- /dev/null +++ b/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.js @@ -0,0 +1,35 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +(function($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend( Popover.Default, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if ( this.config.customClass ) { + var tip = this.getTipElement(); + $(tip).addClass(this.config.customClass); + } + + }; + +})(window.jQuery); diff --git a/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.min.js b/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.min.js new file mode 100644 index 0000000..c3cfe22 --- /dev/null +++ b/bootstrap-v4/popover/dist/js/bootstrap-popover-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(t){if(!t.fn.popover)throw new Error("Bootstrap Popover must be included first!");var o=t.fn.popover.Constructor;t.extend(o.Default,{customClass:""});var s=o.prototype.show;o.prototype.show=function(){if(s.apply(this),this.config.customClass){var o=this.getTipElement();t(o).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4/popover/src/js/bootstrap-popover-custom-class.js b/bootstrap-v4/popover/src/js/bootstrap-popover-custom-class.js new file mode 100644 index 0000000..2859316 --- /dev/null +++ b/bootstrap-v4/popover/src/js/bootstrap-popover-custom-class.js @@ -0,0 +1,26 @@ +(function($) { + + if (!$.fn.popover) { + throw new Error('Bootstrap Popover must be included first!'); + } + + var Popover = $.fn.popover.Constructor; + + $.extend( Popover.Default, { + customClass: '' + }); + + var _show = Popover.prototype.show; + + Popover.prototype.show = function () { + + _show.apply(this); + + if ( this.config.customClass ) { + var tip = this.getTipElement(); + $(tip).addClass(this.config.customClass); + } + + }; + +})(window.jQuery); diff --git a/bootstrap-v4/popover/src/scss/_mixin.scss b/bootstrap-v4/popover/src/scss/_mixin.scss new file mode 100644 index 0000000..f1524b2 --- /dev/null +++ b/bootstrap-v4/popover/src/scss/_mixin.scss @@ -0,0 +1,22 @@ +//== Popover Custom Mixin +// +//## + +@mixin popover-custom($header-bg, $header-color) { + .popover-header { + background: $header-bg; + color: $header-color; + } + + // Popover arrow will have the same bg color as header + &.bs-popover-bottom, + &.bs-popover-auto[x-placement^="bottom"] { + .popover-header::before { + display: none; + } + + > .arrow::after { + border-bottom-color: $header-bg; + } + } +} diff --git a/bootstrap-v4/popover/src/scss/_popovers.scss b/bootstrap-v4/popover/src/scss/_popovers.scss new file mode 100644 index 0000000..3ac7e11 --- /dev/null +++ b/bootstrap-v4/popover/src/scss/_popovers.scss @@ -0,0 +1,23 @@ +//== Styles for predefined Popover Custom Classes +// +//## + +.popover-primary { + @include popover-custom($popover-primary-header-bg, $popover-custom-header-color); +} + +.popover-success { + @include popover-custom($popover-success-header-bg, $popover-custom-header-color); +} + +.popover-info { + @include popover-custom($popover-info-header-bg, $popover-custom-header-color); +} + +.popover-warning { + @include popover-custom($popover-warning-header-bg, $popover-custom-header-color); +} + +.popover-danger { + @include popover-custom($popover-danger-header-bg, $popover-custom-header-color); +} diff --git a/bootstrap-v4/popover/src/scss/_variables.scss b/bootstrap-v4/popover/src/scss/_variables.scss new file mode 100644 index 0000000..2284e7d --- /dev/null +++ b/bootstrap-v4/popover/src/scss/_variables.scss @@ -0,0 +1,16 @@ +//== Define Bootstrap variables for Popovers +// +//## + +// Popover primary background color +$popover-primary-header-bg: map-get($theme-colors, "primary") !default; +// Popover success background color +$popover-success-header-bg: map-get($theme-colors, "success") !default; +// Popover info background color +$popover-info-header-bg: map-get($theme-colors, "info") !default; +// Popover warning background color +$popover-warning-header-bg: map-get($theme-colors, "warning") !default; +// Popover danger background color +$popover-danger-header-bg: map-get($theme-colors, "danger") !default; + +$popover-custom-header-color: #fff !default; diff --git a/bootstrap-v4/popover/src/scss/bootstrap-popover-custom-class.scss b/bootstrap-v4/popover/src/scss/bootstrap-popover-custom-class.scss new file mode 100644 index 0000000..12c029f --- /dev/null +++ b/bootstrap-v4/popover/src/scss/bootstrap-popover-custom-class.scss @@ -0,0 +1,3 @@ +@import "variables"; +@import "mixin"; +@import "popovers"; diff --git a/bootstrap-v4/popover/src/scss/main.scss b/bootstrap-v4/popover/src/scss/main.scss new file mode 100644 index 0000000..19cfa64 --- /dev/null +++ b/bootstrap-v4/popover/src/scss/main.scss @@ -0,0 +1,4 @@ +@import "../../../node_modules/bootstrap/scss/functions"; +@import "../../../node_modules/bootstrap/scss/variables"; + +@import "bootstrap-popover-custom-class"; diff --git a/bootstrap-v4/src/scss/main.scss b/bootstrap-v4/src/scss/main.scss deleted file mode 100644 index b927464..0000000 --- a/bootstrap-v4/src/scss/main.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../node_modules/bootstrap/scss/functions"; -@import "../../node_modules/bootstrap/scss/variables"; - -@import "bootstrap-tooltip-custom-class"; diff --git a/bootstrap-v4/demo/demo.css b/bootstrap-v4/tooltip/demo/demo.css similarity index 100% rename from bootstrap-v4/demo/demo.css rename to bootstrap-v4/tooltip/demo/demo.css diff --git a/bootstrap-v4/demo/demo.js b/bootstrap-v4/tooltip/demo/demo.js similarity index 100% rename from bootstrap-v4/demo/demo.js rename to bootstrap-v4/tooltip/demo/demo.js diff --git a/bootstrap-v4/demo/demo.scss b/bootstrap-v4/tooltip/demo/demo.scss similarity index 89% rename from bootstrap-v4/demo/demo.scss rename to bootstrap-v4/tooltip/demo/demo.scss index 8b44770..75fd244 100644 --- a/bootstrap-v4/demo/demo.scss +++ b/bootstrap-v4/tooltip/demo/demo.scss @@ -1,5 +1,5 @@ -@import "../node_modules/bootstrap/scss/functions"; -@import "../node_modules/bootstrap/scss/variables"; +@import "../../node_modules/bootstrap/scss/functions"; +@import "../../node_modules/bootstrap/scss/variables"; @import "../src/scss/bootstrap-tooltip-custom-class"; .tooltip-custom { diff --git a/bootstrap-v4/demo/index.html b/bootstrap-v4/tooltip/demo/index.html similarity index 92% rename from bootstrap-v4/demo/index.html rename to bootstrap-v4/tooltip/demo/index.html index 944496c..647d258 100644 --- a/bootstrap-v4/demo/index.html +++ b/bootstrap-v4/tooltip/demo/index.html @@ -6,7 +6,7 @@ - + @@ -78,9 +78,9 @@

Dinamic examples

- - - + + + diff --git a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.css b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.css similarity index 91% rename from bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.css rename to bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.css index baf9b7e..c4f424e 100644 --- a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.css +++ b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css similarity index 90% rename from bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css rename to bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css index e327d24..656ec0b 100644 --- a/bootstrap-v4/dist/css/bootstrap-tooltip-custom-class.min.css +++ b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css @@ -1,8 +1,8 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ diff --git a/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map new file mode 100644 index 0000000..d7a2702 --- /dev/null +++ b/bootstrap-v4/tooltip/dist/css/bootstrap-tooltip-custom-class.min.css.map @@ -0,0 +1,15 @@ +{ + "version": 3, + "file": "bootstrap-tooltip-custom-class.min.css", + "sources": [ + "../../src/scss/main.scss", + "../../../node_modules/bootstrap/scss/_functions.scss", + "../../../node_modules/bootstrap/scss/_variables.scss", + "../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X,OAAO,CGnBd,ACDH,ADGE,eCHa,ADGZ,kBAAkB,CAAC,MAAM,AAAA,OAAO,AAAC,CAChC,mBAAmB,CHgBb,OAAO,CGfd" +} \ No newline at end of file diff --git a/bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.js b/bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.js similarity index 70% rename from bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.js index 0c5837a..86fb760 100644 --- a/bootstrap-v4/dist/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.js @@ -1,15 +1,15 @@ /*! * bootstrap-tooltip-custom-class * v1.0.4 - * Extends Bootstrap Tooltip plugin by adding custom classes. - * Copyright (c) 2019 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme * License: MIT */ (function($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js b/bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js new file mode 100644 index 0000000..aace40f --- /dev/null +++ b/bootstrap-v4/tooltip/dist/js/bootstrap-tooltip-custom-class.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-tooltip-custom-class + * v1.0.4 + * Extends Bootstrap Tooltip and Popover plugins by adding custom classes. + * Copyright (c) 2017 - 2020 Andrei Victor Bulearca - https://github.com/andreivictor/bootstrap-tooltip-custom-class#readme + * License: MIT + */ + + +!function(o){if(!o.fn.tooltip)throw new Error("Bootstrap Tooltip must be included first!");var t=o.fn.tooltip.Constructor;o.extend(t.Default,{customClass:""});var s=t.prototype.show;t.prototype.show=function(){if(s.apply(this),this.config.customClass){var t=this.getTipElement();o(t).addClass(this.config.customClass)}}}(window.jQuery); \ No newline at end of file diff --git a/bootstrap-v4/src/js/bootstrap-tooltip-custom-class.js b/bootstrap-v4/tooltip/src/js/bootstrap-tooltip-custom-class.js similarity index 89% rename from bootstrap-v4/src/js/bootstrap-tooltip-custom-class.js rename to bootstrap-v4/tooltip/src/js/bootstrap-tooltip-custom-class.js index f68c147..1d19ff3 100644 --- a/bootstrap-v4/src/js/bootstrap-tooltip-custom-class.js +++ b/bootstrap-v4/tooltip/src/js/bootstrap-tooltip-custom-class.js @@ -1,6 +1,6 @@ (function($) { - if (typeof $.fn.tooltip.Constructor === 'undefined') { + if (!$.fn.tooltip) { throw new Error('Bootstrap Tooltip must be included first!'); } diff --git a/bootstrap-v4/src/scss/_mixin.scss b/bootstrap-v4/tooltip/src/scss/_mixin.scss similarity index 99% rename from bootstrap-v4/src/scss/_mixin.scss rename to bootstrap-v4/tooltip/src/scss/_mixin.scss index 3aa12de..cc42080 100644 --- a/bootstrap-v4/src/scss/_mixin.scss +++ b/bootstrap-v4/tooltip/src/scss/_mixin.scss @@ -1,6 +1,7 @@ //== Tooltip Custom Mixin // //## + @mixin tooltip-custom($bg-color, $color) { .tooltip-inner { diff --git a/bootstrap-v4/src/scss/_tooltips.scss b/bootstrap-v4/tooltip/src/scss/_tooltips.scss similarity index 99% rename from bootstrap-v4/src/scss/_tooltips.scss rename to bootstrap-v4/tooltip/src/scss/_tooltips.scss index db6cb4b..12baf6e 100644 --- a/bootstrap-v4/src/scss/_tooltips.scss +++ b/bootstrap-v4/tooltip/src/scss/_tooltips.scss @@ -1,6 +1,7 @@ //== Styles for predefined Tooltip Custom Classes // //## + .tooltip-primary { @include tooltip-custom($tooltip-primary-bg, $tooltip-color); } diff --git a/bootstrap-v4/src/scss/_variables.scss b/bootstrap-v4/tooltip/src/scss/_variables.scss similarity index 100% rename from bootstrap-v4/src/scss/_variables.scss rename to bootstrap-v4/tooltip/src/scss/_variables.scss diff --git a/bootstrap-v4/src/scss/bootstrap-tooltip-custom-class.scss b/bootstrap-v4/tooltip/src/scss/bootstrap-tooltip-custom-class.scss similarity index 100% rename from bootstrap-v4/src/scss/bootstrap-tooltip-custom-class.scss rename to bootstrap-v4/tooltip/src/scss/bootstrap-tooltip-custom-class.scss diff --git a/bootstrap-v4/tooltip/src/scss/main.scss b/bootstrap-v4/tooltip/src/scss/main.scss new file mode 100644 index 0000000..2f5b000 --- /dev/null +++ b/bootstrap-v4/tooltip/src/scss/main.scss @@ -0,0 +1,4 @@ +@import "../../../node_modules/bootstrap/scss/functions"; +@import "../../../node_modules/bootstrap/scss/variables"; + +@import "bootstrap-tooltip-custom-class"; diff --git a/grunt/clean.js b/grunt/clean.js index ac8a5a8..f43a4fe 100644 --- a/grunt/clean.js +++ b/grunt/clean.js @@ -2,7 +2,7 @@ const projectMap = require('./project-map.js'); let config = {}; Object.keys(projectMap).forEach(function (project) { - config[project] = [`${projectMap[project]}/dist/**`] + config[project] = [`${projectMap[project].path}/dist/**`] }); module.exports = config; diff --git a/grunt/copy.js b/grunt/copy.js index 8d2bd19..83c8f70 100644 --- a/grunt/copy.js +++ b/grunt/copy.js @@ -5,8 +5,8 @@ Object.keys(projectMap).forEach(function (project) { config[project] = { files: [ { - src: `${projectMap[project]}/src/js/<%= meta.filename %>.js`, - dest: `${projectMap[project]}/dist/js/<%= meta.filename %>.js` + src: `${projectMap[project].path}/src/js/${projectMap[project].filename}.js`, + dest: `${projectMap[project].path}/dist/js/${projectMap[project].filename}.js` } ] } diff --git a/grunt/eslint.js b/grunt/eslint.js index 366a148..7261d45 100644 --- a/grunt/eslint.js +++ b/grunt/eslint.js @@ -6,7 +6,7 @@ Object.keys(projectMap).forEach(function (project) { options: { configFile: './.eslintrc.json', }, - src: [`${projectMap[project]}/src/js/<%= meta.filename %>.js`] + src: [`${projectMap[project].path}/src/js/${projectMap[project].filename}.js`] } }); diff --git a/grunt/less.js b/grunt/less.js index 0fb42d4..58473f7 100644 --- a/grunt/less.js +++ b/grunt/less.js @@ -1,9 +1,14 @@ -let config = { - v3: { - files: { - 'bootstrap-v3/dist/css/<%= meta.filename %>.less.css': 'bootstrap-v3/src/less/main.less' - } - } -}; +const projectMap = require('./project-map.js'); +let config = {}; + +Object.keys(projectMap).forEach(function (project) { + if (project === 'v3Tooltip' || project === 'v3Popover') { + const dest = `${projectMap[project].path}/dist/css/${projectMap[project].filename}.less.css`; + const source = `${projectMap[project].path}/src/less/main.less`; + config[project] = {}; + config[project].files = {}; + config[project].files[dest] = source; + } +}); module.exports = config; diff --git a/grunt/project-map.js b/grunt/project-map.js index 383913d..3db92d1 100644 --- a/grunt/project-map.js +++ b/grunt/project-map.js @@ -1,5 +1,29 @@ +const tooltipFilename = "bootstrap-tooltip-custom-class"; +const popoverFilename = "bootstrap-popover-custom-class"; + module.exports = { - v3: "bootstrap-v3", - v4: "bootstrap-v4", - v4Alpha: "bootstrap-v4-alpha" + v3Tooltip: { + path: "bootstrap-v3/tooltip", + filename: tooltipFilename + }, + v3Popover: { + path: "bootstrap-v3/popover", + filename: popoverFilename + }, + v4Tooltip: { + path: "bootstrap-v4/tooltip", + filename: tooltipFilename + }, + v4Popover: { + path: "bootstrap-v4/popover", + filename: popoverFilename + }, + v4AlphaTooltip: { + path: "bootstrap-v4-alpha/tooltip", + filename: tooltipFilename + }, + v4AlphaPopover: { + path: "bootstrap-v4-alpha/popover", + filename: popoverFilename + } }; diff --git a/grunt/sass.js b/grunt/sass.js index 36de3a4..b0c31c3 100644 --- a/grunt/sass.js +++ b/grunt/sass.js @@ -15,22 +15,22 @@ Object.keys(projectMap).forEach(function (project) { outputStyle: 'compressed', sourceMap: true }, - src: `${projectMap[project]}/src/scss/main.scss`, - dest: `${projectMap[project]}/dist/css/<%= meta.filename %>.min.css`, + src: `${projectMap[project].path}/src/scss/main.scss`, + dest: `${projectMap[project].path}/dist/css/${projectMap[project].filename}.min.css`, }; config[`${project}Expanded`] = { options: { outputStyle: 'expanded' }, - src: `${projectMap[project]}/src/scss/main.scss`, - dest: `${projectMap[project]}/dist/css/<%= meta.filename %>.css`, + src: `${projectMap[project].path}/src/scss/main.scss`, + dest: `${projectMap[project].path}/dist/css/${projectMap[project].filename}.css`, }; config[`${project}Demo`] = { options: { outputStyle: 'expanded' }, - src: `${projectMap[project]}/demo/demo.scss`, - dest: `${projectMap[project]}/demo/demo.css`, + src: `${projectMap[project].path}/demo/demo.scss`, + dest: `${projectMap[project].path}/demo/demo.css`, }; }); diff --git a/grunt/uglify.js b/grunt/uglify.js index c4a329d..90c1e6d 100644 --- a/grunt/uglify.js +++ b/grunt/uglify.js @@ -3,8 +3,8 @@ let config = {}; Object.keys(projectMap).forEach(function (project) { config[project] = { - src: `${projectMap[project]}/src/js/<%= meta.filename %>.js`, - dest: `${projectMap[project]}/dist/js/<%= meta.filename %>.min.js` + src: `${projectMap[project].path}/src/js/${projectMap[project].filename}.js`, + dest: `${projectMap[project].path}/dist/js/${projectMap[project].filename}.min.js` } }); diff --git a/grunt/usebanner.js b/grunt/usebanner.js index 8095251..805a3b1 100644 --- a/grunt/usebanner.js +++ b/grunt/usebanner.js @@ -9,8 +9,8 @@ Object.keys(projectMap).forEach(function (project) { }, files: { src: [ - `${projectMap[project]}/dist/css/*.css`, - `${projectMap[project]}/dist/js/*.js` + `${projectMap[project].path}/dist/css/*.css`, + `${projectMap[project].path}/dist/js/*.js` ] } } diff --git a/package.json b/package.json index ff7989f..31cdd87 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,21 @@ { "name": "bootstrap-tooltip-custom-class", "version": "1.0.4", - "description": "Extends Bootstrap Tooltip plugin by adding custom classes.", - "extraDescription": "Custom classes can be added by using `customClass` parameter or via `data-custom-class` attribute.\nThere are 5 predefined custom classes in CSS: .tooltip-primary, .tooltip-success, .tooltip-info, .tooltip-warning, .tooltip-danger.", + "description": "Extends Bootstrap Tooltips and Popovers by adding custom classes.", "scripts": { "install-v3": "cd bootstrap-v3 && rm -rf node_modules && npm install", "install-v4": "cd bootstrap-v4 && rm -rf node_modules && npm install", "install-v4-alpha": "cd bootstrap-v4-alpha && rm -rf node_modules && npm install", "install-all": "npm run install-v3 && npm run install-v4 && npm run install-v4-alpha", - "build-v3": "grunt buildv3", - "build-v4": "grunt buildv4", - "build-v4-alpha": "grunt buildv4Alpha", + "build-v3-tooltip": "grunt buildv3Tooltip", + "build-v3-popover": "grunt buildv3Popover", + "build-v3": "npm run build-v3-tooltip && npm run build-v3-popover", + "build-v4-tooltip": "grunt buildv4Tooltip", + "build-v4-popover": "grunt buildv4Popover", + "build-v4": "npm run build-v4-tooltip && npm run build-v4-popover", + "build-v4-alpha-tooltip": "grunt buildv4AlphaTooltip", + "build-v4-alpha-popover": "grunt buildv4AlphaPopover", + "build-v4-alpha": "npm run build-v4-alpha-tooltip && npm run build-v4-alpha-popover", "build-all": "npm run build-v3 && npm run build-v4 && npm run build-v4-alpha", "version-v3": "cd bootstrap-v3 && json -I -f package.json -e 'this.version=process.env.npm_package_version'", "version-v4": "cd bootstrap-v4 && json -I -f package.json -e 'this.version=process.env.npm_package_version'",