2011-09-09 14:23:32 +00:00
|
|
|
(function(b,c){var a=0;b.widget("ech.multiselect",{options:{header:true,height:175,minWidth:225,classes:"",checkAllText:"Check all",uncheckAllText:"Uncheck all",noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:"",hide:"",autoOpen:false,multiple:true,position:{}},_create:function(){var g=this.element.hide(),i=this.options;this.speed=b.fx.speeds._default;this._isOpen=false;var f=(this.button=b('<button type="button"><span class="ui-icon ui-icon-triangle-2-n-s"></span></button>')).addClass("ui-multiselect ui-widget ui-state-default ui-corner-all").addClass(i.classes).attr({title:g.attr("title"),"aria-haspopup":true,tabIndex:g.attr("tabIndex")}).insertAfter(g),d=(this.buttonlabel=b("<span />")).html(i.noneSelectedText).appendTo(f),h=(this.menu=b("<div />")).addClass("ui-multiselect-menu ui-widget ui-widget-content ui-corner-all").addClass(i.classes).insertAfter(f),k=(this.header=b("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(h),e=(this.headerLinkContainer=b("<ul />")).addClass("ui-helper-reset").html(function(){if(i.header===true){return'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+i.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+i.uncheckAllText+"</span></a></li>"}else{if(typeof i.header==="string"){return"<li>"+i.header+"</li>"}else{return""}}}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(k),j=(this.checkboxContainer=b("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(h);this._bindEvents();this.refresh(true);if(!i.multiple){h.addClass("ui-multiselect-single")}},_init:function(){if(this.options.header===false){this.header.hide()}if(!this.options.multiple){this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide()}if(this.options.autoOpen){this.open()}if(this.element.is(":disabled")){this.disable()}},refresh:function(i){var f=this.element,h=this.options,g=this.menu,k=this.checkboxContainer,d=[],e=[],j=f.attr("id")||a++;this.element.find("option").each(function(n){var o=b(this),s=this.parentNode,q=this.innerHTML,u=this.title,r=this.value,m=this.id||"ui-multiselect-"+j+"-option-"+n,v=this.disabled,l=this.selected,p=["ui-corner-all"],t;if(s.tagName.toLowerCase()==="optgroup"){t=s.getAttribute("label");if(b.inArray(t,d)===-1){e.push('<li class="ui-multiselect-optgroup-label"><a href="#">'+t+"</a></li>");d.push(t)}}if(v){p.push("ui-state-disabled")}if(l&&!h.multiple){p.push("ui-state-active")}e.push('<li class="'+(v?"ui-multiselect-disabled":"")+'">');e.push('<label for="'+m+'" title="'+u+'" class="'+p.join(" ")+'">');e.push('<input id="'+m+'" name="multiselect_'+j+'" type="'+(h.multiple?"checkbox":"radio")+'" value="'+r+'" title="'+q+'"');if(l){e.push(' checked="checked"');e.push(' aria-selected="true"')}if(v){e.push(' disabled="disabled"');e.push(' aria-disabled="true"')}e.push(" /><span>"+q+"</span></label></li>");if(s.tagName.toLowerCase()==="optgroup"){var w=o.next("option").parent();if(!w.is("optgroup")){e.push('<li class="ui-multiselect-optgroup-last"></li>')}}});k.html(e.join(""));this.labels=g.find("label");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();if(!i){this._trigger("refresh")}},update:function(){var h=this.options,e=this.labels.find("input"),d=e.filter(":checked"),f=d.length,g;if(f===0){g=h.noneSelectedText}else{if(b.isFunction(h.selectedText)){g=h.selectedText.call(this,f,e.length,d.get())}else{if(/\d/.test(h.selectedList)&&h.selectedList>0&&f<=h.selectedList){g=d.map(function(){return this.title}).get().join(", ")}else{g=h.selectedText.replace("#",f).replace("#",e.length)}}}this.buttonlabel.html(g);return g},_bindEvents:function(){var d=this,e=this.button;function f(){d[d._isOpen?"close":"open"]();return false}e.find("span").bind("click.multiselect",f);e.bind({click:f,keypress:function(g){switch(g.w
|
|
|
|
/*
|
|
|
|
jQuery blockUI plugin
|
|
|
|
Version 2.37 (29-JAN-2011)
|
|
|
|
@requires jQuery v1.2.3 or later
|
|
|
|
|
|
|
|
Examples at: http://malsup.com/jquery/block/
|
|
|
|
Copyright (c) 2007-2010 M. Alsup
|
|
|
|
Dual licensed under the MIT and GPL licenses:
|
|
|
|
http://www.opensource.org/licenses/mit-license.php
|
|
|
|
http://www.gnu.org/licenses/gpl.html
|
|
|
|
|
|
|
|
Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
|
|
|
*/
|
2011-09-19 16:53:08 +00:00
|
|
|
(function(i){if(/1\.(0|1|2)\.(0|1|2)/.test(i.fn.jquery)||/^1.1/.test(i.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later! You are using v"+i.fn.jquery);return}i.fn._fadeIn=i.fn.fadeIn;var c=function(){};var j=document.documentMode||0;var e=i.browser.msie&&((i.browser.version<8&&!j)||j<8);var f=i.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!j;i.blockUI=function(p){d(window,p)};i.unblockUI=function(p){h(window,p)};i.growlUI=function(t,r,s,p){var q=i('<div class="growlUI"></div>');if(t){q.append("<h1>"+t+"</h1>")}if(r){q.append("<h2>"+r+"</h2>")}if(s==undefined){s=3000}i.blockUI({message:q,fadeIn:700,fadeOut:1000,centerY:false,timeout:s,showOverlay:false,onUnblock:p,css:i.blockUI.defaults.growlCSS})};i.fn.block=function(p){return this.unblock({fadeOut:0}).each(function(){if(i.css(this,"position")=="static"){this.style.position="relative"}if(i.browser.msie){this.style.zoom=1}d(this,p)})};i.fn.unblock=function(p){return this.each(function(){h(this,p)})};i.blockUI.version=2.37;i.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var b=null;var g=[];function d(r,F){var A=(r==window);var w=F&&F.message!==undefined?F.message:undefined;F=i.extend({},i.blockUI.defaults,F||{});F.overlayCSS=i.extend({},i.blockUI.defaults.overlayCSS,F.overlayCSS||{});var C=i.extend({},i.blockUI.defaults.css,F.css||{});var N=i.extend({},i.blockUI.defaults.themedCSS,F.themedCSS||{});w=w===undefined?F.message:w;if(A&&b){h(window,{fadeOut:0})}if(w&&typeof w!="string"&&(w.parentNode||w.jquery)){var I=w.jquery?w[0]:w;var P={};i(r).data("blockUI.history",P);P.el=I;P.parent=I.parentNode;P.display=I.style.display;P.position=I.style.position;if(P.parent){P.parent.removeChild(I)}}var B=F.baseZ;var M=(i.browser.msie||F.forceIframe)?i('<iframe class="blockUI" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+F.iframeSrc+'"></iframe>'):i('<div class="blockUI" style="display:none"></div>');var L=i('<div class="blockUI blockOverlay" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var K,G;if(F.theme&&A){G='<div class="blockUI '+F.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||" ")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(F.theme){G='<div class="blockUI '+F.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||" ")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(A){G='<div class="blockUI '+F.blockMsgClass+' blockPage" style="z-index:'+B+';display:none;position:fixed"></div>'}else{G='<div class="blockUI '+F.blockMsgClass+' blockElement" style="z-index:'+B+';display:none;position:absolute"></div>'}}}K=i(G);if(w){if(F.theme){K.css(N);K.addClass("ui-widget-content")}else{K.css(C)}}if(!F.applyPlatformOpacityRules||!(i.browser.mozilla&&/Linux/.test(navigator.
|