Skip to content

Commit

Permalink
Support bootstrap v3.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nakupanda committed Mar 24, 2015
1 parent f921c8d commit 9b7745e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap3-dialog",
"description": "Make use of Bootstrap Modal more monkey-friendly. http://nakupanda.github.io/bootstrap3-dialog/",
"version": "1.34.2",
"version": "1.34.3",
"keywords": [
"css",
"js",
Expand Down
6 changes: 5 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
LASTEST NOT RELEASED
------------------------------
NONE

V1.34.3
------------------------------
* Fixed #125, a bug that dialog footer won't be shown if it was hidden by a no button realization. *
* Refs #126. Adding a data 'button' to the created button. Passing original event object to button callback action(dialog, event). *

* Support Bootstrap v3.3.4

V1.34.2
------------------------------
Expand Down
12 changes: 5 additions & 7 deletions dist/js/bootstrap-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@
version = 'v3.1';
} else if (/3\.2\.\d+/.test($.fn.modal.Constructor.VERSION)) {
version = 'v3.2';
} else if (/3\.3\.[1,2]/.test($.fn.modal.Constructor.VERSION)) {
version = 'v3.3'; // v3.3.1, v3.3.2
} else {
version = 'v3.3'; // v3.3+
version = 'v3.3.4';
}

return version;
Expand Down Expand Up @@ -136,6 +138,7 @@
}, this));
}
};
BootstrapDialogModal.METHODS_TO_OVERRIDE['v3.3.4'] = $.extend({}, BootstrapDialogModal.METHODS_TO_OVERRIDE['v3.3']);
BootstrapDialogModal.prototype = {
constructor: BootstrapDialogModal,
/**
Expand Down Expand Up @@ -189,14 +192,12 @@
* Some constants.
*/
BootstrapDialog.NAMESPACE = 'bootstrap-dialog';

BootstrapDialog.TYPE_DEFAULT = 'type-default';
BootstrapDialog.TYPE_INFO = 'type-info';
BootstrapDialog.TYPE_PRIMARY = 'type-primary';
BootstrapDialog.TYPE_SUCCESS = 'type-success';
BootstrapDialog.TYPE_WARNING = 'type-warning';
BootstrapDialog.TYPE_DANGER = 'type-danger';

BootstrapDialog.DEFAULT_TEXTS = {};
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO] = 'Information';
Expand All @@ -207,18 +208,15 @@
BootstrapDialog.DEFAULT_TEXTS['OK'] = 'OK';
BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
BootstrapDialog.DEFAULT_TEXTS['CONFIRM'] = 'Confirmation';

BootstrapDialog.SIZE_NORMAL = 'size-normal';
BootstrapDialog.SIZE_SMALL = 'size-small';
BootstrapDialog.SIZE_WIDE = 'size-wide'; // size-wide is equal to modal-lg
BootstrapDialog.SIZE_LARGE = 'size-large';

BootstrapDialog.BUTTON_SIZES = {};
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';

BootstrapDialog.ICON_SPINNER = 'glyphicon glyphicon-asterisk';

/**
Expand Down Expand Up @@ -308,7 +306,6 @@
!this.isRealized() && this.realize();
this.getModal().modal('show');
this.updateZIndex();
this.setOpened(true);

return this;
}
Expand All @@ -319,6 +316,7 @@
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open']
};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.3'] = {};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.3.4'] = $.extend({}, BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']);
BootstrapDialog.prototype = {
constructor: BootstrapDialog,
initOptions: function(options) {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap-dialog.min.js

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions examples/assets/bootstrap-dialog/js/bootstrap-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@
version = 'v3.1';
} else if (/3\.2\.\d+/.test($.fn.modal.Constructor.VERSION)) {
version = 'v3.2';
} else if (/3\.3\.[1,2]/.test($.fn.modal.Constructor.VERSION)) {
version = 'v3.3'; // v3.3.1, v3.3.2
} else {
version = 'v3.3'; // v3.3+
version = 'v3.3.4';
}

return version;
Expand Down Expand Up @@ -136,6 +138,7 @@
}, this));
}
};
BootstrapDialogModal.METHODS_TO_OVERRIDE['v3.3.4'] = $.extend({}, BootstrapDialogModal.METHODS_TO_OVERRIDE['v3.3']);
BootstrapDialogModal.prototype = {
constructor: BootstrapDialogModal,
/**
Expand Down Expand Up @@ -189,14 +192,12 @@
* Some constants.
*/
BootstrapDialog.NAMESPACE = 'bootstrap-dialog';

