/*! jQuery Migrate v3.3.2 | (c) OpenJS Foundation and other contributors | jquery.org/license */
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],i=1;i<=3;i++){if(+o[i]<+n[i])return 1;if(+n[i]<+o[i])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.3.2",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var r={};function u(e){var t=n.console;s.migrateDeduplicateWarnings&&r[e]||(r[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n),r},set:function(e){u(n),r=e}})}function o(e,t,r,n){e[t]=function(){return u(n),r.apply(this,arguments)}}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){r={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("jQuery is not compatible with Quirks Mode");var i,a,c,d={},l=s.fn.init,p=s.find,f=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,y=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(i in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(u("jQuery( '#' ) is not a valid selector"),t[0]=[]),l.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&f.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(y,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("Attribute selector with '#' was not fixed: "+r[0])}}return p.apply(this,r)},p)Object.prototype.hasOwnProperty.call(p,i)&&(s.find[i]=p[i]);o(s.fn,"size",function(){return this.length},"jQuery.fn.size() is deprecated and removed; use the .length property"),o(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"jQuery.parseJSON is deprecated; use JSON.parse"),o(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),o(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&o(s,"trim",function(e){return null==e?"":(e+"").replace(m,"")},"jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(o(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"jQuery.nodeName is deprecated"),o(s,"isArray",Array.isArray,"jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(o(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()}),o(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[Object.prototype.toString.call(e)]||"object":typeof e},"jQuery.type is deprecated"),o(s,"isFunction",function(e){return"function"==typeof e},"jQuery.isFunction() is deprecated"),o(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated")),s.ajax&&(a=s.ajax,c=/(=)\?(?=&|$)|\?\?/,s.ajax=function(){var e=a.apply(this,arguments);return e.promise&&(o(e,"success",e.done,"jQXHR.success is deprecated and removed"),o(e,"error",e.fail,"jQXHR.error is deprecated and removed"),o(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e},e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(c.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&c.test(e.data))&&u("JSON-to-JSONP auto-promotion is deprecated")}));var g=s.fn.removeAttr,h=s.fn.toggleClass,v=/\S+/g;function j(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}s.fn.removeAttr=function(e){var r=this;return s.each(e.match(v),function(e,t){s.expr.match.bool.test(t)&&(u("jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),g.apply(this,arguments)};var Q,b=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?h.apply(this,arguments):(u("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))}),w=/^[a-z]/,x=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return b=!0,e=r.apply(this,arguments),b=!1,e})}),s.swap=function(e,t,r,n){var o,i,a={};for(i in b||u("jQuery.swap() is undocumented and deprecated"),t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=r.apply(e,n||[]),t)e.style[i]=a[i];return o},e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("JQMIGRATE: jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),s.cssNumber||(s.cssNumber={}),Q=s.fn.css,s.fn.css=function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=j(e),n=r,w.test(n)&&x.test(n[0].toUpperCase()+n.slice(1))||s.cssNumber[r]||u('Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))};var A,k,S,M,N=s.data;s.data=function(e,t,r){var n,o,i;if(t&&"object"==typeof t&&2===arguments.length){for(i in n=s.hasData(e)&&N.call(this,e),o={},t)i!==j(i)?(u("jQuery.data() always sets/gets camelCased names: "+i),n[i]=t[i]):o[i]=t[i];return N.call(this,e,o),t}return t&&"string"==typeof t&&t!==j(t)&&(n=s.hasData(e)&&N.call(this,e))&&t in n?(u("jQuery.data() always sets/gets camelCased names: "+t),2");t!==e&&T(e)!==T(t)&&u("HTML tags must be properly nested and closed: "+e)}var O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,q=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return P(e),e.replace(O,"<$1>")}},s.htmlPrefilter=function(e){return P(e),q(e)};var D,_=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(u("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(D=s.param,s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)});var E,F,J=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),J.apply(this,arguments)},s.Deferred&&(E=s.Deferred,F=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var i=E(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(F,function(e,t){var r="function"==typeof o[e]&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=E.exceptionHook),s});
;
jQuery(document).ready(function(){jQuery("#buddypress").on("click","a.confirm",function(){return!!confirm(BP_Confirm.are_you_sure)})});;
function member_widget_click_handler(){jQuery(".widget div#members-list-options a").on("click",function(){var e=this;return jQuery(e).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(t){jQuery(e).removeClass("loading"),member_widget_response(t)}),!1})}function member_widget_response(e){e=e.substr(0,e.length-1),"-1"!==(e=e.split("[[SPLIT]]"))[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(e[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var t="
"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())+1)),u.removeClass("fav"),u.addClass("unfav")):(u.removeClass("unfav"),u.addClass("fav"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())-1),Number(jq(".item-list-tabs ul #activity-favorites span").html())||(jq(".item-list-tabs ul #activity-favorites").hasClass("selected")&&bp_activity_request(null,null),jq(".item-list-tabs ul #activity-favorites").remove())),"activity-favorites"===jq(".item-list-tabs li.selected").attr("id")&&u.closest(".activity-item").slideUp(100)}),!1):u.hasClass("delete-activity")?(r=u.parents("div.activity ul li"),n=r.attr("id").substr(9,r.attr("id").length),o=u.attr("href"),c=o.split("_wpnonce="),l=r.prop("class").match(/date-recorded-([0-9]+)/),c=c[1],u.addClass("loading"),jq.post(ajaxurl,{action:"delete_activity",cookie:bp_get_cookies(),id:n,_wpnonce:c},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.hasClass("spam-activity")?(r=u.parents("div.activity ul li"),l=r.prop("class").match(/date-recorded-([0-9]+)/),u.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:r.attr("id").substr(9,r.attr("id").length),_wpnonce:u.attr("href").split("_wpnonce=")[1]},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.parent().hasClass("load-more")?(bp_ajax_request&&bp_ajax_request.abort(),jq("#buddypress li.load-more").addClass("loading"),d=e+1,p=[],jq(".activity-list li.just-posted").each(function(){p.push(jq(this).attr("id").replace("activity-",""))}),load_more_args={action:"activity_get_older_updates",cookie:bp_get_cookies(),page:d,exclude_just_posted:p.join(",")},load_more_search=bp_get_querystring("s"),load_more_search&&(load_more_args.search_terms=load_more_search),bp_ajax_request=jq.post(ajaxurl,load_more_args,function(t){jq("#buddypress li.load-more").removeClass("loading"),e=d,jq("#buddypress ul.activity-list").append(t.contents),u.parent().hide()},"json"),!1):void(u.parent().hasClass("load-newest")&&(t.preventDefault(),u.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(e,t){"LI"===t.nodeName&&jq(t).hasClass("just-posted")&&jq("#"+jq(t).attr("id")).length&&jq("#"+jq(t).attr("id")).remove()}),jq("#buddypress ul.activity-list").prepend(newest_activities),newest_activities=""))}),jq("div.activity").on("click",".activity-read-more a",function(e){var t,i,a=jq(e.target),s=a.parent().attr("id").split("-"),r=s[3],n=s[0];return t="acomment"===n?"acomment-content":"activity-inner",i=jq("#"+n+"-"+r+" ."+t+":first"),jq(a).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:r},function(e){jq(i).slideUp(300).html(e).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(e){var t,i,a,s,r,n,o,c,l,d,p,u,m,h,_,v=jq(e.target);return v.hasClass("acomment-reply")||v.parent().hasClass("acomment-reply")?(v.parent().hasClass("acomment-reply")&&(v=v.parent()),t=v.attr("id"),i=t.split("-"),a=i[2],s=v.attr("href").substr(10,v.attr("href").length),(r=jq("#ac-form-"+a)).css("display","none"),r.removeClass("root"),jq(".ac-form").hide(),r.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),"comment"!==i[1]?jq("#acomment-"+s).append(r):jq("#activity-"+a+" .activity-comments").append(r),r.parent().hasClass("activity-comments")&&r.addClass("root"),r.slideDown(200),jq.scrollTo(r,500,{offset:-100,easing:"swing"}),jq("#ac-form-"+i[2]+" textarea").focus(),!1):"ac_form_submit"===v.attr("name")?(r=v.parents("form"),n=r.parent(),o=r.attr("id").split("-"),c=n.hasClass("activity-comments")?o[2]:n.attr("id").split("-")[1],content=jq("#"+r.attr("id")+" textarea"),jq("#"+r.attr("id")+" div.error").hide(),v.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),l={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment").val(),comment_id:c,form_id:o[2],content:content.val()},(d=jq("#_bp_as_nonce_"+c).val())&&(l["_bp_as_nonce_"+c]=d),jq.post(ajaxurl,l,function(e){if(v.removeClass("loading"),content.removeClass("loading"),e[0]+e[1]==="-1")r.append(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t=r.parent();r.fadeOut(200,function(){0===t.children("ul").length&&(t.hasClass("activity-comments")?t.prepend("
"))})});;
/*
* jquery.sumoselect - v3.0.3
* http://hemantnegi.github.io/jquery.sumoselect
* 2016-12-12
*
* Copyright 2015 Hemant Negi
* Email : hemant.frnz@gmail.com
* Compressor http://refresh-sf.com/
*/
(function(factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof exports !== 'undefined') {
module.exports = factory(require('jquery'));
} else {
factory(jQuery);
}
})(function ($) {
'namespace sumo';
$.fn.SumoSelect = function (options) {
/* This is the easiest way to have default options.*/
var settings = $.extend({
placeholder: 'Select Here', /* Dont change it here.*/
csvDispCount: 3, /* display no. of items in multiselect. 0 to display all.*/
captionFormat:'{0} Selected', /* format of caption text. you can set your locale.*/
captionFormatAllSelected:'{0} all selected!', /* format of caption text when all elements are selected. set null to use captionFormat. It will not work if there are disabled elements in select.*/
floatWidth: 400, /* Screen width of device at which the list is rendered in floating popup fashion.*/
forceCustomRendering: false, /* force the custom modal on all devices below floatWidth resolution.*/
nativeOnDevice: ['Android', 'BlackBerry', 'iPhone', 'iPad', 'iPod', 'Opera Mini', 'IEMobile', 'Silk'],
outputAsCSV: false, /* true to POST data as csv ( false for Html control array ie. default select )*/
csvSepChar: ',', /* separation char in csv mode*/
okCancelInMulti: false, /* display ok cancel buttons in desktop mode multiselect also.*/
isClickAwayOk: false, /* for okCancelInMulti=true. sets whether click outside will trigger Ok or Cancel (default is cancel).*/
triggerChangeCombined: true, /* im multi select mode whether to trigger change event on individual selection or combined selection.*/
selectAll: false, /* to display select all button in multiselect mode.|| also select all will not be available on mobile devices.*/
search: false, /* to display input for filtering content. selectAlltext will be input text placeholder*/
searchText: 'Search...', /* placeholder for search input*/
noMatch: 'No matches for "{0}"',
prefix: '', /* some prefix usually the field name. eg. 'Hello'*/
locale: ['OK', 'Cancel', 'Select All'], /* all text that is used. don't change the index.*/
up: false, /* set true to open upside.*/
showTitle: true /* set to false to prevent title (tooltip) from appearing*/
}, options);
var ret = this.each(function () {
var selObj = this; /* the original select object.*/
if (this.sumo || !$(this).is('select')) return; /* already initialized*/
this.sumo = {
E: $(selObj), /* the jquery object of original select element.*/
is_multi: $(selObj).attr('multiple'), /* if its a multiple select*/
select: '',
caption: '',
placeholder: '',
optDiv: '',
CaptionCont: '',
ul:'',
is_floating: false,
is_opened: false,
/* backdrop: '', */
mob:false, /* if to open device default select */
Pstate: [],
createElems: function () {
var O = this;
O.E.wrap('
');
O.select = O.E.parent();
O.caption = $('');
O.CaptionCont = $('')
.attr('style', O.E.attr('style'))
.prepend(O.caption);
O.select.append(O.CaptionCont);
/* default turn off if no multiselect */
if(!O.is_multi)settings.okCancelInMulti = false
if(O.E.attr('disabled'))
O.select.addClass('disabled').removeAttr('tabindex');
/* if output as csv and is a multiselect.*/
if (settings.outputAsCSV && O.is_multi && O.E.attr('name')) {
/* create a hidden field to store csv value.*/
O.select.append($('').attr('name', O.E.attr('name')).val(O.getSelStr()));
/* so it can not post the original select.*/
O.E.removeAttr('name');
}
/* break for mobile rendring.. if forceCustomRendering is false*/
if (O.isMobile() && !settings.forceCustomRendering) {
O.setNativeMobile();
return;
}
/* if there is a name attr in select add a class to container div*/
if(O.E.attr('name')) O.select.addClass('sumo_'+O.E.attr('name').replace(/\[\]/, ''))
/* hide original select */
O.E.addClass('SumoUnder').attr('tabindex','-1');
/* Creating the list... */
O.optDiv = $('
');
/* branch for floating list in low res devices.*/
O.floatingList();
/* Creating the markup for the available options*/
O.ul = $('
');
O.optDiv.append(O.ul);
/* Select all functionality*/
if(settings.selectAll && O.is_multi) O.SelAll();
/* search functionality*/
if(settings.search) O.Search();
O.ul.append(O.prepItems(O.E.children()));
/* if multiple then add the class multiple and add OK / CANCEL button */
if (O.is_multi) O.multiSelelect();
O.select.append(O.optDiv);
O.basicEvents();
O.selAllState();
},
prepItems: function(opts, d){
var lis = [], O=this;
$(opts).each(function (i, opt) { /* parsing options to li */
opt = $(opt);
lis.push(opt.is('optgroup')?
$('
')
.find('ul')
.append(O.prepItems(opt.children(), opt[0].disabled))
.end()
:
O.createLi(opt, d)
);
});
return lis;
},
/* Creates a LI element from a given option and binds events to it*/
/*returns the jquery instance of li (not inserted in dom)*/
createLi: function (opt, d) {
var O = this;
if(!opt.attr('value'))opt.attr('value',opt.val());
var li = $('');
li.data('opt', opt); /* store a direct reference to option.*/
opt.data('li', li); /* store a direct reference to list item.*/
if (O.is_multi) li.prepend('');
if (opt[0].disabled || d)
li = li.addClass('disabled');
O.onOptClick(li);
if (opt[0].selected)
li.addClass('selected');
if (opt.attr('class'))
li.addClass(opt.attr('class'));
if (opt.attr('title'))
li.attr('title', opt.attr('title'));
return li;
},
/* Returns the selected items as string in a Multiselect.*/
getSelStr: function () {
/* get the pre selected items.*/
sopt = [];
this.E.find('option:selected').each(function () { sopt.push($(this).val()); });
return sopt.join(settings.csvSepChar);
},
/* THOSE OK/CANCEL BUTTONS ON MULTIPLE SELECT.*/
multiSelelect: function () {
var O = this;
O.optDiv.addClass('multiple');
O.okbtn = $('
'+settings.locale[0]+'
').click(function () {
/* if combined change event is set.*/
O._okbtn();
O.hideOpts();
});
O.cancelBtn = $('
').append(btns));
/* handling keyboard navigation on ok cancel buttons. */
btns.on('keydown.sumo', function (e) {
var el = $(this);
switch (e.which) {
case 32: /* space */
case 13: /* enter */
el.trigger('click');
break;
case 9: /* tab */
if(el.hasClass('btnOk'))return;
case 27: /* esc */
O._cnbtn();
O.hideOpts();
return;
}
e.stopPropagation();
e.preventDefault();
});
},
_okbtn:function(){
var O = this, cg = 0;
/* if combined change event is set. */
if (settings.triggerChangeCombined) {
/* check for a change in the selection. */
if (O.E.find('option:selected').length != O.Pstate.length) {
cg = 1;
}
else {
O.E.find('option').each(function (i,e) {
if(e.selected && O.Pstate.indexOf(i) < 0) cg = 1;
});
}
if (cg) {
O.callChange();
O.setText();
}
}
},
_cnbtn:function(){
var O = this;
/* remove all selections */
O.E.find('option:selected').each(function () { this.selected = false; });
O.optDiv.find('li.selected').removeClass('selected')
/* restore selections from saved state. */
for(var i = 0; i < O.Pstate.length; i++) {
O.E.find('option')[O.Pstate[i]].selected = true;
O.ul.find('li.opt').eq(O.Pstate[i]).addClass('selected');
}
O.selAllState();
},
SelAll:function(){
var O = this;
if(!O.is_multi)return;
O.selAll = $('
');
O.optDiv.addClass('selall');
O.selAll.on('click',function(){
O.selAll.toggleClass('selected');
O.toggSelAll(O.selAll.hasClass('selected'), 1);
//O.selAllState();
});
O.optDiv.prepend(O.selAll);
},
/* search module (can be removed if not required.) */
Search: function(){
var O = this,
cc = O.CaptionCont.addClass('search'),
P = $('
');
O.ftxt = $('')
.on('click', function(e){
e.stopPropagation();
});
cc.append(O.ftxt);
O.optDiv.children('ul').after(P);
O.ftxt.on('keyup.sumo',function(){
var hid = O.optDiv.find('ul.options li.opt').each(function(ix,e){
var e = $(e),
opt = e.data('opt')[0];
opt.hidden = e.text().toLowerCase().indexOf(O.ftxt.val().toLowerCase()) < 0;
e.toggleClass('hidden', opt.hidden);
}).not('.hidden');
P.html(settings.noMatch.replace(/\{0\}/g, '')).toggle(!hid.length);
P.find('em').text(O.ftxt.val());
O.selAllState();
});
},
selAllState: function () {
var O = this;
if (settings.selectAll && O.is_multi) {
var sc = 0, vc = 0;
O.optDiv.find('li.opt').not('.hidden').each(function (ix, e) {
if ($(e).hasClass('selected')) sc++;
if (!$(e).hasClass('disabled')) vc++;
});
/* select all checkbox state change. */
if (sc == vc) O.selAll.removeClass('partial').addClass('selected');
else if (sc == 0) O.selAll.removeClass('selected partial');
else O.selAll.addClass('partial') /* .removeClass('selected'); */
}
},
showOpts: function () {
var O = this;
if (O.E.attr('disabled')) return; /* if select is disabled then retrun */
O.E.trigger('sumo:opening', O);
O.is_opened = true;
O.select.addClass('open').attr('aria-expanded', 'true');
O.E.trigger('sumo:opened', O);
if(O.ftxt)O.ftxt.focus();
else O.select.focus();
/* hide options on click outside.*/
$(document).on('click.sumo', function (e) {
if (!O.select.is(e.target) /* if the target of the click isn't the container... */
&& O.select.has(e.target).length === 0){ /* ... nor a descendant of the container */
if(!O.is_opened)return;
O.hideOpts();
if (settings.okCancelInMulti){
if(settings.isClickAwayOk)
O._okbtn();
else
O._cnbtn();
}
}
});
if (O.is_floating) {
H = O.optDiv.children('ul').outerHeight() + 2; /* +2 is clear fix*/
if (O.is_multi) H = H + parseInt(O.optDiv.css('padding-bottom'));
O.optDiv.css('height', H);
$('body').addClass('sumoStopScroll');
}
O.setPstate();
},
/* maintain state when ok/cancel buttons are available storing the indexes. */
setPstate: function(){
var O = this;
if (O.is_multi && (O.is_floating || settings.okCancelInMulti)){
O.Pstate = [];
/* assuming that find returns elements in tree order */
O.E.find('option').each(function (i, e){if(e.selected) O.Pstate.push(i);});
}
},
callChange:function(){
this.E.trigger('change').trigger('click');
},
hideOpts: function () {
var O = this;
if(O.is_opened){
O.E.trigger('sumo:closing', O);
O.is_opened = false;
O.select.removeClass('open').attr('aria-expanded', 'true').find('ul li.sel').removeClass('sel');
O.E.trigger('sumo:closed', O);
$(document).off('click.sumo');
O.select.focus();
$('body').removeClass('sumoStopScroll');
/* clear the search */
if(settings.search){
O.ftxt.val('');
O.ftxt.trigger('keyup.sumo');
}
}
},
setOnOpen: function () {
var O = this,
li = O.optDiv.find('li.opt:not(.hidden)').eq(settings.search?0:O.E[0].selectedIndex);
if(li.hasClass('disabled')){
li = li.next(':not(disabled)')
if(!li.length) return;
}
O.optDiv.find('li.sel').removeClass('sel');
li.addClass('sel');
O.showOpts();
},
nav: function (up) {
var O = this, c,
s=O.ul.find('li.opt:not(.disabled, .hidden)'),
sel = O.ul.find('li.opt.sel:not(.hidden)'),
idx = s.index(sel);
if (O.is_opened && sel.length) {
if (up && idx > 0)
c = s.eq(idx-1);
else if(!up && idx < s.length-1 && idx > -1)
c = s.eq(idx+1);
else return; /* if no items before or after*/
sel.removeClass('sel');
sel = c.addClass('sel');
/* setting sel item to visible view. */
var ul = O.ul,
st = ul.scrollTop(),
t = sel.position().top + st;
if(t >= st + ul.height()-sel.outerHeight())
ul.scrollTop(t - ul.height() + sel.outerHeight());
if(t= settings.csvDispCount && settings.csvDispCount) {
if (sels.length == O.E.find('option').length && settings.captionFormatAllSelected) {
O.placeholder = settings.captionFormatAllSelected.replace(/\{0\}/g, sels.length)+',';
} else {
O.placeholder = settings.captionFormat.replace(/\{0\}/g, sels.length)+',';
}
break;
}
else O.placeholder += $(sels[i]).text() + ", ";
}
O.placeholder = O.placeholder.replace(/,([^,]*)$/, '$1'); //remove unexpected "," from last.
}
else {
O.placeholder = O.E.find(':selected').not(':disabled').text();
}
var is_placeholder = false;
if (!O.placeholder) {
is_placeholder = true;
O.placeholder = O.E.attr('placeholder');
if (!O.placeholder) //if placeholder is there then set it
O.placeholder = O.E.find('option:disabled:selected').text();
}
O.placeholder = O.placeholder ? (settings.prefix + ' ' + O.placeholder) : settings.placeholder
//set display text
O.caption.html(O.placeholder);
if (settings.showTitle) O.CaptionCont.attr('title', O.placeholder);
//set the hidden field if post as csv is true.
var csvField = O.select.find('input.HEMANT123');
if (csvField.length) csvField.val(O.getSelStr());
//add class placeholder if its a placeholder text.
if (is_placeholder) O.caption.addClass('placeholder'); else O.caption.removeClass('placeholder');
return O.placeholder;
},
isMobile: function () {
/* Adapted from http://www.detectmobilebrowsers.com */
var ua = navigator.userAgent || navigator.vendor || window.opera;
/* Checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices */
for (var i = 0; i < settings.nativeOnDevice.length; i++) if (ua.toString().toLowerCase().indexOf(settings.nativeOnDevice[i].toLowerCase()) > 0) return settings.nativeOnDevice[i];
return false;
},
setNativeMobile: function () {
var O = this;
O.E.addClass('SelectClass'); /* .css('height', O.select.outerHeight()); */
O.mob = true;
O.E.change(function () {
O.setText();
});
},
floatingList: function () {
var O = this;
/*called on init and also on resize.*/
/*O.is_floating = true if window width is < specified float width*/
O.is_floating = $(window).width() <= settings.floatWidth;
/*set class isFloating*/
O.optDiv.toggleClass('isFloating', O.is_floating);
/*remove height if not floating*/
if (!O.is_floating) O.optDiv.css('height', '');
/*toggle class according to okCancelInMulti flag only when it is not floating*/
O.optDiv.toggleClass('okCancelInMulti', settings.okCancelInMulti && !O.is_floating);
},
/* HELPERS FOR OUTSIDERS*/
/* validates range of given item operations*/
vRange: function (i) {
var O = this;
var opts = O.E.find('option');
if (opts.length <= i || i < 0) throw "index out of bounds"
return O;
},
/*toggles selection on c as boolean.*/
toggSel: function (c, i) {
var O = this;
var opt;
if (typeof(i) === "number"){
O.vRange(i);
opt = O.E.find('option')[i];
}
else{
opt = O.E.find('option[value="'+i+'"]')[0]||0;
}
if (!opt || opt.disabled)
return;
if(opt.selected != c){
opt.selected = c;
if(!O.mob) $(opt).data('li').toggleClass('selected',c);
O.callChange();
O.setPstate();
O.setText();
O.selAllState();
}
},
/*toggles disabled on c as boolean.*/
toggDis: function (c, i) {
var O = this.vRange(i);
O.E.find('option')[i].disabled = c;
if(c)O.E.find('option')[i].selected = false;
if(!O.mob)O.optDiv.find('ul.options li').eq(i).toggleClass('disabled', c).removeClass('selected');
O.setText();
},
/* toggle disable/enable on complete select control*/
toggSumo: function(val) {
var O = this;
O.enabled = val;
O.select.toggleClass('disabled', val);
if (val) {
O.E.attr('disabled', 'disabled');
O.select.removeAttr('tabindex');
}
else{
O.E.removeAttr('disabled');
O.select.attr('tabindex','0');
}
return O;
},
/* toggles all option on c as boolean.*/
/* set direct=false/0 bypasses okCancelInMulti behaviour.*/
toggSelAll: function (c, direct) {
var O = this;
O.E.find('option:not(:disabled,:hidden)')
.each(function(ix,e){
var is_selected=e.selected,
e = $(e).data('li');
if(e.hasClass('hidden'))return;
if(!!c){
if(!is_selected)e.trigger('click');
}
else{
if(is_selected)e.trigger('click');
}
});
if(!direct){
if(!O.mob && O.selAll)O.selAll.removeClass('partial').toggleClass('selected',!!c);
O.callChange();
O.setText();
O.setPstate();
}
},
/* outside accessibility options
which can be accessed from the element instance.
*/
reload:function(){
var elm = this.unload();
return $(elm).SumoSelect(settings);
},
unload: function () {
var O = this;
O.select.before(O.E);
O.E.show();
if (settings.outputAsCSV && O.is_multi && O.select.find('input.HEMANT123').length) {
O.E.attr('name', O.select.find('input.HEMANT123').attr('name')); /* restore the name; */
}
O.select.remove();
delete selObj.sumo;
return selObj;
},
/* add a new option to select at a given index.*/
add: function (val, txt, i) {
if (typeof val == "undefined") throw "No value to add"
var O = this;
opts=O.E.find('option')
if (typeof txt == "number") { i = txt; txt = val; }
if (typeof txt == "undefined") { txt = val; }
opt = $("").val(val).html(txt);
if (opts.length < i) throw "index out of bounds"
if (typeof i == "undefined" || opts.length == i) { /* add it to the last if given index is last no or no index provides.*/
O.E.append(opt);
if(!O.mob)O.ul.append(O.createLi(opt));
}
else {
opts.eq(i).before(opt);
if(!O.mob)O.ul.find('li.opt').eq(i).before(O.createLi(opt));
}
return selObj;
},
/* removes an item at a given index. */
remove: function (i) {
var O = this.vRange(i);
O.E.find('option').eq(i).remove();
if(!O.mob)O.optDiv.find('ul.options li').eq(i).remove();
O.setText();
},
/* Select an item at a given index.*/
selectItem: function (i) { this.toggSel(true, i); },
/* UnSelect an iten at a given index.*/
unSelectItem: function (i) { this.toggSel(false, i); },
/* Select all items of the select.*/
selectAll: function () { this.toggSelAll(true); },
/* UnSelect all items of the select.*/
unSelectAll: function () { this.toggSelAll(false); },
/* Disable an iten at a given index.*/
disableItem: function (i) { this.toggDis(true, i) },
/* Removes disabled an iten at a given index.*/
enableItem: function (i) { this.toggDis(false, i) },
/* New simple methods as getter and setter are not working fine in ie8-*/
/* variable to check state of control if enabled or disabled.*/
enabled : true,
/* Enables the control*/
enable: function(){return this.toggSumo(false)},
/* Disables the control*/
disable: function(){return this.toggSumo(true)},
init: function () {
var O = this;
O.createElems();
O.setText();
return O
}
};
selObj.sumo.init();
});
return ret.length == 1 ? ret[0] : ret;
};
});;
/*! jQuery Mobile v1.3.2 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */
(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function T(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;di||Math.abs(n.pageY-p)>i,d&&!r&&D("vmousecancel",t,s),D("vmousemove",t,s),M()}function F(e){if(g)return;L();var t=N(e.target),n;D("vmouseup",e,t);if(!d){var r=D("vclick",e,t);r&&r.isDefaultPrevented()&&(n=x(e).changedTouches[0],v.push({touchID:E,x:n.clientX,y:n.clientY}),m=!0)}D("vmouseout",e,t),d=!1,M()}function I(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function q(){}function R(t){var n=t.substr(1);return{setup:function(r,s){I(this)||e.data(this,i,{});var o=e.data(this,i);o[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,P),e(this).bind(n,q),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",H).bind("touchend",F).bind("touchmove",j).bind("scroll",B))},teardown:function(r,s){--l[t],l[t]||b.unbind(n,P),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",H).unbind("touchmove",j).unbind("touchend",F).unbind("scroll",B));var o=e(this),u=e.data(this,i);u&&(u[t]=!1),o.unbind(n,q),I(this)||o.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var U=0;Ue.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])n.coords[0]?"swipeleft":"swiperight")},setup:function(){var t=this,n=e(t);n.bind(u,function(t){function o(t){if(!i)return;s=e.event.special.swipe.stop(t),Math.abs(i.coords[0]-s.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()}var i=e.event.special.swipe.start(t),s;n.bind(f,o).one(a,function(){n.unbind(f,o),i&&s&&e.event.special.swipe.handleSwipe(i,s),i=s=r})})}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)}}})}(e,this)});;
/*mousewheel*/
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
/*custom scrollbar*/
(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("