Submit
Path:
~
/
home
/
getwphos
/
www
/
cytogenx
/
wp-content
/
themes
/
labtechco
/
includes
/
libraries
/
bootstrap-iconpicker
/
js
/
File Content:
bootstrap-iconpicker.min.js
/*!======================================================================== * Bootstrap: bootstrap-iconpicker.js v1.7.0 by @recktoner * https://victor-valencia.github.com/bootstrap-iconpicker * ======================================================================== * Copyright 2013-2015 Victor Valencia Rico. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ======================================================================== */ !function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,this.$element.data()),this.options=a.extend({},this.options,d)};b.ICONSET_EMPTY={iconClass:"",iconClassFix:"",icons:[]},b.ICONSET={_custom:null,elusiveicon:a.iconset_elusiveicon||b.ICONSET_EMPTY,fontawesome:a.iconset_fontawesome||b.ICONSET_EMPTY,ionicon:a.iconset_ionicon||b.ICONSET_EMPTY,glyphicon:a.iconset_glyphicon||b.ICONSET_EMPTY,mapicon:a.iconset_mapicon||b.ICONSET_EMPTY,materialdesign:a.iconset_materialdesign||b.ICONSET_EMPTY,octicon:a.iconset_octicon||b.ICONSET_EMPTY,typicon:a.iconset_typicon||b.ICONSET_EMPTY,weathericon:a.iconset_weathericon||b.ICONSET_EMPTY},b.DEFAULTS={align:"center",arrowClass:"btn-primary",arrowNextIconClass:"glyphicon glyphicon-arrow-right",arrowPrevIconClass:"glyphicon glyphicon-arrow-left",cols:4,icon:"",iconset:"glyphicon",header:!0,labelHeader:"{0} / {1}",footer:!0,labelFooter:"{0} - {1} of {2}",placement:"bottom",rows:4,search:!0,searchText:"Search icon",selectedClass:"btn-warning",unselectedClass:"btn-default"},b.prototype.bindEvents=function(){var b=this.options,c=this;b.table.find(".btn-previous, .btn-next").off("click").on("click",function(d){d.preventDefault();var e=parseInt(a(this).val(),10);c.changeList(b.page+e)}),b.table.find(".btn-icon").off("click").on("click",function(d){d.preventDefault(),c.select(a(this).val()),b.inline===!1?c.$element.popover("destroy"):b.table.find("i."+a(this).val()).parent().addClass(b.selectedClass)}),b.table.find(".search-control").off("keyup").on("keyup",function(){c.changeList(1)})},b.prototype.changeList=function(a){this.filterIcons(),this.updateLabels(a),this.updateIcons(a),this.options.page=a,this.bindEvents()},b.prototype.filterIcons=function(){var c=this.options,d=c.table.find(".search-control").val();if(""===d)c.icons=b.ICONSET[c.iconset].icons;else{var e=[];a.each(b.ICONSET[c.iconset].icons,function(a,b){b.indexOf(d)>-1&&e.push(b)}),c.icons=e}},b.prototype.removeAddClass=function(a,b,c){return this.options.table.find(a).removeClass(b).addClass(c),c},b.prototype.reset=function(){this.updatePicker(),this.changeList(1)},b.prototype.select=function(b){var c=this.options,d=this.$element;c.selected=a.inArray(b.replace(c.iconClassFix,""),c.icons),c.selected===-1&&(c.selected=0,b=c.iconClassFix+c.icons[c.selected]),""!==b&&c.selected>=0&&(c.icon=b,c.inline===!1&&(d.find("input").val(b),d.find("i").attr("class","").addClass(c.iconClass).addClass(b)),b===c.iconClassFix?d.trigger({type:"change",icon:"empty"}):(b=c.iconClass+" "+b,d.trigger({type:"change",icon:b})),c.table.find("button."+c.selectedClass).removeClass(c.selectedClass))},b.prototype.switchPage=function(b){var c=this.options;if(c.selected=a.inArray(b.replace(c.iconClassFix,""),c.icons),c.selected>=0){var d=Math.ceil((c.selected+1)/this.totalIconsPerPage());this.changeList(d)}""===b?c.table.find("i."+c.iconClassFix).parent().addClass(c.selectedClass):c.table.find("i."+b).parent().addClass(c.selectedClass)},b.prototype.totalPages=function(){return Math.ceil(this.totalIcons()/this.totalIconsPerPage())},b.prototype.totalIcons=function(){return this.options.icons.length},b.prototype.totalIconsPerPage=function(){return 0===this.options.rows?this.options.icons.length:this.options.cols*this.options.rows},b.prototype.updateArrows=function(a){var b=this.options,c=this.totalPages();1===a?b.table.find(".btn-previous").addClass("disabled"):b.table.find(".btn-previous").removeClass("disabled"),a===c||0===c?b.table.find(".btn-next").addClass("disabled"):b.table.find(".btn-next").removeClass("disabled")},b.prototype.updateIcons=function(b){var c=this.options,d=c.table.find("tbody").empty(),e=(b-1)*this.totalIconsPerPage(),f=c.rows;0===c.rows&&(f=c.icons.length);for(var g=0;g<f;g++){for(var h=a("<tr></tr>"),i=0;i<c.cols;i++){var j=e+g*c.cols+i,k=a('<button class="btn '+c.unselectedClass+' btn-icon"></button>').hide();if(j<c.icons.length){var l=c.iconClassFix+c.icons[j];k.val(l).attr("title",l).append('<i class="'+c.iconClass+" "+l+'"></i>').show(),c.icon===l&&k.addClass(c.selectedClass).addClass("btn-icon-selected")}h.append(a("<td></td>").append(k))}d.append(h)}},b.prototype.updateIconsCount=function(){var a=this.options;if(a.footer===!0){var b=["<tr>",' <td colspan="'+a.cols+'" class="text-center">',' <span class="icons-count"></span>'," </td>","</tr>"];a.table.find("tfoot").empty().append(b.join(""))}},b.prototype.updateLabels=function(a){var b=this.options,c=this.totalIcons(),d=this.totalPages();b.table.find(".page-count").html(b.labelHeader.replace("{0}",0===d?0:a).replace("{1}",d));var e=(a-1)*this.totalIconsPerPage(),f=a*this.totalIconsPerPage();b.table.find(".icons-count").html(b.labelFooter.replace("{0}",e+1).replace("{1}",f<c?f:c).replace("{2}",c)),this.updateArrows(a)},b.prototype.updatePagesCount=function(){var b=this.options;if(b.header===!0){for(var c=a("<tr></tr>"),d=0;d<b.cols;d++){var e=a('<td class="text-center"></td>');if(0===d||d===b.cols-1){var f=['<button class="btn btn-arrow '+(0===d?"btn-previous":"btn-next")+" "+b.arrowClass+'" value="'+(0===d?-1:1)+'">','<span class="'+(0===d?b.arrowPrevIconClass:b.arrowNextIconClass)+'"></span>',"</button>"];e.append(f.join("")),c.append(e)}else 0===c.find(".page-count").length&&(e.attr("colspan",b.cols-2).append('<span class="page-count"></span>'),c.append(e))}b.table.find("thead").empty().append(c)}},b.prototype.updatePicker=function(){var a=this.options;if(a.cols<4)throw"Iconpicker => The number of columns must be greater than or equal to 4. [option.cols = "+a.cols+"]";if(a.rows<0)throw"Iconpicker => The number of rows must be greater than or equal to 0. [option.rows = "+a.rows+"]";this.updatePagesCount(),this.updateSearch(),this.updateIconsCount()},b.prototype.updateSearch=function(){var b=this.options,c=["<tr>",' <td colspan="'+b.cols+'">',' <input type="text" class="form-control search-control" style="width: '+39*b.cols+'px;" placeholder="'+b.searchText+'">'," </td>","</tr>"];c=a(c.join("")),b.search===!0?c.show():c.hide(),b.table.find("thead").append(c)},b.prototype.setAlign=function(a){this.$element.removeClass(this.options.align).addClass(a),this.options.align=a},b.prototype.setArrowClass=function(a){this.options.arrowClass=this.removeAddClass(".btn-arrow",this.options.arrowClass,a)},b.prototype.setArrowNextIconClass=function(a){this.options.arrowNextIconClass=this.removeAddClass(".btn-next > span",this.options.arrowNextIconClass,a)},b.prototype.setArrowPrevIconClass=function(a){this.options.arrowPrevIconClass=this.removeAddClass(".btn-previous > span",this.options.arrowPrevIconClass,a)},b.prototype.setCols=function(a){this.options.cols=a,this.reset()},b.prototype.setFooter=function(a){var b=this.options.table.find("tfoot");a===!0?b.show():b.hide(),this.options.footer=a},b.prototype.setHeader=function(a){var b=this.options.table.find("thead");a===!0?b.show():b.hide(),this.options.header=a},b.prototype.setIcon=function(a){this.select(a)},b.prototype.setIconset=function(c){var d=this.options;a.isPlainObject(c)?(b.ICONSET._custom=a.extend(b.ICONSET_EMPTY,c),d.iconset="_custom"):b.ICONSET.hasOwnProperty(c)?d.iconset=c:d.iconset=b.DEFAULTS.iconset,d=a.extend(d,b.ICONSET[d.iconset]),this.reset(),this.select(d.icon)},b.prototype.setLabelHeader=function(a){this.options.labelHeader=a,this.updateLabels(this.options.page)},b.prototype.setLabelFooter=function(a){this.options.labelFooter=a,this.updateLabels(this.options.page)},b.prototype.setPlacement=function(a){this.options.placement=a},b.prototype.setRows=function(a){this.options.rows=a,this.reset()},b.prototype.setSearch=function(a){var b=this.options.table.find(".search-control");a===!0?b.show():b.hide(),b.val(""),this.changeList(1),this.options.search=a},b.prototype.setSearchText=function(a){this.options.table.find(".search-control").attr("placeholder",a),this.options.searchText=a},b.prototype.setSelectedClass=function(a){this.options.selectedClass=this.removeAddClass(".btn-icon-selected",this.options.selectedClass,a)},b.prototype.setUnselectedClass=function(a){this.options.unselectedClass=this.removeAddClass(".btn-icon",this.options.unselectedClass,a)};var c=a.fn.iconpicker;a.fn.iconpicker=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.iconpicker"),g="object"==typeof c&&c;if(f||e.data("bs.iconpicker",f=new b(this,g)),"string"==typeof c){if("undefined"==typeof f[c])throw'Iconpicker => The "'+c+'" method does not exists.';f[c](d)}else{var h=f.options;h=a.extend(h,{inline:!1,page:1,selected:-1,table:a('<table class="table-icons"><thead></thead><tbody></tbody><tfoot></tfoot></table>')});var i="undefined"!=typeof e.attr("name")?'name="'+e.attr("name")+'"':"";"BUTTON"===e.prop("tagName")?(e.empty().append("<i></i>").append('<input type="hidden" '+i+"></input>").append('<span class="caret"></span>').addClass("iconpicker"),f.setIconset(h.iconset),e.on("click",function(a){a.preventDefault(),e.popover({animation:!1,trigger:"manual",html:!0,content:h.table,container:"body",placement:h.placement}).on("shown.bs.popover",function(){f.switchPage(h.icon),f.bindEvents()}),e.data("bs.popover").tip().addClass("iconpicker-popover"),e.popover("show")})):(h.inline=!0,f.setIconset(h.iconset),e.empty().append('<input type="hidden" '+i+"></input>").append(h.table).addClass("iconpicker").addClass(h.align),f.switchPage(h.icon),f.bindEvents())}})},a.fn.iconpicker.Constructor=b,a.fn.iconpicker.noConflict=function(){return a.fn.iconpicker=c,this},a(document).on("click","body",function(b){a(".iconpicker").each(function(){a(this).is(b.target)||0!==a(this).has(b.target).length||0!==a(".popover").has(b.target).length||a(this).popover("destroy")})}),a('button[role="iconpicker"],div[role="iconpicker"]').iconpicker()}(jQuery);
Submit
FILE
FOLDER
Name
Size
Permission
Action
bootstrap-iconpicker.js
20112 bytes
0644
bootstrap-iconpicker.min.js
10709 bytes
0644
N4ST4R_ID | Naxtarrr