# HG changeset patch # User Thierry Florac # Date 1454078160 -3600 # Node ID e0fb6fd568ebb3162713b351a1821fc85513ec0b # Parent 0fff49179f6dafd06f87af497f6249d98883c7bf Plug-ins updates diff -r 0fff49179f6d -r e0fb6fd568eb src/ztfy/myams/__init__.py --- a/src/ztfy/myams/__init__.py Mon Dec 07 14:31:56 2015 +0100 +++ b/src/ztfy/myams/__init__.py Fri Jan 29 15:36:00 2016 +0100 @@ -39,8 +39,8 @@ minified='css/ext/bootstrap-modal.min.css', depends=[bootstrap_css, ]) -awesomefonts_css = Resource(library, 'css/ext/font-awesome-4.3.0.css', - minified='css/ext/font-awesome-4.3.0.min.css', +awesomefonts_css = Resource(library, 'css/ext/font-awesome-4.5.0.css', + minified='css/ext/font-awesome-4.5.0.min.css', depends=[bootstrap_css, ]) myams_css = Resource(library, 'css/myams.css', diff -r 0fff49179f6d -r e0fb6fd568eb src/ztfy/myams/configure.zcml --- a/src/ztfy/myams/configure.zcml Mon Dec 07 14:31:56 2015 +0100 +++ b/src/ztfy/myams/configure.zcml Fri Jan 29 15:36:00 2016 +0100 @@ -221,7 +221,7 @@ @@ -231,7 +231,7 @@ diff -r 0fff49179f6d -r e0fb6fd568eb src/ztfy/myams/resources/js/ext/bootstrap-modalmanager.js --- a/src/ztfy/myams/resources/js/ext/bootstrap-modalmanager.js Mon Dec 07 14:31:56 2015 +0100 +++ b/src/ztfy/myams/resources/js/ext/bootstrap-modalmanager.js Fri Jan 29 15:36:00 2016 +0100 @@ -18,7 +18,7 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; /* MODAL MANAGER CLASS DEFINITION * ====================== */ @@ -33,7 +33,7 @@ init: function (element, options) { this.$element = $(element); - this.options = $.extend({}, $.fn.modalmanager.defaults, this.$element.data(), typeof options == 'object' && options); + this.options = $.extend({}, $.fn.modalmanager.defaults, this.$element.data(), typeof options === 'object' && options); this.stack = []; this.backdropCount = 0; @@ -42,10 +42,14 @@ that = this; $(window).on('resize.modal', function () { - resizeTimeout && clearTimeout(resizeTimeout); + if (resizeTimeout) { + clearTimeout(resizeTimeout); + } resizeTimeout = setTimeout(function () { for (var i = 0; i < that.stack.length; i++) { - that.stack[i].isShown && that.stack[i].layout(); + if (that.stack[i].isShown) { + that.stack[i].layout(); + } } }, 10); }); @@ -82,9 +86,9 @@ modal.$element.show(); if (transition) { - //modal.$element[0].style.display = 'run-in'; + //modal.$element[0].style.display = 'run-in'; modal.$element[0].offsetWidth; - //modal.$element.one($.support.transition.end, function () { modal.$element[0].style.display = 'block' }); + //modal.$element.one($.support.transition.end, function () { modal.$element[0].style.display = 'block' }); } modal.layout(); @@ -98,15 +102,19 @@ modal.$element.trigger('shown'); }; - transition ? - modal.$element.one($.support.transition.end, complete) : + if (transition) { + modal.$element.one($.support.transition.end, complete); + } else { complete(); + } }); }; - modal.options.replace ? - that.replace(showModal) : + if (modal.options.replace) { + that.replace(showModal); + } else { showModal(); + } })); modal.$element.on('hidden.modalmanager', targetIsSelf(function (e) { @@ -117,14 +125,17 @@ } else if (modal.$backdrop) { var transition = $.support.transition && modal.$element.hasClass('fade'); - // trigger a relayout due to firebox's buggy transition end event - if (transition) + // trigger a relayout due to firefox's buggy transition end event + if (transition) { modal.$element[0].offsetWidth; - $.support.transition && modal.$element.hasClass('fade') ? + } + if ($.support.transition && modal.$element.hasClass('fade')) { modal.$backdrop.one($.support.transition.end, function () { modal.destroy(); - }) : + }); + } else { modal.destroy(); + } } else { modal.destroy(); } @@ -139,7 +150,9 @@ getOpenModals: function () { var openModals = []; for (var i = 0; i < this.stack.length; i++) { - if (this.stack[i].isShown) openModals.push(this.stack[i]); + if (this.stack[i].isShown) { + openModals.push(this.stack[i]); + } } return openModals; @@ -153,17 +166,23 @@ var topModal; for (var i = 0; i < this.stack.length; i++) { - if (this.stack[i].isShown) topModal = this.stack[i]; + if (this.stack[i].isShown) { + topModal = this.stack[i]; + } } - if (!topModal) return; + if (!topModal) { + return; + } topModal.focus(); }, destroyModal: function (modal) { modal.$element.off('.modalmanager'); - if (modal.$backdrop) this.removeBackdrop(modal); + if (modal.$backdrop) { + this.removeBackdrop(modal); + } this.stack.splice(this.getIndexOfModal(modal), 1); var hasOpenModal = this.hasOpenModal(); @@ -185,7 +204,9 @@ getIndexOfModal: function (modal) { for (var i = 0; i < this.stack.length; i++) { - if (modal === this.stack[i]) return i; + if (modal === this.stack[i]) { + return i; + } } }, @@ -193,15 +214,19 @@ var topModal; for (var i = 0; i < this.stack.length; i++) { - if (this.stack[i].isShown) topModal = this.stack[i]; + if (this.stack[i].isShown) { + topModal = this.stack[i]; + } } if (topModal) { this.$backdropHandle = topModal.$backdrop; topModal.$backdrop = null; - callback && topModal.$element.one('hidden', - targetIsSelf($.proxy(callback, this))); + if (callback) { + topModal.$element.one('hidden', + targetIsSelf($.proxy(callback, this))); + } topModal.hide(); } else if (callback) { @@ -225,7 +250,9 @@ $backdrop = this.$backdropHandle; $backdrop.off('.modalmanager'); this.$backdropHandle = null; - this.isLoading && this.removeSpinner(); + if (this.isLoading) { + this.removeSpinner(); + } } return $backdrop; @@ -243,11 +270,11 @@ .css('z-index', getzIndex('modal', this.getOpenModals().length)) .appendTo(this.$element); - if (modal && modal.options.backdrop != 'static') { + if (modal && modal.options.backdrop === 'hide') { $container.on('click.modal', targetIsSelf(function (e) { modal.hide(); })); - } else if (modal) { + } else if (modal && modal.options.backdrop === 'attention') { $container.on('click.modal', targetIsSelf(function (e) { modal.attention(); })); @@ -269,15 +296,19 @@ modal.$backdrop.css('z-index', getzIndex('backdrop', this.getOpenModals().length)); - if (doAnimate) modal.$backdrop[0].offsetWidth; // force reflow + if (doAnimate) { + modal.$backdrop[0].offsetWidth; + } // force reflow modal.$backdrop.addClass('in'); this.backdropCount += 1; - doAnimate ? - modal.$backdrop.one($.support.transition.end, callback) : + if (doAnimate) { + modal.$backdrop.one($.support.transition.end, callback); + } else { callback(); + } } else if (!modal.isShown && modal.$backdrop) { modal.$backdrop.removeClass('in'); @@ -286,11 +317,13 @@ var that = this; - $.support.transition && modal.$element.hasClass('fade') ? + if ($.support.transition && modal.$element.hasClass('fade')) { modal.$backdrop.one($.support.transition.end, function () { - that.removeBackdrop(modal) - }) : + that.removeBackdrop(modal); + }); + } else { that.removeBackdrop(modal); + } } else if (callback) { callback(); @@ -298,13 +331,17 @@ }, removeSpinner: function () { - this.$spinner && this.$spinner.remove(); + if (this.$spinner) { + this.$spinner.remove(); + } this.$spinner = null; this.isLoading = false; }, removeLoading: function () { - this.$backdropHandle && this.$backdropHandle.remove(); + if (this.$backdropHandle) { + this.$backdropHandle.remove(); + } this.$backdropHandle = null; this.removeSpinner(); }, @@ -339,19 +376,23 @@ this.isLoading = true; - $.support.transition ? - this.$backdropHandle.one($.support.transition.end, callback) : + if ($.support.transition) { + this.$backdropHandle.one($.support.transition.end, callback); + } else { callback(); + } } else if (this.isLoading && this.$backdropHandle) { this.$backdropHandle.removeClass('in'); var that = this; - $.support.transition ? + if ($.support.transition) { this.$backdropHandle.one($.support.transition.end, function () { - that.removeLoading() - }) : + that.removeLoading(); + }); + } else { that.removeLoading(); + } } else if (callback) { callback(this.isLoading); @@ -373,9 +414,9 @@ var $baseModal = $('