BootstrapDialog.TYPE_DEFAULT = 'type-default';
BootstrapDialog.TYPE_INFO = 'type-info';
BootstrapDialog.TYPE_PRIMARY = 'type-primary';
BootstrapDialog.TYPE_SUCCESS = 'type-success';
BootstrapDialog.TYPE_WARNING = 'type-warning';
BootstrapDialog.TYPE_DANGER = 'type-danger';

BootstrapDialog.DEFAULT_TEXTS = {};
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO] = 'Information';
Expand All @@ -207,18 +208,15 @@
BootstrapDialog.DEFAULT_TEXTS['OK'] = 'OK';
BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
BootstrapDialog.DEFAULT_TEXTS['CONFIRM'] = 'Confirmation';

BootstrapDialog.SIZE_NORMAL = 'size-normal';
BootstrapDialog.SIZE_SMALL = 'size-small';
BootstrapDialog.SIZE_WIDE = 'size-wide'; // size-wide is equal to modal-lg
BootstrapDialog.SIZE_LARGE = 'size-large';

BootstrapDialog.BUTTON_SIZES = {};
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';

BootstrapDialog.ICON_SPINNER = 'glyphicon glyphicon-asterisk';

/**
Expand Down Expand Up @@ -308,7 +306,6 @@
!this.isRealized() && this.realize();
this.getModal().modal('show');
this.updateZIndex();
this.setOpened(true);

return this;
}
Expand All @@ -319,6 +316,7 @@
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open']
};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.3'] = {};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.3.4'] = $.extend({}, BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']);
BootstrapDialog.prototype = {
constructor: BootstrapDialog,
initOptions: function(options) {
Expand Down

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
<html>
<head>
<script src="assets/jquery/jquery-1.10.2.min.js"></script>
<!--
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
-->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="assets/prettify/run_prettify.js"></script>
<link href="assets/bootstrap-dialog/css/bootstrap-dialog.min.css" rel="stylesheet" type="text/css" />
<script src="../src/js/bootstrap-dialog.js"></script>
<script src="assets/bootstrap-dialog/js/bootstrap-dialog.min.js"></script>
<meta charset="utf-8" />
<title>BootstrapDialog examples</title>
<style>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap3-dialog",
"version": "1.34.2",
"version": "1.34.3",
"description": "Make use of Bootstrap Modal more monkey-friendly.",
"private": true,
"directories": {
Expand Down

1 comment on commit 9b7745e

@avdv
Copy link

@avdv avdv commented on 9b7745e Apr 10, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you added support for Bootstrap 3.3.4 you should also reflect this fact in bower.json.

Running bower install bootstrap results in this message:

Unable to find a suitable version for bootstrap, please choose one:
    1) bootstrap#~3.1.1 which resolved to 3.1.1 and is required by bootstrap-dialog#1.34.3
    2) bootstrap#~3.3.2 which resolved to 3.3.4 and is required by adam
    3) bootstrap#>= 3.0.0 which resolved to 3.3.4 and is required by bootstrap-fileinput#4.1.8
    4) bootstrap#~3.3.4 which resolved to 3.3.4

So, bootstrap-dialog explicitely requires bootstrap version >= 3.1.1 && < 3.2.0.

Please change this to e.g. 3.1.1 - 3.3.4. Thanks!

Please sign in to comment.