From 6f873ec7d40e871c25b57c6a78310dd3495ea208 Mon Sep 17 00:00:00 2001 From: Adrian Crisan Date: Thu, 16 Oct 2014 19:02:59 +0300 Subject: [PATCH] Update bootstrap-iconpicker.min.js Minified after body click event syntax was changed --- bootstrap-iconpicker/js/bootstrap-iconpicker.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-iconpicker/js/bootstrap-iconpicker.min.js b/bootstrap-iconpicker/js/bootstrap-iconpicker.min.js index d39695a..4a70837 100644 --- a/bootstrap-iconpicker/js/bootstrap-iconpicker.min.js +++ b/bootstrap-iconpicker/js/bootstrap-iconpicker.min.js @@ -16,4 +16,4 @@ * See the License for the specific language governing permissions and * limitations under the License. * ======================================================================== */ -+function(e){"use strict";var t=function(n,o){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,this.$element.data()),this.options=e.extend({},this.options,o)};t.ICONSET={glyphicon:["adjust","align-center","align-justify","align-left","align-right","arrow-down","arrow-left","arrow-right","arrow-up","asterisk","backward","ban-circle","barcode","bell","bold","book","bookmark","briefcase","bullhorn","calendar","camera","certificate","check","chevron-down","chevron-left","chevron-right","chevron-up","circle-arrow-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","cloud","cloud-download","cloud-upload","cog","collapse-down","collapse-up","comment","compressed","copyright-mark","credit-card","cutlery","dashboard","download","download-alt","earphone","edit","eject","envelope","euro","exclamation-sign","expand","export","eye-close","eye-open","facetime-video","fast-backward","fast-forward","file","film","filter","fire","flag","flash","floppy-disk","floppy-open","floppy-remove","floppy-save","floppy-saved","folder-close","folder-open","font","forward","fullscreen","gbp","gift","glass","globe","hand-down","hand-left","hand-right","hand-up","hd-video","hdd","header","headphones","heart","heart-empty","home","import","inbox","indent-left","indent-right","info-sign","italic","leaf","link","list","list-alt","lock","log-in","log-out","magnet","map-marker","minus","minus-sign","move","music","new-window","off","ok","ok-circle","ok-sign","open","paperclip","pause","pencil","phone","phone-alt","picture","plane","play","play-circle","plus","plus-sign","print","pushpin","qrcode","question-sign","random","record","refresh","registration-mark","remove","remove-circle","remove-sign","repeat","resize-full","resize-horizontal","resize-small","resize-vertical","retweet","road","save","saved","screenshot","sd-video","search","send","share","share-alt","shopping-cart","signal","sort","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt","sound-5-1","sound-6-1","sound-7-1","sound-dolby","sound-stereo","star","star-empty","stats","step-backward","step-forward","stop","subtitles","tag","tags","tasks","text-height","text-width","th","th-large","th-list","thumbs-down","thumbs-up","time","tint","tower","transfer","trash","tree-conifer","tree-deciduous","unchecked","upload","usd","user","volume-down","volume-off","volume-up","warning-sign","wrench","zoom-in","zoom-out"],fa:e.fontawesome||[]},t.DEFAULTS={iconset:"glyphicon",icon:"",rows:4,cols:4,placement:"right"},t.prototype.createButtonBar=function(){for(var t=this.options,n=e(""),o=0;o'),i=e('');0==o||o==t.cols-1?(a.val(0==o?-1:1),a.addClass(0==o?"btn-previous":"btn-next"),a.find("span").addClass(0==o?"glyphicon-arrow-left":"glyphicon-arrow-right"),i.append(a),n.append(i)):0==n.find(".page-count").length&&(i.attr("colspan",t.cols-2).append(''),n.append(i))}t.table.find("thead").append(n)},t.prototype.updateButtonBar=function(e){var t=this.options,n=Math.ceil(t.icons.length/(t.cols*t.rows));t.table.find(".page-count").html(e+" / "+n);var o=t.table.find(".btn-previous"),a=t.table.find(".btn-next");1==e?o.addClass("disabled"):o.removeClass("disabled"),e==n?a.addClass("disabled"):a.removeClass("disabled")},t.prototype.bindEvents=function(){var t=this.options,n=this;t.table.find(".btn-previous, .btn-next").off("click").on("click",function(){var o=parseInt(e(this).val());n.changeList(t.page+o)}),t.table.find(".btn-icon").off("click").on("click",function(){n.select(e(this).val()),n.$element.popover("destroy")})},t.prototype.select=function(t){var n=this.options,o=this.$element;n.selected=e.inArray(t.replace(n.iconClassFix,""),n.icons),-1==n.selected&&(n.selected=0,t=n.iconClassFix+n.icons[n.selected]),""!=t&&n.selected>=0&&(n.icon=t,o.find("input").val(t),o.find("i").attr("class","").addClass(n.iconClass).addClass(t),o.trigger({type:"change",icon:t}),n.table.find("button.btn-warning").removeClass("btn-warning"))},t.prototype.switchPage=function(t){var n=this.options;if(n.selected=e.inArray(t.replace(n.iconClassFix,""),n.icons),""!=t&&n.selected>=0){var o=Math.ceil((n.selected+1)/(n.cols*n.rows));this.changeList(o)}n.table.find("."+t).parent().addClass("btn-warning")},t.prototype.changeList=function(t){var n=this.options;this.updateButtonBar(t);for(var o=n.table.find("tbody").empty(),a=(t-1)*n.rows*n.cols,i=0;i"),r=0;r').hide();if(c')}var d=e("").append(l);s.append(d)}o.append(s)}n.page=t,this.bindEvents()},t.prototype.setIcon=function(e){this.select(e)};var n=e.fn.iconpicker;e.fn.iconpicker=function(n,o){return this.each(function(){var a=e(this),i=a.data("bs.iconpicker"),s="object"==typeof n&&n;if(i||a.data("bs.iconpicker",i=new t(this,s)),"string"==typeof n)i[n](o);else{var r=i.options,c="fontawesome"==r.iconset?"fa":"glyphicon";r=e.extend(r,{icons:t.ICONSET[c],iconClass:c,iconClassFix:c+"-",page:1,selected:-1,table:e('
')});var l="undefined"!=typeof a.attr("name")?'name="'+a.attr("name")+'"':"";a.empty().append("").append('").append(''),a.addClass("iconpicker"),i.createButtonBar(),i.changeList(1),a.on("click",function(e){e.preventDefault(),a.popover({animation:!1,trigger:"manual",html:!0,content:i.options.table,container:"body",placement:i.options.placement}).on("shown.bs.popover",function(){i.switchPage(r.icon),i.bindEvents()}),a.data("bs.popover").tip().addClass("iconpicker-popover"),a.popover("show")}),i.select(r.icon)}})},e.fn.iconpicker.Constructor=t,e.fn.iconpicker.noConflict=function(){return e.fn.iconpicker=n,this},e("body").on("click",function(t){e(".iconpicker").each(function(){e(this).is(t.target)||0!==e(this).has(t.target).length||0!==e(".popover").has(t.target).length||e(this).popover("destroy")})}),e('button[role="iconpicker"]').iconpicker()}(window.jQuery); \ No newline at end of file ++function(e){"use strict";var t=function(n,o){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,this.$element.data()),this.options=e.extend({},this.options,o)};t.ICONSET={glyphicon:["adjust","align-center","align-justify","align-left","align-right","arrow-down","arrow-left","arrow-right","arrow-up","asterisk","backward","ban-circle","barcode","bell","bold","book","bookmark","briefcase","bullhorn","calendar","camera","certificate","check","chevron-down","chevron-left","chevron-right","chevron-up","circle-arrow-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","cloud","cloud-download","cloud-upload","cog","collapse-down","collapse-up","comment","compressed","copyright-mark","credit-card","cutlery","dashboard","download","download-alt","earphone","edit","eject","envelope","euro","exclamation-sign","expand","export","eye-close","eye-open","facetime-video","fast-backward","fast-forward","file","film","filter","fire","flag","flash","floppy-disk","floppy-open","floppy-remove","floppy-save","floppy-saved","folder-close","folder-open","font","forward","fullscreen","gbp","gift","glass","globe","hand-down","hand-left","hand-right","hand-up","hd-video","hdd","header","headphones","heart","heart-empty","home","import","inbox","indent-left","indent-right","info-sign","italic","leaf","link","list","list-alt","lock","log-in","log-out","magnet","map-marker","minus","minus-sign","move","music","new-window","off","ok","ok-circle","ok-sign","open","paperclip","pause","pencil","phone","phone-alt","picture","plane","play","play-circle","plus","plus-sign","print","pushpin","qrcode","question-sign","random","record","refresh","registration-mark","remove","remove-circle","remove-sign","repeat","resize-full","resize-horizontal","resize-small","resize-vertical","retweet","road","save","saved","screenshot","sd-video","search","send","share","share-alt","shopping-cart","signal","sort","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt","sound-5-1","sound-6-1","sound-7-1","sound-dolby","sound-stereo","star","star-empty","stats","step-backward","step-forward","stop","subtitles","tag","tags","tasks","text-height","text-width","th","th-large","th-list","thumbs-down","thumbs-up","time","tint","tower","transfer","trash","tree-conifer","tree-deciduous","unchecked","upload","usd","user","volume-down","volume-off","volume-up","warning-sign","wrench","zoom-in","zoom-out"],fa:e.fontawesome||[]},t.DEFAULTS={iconset:"glyphicon",icon:"",rows:4,cols:4,placement:"right"},t.prototype.createButtonBar=function(){for(var t=this.options,n=e(""),o=0;o'),i=e('');0==o||o==t.cols-1?(a.val(0==o?-1:1),a.addClass(0==o?"btn-previous":"btn-next"),a.find("span").addClass(0==o?"glyphicon-arrow-left":"glyphicon-arrow-right"),i.append(a),n.append(i)):0==n.find(".page-count").length&&(i.attr("colspan",t.cols-2).append(''),n.append(i))}t.table.find("thead").append(n)},t.prototype.updateButtonBar=function(e){var t=this.options,n=Math.ceil(t.icons.length/(t.cols*t.rows));t.table.find(".page-count").html(e+" / "+n);var o=t.table.find(".btn-previous"),a=t.table.find(".btn-next");1==e?o.addClass("disabled"):o.removeClass("disabled"),e==n?a.addClass("disabled"):a.removeClass("disabled")},t.prototype.bindEvents=function(){var t=this.options,n=this;t.table.find(".btn-previous, .btn-next").off("click").on("click",function(){var o=parseInt(e(this).val());n.changeList(t.page+o)}),t.table.find(".btn-icon").off("click").on("click",function(){n.select(e(this).val()),n.$element.popover("destroy")})},t.prototype.select=function(t){var n=this.options,o=this.$element;n.selected=e.inArray(t.replace(n.iconClassFix,""),n.icons),-1==n.selected&&(n.selected=0,t=n.iconClassFix+n.icons[n.selected]),""!=t&&n.selected>=0&&(n.icon=t,o.find("input").val(t),o.find("i").attr("class","").addClass(n.iconClass).addClass(t),o.trigger({type:"change",icon:t}),n.table.find("button.btn-warning").removeClass("btn-warning"))},t.prototype.switchPage=function(t){var n=this.options;if(n.selected=e.inArray(t.replace(n.iconClassFix,""),n.icons),""!=t&&n.selected>=0){var o=Math.ceil((n.selected+1)/(n.cols*n.rows));this.changeList(o)}n.table.find("."+t).parent().addClass("btn-warning")},t.prototype.changeList=function(t){var n=this.options;this.updateButtonBar(t);for(var o=n.table.find("tbody").empty(),a=(t-1)*n.rows*n.cols,i=0;i"),r=0;r').hide();if(c')}var d=e("").append(l);s.append(d)}o.append(s)}n.page=t,this.bindEvents()},t.prototype.setIcon=function(e){this.select(e)};var n=e.fn.iconpicker;e.fn.iconpicker=function(n,o){return this.each(function(){var a=e(this),i=a.data("bs.iconpicker"),s="object"==typeof n&&n;if(i||a.data("bs.iconpicker",i=new t(this,s)),"string"==typeof n)i[n](o);else{var r=i.options,c="fontawesome"==r.iconset?"fa":"glyphicon";r=e.extend(r,{icons:t.ICONSET[c],iconClass:c,iconClassFix:c+"-",page:1,selected:-1,table:e('
')});var l="undefined"!=typeof a.attr("name")?'name="'+a.attr("name")+'"':"";a.empty().append("").append('").append(''),a.addClass("iconpicker"),i.createButtonBar(),i.changeList(1),a.on("click",function(e){e.preventDefault(),a.popover({animation:!1,trigger:"manual",html:!0,content:i.options.table,container:"body",placement:i.options.placement}).on("shown.bs.popover",function(){i.switchPage(r.icon),i.bindEvents()}),a.data("bs.popover").tip().addClass("iconpicker-popover"),a.popover("show")}),i.select(r.icon)}})},e.fn.iconpicker.Constructor=t,e.fn.iconpicker.noConflict=function(){return e.fn.iconpicker=n,this},e(document).on("click","body",function(t){e(".iconpicker").each(function(){e(this).is(t.target)||0!==e(this).has(t.target).length||0!==e(".popover").has(t.target).length||e(this).popover("destroy")})}),e('button[role="iconpicker"]').iconpicker()}(window.jQuery);