Skip to content

Commit

Permalink
Module loaded without dependency of window.jQuery and one build Gulp
Browse files Browse the repository at this point in the history
script.
  • Loading branch information
jbolila committed Jun 19, 2014
1 parent f718f12 commit e6de590
Show file tree
Hide file tree
Showing 14 changed files with 360 additions and 205 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
node_modules/**
24 changes: 24 additions & 0 deletions .eslintrc
@@ -0,0 +1,24 @@
{
"env": {
"node": true
},

"rules": {
"brace-style": [2, "1tbs"],
"default-case": 2,
"func-style": [2, "declaration"],
"guard-for-in": 2,
"no-floating-decimal": 2,
"no-nested-ternary": 2,
"radix": 2,
"space-unary-word-ops": 2,
"space-after-keywords": [2, "always"],
"valid-jsdoc": [2, {
"prefer": {
"return": "returns"
}
}],
"quotes": [1, "single", "allow-avoiding-escaped-quotes"],
"wrap-iife": 2
}
}
17 changes: 16 additions & 1 deletion README.md
Expand Up @@ -13,10 +13,25 @@ Thanks for [akinoniku](https://github.com/akinoniku)'s suggestions on dialog app

## Use Guidances from contributors

<a href="https://gist.github.com/Genkilabs/bdcc5f62c5b46a8e0904">How to use bootstrap-dialog as Rails 4 confirm</a> - @[Genkilabs](https://github.com/Genkilabs)
<a href="https://gist.github.com/Genkilabs/bdcc5f62c5b46a8e0904">How to use bootstrap-dialog as Rails 4 confirm</a> - @[Genkilabs](https://github.com/Genkilabs)


================

## Build instructions:

Prepare:

```
npm install
```

Build:

```
gulp dist
```

================

Licensed under The MIT License.
152 changes: 76 additions & 76 deletions dist/css/bootstrap-dialog.css
@@ -1,120 +1,120 @@
.bootstrap-dialog {

/* dialog types */
/* dialog sizes */
/**
* Icon animation
* Copied from font-awesome: http://fontawesome.io/
**/
/** End of icon animation **/
}
.bootstrap-dialog .modal-header {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.bootstrap-dialog .bootstrap-dialog-title {
color: #fff;
display: inline-block;
color: #fff;
display: inline-block;
}
.bootstrap-dialog.type-default .bootstrap-dialog-title {
color: #333;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-title {
font-size: 16px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-title {
font-size: 24px;
.bootstrap-dialog .bootstrap-dialog-button-icon {
margin-right: 3px;
}
.bootstrap-dialog .bootstrap-dialog-close-button {
float: right;
filter:alpha(opacity=90);
-moz-opacity:0.9;
-khtml-opacity: 0.9;
opacity: 0.9;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
font-size: 20px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-close-button {
font-size: 30px;
float: right;
filter: alpha(opacity=90);
-moz-opacity: 0.9;
-khtml-opacity: 0.9;
opacity: 0.9;
}
.bootstrap-dialog .bootstrap-dialog-close-button:hover {
cursor: pointer;
filter: alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-message {
font-size: 14px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-message {
font-size: 18px;
cursor: pointer;
filter: alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
}
.bootstrap-dialog.type-default .modal-header {
background-color: #fff;
background-color: #fff;
}
.bootstrap-dialog.type-default .bootstrap-dialog-title {
color: #333;
}
.bootstrap-dialog.type-info .modal-header {
background-color: #5bc0de;
background-color: #5bc0de;
}
.bootstrap-dialog.type-primary .modal-header {
background-color: #428bca;
background-color: #428bca;
}
.bootstrap-dialog.type-success .modal-header {
background-color: #5cb85c;
background-color: #5cb85c;
}
.bootstrap-dialog.type-warning .modal-header {
background-color: #f0ad4e;
background-color: #f0ad4e;
}
.bootstrap-dialog.type-danger .modal-header {
background-color: #d9534f;
background-color: #d9534f;
}
.bootstrap-dialog .bootstrap-dialog-button-icon {
margin-right: 3px;
}

/**
* Icon animation
* Copied from font-awesome: http://fontawesome.io/
**/
.icon-spin {
display: inline-block;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
.bootstrap-dialog.size-normal .bootstrap-dialog-title {
font-size: 16px;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
font-size: 20px;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-message {
font-size: 14px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-title {
font-size: 24px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-close-button {
font-size: 30px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-message {
font-size: 18px;
}
.bootstrap-dialog .icon-spin {
display: inline-block;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
@-moz-keyframes spin {
0% {
0% {
-moz-transform: rotate(0deg);
}
100% {
}
100% {
-moz-transform: rotate(359deg);
}
}
}
@-webkit-keyframes spin {
0% {
0% {
-webkit-transform: rotate(0deg);
}
100% {
}
100% {
-webkit-transform: rotate(359deg);
}
}
}
@-o-keyframes spin {
0% {
0% {
-o-transform: rotate(0deg);
}
100% {
}
100% {
-o-transform: rotate(359deg);
}
}
}
@-ms-keyframes spin {
0% {
0% {
-ms-transform: rotate(0deg);
}
100% {
}
100% {
-ms-transform: rotate(359deg);
}
}
}
@keyframes spin {
0% {
0% {
transform: rotate(0deg);
}
100% {
}
100% {
transform: rotate(359deg);
}
}
}
/** End of icon animation **/
2 changes: 1 addition & 1 deletion dist/css/bootstrap-dialog.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions dist/js/bootstrap-dialog.js
@@ -1,3 +1,5 @@
/* global define */

/* ================================================
* Make use of Bootstrap's modal more monkey-friendly.
*
Expand All @@ -9,7 +11,25 @@
*
* Licensed under The MIT License.
* ================================================ */
(function($) {
(function(root, factory) {

"use strict";

// CommonJS module is defined
if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(require('jquery')(root));
}
// AMD module is defined
else if (typeof define === "function" && define.amd) {
define("bootstrap-dialog", ["jquery"], function($) {
return factory($);
});
} else {
// planted over the root!
root.BootstrapDialog = factory(root.jQuery);
}

}(this, function($) {

"use strict";

Expand Down Expand Up @@ -900,20 +920,6 @@
}).open();
};

BootstrapDialog.init = function() {
// check for nodeJS
var hasModule = (typeof module !== 'undefined' && module.exports);

// CommonJS module is defined
if (hasModule)
module.exports = BootstrapDialog;
else if (typeof define === "function" && define.amd)
define("bootstrap-dialog", function() {
return BootstrapDialog;
});
else
window.BootstrapDialog = BootstrapDialog;
};
BootstrapDialog.init();

})(window.jQuery);
}));

0 comments on commit e6de590

Please sign in to comment.